/* ==========================================================================
   União Truck — sistema visual (v2)
   Uma regra por componente; tokens centralizados em :root.
   Ordem: tokens · base · layout · navegação · componentes · páginas · impressão
   ========================================================================== */

:root {
  /* Identidade União Truck */
  --navy: #102C40;
  --navy-2: #0B2133;
  --blue: #397CB0;
  --blue-700: #2A6290;
  --teal: #43A2C5;
  --graphite: #151D25;

  /* Neutros */
  --ink: #142230;
  --text: #2B3B4A;
  --muted: #687A8B;
  --line: #E1E8EE;
  --line-soft: #EDF2F6;
  --bg: #EDF2F6;
  --surface: #FFFFFF;
  --surface-2: #F6F9FB;
  --tint: #E9F3F9;

  /* Estados */
  --green: #1C9466;
  --amber: #B97F0E;
  --orange: #C9612A;
  --red: #CF3F37;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --shadow-sm: 0 1px 2px rgba(16, 44, 64, .06);
  --shadow: 0 12px 32px -18px rgba(16, 44, 64, .28), 0 2px 6px rgba(16, 44, 64, .04);
  --shadow-lg: 0 28px 70px -24px rgba(11, 33, 51, .55);
  --ring: 0 0 0 3px rgba(67, 162, 197, .28);

  --side-w: 264px;
  --side-mini: 86px;
  --topbar-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------------------------------------------------------------- base */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 64px); }

body {
  margin: 0;
  font: 15px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); margin: 0; line-height: 1.2; letter-spacing: -.015em; }
p { margin: 0 0 .75em; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-700); }
img { max-width: 100%; display: block; }
small { font-size: 12.5px; }
code, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; overflow: auto; white-space: pre-wrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
[hidden] { display: none !important; }

.i { width: 20px; height: 20px; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kicker { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

/* ---------------------------------------------------------------- layout */

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-w);
  min-height: 100vh;
  min-height: 100dvh;
}

.main { min-width: 0; display: flex; flex-direction: column; padding: 0 26px 0 34px; }
.content { flex: 1; padding: 6px 0 40px; }
.app-foot { display: flex; justify-content: space-between; gap: 12px; padding: 18px 0 24px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

/* Barra superior */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  min-height: var(--topbar-h);
  padding: calc(10px + var(--safe-t)) 0 10px;
  background: linear-gradient(var(--bg) 70%, rgba(237, 242, 246, 0));
}
.topbar-logo { display: none; }
.topbar-title { min-width: 0; flex: 1; }
.topbar-title h1 { font-size: 24px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search { position: relative; width: min(380px, 34vw); }
.top-search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.top-search input { width: 100%; height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 16px 0 42px; font: inherit; font-size: 14px; color: var(--ink); box-shadow: var(--shadow-sm); }
.top-search input:focus { outline: none; border-color: var(--teal); box-shadow: var(--ring); }
.top-search-mobile { display: none; }
.top-user { display: flex; align-items: center; gap: 10px; color: var(--ink); padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.top-user-text { display: grid; line-height: 1.15; }
.top-user-text strong { font-size: 13.5px; }
.top-user-text small { font-size: 11.5px; color: var(--muted); }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(140deg, var(--teal), var(--blue));
  color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .02em;
}

.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}

/* ---------------------------------------------------------------- menu lateral (direita) */

.side { position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 14px 14px 14px 0; z-index: 40; }
.side-inner {
  position: relative; height: 100%; overflow: hidden auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 14px 14px;
  border-radius: var(--radius-xl);
  color: #fff;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(67, 162, 197, .28), transparent 60%),
    linear-gradient(185deg, #14395A 0%, #0F2C43 46%, #0A1F31 100%);
  box-shadow: var(--shadow-lg);
  scrollbar-width: thin;
}
.side-inner::after {
  content: ""; position: absolute; right: -70px; bottom: -60px; width: 260px; height: 260px;
  background: url("../img/logo-symbol-white.png") center / contain no-repeat;
  opacity: .05; pointer-events: none;
}
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 10px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.side-brand img { height: 44px; width: auto; }
.side-brand .brand-mini { display: none; height: 40px; }
.side-toggle, .side-close { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .8); cursor: pointer; }
.side-toggle:hover, .side-close:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.side-close { display: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; position: relative; z-index: 1; }
.side-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .42); padding: 14px 12px 6px; font-weight: 700; }

