/* ============================================================
   KASTOKO POS - Professional Theme
   Navy + Emerald + Plus Jakarta Sans
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  /* Brand Colors */
  --navy: #0f172a;
  --navy-2: #1e293b;
  --navy-3: #334155;
  --emerald: #10b981;
  --emerald-dark: #059669;
  --emerald-light: #d1fae5;
  --amber: #f59e0b;
  --amber-light: #fef3c7;
  --red: #ef4444;
  --red-light: #fee2e2;
  --blue: #3b82f6;
  --blue-light: #dbeafe;

  /* Neutrals */
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  /* Sizes */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .14);
}

html, body {
  height: 100%;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

input, textarea, select { -webkit-user-select: text !important; user-select: text !important; }

body { display: flex; flex-direction: column; min-height: 100vh; max-width: 100vw; }
body.modal-open { overflow: hidden; position: fixed; width: 100%; }

.material-icons-round {
  font-family: 'Material Icons Round';
  font-size: 22px;
  display: inline-block;
  line-height: 1;
  font-weight: normal;
  font-style: normal;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}
.icon-sm { font-size: 18px !important; }

/* ============ SCREENS ============ */
.screen { display: none; flex: 1; min-height: 100vh; flex-direction: column; }
.screen.active { display: flex; }

/* ============ SPLASH ============ */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s, visibility .5s;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-brand { display: flex; flex-direction: column; align-items: center; }
.splash-mark {
  width: 84px; height: 84px;
  background: var(--emerald);
  color: var(--navy);
  border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; font-weight: 800;
  box-shadow: 0 20px 60px rgba(16, 185, 129, .35);
  animation: pop .7s cubic-bezier(.34, 1.56, .64, 1);
}
.splash-word {
  color: #fff; font-size: 26px; font-weight: 800;
  margin-top: 20px; letter-spacing: -.3px;
}
.splash-tag {
  color: var(--text-subtle); font-size: 12px; font-weight: 600;
  margin-top: 6px; letter-spacing: 2px; text-transform: uppercase;
}
@keyframes pop {
  from { transform: scale(0) rotate(-180deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}

/* ============ AUTH ============ */
.auth-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px 22px; max-width: 440px; margin: 0 auto; width: 100%;
}

.auth-mark {
  width: 72px; height: 72px;
  background: var(--navy);
  color: var(--emerald);
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 800;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
  margin-bottom: 20px;
}
.auth-mark--sm { width: 64px; height: 64px; font-size: 30px; border-radius: 20px; }

.auth-title {
  font-size: 24px; font-weight: 800;
  color: var(--text); text-align: center;
  letter-spacing: -.4px;
}
.auth-sub {
  font-size: 13px; color: var(--text-muted);
  text-align: center; margin-top: 6px; margin-bottom: 28px;
  line-height: 1.5;
}
.auth-hint {
  font-size: 12px; color: var(--text-subtle);
  text-align: center; margin-top: 20px; line-height: 1.5;
}

.auth-error {
  background: var(--red-light); color: #b91c1c;
  font-size: 12px; font-weight: 600;
  padding: 11px 14px; border-radius: var(--r-md);
  margin-bottom: 16px; display: none; width: 100%;
  border-left: 3px solid var(--red);
}
.auth-error.show { display: block; }

/* ============ FIELD ============ */
.field { width: 100%; margin-bottom: 14px; }
.field label {
  font-size: 12px; font-weight: 700;
  display: block; margin-bottom: 6px;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .5px;
}
.field input, .field select {
  width: 100%; padding: 13px 14px;
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  font-size: 16px; background: #fff;
  font-family: inherit; font-weight: 500;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--emerald);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
}
.field-row { display: flex; gap: 12px; }
.field-row .field { margin-bottom: 14px; }

/* ============ BUTTONS ============ */
.btn {
  padding: 13px 18px; border: none; border-radius: var(--r-md);
  font-weight: 700; font-size: 14px; cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .1s, background .15s, opacity .15s;
  white-space: nowrap; letter-spacing: .1px;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-accent { background: var(--emerald); color: #fff; }
.btn-accent:hover { background: var(--emerald-dark); }

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }

.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: var(--border-light); color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: var(--r-sm); }
.mt-10 { margin-top: 10px; }

/* ============ APP HEADER ============ */
.app-header {
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .15);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px;
  background: var(--emerald); color: var(--navy);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; flex-shrink: 0;
}
.brand-info { min-width: 0; }
.brand-name {
  font-size: 14px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-meta {
  font-size: 11px; color: #94a3b8; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 1px;
}

.header-btn {
  background: rgba(255, 255, 255, .08);
  border: none; color: #cbd5e1;
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: background .15s, color .15s;
}
.header-btn:active { background: rgba(255, 255, 255, .16); color: #fff; }

/* ============ MAIN ============ */
.main {
  flex: 1; padding: 16px;
  padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto; overflow-x: hidden;
}

.page { display: none; }
.page.active { display: block; animation: pageFade .25s ease; }
@keyframes pageFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-title-row {
  display: flex; justify-content: space-between;
  align-items: flex-end; margin-bottom: 16px; gap: 12px;
}
.page-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.page-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; font-weight: 500; }

/* ============ SEARCH ============ */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  padding: 0 16px; height: 46px;
  border-radius: var(--r-md);
  margin-bottom: 14px;
  border: 1.5px solid var(--border);
  transition: border-color .15s;
}
.search-bar:focus-within { border-color: var(--emerald); }
.search-bar .material-icons-round { color: var(--text-subtle); font-size: 20px; }
.search-bar input {
  flex: 1; border: none; outline: none;
  font-size: 16px; background: transparent;
  font-family: inherit; font-weight: 500;
}

