/* =====================================================================
   style.css — Design System "Gestão Comercial"
   Tema: Azul corporativo · Light & Dark · Responsivo
   Estrutura:
     1. Tokens (variáveis de tema)
     2. Base / reset
     3. Layout (shell, sidebar, topbar)
     4. Componentes (cards, KPIs, tabelas, botões, badges…)
     5. Telas específicas (PDV, login)
     6. Utilitários e animações
     7. Responsivo
   ===================================================================== */

/* ============ 1. TOKENS ============ */
:root {
  --brand:        #2563eb;
  --brand-600:    #1d4ed8;
  --brand-700:    #1e40af;
  --brand-soft:   rgba(37, 99, 235, .12);
  --brand-grad:   linear-gradient(135deg, #2563eb 0%, #1e40af 100%);

  --ok:    #16a34a;  --ok-soft:    rgba(22,163,74,.12);
  --warn:  #d97706;  --warn-soft:  rgba(217,119,6,.14);
  --danger:#dc2626;  --danger-soft:rgba(220,38,38,.12);
  --info:  #0ea5e9;  --info-soft:  rgba(14,165,233,.12);
  --purple:#7c3aed;

  --radius:   16px;
  --radius-sm:10px;
  --radius-lg:22px;
  --sidebar-w:264px;
  --topbar-h:64px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Light ---- */
[data-bs-theme="light"] {
  --bg:        #f4f6fb;
  --bg-2:      #eef1f8;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --border:    #e6e9f2;
  --border-2:  #eef1f7;
  --text:      #0f172a;
  --text-2:    #475569;
  --text-3:    #94a3b8;
  --shadow:    0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.12);
  --sidebar-bg:#0f1b3d;
  --sidebar-text:#c7d2e8;
}
/* ---- Dark ---- */
[data-bs-theme="dark"] {
  --bg:        #0b1020;
  --bg-2:      #0f1525;
  --surface:   #151b2e;
  --surface-2: #1b2238;
  --border:    #26304b;
  --border-2:  #202942;
  --text:      #eef2fb;
  --text-2:    #9fb0cd;
  --text-3:    #6b7a9c;
  --shadow:    0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.5);
  --sidebar-bg:#0a0f1f;
  --sidebar-text:#aab8d4;
  --brand-soft: rgba(59,130,246,.18);
}

/* ============ 2. BASE ============ */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14.5px;
}
a { text-decoration: none; cursor: pointer; color: var(--brand); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
.text-muted-2 { color: var(--text-2) !important; }
.text-3 { color: var(--text-3) !important; }

/* ============ 3. LAYOUT ============ */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(255,255,255,.04);
  z-index: 60;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px; height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand-logo {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; font-size: 18px;
  box-shadow: 0 6px 16px rgba(37,99,235,.4); flex: none;
}
.brand-name { font-weight: 700; color: #fff; font-size: 15.5px; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-close { margin-left: auto; color: var(--sidebar-text); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.nav-section {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .9px;
  text-transform: uppercase; color: rgba(255,255,255,.32);
  padding: 16px 12px 7px;
}
.nav-section:first-child { padding-top: 4px; }
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 11px; margin-bottom: 2px;
  color: var(--sidebar-text); font-weight: 500; font-size: 14px;
  transition: background .15s, color .15s; position: relative;
}
.sidebar-nav .nav-link i { font-size: 17px; width: 20px; text-align: center; opacity: .9; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--brand-grad); color: #fff; box-shadow: 0 8px 20px rgba(37,99,235,.35); }
.sidebar-nav .nav-link.active i { opacity: 1; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 20px; min-width: 20px; text-align: center;
}
.nav-badge:empty { display: none; }

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.06); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: rgba(255,255,255,.05); }
.user-meta { line-height: 1.2; overflow: hidden; }
.user-meta strong { color: #fff; font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: var(--sidebar-text); font-size: 11.5px; }
.user-chip .btn-icon { margin-left: auto; color: var(--sidebar-text); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--brand-grad); color: #fff;
}
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }

.sidebar-overlay { display: none; }

/* ---- Main / Topbar ---- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.global-search {
  position: relative; flex: 1; max-width: 520px;
  display: flex; align-items: center;
}
.global-search > i { position: absolute; left: 14px; color: var(--text-3); font-size: 15px; pointer-events: none; }
.global-search input {
  width: 100%; height: 42px; padding: 0 14px 0 40px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.global-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search-results {
  position: absolute; top: 50px; left: 0; right: 0; z-index: 80;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 60vh; overflow-y: auto; display: none;
}
.search-results.show { display: block; }
.search-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; cursor: pointer; }
.search-item:hover, .search-item.active { background: var(--surface-2); }
.search-item .si-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.search-cat { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); padding: 8px 11px 4px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.view { padding: 24px 22px 60px; max-width: 1500px; width: 100%; margin: 0 auto; }

/* ============ 4. COMPONENTES ============ */
.btn-icon {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); display: inline-grid; place-items: center;
  cursor: pointer; transition: background .15s, color .15s; font-size: 17px; position: relative;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
