/* =========================================================
   Omni Agente CRM — Design System
   Paleta extraída de omni.com.br (main.css) — out/2026
   ========================================================= */
:root {
  --primary: #E95814;
  --primary-700: #D14D10;
  --primary-600: #F08A5B;
  --primary-400: #F29B72;
  --primary-300: #F6BCA1;
  --primary-200: #FDEBE3;
  --primary-100: #FEF6F3;
  --orange-a: #F57821;
  --orange-b: #E54A26;
  --grad-brand: linear-gradient(135deg, #F47920 0%, #EE6422 55%, #E64925 100%);

  --brand-blue: #002FA7;
  --secondary: #013188;
  --secondary-900: #01215E;
  --secondary-700: #0F4199;
  --secondary-600: #2453A9;
  --secondary-500: #4C76C0;
  --secondary-400: #6689C8;
  --secondary-300: #85A0D2;
  --secondary-200: #C6D3EA;
  --secondary-100: #EDF1F8;
  --blue-300: #0035DE;
  --blue-200: #1B72FF;
  --blue-100: #19BFFF;
  --grad-navy: linear-gradient(160deg, #013188 0%, #01215E 100%);

  --text: #3E4149;
  --text-strong: #151618;
  --text-muted: #676D79;
  --text-soft: #A4A7AF;
  --border: #E1E2E4;
  --border-strong: #C2C5C9;
  --bg: #F7F7F8;
  --bg-soft: #F0F0F2;
  --surface: #FFFFFF;
  --surface-2: #FBFBFC;

  --success: #028E39; --success-bg: #E8F8EE;
  --error: #E53930;   --error-bg: #FEF0EF;
  --warning: #B7791F; --warning-bg: #FFF6DF;
  --info: #1B72FF;    --info-bg: #EAF2FF;
  --violet: #6D4AFF;  --violet-bg: #F0ECFF;

  --radius-sm: 8px; --radius: 12px; --radius-lg: 20px; --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(21,22,24,.06);
  --shadow-sm: 0 1px 3px rgba(21,22,24,.08), 0 1px 2px rgba(21,22,24,.04);
  --shadow: 0 6px 24px -6px rgba(1,49,136,.14), 0 2px 6px rgba(21,22,24,.05);
  --shadow-lg: 0 24px 60px -12px rgba(1,33,94,.28);
  --sidebar-w: 256px;
  --topbar-h: 64px;
  --font: 'Plus Jakarta Sans', 'Averta CY', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --text: #D9DBE0; --text-strong: #FFFFFF; --text-muted: #9AA0AC; --text-soft: #6B717D;
  --border: #2A2E37; --border-strong: #3A3F4A;
  --bg: #111317; --bg-soft: #181B21; --surface: #1A1D23; --surface-2: #1F232A;
  --primary-100: #2A1A12; --primary-200: #3A2216;
  --secondary-100: #17213A; --secondary-200: #24345A;
  --success-bg: #0F2A1B; --error-bg: #301615; --warning-bg: #2E2410; --info-bg: #13233F; --violet-bg: #231D3F;
  --success: #3CCB74; --error: #FF6B63; --warning: #F2B648; --info: #5B9BFF;
  --shadow: 0 6px 24px -6px rgba(0,0,0,.5); --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-200); text-decoration: none; }
a:hover { color: var(--primary); }
h1,h2,h3,h4 { color: var(--text-strong); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.bold { font-weight: 700; }
.semibold { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-blue { color: var(--secondary); }
:root[data-theme="dark"] .text-blue { color: var(--secondary-300); }

/* ---------- layout helpers ---------- */
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-16 { margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }
@media (max-width: 1200px) { .grid-5 { grid-template-columns: repeat(3, minmax(0,1fr)); } .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 860px) { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: minmax(0,1fr); } .span-2, .span-3 { grid-column: auto; } }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--grad-navy);
  color: #C6D3EA; display: flex; flex-direction: column; padding: 18px 14px; z-index: 40;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.sidebar .brand img { height: 30px; }
.sidebar .brand .brand-tag { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff; background: rgba(255,255,255,.12); border-radius: var(--radius-pill); padding: 3px 8px; }
.sidebar .tenant { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px; }
.sidebar .tenant .t-name { color: #fff; font-weight: 700; font-size: 13px; }
.sidebar .tenant .t-sub { font-size: 11px; color: #85A0D2; }
.nav-group { margin-bottom: 10px; }
.nav-group-title { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6689C8; padding: 8px 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: #C6D3EA;
  font-weight: 500; font-size: 13.5px; cursor: pointer; transition: background .15s var(--ease), color .15s;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 700; }
.nav-item.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
.nav-item .nav-badge { margin-left: auto; background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: var(--radius-pill); padding: 1px 7px; min-width: 20px; text-align: center; }
.sidebar .sidebar-foot { margin-top: auto; padding-top: 14px; font-size: 10.5px; color: #6689C8; line-height: 1.4; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 28px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .menu-btn { display: none; }
.search-trigger {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-soft); cursor: pointer;
}
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger kbd { margin-left: auto; }
kbd { font-family: inherit; font-size: 11px; font-weight: 600; background: var(--surface); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--text-muted); }
.topbar .spacer { flex: 1; }
.market-ticker { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.market-ticker b { color: var(--text-strong); font-weight: 700; }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius); display: grid; place-items: center; border: 1px solid transparent;
  background: transparent; color: var(--text-muted); cursor: pointer; position: relative; transition: background .15s;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text-strong); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--surface); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: var(--radius-pill); cursor: pointer; border: 1px solid var(--border); background: var(--surface); }