/* ============ PRODUCT LIST ============ */
.product-list { display: flex; flex-direction: column; gap: 8px; }

.product-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  padding: 12px 14px;
  border-radius: var(--r-md);
  cursor: pointer;
  border: 1px solid var(--border-light);
  transition: border-color .15s, background .15s, transform .1s;
}
.product-item:active { transform: scale(.99); background: var(--border-light); }

.prod-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--emerald-light); color: var(--emerald-dark);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.prod-icon .material-icons-round { font-size: 22px; }

.prod-info { flex: 1; min-width: 0; }
.prod-name {
  font-size: 14px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: -.1px;
}
.prod-meta {
  font-size: 12px; color: var(--text-muted);
  margin-top: 3px; font-weight: 500;
}

.prod-price {
  font-weight: 800; font-size: 14px;
  color: var(--text); letter-spacing: -.2px;
  white-space: nowrap;
}

.qty-btn {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--emerald); color: #fff;
  border: none; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; font-weight: 700;
  font-family: inherit; font-size: 14px;
  transition: transform .1s;
}
.qty-btn:active { transform: scale(.92); }
.qty-btn.ghost { background: var(--border-light); color: var(--text); }

/* ============ CART DOCK ============ */
.cart-dock {
  position: fixed; z-index: 49;
  left: 50%; bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  width: min(calc(100% - 32px), 500px);
  transform: translateX(-50%) translateY(120%);
  background: var(--navy); color: #fff;
  border-radius: var(--r-lg); padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.cart-dock.show { transform: translateX(-50%) translateY(0); }
.cart-info { flex: 1; min-width: 0; }
.cart-count { font-size: 11px; color: #94a3b8; font-weight: 600; }
.cart-total {
  font-size: 18px; font-weight: 800;
  color: var(--emerald); margin-top: 2px; letter-spacing: -.3px;
}
.cart-checkout {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--emerald); color: #fff;
  border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: transform .1s, background .15s;
}
.cart-checkout:active { transform: scale(.94); }

/* ============ BOTTOM NAV + FAB ============ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff;
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px)) 4px;
  border-top: 1px solid var(--border);
  z-index: 50;
  box-shadow: 0 -2px 12px rgba(15, 23, 42, .04);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; color: var(--text-subtle);
  cursor: pointer; padding: 6px 0;
  font-size: 10px; font-weight: 700; font-family: inherit;
  text-transform: uppercase; letter-spacing: .3px;
  transition: color .15s;
  min-width: 0;
}
.nav-item .material-icons-round { font-size: 22px; }
.nav-item.active { color: var(--emerald-dark); }

.nav-fab {
  width: 56px; height: 56px;
  margin: 0 6px;
  background: var(--emerald); color: #fff;
  border: none; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(16, 185, 129, .38);
  transform: translateY(-10px);
  transition: transform .15s, background .15s;
}
.nav-fab:active { transform: translateY(-10px) scale(.94); }
.nav-fab .material-icons-round { font-size: 28px; }

/* ============ PROFILE ============ */
.profile-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); padding: 18px;
  border-radius: var(--r-lg);
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
}
.profile-avatar {
  width: 58px; height: 58px; border-radius: 18px;
  background: var(--navy); color: var(--emerald);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 24px; flex-shrink: 0;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name {
  font-size: 16px; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: -.2px;
}
.profile-role { font-size: 12px; color: var(--text-muted); margin-top: 3px; font-weight: 600; }

/* ============ MENU ============ */
.menu-section { margin-bottom: 20px; }
.menu-section-title {
  font-size: 11px; font-weight: 700;
  color: var(--text-subtle); text-transform: uppercase;
  letter-spacing: .8px; margin-bottom: 8px; padding-left: 4px;
}
.menu-list, .menu-section {
  background: var(--card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
}
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 15px 16px; background: none; border: none;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--text); cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  text-align: left; transition: background .15s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--border-light); }
.menu-item > .material-icons-round:first-child {
  font-size: 20px; color: var(--text-muted);
}
.menu-chevron { margin-left: auto; color: var(--text-subtle) !important; font-size: 20px !important; }
.menu-item--danger { color: var(--red); }
.menu-item--danger > .material-icons-round:first-child { color: var(--red); }

