/* =====================================================================
   PLATAFORMA GERENCIAL — Design system
   Temas por empresa via CSS Custom Properties (--brand, --brand-2, --accent, --radius, --font)
   ===================================================================== */

:root {
  --brand: #1E3A8A; --brand-2: #0EA5E9; --accent: #F59E0B;
  --brand-rgb: 30,58,138; --brand-2-rgb: 14,165,233; --accent-rgb: 245,158,11;
  --radius: 14px; --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --bg: #F4F6FB; --surface: #FFFFFF; --surface-2: #F8FAFD; --surface-3: #EEF2F8;
  --text: #0F172A; --text-2: #334155; --muted: #64748B; --border: #E2E8F0; --border-2: #CBD5E1;
  --ok: #059669; --warn: #D97706; --danger: #DC2626; --info: #2563EB;
  --ok-bg: #ECFDF5; --warn-bg: #FFFBEB; --danger-bg: #FEF2F2; --info-bg: #EFF6FF;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px -12px rgba(15,23,42,.18);
  --shadow-lg: 0 20px 50px -20px rgba(15,23,42,.35);
  --sb-w: 268px; --sbr-w: 312px; --top-h: 60px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --dur: .28s;
  --chart-1: var(--brand); --chart-grid: #E5E9F0;
  color-scheme: light;
}

/* ---------- Modo escuro (por empresa ou preferência) ---------- */
body.mode-escuro, body.user-escuro {
  --bg: #0E1116; --surface: #161A21; --surface-2: #1B2028; --surface-3: #232A34;
  --text: #E8ECF2; --text-2: #C3CBD6; --muted: #8A94A6; --border: #2A313C; --border-2: #3A4350;
  --ok-bg: rgba(5,150,105,.14); --warn-bg: rgba(217,119,6,.14); --danger-bg: rgba(220,38,38,.14); --info-bg: rgba(37,99,235,.16);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.75);
  --chart-grid: #2A313C;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  body.mode-auto:not(.user-claro) {
    --bg: #0E1116; --surface: #161A21; --surface-2: #1B2028; --surface-3: #232A34;
    --text: #E8ECF2; --text-2: #C3CBD6; --muted: #8A94A6; --border: #2A313C; --border-2: #3A4350;
    --ok-bg: rgba(5,150,105,.14); --warn-bg: rgba(217,119,6,.14); --danger-bg: rgba(220,38,38,.14); --info-bg: rgba(37,99,235,.16);
    --chart-grid: #2A313C; color-scheme: dark;
  }
}
body.user-claro {
  --bg: #F4F6FB; --surface: #FFFFFF; --surface-2: #F8FAFD; --surface-3: #EEF2F8;
  --text: #0F172A; --text-2: #334155; --muted: #64748B; --border: #E2E8F0; --border-2: #CBD5E1;
  --ok-bg: #ECFDF5; --warn-bg: #FFFBEB; --danger-bg: #FEF2F2; --info-bg: #EFF6FF; --chart-grid: #E5E9F0; color-scheme: light;
}

/* ---------- Tema 1: Distribuidora de Tintas (branco, azul profundo, cromático) ---------- */
body.theme-tintas {
  --chromatic: linear-gradient(90deg, #00B4D8, #3A86FF, #8338EC, #FF006E, #FB5607, #FFBE0B);
}
body.theme-tintas .sb-left { background: linear-gradient(180deg, #0B2E6F 0%, #0A2558 100%); color: #DCE6FA; border-right: 0; }
body.theme-tintas .sb-left::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--chromatic); background-size: 200% 100%; animation: chroma 9s linear infinite; }
body.theme-tintas .sb-left .nav a:hover, body.theme-tintas .sb-left .nav a.active { background: rgba(255,255,255,.10); color: #fff; }
body.theme-tintas .sb-left .nav a.active::after { background: var(--chromatic); }
body.theme-tintas .sb-left .muted, body.theme-tintas .sb-left .nav-title { color: rgba(220,230,250,.6); }
body.theme-tintas .sb-left .company-switch { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.14); }
body.theme-tintas .page-head h1 { background: linear-gradient(90deg, var(--brand), #3A86FF 60%, #8338EC); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.theme-tintas .kpi::before { background: var(--chromatic); }
body.theme-tintas .main { background:
  radial-gradient(800px 300px at 100% -10%, rgba(58,134,255,.08), transparent 60%),
  radial-gradient(600px 260px at -10% 110%, rgba(255,0,110,.05), transparent 60%), var(--bg); }

/* ---------- Tema 2: Distribuidora de Cervejas (grafite, âmbar, dourado) ---------- */
body.theme-cervejas {
  --amber-glow: 0 0 0 1px rgba(var(--brand-rgb),.25), 0 8px 30px -10px rgba(var(--brand-rgb),.45);
}
body.theme-cervejas.mode-claro { --bg: #F6F3EC; --surface-2: #FBF8F2; }
body.theme-cervejas .sb-left { background: linear-gradient(180deg, #15171B 0%, #1C1F25 100%); color: #E9DFC9; border-right: 1px solid #2B2F36; }
body.theme-cervejas .sb-left::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, transparent, var(--brand), var(--brand-2), transparent); box-shadow: 0 0 18px rgba(var(--brand-rgb),.7); }
body.theme-cervejas .sb-left .nav a:hover, body.theme-cervejas .sb-left .nav a.active { background: rgba(var(--brand-rgb),.14); color: #FFE7B0; }
body.theme-cervejas .sb-left .nav a.active::after { background: linear-gradient(180deg, var(--brand-2), var(--brand)); box-shadow: 0 0 12px rgba(var(--brand-rgb),.8); }
body.theme-cervejas .sb-left .muted, body.theme-cervejas .sb-left .nav-title { color: rgba(233,223,201,.55); }
body.theme-cervejas .sb-left .company-switch { background: rgba(255,255,255,.05); color: #F5E6C4; border-color: #2E333B; }
body.theme-cervejas .btn-primary { background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #1A1406; border-color: transparent; }
body.theme-cervejas .kpi { border-top: 0; }
body.theme-cervejas .kpi::before { background: linear-gradient(90deg, var(--brand), var(--brand-2)); box-shadow: 0 0 14px rgba(var(--brand-rgb),.6); }
body.theme-cervejas .card:hover { box-shadow: var(--amber-glow); }
body.theme-cervejas.mode-escuro .main { background: radial-gradient(900px 340px at 100% -10%, rgba(var(--brand-rgb),.10), transparent 60%), var(--bg); }

@keyframes chroma { from { background-position: 0% 0; } to { background-position: 200% 0; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
body.mode-escuro a, body.theme-cervejas a { color: var(--brand-2); }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.ico { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.ico-lg { width: 26px; height: 26px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.2rem 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns var(--dur) var(--ease); }
body.sb-left-hidden .shell { grid-template-columns: 0 minmax(0, 1fr); }
.sb-left { position: sticky; top: 0; height: 100vh; overflow: hidden auto; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 14px; gap: 14px; z-index: 30; transition: transform var(--dur) var(--ease), opacity var(--dur); }
body.sb-left-hidden .sb-left { opacity: 0; pointer-events: none; padding: 0; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 40px; color: inherit; text-decoration: none !important; border-radius: 10px; }
.brand:hover { background: var(--surface-3); }
.brand img { max-height: 38px; max-width: 150px; object-fit: contain; }
.brand .logo-fallback { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.brand strong { display: block; font-size: .98rem; line-height: 1.15; }
.brand span { font-size: .75rem; }
.company-switch { width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: inherit; font: inherit; cursor: pointer; text-align: left; }
.company-switch span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 12px 8px 4px; font-weight: 650; }
.nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: inherit; text-decoration: none; transition: background .18s, color .18s, transform .18s var(--ease); }
.nav a span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a:hover { background: var(--surface-3); transform: translateX(2px); }
.nav a.active { background: rgba(var(--brand-rgb), .10); color: var(--brand); font-weight: 600; }
.nav a.active::after { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.nav .fav { color: var(--accent); }
.nav details > summary { list-style: none; cursor: pointer; }
.nav details > summary::-webkit-details-marker { display: none; }
.nav details[open] > summary .chev { transform: rotate(90deg); }
.chev { transition: transform .2s var(--ease); }
.sb-footer { margin-top: auto; font-size: .75rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 20px; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.topbar .title { font-weight: 650; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar .actions { display: flex; align-items: center; gap: 6px; }
.content { padding: 22px; flex: 1; min-width: 0; }
.content > * { animation: page-in .38s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.iconbtn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; transition: background .15s, transform .15s; }
.iconbtn:hover { background: var(--surface-3); }
.iconbtn.active { background: rgba(var(--brand-rgb), .12); color: var(--brand); }
.iconbtn:active { transform: scale(.94); }
.iconbtn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: .62rem; display: grid; place-items: center; font-weight: 700; }

.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); opacity: 0; pointer-events: none; transition: opacity var(--dur); z-index: 25; }

/* ---------- Página de relatório (área central + barra direita de filtros) ---------- */
.report { display: grid; grid-template-columns: minmax(0, 1fr) var(--sbr-w); gap: 0; min-height: calc(100vh - var(--top-h)); transition: grid-template-columns var(--dur) var(--ease); }
body.sb-right-hidden .report { grid-template-columns: minmax(0, 1fr) 0; }
.report-main { padding: 22px; min-width: 0; }
.sb-right { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow: hidden auto; background: var(--surface); border-left: 1px solid var(--border); padding: 18px 16px; z-index: 22; transition: opacity var(--dur), transform var(--dur) var(--ease); }
body.sb-right-hidden .sb-right { opacity: 0; pointer-events: none; padding: 0; }
.sb-right h3 { display: flex; align-items: center; gap: 8px; }
.filter { margin-bottom: 14px; }
.filter > label { display: block; font-size: .78rem; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }

/* ---------- Componentes ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); margin: 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.span-2 { grid-column: span 2; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s; min-width: 0; }
body.cards-contorno .card { box-shadow: none; border-width: 1.5px; }
body.cards-solido .card { border-color: transparent; box-shadow: var(--shadow); }
body.cards-vidro .card { background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(12px); }
.card.hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 14px 18px 0; }

.kpi { position: relative; overflow: hidden; padding: 16px 18px; }
.kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.kpi .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .label .ico { color: var(--brand); }
body.theme-cervejas .kpi .label .ico { color: var(--brand-2); }
.kpi .value { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: .8rem; font-weight: 600; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }

.chart-card { display: flex; flex-direction: column; min-height: 340px; }
.chart-card.inteira { grid-column: 1 / -1; }
.chart { flex: 1; min-height: 280px; width: 100%; }
.chart-tools { display: flex; gap: 4px; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: transform .12s, box-shadow .2s, background .2s, border-color .2s; }
.btn:hover { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .10); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn.loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { box-shadow: 0 6px 18px -6px rgba(var(--brand-rgb), .6); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); box-shadow: none; }
.btn-sm { height: 32px; padding: 0 10px; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Formulários */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; } .col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-2 { grid-column: span 2; }
.col-11 { grid-column: span 11; } .col-10 { grid-column: span 10; } .col-9 { grid-column: span 9; } .col-7 { grid-column: span 7; } .col-5 { grid-column: span 5; } .col-1 { grid-column: span 1; }
.field label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field .hint { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.field .err { font-size: .78rem; color: var(--danger); margin-top: 4px; }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 90px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .15); }
.input.invalid, .field.has-err .input { border-color: var(--danger); }
.input-sm { height: 34px; padding: 4px 10px; font-size: .88rem; }
input[type=color].input { padding: 4px; height: 40px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
legend { padding: 0 8px; font-weight: 650; }
.otp { letter-spacing: .5em; text-align: center; font-size: 1.6rem; font-weight: 700; height: 56px; font-variant-numeric: tabular-nums; }

/* Tabelas simples */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .actions { white-space: nowrap; text-align: right; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 650; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.b-ok { background: var(--ok-bg); color: var(--ok); } .b-warn { background: var(--warn-bg); color: var(--warn); }
.b-danger { background: var(--danger-bg); color: var(--danger); } .b-info { background: var(--info-bg); color: var(--info); }
.b-brand { background: rgba(var(--brand-rgb), .12); color: var(--brand); }

/* Alertas e toasts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: .9rem; border: 1px solid transparent; animation: page-in .3s var(--ease); }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 200; max-width: min(380px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); border-left: 4px solid var(--brand); animation: toast-in .35s var(--ease) both; }
.toast.err { border-left-color: var(--danger); } .toast.ok { border-left-color: var(--ok); }
.toast.out { animation: toast-out .3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* Skeleton / estados */
.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 8px; min-height: 14px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); animation: shimmer 1.3s infinite; }
body.mode-escuro .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.is-loading .chart, .is-loading .value { opacity: .35; transition: opacity .2s; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ico { width: 44px; height: 44px; color: var(--border-2); margin-bottom: 8px; }
.empty h3 { color: var(--text-2); }

/* Dropdown / menu */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60; transform-origin: top right; }
.dropdown.open .menu { display: block; animation: pop .18s var(--ease); }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-3); }
/* Carteira do vendedor (menu da conta) */
.menu a.carteira { align-items: flex-start; gap: 12px; padding: 10px; background: rgba(var(--brand-rgb), .06); border: 1px solid rgba(var(--brand-rgb), .18); }
.menu a.carteira:hover { background: rgba(var(--brand-rgb), .12); }
.carteira-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(var(--brand-rgb), .14); color: var(--brand); }
.carteira-ico .ico { width: 18px; height: 18px; }
.carteira-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.carteira-valor { font-size: 1.15rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.menu .sep { height: 1px; background: var(--border); margin: 6px 0; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }

/* Multi-select com busca */
.ms { position: relative; }
.ms-btn { width: 100%; display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: left; flex-wrap: wrap; }
.ms-btn .ph { color: var(--muted); flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(var(--brand-rgb), .12); color: var(--brand); font-size: .76rem; font-weight: 600; max-width: 100%; animation: pop .2s var(--ease); }
body.theme-cervejas .chip { color: var(--brand-2); }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; line-height: 1; }
.ms-pop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 40; display: none; }
.ms.open .ms-pop { display: block; animation: pop .16s var(--ease); }
.ms-list { max-height: 240px; overflow: auto; margin-top: 6px; }
.ms-list label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: .88rem; }
.ms-list label:hover { background: var(--surface-3); }
.ms-foot { display: flex; justify-content: space-between; padding-top: 6px; border-top: 1px solid var(--border); margin-top: 6px; }

/* Abas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs .on { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel[hidden] { display: none; }

/* Modal */
dialog.modal { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(15,23,42,.5); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .22s var(--ease); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); }

/* Lista de empresas / relatórios */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: inherit; text-decoration: none !important; transition: transform .22s var(--ease), box-shadow .22s, border-color .22s; cursor: pointer; text-align: left; font: inherit; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(var(--brand-rgb), .4); }
.tile .tile-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: rgba(var(--brand-rgb), .1); color: var(--brand); }
body.theme-cervejas .tile .tile-ico { color: var(--brand-2); }
.tile .swatch { width: 40px; height: 40px; border-radius: 11px; }
.tile strong { font-size: .98rem; }

/* Matriz de permissões */
.matrix-wrap { overflow: auto; max-height: 64vh; border: 1px solid var(--border); border-radius: var(--radius); }
table.matrix { border-collapse: separate; border-spacing: 0; font-size: .84rem; min-width: 100%; }
.matrix th, .matrix td { padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface); }
.matrix thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); text-align: center; white-space: nowrap; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; z-index: 2; min-width: 260px; text-align: left; }
.matrix thead th:first-child { z-index: 4; }
.matrix td.c { text-align: center; }
.matrix tr.grp td { background: var(--surface-3); font-weight: 650; font-size: .75rem; text-transform: uppercase; color: var(--muted); }
.matrix .cell { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; position: relative; }
.matrix .cell input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }
.matrix .cell.dirty { background: rgba(var(--accent-rgb), .18); }
.matrix .cell.exp { background: var(--danger-bg); }
.matrix .cell.capped input { cursor: not-allowed; opacity: .35; }
.matrix .cell .v { position: absolute; bottom: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }

/* Paginação */
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }

/* Tabulator — integração com o tema */
.tabulator { border: 0; background: transparent; font-size: .86rem; }
.tabulator .tabulator-header { background: var(--surface-2); border-bottom: 1px solid var(--border); color: var(--muted); }
.tabulator .tabulator-header .tabulator-col { background: var(--surface-2); border-right: 1px solid var(--border); }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content { padding: 9px 10px; }
.tabulator .tabulator-header .tabulator-col .tabulator-col-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 650; }
.tabulator .tabulator-tableholder .tabulator-table { background: var(--surface); color: var(--text); }
.tabulator-row { background: var(--surface); border-bottom: 1px solid var(--border); }
.tabulator-row.tabulator-row-even { background: var(--surface-2); }
.tabulator-row.tabulator-selectable:hover { background: rgba(var(--brand-rgb), .06); }
.tabulator-row .tabulator-cell { border-right: 1px solid var(--border); padding: 8px 10px; }
.tabulator .tabulator-footer { background: var(--surface-2); border-top: 1px solid var(--border); color: var(--text-2); }
.tabulator .tabulator-footer .tabulator-calcs-holder { background: var(--surface-3); border-top: 1px solid var(--border); }
.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row { background: var(--surface-3); font-weight: 700; }
.tabulator .tabulator-footer .tabulator-page { border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); }
.tabulator .tabulator-footer .tabulator-page.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tabulator .tabulator-footer .tabulator-page-size { border-radius: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--border-2); }
.tabulator-row.tabulator-group { background: var(--surface-3); border-bottom: 1px solid var(--border); font-weight: 650; color: var(--text); }
.tabulator .tabulator-frozen { background: inherit; }
.tabulator .tabulator-cell.tabulator-frozen { background: inherit; }
.bar-cell { position: relative; }
.bar-cell .bar { position: absolute; left: 0; top: 20%; bottom: 20%; border-radius: 0 4px 4px 0; background: rgba(var(--brand-rgb), .14); }
.bar-cell span { position: relative; }