.user-chip:hover { border-color: var(--border-strong); }
.user-chip .u-name { font-weight: 700; font-size: 13px; color: var(--text-strong); line-height: 1.1; }
.user-chip .u-role { font-size: 11px; color: var(--text-muted); }
.content { padding: 28px; max-width: 1560px; width: 100%; margin: 0 auto; }
.legal-foot { padding: 14px 28px 24px; font-size: 11px; color: var(--text-soft); text-align: center; }

@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(1,33,94,.35); z-index: 35; }
  .topbar .menu-btn { display: grid; }
  .topbar { padding: 0 14px; }
  .content { padding: 18px 14px; }
  .market-ticker { display: none; }
  .user-chip .u-meta { display: none; }
}

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 12px; font-weight: 700; color: var(--primary); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.page-head .sub { color: var(--text-muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card-pad { padding: 20px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head h3 svg { width: 18px; height: 18px; color: var(--primary); }
.card-body { padding: 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); }
.card.hover { transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s; cursor: pointer; }
.card.hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--secondary-200); }
.card.navy { background: var(--grad-navy); color: #C6D3EA; border: 0; }
.card.navy h1, .card.navy h2, .card.navy h3 { color: #fff; }
.card.orange { background: var(--grad-brand); color: #fff; border: 0; }

/* KPI */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi .kpi-label { font-size: 12px; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.kpi .kpi-label svg { width: 15px; height: 15px; }
.kpi .kpi-value { font-size: 26px; font-weight: 800; color: var(--text-strong); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .kpi-foot { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.kpi .kpi-icon { position: absolute; right: 16px; top: 16px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-100); color: var(--primary); }
.kpi .kpi-icon svg { width: 19px; height: 19px; }
.kpi .kpi-icon.blue { background: var(--secondary-100); color: var(--secondary); }
:root[data-theme="dark"] .kpi .kpi-icon.blue { color: var(--secondary-300); }
.kpi .kpi-icon.green { background: var(--success-bg); color: var(--success); }
.kpi .kpi-icon.red { background: var(--error-bg); color: var(--error); }
.kpi .kpi-icon.violet { background: var(--violet-bg); color: var(--violet); }
.delta { font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; gap: 2px; }
.delta.up { color: var(--success); } .delta.down { color: var(--error); }

/* progress */
.progress { height: 8px; background: var(--bg-soft); border-radius: var(--radius-pill); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad-brand); border-radius: inherit; transition: width .6s var(--ease); }
.progress.blue > span { background: linear-gradient(90deg, var(--secondary-600), var(--blue-200)); }
.progress.green > span { background: var(--success); }
.progress.lg { height: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--radius); border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 13.5px;
  cursor: pointer; transition: all .15s var(--ease); white-space: nowrap; user-select: none; text-decoration: none;
}
.btn svg { width: 17px; height: 17px; stroke-width: 2.1; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px -2px rgba(233,88,20,.45); }
.btn-primary:hover { background: var(--primary-700); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--primary); border-color: var(--primary-400); }
.btn-secondary:hover { background: var(--primary-100); color: var(--primary); }
.btn-navy { background: var(--secondary); color: #fff; }
.btn-navy:hover { background: var(--secondary-700); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text-strong); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-success { background: var(--success); color: #fff; }
.btn-whats { background: #25D366; color: #fff; }
.btn-whats:hover { background: #1EBE5A; color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 8px; gap: 5px; }
.btn-xs svg { width: 13px; height: 13px; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-xs.btn-icon { width: 26px; }
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; grid-column: span 6; min-width: 0; }
.field.c-2 { grid-column: span 2; } .field.c-3 { grid-column: span 3; } .field.c-4 { grid-column: span 4; }
.field.c-5 { grid-column: span 5; } .field.c-6 { grid-column: span 6; } .field.c-8 { grid-column: span 8; } .field.c-9 { grid-column: span 9; } .field.c-12 { grid-column: span 12; }
@media (max-width: 720px) { .field, .field[class*="c-"] { grid-column: span 12; } }
.field label, .label { font-size: 12px; font-weight: 700; color: var(--text); }
.field label .req { color: var(--primary); }
.field .hint { font-size: 11.5px; color: var(--text-muted); }
.field .err { font-size: 11.5px; color: var(--error); font-weight: 600; }
.form-section { grid-column: 1 / -1; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--secondary-500); padding-top: 6px; border-top: 1px dashed var(--border); margin-top: 4px; }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--text-strong); font: inherit; font-size: 13.5px; transition: border-color .15s, box-shadow .15s; outline: none;
}
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23676D79' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary-400); box-shadow: 0 0 0 4px rgba(233,88,20,.12); }
.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--error); box-shadow: 0 0 0 4px rgba(229,57,48,.1); }
.input:disabled, .select:disabled { background: var(--bg-soft); color: var(--text-muted); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 36px; }
.input-group > svg, .input-group > .prefix { position: absolute; left: 11px; width: 17px; height: 17px; color: var(--text-soft); pointer-events: none; font-size: 13px; font-weight: 700; }
.input-group .suffix { position: absolute; right: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; font-size: 13.5px; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.switch { position: relative; width: 38px; height: 22px; display: inline-block; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 22px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-xs); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(16px); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input, .toolbar .select { height: 38px; width: auto; min-width: 160px; }
.toolbar .search { min-width: 260px; flex: 1; max-width: 380px; }
.seg { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { white-space: nowrap; flex-shrink: 0; }
.seg button { border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-muted); height: 30px; padding: 0 12px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button svg { width: 15px; height: 15px; }
.seg button.active { background: var(--surface); color: var(--text-strong); box-shadow: var(--shadow-xs); }

/* chips / badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--bg-soft); color: var(--text-muted); }
.badge svg { width: 12px; height: 12px; }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.orange { background: var(--primary-100); color: var(--primary); }
.badge.blue { background: var(--secondary-100); color: var(--secondary); }
:root[data-theme="dark"] .badge.blue { color: var(--secondary-300); }
.badge.green { background: var(--success-bg); color: var(--success); }
.badge.red { background: var(--error-bg); color: var(--error); }
.badge.yellow { background: var(--warning-bg); color: var(--warning); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.violet { background: var(--violet-bg); color: var(--violet); }
.badge.gray { background: var(--bg-soft); color: var(--text-muted); }
.badge.navy { background: var(--secondary); color: #fff; }
.badge.solid-orange { background: var(--primary); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text); }
.chip.active { border-color: var(--primary); background: var(--primary-100); color: var(--primary); }
.semaforo { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; }
.semaforo i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); background: currentColor; }
.semaforo.verde { color: var(--success); } .semaforo.amarelo { color: var(--warning); } .semaforo.vermelho { color: var(--error); }

/* avatar */
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; color: #fff; background: var(--secondary-600); flex-shrink: 0; letter-spacing: .02em; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }
.avatar.sq { border-radius: 12px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text-strong); }
.table th .sort-ind { opacity: .5; margin-left: 4px; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.table tbody tr { transition: background .12s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.right, .table th.right { text-align: right; }
.table .cell-main { font-weight: 700; color: var(--text-strong); }
.table .cell-sub { font-size: 11.5px; color: var(--text-muted); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: 60vh; }
.kanban-col { flex: 0 0 290px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.kanban-col-head { padding: 12px 14px 10px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.kanban-col-head .k-title { font-weight: 800; font-size: 12.5px; color: var(--text-strong); text-transform: uppercase; letter-spacing: .04em; }
.kanban-col-head .k-count { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.kanban-col-head .k-bar { width: 4px; height: 16px; border-radius: 2px; }
.kanban-col-sum { padding: 6px 14px; font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.kanban-list { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 80px; flex: 1; }
.kanban-list.drag-over { background: var(--primary-100); border-radius: 12px; }
.k-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; cursor: grab; box-shadow: var(--shadow-xs); transition: box-shadow .15s, border-color .15s; }
.k-card:hover { box-shadow: var(--shadow-sm); border-color: var(--secondary-200); }
.k-card.dragging { opacity: .45; }
.k-card .k-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.k-card .k-name { font-weight: 700; font-size: 13px; color: var(--text-strong); }
.k-card .k-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.k-card .k-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 6px; }
.k-card .k-value { font-weight: 800; font-size: 13px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.k-card.late { border-left: 3px solid var(--error); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 10px 14px; font-weight: 700; font-size: 13px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit; }
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text-strong); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .badge { height: 18px; padding: 0 6px; font-size: 10.5px; }

/* ---------- modal / drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(1,21,60,.45); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fadeIn .18s var(--ease); }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; animation: popIn .22s var(--ease); }
.modal.sm { max-width: 440px; } .modal.lg { max-width: 920px; } .modal.xl { max-width: 1200px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.modal-head h2 { flex: 1; font-size: 17px; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.drawer-overlay { place-items: stretch end; padding: 0; }
.drawer { background: var(--surface); width: min(720px, 100vw); height: 100vh; height: 100dvh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slideIn .26s var(--ease); }
.drawer.lg { width: min(980px, 100vw); }
.drawer .modal-foot { border-radius: 0; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }

/* toast */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 280px; max-width: 420px; background: var(--text-strong); color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; font-size: 13px; font-weight: 500; animation: popIn .2s var(--ease); }
:root[data-theme="dark"] .toast { background: #2A2E37; }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast.success svg { color: #3CCB74; } .toast.error svg { color: #FF6B63; } .toast.warning svg { color: #F2B648; } .toast.info svg { color: #5B9BFF; }

/* popover / dropdown */
.popover { position: fixed; z-index: 150; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; animation: popIn .15s var(--ease); }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text); }
.menu-item svg { width: 16px; height: 16px; color: var(--text-muted); }
.menu-item:hover { background: var(--bg-soft); color: var(--text-strong); }
.menu-item.danger, .menu-item.danger svg { color: var(--error); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }

/* command palette */
.cmdk { max-width: 640px; align-self: start; margin-top: 10vh; }
.cmdk .cmdk-input { border: 0; height: 56px; font-size: 16px; padding: 0 20px 0 50px; border-bottom: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: none !important; }
.cmdk .cmdk-wrap { position: relative; }
.cmdk .cmdk-wrap > svg { position: absolute; left: 18px; top: 18px; width: 20px; height: 20px; color: var(--text-soft); }
.cmdk-results { max-height: 420px; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.cmdk-item.sel, .cmdk-item:hover { background: var(--primary-100); }
.cmdk-item .ci-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--secondary-100); color: var(--secondary); display: grid; place-items: center; }
.cmdk-item .ci-icon svg { width: 16px; height: 16px; }

/* list items / timeline */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: var(--surface-2); }
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item .tl-dot { position: absolute; left: -26px; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--secondary-300); display: grid; place-items: center; }
.tl-item .tl-dot svg { width: 11px; height: 11px; color: var(--secondary); }
:root[data-theme="dark"] .cmdk-item .ci-icon, :root[data-theme="dark"] .tl-item .tl-dot svg { color: var(--secondary-300); }
.tl-item .tl-title { font-weight: 700; font-size: 13px; color: var(--text-strong); }
.tl-item .tl-meta { font-size: 11.5px; color: var(--text-muted); }
.tl-item .tl-body { font-size: 13px; margin-top: 4px; white-space: pre-wrap; }

/* empty state */
.empty { padding: 48px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .empty-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--primary-100); color: var(--primary); display: grid; place-items: center; margin-bottom: 6px; }
.empty .empty-icon svg { width: 28px; height: 28px; }
.empty h3 { font-size: 16px; }
.empty p { color: var(--text-muted); max-width: 420px; }

