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

:root {
  --bg: #FAF9F7; --bg2: #FFFFFF; --fg: #1C1917; --t2: #78716C; --t3: #A8A29E;
  --surface: #F5F4F1; --surface2: #ECEAE6;
  --line: #E7E5E4; --line2: #D6D3D1;
  --acc: #B45309; --acc2: #D97706; --acc-light: #FEF3C7; --acc-text: #92400E;
  --up: #047857; --up-bg: #ECFDF5; --dn: #B91C1C; --dn-bg: #FEF2F2;
  --chart-1: #B45309; --chart-2: #0F766E; --chart-3: #2563EB;
  --chart-4: #9333EA; --chart-5: #DC2626; --chart-6: #0891B2;
  --num: 'SFMono-Regular', 'SF Mono', 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
  --sans: 'Avenir Next', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --r: 10px; --rs: 7px;
}
.dark {
  --bg: #0F0E0D; --bg2: #171614; --fg: #F5F5F0; --t2: #8C8780; --t3: #5C5850;
  --surface: #1A1918; --surface2: #222120;
  --line: #2A2826; --line2: #3A3836;
  --acc: #F59E0B; --acc2: #FBBF24; --acc-light: #422006; --acc-text: #FDE68A;
  --up: #34D399; --up-bg: #064E3B; --dn: #FB7185; --dn-bg: #4C0519;
  --chart-1: #F59E0B; --chart-2: #2DD4BF; --chart-3: #60A5FA;
  --chart-4: #C084FC; --chart-5: #FB7185; --chart-6: #22D3EE;
}
body { font-family: var(--sans); color: var(--fg); background: var(--bg); min-height: 100vh; transition: background .2s, color .2s; overflow-y: scroll; }

/* ═══ LOGIN — SPLIT SCREEN ═══ */
.login-screen { min-height: 100vh; display: flex; }
.login-brand-panel {
  flex: 1; background: #1C1917; display: flex; flex-direction: column;
  justify-content: space-between; padding: 40px 36px; color: #fff;
}
.dark .login-brand-panel { background: #0A0A09; }
.login-logo { font-size: 17px; font-weight: 700; letter-spacing: -.04em; color: #fff; }
.login-logo span { color: #F59E0B; }
.login-brand-middle { max-width: 280px; }
.login-tagline { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.login-tagline-sub { font-size: 12px; color: rgba(255,255,255,.4); margin-top: 16px; line-height: 1.6; }
.login-brand-badges { display: flex; gap: 24px; font-size: 10px; color: rgba(255,255,255,.3); }
.login-form-panel {
  flex: 1; background: var(--bg); display: flex; align-items: center;
  justify-content: center; padding: 40px;
}
.login-form-inner { width: 320px; max-width: 100%; }
.login-mobile-logo { display: none; text-align: center; margin-bottom: 28px; }
.login-mobile-icon {
  width: 44px; height: 44px; background: var(--acc-light); border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--acc); margin-bottom: 10px;
}
.login-sub { font-size: 13px; color: var(--t3); margin-bottom: 28px; }
.login-field { margin-bottom: 16px; }
.login-field label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--t3); display: block; margin-bottom: 5px;
}
.login-field input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--rs);
  font-size: 13px; background: var(--bg2); color: var(--fg); outline: none;
  font-family: inherit; transition: border-color .15s;
}
.login-field input:focus { border-color: var(--acc); }
.login-forgot { text-align: right; font-size: 11px; color: var(--acc); font-weight: 500; cursor: pointer; margin-bottom: 20px; }
.login-error { font-size: 12px; color: var(--dn); margin-bottom: 12px; min-height: 18px; }
.login-submit { width: 100%; padding: 12px; font-size: 14px; }
.login-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid var(--line); }
.login-tab {
  flex: 1; padding: 10px 0; font-size: 14px; font-weight: 600; text-align: center;
  cursor: pointer; border: none; background: none; color: var(--t3); font-family: inherit;
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s;
}
.login-tab:hover { color: var(--t2); }
.login-tab.on { color: var(--fg); border-bottom-color: var(--acc); }

/* ═══ APP ═══ */
.app { background: var(--bg); min-height: 100vh; transition: background .2s, color .2s; }

