/* =========================================================
   3 COLOR FURNITURE - ADMIN
   ระบบประเมินราคาเฟอร์นิเจอร์
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Noto Sans Thai", "Sarabun", Arial, sans-serif;
    background: #f6f7f9;
    color: #222;
}

body {
    min-height: 100vh;
}

/* =========================
   LAYOUT
   ========================= */

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    min-width: 250px;
    background: #171717;
    color: #fff;
    min-height: 100vh;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    align-self: flex-start;
}

.main {
    flex: 1;
    min-width: 0;
    padding: 28px;
}

.sidebar h1 {
    font-size: 20px;
    margin: 0 0 8px;
}

.sidebar p {
    color: #aaa;
    font-size: 13px;
    margin: 0 0 25px;
}

/* =========================
   SIDEBAR MENU
   ========================= */

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.nav-menu button {
    width: 100%;
    border: 0;
    background: transparent;
    color: #ddd;
    text-align: left;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
}

.nav-menu button:hover,
.nav-menu button.active {
    background: #3a3a3a;
    color: #fff;
}

/* =========================
   PAGE
   ========================= */

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-header h2 {
    margin: 0;
    font-size: 28px;
    color: #222;
}

.page-header p {
    margin: 7px 0 0;
    color: #777;
    font-size: 14px;
}

/* =========================
   CARDS
   ========================= */

.card,
.panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.04);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 18px;
}

/* =========================
   DASHBOARD
   ========================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    padding: 20px;
}

.stat-card .label {
    color: #777;
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 27px;
    font-weight: 800;
}

/* =========================
   FORM
   ========================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    margin-bottom: 4px;
}

.form-group.full {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 7px;
    color: #333;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d7dbe0;
    border-radius: 9px;
    padding: 11px 13px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    color: #222;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #222;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* =========================
   DIMENSIONS
   ========================= */

.dimension-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.dimension-box {
    position: relative;
}

.dimension-box input {
    padding-right: 45px;
}

.dimension-unit {
    position: absolute;
    right: 13px;
    bottom: 11px;
    color: #888;
    font-size: 13px;
}

/* =========================
   BUTTONS
   ========================= */

button {
    font-family: inherit;
}

.btn {
    border: 0;
    border-radius: 9px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: #222;
    color: #fff;
}

.btn-primary:hover {
    background: #000;
}

.btn-secondary {
    background: #eee;
    color: #333;
}

.btn-success {
    background: #198754;
    color: #fff;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-orange {
    background: #d9822b;
    color: #fff;
}

/* =========================
   PRICE BOX
   ========================= */

.price-box {
    background: #faf7f2;
    border: 1px solid #ead8c2;
    border-radius: 14px;
    padding: 22px;
    margin-top: 20px;
}

.price-box-title {
    font-size: 15px;
    font-weight: 700;
    color: #75400d;
    margin-bottom: 8px;
}

.price-main {
    font-size: 34px;
    font-weight: 900;
    color: #9a560f;
}

.price-detail {
    color: #666;
    font-size: 13px;
    margin-top: 8px;
}

/* =========================
   ITEM LIST
   ========================= */

.item-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}

.item-name {
    font-weight: 700;
}

.item-description {
    color: #777;
    font-size: 13px;
    margin-top: 4px;
}

.item-price {
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
}

/* =========================
   SUMMARY
   ========================= */

.summary-box {
    background: #222;
    color: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-top: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.summary-row:last-child {
    border-bottom: 0;
}

.summary-total {
    font-size: 25px;
    font-weight: 900;
    padding-top: 15px;
}

/* =========================
   TABLE
   ========================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

th {
    background: #f7f7f7;
    font-weight: 700;
}

tr:hover td {
    background: #fafafa;
}

/* =========================
   EMPTY PANEL
   ========================= */

.empty-panel {
    background: #fff;
    border: 1px dashed #ccc;
    border-radius: 15px;
    padding: 50px 25px;
    text-align: center;
    color: #888;
}

/* =========================
   BADGES
   ========================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background: #e7f6ec;
    color: #198754;
}

.badge-warning {
    background: #fff4dc;
    color: #a66a00;
}

.badge-danger {
    background: #fdeaea;
    color: #c62828;
}

/* =========================
   NOTICE
   ========================= */

.notice {
    padding: 13px 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 13px;
}

.notice-info {
    background: #eef5ff;
    color: #24558c;
    border: 1px solid #d6e6ff;
}

.notice-warning {
    background: #fff8e8;
    color: #805b00;
    border: 1px solid #f5e1a8;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 800px) {
    .app {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        min-height: auto;
        position: relative;
    }

    .main {
        padding: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: auto;
    }

    .dimension-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .page-header {
        display: block;
    }

    .page-header h2 {
        font-size: 23px;
    }

    .card,
    .panel {
        padding: 16px;
    }

    .item-row {
        grid-template-columns: 1fr;
    }

    .price-main {
        font-size: 28px;
    }
}