*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

:root {
    --bg: #F5F7FA;
    --on-bg: #0F1117;
    --surface: #ECEEF2;
    --surface-soft: #E4E6EB;
    --surface-elevated: #FFFFFF;
    --on-surface: #1A1D27;
    --on-surface-muted: #6B7280;
    --outline: #E5E7EB;
    --outline-strong: #D1D5DB;
    --primary: #F97316;
    --primary-strong: #EA6C0E;
    --primary-warm: #FDBA74;
    --primary-focus: #F97316;
    --primary-dim: rgba(249, 115, 22, 0.10);
    --on-primary: #FFFFFF;
    --shell-bg: #FFFFFF;
    --shell-surface: #F8FAFC;
    --shell-border: #E2E8F0;
    --on-shell: #0F1117;
    --on-shell-muted: #64748B;
    --shell-hover: rgba(15, 17, 23, 0.05);
    --shell-active-bg: rgba(249, 115, 22, 0.08);
    --success: #10B981;
    --success-dim: rgba(16, 185, 129, 0.10);
    --warning: #F59E0B;
    --warning-dim: rgba(245, 158, 11, 0.10);
    --danger: #EF4444;
    --danger-dim: rgba(239, 68, 68, 0.10);
    --info: #3B82F6;
    --info-dim: rgba(59, 130, 246, 0.10);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.06);
    --font: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --sidebar-w: 260px;
    --header-h: 60px;
}

html.dark {
    --bg: #0F1117;
    --on-bg: #F9FAFB;
    --surface: #161922;
    --surface-soft: #1D2030;
    --surface-elevated: #1D2030;
    --on-surface: #F3F4F6;
    --on-surface-muted: #9CA3AF;
    --outline: #252836;
    --outline-strong: #2E3347;
    --shell-bg: #080A10;
    --shell-surface: #0D0F18;
    --shell-border: rgba(255, 255, 255, 0.07);
    --on-shell: #F9FAFB;
    --on-shell-muted: rgba(249, 250, 251, 0.45);
    --shell-hover: rgba(255, 255, 255, 0.05);
    --shell-active-bg: rgba(249, 115, 22, 0.12);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.30), 0 2px 6px rgba(0, 0, 0, 0.20);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.40), 0 4px 12px rgba(0, 0, 0, 0.25);
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--on-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--outline-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--on-surface-muted); }

/* ===== SHELL HEADER ===== */
.shell-header {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--header-h);
    background: var(--shell-bg);
    border-bottom: 1px solid var(--shell-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    color: var(--on-shell);
}

.shell-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.shell-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--on-shell);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--primary);
    border-radius: 7px;
    flex-shrink: 0;
}

.brand-mark svg {
    width: 16px;
    height: 16px;
    color: #fff;
    stroke-width: 2.5;
}

.brand-text {
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--on-shell);
    white-space: nowrap;
}

.shell-divider {
    width: 1px;
    height: 20px;
    background: var(--shell-border);
    flex-shrink: 0;
}

.shell-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.shell-search-wrap svg {
    position: absolute;
    left: 10px;
    width: 14px;
    height: 14px;
    color: var(--on-shell-muted);
    pointer-events: none;
}

.shell-search {
    background: var(--surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--radius-sm);
    height: 34px;
    padding: 0 12px 0 32px;
    color: var(--on-shell);
    font-size: 0.8125rem;
    font-family: var(--font);
    outline: none;
    width: 220px;
    transition: all 180ms;
}

.shell-search::placeholder {
    color: var(--on-shell-muted);
}

.shell-search:focus {
    background: var(--surface-elevated);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
    width: 260px;
}

.shell-icon-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--on-shell-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms;
    flex-shrink: 0;
}

.shell-icon-btn svg {
    width: 16px;
    height: 16px;
}

.shell-icon-btn:hover {
    background: var(--shell-hover);
    color: var(--on-shell);
}

.shell-icon-btn:active {
    transform: scale(0.92);
}

.shell-date {
    font-size: 0.75rem;
    color: var(--on-shell-muted);
    font-weight: 500;
    white-space: nowrap;
    padding: 0 4px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 6px;
    background: var(--shell-hover);
    border: 1px solid var(--shell-border);
    border-radius: 100px;
    cursor: default;
}

.user-badge .avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6875rem;
    background: var(--primary);
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0;
}