/* ═══ TOP BAR ═══ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 56px; border-bottom: 1px solid var(--line);
  background: var(--bg); position: sticky; top: 0; z-index: 30;
}
.brand { font-size: 17px; font-weight: 700; letter-spacing: -.04em; }
.brand span { color: var(--acc); }
.tabs { display: flex; gap: 2px; background: var(--surface); border-radius: var(--rs); padding: 3px; }
.tab {
  padding: 6px 18px; font-size: 13px; font-weight: 600; border-radius: 5px;
  cursor: pointer; color: var(--t3); transition: all .12s; border: none;
  background: transparent; font-family: inherit; letter-spacing: -.01em;
}
.tab.on { background: var(--bg2); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.tab:hover:not(.on) { color: var(--t2); }

/* ═══ HAMBURGER ═══ */
.burger { background: none; border: none; cursor: pointer; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.burger span { display: block; width: 20px; height: 2px; background: var(--fg); border-radius: 1px; }

/* ═══ MENU DRAWER ═══ */
.menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 80; backdrop-filter: blur(3px); animation: fadeIn .15s; }
.menu-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 280px;
  background: var(--bg); border-left: 1px solid var(--line); z-index: 90;
  display: flex; flex-direction: column; animation: slideIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideIn { from { transform: translateX(100%) } to { transform: translateX(0) } }
.menu-top { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.menu-top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.menu-close { background: none; border: none; cursor: pointer; color: var(--t3); font-size: 22px; line-height: 1; padding: 4px; }
.lang-group { display: flex; gap: 4px; }
.lang-pill {
  padding: 6px 14px; font-size: 11px; font-weight: 600; border-radius: var(--rs);
  border: 1px solid var(--line); background: transparent; color: var(--t3);
  cursor: pointer; font-family: inherit; transition: all .12s;
}
.lang-pill:hover { border-color: var(--line2); color: var(--t2); }
.lang-pill.on { background: var(--acc); color: #fff; border-color: var(--acc); }
.theme-row { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.theme-label { font-size: 11px; color: var(--t3); font-weight: 500; }
.theme-toggle {
  position: relative; width: 44px; height: 24px; background: var(--surface2);
  border-radius: 12px; cursor: pointer; border: 1px solid var(--line); transition: background .2s;
}
.theme-toggle.on { background: var(--acc); }
.theme-knob {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  background: var(--bg2); border-radius: 50%; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.theme-toggle.on .theme-knob { transform: translateX(20px); }
.menu-nav { flex: 1; padding: 12px 0; }
.menu-link {
  display: flex; align-items: center; padding: 12px 24px; font-size: 13px;
  font-weight: 600; color: var(--t2); cursor: pointer; transition: all .1s;
  border-left: 3px solid transparent;
}
.menu-link:hover { color: var(--fg); background: var(--surface); }
.menu-link.on { color: var(--fg); background: var(--surface); border-left-color: var(--acc); }
.menu-bottom { padding: 20px 24px; border-top: 1px solid var(--line); }
.menu-email { font-size: 11px; color: var(--t3); margin-bottom: 10px; }
.logout-btn {
  width: 100%; font-size: 12px; font-weight: 600; color: var(--t3);
  background: transparent; border: 1px solid var(--line); border-radius: var(--rs);
  padding: 8px 0; cursor: pointer; font-family: inherit; transition: all .12s; text-align: center;
}
.logout-btn:hover { color: var(--fg); border-color: var(--line2); }

/* ═══ CONTAINER ═══ */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 40px 28px; }

/* ═══ LAYOUT ═══ */
.grid-main { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 24px; margin-bottom: 28px; }
.section-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--t3); margin-bottom: 14px; }
.section-link { font-size: 14px; color: var(--acc); cursor: pointer; font-weight: 600; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

/* ═══ CARD ═══ */
.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.86) 0%, rgba(255,255,255,.66) 100%),
    var(--bg2);
  border: 1px solid rgba(214, 211, 209, .82);
  border-radius: calc(var(--r) + 4px);
  padding: 24px;
  box-shadow: 0 18px 48px rgba(28, 25, 23, .06), 0 2px 10px rgba(28, 25, 23, .03);
}
.dark .card {
  background:
    linear-gradient(180deg, rgba(34, 33, 32, .94) 0%, rgba(23, 22, 20, .94) 100%),
    var(--bg2);
  border-color: rgba(58, 56, 54, .9);
  box-shadow: 0 20px 52px rgba(0, 0, 0, .24), 0 2px 10px rgba(0, 0, 0, .16);
}
.card-title { font-size: 16px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 18px; }
.analytics-kicker {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: var(--acc); opacity: .88;
}
.analytics-panel {
  position: relative;
  overflow: hidden;
}
.analytics-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 72px;
  background: linear-gradient(135deg, rgba(180, 83, 9, .12), rgba(217, 119, 6, 0));
  pointer-events: none;
}
.dark .analytics-panel::before {
  background: linear-gradient(135deg, rgba(245, 158, 11, .14), rgba(251, 191, 36, 0));
}