[data-bs-theme="light"] .btn-icon:hover { background: var(--bg-2); }

.theme-icon-light { display: none; }
[data-bs-theme="dark"] .theme-icon-dark { display: none; }
[data-bs-theme="dark"] .theme-icon-light { display: inline; }

.card-soft {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }

/* page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 23px; font-weight: 800; letter-spacing: -.5px; margin: 0; }
.page-head .sub { color: var(--text-2); font-size: 13.5px; margin: 4px 0 0; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* KPI cards */
.kpi-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kpi-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; }
.kpi-label { color: var(--text-2); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kpi-value { font-size: 25px; font-weight: 800; letter-spacing: -.6px; line-height: 1.1; margin-top: 3px; }
.kpi-foot { margin-top: 9px; font-size: 12.5px; display: flex; align-items: center; gap: 5px; color: var(--text-2); }
.trend-up { color: var(--ok); font-weight: 600; }
.trend-down { color: var(--danger); font-weight: 600; }

.ic-blue   { background: var(--brand-soft); color: var(--brand); }
.ic-green  { background: var(--ok-soft);    color: var(--ok); }
.ic-orange { background: var(--warn-soft);  color: var(--warn); }
.ic-red    { background: var(--danger-soft);color: var(--danger); }
.ic-info   { background: var(--info-soft);  color: var(--info); }
.ic-purple { background: rgba(124,58,237,.13); color: var(--purple); }

/* generic panel */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.panel-head h2, .panel-head h3 { font-size: 15.5px; font-weight: 700; margin: 0; }
.panel-body { padding: 18px; }

/* tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.6px; }
table.data thead th {
  text-align: left; font-weight: 600; color: var(--text-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
  padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface);
}
table.data tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-click { cursor: pointer; }

/* badges */
.badge-soft { font-weight: 600; font-size: 11.5px; padding: 4px 10px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; }
.b-green  { background: var(--ok-soft);    color: var(--ok); }
.b-orange { background: var(--warn-soft);  color: var(--warn); }
.b-red    { background: var(--danger-soft);color: var(--danger); }
.b-blue   { background: var(--brand-soft); color: var(--brand); }
.b-info   { background: var(--info-soft);  color: var(--info); }
.b-gray   { background: var(--surface-2);  color: var(--text-2); border: 1px solid var(--border); }
.b-purple { background: rgba(124,58,237,.13); color: var(--purple); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* buttons (override bootstrap a bit) */
.btn { font-weight: 600; border-radius: 11px; font-size: 14px; }
.btn-sm { border-radius: 9px; font-size: 13px; }
.btn-lg { border-radius: 13px; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-soft { background: var(--brand-soft); color: var(--brand); border: 1px solid transparent; }
.btn-soft:hover { background: var(--brand); color: #fff; }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-success { background: var(--ok); border-color: var(--ok); }

/* forms */
.form-control, .form-select {
  background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 11px;
  padding: 9px 12px; font-size: 14px;
}
.form-control:focus, .form-select:focus { background: var(--surface); color: var(--text); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.form-label { font-weight: 600; font-size: 13px; margin-bottom: 5px; color: var(--text-2); }
.input-group-text { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); border-radius: 11px; }

/* segmented / chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all .15s; white-space: nowrap;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* empty state */
.empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty i { font-size: 40px; opacity: .5; display: block; margin-bottom: 12px; }
.empty p { margin: 0; font-size: 14px; }

/* mini list (top produtos/clientes) */
.rank-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-2); }
.rank-item:last-child { border-bottom: 0; }
.rank-pos { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: var(--text-2); flex: none; }
.rank-pos.gold { background: #fde68a; color: #92400e; }
.rank-pos.silver { background: #e2e8f0; color: #475569; }
.rank-pos.bronze { background: #fcd9b6; color: #9a3412; }
.rank-meta { flex: 1; min-width: 0; }
.rank-meta strong { font-size: 13.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-meta small { color: var(--text-2); font-size: 12px; }
.rank-val { font-weight: 700; font-size: 13.5px; white-space: nowrap; }

.progress-thin { height: 6px; background: var(--surface-2); border-radius: 10px; overflow: hidden; }
.progress-thin > span { display: block; height: 100%; border-radius: 10px; }

/* thumbnails */
.thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); font-size: 17px; flex: none; }

/* ============ 5. TELAS ESPECÍFICAS ============ */

/* ---- PDV ---- */
.pdv { display: grid; grid-template-columns: 1fr 400px; gap: 18px; align-items: start; }
.pdv-catalog .pdv-search { position: relative; margin-bottom: 14px; }
.pdv-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.prod-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px;
  cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s; text-align: left; position: relative;
}
.prod-card:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow); }
.prod-card .pc-thumb { width: 100%; height: 64px; border-radius: 10px; display: grid; place-items: center; font-size: 26px; margin-bottom: 10px; }
.prod-card .pc-name { font-size: 13px; font-weight: 600; line-height: 1.25; min-height: 32px; }
.prod-card .pc-price { font-weight: 800; color: var(--brand); margin-top: 6px; font-size: 15px; }
.prod-card .pc-stock { position: absolute; top: 8px; right: 8px; font-size: 10.5px; }

.cart { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; max-height: calc(100vh - var(--topbar-h) - 36px); }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cart-items { flex: 1; overflow-y: auto; padding: 6px 12px; min-height: 120px; }
.cart-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--border-2); }
.cart-row:last-child { border-bottom: 0; }
.cart-row .ci-name { flex: 1; min-width: 0; }
.cart-row .ci-name strong { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-row .ci-name small { color: var(--text-2); font-size: 11.5px; }
.qty-step { display: flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.qty-step button { width: 28px; height: 28px; border: 0; background: var(--surface-2); color: var(--text); font-weight: 700; cursor: pointer; }
.qty-step button:hover { background: var(--brand); color: #fff; }
.qty-step span { min-width: 30px; text-align: center; font-weight: 700; font-size: 13px; }
.cart-foot { border-top: 1px solid var(--border); padding: 16px 18px; }
.cart-total-row { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; color: var(--text-2); }
.cart-total-row.grand { font-size: 21px; font-weight: 800; color: var(--text); margin: 10px 0 14px; }

/* payment method picker */
.pay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-opt {
  border: 1px solid var(--border); border-radius: 11px; padding: 11px 6px; text-align: center; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--text-2); transition: all .15s; background: var(--surface);
}
.pay-opt i { display: block; font-size: 18px; margin-bottom: 5px; }
.pay-opt:hover { border-color: var(--brand); color: var(--brand); }
.pay-opt.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* receipt */
.receipt { font-family: 'Courier New', monospace; background: #fff; color: #111; padding: 22px; border-radius: 10px; max-width: 320px; margin: 0 auto; font-size: 13px; }
.receipt hr { border: 0; border-top: 1px dashed #999; margin: 10px 0; }
.receipt .r-row { display: flex; justify-content: space-between; }
.receipt h3 { text-align: center; margin: 0 0 2px; font-size: 16px; }

/* ---- Login ---- */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 80% -10%, var(--brand-soft), transparent), var(--bg); }
.login-card { width: 100%; max-width: 410px; padding: 34px; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-brand .brand-logo { width: 50px; height: 50px; font-size: 23px; border-radius: 14px; }
.login-title { font-size: 20px; font-weight: 800; margin: 0; letter-spacing: -.4px; }
.login-sub { color: var(--text-2); margin: 2px 0 0; font-size: 13.5px; }
.login-hint { text-align: center; font-size: 12.5px; color: var(--text-3); margin: 16px 0 0; }

/* ============ 6. UTILITÁRIOS / ANIMAÇÕES ============ */
.fade-in { animation: fadeIn .35s ease both; }
.slide-up { animation: slideUp .4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.stagger > * { animation: slideUp .45s cubic-bezier(.2,.8,.2,1) both; }
.stagger > *:nth-child(1){animation-delay:.02s}.stagger > *:nth-child(2){animation-delay:.06s}
.stagger > *:nth-child(3){animation-delay:.10s}.stagger > *:nth-child(4){animation-delay:.14s}
.stagger > *:nth-child(5){animation-delay:.18s}.stagger > *:nth-child(6){animation-delay:.22s}

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border-2) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.gap-cards { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.grid-2-1 { display: grid; gap: 16px; grid-template-columns: 2fr 1fr; }
.mono { font-variant-numeric: tabular-nums; }
.cursor { cursor: pointer; }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }

/* toast */
.toast { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-lg); }
.toast .toast-body { display: flex; align-items: center; gap: 10px; font-weight: 500; }

/* modal */
.modal-content.card-soft { border: 1px solid var(--border); }
.modal-header, .modal-footer { border-color: var(--border); }

/* dropdown */
.dropdown-menu { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-lg); padding: 6px; }
.dropdown-item { border-radius: 9px; padding: 8px 12px; font-size: 13.5px; color: var(--text); }
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.dropdown-header { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }

/* ============ 7. RESPONSIVO ============ */
@media (max-width: 1100px) {
  .pdv { grid-template-columns: 1fr; }
  .cart { position: static; max-height: none; }
  .grid-2-1, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 992px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.2,.8,.2,1);
  }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .app-shell.nav-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(2,6,23,.55); z-index: 55; }
}
@media (max-width: 640px) {
  .view { padding: 16px 14px 50px; }
  .topbar { padding: 0 14px; }
  .page-head h1 { font-size: 20px; }
  .kpi-value { font-size: 22px; }
  .pay-grid { grid-template-columns: repeat(3, 1fr); }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .app-shell { display: block; }
  .view { padding: 0; }
}