.user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--on-shell);
    line-height: 1.2;
}

.role-tag {
    font-size: 0.6875rem;
    color: var(--on-shell-muted);
    font-weight: 500;
    line-height: 1;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--shell-border);
    background: transparent;
    color: var(--on-shell-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 150ms;
    white-space: nowrap;
}

.btn-logout svg {
    width: 13px;
    height: 13px;
}

.btn-logout:hover {
    background: var(--danger-dim);
    border-color: var(--danger);
    color: var(--danger);
}

.btn-logout:active { transform: scale(0.96); }

/* ===== SHELL SIDEBAR ===== */
.shell-layout {
    display: flex;
    min-height: calc(100vh - var(--header-h));
}

.shell-sidebar {
    position: sticky;
    top: var(--header-h);
    z-index: 150;
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--shell-bg);
    border-right: 1px solid var(--shell-border);
    box-shadow: 1px 0 3px rgba(0,0,0,0.04);
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
}

.sidebar-section-label {
    font-size: 0.6375rem;
    font-weight: 700;
    color: var(--on-shell-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 14px 10px 5px;
    opacity: 0.5;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--on-shell-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    text-align: left;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    position: relative;
}

.nav-item .nav-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    flex-shrink: 0;
    transition: all 150ms;
}

.nav-item .nav-icon svg {
    width: 15px;
    height: 15px;
    stroke-width: 1.75;
    color: inherit;
}

.nav-item:hover {
    background: var(--shell-hover);
    color: var(--on-shell);
}

.nav-item:hover .nav-icon {
    background: var(--shell-hover);
}

.nav-item.active {
    background: var(--shell-active-bg);
    color: var(--primary);
}

.nav-item.active .nav-icon {
    background: var(--primary-dim);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 2.5px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

/* ===== MAIN CONTENT ===== */
.main {
    flex: 1;
    min-width: 0;
    padding: 28px 32px;
}

/* Page header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.03em;
    color: var(--on-bg);
}

.page-sub {
    font-size: 0.8125rem;
    color: var(--on-surface-muted);
    font-weight: 400;
    margin-top: 3px;
}

/* Primary button */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--font);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 150ms;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn-primary svg {
    width: 14px;
    height: 14px;
}

.btn-primary:hover {
    background: var(--primary-strong);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.30);
    transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); box-shadow: none; }

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--surface-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--outline);
    box-shadow: var(--shadow-xs);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--on-surface-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.filter-group select {
    height: 34px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--outline);
    background: var(--surface-elevated);
    color: var(--on-surface);
    font-size: 0.8125rem;
    font-family: var(--font);
    outline: none;
    cursor: pointer;
    min-width: 130px;
    transition: border-color 150ms;
    font-weight: 500;
}

.filter-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

/* Section headline */
.section-headline {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--on-bg);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.section-headline-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--primary-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-headline-icon svg {
    width: 14px;
    height: 14px;
    color: var(--primary);
    stroke-width: 2;
}

/* ===== KPI CARDS ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--outline);
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2.5px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--outline);
    transition: background 200ms;
}

.kpi-card.orange::after { background: var(--primary); }
.kpi-card.green::after  { background: var(--success); }
.kpi-card.amber::after  { background: var(--warning); }
.kpi-card.blue::after   { background: var(--info); }
.kpi-card.red::after    { background: var(--danger); }

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--outline-strong);
}

.kpi-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon svg {
    width: 17px;
    height: 17px;
    stroke-width: 1.75;
}

.kpi-icon.orange { background: var(--primary-dim); color: var(--primary); }
.kpi-icon.green  { background: var(--success-dim); color: var(--success); }
.kpi-icon.amber  { background: var(--warning-dim); color: var(--warning); }
.kpi-icon.blue   { background: var(--info-dim);    color: var(--info);    }
.kpi-icon.red    { background: var(--danger-dim);  color: var(--danger);  }
.kpi-icon.neutral{ background: var(--surface);     color: var(--on-surface-muted); }

.kpi-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--on-surface-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--on-bg);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.kpi-sub {
    font-size: 0.75rem;
    color: var(--on-surface-muted);
    margin-top: 5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-sub .up   { color: var(--success); font-weight: 700; }
.kpi-sub .down { color: var(--danger);  font-weight: 700; }

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.grid-full { grid-template-columns: 1fr; }

/* Card panel */
.card {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--outline);
    transition: box-shadow 200ms;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--on-bg);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.card-title-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-title-icon svg {
    width: 13px;
    height: 13px;
    color: var(--on-surface-muted);
    stroke-width: 2;
}