/* ═══ STATS ═══ */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.stat-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.42) 0%, rgba(255,255,255,.08) 100%),
    var(--surface);
  border: 1px solid rgba(214, 211, 209, .74);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}
.dark .stat-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.01) 100%),
    var(--surface);
  border-color: rgba(58, 56, 54, .9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--t3); margin-bottom: 6px; }
.stat-value { font-family: var(--num); font-size: 28px; font-weight: 700; letter-spacing: -.04em; line-height: 1.1; }
.stat-sub { font-size: 13px; color: var(--t3); margin-top: 4px; }
.trend-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 18px; }
.analytics-toolbar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid rgba(214, 211, 209, .82);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(180, 83, 9, .12), rgba(180, 83, 9, 0) 38%),
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.68));
  box-shadow: 0 18px 48px rgba(28, 25, 23, .06), 0 2px 10px rgba(28, 25, 23, .03);
}
.dark .analytics-toolbar {
  border-color: rgba(58, 56, 54, .9);
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, .14), rgba(245, 158, 11, 0) 36%),
    linear-gradient(180deg, rgba(34, 33, 32, .94), rgba(23, 22, 20, .94));
  box-shadow: 0 20px 52px rgba(0, 0, 0, .24), 0 2px 10px rgba(0, 0, 0, .16);
}
.analytics-toolbar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.analytics-toolbar-title { font-size: 24px; letter-spacing: -.04em; }
.analytics-toolbar-copy {
  max-width: 420px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--t2);
}
.analytics-toolbar-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) minmax(180px, 1fr) 160px 160px auto;
  gap: 12px;
  align-items: end;
}
.toolbar-field {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(214, 211, 209, .74);
}
.dark .toolbar-field {
  background: rgba(255,255,255,.03);
  border-color: rgba(58, 56, 54, .84);
}
.toolbar-field.action {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  background: transparent;
  border: none;
  padding: 0;
}
.analytics-select-row { margin-bottom: 14px; }

/* ═══ FORM ═══ */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.field label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--t3); display: block; margin-bottom: 7px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.inp {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--rs);
  font-size: 14px; background: var(--bg); color: var(--fg); outline: none;
  width: 100%; font-family: inherit; transition: border-color .15s;
}
.inp:focus { border-color: var(--acc); }

/* ═══ SEARCH INPUT ═══ */
.search-wrap { position: relative; }
.search-wrap .inp { padding-left: 36px; }
.search-wrap .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--t3); pointer-events: none; }

/* ═══ BUTTONS ═══ */
.btn { padding: 12px 22px; border-radius: var(--rs); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; border: none; transition: all .1s; }
.btn:active { transform: scale(.97); }
.btn-p { background: var(--acc); color: #fff; }
.btn-p:hover { opacity: .88; }
.btn-g { background: transparent; border: 1px solid var(--line); color: var(--t2); }
.btn-g:hover { border-color: var(--line2); color: var(--fg); }
.btn-d { background: transparent; border: 1px solid var(--line); color: var(--dn); font-size: 12px; padding: 6px 14px; border-radius: 5px; }
.btn-d:hover { background: var(--dn-bg); }
.btn-danger { background: var(--dn); color: #fff; }
.export-btn {
  display: inline-flex; align-items: center; gap: 7px; background: var(--acc); color: #fff;
  border: none; border-radius: var(--rs); padding: 12px 22px; font-size: 14px;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: opacity .12s;
}
.analytics-export-btn {
  min-height: 52px;
  border-radius: 14px;
  box-shadow: 0 16px 28px rgba(180, 83, 9, .22);
}
.dark .analytics-export-btn { box-shadow: 0 16px 28px rgba(245, 158, 11, .18); }
.export-btn:hover { opacity: .88; }
.export-btn:active { transform: scale(.97); }

/* ═══ SELECT ═══ */
.sel-wrap { position: relative; z-index: 10; }
.sel {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--rs); font-size: 14px;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  background: var(--bg); color: var(--fg); transition: border-color .15s; font-family: inherit;
  gap: 6px; user-select: none;
}
.sel-sm { padding: 9px 12px; font-size: 13px; }
.sel:hover { border-color: var(--line2); }
.sel-ph { opacity: .4; }
.sel-arr { flex-shrink: 0; opacity: .3; transition: transform .15s; }
.sel-arr.open { transform: scaleY(-1); }
.sel-dd {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; min-width: 150px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--rs);
  z-index: 50; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.sel-dd-s { padding: 9px 13px; border-bottom: 1px solid var(--line); }
.sel-dd-i { width: 100%; border: none; outline: none; font-size: 14px; background: transparent; color: var(--fg); font-family: inherit; }
.sel-dd-l { max-height: 185px; overflow-y: auto; }
.sel-o { padding: 10px 14px; font-size: 14px; cursor: pointer; transition: background .08s; }
.sel-o:hover, .sel-o.on { background: var(--surface); }

/* ═══ RECENT ═══ */
.recent-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); }
.recent-row:last-child { border-bottom: none; }

