:root {
  --navy: #16181d;
  --navy-mid: #22252c;
  --navy-soft: #3a3f4a;
  --gold: #d98c0f;
  --gold-dark: #a3590a;
  --gray: #64748b;
  --gray-light: #e5e7eb;
  --gray-pale: #f8f7f4;
  --white: #ffffff;
  --accent: #10b981;
  --danger: #ef4444;
  --warn: #f59e0b;
  --info: #3b82f6;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08);
  --shadow: 0 4px 20px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 250px;
  --topbar-h: 64px;
  --transition: .2s ease;
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-pale);
  color: var(--navy);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: .95rem; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* Layout */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: var(--white);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  z-index: 40;
  transition: transform var(--transition);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .95rem; color: var(--white); flex-shrink: 0;
}
.sidebar-brand .logo-img { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.sidebar-brand .brand-text strong { display: block; font-size: .95rem; font-weight: 700; }
.sidebar-brand .brand-text span { display: block; font-size: .72rem; color: rgba(255,255,255,.55); }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-group { margin-bottom: 2px; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.7); font-size: .9rem; font-weight: 500;
  margin-bottom: 2px; transition: background var(--transition), color var(--transition);
}
.sidebar .nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: var(--white); }
.sidebar .nav-link.active { background: var(--gold); color: var(--white); }
.nav-label { flex: 1; }
.nav-badge {
  min-width: 22px; text-align: center; box-sizing: border-box;
  background: #e5484d; color: var(--white); font-size: .68rem; font-weight: 800;
  line-height: 1; padding: 4px 7px; border-radius: 999px; flex-shrink: 0;
}
.nav-badge[hidden] { display: none; }
.nav-link.active .nav-badge { box-shadow: 0 0 0 1.5px rgba(255,255,255,.85); }
.nav-child-link .nav-badge { min-width: 20px; font-size: .64rem; padding: 3px 6px; }

.nav-children { max-height: 0; overflow: hidden; transition: max-height .25s ease; padding-left: 38px; }
.nav-group.open .nav-children { max-height: 240px; }
.nav-child-link {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: .81rem; font-weight: 500;
  color: rgba(255,255,255,.55); border-radius: 6px; margin-bottom: 1px;
}
.nav-child-link:hover { color: var(--white); background: rgba(255,255,255,.06); }

.sidebar-foot-nav { padding: 10px 12px 0; margin-top: 6px; border-top: 1px solid rgba(255,255,255,.08); }

.sidebar-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot small { color: rgba(255,255,255,.4); font-size: .72rem; }

.main-area { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-light);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 1.05rem; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.hamburger-btn { display: none; }

.admin-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 6px; border-radius: 999px; background: var(--gray-pale);
}
.admin-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem;
}
.admin-chip span { font-size: .85rem; font-weight: 600; }
.logout-btn {
  color: var(--gray); font-size: .82rem; font-weight: 600;
  padding: 6px 10px; border-radius: var(--radius-sm);
}
.logout-btn[hidden] { display: none; }
.logout-btn:hover { background: var(--gray-light); color: var(--navy); }

.page-content { padding: 24px; flex: 1; }