.card-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 100px;
    background: var(--surface);
    color: var(--on-surface-muted);
    letter-spacing: 0.02em;
}

/* Chart */
.chart-box {
    position: relative;
    height: 260px;
    width: 100%;
}

.chart-box-sm {
    position: relative;
    height: 200px;
    width: 100%;
}

.chart-box-lg {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Table */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

thead th {
    background: var(--surface);
    color: var(--on-surface-muted);
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
    height: 42px;
    padding: 0 14px;
    border-bottom: 1px solid var(--outline);
    white-space: nowrap;
}

thead th:first-child { border-radius: 8px 0 0 0; }
thead th:last-child  { border-radius: 0 8px 0 0; }

tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--outline);
    color: var(--on-surface-muted);
    font-size: 0.8125rem;
}

tbody tr:hover td { background: var(--primary-dim); }
tbody tr:last-child td { border-bottom: none; }
td strong { color: var(--on-bg); font-weight: 600; }

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
}

.badge-orange  { background: var(--primary-dim); color: var(--primary); }
.badge-neutral { background: var(--surface);     color: var(--on-surface-muted); }
.badge-green   { background: var(--success-dim); color: var(--success); }
.badge-blue    { background: var(--info-dim);    color: var(--info); }
.badge-red     { background: var(--danger-dim);  color: var(--danger); }

.rank-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75rem;
    background: var(--surface);
    color: var(--on-surface-muted);
    flex-shrink: 0;
}

.rank-1 { background: var(--primary); color: #fff; }
.rank-2 { background: var(--outline-strong); color: var(--on-surface-muted); }
.rank-3 { background: var(--primary-dim);    color: var(--primary); }

/* Product row */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    transition: all 150ms;
}

.product-row:hover { background: var(--surface-soft); }

.product-row .info {
    flex: 1;
    min-width: 0;
}

.product-row .name {
    font-weight: 600;
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--on-bg);
}

.product-row .bar-wrap {
    height: 3px;
    background: var(--outline);
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.product-row .bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--primary);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-row .bar-fill.amber { background: var(--warning); }
.product-row .bar-fill.blue  { background: var(--info);    }
.product-row .bar-fill.green { background: var(--success); }

.product-row .value {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--on-bg);
    white-space: nowrap;
}

/* Slow moving */
.slow-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--danger-dim);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--danger);
    margin-bottom: 6px;
}

.slow-item .name   { font-weight: 600; font-size: 0.8125rem; }
.slow-item .detail { font-size: 0.75rem; color: var(--on-surface-muted); margin-top: 2px; }
.slow-item .stock-val { font-weight: 700; font-size: 0.9375rem; color: var(--danger); }

/* Customer row */
.cust-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--outline);
    transition: background 150ms;
    border-radius: 0;
}

.cust-row:last-child { border-bottom: none; }
.cust-row:hover { background: var(--surface); border-radius: var(--radius-sm); }

.cust-row .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8125rem;
    background: var(--surface-soft);
    color: var(--on-surface-muted);
    flex-shrink: 0;
}

.cust-row .avatar.gold   { background: var(--primary); color: #fff; }
.cust-row .avatar.silver { background: var(--outline-strong); color: #fff; }
.cust-row .avatar.bronze { background: var(--primary-dim); color: var(--primary); }

.cust-row .info  { flex: 1; min-width: 0; }
.cust-row .name  { font-weight: 600; font-size: 0.8125rem; }
.cust-row .sub   { font-size: 0.75rem; color: var(--on-surface-muted); }
.cust-row .amount{ font-weight: 700; font-size: 0.8125rem; color: var(--on-bg); white-space: nowrap; }

/* Stat grid */
.stat-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat-box {
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    text-align: center;
}

.stat-box .label {
    font-size: 0.6375rem;
    font-weight: 600;
    color: var(--on-surface-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.stat-box .value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--on-bg);
    margin-top: 3px;
    letter-spacing: -0.03em;
}

.stat-box .value.orange { color: var(--primary); }
.stat-box .value.green  { color: var(--success); }
.stat-box .value.blue   { color: var(--info);    }

/* Filter tags */
.filter-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.filter-tag {
    padding: 4px 11px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--outline);
    background: transparent;
    color: var(--on-surface-muted);
    font-family: var(--font);
    transition: all 150ms;
}

.filter-tag.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.filter-tag:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
}