/* Autenticação */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(900px 500px at 10% 10%, rgba(14,165,233,.45), transparent 60%), radial-gradient(700px 500px at 90% 90%, rgba(245,158,11,.30), transparent 60%), linear-gradient(135deg, #0B1B45, #1E3A8A); }
.auth-art .blob { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55; animation: float 14s ease-in-out infinite; }
.auth-art .b1 { width: 320px; height: 320px; background: #3A86FF; top: -60px; right: -60px; }
.auth-art .b2 { width: 260px; height: 260px; background: #FF006E; bottom: 10%; left: -80px; animation-delay: -4s; opacity: .3; }
.auth-art .b3 { width: 220px; height: 220px; background: #FFBE0B; bottom: -60px; right: 20%; animation-delay: -8s; opacity: .35; }
@keyframes float { 50% { transform: translate(20px, -24px) scale(1.06); } }
.auth-art h1 { font-size: 2.2rem; max-width: 460px; position: relative; }
.auth-art p, .auth-art ul { position: relative; color: rgba(255,255,255,.82); max-width: 460px; }
.auth-art ul { padding: 0; list-style: none; display: grid; gap: 10px; }
.auth-art li { display: flex; gap: 10px; align-items: center; }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(420px, 100%); }
.auth-card .card { padding: 28px; box-shadow: var(--shadow); }
.auth-card h2 { font-size: 1.4rem; }
.auth-foot { text-align: center; margin-top: 18px; font-size: .8rem; color: var(--muted); }
.pw-meter { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.pw-meter i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .3s var(--ease), background .3s; }

/* Utilitários */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; }
.right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; }
.w-100 { width: 100%; }
.stat-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.stat-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.stat-list li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; font-size: .9rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
pre.json { background: var(--surface-3); padding: 12px; border-radius: 10px; overflow: auto; font-size: .8rem; max-height: 320px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1200px) { .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1024px) {
  .shell, body.sb-left-hidden .shell { grid-template-columns: minmax(0, 1fr); }
  .sb-left { position: fixed; left: 0; top: 0; bottom: 0; width: min(86vw, var(--sb-w)); transform: translateX(-105%); box-shadow: var(--shadow-lg); opacity: 1 !important; pointer-events: auto !important; padding: 18px 14px !important; }
  body.drawer-left .sb-left { transform: none; }
  .report, body.sb-right-hidden .report { grid-template-columns: minmax(0, 1fr); }
  .sb-right { position: fixed; right: 0; top: 0; height: 100vh; width: min(90vw, var(--sbr-w)); transform: translateX(105%); box-shadow: var(--shadow-lg); opacity: 1 !important; pointer-events: auto !important; padding: 18px 16px !important; z-index: 32; }
  body.drawer-right .sb-right { transform: none; }
  body.drawer-left .overlay, body.drawer-right .overlay { opacity: 1; pointer-events: auto; }
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .chart-card.inteira { grid-column: auto; }
}
@media (max-width: 720px) {
  .content, .report-main { padding: 14px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .form-grid > [class*="col-"] { grid-column: span 12; }
  .kpi .value { font-size: 1.35rem; }
  .topbar { padding: 0 10px; }
  .kv { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  .chart-card { min-height: 300px; }
  .page-head h1 { font-size: 1.3rem; }
}

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after { animation: none !important; transition: none !important; }

/* Transição entre empresas */
.switching .main { opacity: .2; filter: blur(2px); transition: opacity .25s, filter .25s; }

@media print {
  .sb-left, .sb-right, .topbar, .toolbar, .chart-tools { display: none !important; }
  .shell, .report { display: block; }
  .card { break-inside: avoid; box-shadow: none; }
}

/* Ajustes finos */
.kpi .value { font-size: clamp(1.2rem, 1.55vw, 1.65rem); overflow-wrap: anywhere; }
.sb-right .filter .row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sb-right .filter .row.mt-1 { display: flex; flex-wrap: wrap; gap: 2px; }
.sb-right input[type=date] { min-width: 0; padding: 4px 6px; font-size: .82rem; }
.tabulator-row.tabulator-group span { color: var(--muted); margin-left: 6px; font-weight: 500; }
.tabulator .tabulator-footer .tabulator-page:not(.active) { color: var(--text); }
.tabulator .tabulator-footer .tabulator-page[disabled] { opacity: .4; }

/* Portfólio de produtos */
.tbl tr.row-pendente td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
a.kpi { color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--brand); }
.btn.btn-wrap { white-space: normal; height: auto; min-height: 40px; text-align: center; max-width: 100%; }

/* Motor de processamento */
.btn-lg { height: 48px; padding: 0 22px; font-size: 1rem; font-weight: 700; letter-spacing: .02em; }
.proc-run { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-bottom: 16px; }
.proc-monitor { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface-2); }
.proc-status-line { margin-bottom: 10px; }
.proc-bar { position: relative; height: 14px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-bottom: 6px; }
.proc-bar > span { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: inherit; transition: width .4s var(--ease); }
.proc-bar.indeterminado::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(255,255,255,.18) 10px 20px); background-size: 28px 28px; animation: proc-stripes 1s linear infinite; }
.proc-bar.falha > span { background: var(--danger); }
@keyframes proc-stripes { to { background-position: 28px 0; } }
@media (prefers-reduced-motion: reduce) { .proc-bar.indeterminado::after { animation: none; } }
.proc-steps { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; }
.proc-steps li { display: grid; grid-template-columns: 22px minmax(0, max-content) 1fr; gap: 8px; align-items: baseline; font-size: .9rem; }
.proc-steps .st-ico { font-weight: 700; text-align: center; color: var(--muted); }
.proc-steps .st-concluida .st-ico { color: var(--ok); }
.proc-steps .st-em_execucao .st-ico { color: var(--warn); display: inline-block; animation: proc-spin 1.2s linear infinite; }
.proc-steps .st-falha .st-ico, .proc-steps .st-falha .st-info { color: var(--danger); }
.proc-steps .st-pendente .st-txt, .proc-steps .st-cancelada .st-txt { color: var(--muted); }
.proc-steps .st-info { overflow-wrap: anywhere; }
@keyframes proc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .proc-steps .st-em_execucao .st-ico { animation: none; } }
.proc-kpis .kpi .value { font-size: 1.3rem; }
.switch { position: relative; width: 44px; height: 24px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-3); cursor: pointer; padding: 0; transition: background .2s; }
.switch > span { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
.switch.on { background: var(--ok); border-color: var(--ok); }
.switch.on > span { transform: translateX(20px); }
.switch:disabled { opacity: .6; cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tbl tr.row-off td { opacity: .6; }
.tbl tr.row-off td.actions, .tbl tr.row-off td:nth-child(6) { opacity: 1; }
.drag-handle { cursor: grab; color: var(--muted); user-select: none; letter-spacing: -2px; }
.tbl tr.dragging td { background: rgba(var(--brand-rgb), .12); }
[hidden] { display: none !important; }
#proc-painel .card-head { flex-wrap: wrap; }
#proc-painel .card-head h3 { overflow-wrap: anywhere; min-width: 0; }

/* Construtor de linhas comissionadas */
.lc-grupo { border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: 10px; padding: 10px; background: var(--surface); }
.lc-grupo .lc-grupo { margin-top: 4px; background: var(--surface-2); }
.lc-grupo.nivel-2 { border-left-color: var(--info); } .lc-grupo.nivel-3 { border-left-color: var(--warn); } .lc-grupo.nivel-4 { border-left-color: var(--ok); }
.lc-grupo-topo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.lc-itens { display: grid; gap: 4px; }
.lc-conector { font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .08em; padding-left: 6px; }
.lc-cond { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; padding: 6px; border-radius: 8px; background: var(--surface-2); }
.lc-grupo .lc-grupo .lc-cond { background: var(--surface); }
.lc-cond-campos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; min-width: 0; }
.lc-cond-campos select.input, .lc-cond-campos input.input { width: auto; max-width: 100%; }
.lc-acoes { display: inline-flex; gap: 2px; margin-left: auto; }
.lc-resumo code { white-space: normal; overflow-wrap: anywhere; }

/* ---------------- Metas ---------------- */
.mt-filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.mt-filtros .field { margin: 0; }
.mt-filtros .input { width: auto; min-width: 90px; }
.mt-grade td, .mt-grade th { vertical-align: middle; }
.mt-grade input.input { width: 128px; height: 34px; padding: 4px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.mt-grade input.mt-range { width: 74px; }
.mt-grade input.input:placeholder-shown { border-style: dashed; }
.mt-grade input.mt-mudou { border-color: var(--warn); box-shadow: 0 0 0 2px rgba(245, 158, 11, .18); }
.mt-grade .mt-sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.mt-faltando { color: var(--warn); font-size: .78rem; }
.mt-grade tfoot .mt-total td, .mt-grade tfoot .mt-total th { border-top: 2px solid var(--border); background: var(--surface-2, var(--surface)); text-align: right; font-variant-numeric: tabular-nums; }
.mt-grade tfoot .mt-total th { text-align: left; }
.mt-grade tfoot .mt-total-pendente strong { color: var(--warn); }
.mt-min { display: block; color: var(--muted); font-size: .76rem; margin-top: 2px; white-space: nowrap; }
.mt-cab-ind { min-width: 140px; white-space: normal; font-size: .76rem; line-height: 1.2; }
.mt-acoes { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; z-index: 2; }
.mt-acoes .input { width: auto; flex: 1; min-width: 220px; }
.mt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.mt-dif-pos { color: var(--warn); }
.mt-dif-neg { color: var(--ok); }
@media (max-width: 720px) { .mt-grade input.input { width: 104px; } .mt-acoes .input { min-width: 0; } }

/* Comissões e bonificações */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.cm-abas { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.cm-abas a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--radius) var(--radius) 0 0; color: var(--muted); text-decoration: none; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.cm-abas a.ativo { color: var(--text); background: var(--surface); border-color: var(--border); font-weight: 600; }
.cm-abas a .ico { width: 16px; height: 16px; }
.cm-grade input.cm-pct { width: 86px; }
.cm-grade input.cm-mes { width: 150px; text-align: left; }
.cm-grade select.cm-max { width: 70px; height: 34px; padding: 2px 6px; }
.cm-grade tr.cm-grupo td { background: rgba(var(--brand-rgb), .06); }
.cm-grade.so-config tr[data-cm-config="0"] { display: none; }
.cm-matriz th, .cm-matriz td { text-align: center; vertical-align: middle; }
.cm-matriz input.input { width: 92px; height: 34px; padding: 4px 8px; text-align: right; }
.cm-matriz .cm-eixo input.input { width: 84px; font-weight: 600; }
.cm-matriz td.cm-alvo { outline: 2px solid var(--ok); outline-offset: -2px; }
.cm-ok { color: var(--ok); } .cm-nc { color: var(--danger); } .cm-zero { color: var(--warn); }
.cm-total { font-size: 1.15rem; font-weight: 700; }
.cm-kpi { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: var(--surface); }
.cm-kpi .v { font-size: 1.2rem; font-weight: 700; margin-top: 4px; }

/* Classificação de clientes */
.ccl-comb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ccl-grupo { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 6px; border-radius: var(--radius); border: 1px solid var(--border); }
.ccl-grupo small { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; margin-right: 2px; }
.ccl-todas { background: rgba(var(--brand-rgb), .05); }
.ccl-alt { border-style: dashed; }
.ccl-item { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; padding: 2px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.ccl-item.ccl-pend { border-color: var(--warn); color: var(--warn); }
.ccl-e { font-weight: 700; color: var(--muted); font-size: .75rem; }
.ccl-ok { color: var(--ok); font-weight: 600; } .ccl-no { color: var(--danger); font-weight: 600; } .ccl-na { color: var(--muted); }
.ccl-grade input.input { width: 90px; height: 32px; padding: 3px 8px; text-align: right; }
.ccl-grade select.input { width: 70px; height: 32px; padding: 2px 4px; }
.ccl-grade tr.ccl-exigida td { background: rgba(var(--brand-rgb), .05); }

/* ======================================================================
   DASHBOARDS GERENCIAIS (página própria, cache versionado, IA)
   Paleta dos gráficos: slots categóricos validados (claro/escuro) — cada entidade
   tem cor fixa: Realizado Y, Meta, Realizado Y-1, Realizado Y-2, Gap.
   ====================================================================== */
.dash, .iata-tema, .lg {
  --viz-surface: #fcfcfb; --viz-ink: #0b0b0b; --viz-ink-2: #52514e; --viz-grid: #e7e6e2;
  /* Paleta semântica do dashboard (fonte única; o JS lê estas variáveis): meta=roxo, Y-2/Y-1=azuis, Y=verde, gap=laranja */
  --viz-meta: #7c3aed; --viz-y2: #1c5cab; --viz-y1: #5598e7; --viz-y: #15803d; --viz-gap: #fb923c;
  --st-good: #0ca30c; --st-warn: #fab219; --st-crit: #d03b3b;
  /* marcas (Resumo diário) — paleta categórica validada (claro/escuro) */
  --viz-akzo: #1c5cab; --viz-condor: #d9480f; --viz-mactra: #7c3aed; --viz-tigre: #00917f; --viz-mapa-0: #dbe6f5; --viz-mapa-vazio: #f1f0ec;
  --viz-div-baixo: #d9480f; --viz-div-meio: #eeece6; --viz-div-alto: #1c5cab;
  /* classificação CL: rampa ordinal de um tom (validada), Sem CL neutro */
  --viz-cl-0: #d6d4cc; --viz-cl-1: #86b6ef; --viz-cl-2: #3d7fd6; --viz-cl-3: #163f7a;
  /* conformidade logística: dentro / fora / sem programação (neutro) / dados insuficientes */
  --viz-log-d: #1c5cab; --viz-log-f: #d9480f; --viz-log-s: #b9b7ae; --viz-log-i: #7c3aed;
  --viz-ader-p: #12917f; --viz-vol-0: #b9b3a3; --viz-vol-1: #3a3630;
  --viz-rot-p: #1c5cab; --viz-rot-t: #12917f; --viz-rot-i: #d9480f; --viz-rot-0: #b9b7ae;
  /* evolução geográfica: conquistada / recuperada / mantida / perdida (validadas; forma do ponto = codificação secundária)
     e variação divergente (queda laranja ↔ alta azul, estável neutro) */
  --viz-geo-nova: #15803d; --viz-geo-rec: #9333ea; --viz-geo-mant: #1c5cab; --viz-geo-perd: #d03b3b;
  --viz-geo-q2: #c2410c; --viz-geo-q1: #f59e5b; --viz-geo-e: #a8a69e; --viz-geo-a1: #6f9fdc; --viz-geo-a2: #1c5cab;
}
body.mode-escuro .dash, body.user-escuro .dash, body.mode-escuro .iata-tema, body.user-escuro .iata-tema, body.mode-escuro .lg, body.user-escuro .lg {
  --viz-surface: #1a1a19; --viz-ink: #f0efec; --viz-ink-2: #c3c2b7; --viz-grid: #34332f;
  --viz-akzo: #3b82f6; --viz-condor: #e8590c; --viz-mactra: #9b79ee; --viz-tigre: #14a394; --viz-mapa-0: #1f2a3a; --viz-mapa-vazio: #24231f; --viz-div-baixo: #e8590c; --viz-div-meio: #33322d; --viz-div-alto: #3b82f6; --viz-cl-0: #45443f; --viz-cl-1: #2f5f99; --viz-cl-2: #4f8fe0; --viz-cl-3: #a9cdf7; --viz-log-d: #3b82f6; --viz-log-f: #e8590c; --viz-log-s: #5d5c55; --viz-log-i: #9b79ee; --viz-ader-p: #26a898; --viz-vol-0: #5a574f; --viz-vol-1: #e0ddd3; --viz-rot-p: #3b82f6; --viz-rot-t: #26a898; --viz-rot-i: #e8590c; --viz-rot-0: #5d5c55;
  --viz-geo-nova: #22a356; --viz-geo-rec: #c084fc; --viz-geo-mant: #3b82f6; --viz-geo-perd: #ef5350; --viz-geo-q2: #e8590c; --viz-geo-q1: #b5652e; --viz-geo-e: #6b6a63; --viz-geo-a1: #3f6fb0; --viz-geo-a2: #60a5fa;
  --viz-meta: #9b79ee; --viz-y2: #2460b7; --viz-y1: #4299dc; --viz-y: #007834; --viz-gap: #da720d;
}
@media (prefers-color-scheme: dark) {
  body.mode-auto:not(.user-claro) .dash, body.mode-auto:not(.user-claro) .iata-tema, body.mode-auto:not(.user-claro) .lg {
    --viz-surface: #1a1a19; --viz-ink: #f0efec; --viz-ink-2: #c3c2b7; --viz-grid: #34332f;
  --viz-akzo: #3b82f6; --viz-condor: #e8590c; --viz-mactra: #9b79ee; --viz-tigre: #14a394; --viz-mapa-0: #1f2a3a; --viz-mapa-vazio: #24231f; --viz-div-baixo: #e8590c; --viz-div-meio: #33322d; --viz-div-alto: #3b82f6; --viz-cl-0: #45443f; --viz-cl-1: #2f5f99; --viz-cl-2: #4f8fe0; --viz-cl-3: #a9cdf7; --viz-log-d: #3b82f6; --viz-log-f: #e8590c; --viz-log-s: #5d5c55; --viz-log-i: #9b79ee; --viz-ader-p: #26a898; --viz-vol-0: #5a574f; --viz-vol-1: #e0ddd3; --viz-rot-p: #3b82f6; --viz-rot-t: #26a898; --viz-rot-i: #e8590c; --viz-rot-0: #5d5c55;
  --viz-geo-nova: #22a356; --viz-geo-rec: #c084fc; --viz-geo-mant: #3b82f6; --viz-geo-perd: #ef5350; --viz-geo-q2: #e8590c; --viz-geo-q1: #b5652e; --viz-geo-e: #6b6a63; --viz-geo-a1: #3f6fb0; --viz-geo-a2: #60a5fa;
    --viz-meta: #9b79ee; --viz-y2: #2460b7; --viz-y1: #4299dc; --viz-y: #007834; --viz-gap: #da720d;
  }
}
.dash-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 14px; }
.dash-head h1 { margin: 0 0 4px; font-size: clamp(1.35rem, 2.6vw, 1.85rem); letter-spacing: -.01em; }
.dash-kicker { margin: 0 0 4px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-2); }
.dash-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-filtros { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); position: sticky; top: calc(var(--top-h) + 6px); z-index: 5; }
.dash-filtros .field { margin: 0; min-width: 130px; }
.dash-seg { border: 0; padding: 0; margin: 0; min-width: 0; }
.dash-seg legend { font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: 5px; padding: 0; }
.dash-seg-op { display: flex; border: 1px solid var(--border-2); border-radius: 10px; overflow: hidden; height: 40px; background: var(--surface); }
.dash-seg label { display: inline-flex; position: relative; }
.dash-seg input { position: absolute; opacity: 0; }
.dash-seg span { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; cursor: pointer; font-weight: 600; color: var(--text-2); transition: background .15s, color .15s; }
.dash-seg input:checked + span { background: var(--brand); color: #fff; }
.dash-seg input:focus-visible + span { outline: 3px solid rgba(var(--brand-2-rgb), .55); outline-offset: -3px; }
.dash-seg[disabled] span { cursor: not-allowed; opacity: .7; }
.dash-nota { flex-basis: 100%; margin: 0; }
.dash-comp { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -4px 0 12px; font-size: .84rem; color: var(--text-2); }
.dash-comp-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: .78rem; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); }
.dash-comp-tag::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--muted); }
.dash-comp-tag[data-st="aplicado"]::before { content: "✓"; width: auto; height: auto; background: none; color: var(--st-good); }
.dash-comp-tag[data-st="completo"]::before { content: "▣"; width: auto; height: auto; background: none; color: var(--text-2); }
.dash-comp-tag[data-st="nao"]::before { content: "–"; width: auto; height: auto; background: none; color: var(--text-2); }
@media (max-width: 640px) {
  .dash-seg span { text-align: center; padding: 0 8px; font-size: .86rem; line-height: 1.15; }
}
.dash-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; font-size: .86rem; color: var(--text-2); }
.dash-status strong { color: var(--text); }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.dash-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.dash-kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--k, var(--border-2)); }
.dash-kpi .rot { font-size: .76rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dash-kpi .val { font-size: clamp(1.05rem, 1.55vw, 1.4rem); white-space: nowrap; font-weight: 750; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--text); }
.dash-kpi .sub { font-size: .8rem; color: var(--text-2); margin-top: 2px; }
.dash-st { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; font-size: .8rem; }
.dash-st::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; }
.dash-st[data-st="superada"], .dash-st[data-st="alcancada"] { --c: var(--st-good); }
.dash-st[data-st="nao_alcancada"] { --c: var(--st-crit); }
.dash-st[data-st="parcial"], .dash-st[data-st="andamento"] { --c: var(--st-warn); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 14px; }
.dash-card { padding: 16px; }
.dash-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.dash-card h2, .dash-h2 { font-size: 1.02rem; margin: 0 0 6px; }
.dash-chart { height: 320px; width: 100%; transition: opacity .2s; }
.dash[aria-busy="true"] .dash-chart, .dash[aria-busy="true"] .dash-tris, .dash[aria-busy="true"] .dash-kpis { opacity: .55; }
.dash-legenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--text-2); margin: 4px 0 2px; }
.dash-legenda button { all: unset; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 3px 4px; border-radius: 6px; }
.dash-legenda button:focus-visible { outline: 2px solid var(--brand-2); }
.dash-legenda button[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.dash-legenda i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: var(--c); }
.dash-legenda i.ln { height: 3px; border-radius: 2px; }
.dash-vazio { padding: 26px 10px; text-align: center; color: var(--text-2); background: var(--surface-2); border-radius: 10px; }
.dash-tabela-alt summary { cursor: pointer; font-size: .82rem; color: var(--text-2); margin-top: 6px; }
.dash-tris { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 14px; }
.dash-tri { padding: 0; overflow: hidden; }
.dash-tri h3 { margin: 0; padding: 12px 14px; font-size: .95rem; display: flex; justify-content: space-between; gap: 8px; align-items: center; border-bottom: 1px solid var(--border); }
.dash-tri table, .dash-card table { width: 100%; }
.dash .tbl td, .dash .tbl th { font-variant-numeric: tabular-nums; }
.dash .tbl tfoot th, .dash .tbl tfoot td { background: var(--surface-3); font-weight: 700; }
.dash .na { color: var(--muted); font-style: italic; }
.dash .pos { color: var(--ok); } .dash .neg { color: var(--danger); }
.dash-metas-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.dash-meta .dash-st { margin-top: 6px; }
.dash-prog { height: 6px; border-radius: 999px; background: var(--viz-grid); margin: 8px 0 4px; overflow: hidden; }
.dash-prog span { display: block; height: 100%; background: var(--viz-y); border-radius: 999px; transition: width .5s; }
.dash-chart-alto { min-height: 260px; }
.dash-chart-baixo { height: 230px; min-height: 230px; }
.dash-dias { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.dash-explica { margin: 0 0 12px; }
.input-sm { height: 32px; padding: 2px 8px; font-size: .84rem; width: auto; display: inline-block; margin-left: 6px; }
.dash-resumo-kpis { display: grid; gap: 12px; margin-bottom: 14px; }
.dash-resumo-marca h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: .95rem; }
.dash-resumo-marca h3 i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dash-resumo-linha { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; }
.dash-resumo-marca .dash-kpi::before { background: var(--k); }
.dash-flags { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; flex-basis: 100%; }
.dash-flags legend { font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: 4px; padding: 0; }
.dash-flags label, .dash-flags-marcas label { display: inline-flex; gap: 6px; align-items: center; font-size: .88rem; }
.dash-flags-marcas { display: inline-flex; gap: 12px; padding: 2px 10px; border-left: 2px solid var(--border-2); }
.dash-mapa { height: 420px; min-height: 420px; }
.dash-tab-resumo td, .dash-tab-resumo th { white-space: nowrap; }
.dash-grid > * { min-width: 0; }
#tb-margem, #tb-pos, #tb-cob, #tb-cl, #tb-vs { max-height: 640px; overflow: auto; }
#tb-margem thead th, #tb-pos thead th, #tb-cob thead th, #tb-cl thead th, #tb-vs thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dash-linha-total td { font-weight: 650; background: var(--surface-2); }
.dash-ia-sug { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.dash-ia-sug .btn { white-space: normal; max-width: 100%; height: auto; min-height: 32px; text-align: left; }
.dash-ia-hist { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 10px; max-height: 460px; overflow: auto; }
.dash-ia-hist li { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.dash-ia-hist .q { font-weight: 650; margin-bottom: 6px; }
.dash-ia-hist .a { white-space: pre-wrap; line-height: 1.55; }
.dash-ia-hist .meta { font-size: .74rem; color: var(--muted); margin-top: 6px; }
.dash-ia-form { display: flex; gap: 8px; }
.dash-ia-form .input { flex: 1; min-width: 0; }
.dash-modal { width: min(720px, calc(100vw - 24px)); }
.dash-modal dl { display: grid; grid-template-columns: minmax(140px, 34%) 1fr; gap: 8px 14px; margin: 0; font-size: .88rem; }
.dash-modal dt { color: var(--text-2); font-weight: 600; }
.dash-modal dd { margin: 0; }
@keyframes dash-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dash-kpi, .dash-tri { animation: dash-in .35s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { .dash-kpi, .dash-tri, .dash-chart { animation: none !important; transition: none !important; } }
@media (max-width: 640px) {
  .dash-filtros { position: static; }
  .dash-filtros .field { flex: 1 1 140px; }
  .dash-filtros .dash-seg { flex: 1 1 100%; }
  .dash-seg label { flex: 1; } .dash-seg-op { width: 100%; } .dash-seg span { width: 100%; justify-content: center; }
  .dash-chart { height: 280px; }
  .dash-acoes { width: 100%; } .dash-acoes .btn, .dash-acoes form { flex: 1; } .dash-acoes form .btn { width: 100%; }
  .dash-modal dl { grid-template-columns: 1fr; gap: 2px; } .dash-modal dd { margin-bottom: 8px; }
  .dash-ia-form { flex-direction: column; }
}
@media (forced-colors: active) { .dash-kpi::before, .dash-legenda i { forced-color-adjust: none; } }
.dash .tbl tbody th, .dash .tbl tfoot th { text-transform: none; letter-spacing: 0; font-size: inherit; font-weight: 650; color: var(--text); position: static; white-space: nowrap; }
.dash .tbl tbody th { background: transparent; }
.dash .tbl thead th { white-space: normal; }
.dash .tbl tbody th .badge, .dash .tbl tfoot th .badge { margin-left: 6px; font-weight: 600; }
.dash .tbl td { white-space: nowrap; }

.perm-matriz tbody th { text-transform: none; letter-spacing: 0; font-size: .86rem; color: var(--text); background: transparent; position: static; font-weight: 650; }
.perm-matriz td.center, .perm-matriz th.center { text-align: center; }
.perm-matriz input[type=checkbox] { width: 18px; height: 18px; }

.dash-kpi .val .na { white-space: normal; }
@media (max-width: 640px) {
  .dash-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash-kpi { padding: 12px; }
  .dash-kpi .val { font-size: 1rem; white-space: normal; }
}

/* Variação da positivação */
#tb-pos tbody tr[data-k] { cursor: pointer; }
#tb-pos tbody tr.dash-sel td { background: color-mix(in srgb, var(--viz-akzo) 12%, transparent); }
.dash-sit { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid currentColor; white-space: nowrap; }
.dash-sit-novo, .dash-sit-recuperado { color: var(--viz-div-alto); }
.dash-sit-perdido { color: var(--viz-div-baixo); }
.dash-sit-mantido, .dash-sit-inativo { color: var(--viz-ink-2); }
.dash-ok { color: var(--viz-div-alto); font-weight: 700; }
#f-mapa { width: auto; max-width: 100%; flex: 0 1 auto; margin-left: 0; }
#tb-cob tbody tr[data-k] { cursor: pointer; }
#tb-cob tbody tr.dash-sel td { background: color-mix(in srgb, var(--viz-akzo) 12%, transparent); }
.dash-sit-nova, .dash-sit-recuperada { color: var(--viz-div-alto); }
.dash-sit-perdida { color: var(--viz-div-baixo); }
.dash-sit-mantida, .dash-sit-inativa { color: var(--viz-ink-2); }
.dash-legenda { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 0; margin: 6px 0 0; color: var(--viz-ink-2); }
.dash-legenda li { display: inline-flex; align-items: center; gap: 6px; }
.dash-legenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--viz-grid); }
#tb-cl tbody tr[data-k] { cursor: pointer; }
#tb-cl tbody tr.dash-sel td { background: color-mix(in srgb, var(--viz-akzo) 12%, transparent); }
.dash-cl { display: inline-block; min-width: 44px; text-align: center; padding: 1px 6px; border-radius: 4px; font-size: .78rem; font-weight: 650; }
.dash-mov { font-weight: 650; white-space: nowrap; }
.dash-mov-subiu { color: var(--viz-div-alto); } .dash-mov-caiu { color: var(--viz-div-baixo); } .dash-mov-manteve { color: var(--viz-ink-2); }
#tb-cl td:nth-child(2) { min-width: 180px; max-width: 260px; white-space: normal; }
#tb-cl td:nth-child(3), #tb-cl td:nth-child(4) { white-space: nowrap; }
#tb-cl td:last-child { max-width: 160px; white-space: normal; }
#tb-cl th:nth-child(1), #tb-cl td:nth-child(1) { position: sticky; left: 0; min-width: 76px; width: 76px; background: var(--surface); z-index: 1; }
#tb-cl th:nth-child(2), #tb-cl td:nth-child(2) { position: sticky; left: 76px; background: var(--surface); z-index: 1; box-shadow: 1px 0 0 var(--border, #e7e6e2); }
#tb-cl thead th:nth-child(1), #tb-cl thead th:nth-child(2) { z-index: 3; }
#tb-cl tbody tr.dash-sel td:nth-child(1), #tb-cl tbody tr.dash-sel td:nth-child(2) { background: color-mix(in srgb, var(--viz-akzo) 12%, var(--surface)); }
@media (max-width: 640px) { #tb-cl th:nth-child(2), #tb-cl td:nth-child(2) { position: static; box-shadow: none; } }

/* Assistente de IA flutuante (todos os dashboards) */
.ia-flut { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.ia-flut > * { pointer-events: auto; }
.dash:has(~ .ia-flut) { padding-bottom: 84px; }
.ia-flut-btn { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-weight: 650;
  background: var(--brand); color: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .22); }
.ia-flut-btn:focus-visible { outline: 3px solid rgba(var(--brand-rgb), .45); outline-offset: 2px; }
.ia-flut-btn .ico { width: 18px; height: 18px; }
.ia-flut.aberto .ia-flut-btn { display: none; }
.ia-flut-painel { width: min(420px, calc(100vw - 32px)); height: min(620px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--surface); color: var(--text, inherit);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 18px 48px rgba(15, 23, 42, .28); overflow: hidden; }
.ia-flut-painel[hidden] { display: none; }
.ia-flut-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ia-flut-head h2 { font-size: 1rem; margin: 0 0 2px; display: flex; align-items: center; gap: 6px; }
.ia-flut-corpo { flex: 1; overflow: auto; padding: 10px 14px; }
.ia-flut-corpo .dash-ia-hist { max-height: none; overflow: visible; }
.ia-flut-painel .dash-ia-form { padding: 10px 14px; border-top: 1px solid var(--border); flex-direction: row; }
.ia-flut-painel .dash-ia-form .btn span { display: none; }
@media (max-width: 640px) {
  .ia-flut { right: 12px; bottom: 12px; left: 12px; align-items: stretch; }
  .ia-flut-btn { align-self: flex-end; }
  .ia-flut-painel { width: 100%; height: calc(100vh - 96px); }
  .ia-flut-painel .dash-ia-form { flex-direction: row; }
}
#tb-vs tbody tr[data-k] { cursor: pointer; }
#tb-vs tbody tr.dash-sel td { background: color-mix(in srgb, var(--viz-akzo) 12%, transparent); }

/* Programação logística (administração) */
.log-cache { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.log-sem-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.log-atalhos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 12px; }
.log-atalhos select { width: auto; max-width: 100%; min-width: 220px; }
.log-meses { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.log-mes { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px 10px; margin: 0; min-width: 0; }
.log-mes legend { font-weight: 650; padding: 0 4px; }
.log-sem { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; cursor: pointer; }
.log-sem:hover { background: var(--surface-2); }
.log-sem input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.log-sem input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.log-sem .n { font-weight: 650; font-variant-numeric: tabular-nums; }
.log-sem .d { color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.log-sem.passada .d::after, .log-passada-ex::after { content: ' · encerrada'; font-size: .74rem; }
.log-sem.passada { opacity: .85; }
.log-sem.mudou { outline: 2px dashed var(--brand); outline-offset: -2px; }
.log-salvar { display: grid; gap: 8px; margin-top: 14px; max-width: 720px; }
.log-linha { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.log-pend { border-top: 1px solid var(--border); padding: 12px 0; }
.log-busca { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 4px; }
.log-sim { max-height: 460px; overflow: auto; }
.log-json { max-width: 260px; overflow-wrap: anywhere; }

/* Conformidade logística (dashboard) */
.log-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.log-mapa { height: 520px; min-height: 420px; }
.log-rank { height: 380px; }
.log-rotas { height: 420px; }
.log-seg .btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.log-cidade { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-top: 10px; background: var(--surface-2); }
.log-cidade dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px 16px; margin: 6px 0 0; }
.log-cidade dt { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.log-cidade dd { margin: 0; font-weight: 600; }
.log-busca-tab .input { width: min(360px, 100%); margin: 0; }
#tb-ped { max-height: 640px; overflow: auto; }
#tb-ped thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
#tb-ped th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
#tb-ped th button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.log-pag { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; }
.log-st { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; }
.log-st::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
@media (max-width: 640px) { .log-mapa { height: 380px; min-height: 340px; } .log-rank, .log-rotas { height: 340px; } }
/* conformidade logística: gargalos, programado × executado, aderência */
.log-garg { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.log-garg .dash-kpi .val { font-size: 1.25rem; }
.log-h3 { font-size: .95rem; margin: 10px 0 4px; }
.log-cal-ch { height: 200px; }
.log-mat { height: 420px; }
.log-sel2 { display: flex; gap: 6px; flex-wrap: wrap; }
.log-chips { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 0; margin: 6px 0 8px; font-size: .86rem; }
.log-chips li { display: inline-flex; align-items: center; gap: 6px; }
.log-chips i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); display: inline-block; }
@media (max-width: 640px) { .log-garg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* programação logística: calendários mensais (marcação por semana ISO) */
.log-cals { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 12px; }
.log-cal { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px 10px; min-width: 0; background: var(--surface); }
.log-cal h3 { font-size: .95rem; margin: 0 0 6px; }
.log-cal-t { width: 100%; border-collapse: separate; border-spacing: 0 3px; table-layout: fixed; font-variant-numeric: tabular-nums; }
.log-cal-t th, .log-cal-t td { text-align: center; padding: 4px 0; font-size: .84rem; }
.log-cal-t thead th { color: var(--muted); font-weight: 600; font-size: .74rem; }
.log-cal-t thead abbr { text-decoration: none; }
.log-cal-t thead th:first-child, .log-cal-t tbody th { width: 62px; text-align: left; }
.log-cal-n { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-weight: 650; font-size: .78rem; white-space: nowrap; }
.log-cal-n input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.log-cal-n input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.log-cal-sem td { cursor: pointer; border-top: 1px solid transparent; border-bottom: 1px solid transparent; }
.log-cal-sem td:last-child { border-radius: 0 7px 7px 0; }
.log-cal-sem:hover td { background: var(--surface-2); }
.log-cal-sem.on td { background: rgba(var(--brand-rgb), .16); color: var(--text, inherit); font-weight: 600; }
.log-cal-sem.on td:first-of-type { box-shadow: inset 3px 0 0 var(--brand); }
.log-cal-sem.mudou td { border-top-color: var(--brand); border-bottom-color: var(--brand); border-top-style: dashed; border-bottom-style: dashed; }
.log-cal-sem.passada td { opacity: .78; }
.log-cal-sem.outro-ano td { cursor: default; opacity: .5; }
.log-cal-t td.fora { color: var(--muted); font-weight: 400; opacity: .55; }
.log-cal-t td.fer { color: #c2410c; text-decoration: underline dotted; text-underline-offset: 3px; }
.log-cal-t td.hoje { box-shadow: inset 0 0 0 2px var(--text, #111); border-radius: 6px; }
.log-cal-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 0; margin: 4px 0 10px; color: var(--muted); }
.log-cal-leg li { display: inline-flex; align-items: center; gap: 6px; }
.log-cal-leg i { width: 14px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--border); }
.log-cal-leg i.on { background: rgba(var(--brand-rgb), .16); box-shadow: inset 3px 0 0 var(--brand); }
.log-cal-leg i.mud { border: 1px dashed var(--brand); }
.log-cal-leg i.fer { border: 0; border-bottom: 2px dotted #c2410c; border-radius: 0; }
.log-cal-leg i.hoje { box-shadow: inset 0 0 0 2px var(--text, #111); }
.log-cal-leg i.fora { opacity: .45; background: var(--surface-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .log-cal-t td.fer { color: #fb923c; } }
:root[data-theme="dark"] .log-cal-t td.fer { color: #fb923c; }
/* roteirização: gestão de carteiras e dashboard */
.rot-tag { display: inline-block; font-size: .72rem; font-weight: 650; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.rot-tag.t-cl { background: rgba(var(--brand-rgb), .10); color: var(--brand); border-color: rgba(var(--brand-rgb), .3); }
.rot-tag.t-ti { background: var(--surface-2); }
.rot-tag.t-ce { background: var(--ok-bg, var(--surface-2)); color: var(--ok, inherit); border-color: transparent; }
.rot-tag.t-ma { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
tr.rot-pend > * { background: var(--warn-bg); }
tr.rot-ex > * { opacity: .6; }
.rot-tab { max-height: 640px; overflow: auto; position: relative; }
.rot-tab thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.rot-acao { display: inline-block; margin: 2px 4px 2px 0; }
.rot-acao > summary { list-style: none; }
.rot-acao > summary::-webkit-details-marker { display: none; }
.rot-acao[open] > summary { background: var(--surface-2); }
.rot-form { display: grid; gap: 6px; min-width: 240px; padding: 8px; margin-top: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.rot-form label { display: grid; gap: 2px; font-size: .8rem; }
.rot-form-inline { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 2px 0; }
.rot-form-inline .input-sm { max-width: 150px; }
.rot-json { max-width: 260px; word-break: break-word; }
.rot-kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.rot-vis { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; }
.rot-vis li { display: grid; grid-template-columns: 92px 1fr; gap: 8px; align-items: baseline; font-size: .8rem; }
.rot-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 650; padding: 1px 8px; border-radius: 999px; white-space: nowrap; color: var(--text, inherit); background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.rot-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.rot-barra { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); min-width: 90px; }
.rot-barra > i { display: block; height: 100%; }
#tb-rot-cli td.det { background: var(--surface-2); }
@media (max-width: 640px) { .rot-vis li { grid-template-columns: 1fr; } }

.rot-rank { height: 320px; }
td.rot-hoje { color: var(--ok); }

/* Contratos */
.ct-h { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin: 0 0 14px; }
.ct-h3 { font-size: .95rem; margin: 0 0 8px; }
.ct-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .85rem; font-weight: 700; flex: none; }
.ct-partes { align-items: start; }
.ct-parte { margin: 0; min-width: 0; }
.ct-origens { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 12px; }
.ct-combo { position: relative; }
.ct-lista { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 300px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14); }
.ct-lista li { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .88rem; line-height: 1.35; }
.ct-lista li[aria-selected="true"], .ct-lista li[data-i]:hover { background: var(--surface-3); }
.ct-dados:not(:empty) { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border-2); }
.ct-resumo { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.ct-aviso { background: var(--warn-bg); border-left: 3px solid var(--warn); padding: 6px 10px; border-radius: 6px; margin: 0 0 8px; }
.ct-campos { gap: 10px 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ct-campos .field, .ct-campos .input { min-width: 0; }
.ct-campos .input.input-sm { width: 100%; margin-left: 0; display: block; }
.ct-campos .col-12 { grid-column: span 6; } .ct-campos .col-6 { grid-column: span 3; } .ct-campos .col-3 { grid-column: span 2; }
.ct-campos .hint { margin-top: 2px; }
.ct-campos .field label { margin-bottom: 3px; }
.ct-hist td { vertical-align: top; }
.ct-sel-row td { background: var(--surface-2); }
@media (max-width: 720px) {
  .ct-campos .col-3, .ct-campos .col-6 { grid-column: span 3; }
  .ct-campos .col-12 { grid-column: span 6; }
  .ct-form .form-grid > .col-3, .ct-form .form-grid > .col-6 { grid-column: span 12; }
}

.rot-mapa { height: 520px; min-height: 420px; }
@media (max-width: 640px) { .rot-mapa { height: 380px; min-height: 340px; } }
.ct-disp { margin: 0; padding: 10px 12px; display: grid; gap: 6px; }
.ct-tipos { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-left: 26px; }

/* Visão estratégica: componentes compartilhados (gauge, tree table, abas, matriz) */
.ger-abas { margin-top: 6px; }
.ger-abas button { all: unset; cursor: pointer; padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--text-2); font-weight: 600; font-size: .92rem; }
.ger-abas button.on { color: var(--brand); border-bottom-color: var(--brand); }
.ger-abas button:focus-visible { outline: 2px solid var(--brand-2); border-radius: 6px; }
.ger-abas { overflow-x: auto; scrollbar-width: thin; white-space: nowrap; }
/* seletor dentro da aba (Resumo › Análises: Akzo / Condor / Mactra / Tigre) */
.ger-variantes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.ger-variantes-rot { font-size: .82rem; color: var(--text-2); font-weight: 600; margin-right: 4px; }
.ger-variantes button { all: unset; cursor: pointer; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); font-size: .88rem; font-weight: 600; color: var(--text-2); background: var(--surface); }
.ger-variantes button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ger-variantes button:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.ger-corpo { min-width: 0; }
.ger-chart { height: 340px; }
.ger-mapa { height: 480px; }
.gg-grid { display: grid; gap: 12px; grid-template-columns: repeat(var(--gg-col, 3), minmax(0, 1fr)); }
.gg { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; height: 100%; animation: dash-in .35s var(--ease) both; }
.gg-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.gg-head strong { font-size: .92rem; }
.gg-chart { height: 170px; }
.gg-info { display: grid; gap: 2px; font-size: .8rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.gg-info strong { color: var(--text); }
.gg-k { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.gg-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; min-width: 0; }
.gg-foot > * { min-width: 0; overflow-wrap: anywhere; }
.gg-foot .badge { white-space: normal; max-width: 100%; }
.tt-barra { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.tt-barra .input-sm { width: min(280px, 100%); margin-left: 0; }
.tt-wrap { max-height: 640px; overflow: auto; }
table.tt th.tt-nome { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 240px; text-align: left; font-weight: 500; padding-left: calc(8px + var(--nv, 0) * 18px); white-space: nowrap; }
table.tt thead th.tt-nome { z-index: 2; background: var(--surface-2); }
table.tt tr.tt-n0 th.tt-nome { font-weight: 650; }
table.tt tr.tt-n1 td, table.tt tr.tt-n1 th { background: var(--surface-2); }
table.tt tr.tt-total th, table.tt tr.tt-total td, .tbl tr.tt-total th, .tbl tr.tt-total td { font-weight: 700; border-top: 2px solid var(--border-2); background: var(--surface-2); }
.tt-tog { all: unset; cursor: pointer; width: 18px; display: inline-block; text-align: center; color: var(--brand); font-size: .9rem; }
.tt-tog:focus-visible, .tt-ord:focus-visible { outline: 2px solid var(--brand-2); border-radius: 4px; }
.tt tr.tt-sel { cursor: pointer; }
.tt tr.tt-sel:focus-visible { outline: 2px solid var(--brand-2); outline-offset: -2px; }
.tt-esp { display: inline-block; width: 18px; }
.tt-cod { color: var(--muted); font-size: .78rem; margin-right: 6px; font-variant-numeric: tabular-nums; }
.tt-ord { all: unset; cursor: pointer; font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; }
.tbl td.pos { color: var(--ok); } .tbl td.neg { color: var(--danger); }
.dash-kpi .val.pos { color: var(--ok); } .dash-kpi .val.neg { color: var(--danger); }
.ger-lista { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.ger-lista li.ger-alerta::marker { color: var(--danger); } .ger-lista li.ger-ok::marker { color: var(--ok); }
.ger-matriz td { background: color-mix(in srgb, var(--viz-y1) calc(var(--a, 0) * 55%), transparent); }
.ger-matriz td.ger-m-igual { background: color-mix(in srgb, var(--viz-rot-0) calc(var(--a, 0) * 55%), transparent); }
.ger-matriz td.ger-m-caiu { background: color-mix(in srgb, var(--viz-rot-i) calc(var(--a, 0) * 55%), transparent); }
.ger-multi { position: relative; }
.ger-multi summary { list-style: none; cursor: pointer; display: block; min-width: 200px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .ger-multi summary { min-width: 0; } .ger-multi-op { min-width: 0; width: min(320px, calc(100vw - 32px)); } }
.ger-multi-op { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; max-height: 280px; overflow: auto; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.14); display: grid; gap: 4px; min-width: 260px; }
@media (max-width: 1024px) { .gg-grid { grid-template-columns: repeat(min(var(--gg-col, 3), 2), minmax(0, 1fr)); } }
@media (max-width: 640px) { .gg-grid { grid-template-columns: minmax(0, 1fr); } .ger-chart { height: 300px; } .ger-mapa { height: 380px; } table.tt th.tt-nome { min-width: 180px; } }

.ger-leg-papeis { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; color: var(--viz-ink-2); }
.ger-leg-papeis i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.ger-leg-papeis { align-items: center; }
.ger-leg-btn { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.ger-leg-btn:hover { border-color: var(--brand); }
.ger-leg-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ger-leg-btn[aria-pressed="false"] { color: var(--muted); background: transparent; border-style: dashed; }
.ger-leg-btn[aria-pressed="false"] i { opacity: .25; }
.ger-leg-todas[aria-pressed="true"] { border-color: var(--brand); font-weight: 600; }

/* ---------- Meus Dashboards ---------- */
.md-cat { font-size: 1rem; margin-bottom: 10px; }
.md-dash { display: flex; gap: 12px; align-items: flex-start; min-width: 240px; }
.md-dash .tile-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--brand-rgb), .1); color: var(--brand); flex: none; }
.md-tbl td.center, .md-tbl th.center { text-align: center; }
.md-tbl tr.md-oculto .md-dash { opacity: .6; }
.md-check { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; cursor: pointer; position: relative; }
.md-check input[type="checkbox"][role="switch"] { position: absolute; opacity: 0; width: 44px; height: 24px; margin: 0; cursor: pointer; }
.md-sw { width: 44px; height: 24px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-3); position: relative; transition: background .2s; }
.md-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
.md-check input:checked + .md-sw { background: var(--ok); border-color: var(--ok); }
.md-check input:checked + .md-sw::after { transform: translateX(20px); }
.md-check input:focus-visible + .md-sw { outline: 2px solid var(--brand); outline-offset: 2px; }
.md-star input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.md-star .ico { width: 22px; height: 22px; color: var(--muted); }
.md-star input:checked ~ .ico { color: var(--accent); fill: currentColor; }
.md-star input:focus-visible ~ .ico { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.md-check input[type="radio"] { width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer; }
.md-inicial { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.md-inicial legend { padding: 0; margin-bottom: 6px; }
.md-radio { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.md-radio input { width: 20px; height: 20px; accent-color: var(--brand); }
.md-salvar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 4px 0 24px; }
.nav .nav-ocultos { font-size: .78rem; color: var(--muted); padding: 4px 10px 8px 38px; }
@media (max-width: 720px) {
  .md-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-tbl thead { display: none; }
  .md-tbl, .md-tbl tbody { display: block; }
  .md-tbl tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 8px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .md-tbl td { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; border: 0; }
  .md-tbl td:first-child { grid-column: 1 / -1; align-items: stretch; }
  .md-tbl td:nth-child(5), .md-tbl td:last-child { grid-column: span 3; align-items: flex-start; flex-direction: row; gap: 8px; }
  .md-tbl td[data-label]::before { content: attr(data-label); font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .md-tbl td:nth-child(5)::before { content: attr(data-label) ":"; }
  .md-tbl tr:hover td { background: none; }
  .md-dash { min-width: 0; }
}
.dash-metas-gauges { padding: 14px; }
/* ---------- Análise de Inatividade Comercial ---------- */
.ina-filtros { position: static; }
.ina-mais { position: relative; }
.ina-mais > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; }
.ina-mais > summary::-webkit-details-marker { display: none; }
.ina-mais[open] > summary { border-color: var(--brand); }
.ina-mais-corpo { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 10px; padding: 12px; border: 1px dashed var(--border-2); border-radius: var(--radius); width: 100%; }
.ina-mais[open] { flex-basis: 100%; }
.ina-curto { min-width: 110px !important; max-width: 170px; }
.ina-ref { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 12px; font-size: .88rem; color: var(--text-2); }
.ina-mini { height: 32px; }
.ina-mini button { all: unset; cursor: pointer; padding: 0 12px; display: inline-flex; align-items: center; font-size: .8rem; font-weight: 600; color: var(--text-2); }
.ina-mini button.on { background: var(--brand); color: #fff; }
.ina-mini button:focus-visible { outline: 3px solid rgba(var(--brand-2-rgb), .55); outline-offset: -3px; }
.ina-rank { height: 400px; }
.ina-tab-ctrl { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.ina-tab-ctrl input[type="search"] { width: min(360px, 100%); }
.ina-cols { position: relative; }
.ina-cols > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.ina-cols > summary::-webkit-details-marker { display: none; }
.ina-cols-op { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(340px, calc(100vw - 48px)); max-height: 320px; overflow: auto; padding: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 4px; }
.ina-cols-acoes { display: flex; gap: 6px; margin-bottom: 4px; }
.ina-tabela { max-height: 70vh; }
.ina-tbl th, .ina-tbl td { white-space: nowrap; }
.ina-tbl thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.ina-tbl .ina-lh { text-align: center; border-left: 1px solid var(--border); }
.ina-tbl .ina-lh2 { font-weight: 600; font-size: .72rem; }
.ina-nunca { color: var(--muted); font-style: italic; }
.ina-abrir { all: unset; cursor: pointer; color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ina-abrir:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ina-sit { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--surface-2, rgba(0,0,0,.05)); }
.ina-sit.ina-inativo { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.ina-sit.ina-ativo { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.ina-sit.ina-sem_historico { color: var(--text-2); }
.ina-pag { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.ina-pag input { width: 74px; display: inline-block; margin: 0 4px; }
.modal.ina-det { width: min(980px, calc(100vw - 24px)); max-width: min(980px, calc(100vw - 24px)); }
.ina-det h4 { margin: 18px 0 8px; font-size: .95rem; }
.ina-det-chart { height: 260px; }
@media (max-width: 700px) { .ina-rank { height: 360px; } .ina-curto { max-width: none; } }
/* ---------- Conferência de pedidos e cargas (operação no galpão) ---------- */
.cf-head-acoes { gap: 8px; }
.cf-titulo { font-size: 1.15rem; letter-spacing: .06em; margin: 0 0 8px; }
.cf-passo { max-width: 760px; }
.cf-linha { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.cf-input { font-size: 1.5rem; height: 56px; flex: 1 1 260px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.cf-btn { min-height: 48px; font-size: 1rem; padding: 0 20px; }
.cf-quem { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius); }
.cf-dl { display: grid; grid-template-columns: minmax(130px, 30%) 1fr; gap: 6px 14px; margin: 0; }
.cf-dl dt { color: var(--text-2); font-weight: 600; }
.cf-dl dd { margin: 0; }
.cf-ped-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.cf-ativas { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.cf-sub { font-size: .95rem; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.cf-topo { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.cf-topo-id { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 10px; }
.cf-topo-id > div { display: flex; flex-direction: column; min-width: 0; }
.cf-pedido-n { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.cf-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.cf-kpi { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; background: var(--surface-2); }
.cf-kpi strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.cf-kpi-rot { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.cf-k-con strong { color: var(--ok); } .cf-k-and strong { color: var(--info); } .cf-k-div { border-color: var(--danger); } .cf-k-div strong { color: var(--danger); }
.cf-progs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 16px; margin-top: 10px; }
.cf-prog { position: relative; height: 26px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.cf-prog-barra { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 70%, #fff)); transition: width .25s; }
.cf-prog span { position: relative; display: block; text-align: center; line-height: 26px; font-size: .8rem; font-weight: 700; color: var(--text); }
.cf-leitura { margin-bottom: 12px; border: 2px solid var(--brand); }
.cf-leitura.cf-mult-on { border-color: var(--warn); }
.cf-leitura-form { display: grid; grid-template-columns: 1fr auto auto; gap: 10px 14px; align-items: end; }
.cf-leitura-rot { grid-column: 1 / -1; font-weight: 800; letter-spacing: .05em; display: flex; align-items: center; gap: 6px; }
.cf-barras { font-size: 1.7rem; height: 64px; font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .05em; }
.cf-barras:focus { outline: 4px solid rgba(var(--brand-2-rgb), .45); }
.cf-mult { display: flex; flex-direction: column; gap: 4px; }
.cf-mult-rot { font-size: .7rem; font-weight: 800; letter-spacing: .06em; color: var(--text-2); }
.cf-mult-op { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.cf-mult-op button { min-width: 46px; height: 44px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface); font: inherit; font-weight: 700; cursor: pointer; color: var(--text); }
.cf-mult-op button[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.cf-mult-op input { width: 80px; height: 44px; }
.cf-mult-ativo { font-size: 1.1rem; }
.cf-mult-on .cf-mult-ativo { color: var(--warn); }
.cf-feedback { margin-top: 10px; min-height: 48px; padding: 10px 14px; border-radius: 10px; font-size: 1.05rem; background: var(--surface-2); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.cf-fb-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.cf-fb-exc, .cf-fb-err { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.cf-fb-warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: color-mix(in srgb, var(--warn) 80%, #000); }
.cf-fb-info { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); }
.cf-pulse { animation: cfPulse .45s ease-out; }
@keyframes cfPulse { from { transform: scale(1.02); filter: brightness(1.15); } to { transform: none; filter: none; } }
.cf-areas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.cf-col { min-width: 0; }
.cf-dir { display: flex; flex-direction: column; gap: 12px; }
.cf-col-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.cf-col-head h2 { font-size: .95rem; margin: 0; display: flex; gap: 8px; align-items: center; }
.cf-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 62vh; overflow: auto; }
.cf-dir .cf-lista { max-height: 34vh; }
.cf-item { border: 1px solid var(--border); border-left: 6px solid var(--muted); border-radius: 10px; padding: 8px 10px; display: grid; gap: 4px; background: var(--surface); }
.cf-item-nome { display: flex; gap: 8px; align-items: baseline; }
.cf-ico { font-weight: 900; width: 1.1em; text-align: center; }
.cf-item-cod { color: var(--text-2); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .76rem; word-break: break-all; }
.cf-item-qtd { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cf-qtd { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.cf-tag { font-size: .72rem; font-weight: 800; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); }
.cf-ctrl { display: flex; gap: 6px; flex-wrap: wrap; }
.cf-ctrl .btn { min-width: 52px; min-height: 38px; font-weight: 800; }
.cf-oc { color: color-mix(in srgb, var(--warn) 80%, #000); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cf-s-pend { border-left-color: #94A3B8; }
.cf-s-and { border-left-color: var(--info); } .cf-s-and .cf-tag { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.cf-s-con { border-left-color: var(--ok); } .cf-s-con .cf-tag { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.cf-s-falha { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); } .cf-s-falha .cf-tag { background: color-mix(in srgb, var(--warn) 20%, transparent); }
.cf-s-exc, .cf-s-div { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); } .cf-s-exc .cf-tag, .cf-s-div .cf-tag { background: var(--danger); color: #fff; }
.cf-ultimo { border-left: 8px solid var(--border-2); }
.cf-ultimo.cf-s-con { border-left-color: var(--ok); } .cf-ultimo.cf-s-and { border-left-color: var(--info); } .cf-ultimo.cf-s-exc { border-left-color: var(--danger); } .cf-ultimo.cf-s-falha { border-left-color: var(--warn); }
.cf-ult-nome { font-size: 1.2rem; font-weight: 800; }
.cf-ult-qtd { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cf-ult-qtd small { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.cf-eventos summary { cursor: pointer; font-weight: 700; }
.cf-ev { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: .85rem; max-height: 30vh; overflow: auto; }
.cf-ev-rej { color: var(--danger); }
.cf-rodape { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; position: sticky; bottom: 0; padding: 10px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.cf-sit-em_andamento { color: var(--info); } .cf-sit-pausada { color: var(--warn); } .cf-sit-finalizada { color: var(--ok); } .cf-sit-finalizada_divergencia, .cf-sit-cancelada { color: var(--danger); }
.modal.cf-modal { width: min(760px, calc(100vw - 24px)); max-width: min(760px, calc(100vw - 24px)); }
.cf-vazio { padding: 6px; }
kbd { border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; font-size: .8em; background: var(--surface-2); }
@media (max-width: 960px) { .cf-areas { grid-template-columns: 1fr; } .cf-leitura-form { grid-template-columns: 1fr; } .cf-lista, .cf-dir .cf-lista { max-height: none; } }
@media print { .cf-rodape, .cf-leitura { display: none; } }
/* relatório imprimível */
.cfr-folha { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.cfr-res { font-size: 1.1rem; font-weight: 800; }
@media print {
  .sb-left, .sb-right, .topbar, .no-print, .toasts, .ia-flut, nav.tabs, .skip-link { display: none !important; }
  .main { margin: 0 !important; }
  .cfr-folha { border: 0; padding: 0; }
  body, .main, #conteudo { background: #fff !important; margin: 0 !important; padding: 0 !important; }
}
.cf-modal .table-wrap { max-height: 38vh; overflow: auto; }
@media (max-width: 700px) {
  .cf-op:not([hidden]) { display: flex; flex-direction: column; }
  .cf-leitura { order: -1; }
  .cf-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .cf-kpi { padding: 6px; } .cf-kpi strong { font-size: .95rem; } .cf-kpi-rot { font-size: .58rem; letter-spacing: 0; }
  .cf-topo-id { gap: 4px 14px; } .cf-pedido-n { font-size: 1.1rem; }
  .cf-rodape { position: static; background: none; }
  .cf-rodape .btn { flex: 1 1 100%; }
  .cf-barras { font-size: 1.25rem; height: 54px; }
  .cf-mult-op button { min-width: 40px; height: 40px; }
}

/* ---------- Inteligência de estoques ---------- */
.est-kpis { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.est-sim-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 8px; }
.est-sim-form .field { margin: 0; min-width: 150px; flex: 1 1 150px; }
.est-sim-acoes { gap: 8px; flex-wrap: wrap; flex: 1 1 100%; }
.est-comp { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; margin: 10px 0; }
.est-comp-c { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.est-comp-c h3 { font-size: .95rem; margin: 0 0 8px; }
.est-comp-c dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; margin: 0; font-size: .88rem; }
.est-comp-c dt { color: var(--text-2); }
.est-comp-c dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.est-comp-c dd.neg { color: var(--danger); }
.est-alertas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.est-alerta { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; }
.est-alerta.tem { border-left: 4px solid var(--warn); }
.est-alerta summary { cursor: pointer; }
.est-alerta ul { margin: 6px 0 0; padding-left: 18px; max-height: 220px; overflow: auto; }
.ina-sit.est-ruptura, .ina-sit.est-critico, .ina-sit.est-inconsistente { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.ina-sit.est-atencao { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.ina-sit.est-adequado { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.ina-sit.est-excesso { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.dash-est #est-diag dl { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 4px 16px; margin: 0; }
.dash-est #est-diag dt { color: var(--text-2); }
.dash-est #est-diag dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .est-sim-form .field { flex-basis: 45%; min-width: 0; }
  .est-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .est-comp-c dl { grid-template-columns: 1fr; gap: 0; }
  .est-comp-c dd { text-align: left; margin-bottom: 6px; }
  .est-kpis .dash-kpi .val { font-size: 1.1rem; }
  .dash-est #est-diag dl { grid-template-columns: 1fr; }
  .dash-est #est-diag dd { margin-bottom: 6px; }
}
.dash-est .ina-tbl td:not(.num), .dash-est .ina-tbl th[scope="row"] { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* Menu lateral: seções dentro das categorias e rolagem própria (independente do conteúdo) */
.nav .nav-sec { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); opacity: .8; margin: 8px 10px 2px 38px; }
.nav details > summary.nav-title { padding: 2px 0; border-radius: 6px; }
.nav details > summary.nav-title:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sb-left { overscroll-behavior: contain; scrollbar-gutter: stable; }
body.theme-tintas .sb-left .nav-sec { color: rgba(220,230,250,.5); }
body.theme-cervejas .sb-left .nav-sec { color: rgba(233,223,201,.45); }

/* Central de atualização completa */
.atu-grupo { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; min-width: 0; }
.atu-grupo legend { font-weight: 650; font-size: .85rem; padding: 0 6px; }
.atu-opcoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.atu-opcao { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.atu-opcao:has(input:checked) { border-color: var(--brand); background: rgba(var(--brand-rgb), .06); }
.atu-opcao input { margin-top: 3px; accent-color: var(--brand); }
.atu-opcao span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.atu-atalhos { display: flex; flex-wrap: wrap; gap: 8px; }
.atu-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: .85rem; }
.atu-chip:has(input:checked) { border-color: var(--brand); color: var(--brand); background: rgba(var(--brand-rgb), .08); font-weight: 600; }
.atu-chip input { accent-color: var(--brand); }
.atu-desab .atu-atalhos { opacity: .5; }
.atu-personalizado { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(160px, 1fr) minmax(0, 2fr); gap: 14px; margin-top: 12px; }
.atu-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.atu-combos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.atu-kpis .kpi .value { font-size: 1.35rem; }
.atu-tipos { margin: 8px 0 0; padding-left: 18px; }
.atu-reuso td { color: var(--muted); }
.atu-confirma { align-items: flex-start; max-width: 760px; }
.atu-cab { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.atu-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.atu-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px; margin: 8px 0 0; }
.atu-dl > div { min-width: 0; }
.atu-dl dt { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.atu-dl dd { margin: 0; overflow-wrap: anywhere; }
.atu-contagem { margin-top: 4px; }
.atu-txt-erro { color: var(--danger); font-weight: 600; }
.atu-etapas { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.atu-et { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.atu-et-btn { width: 100%; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.atu-et-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 10px; }
.atu-et-rot { overflow-wrap: anywhere; }
.atu-et-ico { font-weight: 700; text-align: center; color: var(--muted); }
.atu-et.st-concluida .atu-et-ico { color: var(--ok); }
.atu-et.st-em_execucao { border-color: var(--brand); }
.atu-et.st-em_execucao .atu-et-ico { color: var(--brand); display: inline-block; animation: proc-spin 1.2s linear infinite; }
.atu-et.st-falhou { border-color: var(--danger); }
.atu-et.st-falhou .atu-et-ico, .atu-et-erro { color: var(--danger); }
.atu-et.st-bloqueada .atu-et-ico, .atu-et.st-cancelada .atu-et-ico { color: var(--warn); }
.atu-et.st-ignorada .atu-et-rot, .atu-et.st-aguardando .atu-et-rot { color: var(--muted); }
.atu-et-erro { padding: 0 12px 8px 44px; overflow-wrap: anywhere; }
.atu-det { padding: 0 12px 12px 44px; }
.atu-logs { list-style: none; margin: 10px 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); max-height: 260px; overflow: auto; display: grid; gap: 4px; font-size: .8rem; }
.atu-logs time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }
.atu-log-aviso { color: var(--warn); }
.atu-log-erro { color: var(--danger); }
@media (prefers-reduced-motion: reduce) { .atu-et.st-em_execucao .atu-et-ico { animation: none; } }
@media (max-width: 760px) {
  .atu-personalizado { grid-template-columns: minmax(0, 1fr); }
  .atu-et-btn { grid-template-columns: 22px minmax(0, 1fr); }
  .atu-et-btn .badge, .atu-et-btn .atu-et-tempo { grid-column: 2; justify-self: start; }
  .atu-det, .atu-et-erro { padding-left: 12px; }
  .atu-hist td, .atu-hist th { white-space: nowrap; }
}
.atu-cab > div:first-child { flex: 1 1 420px; min-width: 0; }

/* Dispositivos */
.disp-codigo { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; margin: 12px 0; border: 1px dashed var(--border-2); border-radius: 12px; background: var(--surface-2); }
.disp-codigo strong { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.8rem; letter-spacing: .25em; }
.disp-pedido { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--border); }
.disp-pedido-info { flex: 1 1 360px; min-width: 0; overflow-wrap: anywhere; }
.disp-pedido-acoes { display: flex; flex-direction: column; gap: 8px; flex: 0 1 380px; }
.disp-pedido-acoes form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.disp-pedido-acoes .input { flex: 1 1 160px; min-width: 0; }
.disp-rotulo { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-width: 220px; }
.disp-rotulo .input { flex: 1 1 140px; min-width: 0; }

/* ======================================================================
   IATA — Inteligência Artificial, Tecnologia e Automação
   Paleta categórica das séries (validada: claro sobre #fcfcfb, escuro sobre #1a1a19 — banda de luminosidade,
   croma, separação para daltonismo ΔE ≥ 10 e contraste ≥ 3:1). Ordem fixa; no máximo 6 séries por gráfico.
   ====================================================================== */
.iata-tema { --iata-c1: #1c5cab; --iata-c2: #d9480f; --iata-c3: #00917f; --iata-c4: #7c3aed; --iata-c5: #b8860b; --iata-c6: #c2185b; }
body.mode-escuro .iata-tema, body.user-escuro .iata-tema { --iata-c1: #3b82f6; --iata-c2: #e8590c; --iata-c3: #14a394; --iata-c4: #9b79ee; --iata-c5: #b8860b; --iata-c6: #e0457b; }
@media (prefers-color-scheme: dark) { body.mode-auto:not(.user-claro) .iata-tema { --iata-c1: #3b82f6; --iata-c2: #e8590c; --iata-c3: #14a394; --iata-c4: #9b79ee; --iata-c5: #b8860b; --iata-c6: #e0457b; } }

/* identidade */
/* ícone oficial (Equilibrium) num bloco claro: legível nos modos claro e escuro e sobre a cor da marca */
.iata-logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; flex: none; color: transparent;
  background: #fff url('../img/equilibrium-icone.svg') center / 74% no-repeat; border: 1px solid rgba(69, 74, 126, .18); box-shadow: 0 4px 12px -6px rgba(69, 74, 126, .55); }
.iata-logo > svg { opacity: 0; }
.iata-logo .ico { width: 18px; height: 18px; }
.iata-logo-sm { width: 26px; height: 26px; border-radius: 8px; } .iata-logo-sm .ico { width: 15px; height: 15px; }
.iata-logo-g { width: 38px; height: 38px; border-radius: 12px; } .iata-logo-g .ico { width: 22px; height: 22px; }
.iata-logo-xl { width: 64px; height: 64px; border-radius: 20px; } .iata-logo-xl .ico { width: 36px; height: 36px; }
.iata-logo.pulsando { animation: iata-pulso 1.4s ease-in-out infinite; }
@keyframes iata-pulso { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.iata-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.iata-id > div { min-width: 0; display: flex; flex-direction: column; }
.iata-sigla { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iata-modo { font-size: .68rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); background: rgba(var(--brand-rgb), .1); padding: 2px 6px; border-radius: 6px; vertical-align: middle; }
.ia-flut-btn .iata-logo { width: 28px; height: 28px; margin-left: -10px; box-shadow: none; border-color: transparent; }
.ia-flut-btn .iata-logo .ico { width: 16px; height: 16px; }
.ia-flut-btn { transition: transform .2s var(--ease), box-shadow .2s; }
.ia-flut-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 23, 42, .28); }
.ia-flut-painel { animation: iata-entra .22s var(--ease); }
@keyframes iata-entra { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.ia-flut-painel.largo { width: min(920px, calc(100vw - 32px)); height: min(760px, calc(100vh - 100px)); }
.iata-boas-vindas p:first-child { margin-top: 0; }
.iata-tema .dash-ia-hist .a { white-space: normal; }
.iata-tema .dash-ia-hist li { min-width: 0; }

/* processamento */
.iata-pensando { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.iata-pensando-ico { display: inline-flex; gap: 3px; }
.iata-pensando-ico i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: iata-ponto 1.1s infinite ease-in-out; }
.iata-pensando-ico i:nth-child(2) { animation-delay: .15s; } .iata-pensando-ico i:nth-child(3) { animation-delay: .3s; }
@keyframes iata-ponto { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .iata-logo.pulsando, .iata-pensando-ico i, .ia-flut-painel, .iata-msg { animation: none; } }

/* texto da resposta */
.iata-txt p, .dash-ia-hist .a p { margin: 0 0 8px; line-height: 1.55; }
.iata-h { font-size: .95rem; margin: 12px 0 6px; }
.iata-lista { margin: 0 0 8px; padding-left: 20px; line-height: 1.5; }
.iata-lista li { margin: 2px 0; }
.iata-chip { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; margin-right: 6px; vertical-align: 1px; border: 1px solid transparent; }
.iata-chip-fato { background: var(--info-bg); color: var(--info); }
.iata-chip-interp { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.iata-chip-rec { background: var(--ok-bg); color: var(--ok); }
.iata-chip-est { background: var(--warn-bg); color: var(--warn); }
.iata-escopo { font-size: .8rem; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 6px; margin-top: 8px !important; }
.iata-escopo-k { font-weight: 700; text-transform: uppercase; font-size: .68rem; letter-spacing: .05em; }
.iata-opcoes { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.iata-opcao { white-space: normal; height: auto; min-height: 32px; text-align: left; border-style: dashed; }
.iata-msg-acoes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.iata-msg-acoes .btn { font-size: .78rem; }
.iata-quando { font-size: .74rem; color: var(--muted); margin: 4px 0 0; }

/* blocos de visualização */
.iata-bloco { margin: 10px 0 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 10px 12px; min-width: 0; }
.iata-bloco-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.iata-bloco-head > div:first-child { min-width: 0; flex: 1 1 200px; }
.iata-bloco-t { font-weight: 700; font-size: .92rem; }
.iata-bloco-head p { margin: 2px 0 0; }
.iata-bloco-acoes { display: flex; gap: 4px; flex-wrap: wrap; }
.iata-bloco-acoes .btn { height: 28px; padding: 0 8px; font-size: .74rem; }
.iata-bloco-acoes .ico { width: 14px; height: 14px; }
.iata-bloco-corpo { min-width: 0; }
.iata-chart { width: 100%; height: 300px; }
.iata-b-barras .iata-chart, .iata-b-ranking .iata-chart { height: 340px; }
.iata-origem { font-size: .72rem; color: var(--muted); margin: 6px 0 0; }
.iata-aviso { color: var(--warn); margin: 4px 0 0; }
.iata-dados { margin-top: 6px; }
.iata-dados summary { cursor: pointer; color: var(--text-2); }
.iata-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.iata-card { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.iata-card-k { font-size: .74rem; color: var(--muted); font-weight: 600; }
.iata-card-v { font-size: 1.15rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.iata-card-v.pos { color: var(--ok); } .iata-card-v.neg { color: var(--danger); }
.iata-gauges { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.iata-tb-barra { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.iata-tb-barra .input { max-width: 260px; }
.iata-tb-wrap { max-height: 420px; overflow: auto; }
.iata-tb th .tt-ord { white-space: nowrap; }
.iata-tb td.pos { color: var(--ok); } .iata-tb td.neg { color: var(--danger); }

/* IATA Global */
.iata-app { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: calc(100vh - 120px); min-height: 520px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.iata-side { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-right: 1px solid var(--border); background: var(--surface-2); min-height: 0; }
.iata-side-head { display: flex; gap: 6px; align-items: center; }
.iata-nova { flex: 1; justify-content: center; }
.iata-side-fechar, .iata-side-abrir { display: none; }
.iata-filtro { display: flex; gap: 4px; }
.iata-filtro .btn.active { background: rgba(var(--brand-rgb), .12); color: var(--brand); border-color: transparent; }
.iata-lista-conv { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.iata-conv { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "f t" "f d"; column-gap: 6px; text-align: left; padding: 8px 10px; border-radius: 10px; border: 0; background: transparent; color: var(--text); cursor: pointer; font: inherit; }
.iata-conv > .ico { grid-area: f; width: 14px; height: 14px; color: var(--accent); margin-top: 2px; }
.iata-conv-t { grid-area: t; font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iata-conv-d { grid-area: d; font-size: .72rem; }
.iata-conv:hover { background: var(--surface-3); }
.iata-conv.active { background: rgba(var(--brand-rgb), .12); }
.iata-conv:focus-visible { outline: 2px solid rgba(var(--brand-rgb), .5); outline-offset: 1px; }
.iata-vazio { padding: 8px; }
.iata-side-pe { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border); padding-top: 8px; }
.iata-side-pe .btn { justify-content: flex-start; }
.iata-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.iata-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.iata-h1 { font-size: 1.1rem; margin: 0; }
.iata-head-acoes { display: flex; gap: 2px; }
.iata-head-acoes[hidden] { display: none; }
#iata-fav.on { color: var(--accent); }
.iata-msgs { flex: 1; overflow: auto; padding: 16px clamp(12px, 3vw, 28px); display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.iata-inicio { margin: auto; max-width: 640px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 8px; }
.iata-inicio[hidden] { display: none; }
.iata-bv { font-size: 1.02rem; line-height: 1.55; margin: 6px 0 0; }
.iata-msg { display: flex; gap: 10px; max-width: 100%; animation: iata-entra .2s var(--ease); }
.iata-msg-u { flex-direction: column; align-items: flex-end; }
.iata-bolha { max-width: min(680px, 88%); background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.iata-msg-ia .iata-resp { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: 12px 14px; }
.iata-msg-ia.oculta .iata-resp { color: var(--muted); font-style: italic; }
.iata-msg-ia.erro .iata-resp { color: var(--danger); }
.iata-composer { border-top: 1px solid var(--border); padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.iata-sug { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.iata-sug-b { white-space: nowrap; flex: none; }
.iata-entrada { display: flex; gap: 8px; align-items: flex-end; }
.iata-entrada textarea { flex: 1; min-width: 0; resize: none; min-height: 44px; max-height: 180px; line-height: 1.4; }
.iata-enviar { height: 44px; }
.iata-nota { margin: 0; }
.iata-cat { display: grid; gap: 10px; max-height: 60vh; overflow: auto; }
.iata-cat-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.iata-cat-item h4 { margin: 0 0 4px; font-size: .92rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.iata-cat-item p { margin: 0 0 6px; }
.iata-cat-item dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 2px 8px; margin: 0; }
.iata-cat-item dt { color: var(--muted); }
.iata-cat-item dd { margin: 0; overflow-wrap: anywhere; }
.iata-cat-item[hidden] { display: none; }
#iata-dlg-catalogo { width: min(760px, calc(100vw - 32px)); }

/* Relatórios personalizados */
.iata-rels { display: grid; gap: 12px; }
.iata-rel-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.iata-rel-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.iata-rel-head p { margin-top: 2px; }
.iata-rel-acoes { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.iata-rel-res:not(:empty) { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
h1 .iata-logo { vertical-align: -6px; margin-right: 4px; }

@media (max-width: 900px) {
  .iata-app { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 96px); border-radius: 12px; position: relative; }
  .iata-side { position: absolute; inset: 0 auto 0 0; width: min(320px, 86%); z-index: 5; transform: translateX(-102%); visibility: hidden; transition: transform .22s var(--ease), visibility .22s; box-shadow: var(--shadow-lg); }
  .iata-app.side-aberta .iata-side { transform: none; visibility: visible; }
  .iata-side-fechar, .iata-side-abrir { display: inline-grid; }
}
@media (max-width: 640px) {
  .iata-msgs { padding: 12px 10px; }
  .iata-composer { padding: 8px 10px 10px; }
  .iata-enviar span { display: none; }
  .iata-nota { display: none; }
  .iata-bolha { max-width: 92%; }
  .iata-msg-ia > .iata-logo { display: none; }
  .iata-chart { height: 260px; }
  .iata-cat-item dl { grid-template-columns: minmax(0, 1fr); }
  .ia-flut-painel.largo { width: 100%; height: calc(100vh - 96px); }
}
.iata-flut-acoes { display: flex; gap: 2px; flex: none; }
.ia-flut-head .iata-id { flex: 1; }

/* Tela de acesso com a marca Equilibrium */
body.marca-equilibrium { --brand: #4F5391; --brand-rgb: 79, 83, 145; --brand-2: #7F84C9; --brand-2-rgb: 127, 132, 201; }
.marca-equilibrium .auth-art { background: radial-gradient(800px 520px at 12% 8%, rgba(127, 132, 201, .55), transparent 62%), radial-gradient(700px 520px at 92% 92%, rgba(56, 189, 248, .22), transparent 60%), linear-gradient(140deg, #23264A, #3B3F73 55%, #454A7E); }
.marca-equilibrium .auth-art .b1 { background: #7F84C9; }
.marca-equilibrium .auth-art .b2 { background: #38BDF8; opacity: .22; }
.marca-equilibrium .auth-art .b3 { background: #A5A9E6; opacity: .3; }
.auth-marca { position: relative; display: flex; align-items: center; gap: 12px; font-weight: 650; letter-spacing: .02em; }
.auth-marca-ico { width: 44px; height: 44px; border-radius: 13px; background: #fff url('../img/equilibrium-icone.svg') center / 72% no-repeat; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); }
.auth-logo { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-logo img { width: min(280px, 82%); height: auto; display: block; }
.auth-foot a { color: inherit; }
@media (max-width: 900px) { .auth-logo { margin-top: 8px; } }

/* Botão "Info" padronizado dos dashboards (abre informações e critérios de cálculo) */
.btn-info-dash { min-width: 0; padding-inline: 12px; gap: 6px; }
.btn-info-dash .ico { color: var(--brand); }
.btn-info-dash { position: relative; }
/* avisos dos dashboards: texto completo só no Info; o botão recebe um marcador com a quantidade */
.btn-info-dash .info-marca { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--warn, #b45309); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.btn-info-dash.tem-aviso { border-color: color-mix(in srgb, var(--warn, #b45309) 55%, transparent); }
#dash-atualizado[data-completo-ate] { cursor: help; }
.gg-aviso { margin: 6px 0 0; font-size: .74rem; color: var(--muted); font-style: italic; }

/* Filtro "Meta" (Meta range × Meta real) dos dashboards de metas e "Gráficos exibidos" (Administração › Dashboards) */
.dash-aviso-range { color: var(--muted); font-style: italic; font-size: .76rem; margin: 6px 0 0; }
span.dash-aviso-range { display: block; margin: 2px 0 0; }
.graf-lista { display: grid; gap: 14px; }
.graf-grupo { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px 12px; margin: 0; min-width: 0; }
.graf-grupo legend { font-weight: 650; font-size: .82rem; color: var(--text-2); padding: 0 4px; }
.graf-grupo { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 6px 14px; }
.graf-item { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 4px; border-radius: 8px; min-width: 0; }
.graf-item:hover { background: var(--surface-2); }
.graf-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.graf-chave { flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--border-2); position: relative; transition: background .2s; }
.graf-chave::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s var(--ease); }
.graf-item input:checked + .graf-chave { background: var(--brand); }
.graf-item input:checked + .graf-chave::after { transform: translateX(16px); }
.graf-item input:focus-visible + .graf-chave { outline: 3px solid rgba(var(--brand-rgb), .45); outline-offset: 2px; }
.graf-contextos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.graf-contexto { border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-width: 0; display: grid; gap: 10px; align-content: start; }
.graf-contexto h4 { margin: 0; font-size: .95rem; }
.graf-acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.graf-padrao-tag { font-size: .72rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .graf-chave, .graf-chave::after { transition: none; } }

/* Base da fábrica × carteira de roteirização */
.rf-topo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; align-items: start; }
.rf-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; margin-bottom: 10px; }
.rf-campos .rf-arq, .rf-campos .rf-obs { grid-column: 1 / -1; }
.rf-hist { max-height: 320px; overflow: auto; }
.rf-hist tr.rf-on > * { background: rgba(var(--brand-rgb), .08); }
.rf-crit { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 6px 14px; margin: 10px 0 0; }
.rf-crit dt { font-weight: 650; }
.rf-crit dd { margin: 0; }
@media (max-width: 640px) { .rf-crit { grid-template-columns: 1fr; } .rf-crit dd { margin-bottom: 6px; } }

/* Auditoria ECS */
.ae-lista { display: grid; gap: 10px; margin-top: 12px; }
.ae-check summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: baseline; }
.ae-check .ae-tab { max-height: 420px; overflow: auto; }
/* Auditoria ECS — sell-out: escolha da combinação comparada */
.as-sel { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.as-sel .field { flex: 1 1 220px; margin: 0; }
.as-sel p { flex-basis: 100%; margin: 0; }

/* Tabelas gerenciais com filtro por clique (ex.: ranking do Bônus Tinting → detalhamento do cliente) */
.dash-ger tr.ger-clicavel { cursor: pointer; }
.dash-ger tr.ger-clicavel:hover > *, .dash-ger tr.ger-clicavel:focus-visible > * { background: var(--surface-2, rgba(127,127,127,.08)); }
.dash-ger tr.ger-clicavel:focus-visible { outline: 2px solid var(--brand, currentColor); outline-offset: -2px; }
.dash-kpi .val.val-texto { font-size: 1rem; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }

/* Tabelas com grupos de colunas coloridos (Oportunidades de Classificação CL) */
.dash-ger .ger-tab-grupos th.ger-grupo { text-align: center; font-weight: 650; border-top: 4px solid var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.dash-ger .ger-tab-grupos th.ger-grupo-vazio { border-top: 4px solid transparent; }
.dash-ger th.ger-col-papel { border-top: 3px solid var(--c); }
.dash-ger td.ger-cel-papel { background: color-mix(in srgb, var(--c) 7%, transparent); }
.dash-ger td.ger-cel-ok { background: color-mix(in srgb, var(--c) 32%, transparent); font-weight: 700; }
.dash-ger td.ger-cel-parcial { background: color-mix(in srgb, var(--c) 14%, transparent); }
.dash-ger td.ger-cel-zero { color: var(--text-3, #8a8a8a); }
.dash-ger .ger-lista-p { margin: 0 0 .35rem; }
.dash-ger .ger-lista li.ger-lista-acao { list-style: none; margin-top: .5rem; }

/* Plano comercial do dia (check list) */
.ic-progresso { height: 8px; border-radius: 4px; background: var(--surface-3, #e6e4dc); overflow: hidden; }
.ic-progresso > span { display: block; height: 100%; background: var(--viz-y, #2e9e6a); }
.ic-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ic-check li { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border: 1px solid var(--border, #e2e0d8); border-radius: 8px; }
.ic-check li.ok { opacity: .72; }
.ic-check li.ok .ic-txt > div:nth-child(2) { text-decoration: line-through; }
.ic-caixa { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 6px; border: 2px solid var(--viz-y, #2e9e6a); background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--viz-y, #2e9e6a); }
.ic-caixa[aria-pressed="true"] { background: var(--viz-y, #2e9e6a); color: #fff; }
.ic-caixa:disabled { cursor: default; }
.ic-txt { display: grid; gap: 4px; min-width: 0; }
.ic-sis { color: var(--viz-y, #2e9e6a); }

/* ===== Componentes comuns dos dashboards gerenciais: barra de filtros, tabela responsiva e modal de detalhes ===== */
.ger-filtros-barra { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }
.ger-filtros-barra:not(:has(.ger-chip)):has(.ger-filtros-limpar[hidden]) { display: none; }
.ger-filtros-toggle { display: none; gap: 6px; min-height: 44px; }
.ger-filtros-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; }
.ger-filtros-n[hidden] { display: none; }
.ger-filtros-ativos { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.ger-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 4px 3px 10px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); font-size: .8rem; font-weight: 600; color: var(--text); }
.ger-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ger-chip-x { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer; flex: none; }
.ger-chip-x:hover, .ger-chip-x:focus-visible { background: var(--surface-3); color: var(--text); }
.ger-chip-x .ico, .ger-campo-limpar .ico { width: 14px; height: 14px; }
.ger-filtros-limpar { gap: 6px; min-height: 40px; }
.ger-filtros-fechar { display: none; }
.ger-campo-caixa { position: relative; display: flex; }
.ger-campo-caixa .input { padding-right: 38px; width: 100%; }
.ger-campo-limpar { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; }
.ger-campo-limpar:hover, .ger-campo-limpar:focus-visible { background: var(--surface-3); }
.ger-campo-cliente { min-width: 220px; }

.ger-cel-nome { margin-right: 2px; }
.ger-cel-nome { vertical-align: middle; }
.ger-det-btn, .ger-exp { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-left: 4px; vertical-align: middle; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); color: var(--brand); cursor: pointer; }
.ger-det-btn:hover, .ger-exp:hover, .ger-det-btn:focus-visible, .ger-exp:focus-visible { background: rgba(var(--brand-rgb), .1); }
.ger-det-btn .ico, .ger-exp .ico { width: 16px; height: 16px; }
.ger-exp { display: none; color: var(--text-2); }
.ger-exp[aria-expanded="true"] .ico { transform: rotate(180deg); }
.ger-exp-linha { display: none; }
.ger-exp-linha > td { background: var(--surface-2, var(--surface)); padding: 8px 12px; }
.ger-exp-dl { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 4px 12px; margin: 0; font-size: .84rem; }
.ger-exp-dl dt { color: var(--text-2); font-weight: 600; }
.ger-exp-dl dd { margin: 0; overflow-wrap: anywhere; }
/* tablet: colunas de detalhe saem e aparecem ao expandir */
@media (max-width: 1024px) {
  .dash-ger .dash-filtros { position: static; } /* tablet: o painel de filtros não cobre o conteúdo ao rolar */
  .dash .tbl.ger-tab th, .dash .tbl.ger-tab td { padding: 8px 8px; }
  .dash .tbl.ger-tab tbody th[scope="row"] { white-space: normal; min-width: 170px; } /* nomes longos quebram no tablet e no celular */
  .ger-tab .ger-tela-det { display: none; }
  .ger-tab.ger-tem-det .ger-exp { display: inline-grid; }
  .ger-tab .ger-exp-linha { display: table-row; }
  .ger-exp-dl .ger-tela-det { display: block; }
  .ger-exp-dl dt.ger-tela-sec, .ger-exp-dl dd.ger-tela-sec { display: none; }
}
/* celular: só as colunas essenciais; o restante ao expandir */
@media (max-width: 640px) {
  .ger-tab .ger-tela-sec { display: none; }
  .ger-tab.ger-tem-sec .ger-exp { display: inline-grid; }
  .ger-exp-dl dt.ger-tela-sec, .ger-exp-dl dd.ger-tela-sec { display: block; }
  .ger-exp-dl { grid-template-columns: 1fr; gap: 0; }
  .ger-exp-dl dd { margin-bottom: 6px; }
}

dialog.ger-modal { width: min(1120px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); display: none; flex-direction: column; overflow: hidden; }
dialog.ger-modal[open] { display: flex; }
.ger-modal .modal-head { position: sticky; top: 0; background: var(--surface); z-index: 1; gap: 12px; }
.ger-modal .modal-head h3 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.ger-modal-corpo { overflow: auto; overscroll-behavior: contain; flex: 1 1 auto; }
.ger-modal-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; margin: 0 0 14px; font-size: .88rem; }
.ger-modal-campos dt { color: var(--text-2); font-weight: 600; font-size: .78rem; }
.ger-modal-campos dd { margin: 0; overflow-wrap: anywhere; }
.ger-modal-campo { min-width: 0; }
.ger-modal-tab th, .ger-modal-tab td { padding: 6px 6px; font-size: .8rem; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.ger-modal-tab thead th { font-size: .72rem; color: var(--text-2); }
.ger-modal-tab td:last-child { white-space: normal; min-width: 84px; }
.ger-modal-tab th[scope="row"] { white-space: normal; background: transparent; font-weight: 600; color: var(--text); position: static; font-size: .8rem; }
.ger-modal-blocos { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 12px; }
.ger-modal-bloco { border: 1px solid var(--border); border-radius: 12px; padding: 0 12px 10px; background: var(--surface); min-width: 0; }
.ger-modal-bloco > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; font-weight: 700; list-style: none; min-height: 44px; }
.ger-modal-bloco > summary::-webkit-details-marker { display: none; }
.ger-modal-bloco > summary::after { content: "▾"; color: var(--text-2); margin-left: auto; }
.ger-modal-bloco:not([open]) > summary::after { content: "▸"; }
.ger-modal-tab-wrap { overflow-x: auto; }
.ger-modal-tab { width: 100%; }
.ger-req-ok td:last-child { color: var(--ok); font-weight: 600; }
.ger-req-falta td:last-child, .ger-req-nova td:last-child { color: var(--warn); font-weight: 600; }
.ger-sit-atingida { background: var(--ok-bg); color: var(--ok); }
.ger-sit-pendente { background: var(--warn-bg); color: var(--warn); }
.ger-sit-inalcancavel { background: var(--surface-3); color: var(--text-2); }
@media (max-width: 1024px) { .ger-modal-blocos { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  /* filtros: painel aberto pelo botão "Filtros"; resumo dos filtros ativos sempre visível */
  .ger-filtros-barra, .ger-filtros-barra:not(:has(.ger-chip)):has(.ger-filtros-limpar[hidden]) { display: flex; }
  .ger-filtros-toggle { display: inline-flex; align-items: center; }
  .dash-ger .ger-filtros-painel:not(.aberto) { display: none; }
  .dash-ger .ger-filtros-painel.aberto { display: flex; }
  .ger-filtros-fechar { display: inline-flex; justify-content: center; flex: 1 1 100%; min-height: 44px; }
  .dash-filtros .input, .dash-filtros select { min-height: 44px; }
  .ger-campo-cliente { min-width: 0; flex: 1 1 100%; }
  /* modal em tela cheia; tabelas de requisitos como cartões compactos */
  dialog.ger-modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .ger-modal-campos { grid-template-columns: 1fr 1fr; }
  .ger-modal-tab th, .ger-modal-tab td { white-space: normal; }
  .ger-modal-tab thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ger-modal-tab, .ger-modal-tab tbody, .ger-modal-tab tr, .ger-modal-tab th, .ger-modal-tab td { display: block; width: auto; }
  .ger-modal-tab tr { border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; margin-bottom: 8px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 8px; }
  .ger-modal-tab th[scope="row"] { grid-column: 1 / -1; font-weight: 700; border: 0; padding: 2px 0; }
  .ger-modal-tab td { border: 0; padding: 2px 0; text-align: left; }
  .ger-modal-tab td::before { content: attr(data-rotulo); display: block; font-size: .7rem; color: var(--text-2); font-weight: 600; }
  .ger-modal-tab td:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .ger-exp .ico { transition: none; } }

/* ===================== IATA — Imersivo (palco em tela inteira, escuro em qualquer tema) ===================== */
body.pg-imersivo { overflow: hidden; }
.imz {
  --imz-ink: #dcecff; --imz-ink-2: #9fb6d2; --imz-azul: #3b8cff; --imz-ciano: #6fd6ff; --imz-vidro: rgba(6, 14, 32, .58); --imz-borda: rgba(110, 170, 255, .22);
  /* variáveis dos componentes do IATA (cards, tabelas, gráficos e mapas) no escuro */
  --surface: rgba(9, 18, 38, .72); --surface-2: rgba(16, 28, 54, .7); --surface-3: rgba(30, 48, 84, .65); --text: #e6f0ff; --text-2: #a9bdd6; --muted: #7d93b0;
  --border: rgba(110, 170, 255, .2); --border-2: rgba(110, 170, 255, .3); --brand: #3b8cff; --brand-rgb: 59, 140, 255;
  --viz-surface: transparent; --viz-ink: #e6f0ff; --viz-ink-2: #a9bdd6; --viz-grid: rgba(140, 175, 220, .16); --viz-mapa-vazio: rgba(60, 90, 140, .22);
  --iata-c1: #4f9dff; --iata-c2: #ff7a3d; --iata-c3: #2fd1b5; --iata-c4: #b18cff; --iata-c5: #f2c14e; --iata-c6: #ff6fa4;
  position: fixed; inset: 0; z-index: 70; background: #000; color: var(--imz-ink); overflow: hidden; height: 100dvh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.imz svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.imz-palco { position: absolute; inset: 0; transition: right .6s cubic-bezier(.2,.8,.2,1), bottom .6s cubic-bezier(.2,.8,.2,1); }
.imz-palco canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.imz-palco .entity-overlay { pointer-events: none; }
.imz-vinheta { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0,0,0,.55) 100%); }
.imz-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--imz-borda); background: rgba(4, 10, 24, .45); color: #a9d0ff; display: inline-grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: border-color .2s, background .2s, opacity .2s, transform .15s; text-decoration: none; }
.imz-btn:hover, .imz-btn:focus-visible { border-color: rgba(120, 200, 255, .7); background: rgba(20, 50, 100, .5); outline: none; }
.imz-btn:active { transform: scale(.94); }
.imz-btn[aria-pressed="true"] { border-color: rgba(120, 200, 255, .75); color: #fff; box-shadow: 0 0 14px rgba(60, 140, 255, .35); }
.imz-btn[hidden] { display: none; }
.imz-btn-sm { width: 34px; height: 34px; }
.imz-btn-sm svg { width: 16px; height: 16px; }
#imz-mudo .imz-x { display: none; }
.imz.mudo #imz-mudo .imz-x { display: inline; }
.imz.mudo #imz-mudo .imz-onda { display: none; }

/* topo */
.imz-topo { position: absolute; z-index: 5; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); display: flex; align-items: center; gap: 12px; pointer-events: none; }
.imz-topo > * { pointer-events: auto; }
.imz-marca { display: flex; flex-direction: column; line-height: 1.05; }
.imz-logo { font-weight: 800; letter-spacing: .32em; font-size: 1.05rem; background: linear-gradient(90deg, #9fd4ff, #4f9dff 50%, #b18cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.imz-sub { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--imz-ink-2); margin-top: 3px; }
.imz-estado { margin: 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--imz-borda); background: rgba(4, 10, 24, .45); backdrop-filter: blur(8px); font-size: .8rem; color: var(--imz-ink-2); max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imz-estado i { width: 8px; height: 8px; border-radius: 50%; background: #3a5c86; flex: none; }
.imz[data-estado="ouvindo"] .imz-estado i { background: #6fe3ff; box-shadow: 0 0 10px #6fe3ff; animation: imz-pulso 1s ease-in-out infinite; }
.imz[data-estado="pensando"] .imz-estado i, .imz[data-estado="transcrevendo"] .imz-estado i { background: #b18cff; box-shadow: 0 0 10px #b18cff; animation: imz-pulso .8s ease-in-out infinite; }
.imz[data-estado="falando"] .imz-estado i { background: #4f9dff; box-shadow: 0 0 10px #4f9dff; }
.imz[data-estado="erro"] .imz-estado i { background: #ff6f8f; }
.imz[data-estado="livre"] .imz-estado i { background: #2fd1b5; box-shadow: 0 0 10px #2fd1b5; }
.imz-acoes { display: flex; gap: 8px; }
@keyframes imz-pulso { 50% { transform: scale(1.5); opacity: .6; } }

/* pergunta (topo) e legenda (fala) */
.imz-pergunta { position: absolute; z-index: 4; top: calc(max(12px, env(safe-area-inset-top)) + 58px); left: 50%; transform: translate(-50%, -6px); max-width: min(760px, 90vw); padding: 8px 16px; border-radius: 14px; background: rgba(4, 10, 24, .4); border: 1px solid rgba(110, 170, 255, .14); font-size: .95rem; color: var(--imz-ink); opacity: 0; transition: opacity .4s, transform .4s; display: flex; gap: 10px; align-items: baseline; pointer-events: none; }
.imz-pergunta.on { opacity: 1; transform: translate(-50%, 0); }
.imz-voce { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--imz-ciano); flex: none; }
.imz-legenda { position: absolute; z-index: 4; left: 50%; bottom: calc(max(26px, env(safe-area-inset-bottom) + 18px) + 108px); transform: translate(-50%, 8px); width: min(820px, 92vw); max-height: 7.8em; overflow: hidden; text-align: center; opacity: 0; transition: opacity .45s, transform .45s; pointer-events: none; scroll-behavior: smooth; }
.imz-legenda.on { opacity: 1; transform: translate(-50%, 0); }
.imz.sem-legendas .imz-legenda { opacity: 0 !important; }
.imz-legenda-txt { margin: 0; font-size: clamp(1.02rem, 1.9vw, 1.42rem); line-height: 1.5; font-weight: 500; text-shadow: 0 2px 18px rgba(0, 0, 0, .9); }
.imz-p { color: rgba(220, 236, 255, .38); transition: color .25s; }
.imz-p.dita { color: #f3f8ff; }
.imz-sugestoes { position: absolute; z-index: 4; left: 50%; bottom: calc(max(26px, env(safe-area-inset-bottom) + 18px) + 104px); transform: translateX(-50%); width: min(860px, 94vw); display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.imz-sugestoes[hidden] { display: none; }
.imz-chip { border: 1px solid var(--imz-borda); background: rgba(6, 16, 36, .55); color: var(--imz-ink); border-radius: 999px; padding: 8px 14px; font-size: .84rem; cursor: pointer; backdrop-filter: blur(8px); transition: border-color .2s, background .2s, transform .15s; min-height: 40px; }
.imz-chip:hover, .imz-chip:focus-visible { border-color: rgba(120, 200, 255, .7); background: rgba(20, 50, 100, .55); outline: none; }

/* dock: microfone e teclado */
.imz-dock { position: absolute; z-index: 6; left: 50%; bottom: max(22px, calc(env(safe-area-inset-bottom) + 14px)); transform: translateX(-50%); display: flex; align-items: center; gap: 14px; flex-direction: row; }
.imz-mic { --lvl: 0; position: relative; width: 78px; height: 78px; border-radius: 50%; border: 1px solid rgba(100, 170, 255, .45); cursor: pointer; color: #e2f2ff; touch-action: none;
  background: radial-gradient(circle at 50% 40%, rgba(60, 140, 255, .42), rgba(10, 30, 80, .6) 70%); box-shadow: 0 0 24px rgba(40, 120, 255, .38), inset 0 0 18px rgba(80, 170, 255, .25); display: grid; place-items: center; transition: transform .15s, box-shadow .2s, background .2s; }
.imz-mic svg { width: 30px; height: 30px; position: relative; }
.imz-mic .imz-ico-parar { display: none; }
.imz-mic:focus-visible { outline: 2px solid #7fc4ff; outline-offset: 4px; }
.imz-mic-anel { position: absolute; inset: -7px; border-radius: 50%; border: 2px solid transparent; transform: scale(calc(1 + var(--lvl) * .38)); transition: transform .06s linear, border-color .2s; pointer-events: none; }
.imz-mic-livre { position: absolute; top: 7px; right: 9px; width: 10px; height: 10px; border-radius: 50%; background: #2fd1b5; box-shadow: 0 0 10px #2fd1b5; opacity: 0; transition: opacity .2s; }
.imz-mic[data-livre="1"] .imz-mic-livre { opacity: 1; }
.imz-mic[data-state="recording"] { transform: scale(1.08); background: radial-gradient(circle at 50% 40%, rgba(90, 190, 255, .65), rgba(10, 40, 110, .75) 70%); box-shadow: 0 0 38px rgba(70, 170, 255, .75), inset 0 0 22px rgba(120, 210, 255, .45); }
.imz-mic[data-state="recording"] .imz-mic-anel, .imz-mic[data-livre="1"] .imz-mic-anel { border-color: rgba(120, 210, 255, .55); }
.imz-mic[data-state="busy"] .imz-mic-anel { border-color: rgba(177, 140, 255, .6); border-top-color: transparent; animation: imz-gira 1s linear infinite; transform: none; }
.imz-mic[data-state="speaking"] .imz-ico-mic { display: none; }
.imz-mic[data-state="speaking"] .imz-ico-parar { display: block; }
@keyframes imz-gira { to { transform: rotate(360deg); } }
.imz-dica { position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%); white-space: nowrap; font-size: .7rem; color: var(--imz-ink-2); letter-spacing: .04em; }
.imz-teclado { display: flex; align-items: center; gap: 6px; width: min(520px, 70vw); padding: 5px 5px 5px 16px; border-radius: 999px; border: 1px solid var(--imz-borda); background: rgba(6, 16, 36, .7); backdrop-filter: blur(10px); }
.imz-teclado[hidden] { display: none; }
.imz-teclado input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--imz-ink); font-size: 1rem; outline: none; user-select: text; -webkit-user-select: text; height: 40px; }
.imz-teclado input::placeholder { color: var(--imz-ink-2); }
.imz-enviar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--imz-azul); color: #fff; display: grid; place-items: center; cursor: pointer; }
.imz.com-teclado .imz-dock { flex-direction: row-reverse; }

/* painel de visualizações (holográfico) */
.imz-painel { position: absolute; z-index: 5; top: calc(max(12px, env(safe-area-inset-top)) + 58px); right: max(12px, env(safe-area-inset-right)); bottom: 16px; width: min(46vw, 760px); display: flex; flex-direction: column;
  border: 1px solid var(--imz-borda); border-radius: 18px; background: linear-gradient(160deg, rgba(10, 24, 52, .72), rgba(4, 10, 24, .78)); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 0 0 1px rgba(80, 150, 255, .06), 0 20px 80px rgba(0, 20, 60, .6), inset 0 1px 0 rgba(160, 210, 255, .08); animation: imz-entra .55s cubic-bezier(.2,.8,.2,1); user-select: text; -webkit-user-select: text; }
.imz-painel[hidden] { display: none; }
.imz-painel::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(120, 190, 255, .025) 0 1px, transparent 1px 4px); }
@keyframes imz-entra { from { opacity: 0; transform: translateX(24px) scale(.98); } }
.imz-painel-topo { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 6px 18px; }
.imz-painel-topo h2 { margin: 0; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--imz-ciano); font-weight: 700; }
.imz-painel-acoes { display: flex; gap: 6px; }
.imz-blocos { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 14px 10px; scrollbar-width: thin; scrollbar-color: rgba(110, 170, 255, .3) transparent; }
.imz-card { opacity: 0; transform: translateY(14px) scale(.985); transition: opacity .55s, transform .55s cubic-bezier(.2,.8,.2,1); }
.imz-card.in { opacity: 1; transform: none; }
.imz .iata-bloco { background: rgba(8, 18, 40, .62); border-color: rgba(110, 170, 255, .18); box-shadow: inset 0 1px 0 rgba(160, 210, 255, .06); color: var(--text); }
.imz .iata-bloco .btn { background: rgba(20, 40, 80, .6); color: var(--text); border-color: rgba(110, 170, 255, .25); }
.imz .tbl th { background: rgba(14, 28, 58, .9); color: var(--text-2); }
.imz .tbl td, .imz .tbl th { border-color: rgba(110, 170, 255, .12); }
.imz .iata-chart { height: 280px; }
.imz .iata-mapa { height: 380px; }
.imz-analise { margin: 0 14px 14px; border-top: 1px solid rgba(110, 170, 255, .14); padding-top: 8px; }
.imz-analise[hidden] { display: none; }
.imz-analise summary { cursor: pointer; font-size: .82rem; color: var(--imz-ciano); padding: 4px 0; }
.imz-analise .iata-msg-texto { font-size: .9rem; line-height: 1.55; color: var(--text); max-height: 32vh; overflow: auto; }
.imz-painel-abrir { position: absolute; z-index: 5; right: max(12px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); }
.imz.com-painel .imz-palco { right: min(46vw, 760px); }
/* com o painel aberto, pergunta, legenda, sugestões e microfone se centralizam na área do núcleo */
@media (min-width: 901px) {
  .imz.com-painel .imz-pergunta, .imz.com-painel .imz-legenda, .imz.com-painel .imz-dock, .imz.com-painel .imz-sugestoes { left: calc((100% - min(46vw, 760px) - 12px) / 2); }
  .imz.com-painel .imz-legenda, .imz.com-painel .imz-sugestoes { width: min(820px, calc(100% - min(46vw, 760px) - 48px)); }
  .imz.com-painel .imz-pergunta { max-width: calc(100% - min(46vw, 760px) - 48px); }
  .imz.com-painel .imz-teclado { width: min(420px, calc(100vw - min(46vw, 760px) - 200px)); }
  .imz-pergunta, .imz-legenda, .imz-dock, .imz-sugestoes { transition: left .6s cubic-bezier(.2,.8,.2,1), opacity .45s, transform .45s; }
}
.imz-legenda { -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 100%); mask-image: linear-gradient(transparent, #000 22%, #000 100%); }
.iata-mapa-topo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.iata-mapa-leg { margin: 0; }
.iata-mapa { height: 360px; }

/* tela inicial */
.imz-inicio { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 55%, rgba(0, 10, 30, .15), rgba(0, 0, 0, .7) 70%); transition: opacity .7s; }
.imz-inicio.saindo { opacity: 0; pointer-events: none; }
.imz-inicio[hidden] { display: none; }
.imz-inicio-caixa { max-width: 620px; text-align: center; }
.imz-kicker { font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--imz-ciano); margin: 0 0 10px; }
.imz-inicio h1 { margin: 0 0 12px; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -.01em; background: linear-gradient(90deg, #e9f4ff, #8ec5ff 60%, #c4a8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.imz-inicio-txt { color: var(--imz-ink-2); line-height: 1.6; margin: 0 auto 20px; max-width: 520px; }
.imz-genero { margin: 0 0 18px; padding: 14px; border-radius: 14px; border: 1px solid var(--imz-borda); background: rgba(6, 16, 36, .6); }
.imz-genero[hidden] { display: none; }
.imz-genero p { margin: 0 0 10px; color: var(--imz-ink); font-size: .92rem; }
.imz-genero-op { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.imz-op { border: 1px solid var(--imz-borda); background: rgba(10, 24, 52, .6); color: var(--imz-ink); padding: 10px 16px; border-radius: 12px; cursor: pointer; min-height: 44px; }
.imz-op[aria-pressed="true"] { border-color: #6fd6ff; background: rgba(40, 110, 220, .45); color: #fff; }
.imz-iniciar { display: inline-flex; align-items: center; gap: 10px; padding: 14px 30px; border-radius: 999px; border: 1px solid rgba(120, 200, 255, .55); background: linear-gradient(135deg, rgba(40, 120, 255, .65), rgba(120, 80, 255, .55)); color: #fff; font-size: 1.05rem; font-weight: 600; cursor: pointer; box-shadow: 0 0 34px rgba(60, 140, 255, .45); }
.imz-iniciar:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.imz-iniciar:focus-visible { outline: 2px solid #9fd4ff; outline-offset: 4px; }
.imz-aviso { margin: 16px 0 0; font-size: .74rem; color: var(--muted); }

@media (max-width: 900px) {
  .imz-painel { left: 10px; right: 10px; width: auto; top: auto; bottom: calc(max(22px, env(safe-area-inset-bottom) + 14px) + 96px); height: min(52dvh, 560px); }
  .imz.com-painel .imz-palco { right: 0; bottom: 48dvh; }
  .imz.com-painel .imz-legenda { bottom: auto; top: calc(max(12px, env(safe-area-inset-top)) + 100px); max-height: 4.6em; }
  .imz.com-painel .imz-pergunta { display: none; }
  .imz-painel-abrir { top: auto; transform: none; bottom: calc(max(22px, env(safe-area-inset-bottom) + 14px) + 14px); right: 14px; }
  .imz .iata-chart { height: 240px; }
  .imz .iata-mapa { height: 300px; }
}
@media (max-width: 560px) {
  .imz-estado { display: none; }
  .imz-acoes { gap: 6px; margin-left: auto; }
  .imz-acoes .imz-btn { width: 40px; height: 40px; }
  #imz-legendas { display: none; }
  .imz-mic { width: 82px; height: 82px; }
  .imz-sugestoes .imz-chip:nth-child(n+4) { display: none; }
  .imz-dock { left: 12px; right: 12px; transform: none; justify-content: center; gap: 10px; }
  .imz.com-teclado .imz-mic { width: 58px; height: 58px; }
  .imz.com-teclado .imz-mic svg { width: 24px; height: 24px; }
  .imz.com-teclado .imz-dica { display: none; }
  .imz-teclado { width: auto; flex: 1 1 auto; min-width: 0; }
  .imz-pergunta { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  .imz-palco, .imz-card, .imz-painel, .imz-mic, .imz-mic-anel, .imz-legenda, .imz-pergunta, .imz-inicio { transition: none !important; animation: none !important; }
}
/* formulário de acesso à IA (Administração › Usuários) */
.ia-acesso-op { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ia-acesso-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.ia-acesso-item > span { display: flex; flex-direction: column; gap: 3px; }
.ia-acesso-item input { margin-top: 3px; }
.ia-acesso-tit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Administração › IATA — Imersivo: prévia dos textos */
.tx-previa { padding: 18px; border-radius: 14px; background: radial-gradient(ellipse at 50% 30%, #0b1a38, #02050c 75%); color: #dcecff; text-align: center; }
.tx-previa-t { font-size: 1.6rem; font-weight: 700; margin: 4px 0 8px; background: linear-gradient(90deg, #e9f4ff, #8ec5ff 60%, #c4a8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tx-previa-a { color: #9fb6d2; font-size: .9rem; line-height: 1.55; margin: 0 0 12px; }
.tx-previa-f { font-size: .95rem; margin: 0; color: #f3f8ff; }

/* Loja de brindes (gamificação) */
.loja-grid { align-items: stretch; }
.loja-item { display: flex; flex-direction: column; gap: 6px; }
.loja-item h3 { margin: 0; font-size: 1.02rem; }
.loja-item .loja-pontos { margin-top: auto; }
.loja-item form, .loja-item > .btn { align-self: flex-start; }

/* Tabela hierárquica: célula com estado (suficiente / abaixo do mínimo) — ex.: Cobertura CL por Cidade e Cliente */
table.tt td.tt-ok, table.tt th.tt-nome.tt-ok { background: var(--ok-bg); color: var(--ok); font-weight: 650; }
table.tt td.tt-falta, table.tt th.tt-nome.tt-falta { background: var(--warn-bg); color: var(--warn); font-weight: 650; }
/* Central de atualização: repetições e tempo médio das etapas */
.atu-rep { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.atu-rep .input { width: 90px; }
.atu-et-tempo.atu-lenta { color: var(--warn); }

/* evolução geográfica: controles da animação e símbolos da legenda */
.ger-tempo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.ger-tempo select.input { width: auto; flex: 0 0 auto; }
.ger-tempo .ger-tempo-rng { flex: 1 1 180px; min-width: 140px; accent-color: var(--brand); }
.ger-tempo .ger-tempo-rot { flex: 1 1 100%; font-size: .92rem; }
.ger-tempo-resumo { margin: 6px 0 2px; }
.ger-sim { display: inline-block; width: 11px; height: 11px; background: var(--c); border-radius: 50%; }
.ger-sim-triangle { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ger-sim-diamond { border-radius: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.ger-sim-ring { background: transparent; border: 2px solid var(--c); }
@media (min-width: 900px) { .ger-tempo .ger-tempo-rot { flex: 0 1 auto; } }
.ger-tempo-grade { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.ger-tempo-mapa { position: relative; min-width: 0; }
.ger-tempo-lado { min-width: 0; display: flex; flex-direction: column; }
.ger-tempo-tit { margin: 0 0 4px; font-weight: 600; color: var(--text-2); }
.ger-tempo-linha { height: 260px; }
.ger-tempo-aviso { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 999px; font-size: .85rem;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border); box-shadow: var(--shadow-sm); pointer-events: none; max-width: calc(100% - 24px); text-align: center; }
.ger-tempo-aviso[hidden] { display: none; }
@media (min-width: 1000px) { .ger-tempo-grade { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .ger-tempo-linha { flex: 1; height: auto; min-height: 440px; } }

/* maximizar gráficos e mapas (apresentação em reunião) — js/maximizar.js */
.pg-max-alvo { position: relative; }
.pg-max-btn { margin-left: auto; flex: 0 0 auto; }
.pg-max-btn[aria-pressed="true"] { width: auto; padding: 0 10px; gap: 6px; display: inline-flex; align-items: center; font-weight: 600; }
.pg-max-flutuante { position: absolute; top: 8px; right: 8px; z-index: 3; }
.dash-card-head:has(.pg-max-btn) { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pg-max { background: var(--surface) !important; color: var(--text); overflow: auto; padding: clamp(14px, 2.5vw, 28px) !important; margin: 0 !important; border-radius: 0 !important; max-width: none !important; width: 100vw; height: 100vh; box-sizing: border-box; }
.pg-max:fullscreen { width: 100vw; height: 100vh; }
.pg-max::backdrop { background: var(--surface); }
.pg-max-janela { position: fixed !important; inset: 0; z-index: 2000; }
body.pg-max-ativo { overflow: hidden; }
.pg-max .dash-card-head h2 { font-size: clamp(1.1rem, 2vw, 1.6rem); }
.pg-max .dash-chart { height: 70vh !important; min-height: 320px; }
.pg-max[data-graficos="1"] .dash-chart { min-height: 280px; }
.pg-max .ger-tempo-grade { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.pg-max .ger-tempo-linha { min-height: 0; }
@media (max-width: 760px) { .pg-max .ger-tempo-grade { grid-template-columns: minmax(0, 1fr); } }
@media print { .pg-max-btn { display: none !important; } }


/* =====================================================================
   MODO APRESENTAÇÃO
   - .pg-embed / html.ap-embed: tela do dashboard dentro de um slide (só o bloco do slide)
   - .pg-palco: projetor, painel do apresentador e impressão, sem menus
   - palco 16:9 com unidades de contêiner (cqw), temas claro / escuro / cores da empresa
   ===================================================================== */
/* ---------- dashboard incorporado no slide ---------- */
body.pg-embed .sb-left, body.pg-embed .topbar, body.pg-embed .sb-right, body.pg-embed .ia-flut, body.pg-embed .overlay,
body.pg-embed .toasts, body.pg-embed .skip, body.pg-embed .pg-max-btn, body.pg-embed .ap-add-btn, body.pg-embed .dash-head { display: none !important; }
body.pg-embed .shell, body.pg-palco .shell { display: block; min-height: 0; }
html.ap-embed, html.ap-embed body { background: transparent !important; overflow: hidden !important; height: 100%; }
html.ap-embed body { visibility: hidden; }
html.ap-embed *:has(.ap-alvo) { transform: none !important; filter: none !important; contain: none !important; will-change: auto !important; animation: none !important; backdrop-filter: none !important; }
html.ap-embed .ap-alvo { visibility: visible; position: fixed !important; top: 0; left: 0; right: 0; bottom: auto; z-index: 10; margin: 0 !important; max-width: none !important; width: 100vw; box-sizing: border-box;
  background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; padding: 2px 4px !important; animation: none !important; }
html.ap-embed .ap-alvo .dash-card-head { display: none; } /* o título fica no slide */
html.ap-embed .ap-alvo .dash-kpi { transition: opacity .55s var(--ease), transform .55s var(--ease); }
html.ap-embed .ap-passo-oculto { opacity: 0 !important; transform: translateY(10px) scale(.98); }
.ap-embed-erro { visibility: visible; position: fixed; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; color: var(--muted); font-size: 1rem; }

/* ---------- páginas do palco sem menus ---------- */
body.pg-palco .sb-left, body.pg-palco .topbar, body.pg-palco .sb-right, body.pg-palco .ia-flut, body.pg-palco .skip { display: none !important; }

/* ---------- temas do palco ---------- */
.ap-projetor, .ap-impressao {
  --ap-bg: #F6F7FA; --ap-ink: #0F172A; --ap-sub: #475569; --ap-mute: #64748B; --ap-acc: var(--brand); --ap-acc-2: var(--brand-2);
  --ap-card: #FFFFFF; --ap-line: #E2E8F0; --ap-warn: #B45309; --ap-letter: #0B0D12;
}
.ap-projetor[data-tema="escuro"], .ap-impressao[data-tema="escuro"] {
  --ap-bg: #0D1117; --ap-ink: #F1F5F9; --ap-sub: #CBD5E1; --ap-mute: #94A3B8; --ap-acc: var(--brand-2); --ap-acc-2: var(--accent);
  --ap-card: #161A21; --ap-line: #2A313C; --ap-warn: #FBBF24; --ap-letter: #000;
}
.ap-projetor[data-tema="marca"], .ap-impressao[data-tema="marca"] {
  --ap-bg: linear-gradient(135deg, rgb(var(--brand-rgb)) 0%, color-mix(in srgb, rgb(var(--brand-rgb)) 55%, #000) 100%);
  --ap-ink: #FFFFFF; --ap-sub: rgba(255,255,255,.86); --ap-mute: rgba(255,255,255,.7); --ap-acc: var(--accent); --ap-acc-2: var(--brand-2);
  --ap-card: #FFFFFF; --ap-line: rgba(255,255,255,.22); --ap-warn: #FDE68A; --ap-letter: #05070B;
}

/* ---------- projetor ---------- */
.ap-projetor { position: fixed; inset: 0; background: var(--ap-letter); display: grid; place-items: center; overflow: hidden; color: var(--ap-ink); }
.ap-projetor.is-ocioso, .ap-projetor.is-ocioso * { cursor: none; }
.ap-stage { position: relative; width: min(100vw, calc(100vh * 16 / 9)); aspect-ratio: 16 / 9; container-type: size; overflow: hidden; background: var(--ap-bg); }
.ap-vazio { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-size: 2cqw; color: var(--ap-mute); }

/* cena (slide) */
.ap-cena { position: absolute; inset: 0; box-sizing: border-box; padding: 3.6cqh 4.4cqw 5.6cqh; display: flex; flex-direction: column; gap: 1.6cqh; background: var(--ap-bg); color: var(--ap-ink); font-family: var(--font);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .6s var(--ease), transform .75s var(--ease), filter .6s var(--ease), clip-path .8s var(--ease), visibility 0s linear .8s; }
.ap-cena.is-ativa { opacity: 1; visibility: visible; pointer-events: auto; transform: none; filter: none; clip-path: inset(0 0 0 0); z-index: 2;
  transition-delay: .1s, .1s, .1s, .1s, 0s; }
.ap-cena.is-saindo { visibility: visible; z-index: 1; transition-delay: 0s, 0s, 0s, 0s, 0s; }
.ap-tr-suave:not(.is-ativa) { filter: blur(8px); }
.ap-tr-zoom:not(.is-ativa) { transform: scale(1.06); }
.ap-tr-zoom.is-saindo { transform: scale(.95); }
.ap-tr-deslizar:not(.is-ativa) { transform: translateX(7%); }
.ap-tr-deslizar.is-saindo { transform: translateX(-7%); }
.ap-tr-revelar:not(.is-ativa) { clip-path: inset(0 100% 0 0); opacity: 1; }
.ap-tr-revelar.is-saindo { clip-path: inset(0 0 0 0); opacity: 0; }

/* entrada escalonada dos textos */
.ap-cena .t-in { opacity: 0; transform: translateY(1.6cqh); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 90ms + .2s); }
.ap-cena.is-ativa .t-in { opacity: 1; transform: none; }
.ap-item { transition: opacity .5s var(--ease), transform .5s var(--ease); }
.ap-item.is-oculto { opacity: 0; transform: translateY(1.2cqh); }

/* tipografia */
.ap-kicker { margin: 0; font-size: 1.05cqw; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ap-acc); }
.ap-projetor[data-tema="marca"] .ap-kicker, .ap-impressao[data-tema="marca"] .ap-kicker { color: var(--ap-sub); }
.ap-titulo { margin: 0; font-size: 2.6cqw; line-height: 1.12; font-weight: 800; letter-spacing: -.01em; color: var(--ap-ink); text-wrap: balance; }
.ap-titulo--capa { font-size: 5cqw; line-height: 1.04; letter-spacing: -.02em; }
.ap-sub { margin: 0; font-size: 1.35cqw; line-height: 1.4; color: var(--ap-sub); max-width: 70ch; text-wrap: pretty; }
.ap-barra { display: block; width: 7cqw; height: .55cqh; min-height: 3px; border-radius: 99px; background: linear-gradient(90deg, var(--ap-acc), var(--ap-acc-2)); }
.ap-rot { margin: 0 0 1cqh; font-size: .95cqw; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ap-mute); }

/* capa, seção, encerramento */
.ap-capa, .ap-secao { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2.4cqh; max-width: 78cqw; }
.ap-capa .ap-sub { font-size: 1.6cqw; }
.ap-secao .ap-titulo { font-size: 4cqw; }
.ap-fim { align-items: center; text-align: center; max-width: none; }
.ap-fim .ap-sub { margin-inline: auto; }

/* cabeçalho de slide de conteúdo */
.ap-cab { display: flex; flex-direction: column; gap: .8cqh; flex: 0 0 auto; }

/* slide de dashboard */
.ap-corpo { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2cqw; }
.ap-corpo--leitura { grid-template-columns: minmax(0, 1fr) 25cqw; }
.ap-frame-caixa { position: relative; min-height: 0; border-radius: 1cqw; background: var(--ap-card); box-shadow: 0 .4cqh 2.4cqh -1cqh rgba(15,23,42,.35); overflow: hidden; }
.ap-projetor[data-tema="claro"] .ap-frame-caixa, .ap-impressao[data-tema="claro"] .ap-frame-caixa { border: 1px solid var(--ap-line); box-shadow: 0 .3cqh 1.6cqh -1cqh rgba(15,23,42,.18); }
.ap-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: normal; }
.ap-carregando { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 1.4cqh; padding: 2cqw; text-align: center; color: #64748B; font-size: 1.1cqw; background: var(--ap-card); }
.ap-projetor[data-tema="escuro"] .ap-carregando, .ap-impressao[data-tema="escuro"] .ap-carregando { color: #94A3B8; }
.ap-carregando[hidden] { display: none; }
.ap-spinner { width: 2.6cqw; height: 2.6cqw; border-radius: 50%; border: .3cqw solid rgba(100,116,139,.25); border-top-color: var(--ap-acc); animation: ap-gira .9s linear infinite; }
@keyframes ap-gira { to { transform: rotate(360deg); } }
.ap-leitura { min-height: 0; overflow: hidden; display: flex; flex-direction: column; padding: 1.6cqw; border-radius: 1cqw; border: 1px solid var(--ap-line); background: color-mix(in srgb, var(--ap-card) 6%, transparent); }
.ap-cena .ap-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6cqh; }
.ap-cena .ap-lista .ap-item { position: relative; padding-left: 1.4cqw; font-size: 1.2cqw; line-height: 1.45; color: var(--ap-ink); }
.ap-cena .ap-lista .ap-item::before { content: ""; position: absolute; left: 0; top: .35em; width: .3cqw; min-width: 3px; height: 1em; border-radius: 99px; background: var(--ap-acc); }

/* resumo executivo */
.ap-resumo { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 3cqw; align-content: start; padding-top: 1cqh; }
.ap-resumo:not(:has(.ap-alertas)) { grid-template-columns: minmax(0, 1fr); max-width: 70cqw; }
.ap-cena .ap-resumo .ap-lista .ap-item { font-size: 1.55cqw; }
.ap-alertas { padding: 1.8cqw; border-radius: 1cqw; border: 1px solid var(--ap-line); }
.ap-cena .ap-alertas .ap-item::before { background: var(--ap-warn); }
.ap-cena .ap-alertas .ap-rot { color: var(--ap-warn); }
.ap-cena .muted { color: var(--ap-mute); font-size: 1.2cqw; }

/* rodapé do slide */
.ap-rodape { position: absolute; left: 4.4cqw; right: 4.4cqw; bottom: 1.6cqh; display: flex; justify-content: space-between; gap: 2cqw; font-size: .8cqw; color: var(--ap-mute); letter-spacing: .02em; }
.ap-rodape .ap-num { font-variant-numeric: tabular-nums; }

/* ferramentas (HUD) */
.ap-hud-progresso { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 20; background: rgba(255,255,255,.08); }
.ap-hud-progresso span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-2), var(--accent)); transition: width .5s var(--ease); }
.ap-hud-aviso { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 20; margin: 0; padding: 6px 14px; border-radius: 99px; background: rgba(15,23,42,.82); color: #fff; font-size: .85rem; }
.ap-hud-ferr { position: fixed; right: 14px; bottom: 14px; z-index: 20; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100vw - 28px);
  padding: 5px; border-radius: 12px; background: rgba(15,23,42,.84); color: #E2E8F0; box-shadow: 0 10px 30px -12px rgba(0,0,0,.6); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.ap-projetor.is-ocioso .ap-hud-ferr { opacity: 0; transform: translateY(8px); pointer-events: none; }
.ap-projetor.is-ocioso .ap-hud-progresso { opacity: .5; }
.ap-hud-cont { padding: 0 8px; font-variant-numeric: tabular-nums; font-weight: 700; font-size: .85rem; }
.ap-hud-versao { padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.1); font-size: .75rem; }
.ap-hud-btn { min-height: 34px; min-width: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: .85rem; cursor: pointer; display: inline-grid; place-items: center; text-decoration: none; }
.ap-hud-btn[data-ap-anterior], .ap-hud-btn[data-ap-proximo] { font-size: 1.3rem; line-height: 1; }
.ap-hud-btn:hover, .ap-hud-btn:focus-visible { background: rgba(255,255,255,.14); color: #fff; outline: none; }
.ap-hud-btn:focus-visible { box-shadow: 0 0 0 2px var(--brand-2); }
.ap-blackout { position: fixed; inset: 0; z-index: 40; background: #000; cursor: none; }
.ap-blackout[hidden] { display: none; }
.ap-dialogo { border: 0; border-radius: 16px; padding: 22px 24px; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.ap-dialogo::backdrop { background: rgba(0,0,0,.6); }
.ap-dialogo h2 { margin: 0 0 12px; font-size: 1.15rem; }
.ap-dialogo dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 16px; font-size: .92rem; }
.ap-dialogo dt { white-space: nowrap; }
.ap-dialogo dd { margin: 0; color: var(--text-2); }
.ap-dialogo kbd, .ap-ctl-barra kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border-2); border-bottom-width: 2px; background: var(--surface-2); font: 600 .8rem/1.4 var(--font); text-align: center; }
@media (max-width: 640px) { .ap-hud-btn[data-ap-controle], .ap-hud-btn[data-ap-atalhos] { display: none; } }

/* ---------- painel do apresentador ---------- */
.ap-controle { min-height: 100vh; box-sizing: border-box; padding: 18px clamp(14px, 3vw, 32px) 96px; display: flex; flex-direction: column; gap: 16px; background: var(--bg); }
.ap-ctl-barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.ap-ctl-barra p { margin: 0; }
.ap-ctl-titulo { font-weight: 800; font-size: 1.05rem; }
.ap-ctl-grade { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.ap-ctl-atual { padding: clamp(16px, 2.5vw, 28px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.ap-ctl-atual h1 { margin: 4px 0 6px; font-size: clamp(1.4rem, 3vw, 2.2rem); line-height: 1.15; }
.ap-ctl-atual [data-ap-passo] { font-weight: 700; color: var(--brand); min-height: 1.2em; }
.ap-ctl-leitura p { margin: 8px 0 0; font-size: 1.05rem; line-height: 1.5; color: var(--text-2); }
.ap-ctl-lado { display: grid; gap: 12px; }
.ap-ctl-lado .card { padding: 14px 16px; }
.ap-ctl-lado .card p { margin: 0; }
.ap-ctl-notas [data-ap-notas] { white-space: pre-wrap; font-size: 1.05rem; line-height: 1.55; max-height: 46vh; overflow: auto; }
.ap-ctl-botoes { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--border); }
.ap-ctl-botoes .btn { min-width: 140px; }
.linklike { border: 0; background: none; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; }
@media (max-width: 860px) { .ap-ctl-grade { grid-template-columns: minmax(0, 1fr); } .ap-ctl-botoes .btn { min-width: 0; flex: 1; } }

/* ---------- impressão (PDF) ---------- */
.ap-impressao { padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 18px; background: #E5E7EB; min-height: 100vh; box-sizing: border-box; }
.ap-imp-barra { width: min(1280px, 100%); padding: 14px 16px; border-radius: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-sizing: border-box; }
.ap-imp-barra p { margin: 0 0 8px; }
.ap-imp-paginas { display: flex; flex-direction: column; gap: 18px; max-width: 100%; overflow-x: auto; }
.ap-pagina { position: relative; width: 1280px; height: 720px; flex: 0 0 auto; container-type: size; overflow: hidden; box-shadow: 0 6px 24px -10px rgba(0,0,0,.35); background: var(--ap-bg); }
.ap-impressao .ap-cena { transition: none !important; filter: none !important; transform: none !important; clip-path: none !important; }
.ap-impressao .t-in, .ap-impressao .ap-item { opacity: 1 !important; transform: none !important; transition: none !important; }
@media print {
  @page { size: 338.67mm 190.5mm; margin: 0; }
  body.pg-palco { background: #fff !important; }
  .ap-impressao { padding: 0; gap: 0; background: none; display: block; }
  .ap-imp-paginas { display: block; overflow: visible; }
  .ap-pagina { width: 338.67mm; height: 190.5mm; box-shadow: none; break-after: page; page-break-after: always; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .ap-pagina:last-child { break-after: auto; page-break-after: auto; }
  .no-print, .ap-hud, .ap-blackout { display: none !important; }
}

/* ---------- lista e editor ---------- */
.ap-index { grid-template-columns: minmax(280px, 1fr) minmax(0, 1.6fr); align-items: start; }
.ap-index .h3, .ap-lado .h3, .ap-ctl-lado .h3, .ap-add-dlg .h3 { margin: 0 0 10px; font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ap-index .ap-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ap-index .ap-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.ap-item-link { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none; }
.ap-item-link:hover strong { color: var(--brand); text-decoration: underline; }
.ap-ro { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; }
.ap-editor { display: grid; grid-template-columns: minmax(290px, 1.05fr) minmax(0, 1.4fr) minmax(290px, 1fr); gap: 16px; align-items: start; }
.ap-editor > .card { min-width: 0; }
.ap-slide-lista { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; max-height: 60vh; overflow: auto; }
.ap-sl { display: flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding-right: 4px; }
.ap-sl.is-sel { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.ap-sl-sel { flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; border-radius: 10px; }
.ap-sl-num { grid-row: 1 / span 2; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: .8rem; font-variant-numeric: tabular-nums; }
.ap-sl.is-sel .ap-sl-num { background: var(--brand); color: #fff; }
.ap-sl-tipo { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ap-sl-tit { font-size: .9rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.ap-sl-acoes { display: flex; flex: 0 0 auto; }
.ap-sl-acoes .iconbtn { width: 30px; height: 30px; }
.ap-sl-acoes .iconbtn:first-child .ico { transform: rotate(180deg); }
.ap-sl-acoes .iconbtn[disabled] { opacity: .3; cursor: default; }
.ap-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.ap-dashs > summary { list-style: none; cursor: pointer; }
.ap-dashs > summary::-webkit-details-marker { display: none; }
.ap-dashs[open] > summary { margin-bottom: 8px; }
.ap-dash-lista { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow: auto; font-size: .9rem; }
.ap-form [data-ap-form] { display: grid; gap: 12px; }
.ap-form .field label { display: grid; gap: 6px; font-weight: 600; font-size: .88rem; }
.ap-form textarea.input { min-height: 0; resize: vertical; line-height: 1.45; }
.ap-origem { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-2); line-height: 1.5; }
.ap-lado { display: grid; gap: 16px; min-width: 0; }
.ap-ia-op { display: grid; gap: 6px; }
.ap-sh-lista { display: grid; gap: 4px; max-height: 220px; overflow: auto; margin-top: 8px; padding: 4px 2px; }
.ap-sh-lista .check { align-items: baseline; }
.ap-versoes { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.ap-versao, .ap-index .ap-versoes li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.btn-danger-ghost { background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); }
@media (max-width: 1280px) { .ap-editor { grid-template-columns: minmax(240px, .9fr) minmax(0, 1.4fr); } .ap-lado { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; } }
@media (max-width: 860px) { .ap-editor, .ap-index { grid-template-columns: minmax(0, 1fr); } }

/* ---------- "Adicionar à apresentação" nas telas de dashboard ---------- */
.ap-add-btn { flex: 0 0 auto; }
.dash-card-head:has(.ap-add-btn) { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-card-head:has(.ap-add-btn):not(:has(.pg-max-btn)) .ap-add-btn { margin-left: auto; }
.ap-add-alvo { position: relative; }
.ap-add-flutuante { position: absolute; top: 8px; right: 52px; z-index: 3; background: var(--surface); border: 1px solid var(--border); }
.ap-add-alvo:not(.pg-max-alvo) .ap-add-flutuante { right: 8px; }
.ap-add-dlg { border: 0; border-radius: 16px; padding: 20px 22px; width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.ap-add-dlg::backdrop { background: rgba(15,23,42,.5); }
.ap-add-dlg form { display: grid; gap: 10px; }
.ap-add-dlg .field { display: grid; gap: 4px; }
.ap-add-dlg .row { justify-content: flex-end; }
@media print { .ap-add-btn { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  .ap-cena, .ap-cena .t-in, .ap-item, .ap-hud-ferr, html.ap-embed .ap-alvo .dash-kpi { transition-duration: .01ms !important; transition-delay: 0s !important; }
  .ap-tr-suave:not(.is-ativa), .ap-tr-zoom:not(.is-ativa), .ap-tr-deslizar:not(.is-ativa) { filter: none; transform: none; }
  .ap-spinner { animation-duration: 3s; }
}
.ap-filtros { margin: 0; font-size: .85cqw; color: var(--ap-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
html.ap-embed .ap-alvo [_echarts_instance_] { overflow: hidden; } /* o canvas antigo não pode inflar a medida da altura ao reajustar */
html.ap-imp .ap-alvo details:not([open]) { display: none; }

/* ---------- Cards por usuário (Administração › Dashboards e permissões) ---------- */
.bl-lista { display: grid; gap: 12px; margin-top: 8px; }
.bl-grupo { display: block; }
.bl-bloco { padding: 2px 0; border-bottom: 1px dashed var(--border); }
.bl-bloco:last-child { border-bottom: 0; }
.bl-filhos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 2px 14px; margin: 0 0 6px 46px; }
.bl-bloco:has(> .graf-item input:not(:checked)) .bl-filhos { opacity: .45; pointer-events: none; }

/* ---------- "Ver como" (superadministrador vendo como outro usuário) ---------- */
.vc-faixa { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 10px; flex-wrap: nowrap;
  width: max-content; max-width: min(980px, calc(100vw - 24px)); box-sizing: border-box; padding: 8px 10px 8px 14px; border-radius: 14px; background: #7C2D12; color: #FFF7ED; font-size: .86rem;
  box-shadow: 0 12px 32px -12px rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.18); }
.vc-faixa .ico { flex: none; }
.vc-faixa .vc-txt { min-width: 0; line-height: 1.35; }
.vc-faixa form { flex: none; }
.vc-faixa strong { color: #fff; }
.vc-faixa .vc-mail { opacity: .8; }
.vc-faixa form { margin: 0; }
.vc-faixa .btn { background: #fff; color: #7C2D12; border-color: transparent; }
body:has(.vc-faixa) .ia-flut { bottom: 76px; }
body.pg-embed .vc-faixa { display: none !important; }
@media (max-width: 640px) { .vc-faixa { bottom: 8px; font-size: .8rem; } .vc-faixa .vc-mail { display: none; } }
@media print { .vc-faixa { display: none !important; } }

/* ---------- Conexão com Excel ---------- */
.ex-dash { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 6px 16px; }
.ex-codigo { width: 100%; min-height: 0; font-size: .8rem; line-height: 1.4; white-space: pre; overflow: auto; margin-top: 8px; }
.ex-tab details > summary { cursor: pointer; }

/* ---------- Layout legado (consulta simplificada, pensada para o celular) ---------- */
.lg { max-width: 1180px; margin: 0 auto; }
.lg-cab { display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--surface); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.lg-cab h1 { flex: 1; margin: 0; font-size: 1.05rem; letter-spacing: .02em; text-align: center; }
.lg-voltar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 8px; background: var(--ok); color: #fff; flex: none; }
.lg-voltar .lg-seta { transform: rotate(180deg); }
.lg-intro, .lg-nota, .lg-atualizado { margin: 6px 2px 12px; }
.lg-atualizado { text-align: center; font-style: italic; }
.lg-menu { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .lg-menu { grid-template-columns: repeat(2, 1fr); } }
.lg-botao { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 14px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-size: 1.1rem; font-weight: 700; text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.lg-botao:hover, .lg-botao:focus-visible { border-color: var(--brand); color: var(--brand); }
.lg-botao .ico { width: 26px; height: 26px; color: var(--brand); flex: none; }
.lg-rodape { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 18px; }
.lg-check { display: inline-flex; gap: 8px; align-items: center; font-size: .92rem; }
.lg-check input { width: 20px; height: 20px; }
.lg-filtros { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.lg-radios { display: flex; flex-wrap: wrap; gap: 6px; }
.lg-radios label { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: .82rem; font-weight: 600; cursor: pointer; }
.lg-radios label:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.lg-radios input { width: 16px; height: 16px; accent-color: var(--brand); }
.lg-radios-meses { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
.lg-radios-meses label { flex: none; }
.lg-campo { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; }
.lg-campo .input { min-height: 40px; width: auto; }
.lg-carregando .lg-filtros { opacity: .6; pointer-events: none; }
.lg-h2 { font-size: 1rem; margin: 0 0 8px; }
.lg-bloco { margin-bottom: 12px; }
.lg-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.lg-item > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px; font-weight: 700; font-size: .95rem; }
.lg-item > summary::-webkit-details-marker { display: none; }
.lg-item > summary::before { content: '+'; font-size: 1.3rem; line-height: 1; width: 18px; text-align: center; flex: none; }
.lg-item[open] > summary::before { content: '−'; }
.lg-item-corpo { padding: 0 8px 10px; }
.lg-n2, .lg-n3 { margin: 6px 0 6px 6px; }
.lg-n2 > summary, .lg-n3 > summary { font-size: .9rem; min-height: 42px; }
.lg-n3 > summary { font-weight: 600; }
.lg-cont { margin-left: auto; font-size: .78rem; font-weight: 600; color: var(--muted); }
.lg-sim { color: var(--ok); } .lg-nao { color: var(--danger); }
.lg-linhas { list-style: none; margin: 0; padding: 0 8px 10px; display: grid; gap: 4px; }
.lg-linhas li { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: .9rem; }
.lg-tabela { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lg-tabela-alta { max-height: 70vh; overflow: auto; }
.lg-tbl { font-size: .86rem; width: 100%; }
.lg-tbl thead th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.lg-tbl tbody th, .lg-tbl tfoot th { font-weight: 600; text-align: left; text-transform: none; letter-spacing: 0; font-size: inherit; color: var(--text); background: transparent; position: static; }
.lg-tbl tfoot td, .lg-tbl tfoot th { font-weight: 700; }
.lg-comp td, .lg-comp th { white-space: nowrap; }
/* nome do cliente: quebra em linhas dentro da própria coluna (nunca por cima das colunas seguintes) */
.lg-comp tbody th { white-space: normal; overflow-wrap: anywhere; min-width: 180px; max-width: 260px; }
.lg-tbl tbody th { overflow-wrap: anywhere; }
.lg-superou { background: var(--danger-bg); }
.lg-ok { background: var(--ok-bg); } .lg-parcial { background: var(--warn-bg); } .lg-falta { background: var(--danger-bg); }
.lg-busca { margin-bottom: 8px; } .lg-busca .input { max-width: 360px; }
/* Remunerativo */
.lg-apagar { display: grid; gap: 6px; justify-items: start; padding: 16px 18px; }
.lg-apagar-rot { font-size: .78rem; font-weight: 700; color: var(--ok); letter-spacing: .02em; }
.lg-apagar-val { font-size: 1.6rem; font-weight: 800; color: var(--ok); font-variant-numeric: tabular-nums; }
.lg-apagar .btn { justify-self: center; margin-top: 6px; }
.lg-rem td, .lg-rem th, .lg-rem-det td, .lg-rem-det th { white-space: nowrap; }
.lg-rem tbody th, .lg-rem tfoot th { min-width: 150px; max-width: 220px; white-space: normal; overflow-wrap: normal; }
@media (max-width: 640px) { .lg-tbl.lg-rem tbody th, .lg-tbl.lg-rem tfoot th { min-width: 120px; } }
.lg-campo { max-width: 100%; } .lg-campo .input { max-width: 100%; min-width: 0; }
.lg-acoes-tab { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.lg-acoes-tab .lg-busca { margin: 0 0 0 4px; flex: 1; min-width: 180px; }
.lg-rem-det tfoot td, .lg-rem-det tfoot th { position: sticky; bottom: 0; background: var(--text); color: var(--surface); }
@media print { .no-print, .lg-cab .lg-voltar, .lg-filtros, .sidebar, .topbar { display: none !important; } .lg-tabela-alta { max-height: none; overflow: visible; } .lg-rem-det { font-size: 7pt; } }
.lg-ord { cursor: pointer; }
.lg-ord[aria-sort="ascending"]::after { content: ' ▲'; font-size: .7em; } .lg-ord[aria-sort="descending"]::after { content: ' ▼'; font-size: .7em; }
.lg-grafico-rolagem { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 8px; }
.lg-grafico { height: 260px; }
.lg-kpis { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .lg-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .lg-kpis { grid-template-columns: repeat(3, 1fr); } }
.lg-bloco-kpi { margin-bottom: 14px; }
.lg-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.lg-kpi h3 { margin: 0 0 8px; text-align: center; font-size: .9rem; }
.lg-barras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lg-barra { display: flex; flex-direction: column; align-items: center; text-align: center; }
.lg-barra-area { height: 92px; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--border); }
.lg-col { display: block; width: 72%; min-height: 0; border-radius: 3px 3px 0 0; }
.lg-col-meta { background: var(--viz-meta); } .lg-col-real { background: var(--viz-y); } .lg-col-gap { background: var(--viz-gap); }
.lg-barra strong { margin-top: 4px; font-size: .9rem; } .lg-barra small { color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.nav-legado { font-weight: 700; }
@media (max-width: 640px) {
  .lg-tbl { font-size: .8rem; }
  .lg-tbl th, .lg-tbl td { padding: 7px 6px; }
  .lg-tbl thead th { white-space: normal; font-size: .66rem; letter-spacing: .02em; vertical-align: bottom; }
  .lg-tbl td.num { white-space: nowrap; }
  .lg-item-corpo { padding: 0 2px 8px; }
  .lg-bloco.card { padding: 10px 6px; }
  .lg-tbl tbody th, .lg-tbl thead th:first-child, .lg-tbl tfoot th { position: sticky; left: 0; z-index: 2; background: var(--surface); min-width: 0; max-width: 38vw; box-shadow: 1px 0 0 var(--border); }
  .lg-tbl thead th:first-child { z-index: 3; background: var(--surface-2, var(--surface)); }
  .lg-comp tbody th, .lg-comp thead th:first-child { position: static; box-shadow: none; }
  .lg-comp tbody th { min-width: 150px; max-width: 200px; }
  .lg-comp thead th { position: sticky; top: 0; }
}

/* Unificação de códigos de vendedores */
.uc-ano { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; min-width: 150px; }
.uc-principal th, .uc-principal td { background: var(--surface-2, rgba(0,0,0,.02)); }
.uc-pend { color: var(--warn); font-weight: 600; }

/* Descontos (WinThor) */
.ds-modelos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.ds-modelo { display: grid; gap: 8px; align-content: start; margin: 0; }
.ds-modelo h4 { margin: 0; font-size: .95rem; }
.ds-modelo .btn { justify-self: start; }
#calculo, #exportar, #manuais, #produtos, #regras, #parametros { scroll-margin-top: 72px; }
.ds-modelo.ds-editando { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
#dp-form { scroll-margin-top: 72px; }

/* Layout legado › Variações KPI */
.lg-graficos { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.lg-na { color: var(--muted); font-style: italic; }
.lg-var td, .lg-sv-tbl td, .lg-sv-tbl th { white-space: nowrap; }
.lg-var tbody th { min-width: 180px; }
.lg-sv .lg-grafico { height: 240px; margin-bottom: 8px; }
.lg-sv-info { margin: 6px 4px 0; }
.lg-sv[hidden] { display: none; }
@media print { .lg-sv { break-inside: avoid; } .lg-sv:not([open]) { display: none; } }

/* Rastreamento de veículos */
.rs-grade { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 1000px) { .rs-grade { grid-template-columns: 1fr; } }
.rs-mapa-card, .rs-lista-card { margin: 0; }
.rs-mapa-wrap { position: relative; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.rs-mapa { height: 600px; width: 100%; background: #eef0f2; }
@media (max-width: 640px) { .rs-mapa { height: 480px; } }
.rs-classico .rs-ctl, .rs-classico .rs-cartao { display: none; }
.rs-classico .rs-mapa { background: var(--viz-surface); }
/* controles flutuantes (estilo apps de mapa) */
.rs-ctl { position: absolute; top: 10px; left: 10px; display: flex; gap: 8px; flex-wrap: wrap; z-index: 2; max-width: calc(100% - 70px); }
.rs-seg, .rs-ctl-btn { display: inline-flex; background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(15, 23, 42, .18); overflow: hidden; }
.rs-seg button, .rs-ctl-btn { border: 0; background: transparent; padding: 7px 11px; font: 600 .78rem/1 var(--font, inherit); color: #334155; cursor: pointer; min-height: 32px; }
.rs-ctl-btn { align-items: center; gap: 5px; } .rs-ctl-btn .ico { width: 14px; height: 14px; }
.rs-seg button[aria-pressed="true"] { background: #0f172a; color: #fff; }
.rs-seg button:disabled { opacity: .45; cursor: not-allowed; }
.rs-seg button:focus-visible, .rs-ctl-btn:focus-visible, .rs-vr:focus-visible, .rs-vm:focus-visible, .rs-pino:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.rs-aviso-mapa { position: absolute; left: 10px; right: 56px; top: 52px; z-index: 2; background: #fff7ed; color: #7c2d12; border-radius: 10px; padding: 7px 10px; box-shadow: 0 2px 10px rgba(15, 23, 42, .15); }
/* veículo: ícone visto de cima, deitado no mapa */
.rs-vm { position: relative; display: grid; place-items: center; cursor: pointer; }
.rs-vm-svg { position: relative; z-index: 1; filter: drop-shadow(0 3px 2px rgba(15, 23, 42, .35)); transition: transform .2s ease; }
.rs-vm:hover .rs-vm-svg, .rs-vm.rs-sel .rs-vm-svg { transform: scale(1.12); }
.rs-vm-sombra { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(closest-side, rgba(15, 23, 42, .22), transparent); }
.rs-vm-pulso { position: absolute; width: 46px; height: 46px; border-radius: 50%; border: 3px solid transparent; }
.rs-vm[data-status="movimento"] .rs-vm-pulso { border-color: rgba(22, 163, 74, .55); background: rgba(22, 163, 74, .12); animation: rs-pulso 1.8s ease-out infinite; }
.rs-vm[data-status="parado"] .rs-vm-pulso { border-color: rgba(217, 119, 6, .6); background: rgba(217, 119, 6, .10); }
.rs-vm[data-status="sem_sinal"] .rs-vm-pulso { border-color: rgba(220, 38, 38, .6); background: rgba(220, 38, 38, .08); border-style: dashed; }
.rs-vm[data-status="sem_sinal"] .rs-vm-svg { opacity: .7; filter: grayscale(.5) drop-shadow(0 3px 2px rgba(15, 23, 42, .3)); }
@keyframes rs-pulso { 0% { transform: scale(.65); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
/* etiqueta do veículo (sempre de pé) */
.rs-vr { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 7px; border: 0; border-radius: 999px; background: #fff; color: #0f172a; font-size: .74rem; line-height: 1.1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .22); white-space: nowrap; cursor: pointer; position: relative; }
.rs-vr::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 2px; z-index: -1; }
.rs-vr strong { font-weight: 700; } .rs-vr-info { color: #475569; }
.rs-vr.rs-sel { background: #0f172a; color: #fff; } .rs-vr.rs-sel::after { background: #0f172a; } .rs-vr.rs-sel .rs-vr-info { color: #cbd5e1; }
.rs-vr-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; flex: none; }
.rs-st-movimento { background: #16a34a; } .rs-st-parado { background: #d97706; } .rs-st-sem_sinal { background: #dc2626; }
/* pinos de lojista e depósito */
.rs-pino { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; padding: 0; cursor: pointer; }
.rs-pino-ico { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(15, 23, 42, .35); border: 2px solid #fff; }
.rs-pino-ico svg { transform: rotate(45deg); }
.rs-pino-txt { order: -1; font-size: .68rem; font-weight: 700; color: #1e293b; background: rgba(255, 255, 255, .92); padding: 1px 6px; border-radius: 6px; white-space: nowrap; box-shadow: 0 1px 3px rgba(15, 23, 42, .18); }
.rs-mun { font-size: .68rem; font-weight: 600; color: #6b7280; letter-spacing: .02em; text-shadow: 0 0 3px #fff, 0 0 3px #fff; pointer-events: none; white-space: nowrap; }
/* cartão do veículo (folha sobre o mapa) */
.rs-cartao { position: absolute; z-index: 3; left: 10px; bottom: 34px; width: min(340px, calc(100% - 20px)); background: #fff; color: #0f172a; border-radius: 14px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(15, 23, 42, .28); display: grid; gap: 10px; animation: rs-sobe .25s ease-out; }
@keyframes rs-sobe { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.rs-cartao-topo { display: flex; align-items: center; gap: 8px; } .rs-cartao-topo .rs-cor { margin: 0; width: 14px; height: 14px; border-radius: 4px; }
.rs-cartao-tit { flex: 1; display: grid; min-width: 0; } .rs-cartao-tit .muted { color: #64748b; }
.rs-cartao-x { border: 0; background: #f1f5f9; width: 28px; height: 28px; border-radius: 50%; font-size: 1.1rem; line-height: 1; cursor: pointer; color: #334155; }
.rs-cartao-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rs-cartao-kpis > div { background: #f8fafc; border-radius: 10px; padding: 7px 8px; display: grid; }
.rs-k-v { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; } .rs-k-r { font-size: .68rem; color: #64748b; }
.rs-cartao-dados { display: grid; gap: 3px; }
.rs-cd { display: flex; justify-content: space-between; gap: 10px; font-size: .78rem; } .rs-cd-r { color: #64748b; } .rs-cd-v { text-align: right; font-weight: 600; }
.rs-cartao-acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.rs-replay { display: grid; gap: 4px; } .rs-replay-barra { height: 6px; border-radius: 3px; background: #e2e8f0; overflow: hidden; }
.rs-replay-barra i { display: block; height: 100%; width: 0; background: var(--brand); }
@media (max-width: 640px) { .rs-cartao { left: 8px; right: 8px; bottom: 30px; width: auto; } }
.rs-popup .maplibregl-popup-content { border-radius: 10px; padding: 8px 10px; box-shadow: 0 6px 18px rgba(15, 23, 42, .25); color: #0f172a; }
.rs-veic-ico { width: 30px; display: grid; place-items: center; flex: none; } .rs-veic-ico svg { max-height: 40px; width: auto; }
.rs-veic[aria-current="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
body.reduced-motion .rs-vm-pulso, body.reduced-motion .rs-cartao { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .rs-vm-pulso, .rs-cartao { animation: none !important; } }
.rs-legenda { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; padding: 0; }
.rs-legenda li { display: inline-flex; align-items: center; gap: 6px; }
.rs-l { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.rs-l-mov { border: 3px solid var(--ok); } .rs-l-par { border: 3px solid var(--warn); } .rs-l-sem { border: 3px solid var(--danger); }
.rs-l-cerca { border-radius: 3px; background: color-mix(in srgb, #1f6b4a 25%, transparent); border: 2px solid #1f6b4a; }
.rs-l-loj { background: color-mix(in srgb, #9333ea 25%, transparent); border: 2px solid #9333ea; }
.rs-l-trilha { width: 18px; height: 4px; border-radius: 2px; background: var(--brand); box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px var(--border-2); }
.rs-nota { margin: 6px 0 0; }
.rs-veiculos { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 560px; overflow: auto; }
.rs-veic { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.rs-veic:hover:not(:disabled) { border-color: var(--brand); }
.rs-veic:disabled { cursor: default; opacity: .8; }
.rs-veic-txt { flex: 1; display: grid; gap: 2px; min-width: 0; }
.rs-veic .badge { flex: none; }
.rs-dentro { color: var(--ok); }
.rs-cor { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; margin-top: 3px; vertical-align: -1px; }

/* Entradas e saídas: saldo de cada trimestre (cards acima do gráfico) */
.dash-saldos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 4px 0 10px; }
.dash-saldo { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; background: var(--surface); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-saldo::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--border-2); }
dl.dash-saldo-l { margin: 4px 0 0; display: grid; gap: 1px; }
dl.dash-saldo-l > div { display: flex; justify-content: space-between; gap: 6px; font-size: .78rem; font-variant-numeric: tabular-nums; }
dl.dash-saldo-l dt { color: var(--text-2); white-space: nowrap; }
dl.dash-saldo-l dd { margin: 0; font-weight: 650; color: var(--text); white-space: nowrap; }
dl.dash-saldo-l .ent dt::before, dl.dash-saldo-l .sai dt::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; background: var(--viz-div-alto); }
dl.dash-saldo-l .sai dt::before { background: var(--viz-div-baixo); }
dl.dash-saldo-l .sal { border-top: 1px solid var(--border); margin-top: 3px; padding-top: 3px; font-size: .9rem; }
dl.dash-saldo-l .sal dd { font-weight: 800; }
.dash-saldo .rot { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dash-saldo .val { font-size: 1.15rem; font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-saldo.na .val { font-size: .85rem; font-weight: 600; color: var(--muted); }
.dash-saldo .sub { font-size: .72rem; color: var(--text-2); overflow-wrap: anywhere; }
@media (max-width: 360px) { .dash-saldos { grid-template-columns: minmax(0, 1fr); } }
@media (forced-colors: active) { .dash-saldo::before, dl.dash-saldo-l dt::before { forced-color-adjust: none; } }

/* Modo apresentação — logo (capa/encerramento e canto dos slides) */
.ap-logo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.ap-logo--grande { height: 12cqh; max-width: 30cqw; display: flex; align-items: center; }
.ap-fim .ap-logo--grande { justify-content: center; margin-inline: auto; }
.ap-logo--canto { position: absolute; z-index: 3; height: 6cqh; max-width: 13cqw; display: flex; align-items: center; pointer-events: none; }
.ap-logo--sup_dir { top: 3cqh; right: 4.4cqw; justify-content: flex-end; }
.ap-logo--sup_esq { top: 3cqh; left: 4.4cqw; }
.ap-logo--inf_dir { bottom: 4.4cqh; right: 4.4cqw; justify-content: flex-end; }
.ap-logo--inf_esq { bottom: 4.4cqh; left: 4.4cqw; }
.ap-com-logo--sup_dir .ap-cab, .ap-com-logo--sup_dir .ap-secao { padding-right: 15cqw; }
.ap-com-logo--sup_esq .ap-cab, .ap-com-logo--sup_esq .ap-secao { padding-left: 15cqw; }
.ap-com-logo--inf_dir, .ap-com-logo--inf_esq { padding-bottom: 11cqh; }
/* fundo escuro: placa clara para logos escuras */
.ap-projetor[data-tema="escuro"] .ap-logo img, .ap-impressao[data-tema="escuro"] .ap-logo img { background: #fff; padding: .6cqh .6cqw; border-radius: .6cqw; box-sizing: border-box; }
.ap-logo-prev { margin-top: .5rem; padding: .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2, #f8fafc); display: flex; justify-content: center; }
.ap-logo-prev img { max-height: 72px; max-width: 100%; object-fit: contain; }

/* Layout legado — Campanhas e sorteios */
.lg-resumo-camp { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 10px; }
@media (min-width: 720px) { .lg-resumo-camp { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lg-kpi-num { display: flex; flex-direction: column; gap: 2px; }
.lg-kpi-num h3 { margin: 0; font-size: .72rem; letter-spacing: .04em; color: var(--muted); }
.lg-kpi-num strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.lg-dinamicas { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 2px 12px; color: var(--muted); }
.lg-tbl-camp td, .lg-tbl-camp th { vertical-align: top; }
.lg-tbl-camp td.num { min-width: 128px; white-space: normal; }
.lg-camp-cards { list-style: none; margin: 0; padding: 0; display: none; gap: 8px; }
.lg-camp-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.lg-camp-card-cab { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.lg-camp-total { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.lg-camp-card dl { margin: 8px 0 0; display: grid; gap: 4px; }
.lg-camp-card dl > div { border-radius: 6px; padding: 6px 8px; }
.lg-camp-card dt { font-size: .78rem; font-weight: 700; color: var(--muted); }
.lg-camp-card dd { margin: 2px 0 0; font-size: .9rem; }
@media (max-width: 719px) { .lg-camp-tabela { display: none; } .lg-camp-cards { display: grid; } }
.lg-tbl-camp tbody th[scope="row"] { min-width: 200px; }
/* Variação dos KPIs: realizado do trimestre (conta para a meta) em destaque; saldo como informação secundária */
dl.dash-saldo-l .real { background: var(--ok-bg); border-radius: 4px; padding: 2px 4px; margin: 2px -4px; font-size: .9rem; }
dl.dash-saldo-l .real dt, dl.dash-saldo-l .real dd { color: var(--text); font-weight: 750; }
dl.dash-saldo-l .sal { font-size: .78rem; }
dl.dash-saldo-l .sal dt, dl.dash-saldo-l .sal dd { color: var(--text-2); font-weight: 600; }

/* Planos estratégicos (plano do dia / E agora?) e Biblioteca */
.pl-ola { font-size: 1rem; }
.pl-sec { margin-top: 14px; }
.pl-sec-t { font-size: 1.05rem; margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
.pl-itens { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.pl-itens li { line-height: 1.4; }
.pl-it-t { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
/* Biblioteca: grade no estilo dos reels */
.bb-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 12px; }
.bb-filtros > .input { flex: 1 1 220px; max-width: 340px; }
.bb-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bb-pill { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.bb-pill .ico { width: 15px; height: 15px; }
.bb-pill:hover { border-color: var(--brand); color: var(--brand); }
.bb-pill.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.bb-pill:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.bb-pill-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.bb-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.bb-revisao .bb-grade { margin-top: 10px; }
.bb-item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bb-tile { position: relative; display: block; width: 100%; aspect-ratio: 9 / 16; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: var(--surface-3); box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.12)); }
.bb-tile img, .bb-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.bb-tile::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(transparent, rgba(0,0,0,.65)); pointer-events: none; }
.bb-tile:hover img, .bb-tile:hover video { transform: scale(1.03); transition: transform .3s; }
.bb-tile:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.bb-tile-txt { position: absolute; z-index: 1; left: 10px; right: 10px; bottom: 9px; color: #fff; font-size: .82rem; font-weight: 650; text-align: left; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.bb-play { position: absolute; z-index: 1; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; display: flex; align-items: center; justify-content: center; }
.bb-play .ico { width: 14px; height: 14px; }
.bb-selo { position: absolute; z-index: 1; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; }
.bb-selo-pendente { background: var(--warn-bg); color: var(--warn); }
.bb-selo-agendado { background: #ede9fe; color: #5b21b6; display: inline-flex; align-items: center; gap: 4px; }
.bb-selo-agendado .ico { width: 12px; height: 12px; }
.bb-selo + .bb-selo-agendado { top: 34px; }
.bb-avisar { border: 0; padding: 0; margin: 0; display: flex; gap: 4px 14px; flex-wrap: wrap; align-items: center; }
.bb-avisar legend { padding: 0; margin-bottom: 2px; font-weight: 600; }
.bb-selo-reprovado { background: var(--danger-bg); color: var(--danger); }
.bb-acoes { display: flex; align-items: center; gap: 2px; }
.bb-ico { display: inline-flex; align-items: center; gap: 4px; height: 32px; min-width: 32px; padding: 0 7px; border: 0; border-radius: 8px; background: none; color: var(--text-2);
  font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.bb-ico .ico { width: 18px; height: 18px; }
.bb-ico:hover { background: var(--surface-3); color: var(--brand); }
.bb-ico:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.bb-ico:disabled { opacity: .5; cursor: progress; }
.bb-datas { margin: 0; font-size: .74rem; color: var(--muted); line-height: 1.35; }
.bb-decisao { display: flex; gap: 6px; flex-wrap: wrap; }
.bb-decisao form { margin: 0; }
.bb-motivo { margin: 0; color: var(--danger); }
.bb-edit form { display: grid; gap: 6px; margin-top: 6px; }
.bb-ver { width: min(960px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 14px; background: var(--surface); color: var(--text);
  display: none; grid-template-columns: minmax(0, 1fr) 300px; overflow: hidden; }
.bb-ver[open] { display: grid; }
.bb-ver::backdrop { background: rgba(0,0,0,.75); }
.bb-ver-midia { background: #000; display: flex; align-items: center; justify-content: center; min-height: 0; max-height: calc(100vh - 24px); }
.bb-ver-midia img, .bb-ver-midia video { max-width: 100%; max-height: calc(100vh - 24px); object-fit: contain; display: block; }
.bb-ver-info { padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.bb-ver-info h3 { margin: 0 32px 0 0; font-size: 1.05rem; }
.bb-ver-leg { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.bb-fechar { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bb-dlg { width: min(480px, calc(100vw - 24px)); border: 0; border-radius: 14px; padding: 18px; background: var(--surface); color: var(--text); }
.bb-dlg::backdrop { background: rgba(0,0,0,.5); }
.bb-dlg form { display: grid; gap: 10px; }
.bb-dlg h3 { margin: 0; }
@media (max-width: 760px) {
  .bb-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bb-ver[open] { grid-template-columns: 1fr; overflow-y: auto; }
  .bb-ver-midia, .bb-ver-midia img, .bb-ver-midia video { max-height: 65vh; }
  .bb-ico { padding: 0 5px; }
}

/* Minha agenda (semana no estilo agenda) */
.ag-barra { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.ag-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ag-nav h2 { margin: 0 0 0 8px; font-size: 1.1rem; }
.ag-prev .ico { transform: rotate(180deg); }
.ag-acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ag-acoes form { margin: 0; }
.ag-semana { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.ag-dia { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-height: 220px; display: flex; flex-direction: column; min-width: 0; }
.ag-dia.fds { background: var(--surface-2, var(--surface)); }
.ag-dia header { display: flex; align-items: center; gap: 6px; padding: 8px 8px 6px; border-bottom: 1px solid var(--border); }
.ag-dsem { font-size: .78rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.ag-dnum { font-size: 1.15rem; font-weight: 750; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.ag-dia.hoje .ag-dnum { background: var(--brand); color: #fff; }
.ag-mais { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ag-mais:hover { background: var(--surface-3); color: var(--brand); }
.ag-evs { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.ag-ev { text-align: left; border: 0; border-left: 4px solid var(--brand); border-radius: 8px; padding: 6px 8px; background: rgba(var(--brand-rgb), .10); color: var(--text); font: inherit; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-ev:hover { background: rgba(var(--brand-rgb), .18); }
.ag-ev.ag-ligacao { border-left-color: var(--warn); background: var(--warn-bg); }
.ag-ev-h { font-size: .72rem; font-weight: 700; color: var(--muted); }
.ag-ev-t { font-size: .82rem; font-weight: 650; overflow-wrap: anywhere; display: flex; gap: 4px; align-items: flex-start; }
.ag-ev-t .ico { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.ag-ev-o { font-size: .74rem; color: var(--text-2); overflow-wrap: anywhere; }
.ag-leg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; background: rgba(var(--brand-rgb), .25); border-left: 3px solid var(--brand); }
.ag-leg.ag-ligacao { background: var(--warn-bg); border-left-color: var(--warn); }
.ag-linha { display: flex; gap: 10px; flex-wrap: wrap; }
.ag-linha .field { flex: 1 1 140px; }
.ag-dlg-bt { gap: 8px; align-items: center; }
@media (max-width: 980px) { .ag-semana { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ag-dia { min-height: 120px; } }
@media (max-width: 560px) { .ag-semana { grid-template-columns: 1fr; } .ag-dia { min-height: 0; } }

/* Meus clientes */
.mc-abas { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.mc-abas a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: .88rem; text-decoration: none; }
.mc-abas a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.mc-filtros { align-items: flex-end; }
.mc-tab td { vertical-align: top; }
.mc-nota { max-width: 260px; white-space: normal; color: var(--text-2); }
.mc-flag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 650; margin: 1px 0; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.mc-cor-vermelho { background: var(--danger-bg); color: var(--danger); } .mc-cor-laranja { background: #FDE7D7; color: #B4530C; } .mc-cor-amarelo { background: var(--warn-bg); color: var(--warn); }
.mc-cor-verde { background: var(--ok-bg); color: var(--ok); } .mc-cor-azul { background: var(--info-bg); color: var(--info); } .mc-cor-roxo { background: #EFE5FB; color: #6B32B5; }
.mc-flags-op { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.mc-flags-op label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.mc-grupos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.mc-grupo h3, .mc-grupo-rel h3 { margin: 0 0 4px; font-size: 1rem; }
.mc-grupo ul, .mc-grupo-rel ul { margin: 4px 0 8px; padding-left: 18px; }
.mc-grupo-rel + .mc-grupo-rel { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.mc-membros { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mc-membros li { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px; background: var(--surface-3); border-radius: 8px; font-size: .85rem; }
.mc-gdlg { width: min(560px, calc(100vw - 24px)); }
.mc-lista-flags { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.mc-lista-flags li { display: flex; align-items: center; gap: 10px; }
.mc-lista-flags form { margin: 0 0 0 auto; }
.mc-parecer { border-left: 3px solid var(--brand); padding: 4px 0 4px 10px; margin-bottom: 10px; }
.mc-parecer p { margin: 0 0 4px; }
.mc-parecer-form { display: grid; gap: 6px; margin-top: 10px; }
.mc-tab .mono { white-space: nowrap; }

/* Check-in de visitas */
.ck-form { display: grid; gap: 10px; max-width: 640px; }
.ck-bt { justify-self: start; padding: 12px 22px; font-size: 1rem; }
.ck-erro { color: var(--danger); font-weight: 600; }
.ck-locs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ck-loc h3 { margin: 0 0 4px; font-size: 1rem; overflow-wrap: anywhere; }
.ck-dec { display: grid; gap: 8px; }
@media (max-width: 560px) { .ck-bt { justify-self: stretch; } .ck-locs { grid-template-columns: 1fr; } }

/* IATA: propostas de ação (o usuário confirma) */
.iata-proposta { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 10px; background: var(--surface); display: grid; gap: 4px; }
.iata-proposta p { margin: 0; }
.iata-proposta-t { display: flex; align-items: center; gap: 6px; }
.iata-proposta-t .ico { width: 16px; height: 16px; }

/* Calculadora de tinta (boletins técnicos) */
.bt-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.bt-form .bt-prod { flex: 1 1 280px; min-width: 0; }
.bt-res h2, .bt-ficha h2 { margin: 0 0 8px; font-size: 1.15rem; overflow-wrap: anywhere; }
.bt-comb { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.bt-comb li { background: var(--surface-3); border-radius: 10px; padding: 8px 12px; }
.bt-dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin: 10px 0; }
.bt-dl dt { font-weight: 650; color: var(--text-2); }
.bt-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.bt-dl ul { margin: 4px 0 0; padding-left: 18px; }
.bt-h3 { font-size: 1rem; margin: 14px 0 6px; display: flex; align-items: center; gap: 6px; }
@media (max-width: 560px) {
  .bt-dl { grid-template-columns: 1fr; } .bt-dl dt { margin-top: 6px; }
  .bt-prep thead { display: none; }
  .bt-prep, .bt-prep tbody, .bt-prep tr, .bt-prep td { display: block; width: 100%; }
  .bt-prep tr { padding: 8px 0; border-bottom: 1px solid var(--border); }
  .bt-prep td { border: 0; padding: 2px 0; overflow-wrap: anywhere; }
  .bt-prep td:first-child { font-weight: 650; }
  .bt-prep td[data-rot]::before { content: attr(data-rot) ": "; color: var(--text-2); font-weight: 600; }
}

/* Minha agenda: sugestão da semana */
.ag-sug-cab { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ag-sug-cab h2 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 6px; }
.ag-foco { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ag-chip { font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text); overflow-wrap: anywhere; }
.ag-chip.alto { background: var(--warn-bg); }
.ag-chip.baixo { opacity: .8; }
.ag-sug-dias { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 10px; }
.ag-sug-dia { border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.ag-sug-dia h3 { font-size: .95rem; margin: 0 0 6px; overflow-wrap: anywhere; }
.ag-sug-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ag-sug-it label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; border-left: 4px solid var(--brand); border-radius: 8px; padding: 6px 8px; background: rgba(var(--brand-rgb), .08); }
.ag-sug-it.ag-ligacao label { border-left-color: var(--warn); background: var(--warn-bg); }
.ag-sug-it input { margin-top: 3px; flex: none; }
.ag-sug-it label > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-sug-bt { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.ag-sug-it .ag-ev-t { display: block; }

/* identificação do cliente: nome fantasia (principal) e razão social abaixo, menor e discreta */
.cli-sub { display: block; font-size: .74rem; font-weight: 400; color: var(--muted); line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
table.tt th.tt-nome .cli-sub { padding-left: 22px; }
.cli-sub { max-width: 340px; }
.cli-sub.rot-hoje { color: var(--ok); font-weight: 600; }
.mc-arv tr.mc-g1 td { background: var(--surface-2); }
.mc-arv tr.mc-g2 td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }

/* Portal do lojista — painel da empresa (Administração › Portal do lojista) */
.pl-kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pl-kpi { margin: 0; padding: 10px 12px; display: grid; gap: 2px; }
.pl-kpi strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.pl-locs { display: grid; gap: 12px; }
.pl-loc { margin: 0; padding: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
.pl-loc-mapa { min-height: 240px; background: #eef0f2; }
.pl-loc-txt { padding: 12px 14px; display: grid; gap: 4px; align-content: start; }
.pl-longe { color: var(--danger); font-weight: 650; }
@media (max-width: 760px) { .pl-loc { grid-template-columns: 1fr; } }
.pt-grade-adm { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); margin-bottom: 14px; }
.pt-grade-adm > .card { margin: 0; }
@media (max-width: 960px) { .pt-grade-adm { grid-template-columns: 1fr; } }
.pt-marcas { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.pt-marca-c { display: grid; gap: 6px; align-content: start; }
.pt-marca-prev { height: 110px; border-radius: 12px; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; padding: 10px; color: var(--muted); }
.pt-marca-prev.fundo-escuro { background: #0f172a; color: #94a3b8; }
.pt-marca-prev.capa { padding: 0; overflow: hidden; background: var(--surface-3); }
.pt-marca-prev img { max-width: 100%; max-height: 100%; display: block; }
.pt-marca-prev.capa img { width: 100%; height: 100%; object-fit: cover; max-height: none; }
.pt-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 0; }
.pt-dl > div { background: var(--surface-2); border-radius: 10px; padding: 7px 10px; min-width: 0; }
.pt-dl dt { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.pt-dl dd { margin: 0; font-weight: 650; font-size: .88rem; overflow-wrap: anywhere; }

/* ===================== PRATELEIRA (catálogo em corredores, 2.5D) ===================== */
.pr-loja { --pr-parede: linear-gradient(180deg, #f7f3ec 0%, #efe8dc 100%); --pr-madeira: linear-gradient(180deg, #e2cba6 0%, #c9a77a 55%, #a9835a 100%);
  --pr-borda-tabua: #8a6741; --pr-etiqueta: #fffef6; --pr-sombra: rgba(60,40,20,.28); --pr-fundo-foto: #f3eee5; }
body.mode-escuro .pr-loja, body.user-escuro .pr-loja { --pr-parede: linear-gradient(180deg, #1d222b 0%, #161a21 100%); --pr-madeira: linear-gradient(180deg, #6b5440 0%, #54402f 60%, #3d2e22 100%);
  --pr-borda-tabua: #2c2119; --pr-etiqueta: #f3f0e6; --pr-sombra: rgba(0,0,0,.55); --pr-fundo-foto: #ffffff; }
@media (prefers-color-scheme: dark) { body.mode-auto:not(.user-claro) .pr-loja { --pr-parede: linear-gradient(180deg, #1d222b 0%, #161a21 100%);
  --pr-madeira: linear-gradient(180deg, #6b5440 0%, #54402f 60%, #3d2e22 100%); --pr-borda-tabua: #2c2119; --pr-etiqueta: #f3f0e6; --pr-sombra: rgba(0,0,0,.55); --pr-fundo-foto: #ffffff; } }
.pr-topo { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 12px; }
.pr-marca { display: flex; gap: 12px; align-items: center; }
.pr-marca h1 { margin: 0; font-size: 1.6rem; letter-spacing: -.01em; }
.pr-logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 20px -8px rgba(var(--brand-rgb),.6); }
.pr-logo .ico { width: 22px; height: 22px; }
.pr-ctrl { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.pr-ctrl .field { margin: 0; min-width: 200px; }
.pr-cli { position: relative; min-width: 280px !important; }
.pr-cli-box { display: flex; gap: 6px; }
.pr-cli-lista { position: absolute; z-index: 40; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 16px 40px -12px rgba(15,23,42,.35); max-height: 320px; overflow: auto; }
.pr-cli-lista li { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .9rem; }
.pr-cli-lista li:hover, .pr-cli-lista li.on { background: var(--surface-3); }
.pr-cliente-faixa { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 10px 14px; margin-bottom: 10px; border-radius: 12px; color: #fff;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); box-shadow: 0 10px 24px -14px rgba(var(--brand-rgb),.8); }
.pr-cliente-faixa span { opacity: .9; font-size: .88rem; }
.pr-avisos .alert { margin-bottom: 8px; }
.pr-corredores { position: sticky; top: 0; z-index: 20; display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px; margin-bottom: 6px; background: var(--bg); scrollbar-width: thin; }
.pr-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: .85rem; text-decoration: none; white-space: nowrap; transition: background .2s, color .2s, border-color .2s; }
.pr-chip:hover { border-color: var(--brand); color: var(--brand); }
.pr-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pr-chip-n { font-size: .75rem; opacity: .75; font-variant-numeric: tabular-nums; }
.pr-cena { border-radius: 18px; padding: 18px clamp(10px, 2vw, 26px) 26px; background: var(--pr-parede); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -40px 60px -40px rgba(0,0,0,.12); min-height: 260px; }
.pr-carregando { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 60px 0; color: var(--muted); }
.pr-corredor { margin: 0 0 34px; scroll-margin-top: 70px; }
.pr-placa { position: relative; display: inline-flex; align-items: baseline; gap: 10px; margin: 6px 0 18px 8px; padding: 9px 16px 9px 10px; border-radius: 10px; color: #fff; font-weight: 700;
  letter-spacing: .02em; background: linear-gradient(180deg, #23314f, #16213a); box-shadow: 0 10px 18px -10px rgba(0,0,0,.6); transform: perspective(600px) rotateX(10deg); transform-origin: top; }
.pr-placa::before, .pr-placa::after { content: ""; position: absolute; top: -14px; width: 2px; height: 14px; background: #9aa3b2; }
.pr-placa::before { left: 18px; } .pr-placa::after { right: 18px; }
.pr-placa small { font-weight: 500; opacity: .7; font-size: .75rem; }
.pr-placa-num { display: inline-grid; place-items: center; min-width: 30px; height: 26px; border-radius: 6px; background: var(--accent); color: #1b1b1b; font-size: .85rem; }
.pr-estante { perspective: 1400px; perspective-origin: 50% 20%; }
.pr-estante > .pr-fileira { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; transition: transform .35s ease-out; }
.pr-fileira { position: relative; padding: 0 6px 30px; margin-bottom: 18px; }
.pr-itens { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 14px 16px; align-items: end; position: relative; z-index: 2; }
.pr-tabua { position: absolute; left: -4px; right: -4px; bottom: 8px; height: 22px; z-index: 1; border-radius: 3px 3px 5px 5px; background: var(--pr-madeira);
  border-bottom: 4px solid var(--pr-borda-tabua); box-shadow: 0 18px 22px -12px var(--pr-sombra), inset 0 2px 0 rgba(255,255,255,.35); transform: perspective(500px) rotateX(38deg); transform-origin: bottom; }
.pr-tabua::after { content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px; background: linear-gradient(180deg, var(--pr-borda-tabua), transparent); opacity: .35; }
.pr-prod { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; position: relative; border-radius: 12px; padding: 4px 2px 0;
  transition: transform .25s cubic-bezier(.2,.8,.2,1); transform: translateZ(0); }
.pr-prod:hover, .pr-prod:focus-visible { transform: translateY(-10px) translateZ(30px) scale(1.04); z-index: 5; }
.pr-prod:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 4px; }
.pr-prod-foto { position: relative; width: 100%; aspect-ratio: 1 / 1; min-height: 0; overflow: visible; display: flex; align-items: flex-end; justify-content: center; border-radius: 10px; background: var(--pr-fundo-foto); }
.pr-prod-foto img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: bottom; mix-blend-mode: multiply; transition: transform .25s; }
.pr-prod-foto::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: -4px; height: 10px; border-radius: 50%; background: radial-gradient(closest-side, var(--pr-sombra), transparent); pointer-events: none; }
body.mode-escuro .pr-prod-foto img, body.user-escuro .pr-prod-foto img { mix-blend-mode: normal; border-radius: 6px; }
.pr-prod:hover .pr-prod-foto::after { opacity: .55; transform: scaleX(.85); }
.pr-semfoto { width: 72%; aspect-ratio: 3 / 4; border-radius: 10px; display: grid; place-items: center; font-size: 1.8rem; font-weight: 700; color: var(--muted);
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 8px, var(--surface-3) 8px, var(--surface-3) 16px); border: 1px dashed var(--border-2); }
.pr-semfoto-g { width: 100%; aspect-ratio: 1; font-size: 1rem; }
.pr-estq { position: absolute; top: 4px; left: 4px; font-size: .68rem; line-height: 1; padding: 4px 7px; border-radius: 999px; background: rgba(255,255,255,.92); color: #0f172a; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.pr-estq::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 0; background: #16a34a; }
.pr-est-pouco .pr-estq::before { background: #f59e0b; }
.pr-est-zero .pr-estq::before { background: #dc2626; }
.pr-est-sem .pr-estq::before { background: #94a3b8; }
.pr-est-zero .pr-prod-foto img { opacity: .55; filter: grayscale(.6); }
.pr-ilustr { position: absolute; bottom: 4px; right: 4px; font-size: .62rem; padding: 3px 6px; border-radius: 6px; background: rgba(15,23,42,.72); color: #fff; }
.pr-prod-nome { font-size: .74rem; line-height: 1.25; color: var(--text-2); text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.pr-tag { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 6px; width: 100%; max-width: 150px; padding: 5px 8px 4px; border-radius: 4px; color: #1f2937;
  background: var(--pr-etiqueta); border-left: 4px solid var(--brand); box-shadow: 0 6px 10px -6px rgba(0,0,0,.45); transform: perspective(400px) rotateX(-8deg); }
.pr-tag-preco { grid-column: 1 / -1; font-size: 1.02rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pr-tag-de { grid-column: 1 / -1; font-size: .68rem; color: #6b7280; text-decoration: line-through; }
.pr-tag-desc { position: absolute; top: -9px; right: -6px; font-size: .66rem; font-weight: 700; padding: 2px 6px; border-radius: 999px; background: #dc2626; color: #fff; }
.pr-tag-cod { grid-column: 1 / -1; font-size: .62rem; color: #9ca3af; font-family: var(--mono, ui-monospace, monospace); }
.pr-tag-oferta { border-left-color: #dc2626; background: #fff7d6; }
.pr-rodape { margin-top: 12px; }
.pr-modal { width: min(860px, 96vw); }
.pr-m-corpo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.pr-m-foto { position: relative; border-radius: 14px; padding: 12px; background: var(--pr-parede, #f4f1ea); display: grid; place-items: center; }
.pr-m-foto img { max-width: 100%; max-height: 420px; object-fit: contain; }
.pr-m-foto .pr-ilustr { position: static; display: inline-block; margin-top: 8px; }
.pr-m-dados { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: .92rem; }
.pr-m-dados dt { color: var(--muted); }
.pr-m-dados dd { margin: 0; font-variant-numeric: tabular-nums; }
.pr-admin summary { cursor: pointer; }
@media (max-width: 720px) {
  .pr-ctrl .field, .pr-cli { min-width: 100% !important; }
  .pr-m-corpo { grid-template-columns: 1fr; }
  .pr-tag-preco { font-size: .92rem; }
  .pr-itens { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .pr-prod, .pr-estante > .pr-fileira, .pr-chip { transition: none; }
  .pr-prod:hover, .pr-prod:focus-visible { transform: none; }
}
@media (prefers-color-scheme: dark) { body.mode-auto:not(.user-claro) .pr-prod-foto img { mix-blend-mode: normal; border-radius: 6px; } }

/* ================= USUÁRIOS ONLINE (topo): ícone de duas pessoas + quantidade; só visual, sem nomes ================= */
.online-ind { display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 8px 0 6px; border-radius: 10px; color: var(--text-2); cursor: default; user-select: none; }
.online-ind:hover { background: var(--surface-3); }
.online-ico { width: 24px; height: 21px; overflow: visible; }
.online-ico .on-tras { fill: #3b82c4; opacity: .85; }
.online-ico .on-frente { fill: #2fa84f; stroke: var(--surface); stroke-width: 1.4; paint-order: stroke; }
.online-n { min-width: 14px; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.online-ind.online-pulso .online-ico { animation: online-pulso .7s ease-out; }
@keyframes online-pulso { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .online-ind.online-pulso .online-ico { animation: none; } }

/* ================= GESTÃO DE PREÇOS TIGRE (.tp-*) ================= */
.tp-barra { display: grid; gap: 8px; }
.tp-sim { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.tp-sim .field { margin: 0; min-width: 220px; flex: 1 1 240px; }
.tp-acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-filtros { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.tp-filtros .field { margin: 0; min-width: 180px; flex: 1 1 200px; }
.tp-seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); align-self: center; }
.tp-seg .btn { border-color: transparent; background: transparent; }
.tp-seg .btn.on { background: var(--surface); border-color: var(--border); color: var(--brand); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.tp-alertas { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.tp-alertas-cli { border-top: 1px solid var(--border); padding-top: 12px; }
.tp-alertas-cli p { margin: 0 0 8px; }
.tp-cli-det summary { cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--brand); margin: 4px 0 8px; }
.tp-cli-det .table-wrap { max-height: 360px; overflow: auto; }
.tp-alertas > h3 { grid-column: 1 / -1; margin: 0; display: flex; align-items: center; gap: 8px; }
.tp-alertas h4 { margin: 0 0 8px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tp-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tp-chip { border: 0; cursor: pointer; font: inherit; font-size: .78rem; }
.tp-chip:hover { filter: brightness(.95); }
.tp-cli td, .tp-cli th { padding: 6px 10px; }
.tp-wrap { max-height: 70vh; overflow: auto; }
.tp-tbl td { padding: 6px 10px; }
.tp-tbl .tp-in { width: 7.5em; text-align: right; padding: 4px 8px; height: 32px; font-variant-numeric: tabular-nums; }
.tp-tbl .tp-in:disabled { background: transparent; border-color: transparent; color: var(--text); opacity: 1; }
.tp-tbl .tp-in.tp-erro { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-bg); }
.tp-un { margin-left: 3px; color: var(--muted); font-size: .8rem; }
.tp-tbl tr.tp-simulada td:first-child { box-shadow: inset 3px 0 0 var(--info); }
.tp-tbl tr.tp-editada td { background: rgba(var(--brand-rgb), .06); }
.tp-tbl tr.tp-editada td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.tp-ord { cursor: pointer; user-select: none; }
.tp-ord[aria-sort="ascending"]::after { content: " ▲"; } .tp-ord[aria-sort="descending"]::after { content: " ▼"; }
.tp-mais { padding: 10px; }
.tp-tbl td.num { white-space: nowrap; }
.tp-tbl td.mono { white-space: nowrap; }

/* Gestão de preços Tigre — busca acima da tabela, setinhas de ajuste fino e etiquetas de segmento (claro e escuro) */
.tp-busca { position: relative; padding: 0 16px 12px; }
.tp-busca .input { width: 100%; padding-left: 38px; }
.tp-busca-ico { position: absolute; left: 28px; top: 50%; transform: translateY(calc(-50% - 6px)); color: var(--muted); display: inline-flex; pointer-events: none; }
.tp-step { display: inline-flex; align-items: stretch; vertical-align: middle; }
.tp-step .tp-in { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tp-step-bt { display: inline-flex; flex-direction: column; border: 1px solid var(--border); border-left: 0; border-radius: 0 8px 8px 0; overflow: hidden; }
.tp-step-bt button { flex: 1; width: 22px; padding: 0; border: 0; background: var(--surface-2); color: var(--muted); font-size: .55rem; line-height: 1; cursor: pointer; }
.tp-step-bt button + button { border-top: 1px solid var(--border); }
.tp-step-bt button:hover { background: rgba(var(--brand-rgb), .14); color: var(--brand); }
.tp-step-bt button:active { background: rgba(var(--brand-rgb), .26); }
.tp-segb { font-weight: 700; letter-spacing: .02em; }
.tp-segb-tc { background: #e0e7ff; color: #1e3a8a; }
.tp-segb-fpp { background: #dbeafe; color: #075985; }
body.mode-escuro .tp-segb-tc, body.user-escuro .tp-segb-tc { background: rgba(129, 140, 248, .22); color: #c7d2fe; }
body.mode-escuro .tp-segb-fpp, body.user-escuro .tp-segb-fpp { background: rgba(56, 189, 248, .2); color: #bae6fd; }
@media (prefers-color-scheme: dark) {
  body.mode-auto:not(.user-claro) .tp-segb-tc { background: rgba(129, 140, 248, .22); color: #c7d2fe; }
  body.mode-auto:not(.user-claro) .tp-segb-fpp { background: rgba(56, 189, 248, .2); color: #bae6fd; }
}
.tp-head-dir { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-tbl td.tp-impossivel .tp-in { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); font-weight: 700; }
.tp-tbl td.tp-impossivel .tp-step-bt { border-color: var(--danger); }
.tp-imp-nota { font-size: .72rem; color: var(--danger); margin-top: 3px; white-space: nowrap; }
.tp-mov { white-space: nowrap; }
.tp-cob-alta { color: var(--warn); }
.tp-cob-baixa { color: var(--danger); }
.tp-alertas-prod { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 0 16px 12px; }
.tp-chips-rot { font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tp-chip-neutro { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.tp-chip.on { outline: 2px solid currentColor; outline-offset: 1px; font-weight: 700; }
/* Gestão de preços Tigre — tabela maximizada: tela cheia do navegador (:fullscreen) ou, sem suporte, cobrindo a janela.
   !important e fundo sólido: o tema "cards de vidro" (fundo translúcido) e transform/filter de outros temas não interferem. */
html.tp-max-aberto, html.tp-max-aberto body { overflow: hidden; }
.tp-tabela.tp-max { display: flex !important; flex-direction: column; margin: 0 !important; border-radius: 0 !important; width: 100vw; height: 100vh; height: 100dvh; max-width: none !important;
  background: var(--surface) !important; backdrop-filter: none !important; transform: none !important; filter: none !important; box-shadow: none !important; opacity: 1 !important; }
.tp-tabela.tp-max-janela { position: fixed !important; inset: 0 !important; z-index: 2147483000 !important; }
.tp-tabela.tp-max::backdrop { background: var(--surface); }
.tp-tabela.tp-max .tp-wrap { flex: 1 1 auto; max-height: none; min-height: 0; overflow: auto; }
.tp-tabela.tp-max .card-head { padding-top: 12px; }
.tp-tabela.tp-max .tp-mais { flex: 0 0 auto; border-top: 1px solid var(--border); }
#tp-max[aria-pressed="true"] { background: rgba(var(--brand-rgb), .12); color: var(--brand); border-color: rgba(var(--brand-rgb), .4); }
.tp-tbl td.tp-al { min-width: 120px; max-width: 170px; }
.tp-tbl td.tp-al .badge { white-space: normal; line-height: 1.25; text-align: left; }