/* Cards / stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--white); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--gray-light);
}
.stat-card .stat-label { font-size: .8rem; color: var(--gray); font-weight: 600; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 1.55rem; font-weight: 800; color: var(--navy); }
.stat-card .stat-sub { font-size: .76rem; color: var(--gray); margin-top: 4px; }
.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.warn .stat-value { color: var(--warn); }
.stat-card.gold .stat-value { color: var(--gold-dark); }
.stat-card.danger .stat-value { color: var(--danger); }

.attention-head { gap: 12px; flex-wrap: wrap; }
.attention-stats { display: flex; gap: 8px; }
.attn-stat-btn {
  display: flex; align-items: baseline; gap: 6px; padding: 7px 13px; border-radius: 999px;
  background: #fef2f2; border: 1px solid #fecaca; transition: all var(--transition);
}
.attn-stat-btn:hover { background: #fee2e2; }
.attn-stat-btn strong { font-size: .95rem; font-weight: 800; color: var(--danger); }
.attn-stat-btn span { font-size: .74rem; font-weight: 600; color: #b91c1c; }

.attention-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gray-pale); cursor: pointer; }
.attention-row:last-child { border-bottom: none; }
.attention-row:hover { background: var(--gray-pale); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: var(--radius-sm); }
.attention-row .a-main { flex: 1; min-width: 0; }
.attention-row .a-code { font-weight: 700; font-size: .87rem; }
.attention-row .a-meta { font-size: .76rem; color: var(--gray); margin-top: 2px; }
.attention-row .a-tags { display: flex; gap: 6px; flex-shrink: 0; }
.attention-row .a-total { font-weight: 700; font-size: .87rem; white-space: nowrap; flex-shrink: 0; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }

.panel {
  background: var(--white); border-radius: var(--radius); border: 1px solid var(--gray-light);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--gray-light);
}
.panel-head h2 { font-size: .98rem; font-weight: 700; }
.panel-body { padding: 20px; }
.panel-link { font-size: .82rem; font-weight: 600; color: var(--gold-dark); }
.panel-link:hover { text-decoration: underline; }

.site-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--gray-pale); }
.site-row:last-child { border-bottom: none; }
.site-row .site-name { font-weight: 600; font-size: .88rem; }
.site-row .site-meta { font-size: .74rem; color: var(--gray); }
.site-row .site-revenue { font-weight: 700; color: var(--gold-dark); font-size: .9rem; }

/* Table */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.data-table th {
  text-align: left; padding: 12px 16px; background: var(--gray-pale);
  color: var(--gray); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .03em;
  white-space: nowrap; border-bottom: 1px solid var(--gray-light);
}
table.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--gray-pale); vertical-align: middle; }
table.data-table tbody tr { cursor: pointer; transition: background var(--transition); }
table.data-table tbody tr:hover { background: var(--gray-pale); }
table.data-table .order-code { font-weight: 700; color: var(--navy); }
table.data-table .cell-muted { color: var(--gray); font-size: .82rem; }
.empty-row td { text-align: center; padding: 40px 16px; color: var(--gray); }

/* status badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #dbeafe; color: #1d4ed8; }
.badge-processing { background: #e0e7ff; color: #4338ca; }
.badge-shipping { background: #ede9fe; color: #6d28d9; }
.badge-completed { background: #d1fae5; color: #047857; }
.badge-cancelled { background: #fee2e2; color: #b91c1c; }
.badge-unpaid { background: #fee2e2; color: #b91c1c; }
.badge-paid { background: #d1fae5; color: #047857; }

.late-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px;
  font-size: .7rem; font-weight: 800; background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
  white-space: nowrap;
}
tr.row-late { box-shadow: inset 3px 0 0 var(--danger); }

.site-tag { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: .72rem; font-weight: 700; background: var(--navy-mid); color: var(--white); }
.site-tag.site-website02 { background: var(--gold-dark); }

/* Filters / forms */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.filter-bar .search-input { flex: 1; min-width: 200px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: .76rem; font-weight: 700; color: var(--gray); }
input[type="text"], input[type="search"], input[type="password"], input[type="date"], input[type="tel"], input[type="email"], select, textarea {
  padding: 9px 12px; border: 1px solid var(--gray-light); border-radius: var(--radius-sm);
  background: var(--white); color: var(--navy); font-size: .87rem; outline: none;
  transition: border-color var(--transition);
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 70px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); font-size: .87rem; font-weight: 700;
  transition: all var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-mid); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-outline { background: var(--white); color: var(--navy); border: 1px solid var(--gray-light); }
.btn-outline:hover { background: var(--gray-pale); }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: #fecaca; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 7px 12px; font-size: .8rem; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--gray-light); font-size: .82rem; color: var(--gray); }
.pagination .page-btns { display: flex; gap: 6px; }
.pagination button { padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--gray-light); font-size: .82rem; font-weight: 600; }
.pagination button:hover:not(:disabled) { background: var(--gray-pale); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* Slide-over */
.overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  opacity: 0; pointer-events: none; transition: opacity var(--transition); z-index: 50;
}
.overlay.open { opacity: 1; pointer-events: auto; }

.slideover {
  position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw;
  background: var(--white); box-shadow: var(--shadow-lg); z-index: 51;
  transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column;
}
.slideover.open { transform: translateX(0); }
.slideover-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--gray-light); }
.slideover-head h3 { font-size: 1.02rem; font-weight: 800; }
.slideover-close { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--gray); }
.slideover-close:hover { background: var(--gray-pale); }
.slideover-body { flex: 1; overflow-y: auto; padding: 22px; }
.slideover-foot { padding: 16px 22px; border-top: 1px solid var(--gray-light); }