/* stat list */
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row .v { font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }

/* hero banner */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 26px 28px; color: #fff; min-height: 168px;
  background: var(--grad-navy); background-size: cover; background-position: right center;
}
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(1,33,94,.96) 0%, rgba(1,49,136,.82) 45%, rgba(1,49,136,.05) 100%); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: 26px; }
.hero .hero-sub { color: #C6D3EA; margin-top: 4px; }
.orbit-deco { position: absolute; right: -60px; top: -40px; width: 340px; height: 160px; border-radius: 50%; border: 3px solid rgba(244,121,32,.55); transform: rotate(-12deg); z-index: 0; }

/* charts */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 200px; } .chart-box.lg { height: 340px; }

/* map */
.map { height: 520px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); z-index: 0; }
.leaflet-container { font-family: var(--font) !important; }
.pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.3); }

/* vehicle cards */
.veh-card { overflow: hidden; display: flex; flex-direction: column; }
.veh-card .veh-img { height: 150px; background: linear-gradient(135deg, var(--secondary-100), var(--bg-soft)); display: grid; place-items: center; color: var(--secondary-300); position: relative; background-size: cover; background-position: center; }
.veh-card .veh-img svg { width: 56px; height: 56px; stroke-width: 1.2; }
.veh-card .veh-img .badge { position: absolute; top: 10px; left: 10px; }
.veh-card .veh-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.veh-card .veh-price { font-size: 19px; font-weight: 800; color: var(--text-strong); font-variant-numeric: tabular-nums; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--surface); }
.login-art { position: relative; background: #01215E url('../assets/login-hero.jpg') center/cover; color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login-art::before { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(1,21,60,.94) 0%, rgba(1,49,136,.7) 50%, rgba(1,49,136,.15) 100%); }
.login-art > * { position: relative; }
.login-art h1 { color: #fff; font-size: 40px; line-height: 1.12; max-width: 520px; letter-spacing: -.025em; }
.login-art h1 em { font-style: normal; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-art .feat { display: flex; gap: 22px; flex-wrap: wrap; color: #C6D3EA; font-size: 13px; }
.login-art .feat div { display: flex; gap: 8px; align-items: center; }
.login-art .feat svg { width: 18px; height: 18px; color: var(--primary-600); }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-box { width: 100%; max-width: 420px; }
.login-box .logo { height: 44px; margin-bottom: 28px; }
.tenant-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; cursor: pointer; transition: all .15s; background: var(--surface); }
.tenant-card:hover, .tenant-card.sel { border-color: var(--primary); background: var(--primary-100); }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } }

/* misc */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.dot-sep::before { content: '•'; margin: 0 6px; color: var(--text-soft); }
.pill-tabs { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.notice { padding: 12px 14px; border-radius: 12px; font-size: 12.5px; display: flex; gap: 10px; align-items: flex-start; }
.notice svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.notice.info { background: var(--info-bg); color: var(--info); }
.notice.warning { background: var(--warning-bg); color: var(--warning); }
.notice.error { background: var(--error-bg); color: var(--error); }
.notice.success { background: var(--success-bg); color: var(--success); }
.notice.orange { background: var(--primary-100); color: var(--primary-700); }
.notice b { color: inherit; }
.skeleton { background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border) 50%, var(--bg-soft) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 16px; padding: 28px; text-align: center; color: var(--text-muted); cursor: pointer; transition: all .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-100); color: var(--primary); }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.doc-row + .doc-row { margin-top: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-cell { min-height: 108px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; font-size: 12px; background: var(--surface); }
.cal-cell.other { background: var(--surface-2); color: var(--text-soft); }
.cal-cell.today .cal-day { background: var(--primary); color: #fff; }
.cal-day { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.cal-ev { font-size: 11px; padding: 2px 6px; border-radius: 6px; margin-top: 3px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--text-muted); letter-spacing: .06em; padding: 8px 0; text-align: center; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
@media print {
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .app { display: block; } .content { padding: 0; } .card { box-shadow: none; break-inside: avoid; }
  /* tema escuro não vai pro papel: volta aos tokens claros */
  :root[data-theme="dark"] {
    --text: #3E4149; --text-strong: #151618; --text-muted: #676D79; --text-soft: #A4A7AF;
    --border: #E1E2E4; --border-strong: #C2C5C9;
    --bg: #fff; --bg-soft: #F0F0F2; --surface: #fff; --surface-2: #FBFBFC;
    --primary-100: #FEF6F3; --primary-200: #FDEBE3;
    --secondary-100: #EDF1F8; --secondary-200: #C6D3EA;
    --success-bg: #E8F8EE; --error-bg: #FEF0EF; --warning-bg: #FFF6DF; --info-bg: #EAF2FF; --violet-bg: #F0ECFF;
    --success: #028E39; --error: #E53930; --warning: #B7791F; --info: #1B72FF;
    color-scheme: light;
  }
}

/* rodapé de modal e cabeçalho de card no celular: quebram linha em vez de vazar */
@media (max-width: 560px) {
  .modal-foot .btn { flex: 1 1 auto; }
  .card-head > .row:not(:empty) { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
}

/* topbar no celular: busca vira só ícone, sem estourar a largura */
@media (max-width: 640px) {
  .topbar { gap: 4px; }
  .search-trigger { flex: 1; min-width: 0; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .user-chip { padding: 2px; border: 0; }
  .user-chip > svg { display: none; }
  .orbit-deco { display: none; }
}

/* modais nunca mais largos que a tela (a trilha do grid do overlay crescia até o conteúdo) */
.overlay { grid-template-columns: minmax(0, 100%); }
.modal, .drawer { min-width: 0; }
@media (max-width: 640px) {
  .overlay:not(.drawer-overlay) { padding: 8px; }
  .modal { max-height: calc(100vh - 16px); }
  .modal-body { padding: 16px; }
  .modal-foot { flex-wrap: wrap; }
}

/* =========================================================
   MOBILE-FIRST / PREMIUM — camada final de responsividade
   Breakpoints: <=1024 shell off-canvas · <=860 grids · <=768 mobile · <=480 compacto
   ========================================================= */

/* toque: sem flash cinza, sem delay de 300ms, sem double-tap zoom em controles */
html { -webkit-tap-highlight-color: transparent; }
body { overflow-x: clip; overscroll-behavior-y: none; }
button, a, .nav-item, .tab, .chip, .menu-item, .seg button, .check, label { touch-action: manipulation; }
::selection { background: var(--primary-200); }
:focus-visible { outline: 2px solid var(--primary-400); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- mobile base (<=768px) ---------- */
@media (max-width: 768px) {
  body { font-size: 14.5px; }
  .content { padding: 16px 12px calc(24px + env(safe-area-inset-bottom)); }
  .legal-foot { padding: 10px 14px calc(20px + env(safe-area-inset-bottom)); }

  /* iOS dá zoom automático em input <16px — subir a fonte só no mobile */
  .input, .select, .textarea { font-size: 16px; height: 44px; }
  .textarea { min-height: 96px; }
  .btn { height: 44px; }
  .btn-sm { height: 38px; }
  .icon-btn { width: 44px; height: 44px; }
  .nav-item { min-height: 46px; font-size: 14.5px; }
  .tab { padding: 12px 14px; font-size: 13.5px; }
  .chip { height: 36px; }
  .menu-item { min-height: 44px; font-size: 14px; }
  .check { min-height: 32px; }

  /* página: título menor, ações em largura total quando couber */
  .page-head { margin-bottom: 16px; gap: 12px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  h1 { font-size: 21px; }
  h2 { font-size: 17px; }

  /* cartões e KPIs respiram menos, número maior contraste */
  .card-pad, .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .card-foot { padding: 10px 16px; }
  .kpi { padding: 16px; }
  .kpi .kpi-value { font-size: 24px; }
  .kpi .kpi-icon { width: 34px; height: 34px; top: 14px; right: 14px; }

  /* tabelas: fonte e respiro menores; wrap já rola na horizontal */
  .table { font-size: 12.5px; }
  .table th { padding: 9px 10px; }
  .table td { padding: 10px; }
  .pager { flex-wrap: wrap; gap: 8px; }

  /* toolbar: busca ocupa a linha toda */
  .toolbar { gap: 8px; }
  .toolbar .search { min-width: 0; max-width: none; flex: 1 1 100%; }
  .toolbar .input, .toolbar .select { min-width: 0; }

  /* formulários já empilham em 720px; aqui só respiro */
  .form-grid { gap: 12px 12px; }

  /* kanban: coluna quase full-width no touch */
  .kanban-col { flex-basis: min(320px, 86vw); }
  .kanban-col-head .k-title { font-size: 12px; }

  /* modal vira bottom-sheet premium */
  .overlay:not(.drawer-overlay) { padding: 0; place-items: end stretch; }
  .modal { max-width: none; width: 100%; max-height: 92dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; animation: slideUp .28s var(--ease); }
  .modal.lg, .modal.xl { max-width: none; }
  .modal-head { padding: 16px 18px 12px; position: relative; }
  .modal-head::before { content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 38px; height: 4px; border-radius: 4px; background: var(--border-strong); }
  .modal-body { padding: 14px 18px 20px; }
  .modal-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1 1 auto; min-height: 44px; }
  .cmdk { align-self: end; margin-top: 0; max-height: 88dvh; }
  .cmdk .cmdk-input { height: 52px; font-size: 16px; }
  @keyframes slideUp { from { transform: translateY(48px); opacity: .4; } }

  /* drawer já é 100vw; só safe-area no rodapé */
  .drawer .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }

  /* toasts: largura total, acima da área do polegar */
  .toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; max-width: none; }

  /* popovers nunca vazam da viewport */
  .popover { max-width: calc(100vw - 24px); }

  /* calendário: células mais baixas pra caber o mês inteiro */
  .cal-cell { min-height: 64px; font-size: 11px; padding: 4px; }
  .cal-ev { font-size: 10px; }

  /* mapa e gráficos acompanham a largura */
  .map { height: 380px; }
  .chart-box { height: 240px; }
  .chart-box.lg { height: 280px; }

  /* hero mais compacto */
  .hero { min-height: 130px; padding: 20px 18px; }
  .hero h1 { font-size: 21px; }

  /* lista/timeline sem padding lateral de desktop */
  .list-item { padding: 12px 14px; }

  /* veículo e documento respiram */
  .veh-card .veh-img { height: 130px; }
  .doc-row { flex-wrap: wrap; }

  /* empty state menos alto */
  .empty { padding: 32px 16px; }
  .empty .empty-icon { width: 52px; height: 52px; }
  .empty .empty-icon svg { width: 24px; height: 24px; }
}

/* ---------- compacto (<=480px) ---------- */
@media (max-width: 480px) {
  .content { padding: 12px 10px calc(20px + env(safe-area-inset-bottom)); }
  .kpi .kpi-value { font-size: 21px; }
  .kpi .kpi-label { font-size: 11px; }
  .badge { height: 20px; font-size: 10.5px; }
  .avatar { width: 30px; height: 30px; font-size: 11px; }
  .avatar.lg { width: 44px; height: 44px; }
  .avatar.xl { width: 60px; height: 60px; }
  .seg { width: 100%; }
  .seg button { flex: 1; justify-content: center; }
  .search-trigger { height: 40px; }
  .topbar { height: 56px; }
  .user-chip .u-name { font-size: 12px; }
  .stat-row { font-size: 12.5px; }
}

/* ---------- telas médias (481–860px): grids já empilham; refinamentos ---------- */
@media (min-width: 481px) and (max-width: 860px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .content { padding: 22px 16px; }
}

/* ---------- desktop wide: aproveita o espaço ---------- */
@media (min-width: 1600px) {
  .content { max-width: 1720px; }
  .grid-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
}