/* ============ VERSION ============ */
.version-block {
  text-align: center; padding: 24px 0 8px;
  font-size: 11px; line-height: 1.8;
}
.version-line { color: var(--text-subtle); font-weight: 600; }
.version-muted { color: var(--border); font-weight: 500; }

/* ============ STATS ============ */
.stats-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 14px;
}
.stat {
  background: var(--card);
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
}
.stat-label {
  font-size: 11px; color: var(--text-muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
}
.stat-value {
  font-size: 20px; font-weight: 800;
  margin-top: 6px; letter-spacing: -.4px;
  color: var(--text);
}

/* ============ HISTORY ============ */
.history-list { display: flex; flex-direction: column; gap: 8px; }

.history-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
}
.history-icon {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--emerald-light); color: var(--emerald-dark);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.history-icon .material-icons-round { font-size: 20px; }
.history-icon.qris {
  background: var(--amber-light); color: #b45309;
}
.history-info { flex: 1; min-width: 0; }
.history-invoice {
  font-size: 13px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: -.1px;
}
.history-meta {
  font-size: 11px; color: var(--text-muted);
  margin-top: 3px; font-weight: 500;
}
.history-amount { text-align: right; flex-shrink: 0; }
.history-total {
  font-size: 14px; font-weight: 800;
  letter-spacing: -.2px;
}
.history-method {
  font-size: 10px; color: var(--text-subtle);
  margin-top: 3px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-subtle); font-size: 13px;
  font-weight: 500; line-height: 1.6;
}
.empty-state .material-icons-round {
  font-size: 48px; color: var(--border);
  display: block; margin: 0 auto 12px;
}

/* ============ MODAL ============ */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  z-index: 100; display: none;
  align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-bg.show { display: flex; }