/* ═══ TABLE ═══ */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 500px; }
.tbl th {
  padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--t3);
  border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; white-space: nowrap;
}
.tbl th:hover { color: var(--t2); }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--surface); }
.badge { font-size: 11px; padding: 3px 10px; border-radius: 10px; background: var(--surface); color: var(--t2); font-weight: 600; }
.num-cell { font-family: var(--num); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.tbl-hint { padding: 8px 10px; text-align: center; font-size: 10px; color: var(--t3); border-top: 1px solid var(--line); display: none; }

/* ═══ MANAGE ═══ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.manage-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 8px 13px 0; border-bottom: 1px solid var(--line); }
.manage-row:last-child { border-bottom: none; }

/* ═══ DROP ZONE ═══ */
.drop-zone {
  border: 2px dashed var(--line2); border-radius: var(--r); padding: 32px 20px;
  text-align: center; cursor: pointer; transition: all .2s; background: var(--bg);
}
.drop-zone:hover, .drop-zone.active { border-color: var(--acc); background: var(--acc-light); }
.drop-text { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.drop-text-mobile { display: none; }
.drop-text-desktop { display: block; }
.drop-formats { font-size: 10px; color: var(--t3); margin-top: 8px; font-family: var(--num); }
.drop-status { margin-top: 12px; padding: 10px 14px; border-radius: var(--rs); font-size: 12px; font-weight: 600; }
.drop-status.ok { background: var(--up-bg); color: var(--up); }
.drop-status.err { background: var(--dn-bg); color: var(--dn); }
.import-hint { margin-top: 10px; font-size: 10px; color: var(--t3); font-family: var(--num); }

/* ═══ CHART ═══ */
.chart-clickable { cursor: pointer; border-radius: var(--rs); transition: opacity .15s; }
.chart-clickable:hover { opacity: .85; }
.chart-shell { display: flex; flex-direction: column; gap: 10px; }
.chart-shell.compact { gap: 8px; }
.chart-note {
  font-size: 11px; color: var(--t3); letter-spacing: .03em;
  text-transform: uppercase; font-weight: 700;
}
.chart-canvas {
  position: relative; border: 1px solid var(--line); border-radius: calc(var(--r) - 2px);
  background:
    radial-gradient(circle at top left, rgba(180, 83, 9, .08), rgba(180, 83, 9, 0) 35%),
    linear-gradient(180deg, rgba(255,255,255,.72) 0%, rgba(255,255,255,.42) 100%),
    var(--bg);
  overflow: hidden; padding: 6px 8px 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
.dark .chart-canvas {
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, .12), rgba(245, 158, 11, 0) 36%),
    linear-gradient(180deg, rgba(255,255,255,.03) 0%, rgba(255,255,255,.01) 100%),
    var(--surface);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.chart-svg { display: block; }
.chart-axis-text {
  fill: var(--t3); font-size: 10px; font-family: var(--num);
}
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.chart-legend-item {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px;
  border-radius: 999px; background: var(--surface); color: var(--t2);
  font-size: 12px; font-weight: 600; max-width: 100%;
}
.chart-legend-swatch, .chart-tooltip-swatch {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.chart-tooltip {
  position: absolute; top: 0; left: 0; opacity: 0; pointer-events: none;
  min-width: 150px; max-width: min(240px, calc(100% - 16px)); padding: 10px 12px;
  border-radius: 12px; background: rgba(28, 25, 23, .96); color: #fff;
  box-shadow: 0 14px 32px rgba(28, 25, 23, .18); transition: opacity .12s ease, transform .12s ease;
}
.dark .chart-tooltip {
  background: rgba(245, 245, 240, .96); color: #0F0E0D;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .28);
}
.chart-tooltip-date {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; opacity: .72; margin-bottom: 8px;
}
.chart-tooltip-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; font-size: 12px; margin-top: 6px;
}
.chart-tooltip-name {
  display: inline-flex; align-items: center; gap: 7px; min-width: 0;
  font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chart-tooltip-value { font-family: var(--num); font-weight: 700; white-space: nowrap; }
.quick-trend-stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.quick-trend-stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--rs);
  padding: 12px 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.38);
}
.quick-trend-stat-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--t3); margin-bottom: 6px;
}
.quick-trend-stat-value {
  font-family: var(--num); font-size: 20px; font-weight: 700; letter-spacing: -.04em;
}
.quick-trend-stat-value.small { font-size: 16px; line-height: 1.3; }
.trend-card { display: flex; flex-direction: column; gap: 12px; }