/* Marketplace cards */
.mkp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.mkp-card {
    border-radius: var(--radius-lg);
    padding: 22px;
    transition: all 200ms;
    position: relative;
    overflow: hidden;
}

.mkp-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.mkp-card.shopee    { background: linear-gradient(135deg, #EE4D2D 0%, #FF7043 100%); color: white; }
.mkp-card.tokopedia { background: linear-gradient(135deg, #00AA5B 0%, #41C783 100%); color: white; }

.mkp-card .mkp-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.mkp-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.mkp-stat {
    padding: 9px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.mkp-stat .label {
    font-size: 0.6375rem;
    opacity: 0.80;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mkp-stat .value {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-top: 2px;
}

/* Inventory */
.inv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.inv-card {
    background: var(--surface-elevated);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--outline);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 150ms;
}

.inv-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2.5px;
    background: var(--outline-strong);
}

.inv-card.low::after  { background: var(--warning); }
.inv-card.out::after  { background: var(--danger);  }

.inv-card .name       { font-size: 0.75rem; font-weight: 600; margin-bottom: 6px; color: var(--on-bg); }
.inv-card .stock-num  { font-size: 1.25rem; font-weight: 800; color: var(--on-bg); letter-spacing: -0.03em; }
.inv-card .status-label { font-size: 0.6375rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; margin-top: 4px; color: var(--on-surface-muted); }
.inv-card.low .status-label { color: var(--warning); }
.inv-card.out .stock-num    { color: var(--danger);  }
.inv-card.out .status-label { color: var(--danger);  }

/* ===== TREND MINI SPARK ===== */
.kpi-sparkline {
    margin-top: 10px;
    height: 36px;
    width: 100%;
}

/* ===== CHART CONTAINER ===== */
.chart-section {
    margin-bottom: 16px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--on-surface-muted);
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== SUMMARY STAT ROW ===== */
.summary-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.summary-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--on-surface-muted);
}

.summary-meta-item strong {
    color: var(--on-bg);
    font-weight: 700;
}

.summary-meta-sep {
    width: 1px;
    height: 14px;
    background: var(--outline-strong);
    flex-shrink: 0;
}

/* ===== LOGIN OVERLAY — SPLIT 2 KOLOM ===== */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: stretch;
}

.login-overlay.hidden { display: none; }

/* Panel Kiri — Branding */
.login-panel-left {
    width: 45%;
    flex-shrink: 0;
    background: linear-gradient(145deg, #EA580C 0%, #F97316 40%, #FB923C 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 44px;
    position: relative;
    overflow: hidden;
}

.login-panel-left::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 320px;
    height: 320px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
}

.login-panel-left::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 240px;
    height: 240px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.login-panel-content {
    position: relative;
    z-index: 1;
}

.login-brand-mark {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.18);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.25);
}

.login-brand-mark svg {
    width: 24px;
    height: 24px;
    color: #fff;
    stroke-width: 2;
}

.login-panel-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: rgba(255,255,255,0.90);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
    backdrop-filter: blur(4px);
}

.login-panel-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.04em;
    margin-bottom: 16px;
}

.login-panel-sub {
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.65;
    max-width: 300px;
    margin-bottom: 36px;
    font-weight: 400;
}

.login-panel-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.90);
    font-size: 0.875rem;
    font-weight: 500;
}

.login-feature-icon {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.2);
}

.login-feature-icon svg {
    width: 15px;
    height: 15px;
    color: #fff;
    stroke-width: 1.75;
}

.login-panel-footer {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    font-weight: 500;
}

/* Panel Kanan — Form */
.login-panel-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 40px 24px;
    overflow-y: auto;
}

.login-form-wrap {
    width: 100%;
    max-width: 380px;
}

.login-form-header {
    margin-bottom: 32px;
}

.login-form-logo {
    margin-bottom: 20px;
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.03em;
}

.login-form-header h2 {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--on-bg);
    letter-spacing: -0.04em;
    margin-bottom: 4px;
}

