/* ==========================================================================
   Estoque Fácil Pro — tema do sistema
   Só visual: todas as classes e atributos usados pelo PHP/JS foram mantidos.
   ========================================================================== */

/* ---- Fontes hospedadas no próprio site (nada é pedido ao Google) ---- */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/instrument-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #f3f6f1;
  --surface: #ffffff;
  --surface-2: #eaf0e8;
  --ink: #17352a;
  --muted: #556a5e;
  --line: #d5dfd2;
  --brand: #1f7a4d;
  --brand-dark: #165a38;
  --brand-2: #0d5c8f;
  --on-brand: #ffffff;
  --tag: #f6c945;
  --tag-ink: #3b2f05;
  --warn: #b86710;
  --danger: #b33838;
  --ok: #26704a;
  --sidebar: #12281f;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 53, 42, .05), 0 10px 24px rgba(23, 53, 42, .07);
  --font-display: "Bricolage Grotesque", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
  font-family: var(--font-body);
}

[data-theme="dark"] {
  --bg: #0e1812;
  --surface: #15231b;
  --surface-2: #1e3026;
  --ink: #e9f2ec;
  --muted: #9db3a5;
  --line: #2a3d31;
  --brand: #4cb383;
  --brand-dark: #3a9a6d;
  --brand-2: #62a8d6;
  --on-brand: #07130c;
  --sidebar: #0a120d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 30px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 1rem; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.015em; }
small { display: block; color: var(--muted); margin-top: 3px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; }

/* ---- Estrutura ---- */
.app-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: #f3f8f4; padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 4px 18px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.brand-mark { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand); color: #fff; font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
[data-theme="dark"] .brand-mark { color: #07130c; }
.brand h1 { margin: 0; font-size: 1.05rem; line-height: 1.15; }
.brand p { margin: 3px 0 0; color: #b6c9bd; font-size: .82rem; overflow-wrap: anywhere; }

.nav { display: grid; gap: 4px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; color: #d3e3d9; border-radius: var(--radius-sm); padding: 11px 12px; font-weight: 500; transition: background-color .15s, color .15s; }
.nav a::before { content: ""; width: 20px; height: 20px; flex: none; background: currentColor; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 650; }
.nav a.active::after { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--tag); }
.nav a.active::before { opacity: 1; }
.nav a[href$="route=dashboard"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1.5'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1.5'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1.5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1.5'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1.5'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1.5'/%3E%3C/svg%3E"); }
.nav a[href$="route=products"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8 12 3 3 8v8l9 5 9-5V8Z'/%3E%3Cpath d='m3 8 9 5 9-5M12 13v8'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8 12 3 3 8v8l9 5 9-5V8Z'/%3E%3Cpath d='m3 8 9 5 9-5M12 13v8'/%3E%3C/svg%3E"); }
.nav a[href$="route=sales"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4H6Z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4H6Z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E"); }
.nav a[href$="route=clients"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.nav a[href$="route=reports"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2'/%3E%3C/svg%3E"); }
.nav a[href$="route=alerts"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E"); }
.nav a[href$="route=backup"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5' rx='9' ry='3'/%3E%3Cpath d='M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5'/%3E%3Cpath d='M3 12c0 1.66 4 3 9 3s9-1.34 9-3'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5' rx='9' ry='3'/%3E%3Cpath d='M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5'/%3E%3Cpath d='M3 12c0 1.66 4 3 9 3s9-1.34 9-3'/%3E%3C/svg%3E"); }
.sidebar-note { margin-top: auto; padding: 14px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .07); color: #c9dacf; font-size: .84rem; line-height: 1.45; }

.main { padding: 28px clamp(16px, 3vw, 36px) 48px; display: grid; gap: 22px; align-content: start; min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.topbar h2 { margin: 0; font-size: clamp(1.6rem, 2.8vw, 2.2rem); font-weight: 750; line-height: 1.1; }
.topbar p { margin: 6px 0 0; color: var(--muted); font-size: .96rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Botões ---- */
.btn { min-height: 44px; border-radius: var(--radius-sm); padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 600; white-space: nowrap; transition: background-color .15s, border-color .15s, transform .08s; }
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn.primary { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #962d2d; border-color: #962d2d; }
.icon-btn { width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; font-weight: 600; transition: background-color .15s, border-color .15s; }
.icon-btn:hover { border-color: var(--danger); color: var(--danger); }
.form-actions, .row-actions, .variation-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.form-actions .btn.primary { flex: 1 1 220px; }
.row-actions { min-width: 126px; }

/* ---- Cartões e painéis ---- */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.metric, .panel, .auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric { container-type: inline-size; position: relative; min-height: 112px; padding: 18px 18px 16px; display: grid; gap: 10px; align-content: space-between; overflow: hidden; }
.metric::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); opacity: .85; }
.metric span { color: var(--muted); font-size: .88rem; font-weight: 500; }
.metric strong { font-family: var(--font-display); font-size: 1.5rem; font-size: clamp(1.1rem, 10.5cqw, 1.75rem); font-weight: 750; line-height: 1.1; letter-spacing: -0.02em; white-space: nowrap; }

.panel { overflow: hidden; }
.panel-header { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-header h3 { margin: 0; font-size: 1.08rem; font-weight: 700; }
.panel-body { padding: 18px; color: var(--muted); }
.form { padding: 18px; display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; color: var(--muted); font-size: .85rem; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 44px; font-weight: 400; font-size: 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 9px 12px; outline: 0; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { font-weight: 400; color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; }
.split, .sales-grid, .chart-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sales-grid { grid-template-columns: minmax(340px, .8fr) minmax(0, 1.2fr); }
.chart-grid canvas { width: 100%; min-height: 260px; padding: 18px; }

/* ---- Filtros e tabelas ---- */
.filters { display: flex; gap: 10px; align-items: center; }
.filters.wide { padding: 18px; display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); }
.filters.compact { display: flex; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: var(--surface-2); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
td { font-size: .94rem; }
tbody tr { transition: background-color .12s; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
.inline-form { display: grid; grid-template-columns: 1.1fr .8fr 70px 1fr auto; gap: 8px; min-width: 620px; }
.tag { display: inline-flex; min-height: 26px; align-items: center; margin: 2px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .78rem; font-weight: 650; }
.empty { padding: 28px; color: var(--muted); text-align: center; }

.variation-box { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.variation-toolbar { justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.variation-toolbar strong { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.sale-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sale-picker > :nth-child(1), .sale-picker > :nth-child(2), .sale-picker > :nth-child(5) { grid-column: span 2; }
.cart-table { min-width: 0; }
.cancel-form { margin: 0; }
.cancel-form .btn { min-height: 36px; padding: 0 12px; font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cart-total { display: flex; justify-content: flex-end; gap: 12px; align-items: center; font-size: 1.1rem; }
.cart-total span { color: var(--muted); }
.cart-total strong { color: var(--brand); font-family: var(--font-display); font-size: 1.5rem; letter-spacing: -0.02em; }

.alert-list { padding: 14px 18px 18px; display: grid; gap: 10px; }
.alert-item { padding: 13px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); border-left-width: 4px; display: grid; gap: 4px; }
.alert-item span { color: var(--muted); font-size: .88rem; }
.alert-item.warning { background: color-mix(in srgb, var(--warn) 10%, transparent); border-left-color: var(--warn); }
.alert-item.danger { background: color-mix(in srgb, var(--danger) 10%, transparent); border-left-color: var(--danger); }

/* ---- Avisos ---- */
.toast { padding: 13px 16px; border-radius: var(--radius-sm); background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-weight: 500; }
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--ok); color: #fff; }
.toast.floating { position: fixed; right: 18px; bottom: 18px; z-index: 1100; max-width: 340px; opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.toast.floating.show { opacity: 1; transform: translateY(0); }
.notice { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); overflow-wrap: anywhere; }

.demo-banner { background: var(--tag); color: var(--tag-ink); text-align: center; padding: 9px 14px; font-size: .88rem; font-weight: 600; }

/* ---- Entrada (login / cadastro / recuperar senha) ---- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 480px at 8% -5%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 60%), radial-gradient(700px 400px at 100% 100%, color-mix(in srgb, var(--tag) 22%, transparent), transparent 60%), var(--bg); }
.auth-card { width: min(440px, 100%); padding: 30px 28px 26px; border-top: 5px solid var(--brand); }
.auth-card h1 { margin: 10px 0 6px; font-size: 1.9rem; font-weight: 750; line-height: 1.1; }
.auth-card p { color: var(--muted); margin-top: 0; }
.auth-card .form { padding: 0; margin-top: 14px; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; color: var(--brand); letter-spacing: -0.01em; }
.auth-brand::before { content: "EF"; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); font-size: .72rem; font-weight: 800; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; color: var(--brand); font-weight: 600; }
.auth-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 6px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.btn.demo { width: 100%; min-height: 48px; font-weight: 700; color: #fff; background: linear-gradient(120deg, var(--brand-dark), var(--brand)); border: none; box-shadow: 0 10px 22px color-mix(in srgb, var(--brand) 32%, transparent); transition: transform .12s ease, box-shadow .12s ease; }
[data-theme="dark"] .btn.demo { color: #07130c; }
.btn.demo:hover { transform: translateY(-1px); box-shadow: 0 14px 26px color-mix(in srgb, var(--brand) 38%, transparent); }

/* ---- Menu do celular (some no desktop) ---- */
.menu-toggle, .menu-backdrop { display: none; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .split, .sales-grid, .chart-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(150px, 1fr)); }

  /* faixa fixa no topo: o conteúdo rola por baixo dela, não por baixo do botão */
  .app-shell::before { content: "Estoque Fácil Pro"; position: fixed; top: 0; left: 0; right: 0; height: 68px; padding-left: 76px; display: flex; align-items: center; background: var(--bg); border-bottom: 1px solid var(--line); z-index: 900; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; }

  .menu-toggle { display: flex; align-items: center; justify-content: center; position: fixed; top: 10px; left: 14px; width: 48px; height: 48px; z-index: 1001; border: none; border-radius: var(--radius-sm); background: var(--brand); color: var(--on-brand); font-size: 24px; cursor: pointer; box-shadow: var(--shadow); }
  .sidebar { position: fixed; top: 0; left: 0; width: 276px; max-width: 86vw; height: 100vh; z-index: 1000; padding: 78px 16px 24px; transform: translateX(-100%); visibility: hidden; transition: transform .3s ease, visibility 0s linear .3s; overflow-y: auto; }
  body.menu-open .sidebar { transform: translateX(0); visibility: visible; transition: transform .3s ease, visibility 0s; box-shadow: 18px 0 40px rgba(0, 0, 0, .3); }
  body.menu-open .menu-backdrop { display: block; position: fixed; inset: 0; z-index: 999; background: rgba(8, 18, 12, .55); }
  .nav a.active::after { left: -16px; }

  .main { padding-top: 88px; }

  body[data-demo-mode="true"] { --demo-h: 46px; padding-top: var(--demo-h); }
  body[data-demo-mode="true"] .demo-banner { position: fixed; top: 0; left: 0; right: 0; height: var(--demo-h); z-index: 950; display: block; overflow: hidden; padding: 7px 12px 0; font-size: .78rem; line-height: 1.25; }
  body[data-demo-mode="true"] .app-shell::before { top: var(--demo-h); }
  body[data-demo-mode="true"] .menu-toggle { top: calc(var(--demo-h) + 10px); }
  body[data-demo-mode="true"] .sidebar { padding-top: calc(var(--demo-h) + 78px); }
  body[data-demo-mode="true"] .main { padding-top: 84px; }
}

@media (max-width: 680px) {
  .main { padding: 88px 14px 40px; gap: 18px; }
  body[data-demo-mode="true"] .main { padding-top: 84px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .actions { flex-direction: row; }
  .actions .btn { flex: 1 1 0; min-height: 42px; padding: 0 10px; font-size: .92rem; }
  .filters { align-items: stretch; flex-direction: column; }
  .grid-2, .grid-4, .filters.wide { grid-template-columns: 1fr; }
  .sale-picker { grid-template-columns: 1fr 1fr; }
  .sale-picker > :nth-child(1), .sale-picker > :nth-child(2), .sale-picker > :nth-child(5) { grid-column: 1 / -1; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { min-height: 96px; padding: 14px 14px 12px; }
  .metric span { font-size: .8rem; }
  .metric strong { font-size: 1.28rem; }
  .auth-card { padding: 24px 20px 22px; }
  .toast.floating { left: 14px; right: 14px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