/* ═══ OVERLAY / CONFIRM ═══ */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(3px); }
.cfm { background: var(--bg2); border-radius: var(--r); padding: 24px; max-width: 360px; width: 90%; border: 1px solid var(--line); }
.cfm p { font-size: 13px; margin-bottom: 20px; line-height: 1.6; }
.cfm-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ═══ TOAST ═══ */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 9px 24px; border-radius: 20px; font-size: 12px; font-weight: 600; z-index: 200; animation: toastUp .25s ease; }
@keyframes toastUp { from { opacity: 0; transform: translate(-50%,8px) } to { opacity: 1; transform: translate(-50%,0) } }

/* ═══ EMPTY ═══ */
.empty { font-size: 12px; color: var(--t3); padding: 28px 0; text-align: center; }

/* ═══ ANIMATIONS ═══ */
@keyframes slideUp { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: translateY(0) } }
.anim { animation: slideUp .35s ease both; }
.ad1 { animation-delay: .05s; } .ad2 { animation-delay: .1s; }

/* ═══ MOBILE ═══ */
@media (max-width: 700px) {
  /* Login: hide brand panel, show mobile logo */
  .login-brand-panel { display: none; }
  .login-form-panel { padding: 24px; }
  .login-mobile-logo { display: block; }
  .login-sub { text-align: center; }

  /* Header */
  .topbar { padding: 0 16px; height: 48px; }
  .tabs { display: none; }
  .brand { font-size: 14px; }

  /* Container */
  .container { padding: 14px 16px 48px; }

  /* Grid stacks */
  .grid-main { grid-template-columns: 1fr; gap: 14px; }
  .two-col { grid-template-columns: 1fr; gap: 14px; }
  .trend-stats { grid-template-columns: 1fr 1fr; }
  .analytics-toolbar { padding: 18px; }
  .analytics-toolbar-head { flex-direction: column; gap: 10px; }
  .analytics-toolbar-grid { grid-template-columns: 1fr; }
  .toolbar-field.action { justify-content: stretch; }
  .analytics-toolbar-copy { max-width: none; }

  /* Form: category/product go full width */
  .form-row-stack { grid-template-columns: 1fr; }

  /* Table: horizontal scroll */
  .tbl-hint { display: block; }

  /* Drop zone: tap instead of drag */
  .drop-text-desktop { display: none; }
  .drop-text-mobile { display: block; }

  /* Card padding */
  .card { padding: 16px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 18px; }
  .chart-canvas { padding: 4px 4px 0; }
  .quick-trend-stats-grid { grid-template-columns: 1fr 1fr; }
  .chart-legend-item { font-size: 11px; }
  .analytics-toolbar-title { font-size: 21px; }

  /* Menu drawer wider on mobile */
  .menu-drawer { width: calc(100vw - 60px); max-width: 280px; }
}

@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr; }
  .trend-stats { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .quick-trend-stats-grid { grid-template-columns: 1fr; }
}

/* ═══ SCROLLBAR ═══ */
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 3px; }
*::-webkit-scrollbar-thumb:hover { background: var(--t3); }
