@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── Reset ─────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    font-family: 'Inter', system-ui, sans-serif;
    background: #F9FAFB;
    color: #111827;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* ─── CSS Variables ──────────────────────────────── */
:root {
    --primary:        #F97316;
    --primary-hover:  #EA580C;
    --primary-light:  #FFF7ED;
    --primary-border: #FDBA74;

    --bg:          #FFFFFF;
    --bg-secondary:#F9FAFB;
    --bg-tertiary: #F3F4F6;

    --text:         #111827;
    --text-muted:   #6B7280;
    --text-light:   #9CA3AF;

    --border:       #E5E7EB;
    --border-dark:  #D1D5DB;

    --success:      #16A34A;
    --success-bg:   #DCFCE7;
    --success-text: #15803D;

    --warning:      #D97706;
    --warning-bg:   #FEF9C3;
    --warning-text: #92400E;

    --danger:       #DC2626;
    --danger-bg:    #FEE2E2;
    --danger-text:  #B91C1C;

    --info:         #2563EB;
    --info-bg:      #DBEAFE;
    --info-text:    #1D4ED8;

    --sidebar-w: 240px;
    --navbar-h:  72px;
    --radius:    8px;
    --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.05);
}

/* ─── Utilities ──────────────────────────────────── */
.container  { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.text-center{ text-align: center; }
.mt-4       { margin-top: 1rem; }
.mb-4       { margin-bottom: 1rem; }
.gap-2      { gap: .5rem; }
.gap-4      { gap: 1rem; }
.flex       { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full     { width: 100%; }
.hidden     { display: none; }

/* ─── Buttons ────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, box-shadow .15s, transform .1s;
    line-height: 1.4;
    white-space: nowrap;
}
.btn:active { transform: scale(.98); }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(249,115,22,.3);
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border-color: var(--border-dark);
}
.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { background: #B91C1C; }

.btn-sm { padding: .3rem .7rem; font-size: 12px; }
.btn-icon {
    padding: .4rem;
    width: 34px;
    height: 34px;
    justify-content: center;
}

/* ─── Badges ─────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .6rem;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-success  { background: var(--success-bg);  color: var(--success-text); }
.badge-warning  { background: var(--warning-bg);  color: var(--warning-text); }
.badge-danger   { background: var(--danger-bg);   color: var(--danger-text);  }
.badge-info     { background: var(--info-bg);     color: var(--info-text);    }
.badge-secondary{ background: var(--bg-tertiary); color: var(--text-muted);   }

/* ─── Alerts ─────────────────────────────────────── */
.alert {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: .65rem;
    width: max-content;
    max-width: min(92vw, 420px);
    padding: .75rem 1rem;
    border-radius: 12px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid;
    box-shadow: 0 18px 45px rgba(15,23,42,.16);
    animation: alertFloatIn .26s ease both;
}
.alert i { font-size: 15px; flex-shrink: 0; }
.alert.hide { animation: alertFloatOut .24s ease both; }
.alert-success { background: #DCFCE7; color: #166534; border-color: #86EFAC; }
.alert-warning { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.alert-danger  { background: #FEE2E2; color: #991B1B; border-color: #FCA5A5; }
.alert-info    { background: #DBEAFE; color: #1E40AF; border-color: #93C5FD; }
@keyframes alertFloatIn { from { opacity:0; transform:translate(-50%, -12px) scale(.96); } to { opacity:1; transform:translate(-50%, 0) scale(1); } }
@keyframes alertFloatOut { to { opacity:0; transform:translate(-50%, -12px) scale(.96); } }

/* ─── Card ───────────────────────────────────────── */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

/* ─── Navbar ─────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-h);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    box-shadow: var(--shadow);
}
.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 1.25rem;
}
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -.5px;
}
.navbar-brand img {
    width: 48px !important;
    height: 48px !important;
    object-fit: contain;
    border-radius: 12px;
    filter: drop-shadow(0 6px 12px rgba(249,115,22,.18));
}
.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.navbar-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--text-muted);
    font-size: 13px;
}
.role-badge {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-border);
    padding: .2rem .6rem;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.cart-link {
    position: relative;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 20px;
    line-height: 1;
}
.cart-badge {
    position: absolute;
    top: -6px; right: -8px;
    background: var(--primary);
    color: #fff;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text);
    padding: .25rem;
}

/* ─── Sidebar ────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--navbar-h));
    background: var(--bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: .75rem 0;
    z-index: 90;
}
.sidebar-menu { list-style: none; }
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}
.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
}
.sidebar-menu a i { font-size: 16px; width: 18px; text-align: center; }

/* Sidebar group (collapsible section) */
.sidebar-group { list-style: none; }
.sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: .55rem 1.25rem;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    transition: background .15s, color .15s;
    text-align: left;
}
.sidebar-group-toggle:hover { background: var(--bg-secondary); color: var(--text); }
.sidebar-group-toggle span { display: flex; align-items: center; gap: .5rem; }
.sidebar-group-toggle span i { font-size: 15px; width: 18px; text-align: center; }
.sidebar-chevron { font-size: 12px; transition: transform .2s; flex-shrink: 0; }
.sidebar-group.open .sidebar-chevron { transform: rotate(180deg); }
.sidebar-group-items {
    list-style: none;
    display: none;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.sidebar-group.open .sidebar-group-items { display: block; }
.sidebar-group-items a {
    padding-left: 2.5rem;
    font-size: 13px;
}
.sidebar-section-divider {
    height: 1px;
    background: var(--border);
    margin: .4rem 1rem;
}

/* Form validation states */
.form-control.is-invalid  { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important; }
.form-control.is-valid    { border-color: var(--success) !important; box-shadow: 0 0 0 3px rgba(22,163,74,.12) !important; }
.form-error { color: var(--danger); font-size: 12px; margin-top: 3px; display: none; }
.form-error.show { display: block; }

/* Stock status badges */
.badge-in-stock  { background: #DCFCE7; color: #15803D; }
.badge-low-stock { background: #FEF9C3; color: #92400E; }
.badge-out-stock { background: #FEE2E2; color: #B91C1C; }

/* Analytics metric card */
.metric-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    animation: fadeUp .45s ease both;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.metric-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary-border); }
.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.metric-card.orange::before { background: #F97316; }
.metric-card.green::before  { background: #16A34A; }
.metric-card.blue::before   { background: #2563EB; }
.metric-card.purple::before { background: #7C3AED; }
.metric-card.red::before    { background: #DC2626; }
.metric-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.metric-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1.1; margin: .35rem 0 .2rem; }
.metric-sub   { font-size: 12px; color: var(--text-muted); }
.metric-trend { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: .2rem; padding: .15rem .45rem; border-radius: 9999px; }
.metric-trend.up   { color: #15803D; background: #DCFCE7; }
.metric-trend.down { color: #B91C1C; background: #FEE2E2; }

/* Tab system */
.tab-nav { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; }
.tab-btn {
    padding: .6rem 1.25rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ─── Main layout ────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    margin-top: var(--navbar-h);
    padding: 1.75rem;
    min-height: calc(100vh - var(--navbar-h));
}

/* ─── Page header ────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}
.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}
.page-header p { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* ─── Section header ─────────────────────────────── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}
.section-header h2  { font-size: 16px; font-weight: 700; color: var(--text); }
.section-header .action-link {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

/* ─── Dashboard grid ─────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: box-shadow .2s;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--primary);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon  { font-size: 28px; margin-bottom: .5rem; color: var(--primary); }
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .25rem; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: .25rem; }
.stat-change{ font-size: 12px; color: var(--text-muted); }

/* ─── Tables ─────────────────────────────────────── */
.table-container {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}
thead th {
    background: var(--bg-secondary);
    padding: .65rem .75rem;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .35px;
    border-bottom: 1px solid var(--border);
    white-space: normal;
    line-height: 1.25;
}
thead th a {
    white-space: normal;
    flex-wrap: wrap;
}
tbody td {
    padding: .65rem .75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-secondary); }
thead th:last-child,
tbody td:last-child {
    text-align: right;
    white-space: normal;
}
tbody td:last-child .btn,
tbody td:last-child a.btn,
tbody td:last-child button.btn {
    white-space: nowrap;
}
.payments-table {
    table-layout: fixed;
}
.payments-table th,
.payments-table td {
    font-size: 12px;
}
.payments-table th:nth-child(1),
.payments-table td:nth-child(1) {
    width: 8%;
}
.payments-table th:nth-child(2),
.payments-table td:nth-child(2) {
    width: 16%;
}
.payments-table th:nth-child(3),
.payments-table td:nth-child(3) {
    width: 9%;
}
.payments-table th:nth-child(4),
.payments-table td:nth-child(4),
.payments-table th:nth-child(5),
.payments-table td:nth-child(5),
.payments-table th:nth-child(6),
.payments-table td:nth-child(6) {
    width: 10%;
}
.payments-table th:nth-child(7),
.payments-table td:nth-child(7) {
    width: 10%;
}
.payments-table th:nth-child(8),
.payments-table td:nth-child(8) {
    width: 9%;
}
.payments-table th:nth-child(9),
.payments-table td:nth-child(9) {
    width: 18%;
}
.payments-table td:last-child > div {
    justify-content: flex-end;
}
@media (max-width: 1200px) {
    thead th,
    tbody td {
        padding: .55rem .5rem;
        font-size: 12px;
    }
    thead th {
        font-size: 10px;
    }
    tbody td:last-child > div {
        justify-content: flex-end;
    }
}
@media (max-width: 900px) {
    .table-container table,
    .table-container thead,
    .table-container tbody,
    .table-container th,
    .table-container td,
    .table-container tr {
        display: block;
    }
    .table-container thead {
        display: none;
    }
    .table-container tr {
        border-bottom: 1px solid var(--border);
        padding: .75rem;
    }
    .table-container tbody td {
        border-bottom: none;
        padding: .35rem 0;
    }
    .table-container tbody td:last-child {
        text-align: left;
        padding-top: .75rem;
    }
    .table-container tbody td:last-child > div {
        justify-content: flex-start;
    }
}

/* ─── Forms ──────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    margin-bottom: .35rem;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 90px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select, textarea {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}
select { cursor: pointer; }

/* ─── Modals ─────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal.active { display: flex; }
.modal-content {
    background: var(--bg);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    border: 1px solid var(--border);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: .875rem;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    padding: .1rem;
    line-height: 1;
    transition: color .15s;
}
.modal-close:hover { color: var(--danger); }

/* ─── Charts ─────────────────────────────────────── */
.chart-container {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    animation: fadeUp .5s ease both;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.chart-container:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-border); }
.chart-container h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 1rem; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.chart-legend-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .55rem;
    border-radius: 9999px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}
.chart-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 9999px;
    display: inline-block;
}

/* ─── Products grid ──────────────────────────────── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
}
.product-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow .2s, transform .2s;
    cursor: pointer;
}
.product-card:hover { box-shadow: 0 8px 20px rgba(249,115,22,.12); transform: translateY(-3px); }
.product-img {
    height: 200px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: .875rem; }
.product-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: .25rem; }
.product-price { font-size: 18px; font-weight: 800; color: var(--primary); }

/* ─── Search / filter bar ────────────────────────── */
.filter-bar {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: var(--shadow);
}
.search-box {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex: 1;
    min-width: 180px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    padding: .4rem .75rem;
    background: var(--bg);
}
.search-box i { color: var(--text-muted); }
.search-box input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 14px;
    color: var(--text);
    background: transparent;
    width: auto;
    padding: 0;
    box-shadow: none;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249,115,22,.15); }

/* ─── Pagination ─────────────────────────────────── */
.pagination { display: flex; gap: .35rem; justify-content: center; margin-top: 1.25rem; flex-wrap: wrap; }
.page-btn {
    padding: .4rem .7rem;
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.page-btn:hover, .page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ─── Order timeline ─────────────────────────────── */
.order-timeline {
    display: flex;
    gap: 0;
    align-items: center;
    padding: .75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow-x: auto;
}
.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 60px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    gap: 4px;
}
.timeline-step .dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--border-dark);
}
.timeline-step.done .dot { background: var(--primary); }
.timeline-step.done { color: var(--primary); }

/* ─── Tabs ───────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; gap: 0; }
.tab-btn {
    padding: .6rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover  { color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ─── Address card ───────────────────────────────── */
.address-card {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: border-color .15s;
}
.address-card.default-addr { border-color: var(--primary); }

/* ─── Low-stock banner ───────────────────────────── */
.low-stock-banner {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid #FDE68A;
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 13px;
    font-weight: 500;
}
.low-stock-banner a { color: var(--warning); font-weight: 700; }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }

    .sidebar {
        left: -240px;
        width: 240px;
        transition: left .25s;
        z-index: 150;
    }
    .sidebar.open { left: 0; box-shadow: 4px 0 20px rgba(0,0,0,.12); }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .menu-toggle { display: flex; }

    .dashboard-grid { grid-template-columns: 1fr 1fr; }

    .page-header { flex-direction: column; align-items: flex-start; }

    .filter-bar { flex-direction: column; }
    .search-box { width: 100%; }

    table { font-size: 12px; }
    th, td { padding: .55rem .75rem; }

    .stat-value { font-size: 22px; }

    .chart-container { padding: 1rem; }

    .two-col { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    .main-content { padding: .75rem; }
    .navbar-container { padding: 0 .875rem; }
    .stat-value { font-size: 20px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .modal-content { padding: 1rem; }
}

/* ─── Overlay (mobile sidebar) ───────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 140;
}
.sidebar-overlay.active { display: block; }

/* ─── Misc helpers ───────────────────────────────── */
.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.sticky-sidebar { position: sticky; top: calc(var(--navbar-h) + 1.5rem); }

.text-primary  { color: var(--primary) !important; }
.text-muted    { color: var(--text-muted) !important; }
.text-success  { color: var(--success) !important; }
.text-danger   { color: var(--danger) !important; }
.text-warning  { color: var(--warning) !important; }
.bg-light      { background: var(--bg-secondary); }
.rounded       { border-radius: var(--radius); }
.border        { border: 1px solid var(--border); }
.shadow        { box-shadow: var(--shadow); }
small, .small  { font-size: 12px; color: var(--text-muted); }
strong         { font-weight: 700; }

/* Print */
@media print {
    .sidebar, .navbar, .no-print { display: none !important; }
    .main-content { margin: 0; padding: 0; }
    body { background: #fff; color: #000; }
}