.login-form-sub {
    font-size: 0.875rem;
    color: var(--on-surface-muted);
    font-weight: 400;
}

/* Input fields */
.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.login-field label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--on-surface-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrap svg {
    position: absolute;
    left: 13px;
    width: 15px;
    height: 15px;
    color: var(--on-surface-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.login-input-wrap input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 40px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--outline);
    background: var(--surface-elevated);
    color: var(--on-surface);
    font-size: 0.9375rem;
    font-family: var(--font);
    outline: none;
    transition: all 180ms;
}

.login-input-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

.login-input-wrap input::placeholder {
    color: var(--outline-strong);
}

.login-error {
    font-size: 0.8125rem;
    color: var(--danger);
    margin-bottom: 14px;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    background: var(--danger-dim);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--danger);
}

.login-error.show { display: flex; }

.login-btn {
    width: 100%;
    height: 48px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    font-family: var(--font);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 150ms;
    margin-top: 6px;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn:hover {
    background: var(--primary-strong);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.30);
}

.login-btn:active { transform: translateY(0); box-shadow: none; }

.login-role-info {
    margin-top: 20px;
    padding: 13px 15px;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--outline);
    font-size: 0.75rem;
    color: var(--on-surface-muted);
    line-height: 1.75;
}

.login-role-info strong { color: var(--on-bg); }

.login-role-info code {
    font-family: var(--mono);
    background: var(--surface-soft);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--primary);
}

/* Dark mode overrides */
html.dark .login-panel-right { background: var(--bg); }
html.dark .login-input-wrap input { background: var(--surface-soft); }

/* Responsive login */
@media (max-width: 860px) {
    .login-panel-left { display: none; }
    .login-panel-right { justify-content: center; }
}

@media (max-width: 480px) {
    .login-panel-right { padding: 28px 20px; }
    .login-form-wrap { max-width: 100%; }
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 150ms ease;
    backdrop-filter: blur(2px);
}

.modal-card {
    background: var(--surface-elevated);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    margin: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--outline);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--on-bg);
    letter-spacing: -0.02em;
}

.modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--surface);
    color: var(--on-surface-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms;
}

.modal-close:hover { background: var(--surface-soft); color: var(--on-surface); }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 24px 20px;
}

.modal-select {
    height: 42px;
    padding: 0 13px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--outline);
    background: var(--surface);
    color: var(--on-surface);
    font-size: 0.9375rem;
    font-family: var(--font);
    outline: none;
    cursor: pointer;
    width: 100%;
    transition: border-color 150ms;
}

.modal-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--outline);
    background: var(--surface);
    color: var(--on-surface);
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--font);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 150ms;
}

.btn-secondary:hover { background: var(--surface-soft); border-color: var(--outline-strong); }

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 12px;
    border: none;
    background: var(--danger-dim);
    color: var(--danger);
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--font);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 150ms;
}

.btn-danger:hover { background: var(--danger); color: white; }

.btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 12px;
    border: none;
    background: var(--primary-dim);
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--font);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 150ms;
}

.btn-edit:hover { background: var(--primary); color: white; }

.action-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--on-surface-muted);
    font-size: 0.875rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .shell-sidebar { width: 56px; padding: 10px 6px; }
    .shell-sidebar .nav-item span:not(.nav-icon) { display: none; }
    .shell-sidebar .sidebar-section-label { display: none; }
    .shell-sidebar .nav-item { justify-content: center; padding: 8px; }
    .shell-sidebar .nav-item::before { display: none; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .mkp-grid { grid-template-columns: 1fr; }
    .main { padding: 20px; }
}

@media (max-width: 768px) {
    .grid-3 { grid-template-columns: 1fr; }
    .stat-grid-2 { grid-template-columns: 1fr; }
    .shell-sidebar { display: none; }
    .main { padding: 16px; }
    .shell-search { width: 130px; }
    .shell-search:focus { width: 160px; }
    .brand-text { display: none; }
    .shell-date { display: none; }
}

@media (max-width: 640px) {
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .kpi-value { font-size: 1.375rem; }
    .page-title { font-size: 1.125rem; }
    .filter-bar { flex-direction: column; }
    .filter-group select { min-width: 100%; }
    .login-card-inner { padding: 26px 22px 22px; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