.modal {
  background: #fff;
  width: 100%; max-width: 500px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 8px 20px 24px;
  max-height: 92vh; overflow-y: auto;
  animation: slideUp .3s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-handle {
  width: 44px; height: 5px;
  background: var(--border);
  border-radius: 3px;
  margin: 6px auto 12px;
}

.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.modal-head h3 {
  font-size: 18px; font-weight: 800; letter-spacing: -.2px;
}
.close-btn {
  background: var(--border-light); border: none;
  width: 32px; height: 32px; border-radius: 10px;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.close-btn .material-icons-round { font-size: 20px; }

.modal-actions {
  display: flex; gap: 10px; margin-top: 20px;
}
.modal-actions .btn { flex: 1; }

/* ============ CART ITEMS ============ */
.cart-item-list {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 45vh; overflow-y: auto; margin-bottom: 16px;
}
.cart-item-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.cart-item-row:last-child { border-bottom: none; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 14px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cart-item-calc { font-size: 12px; color: var(--text-muted); margin-top: 3px; font-weight: 500; }
.cart-item-sub { font-weight: 800; font-size: 14px; letter-spacing: -.2px; }

.cart-summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; background: var(--emerald-light);
  border-radius: var(--r-md);
}
.cart-summary-label {
  font-size: 12px; color: var(--emerald-dark);
  font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
.cart-summary-total {
  font-size: 20px; font-weight: 800;
  color: var(--emerald-dark); letter-spacing: -.3px;
}

/* ============ PAY ============ */
.pay-total {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  border-radius: var(--r-lg);
  padding: 24px; text-align: center; margin-bottom: 20px;
}
.pay-label {
  font-size: 12px; color: #94a3b8;
  font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
}
.pay-value {
  font-size: 32px; font-weight: 800;
  color: var(--emerald); margin-top: 8px; letter-spacing: -.6px;
}

.pay-methods { display: flex; gap: 10px; }
.pay-method {
  flex: 1; padding: 14px 12px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  background: #fff; font-family: inherit;
  font-weight: 700; font-size: 13px;
  cursor: pointer; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: all .15s;
}
.pay-method .material-icons-round { font-size: 24px; }
.pay-method.active {
  border-color: var(--emerald);
  background: var(--emerald-light);
  color: var(--emerald-dark);
}

/* ============ TOAST ============ */
.toast {
  position: fixed; top: 20px; left: 50%;
  transform: translate(-50%, -100px);
  background: var(--navy); color: #fff;
  padding: 13px 20px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 700;
  z-index: 300; opacity: 0;
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), opacity .25s;
  max-width: calc(100vw - 40px);
  box-shadow: var(--shadow-lg);
  letter-spacing: .1px;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.success { background: var(--emerald-dark); }
.toast.error { background: #dc2626; }

/* ============================================================
   DASHBOARD
   ============================================================ */

.range-tabs {
  display: flex; gap: 6px; margin-bottom: 14px;
  background: var(--card); padding: 4px;
  border-radius: var(--r-md); border: 1px solid var(--border-light);
}
.range-tab {
  flex: 1; padding: 9px 8px;
  background: none; border: none;
  border-radius: var(--r-sm);
  font-family: inherit; font-size: 12px; font-weight: 700;
  color: var(--text-muted); cursor: pointer;
  transition: all .15s;
  text-transform: uppercase; letter-spacing: .3px;
}
.range-tab.active {
  background: var(--navy); color: #fff;
}

.hero-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  border-radius: var(--r-lg);
  padding: 22px 20px;
  color: #fff;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .15);
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(16, 185, 129, .15);
  pointer-events: none;
}
.hero-label {
  font-size: 11px; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 1px;
  position: relative; z-index: 1;
}
.hero-value {
  font-size: 34px; font-weight: 800;
  color: var(--emerald);
  margin-top: 8px;
  letter-spacing: -.8px;
  position: relative; z-index: 1;
  line-height: 1.1;
}
.hero-sub {
  font-size: 12px; color: #cbd5e1;
  margin-top: 6px; font-weight: 500;
  position: relative; z-index: 1;
}

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.mini-stat {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.mini-label {
  font-size: 10px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .4px;
}
.mini-value {
  font-size: 18px; font-weight: 800;
  color: var(--text);
  margin-top: 5px;
  letter-spacing: -.3px;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 12px;
}
.chart-head {
  display: flex; justify-content: space-between;
  align-items: baseline; margin-bottom: 12px; gap: 10px;
}
.chart-title {
  font-size: 14px; font-weight: 800;
  color: var(--text); letter-spacing: -.2px;
}
.chart-note {
  font-size: 11px; color: var(--text-muted);
  font-weight: 600;
}

.chart-area {
  width: 100%; height: 160px;
  position: relative;
}
.chart-area svg {
  display: block; width: 100%; height: 100%;
}
.chart-empty {
  text-align: center; color: var(--text-subtle);
  font-size: 12px; font-weight: 600;
  padding: 40px 10px;
}

.top-products {
  display: flex; flex-direction: column; gap: 8px;
}
.top-product-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.top-product-item:last-child { border-bottom: none; }
.top-rank {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--emerald-light);
  color: var(--emerald-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
  flex-shrink: 0;
}
.top-product-item:nth-child(1) .top-rank {
  background: var(--amber); color: var(--navy);
}
.top-product-item:nth-child(2) .top-rank {
  background: var(--border); color: var(--text);
}
.top-product-item:nth-child(3) .top-rank {
  background: #fed7aa; color: #9a3412;
}
.top-info { flex: 1; min-width: 0; }
.top-name {
  font-size: 13px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.top-meta {
  font-size: 11px; color: var(--text-muted);
  margin-top: 2px; font-weight: 500;
}
.top-amount { text-align: right; flex-shrink: 0; }
.top-qty {
  font-size: 13px; font-weight: 800;
  color: var(--text);
}
.top-amount-sub {
  font-size: 10px; color: var(--text-subtle);
  font-weight: 600; margin-top: 2px;
}