.nav-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: 12px; border: 0; background: none;
  color: rgba(255, 255, 255, .74); font: 600 14px/1.2 var(--font); cursor: pointer; text-align: left;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav-link .i { width: 19px; height: 19px; opacity: .9; }
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-link.is-active { background: #fff; color: var(--navy); box-shadow: 0 8px 22px -10px rgba(0, 0, 0, .5); }
.nav-link.is-active .i { color: var(--blue); opacity: 1; }

.side-foot { margin-top: auto; position: relative; z-index: 1; display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.side-user-text { display: grid; line-height: 1.2; min-width: 0; }
.side-user-text strong { font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text small { color: rgba(255, 255, 255, .55); font-size: 11.5px; }
.nav-logout { color: rgba(255, 255, 255, .6); }

/* Menu recolhido (somente ícones) */
.side-mini .app { grid-template-columns: minmax(0, 1fr) var(--side-mini); }
.side-mini .side-nav span, .side-mini .side-label, .side-mini .side-user-text, .side-mini .nav-logout span, .side-mini .brand-full { display: none; }
.side-mini .brand-mini { display: block; }
.side-mini .side-head { flex-direction: column; }
.side-mini .nav-link { justify-content: center; padding: 12px 0; }
.side-mini .side-user { justify-content: center; }

/* Barra flutuante mobile */
.dock { display: none; }
.scrim { display: none; }

/* ---------------------------------------------------------------- componentes: cartões */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  min-width: 0;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h3 .i { color: var(--blue); }
.card-head .muted { font-size: 12.5px; }
.card-flat { box-shadow: none; background: var(--surface-2); }
.card-tight { padding: 14px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack { display: grid; gap: 16px; }
.section { margin-top: 22px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 12px; }
.section-title h2 { font-size: 17px; font-weight: 750; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 26px; font-weight: 800; }
.page-head p { color: var(--muted); margin: 6px 0 0; max-width: 640px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Indicadores */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 16px 16px 14px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  color: var(--text); transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.kpi-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--tint); color: var(--blue); }
.kpi-icon .i { width: 18px; height: 18px; }
.kpi-value { font: 800 28px/1.1 var(--font-display); color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-value.sm { font-size: 20px; }
.kpi-foot { font-size: 12.5px; color: var(--muted); }
.kpi.kpi-dark { background: linear-gradient(150deg, #17405F, var(--navy) 60%, #0B2133); border-color: transparent; color: #fff; }
.kpi.kpi-dark .kpi-label, .kpi.kpi-dark .kpi-foot { color: rgba(255, 255, 255, .66); }
.kpi.kpi-dark .kpi-value { color: #fff; }
.kpi.kpi-dark .kpi-icon { background: rgba(255, 255, 255, .1); color: #8FD3EA; }
.kpi.tone-amber .kpi-icon { background: #FFF3D9; color: var(--amber); }
.kpi.tone-orange .kpi-icon { background: #FDEADB; color: var(--orange); }
.kpi.tone-green .kpi-icon { background: #DFF4EA; color: var(--green); }
.kpi.tone-gray .kpi-icon { background: #EEF2F5; color: #5A6C7C; }
.kpi.tone-teal .kpi-icon { background: #E0F3F9; color: #1F87AD; }

/* Etiquetas de status */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap;
  background: #EEF2F5; color: #536474;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.tone-teal { background: #E0F3F9; color: #1A7A9E; }
.tone-gray { background: #EEF2F5; color: #536474; }
.tone-amber { background: #FFF2D6; color: #93660A; }
.tone-sky { background: #E3EEF9; color: #2A6290; }
.tone-blue { background: #DCEAF7; color: #174F7E; }
.tone-orange { background: #FDE9DA; color: #A84E1E; }
.tone-green { background: #DDF3E9; color: #157552; }
.tone-red { background: #FCE4E2; color: #A9312A; }
.tone-dark { background: var(--navy); color: #fff; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--text); }
.chip .i { width: 15px; height: 15px; color: var(--muted); }

/* Placa no padrão Mercosul */
.plate {
  display: inline-flex; flex-direction: column; align-items: stretch; min-width: 104px;
  border: 2px solid #22303D; border-radius: 6px; overflow: hidden; background: #fff;
  font-family: "Arial Black", "Segoe UI Black", var(--font-display); line-height: 1;
}
.plate b { display: block; background: #1E4E8E; color: #fff; font: 700 7px/1 var(--font); letter-spacing: .32em; text-align: center; padding: 2px 0; }
.plate span { display: block; padding: 4px 8px 5px; font-size: 18px; letter-spacing: .06em; color: #1A232C; text-align: center; white-space: nowrap; }
.plate.lg span { font-size: 26px; padding: 6px 12px 7px; }
.plate.lg { min-width: 150px; }
.plate.lg b { font-size: 8px; padding: 3px 0; }

/* Progresso */
.progress { height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--blue)); }
.ring {
  --p: 0; --size: 76px;
  width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: conic-gradient(var(--teal) calc(var(--p) * 1%), rgba(255, 255, 255, .14) 0);
}
.ring::before { content: ""; grid-area: 1 / 1; width: calc(var(--size) - 14px); height: calc(var(--size) - 14px); border-radius: 50%; background: var(--navy); }
.ring strong { grid-area: 1 / 1; position: relative; color: #fff; font: 800 18px var(--font-display); }
.ring.light { background: conic-gradient(var(--blue) calc(var(--p) * 1%), var(--line-soft) 0); }
.ring.light::before { background: #fff; }
.ring.light strong { color: var(--ink); }

/* ---------------------------------------------------------------- botões */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer;
  font: 650 14px/1 var(--font); white-space: nowrap; text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.btn .i { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: linear-gradient(135deg, #4386BB, var(--blue-700)); color: #fff; box-shadow: 0 8px 18px -10px rgba(42, 98, 144, .9); }
.btn-primary:hover { color: #fff; background: linear-gradient(135deg, #3B7DB2, #245886); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { color: #fff; background: #15384F; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { color: var(--ink); border-color: #C9D6E0; }
.btn-soft { background: var(--tint); color: var(--blue-700); }
.btn-soft:hover { background: #DCECF6; color: var(--blue-700); }
.btn-ghost { background: transparent; color: var(--blue-700); padding: 0 10px; }
.btn-ghost:hover { background: var(--tint); }
.btn-danger { background: #fff; color: var(--red); border-color: #F1C8C4; }
.btn-danger:hover { background: #FDF0EF; color: var(--red); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { color: #fff; background: #187F58; }
.btn-wa { background: #E6F7EE; color: #11804A; }
.btn-wa:hover { background: #D5F1E2; color: #0E6E3F; }
.btn-light { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .18); }
.btn-light:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.btn-white { background: #fff; color: var(--navy); }
.btn-white:hover { color: var(--navy); background: #F0F6FA; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-sm .i { width: 16px; height: 16px; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 34px; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; cursor: pointer; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- formulários */

.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.form-grid .span-all { grid-column: 1 / -1; }
.form-grid .span-2 { grid-column: span 2; }
.form-section { margin-top: 18px; }
.form-section > h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 650; color: var(--text); }
.field > span em { font-style: normal; color: var(--red); }
.field small { color: var(--muted); font-size: 12px; }
.input, .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border: 1px solid #D3DEE7; border-radius: 12px; background: #fff;
  font: 16px/1.3 var(--font); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.field select { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23687A8B' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; }
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--teal); box-shadow: var(--ring); }
.field input[readonly] { background: var(--surface-2); }
.field-money { position: relative; }
.field-money::before { content: "R$"; position: absolute; left: 14px; bottom: 14px; font-size: 14px; color: var(--muted); pointer-events: none; }
.field-money input { padding-left: 40px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--blue); flex: none; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.form-note { font-size: 12.5px; color: var(--muted); }
.radio-cards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.radio-cards label { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; font-weight: 600; font-size: 14px; }
.radio-cards input { accent-color: var(--blue); width: 18px; height: 18px; }
.radio-cards label:has(input:checked) { border-color: var(--blue); background: var(--tint); }

/* Seleção de fotos (câmera / galeria) */
.picker { border: 1.5px dashed #C4D3DF; border-radius: var(--radius); padding: 14px; background: var(--surface-2); }
.picker-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.picker-actions .muted { font-size: 12.5px; margin-left: auto; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-top: 12px; }
.picker-grid:empty { display: none; }
.picker-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #DDE6EE; }
.picker-thumb img { width: 100%; height: 100%; object-fit: cover; }
.picker-thumb.is-doc { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--blue-700); padding: 6px; text-align: center; word-break: break-all; }
.picker-thumb button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(11, 33, 51, .78); color: #fff; display: grid; place-items: center; cursor: pointer; }
.picker-thumb button .i { width: 14px; height: 14px; }
.picker input[type="file"] { display: none; }
.no-js .picker input[type="file"] { display: block; margin-top: 8px; }

/* ---------------------------------------------------------------- tabelas */

.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table td strong { color: var(--ink); }
.table td small { display: block; color: var(--muted); }
.table tfoot td { font-weight: 700; color: var(--ink); border-top: 2px solid var(--line); border-bottom: 0; }
.table .row-link { color: var(--ink); font-weight: 650; }

/* ---------------------------------------------------------------- listas, linha do tempo, vazio */

.rows { display: grid; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); color: var(--text); min-width: 0; }
.row-item:last-child { border-bottom: 0; }
a.row-item:hover { background: var(--surface-2); color: var(--text); border-radius: 12px; }
.row-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--tint); color: var(--blue); flex: none; }
.row-main { min-width: 0; flex: 1; display: grid; gap: 2px; }
.row-main strong { color: var(--ink); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-side { display: grid; justify-items: end; gap: 4px; text-align: right; }

.timeline { position: relative; display: grid; gap: 4px; }
.tl-item { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: 12px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--tint); color: var(--blue); display: grid; place-items: center; }
.tl-dot .i { width: 14px; height: 14px; }
.tl-body strong { display: block; color: var(--ink); font-size: 14px; }
.tl-body p { margin: 2px 0 0; font-size: 13.5px; color: var(--text); }
.tl-body small { color: var(--muted); }
.tl-day { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 10px 0 8px; }

.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .empty-icon { width: 56px; height: 56px; border-radius: 18px; background: var(--tint); color: var(--blue); display: grid; place-items: center; }
.empty .empty-icon .i { width: 26px; height: 26px; }
.empty strong { color: var(--ink); font-size: 15px; }
.empty p { max-width: 360px; margin: 0; font-size: 13.5px; }

.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--tint); color: #234C69; font-size: 13.5px; align-items: flex-start; }
.callout .i { color: var(--blue); margin-top: 1px; }
.callout.warn { background: #FFF5E0; color: #6E4E0B; }
.callout.warn .i { color: var(--amber); }
.callout.danger { background: #FDECEA; color: #8A2621; }
.callout.danger .i { color: var(--red); }
.callout p:last-child { margin: 0; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 18px; }
.kv div { min-width: 0; }
.kv dt, .kv small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kv dd, .kv b { display: block; margin: 3px 0 0; color: var(--ink); font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }

details.fold { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
details.fold > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 650; color: var(--blue-700); font-size: 14px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .i { width: 18px; height: 18px; }
details.fold > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
details.fold[open] > summary::after { transform: rotate(-135deg); }
details.fold > .fold-body { padding: 4px 14px 16px; }

.card-gap { margin-bottom: 16px; }
.fold-inset { margin: 0 18px 16px; }
@supports selector(:has(*)) {
  .client-mode .mode-novo { display: none; }
  .client-mode:has(input[value="novo"]:checked) .mode-novo { display: grid; }
  .client-mode:has(input[value="novo"]:checked) .mode-existente { display: none; }
  .cam-form .cam-new { display: none; }
  .cam-form:has(select[data-cam-target] option[value=""]:checked) .cam-new { display: grid; }
  .supplier-pick .new-supplier { display: none; }
  .supplier-pick:has(select[name="supplier_id"] option[value=""]:checked) .new-supplier { display: grid; }
}

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.pager a { padding: 8px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { flex: 1 1 180px; }
.filters .field.grow { flex: 3 1 260px; }
.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill b { font-size: 11.5px; background: var(--line-soft); color: var(--muted); border-radius: 99px; padding: 1px 7px; }
.pill.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.pill.is-active b { background: rgba(255, 255, 255, .16); color: #fff; }

/* ---------------------------------------------------------------- fotos */

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.photo-grid.sm { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #DCE5EC; }
.ph > a { display: block; height: 100%; }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.ph:hover img { transform: scale(1.04); }
.ph form { position: absolute; top: 6px; right: 6px; }
.ph form button { width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(11, 33, 51, .72); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ph form button .i { width: 14px; height: 14px; }
.ph figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; background: linear-gradient(transparent, rgba(11, 33, 51, .78)); color: #fff; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--blue-700); max-width: 100%; }
.doc-link .i { width: 15px; height: 15px; }
.doc-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------------------------- diálogos, avisos, lightbox */

dialog { border: 0; padding: 0; color: var(--text); }
dialog::backdrop { background: rgba(9, 27, 41, .55); backdrop-filter: blur(3px); }
.sheet {
  width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 48px);
  border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-lg);
  overflow: auto; overscroll-behavior: contain;
}
.sheet[open] { animation: rise .26s var(--ease); }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.sheet-head h3 { font-size: 18px; }
.sheet-body { padding: 16px 20px 22px; }
.sheet-close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
@keyframes rise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }

.flash-stack:empty { display: none; }
.flash-stack, .toast-stack { position: fixed; z-index: 90; top: calc(14px + var(--safe-t)); right: calc(var(--side-w) + 24px); display: grid; gap: 8px; width: min(400px, calc(100% - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--graphite); color: #fff;
  box-shadow: var(--shadow-lg); font-size: 14px; animation: rise .25s var(--ease);
}
.toast > .i { color: #7CD3B0; margin-top: 1px; }
.toast-error > .i { color: #FF8F87; }
.toast span { flex: 1; }
.toast-close { border: 0; background: none; color: rgba(255, 255, 255, .6); cursor: pointer; padding: 0; }
.toast-close .i { width: 16px; height: 16px; }

.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; background: rgba(6, 18, 28, .96); display: none; align-items: center; justify-content: center; }
.lightbox[open] { display: flex; }
.lightbox figure { margin: 0; display: grid; gap: 10px; justify-items: center; max-width: calc(100vw - 120px); }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 120px); border-radius: 10px; object-fit: contain; }
.lightbox figcaption { color: rgba(255, 255, 255, .78); font-size: 13.5px; }
.lightbox-close, .lightbox-nav { position: absolute; border: 0; background: rgba(255, 255, 255, .1); color: #fff; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.lightbox-close { top: calc(16px + var(--safe-t)); right: 16px; }
.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }

/* ---------------------------------------------------------------- gráficos */

.bars { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding-top: 10px; }
.bar { flex: 1; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 6px; height: 100%; }
.bar small { font-weight: 700; color: var(--ink); font-size: 12.5px; }
.bar-track { width: 100%; max-width: 46px; border-radius: 12px; background: var(--line-soft); display: flex; align-items: flex-end; overflow: hidden; }
.bar-track span { width: 100%; border-radius: 12px; background: linear-gradient(180deg, var(--teal), var(--blue)); min-height: 4px; }
.bar em { font-style: normal; font-size: 12px; color: var(--muted); text-transform: capitalize; }

.donut-wrap { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; align-items: center; }
.donut { position: relative; width: 170px; height: 170px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center strong { font: 800 30px/1 var(--font-display); color: var(--ink); }
.donut-center small { color: var(--muted); font-size: 12px; }
.legend { display: grid; gap: 8px; }
.legend a, .legend div { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 13.5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }

.stackbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--line-soft); }
.stackbar span { height: 100%; }

/* Cores dos status nos gráficos */
.c-teal { background: #43A2C5; color: #43A2C5; }
.c-gray { background: #9AAAB8; color: #9AAAB8; }
.c-amber { background: #E3A72F; color: #E3A72F; }
.c-sky { background: #7DB3DE; color: #7DB3DE; }
.c-blue { background: #397CB0; color: #397CB0; }
.c-orange { background: #E07B45; color: #E07B45; }
.c-green { background: #2DAA7A; color: #2DAA7A; }
.c-navy { background: #102C40; color: #102C40; }
.stroke-teal { stroke: #43A2C5; }
.stroke-gray { stroke: #9AAAB8; }
.stroke-amber { stroke: #E3A72F; }
.stroke-sky { stroke: #7DB3DE; }
.stroke-blue { stroke: #397CB0; }
.stroke-orange { stroke: #E07B45; }
.stroke-green { stroke: #2DAA7A; }

/* Comparativo orçamentário */
.budget { display: grid; gap: 10px; }
.budget-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 130px; gap: 12px; align-items: center; font-size: 13.5px; }
.budget-row .label { color: var(--text); font-weight: 600; }
.budget-row .label small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.budget-row .track { height: 12px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.budget-row .track span { display: block; height: 100%; border-radius: inherit; }
.budget-row .value { text-align: right; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
.diffs { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 14px; }
.diff { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.diff small { display: block; color: var(--muted); font-size: 12px; }
.diff strong { font: 800 18px var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.diff.pos strong { color: var(--green); }
.diff.neg strong { color: var(--red); }
.formula { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- dashboard */

.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-xl);
  padding: 26px 28px; color: #fff;
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(67, 162, 197, .45), transparent 55%),
    linear-gradient(120deg, #0F2C43 0%, #17436A 60%, #2B6A9C 100%);
  box-shadow: var(--shadow);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center;
}
.hero::after { content: ""; position: absolute; right: 4%; top: -40px; width: 300px; height: 300px; background: url("../img/logo-symbol-white.png") center / contain no-repeat; opacity: .08; pointer-events: none; }
.hero h2 { color: #fff; font-size: 28px; font-weight: 800; }
.hero p { color: rgba(255, 255, 255, .78); margin: 6px 0 16px; max-width: 520px; }
.hero .kicker { color: #9ED8EC; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-search { position: relative; z-index: 1; display: flex; gap: 8px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); padding: 6px; border-radius: 16px; width: min(340px, 100%); }
.hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: #fff; font: 600 16px var(--font); padding: 0 10px; text-transform: uppercase; letter-spacing: .06em; }
.hero-search input::placeholder { color: rgba(255, 255, 255, .55); text-transform: none; letter-spacing: 0; font-weight: 500; }
.hero-search input:focus { outline: none; }
.hero-side { position: relative; z-index: 1; display: grid; gap: 10px; justify-items: end; }

.vehicle-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.vcard { display: grid; gap: 12px; padding: 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--text); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.vcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.vcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.vcard h3 { font-size: 15.5px; }
.vcard-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.vcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.vcard .progress { flex: 1; }
.demo-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: #8A5A00; background: #FFF0C7; border-radius: 6px; padding: 2px 6px; }

/* ---------------------------------------------------------------- ficha do veículo */

.vhead {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center;
  padding: 22px 24px; border-radius: var(--radius-xl); color: #fff;
  background:
    radial-gradient(80% 140% at 100% 0%, rgba(67, 162, 197, .38), transparent 55%),
    linear-gradient(120deg, #0E2A40, #163F62 70%, #245E8D);
  box-shadow: var(--shadow);
}
.vhead::after { content: ""; position: absolute; right: 170px; bottom: -70px; width: 220px; height: 220px; background: url("../img/logo-symbol-white.png") center / contain no-repeat; opacity: .06; pointer-events: none; }
.vhead h2 { color: #fff; font-size: 24px; font-weight: 800; }
.vhead p { margin: 4px 0 0; color: rgba(255, 255, 255, .78); font-size: 14px; }
.vhead .badge { background: rgba(255, 255, 255, .14); color: #fff; }
.vhead-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.vhead-meta .chip { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .9); }
.vhead-meta .chip .i { color: #9ED8EC; }
.vhead-side { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 12px; color: rgba(255, 255, 255, .7); }
.vhead-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }

.tabs {
  position: sticky; top: var(--topbar-h); z-index: 20;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 18px 0 18px; padding: 6px; border-radius: 16px;
  background: rgba(255, 255, 255, .86); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 11px; color: var(--muted); font-weight: 650; font-size: 13.5px; white-space: nowrap; }
.tab .i { width: 17px; height: 17px; }
.tab b { font-size: 11px; background: var(--line-soft); color: var(--muted); padding: 1px 7px; border-radius: 99px; }
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.is-active { background: var(--navy); color: #fff; }
.tab.is-active b { background: rgba(255, 255, 255, .18); color: #fff; }

.item-card { padding: 0; overflow: hidden; }
.item-card + .item-card { margin-top: 14px; }
.item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 0; flex-wrap: wrap; }
.item-head h3 { font-size: 16px; }
.item-head .kicker { margin-bottom: 4px; }
.item-body { padding: 10px 18px 16px; display: grid; gap: 12px; }
.item-body > p { margin: 0; }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.item-meta span { display: inline-flex; align-items: center; gap: 5px; }
.item-meta .i { width: 14px; height: 14px; }
.item-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 18px; background: var(--surface-2); border-top: 1px solid var(--line-soft); }
.item-foot .spacer { flex: 1; }
.item-number { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 7px; background: var(--navy); color: #fff; font-size: 11.5px; font-weight: 800; margin-right: 6px; vertical-align: 2px; }

.quotes { display: grid; gap: 8px; }
.quote {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff;
}
.quote.is-selected { border-color: #9FC7E6; background: #F5FAFE; }
.quote.is-approved { border-color: #8FD1B4; background: #F2FBF7; box-shadow: inset 4px 0 0 var(--green); }
.quote-supplier strong { display: block; color: var(--ink); }
.quote-supplier small { color: var(--muted); }
.quote-price { font: 800 18px var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.quote-terms { font-size: 12.5px; color: var(--muted); display: grid; gap: 2px; }
.quote-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.quote-extra { grid-column: 1 / -1; display: grid; gap: 8px; font-size: 13.5px; }
.quote-extra p { margin: 0; }

.steps { display: flex; gap: 4px; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 650; background: var(--line-soft); color: var(--muted); }
.step.done { background: #DDF3E9; color: var(--green); }
.step.now { background: var(--navy); color: #fff; }

.checklist { display: grid; gap: 8px; }
.checklist div { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.checklist .i { width: 18px; height: 18px; }
.checklist .ok { color: var(--green); }
.checklist .no { color: var(--amber); }

/* ---------------------------------------------------------------- login e instalação */

.auth-body { min-height: 100dvh; background: var(--bg); display: grid; }
.auth {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr);
  min-height: 100dvh;
}
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(70% 60% at 85% 10%, rgba(67, 162, 197, .5), transparent 60%),
    radial-gradient(60% 50% at 0% 100%, rgba(57, 124, 176, .45), transparent 60%),
    linear-gradient(150deg, #0B2133, #123A5A 60%, #1C5584);
}
.auth-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 560px; height: 560px; background: url("../img/logo-symbol-white.png") center / contain no-repeat; opacity: .09; }
.auth-art img {
  display: block;
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  align-self: flex-start; /* Impede o flex de esticar a marca pela largura inteira. */
  width: 250px;
  max-width: 100%;
  height: auto;
  max-height: 106px;
  object-fit: contain;
  object-position: left center;
}
.auth-art h2 { color: #fff; font-size: clamp(30px, 3.4vw, 46px); font-weight: 800; line-height: 1.05; max-width: 560px; position: relative; z-index: 1; }
.auth-art h2 em { font-style: normal; color: #8FD3EA; }
.auth-art p { color: rgba(255, 255, 255, .75); max-width: 460px; font-size: 16px; position: relative; z-index: 1; }
.auth-flow { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.auth-flow span { padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); font-size: 12.5px; font-weight: 600; }
.auth-panel { display: grid; place-items: center; padding: 32px 22px; }
.auth-card { width: min(420px, 100%); }
/* Setup prioriza o formulário e reduz o painel institucional. Login mantém o layout original. */
.auth-setup .auth { grid-template-columns: minmax(320px, .8fr) minmax(540px, 1.2fr); }
.auth-setup .auth-panel { padding: 36px 36px; }
.auth-setup .auth-card { width: min(530px, 100%); }
.auth-setup .auth-art { padding: 38px; }
.auth-setup .auth-art h2 { max-width: 460px; font-size: clamp(29px, 2.6vw, 41px); }
.auth-setup .setup-steps { gap: 6px; }
.auth-setup .setup-steps div { font-size: 13px; }
.auth-card .logo { height: 64px; width: auto; margin-bottom: 26px; }
.auth-card h1 { font-size: 28px; font-weight: 800; }
.auth-card > p { color: var(--muted); margin: 6px 0 22px; }
.auth-card form { display: grid; gap: 14px; }
.auth-foot { margin-top: 22px; font-size: 12.5px; color: var(--muted); }
.setup-steps { display: grid; gap: 8px; margin: 0 0 18px; }
.setup-steps div { display: flex; gap: 10px; align-items: center; font-size: 13.5px; }
.setup-steps .i { width: 18px; height: 18px; }

.install-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.install-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; background: #fff; }
.install-card.is-device { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(57, 124, 176, .16); }
.install-card h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; margin-bottom: 10px; }
.install-card ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }

/* ---------------------------------------------------------------- relatórios na tela */

.report-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--navy); margin-bottom: 16px; }
.report-head img { height: 46px; width: auto; }
.report-head .kicker { text-align: right; }
.report-head h2 { font-size: 20px; text-align: right; }
.report-section { margin-top: 20px; }
.report-section > h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--blue-700); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 10px; }

/* ==========================================================================
   Responsivo
   ========================================================================== */

@media (max-width: 1280px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .top-search { width: min(300px, 30vw); }
}

@media (max-width: 1023px) {
  .auth-setup .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-setup .auth-art { min-height: 270px; }
  .auth-setup .auth-panel { padding: 30px 22px 50px; }
  :root { --topbar-h: 62px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side-mini .app { grid-template-columns: minmax(0, 1fr); }
  .main { padding: 0 16px; }
  .content { padding-bottom: calc(112px + var(--safe-b)); }
  .app-foot { padding-bottom: calc(110px + var(--safe-b)); }

  .topbar { gap: 10px; padding-top: calc(8px + var(--safe-t)); }
  .topbar-logo { display: block; }
  .topbar-logo img { width: 36px; height: 36px; }
  .topbar-title h1 { font-size: 19px; }
  .topbar-title .kicker { font-size: 10.5px; }
  .top-search { display: none; }
  .top-search-mobile { display: inline-grid; }
  .top-user { padding: 0; border: 0; background: none; box-shadow: none; }
  .top-user-text { display: none; }

  /* Menu lateral vira gaveta pela direita */
  .side {
    position: fixed; top: 0; right: 0; bottom: 0; height: auto;
    width: min(320px, 86vw); padding: 10px;
    transform: translateX(105%); transition: transform .3s var(--ease); z-index: 70;
  }
  .side-mini .side-nav span, .side-mini .side-label, .side-mini .side-user-text, .side-mini .nav-logout span, .side-mini .brand-full { display: revert; }
  .side-mini .brand-mini { display: none; }
  .side-mini .nav-link { justify-content: flex-start; padding: 10px 12px; }
  .side-toggle { display: none; }
  .side-close { display: inline-grid; }
  .drawer-open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(9, 27, 41, .5); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .drawer-open { overflow: hidden; }

  /* Barra inferior flutuante, compacta e arredondada */
  .dock {
    position: fixed; z-index: 60; left: 50%; bottom: calc(12px + var(--safe-b));
    transform: translateX(-50%);
    width: min(380px, calc(100% - 28px)); height: 64px; padding: 0 8px;
    display: grid; grid-template-columns: 1fr 1fr 74px 1fr 1fr; align-items: center;
    border-radius: 999px;
    background: rgba(13, 37, 55, .95);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px -14px rgba(9, 27, 41, .7), inset 0 1px 0 rgba(255, 255, 255, .06);
  }
  .dock-link { display: grid; justify-items: center; gap: 3px; border: 0; background: none; color: rgba(255, 255, 255, .62); font: 600 10.5px/1 var(--font); cursor: pointer; padding: 6px 0; }
  .dock-link .i { width: 22px; height: 22px; padding: 0; box-sizing: content-box; border-radius: 999px; transition: background .2s, color .2s, padding .2s; }
  .dock-link.is-active { color: #fff; }
  .dock-link.is-active .i { background: #fff; color: var(--navy); padding: 4px 13px; margin: -4px 0; }
  .dock-center {
    justify-self: center; display: grid; place-items: center;
    width: 60px; height: 60px; margin-top: -30px; border-radius: 50%;
    border: 4px solid var(--bg); color: #fff; cursor: pointer;
    background: linear-gradient(140deg, #5DBBDA, var(--blue) 70%);
    box-shadow: 0 12px 24px -8px rgba(57, 124, 176, .85);
  }
  .dock-center .i { width: 26px; height: 26px; }
  .dock-center:hover { color: #fff; }
  .dock-center.is-camera { background: linear-gradient(140deg, #6FD0EC, #2F8CC0 65%); animation: pulse 2.6s ease-out infinite; }
  @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(67, 162, 197, .55), 0 12px 24px -8px rgba(57, 124, 176, .85); } 70% { box-shadow: 0 0 0 14px rgba(67, 162, 197, 0), 0 12px 24px -8px rgba(57, 124, 176, .85); } 100% { box-shadow: 0 0 0 0 rgba(67, 162, 197, 0), 0 12px 24px -8px rgba(57, 124, 176, .85); } }

  .flash-stack, .toast-stack { right: 50%; transform: translateX(50%); top: calc(10px + var(--safe-t)); }
  .tabs { top: var(--topbar-h); margin: 14px -16px; border-radius: 0; border-left: 0; border-right: 0; padding: 6px 12px; }

  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 22px 20px; }
  .hero-side { justify-items: stretch; }
  .hero-search { width: 100%; }
  .vhead { grid-template-columns: minmax(0, 1fr) auto; padding: 18px; gap: 12px 14px; }
  .vhead > .plate { grid-column: 1; grid-row: 1; justify-self: start; align-self: center; }
  .vhead > .vhead-side { grid-column: 2; grid-row: 1; }
  .vhead > div:not(.vhead-side) { grid-column: 1 / -1; grid-row: 2; }
  .vhead-side span { display: none; }
  .vhead-meta .chip { font-size: 12px; padding: 3px 8px; }
  .vhead-actions .btn { height: 34px; padding: 0 11px; font-size: 13px; }
  .vhead::after { right: -40px; }
}

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .card { padding: 16px; border-radius: 18px; }
  .page-head h2 { font-size: 22px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px 12px 12px; }
  .kpi-value { font-size: 23px; }
  .kpi-icon { width: 30px; height: 30px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .legend { width: 100%; }
  .budget-row { grid-template-columns: minmax(0, 1fr) auto; }
  .budget-row .track { grid-column: 1 / -1; grid-row: 2; }
  .quote { grid-template-columns: minmax(0, 1fr) auto; }
  .quote-terms { grid-column: 1 / -1; grid-row: 2; }
  .quote-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .vhead h2 { font-size: 20px; }
  .ring { --size: 64px; }
  .ring strong { font-size: 15px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { padding: 26px 22px 30px; min-height: 0; gap: 18px; }
  .auth-art h2 { font-size: 28px; }
  .auth-art img { width: 190px; height: auto; max-height: 82px; }
  .auth-setup .auth-art { min-height: 0; }
  .auth-setup .auth-art h2 { font-size: 27px; }
  .sheet { width: 100%; max-width: 100%; max-height: calc(100dvh - 24px); margin: auto 0 0; border-radius: 24px 24px 0 0; padding-bottom: var(--safe-b); }
  .sheet[open] { animation: sheet-up .3s var(--ease); }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
  .lightbox figure { max-width: 100vw; }
  .lightbox-nav { bottom: calc(20px + var(--safe-b)); top: auto; }

  /* Tabelas viram cartões empilhados */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
  .table-cards td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table-cards td::before { content: attr(data-label); font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-align: left; }
  .table-cards td.cell-main { display: block; text-align: left; font-size: 15px; }
  .table-cards td.cell-main::before { display: none; }
  .table-cards td small { display: block; }
  .table-cards tfoot tr { background: var(--surface-2); }
}

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

/* ==========================================================================
   Impressão (relatórios e fichas)
   ========================================================================== */

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 11.5pt; }
  .side, .dock, .topbar, .tabs, .app-foot, .no-print, .flash-stack, .toast-stack, .scrim, .page-actions, .btn { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .table th, .table td { padding: 6px 8px; }
  .report-section, .table tr, .ph { break-inside: avoid; }
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
  a { color: inherit; }
}