.detail-section { margin-bottom: 22px; }
.detail-section h4 { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--gray); margin-bottom: 10px; }
.detail-line { display: flex; justify-content: space-between; gap: 10px; font-size: .87rem; padding: 6px 0; }
.detail-line .k { color: var(--gray); }
.detail-line .v { font-weight: 600; text-align: right; }

.item-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--gray-pale); font-size: .85rem; }
.item-row:last-child { border-bottom: none; }
.item-row .item-name { font-weight: 600; }
.item-row .item-qty { color: var(--gray); font-size: .78rem; }
.item-row .item-total { font-weight: 700; white-space: nowrap; }

.total-line { display: flex; justify-content: space-between; padding-top: 12px; margin-top: 6px; border-top: 2px solid var(--navy); font-weight: 800; font-size: 1rem; }

.history-item { display: flex; gap: 10px; padding: 8px 0; font-size: .82rem; }
.history-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-top: 6px; flex-shrink: 0; }
.history-item .h-status { font-weight: 700; }
.history-item .h-time { color: var(--gray); font-size: .74rem; }
.history-item .h-note { color: var(--gray); font-size: .78rem; margin-top: 2px; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--navy); color: var(--white);
  padding: 13px 18px; border-radius: var(--radius-sm); font-size: .87rem; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 100; opacity: 0; transform: translateY(10px);
  transition: all var(--transition); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--accent); }

/* Notifications */
.notif-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-bottom: 1px solid var(--gray-pale); border-radius: var(--radius-sm); color: inherit; }
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--gray-pale); }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: transparent; }
.notif-row.unread .notif-dot { background: #e5484d; }
.notif-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-title { font-size: .88rem; font-weight: 500; color: var(--navy-soft); }
.notif-row.unread .notif-title { font-weight: 700; color: var(--navy); }
.notif-meta { font-size: .78rem; color: var(--gray); }
.notif-time { font-size: .76rem; color: var(--gray); white-space: nowrap; }

/* Order alerts */
.order-alerts { position: fixed; top: 76px; right: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; width: 320px; max-width: calc(100vw - 32px); }
.order-alert { position: relative; background: var(--white); border-radius: var(--radius); border-left: 4px solid var(--gold); box-shadow: var(--shadow-lg); padding: 14px 16px; animation: order-alert-in .25s ease; }
.order-alert-title { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; color: var(--gold-dark); margin-bottom: 4px; padding-right: 22px; }
.order-alert-code { font-size: 1rem; font-weight: 800; color: var(--navy); }
.order-alert-meta { font-size: .8rem; color: var(--gray); margin: 2px 0 10px; }
.order-alert-close { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 6px; color: var(--gray); font-size: .8rem; }
.order-alert-close:hover { background: var(--gray-light); color: var(--navy); }
@keyframes order-alert-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }

/* Login page */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); background-image: radial-gradient(circle at 20% 20%, rgba(217,140,15,.15), transparent 50%); padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--white); border-radius: var(--radius); padding: 36px 32px; box-shadow: var(--shadow-lg); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 26px; }
.login-brand .logo-mark { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.3rem; color: var(--white); }
.login-brand .logo-img { height: 96px; width: auto; }
.login-brand strong { font-size: 1.1rem; font-weight: 800; }
.login-brand span { font-size: .8rem; color: var(--gray); }
.login-form .field { margin-bottom: 16px; }
.login-form .btn { width: 100%; margin-top: 6px; }
.login-error { background: #fee2e2; color: var(--danger); font-size: .82rem; font-weight: 600; padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 16px; display: none; }
.login-error.show { display: block; }
.login-hint { text-align: center; margin-top: 18px; font-size: .76rem; color: var(--gray); }

/* Settings */
.config-add { display: flex; gap: 8px; margin-bottom: 12px; }
.config-add input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--gray-light); border-radius: var(--radius-sm); font: inherit; font-size: .86rem; }
.config-row { display: flex; align-items: center; gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--gray-pale); }
.config-row:last-child { border-bottom: none; }
.config-row .config-name { flex: 1; min-width: 0; font-size: .88rem; font-weight: 600; }
.config-row .config-name small { font-weight: 500; color: var(--gray); }
.config-row.inactive .config-name { color: var(--gray); }
.site-card { border: 1px solid var(--gray-light); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.site-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.site-card-head strong { font-size: .95rem; }
.key-box { display: flex; align-items: center; gap: 10px; background: var(--gray-pale); border-radius: var(--radius-sm); padding: 10px 12px; font-family: 'Courier New', monospace; font-size: .82rem; word-break: break-all; }
.key-box.full { background: #d1fae5; color: #047857; font-weight: 700; }
.snippet { background: var(--navy); color: #d1fae5; padding: 14px 16px; border-radius: var(--radius-sm); font-family: 'Courier New', monospace; font-size: .78rem; overflow-x: auto; white-space: pre; margin-top: 10px; }

/* Revenue range tabs */
.range-tabs { display: flex; gap: 4px; background: var(--gray-pale); padding: 4px; border-radius: 10px; flex-wrap: wrap; }
.range-tab { padding: 7px 13px; border-radius: 7px; font-size: .8rem; font-weight: 700; color: var(--gray); transition: all var(--transition); }
.range-tab:hover { color: var(--navy); }
.range-tab.active { background: var(--white); color: var(--navy); box-shadow: var(--shadow-sm); }

.revenue-summary { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.revenue-summary .rs-value { font-size: 1.7rem; font-weight: 800; color: var(--navy); }
.revenue-summary .rs-sub { font-size: .8rem; color: var(--gray); }

.delta-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.delta-badge.up { background: #d1fae5; color: #047857; }
.delta-badge.down { background: #fee2e2; color: #b91c1c; }
.delta-badge.flat { background: var(--gray-light); color: var(--gray); }

.revenue-summary { margin-bottom: 14px; }
#revenueChartWrap { position: relative; }
.revenue-svg { display: block; max-width: 100%; }
.revenue-svg .chart-grid { stroke: var(--gray-light); stroke-width: 1; }
.revenue-svg .chart-bar { fill: var(--gold); transition: fill var(--transition); }
.revenue-svg .chart-col:hover .chart-bar { fill: var(--gold-dark); }
.revenue-svg .chart-hit { fill: transparent; }
.revenue-svg .chart-col:hover .chart-hit { fill: rgba(15, 23, 42, .04); }
.revenue-svg .chart-label { fill: var(--gray); font-size: 11px; font-family: inherit; }
.chart-tip { position: absolute; transform: translateX(-50%); background: var(--navy); color: var(--white); border-radius: var(--radius-sm); padding: 7px 11px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); z-index: 5; }
.chart-tip strong { display: block; font-size: .86rem; font-weight: 700; }
.chart-tip span { display: block; font-size: .72rem; color: rgba(255,255,255,.7); }

/* Payment donut */
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { width: 148px; height: 148px; border-radius: 50%; flex-shrink: 0; position: relative; }
.donut::after { content: ''; position: absolute; inset: 17%; background: var(--white); border-radius: 50%; z-index: 1; }
.donut-center { position: absolute; inset: 17%; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 2; text-align: center; }
.donut-center strong { font-size: 1.15rem; font-weight: 800; color: var(--navy); line-height: 1.2; white-space: nowrap; }
.donut-center span { font-size: .7rem; color: var(--gray); }
.legend-list { flex: 1; min-width: 200px; }
.legend-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--gray-pale); }
.legend-row:last-child { border-bottom: none; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-label { flex: 1; min-width: 0; font-size: .84rem; font-weight: 600; }
.legend-label small { display: block; font-size: .72rem; font-weight: 500; color: var(--gray); }
.legend-value { font-size: .76rem; color: var(--gray); white-space: nowrap; text-align: right; }
.legend-value strong { display: block; font-size: .86rem; color: var(--navy); }

/* Top products */
.top-product-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--gray-pale); }
.top-product-row:last-child { border-bottom: none; }
.tp-rank { width: 24px; height: 24px; border-radius: 50%; background: var(--gray-pale); display: flex; align-items: center; justify-content: center; font-size: .74rem; font-weight: 800; color: var(--navy); flex-shrink: 0; }
.tp-info { flex: 1; min-width: 0; }
.tp-name { font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-meta { font-size: .74rem; color: var(--gray); }
.tp-bar-wrap { width: 90px; height: 6px; background: var(--gray-pale); border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.tp-bar { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-dark)); }
.tp-revenue { font-size: .84rem; font-weight: 700; white-space: nowrap; }

/* Responsive */
@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .hamburger-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
  .slideover { width: 100vw; }
  .donut-wrap { justify-content: center; }
  .revenue-summary { flex-direction: column; align-items: flex-start; gap: 4px; }
}
