/* ==========================================================================
   Laudo Técnico ATR — Design system
   Derivado do logo Real Aviation: disco azul-marinho, "R" amarelo com perna
   diagonal e a "asa" azul. Esses três elementos aparecem nos componentes:
   - marinho: estrutura (sidebar, cabeçalhos)
   - amarelo: ação principal e foco (o "R")
   - azul-asa: destaques secundários, progresso, links
   - diagonal do R: cortes em 18° nos cabeçalhos, stepper e botões principais
   ========================================================================== */

:root {
  --navy-950: #0d1640;
  --navy-900: #141f52;
  --navy-800: #1b2a66;
  --navy-700: #24357a;
  --navy-100: #e6e9f4;
  --navy-50:  #f3f5fb;

  --yellow-500: #f9c31a;
  --yellow-400: #ffd23f;
  --yellow-100: #fff4cc;
  --yellow-700: #b98a00;

  --wing-600: #1665c0;
  --wing-500: #1e7fd8;
  --wing-100: #dcebfb;

  --ok-600: #138a4f;
  --ok-100: #dcf5e7;
  --nc-600: #c8352b;
  --nc-100: #fde4e1;
  --na-600: #66708a;
  --na-100: #eceef3;
  --warn-600: #a86400;
  --warn-100: #fff0d6;

  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #dfe3ee;
  --border-strong: #c5cbdc;
  --text: #121a3a;
  --text-2: #4b5575;
  --text-3: #7d86a3;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(13, 22, 64, .06);
  --shadow: 0 4px 16px rgba(13, 22, 64, .08), 0 1px 3px rgba(13, 22, 64, .06);
  --shadow-lg: 0 20px 50px rgba(13, 22, 64, .18);
  --slant: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sidebar-w: 264px;
  --tap: 52px; /* alvo de toque confortável para luvas e telas ao sol */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* rede de segurança: nada deve empurrar a página para os lados */
}
input, select, textarea, button { max-width: 100%; }

/* Barras de rolagem nas cores do logo: trilho marinho claro, polegar marinho e amarelo ao passar o mouse. */
html { scrollbar-color: var(--navy-700) var(--navy-50); }
* { scrollbar-width: thin; scrollbar-color: var(--navy-700) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--navy-50); }
::-webkit-scrollbar-thumb { background: var(--navy-700); border-radius: 99px; border: 2px solid var(--navy-50); }
::-webkit-scrollbar-thumb:hover { background: var(--yellow-500); }
::-webkit-scrollbar-corner { background: transparent; }
.sidebar, .console { scrollbar-color: var(--yellow-500) transparent; }
.sidebar::-webkit-scrollbar-track, .console::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb, .console::-webkit-scrollbar-thumb { background: rgba(249,195,26,.7); border-color: var(--navy-900); }
.sidebar::-webkit-scrollbar-thumb:hover, .console::-webkit-scrollbar-thumb:hover { background: var(--yellow-500); }
img, video { max-width: 100%; display: block; }
a { color: var(--wing-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 750; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
.mono { font-family: var(--mono); font-feature-settings: "zero"; letter-spacing: -.01em; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.xs { font-size: .75rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[x-cloak] { display: none !important; }
:focus-visible { outline: 3px solid var(--yellow-500); outline-offset: 2px; border-radius: 6px; }

/* --------------------------------------------------------------- Shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--navy-900); color: #cdd3ea; display: flex; flex-direction: column;
  background-image: radial-gradient(circle at -40% 110%, rgba(30,127,216,.35), transparent 55%);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; color: #fff; }
.brand img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(249,195,26,.25); }
.brand strong { display: block; font-size: 1rem; letter-spacing: -.01em; }
.brand span { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--yellow-500); font-weight: 700; }
.nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: #7f89b3; padding: 16px 12px 6px; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #cdd3ea; font-weight: 600; font-size: .92rem; position: relative;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(249,195,26,.12); color: #fff; }
.nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 5px;
  background: var(--yellow-500); border-radius: 0 4px 4px 0;
}
.nav svg { width: 20px; height: 20px; flex: none; }
.nav .badge-count { margin-left: auto; background: var(--yellow-500); color: var(--navy-900); font-size: .7rem; font-weight: 800; padding: 1px 8px; border-radius: 99px; }
.sidebar-cta { padding: 12px 16px 4px; }
.sidebar-foot { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--yellow-500); color: var(--navy-900); font-weight: 800; font-size: .85rem;
}
.sidebar-foot .who { min-width: 0; flex: 1; }
.sidebar-foot .who strong { display: block; color: #fff; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who span { font-size: .75rem; color: #8f99c2; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; border: 0;
  background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: rgba(127,137,179,.18); }
.icon-btn svg { width: 20px; height: 20px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 28px clamp(16px, 3vw, 40px) 100px; max-width: 1360px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--wing-600); margin-bottom: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Mobile: barra superior + navegação inferior (polegar) */
.bottom-nav { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; height: auto; width: min(86vw, 320px); z-index: 60; overscroll-behavior: contain;
    transform: translateX(-102%); transition: transform .25s ease;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { position: fixed; inset: 0; background: rgba(13,22,64,.45); z-index: 55; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40;
    background: var(--navy-900); color: #fff; padding: 10px 12px; min-height: 60px;
  }
  .topbar img { width: 34px; height: 34px; border-radius: 50%; }
  .topbar .title { font-weight: 750; font-size: 1rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .content { padding: 18px 16px 120px; }
  h1 { font-size: 1.35rem; }
  /* Todos os itens têm a mesma estrutura (ícone + rótulo) e a mesma altura, então
     ficam alinhados com ou sem o botão "Novo"; o círculo amarelo só sobe visualmente. */
  .bottom-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; height: calc(65px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border); padding: 0 6px env(safe-area-inset-bottom);
    box-shadow: 0 -6px 20px rgba(13,22,64,.06);
  }
  .bottom-nav > a, .bottom-nav > button, .bottom-nav .bn-new button {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px;
    width: 100%; height: 64px; padding: 0 2px 9px; margin: 0; min-width: 0;
    font: 700 .7rem/1.1 var(--font); color: var(--text-2); background: none; border: 0; border-radius: 10px;
    cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; -webkit-appearance: none; appearance: none;
  }
  .bottom-nav .bn-new { margin: 0; min-width: 0; }
  .bottom-nav > a:hover { text-decoration: none; }
  .bottom-nav > a.active { color: var(--navy-800); }
  .bottom-nav > a.active svg { color: var(--wing-500); }
  .bottom-nav svg { width: 24px; height: 24px; flex: none; }
  .bottom-nav button:disabled { opacity: 1; }
  .bottom-nav .fab {
    width: 54px; height: 54px; margin-top: -24px; border-radius: 50%; flex: none;
    background: var(--yellow-500); color: var(--navy-900); box-shadow: 0 6px 16px rgba(249,195,26,.45);
    display: grid; place-items: center; border: 4px solid var(--surface); transition: transform .12s;
  }
  .bottom-nav .bn-new button { color: var(--navy-800); }
  .bottom-nav .bn-new button:active .fab { transform: scale(.94); }
  .bottom-nav .bn-new button.is-loading .fab svg { animation: spin .8s linear infinite; }
  .bottom-nav .fab svg { width: 26px; height: 26px; }
  body.nav-open { overflow: hidden; }
}

/* --------------------------------------------------------------- Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 10px; }
.card-head h2::before, .card-head h3::before {
  content: ""; width: 14px; height: 18px; background: var(--yellow-500); clip-path: polygon(0 0, 55% 0, 100% 100%, 45% 100%);
}
.card-body { padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* --------------------------------------------------------------- Buttons */
.btn {
  --b-bg: var(--surface); --b-fg: var(--text); --b-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1.5px solid var(--b-bd); background: var(--b-bg); color: var(--b-fg);
  font: 700 .92rem/1 var(--font); cursor: pointer; text-decoration: none; transition: transform .08s, box-shadow .15s, background .15s;
  white-space: nowrap; user-select: none;
}
.btn:hover { text-decoration: none; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-loading { opacity: .6; cursor: not-allowed; box-shadow: none; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { --b-bg: var(--yellow-500); --b-fg: var(--navy-950); --b-bd: var(--yellow-500); }
.btn-primary:hover { --b-bg: var(--yellow-400); }
.btn-navy { --b-bg: var(--navy-800); --b-fg: #fff; --b-bd: var(--navy-800); }
.btn-wing { --b-bg: var(--wing-500); --b-fg: #fff; --b-bd: var(--wing-500); }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; --b-fg: var(--text-2); }
.btn-ghost:hover { --b-bg: var(--navy-50); box-shadow: none; }
.btn-danger { --b-bg: #fff; --b-fg: var(--nc-600); --b-bd: #f1b8b2; }
.btn-danger:hover { --b-bg: var(--nc-100); }
.btn-lg { min-height: var(--tap); padding: 0 24px; font-size: 1rem; border-radius: 14px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .82rem; border-radius: 9px; }
.btn-block { width: 100%; }
/* Botão "R": corte diagonal herdado da perna do R */
.btn-slant { border-radius: 12px 4px 12px 12px; position: relative; overflow: hidden; }
.btn-slant::after {
  content: ""; position: absolute; right: -10px; top: 0; bottom: 0; width: 26px;
  background: rgba(255,255,255,.28); transform: skewX(-18deg);
}

/* --------------------------------------------------------------- Forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 700; font-size: .86rem; color: var(--text); }
.field .hint { font-size: .78rem; color: var(--text-3); }
.req::after { content: " *"; color: var(--nc-600); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: 500 1rem var(--font); transition: border .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--wing-500); box-shadow: 0 0 0 4px rgba(30,127,216,.15); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--nc-600); box-shadow: 0 0 0 4px rgba(200,53,43,.1); }
.error-text { color: var(--nc-600); font-size: .8rem; font-weight: 600; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 600; padding: 6px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--wing-500); flex: none; margin-top: 1px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 46px; height: 26px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--wing-500); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--yellow-500); outline-offset: 2px; }

/* --------------------------------------------------------------- Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 750; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-rascunho { background: var(--na-100); color: var(--na-600); }
.b-finalizado { background: var(--wing-100); color: var(--wing-600); }
.b-enviado { background: var(--ok-100); color: var(--ok-600); }
.b-erro_envio { background: var(--nc-100); color: var(--nc-600); }
.b-preventiva { background: var(--navy-100); color: var(--navy-800); }
.b-corretiva { background: var(--warn-100); color: var(--warn-600); }
.b-conforme { background: var(--ok-100); color: var(--ok-600); }
.b-nao_conforme { background: var(--nc-100); color: var(--nc-600); }
.b-na { background: var(--na-100); color: var(--na-600); }
.b-admin { background: var(--navy-800); color: #fff; }
.b-gestor { background: var(--wing-100); color: var(--wing-600); }
.b-tecnico { background: var(--yellow-100); color: var(--yellow-700); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--navy-50); border: 1px solid var(--border); font-size: .8rem; font-weight: 700; }

/* --------------------------------------------------------------- Alerts / toast */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid; font-weight: 600; font-size: .92rem; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert-success { background: var(--ok-100); border-color: #a8e2c3; color: #0c5c34; }
.alert-error { background: var(--nc-100); border-color: #f1b8b2; color: #8f1f17; }
.alert-warning { background: var(--warn-100); border-color: #f4d29a; color: #6e4100; }
.alert-info { background: var(--wing-100); border-color: #b4d4f5; color: #0d4a8f; }
.toasts { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toasts .alert { box-shadow: var(--shadow-lg); animation: toast-in .35s cubic-bezier(.2,.9,.3,1.2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.96); } }
@media (max-width: 960px) { .toasts { top: 72px; left: 16px; right: 16px; max-width: none; } }

/* --------------------------------------------------------------- Tables & lists */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 800; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--navy-50); }
.table tr.is-inactive td { opacity: .55; }
/* Celular/tablet: cada linha vira um cartão (rótulo à esquerda, valor à direita),
   sem rolagem horizontal. Os rótulos vêm do <thead> (app.js preenche data-label). */
@media (max-width: 960px) {
  .table-wrap { overflow: visible; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { display: none; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table tbody tr:hover { background: none; }
  .table td {
    position: relative; border: 0; padding: 5px 0 5px 38%; min-height: 30px; text-align: left !important;
    white-space: normal !important; overflow-wrap: anywhere;
  }
  .table td::before {
    content: attr(data-label); position: absolute; left: 0; top: 7px; width: calc(38% - 12px);
    font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); line-height: 1.3;
  }
  /* Primeira coluna = título do cartão; colunas sem cabeçalho (ações) ficam alinhadas à direita. */
  .table td:first-child { padding-left: 0; font-size: 1rem; }
  .table td:first-child::before, .table td:not([data-label])::before, .table td[data-label=""]::before { display: none; }
  .table td:not(:first-child):not([data-label]), .table td:not(:first-child)[data-label=""] { padding-left: 0; }
  .table td[data-label=""]:last-child { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-top: 10px; }
  .table td.empty { padding: 32px 0; text-align: center !important; }
  .table td [style*="max-width"] { max-width: 100% !important; }
}
@media (min-width: 600px) and (max-width: 960px) {
  /* Tablet: dois cartões por linha. */
  .table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table tbody tr, .table tbody tr:last-child { border-bottom: 1px solid var(--border); }
  .table tbody tr:nth-child(odd) { border-right: 1px solid var(--border); }
  .table tbody tr:only-child, .table tbody tr:has(> td.empty) { grid-column: 1 / -1; border-right: 0; }
}
.cron-box { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface-2, #f8f9fc); }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .input { flex: 1; min-width: 0; font-size: .82rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--wing-500); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty svg { width: 56px; height: 56px; margin: 0 auto 12px; color: var(--border-strong); }

/* Lista em cartões para celular */
.report-list { display: flex; flex-direction: column; gap: 10px; }
.report-card {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
  position: relative; overflow: hidden; transition: box-shadow .15s, transform .15s;
}
.report-card:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); }
.report-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--navy-700); }
.report-card.corretiva::after { background: var(--yellow-500); }
.report-card .disc {
  width: 56px; height: 56px; border-radius: 50%; background: var(--navy-800); color: #fff; display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: .85rem; border: 3px solid var(--yellow-500);
}
.report-card .title { font-weight: 800; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.report-card .meta { font-size: .8rem; color: var(--text-2); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.report-card .side { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
/* O link do título cobre o card inteiro; botões/formulários ficam por cima e continuam clicáveis. */
.report-card .card-link { color: inherit; }
.report-card .card-link::before { content: ""; position: absolute; inset: 0; z-index: 0; }
.report-card .card-link:hover { text-decoration: none; }
.report-card form, .report-card button, .report-card .side a { position: relative; z-index: 1; }
.report-card .side-row { display: flex; flex-direction: row; gap: 8px; align-items: center; }
.report-card form { margin: 0; }
.btn-icon-danger { --b-fg: var(--text-2); }
.btn-icon-danger:hover { --b-fg: var(--nc-600); --b-bg: var(--nc-100); }
@media (max-width: 560px) { .report-card { grid-template-columns: 48px 1fr; } .report-card .disc { width: 48px; height: 48px; } .report-card .side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; } }

.filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
.filters-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.filters-actions .btn { min-width: 120px; }
@media (max-width: 1100px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .filters { grid-template-columns: minmax(0, 1fr); }
  .filters-actions .btn { flex: 1; min-width: 0; }
}
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; color: var(--text); }
.pagination .current { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* --------------------------------------------------------------- KPI / dashboard */
.kpi {
  position: relative; overflow: hidden; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.kpi .label { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); }
.kpi .value { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .8rem; color: var(--text-2); font-weight: 600; }
.kpi .ring { position: absolute; right: -26px; top: -26px; width: 96px; height: 96px; border-radius: 50%; background: var(--navy-50); }
.kpi .ring svg { position: absolute; left: 22px; bottom: 18px; width: 26px; height: 26px; color: var(--navy-700); }
.kpi.accent { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.kpi.accent .label { color: #9fb0e6; }
.kpi.accent .sub { color: #cdd3ea; }
.kpi.accent .ring { background: rgba(249,195,26,.18); }
.kpi.accent .ring svg { color: var(--yellow-500); }
.chart-box { position: relative; height: 290px; }
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-list .bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: .86rem; font-weight: 600; }
.bar-list .bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--navy-50); overflow: hidden; }
.bar-list .bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--nc-600), #e9665c); }
.coverage { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.coverage .cov {
  border-radius: 12px; padding: 12px; border: 1px solid var(--border); background: var(--surface-2);
}
.coverage .cov strong { font-family: var(--mono); font-size: 1.05rem; }
.coverage .cov .when { font-size: .74rem; font-weight: 700; }
.cov.fresh { border-color: #a8e2c3; background: var(--ok-100); } .cov.fresh .when { color: var(--ok-600); }
.cov.aging { border-color: #f4d29a; background: var(--warn-100); } .cov.aging .when { color: var(--warn-600); }
.cov.stale { border-color: #f1b8b2; background: var(--nc-100); } .cov.stale .when { color: var(--nc-600); }

/* --------------------------------------------------------------- Wizard */
.wizard { max-width: 860px; margin: 0 auto; }
.wizard-head {
  background: var(--navy-800); color: #fff; border-radius: var(--radius-lg); padding: 18px 20px 20px; position: relative; overflow: hidden;
  margin-bottom: 18px;
}
.wizard-head::before {
  content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(30,127,216,.55), transparent 65%);
}
.wizard-head::after {
  content: ""; position: absolute; right: 40px; bottom: -30px; width: 70px; height: 140px; background: var(--yellow-500);
  transform: skewX(-24deg); opacity: .9;
}
.wizard-head > * { position: relative; z-index: 1; }
.wizard-head .num { font-family: var(--mono); color: var(--yellow-500); font-weight: 700; font-size: .85rem; }
.wizard-head h1 { color: #fff; font-size: 1.3rem; margin: 2px 0 2px; }
.save-state { font-size: .78rem; color: #b8c3ea; display: inline-flex; align-items: center; gap: 6px; }
.save-state .dot { width: 8px; height: 8px; border-radius: 50%; background: #5ad19a; }
.save-state.saving .dot { background: var(--yellow-500); animation: pulse 1s infinite; }
.save-state.error .dot { background: #ff6b5e; }
.save-state.offline .dot { background: #ff9d3b; }
@keyframes pulse { 50% { opacity: .3; } }

.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 16px; }
.stepper a {
  display: flex; flex-direction: column; gap: 6px; color: #b8c3ea; font-size: .72rem; font-weight: 700; text-decoration: none;
}
.stepper .bar { height: 8px; border-radius: 3px; background: rgba(255,255,255,.16); clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.stepper a.done .bar { background: var(--wing-500); }
.stepper a.current .bar { background: var(--yellow-500); }
.stepper a.current { color: #fff; }
@media (max-width: 560px) { .stepper span.lbl { display: none; } .stepper a.current span.lbl { display: inline; position: absolute; } }

.wizard-nav {
  position: sticky; bottom: 0; z-index: 30; display: flex; gap: 10px; padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.wizard-nav .btn { flex: 1; }
@media (max-width: 960px) { .wizard-nav { bottom: 0; } body.has-wizard .bottom-nav { display: none; } body.has-wizard .content { padding-bottom: 24px; } }

/* Escolha em blocos grandes (tipo de visita, base) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { position: relative; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile label {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; min-height: 72px; justify-content: center; border-radius: 14px;
  border: 2px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 800; transition: all .15s;
}
.tile label small { font-weight: 600; color: var(--text-2); font-size: .78rem; }
.tile label:hover { border-color: var(--wing-500); }
.tile input:checked + label { border-color: var(--navy-800); background: var(--navy-800); color: #fff; box-shadow: inset -8px 0 0 var(--yellow-500); }
.tile input:checked + label small { color: #cdd3ea; }
.tile input:focus-visible + label { outline: 3px solid var(--yellow-500); outline-offset: 2px; }
.tile .code { font-family: var(--mono); font-size: 1.2rem; }

/* Item do checklist */
.check-item { padding: 0; overflow: hidden; scroll-margin-top: 80px; }
.check-item .ci-head { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 16px 18px 12px; align-items: start; }
.check-item .ci-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--navy-50); color: var(--navy-800); border: 2px solid var(--border);
  display: grid; place-items: center; font-weight: 800; font-family: var(--mono); transition: all .2s;
}
.check-item[data-status="conforme"] .ci-num { background: var(--ok-600); border-color: var(--ok-600); color: #fff; }
.check-item[data-status="nao_conforme"] .ci-num { background: var(--nc-600); border-color: var(--nc-600); color: #fff; }
.check-item[data-status="na"] .ci-num { background: var(--na-600); border-color: var(--na-600); color: #fff; }
.check-item[data-status="nao_conforme"] { border-color: #f1b8b2; box-shadow: 0 0 0 3px var(--nc-100); }
.check-item .ci-title { font-weight: 800; font-size: 1.02rem; line-height: 1.3; }
.check-item .ci-guide { font-size: .82rem; color: var(--text-2); margin-top: 4px; }
.status-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 18px 14px; }
.status-btn {
  min-height: var(--tap); border-radius: 12px; border: 2px solid var(--border); background: var(--surface); cursor: pointer;
  font: 800 .88rem var(--font); color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .12s;
}
.status-btn svg { width: 20px; height: 20px; }
.status-btn:hover { border-color: var(--border-strong); }
.status-btn.s-conforme[aria-pressed="true"] { background: var(--ok-600); border-color: var(--ok-600); color: #fff; }
.status-btn.s-nao_conforme[aria-pressed="true"] { background: var(--nc-600); border-color: var(--nc-600); color: #fff; }
.status-btn.s-na[aria-pressed="true"] { background: var(--na-600); border-color: var(--na-600); color: #fff; }
@media (max-width: 420px) { .status-btn .full { display: none; } }
@media (min-width: 421px) { .status-btn .short { display: none; } }
.ci-extra { padding: 14px 18px 18px; border-top: 1px dashed var(--border); background: var(--surface-2); display: flex; flex-direction: column; gap: 12px; }
.ci-progress { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 8px 0 10px; }
@media (max-width: 960px) { .ci-progress { top: 60px; } }
.progress { height: 10px; background: var(--navy-100); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--wing-500), var(--wing-600)); border-radius: 99px; transition: width .3s; }

/* Fotos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.photo {
  position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--navy-100); border: 1px solid var(--border);
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .rm {
  position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(13,22,64,.75); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.photo .rm svg { width: 16px; height: 16px; }
.photo.uploading::after {
  content: attr(data-progress); position: absolute; inset: 0; display: grid; place-items: center; background: rgba(13,22,64,.55); color: #fff; font-weight: 800; font-size: .85rem;
}
.add-photo {
  aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--border-strong); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--wing-600); font-weight: 800; font-size: .78rem; cursor: pointer; background: var(--surface); text-align: center; padding: 6px;
}
.add-photo:hover { border-color: var(--wing-500); background: var(--wing-100); }
.add-photo svg { width: 26px; height: 26px; }
.add-photo input { display: none; }
.need { color: var(--nc-600); font-size: .78rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }

/* Assinatura */
.sig-box { border: 2px solid var(--border-strong); border-radius: 14px; background: #fff; position: relative; overflow: hidden; touch-action: none; }
.sig-box canvas { width: 100%; height: 200px; display: block; cursor: crosshair; }
.sig-box .baseline { position: absolute; left: 24px; right: 24px; bottom: 46px; border-bottom: 2px dashed var(--border-strong); pointer-events: none; }
.sig-box .ph { position: absolute; left: 24px; bottom: 16px; font-size: .78rem; color: var(--text-3); pointer-events: none; font-weight: 600; }
.sig-box.signed .ph { display: none; }
.sig-box img { width: 100%; height: 200px; object-fit: contain; }
.sig-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

.media-drop {
  border: 2px dashed var(--border-strong); border-radius: 16px; padding: 22px; text-align: center; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.media-drop svg.big { width: 44px; height: 44px; color: var(--wing-500); }
.media-drop video { border-radius: 12px; max-height: 360px; width: 100%; background: #000; }
.upload-bar { width: 100%; height: 8px; background: var(--navy-100); border-radius: 99px; overflow: hidden; }
.upload-bar span { display: block; height: 100%; background: var(--wing-500); transition: width .2s; }

.issues { display: flex; flex-direction: column; gap: 8px; }
.issue { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--nc-100); color: #8f1f17; font-weight: 600; font-size: .9rem; }
.issue a { margin-left: auto; font-weight: 800; white-space: nowrap; }
.ready {
  text-align: center; padding: 28px 18px; border-radius: var(--radius-lg); background: var(--ok-100); color: #0c5c34;
}
.ready svg { width: 56px; height: 56px; margin: 0 auto 8px; }

/* Resumo/visualização */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px 20px; }
.dl dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 800; }
.dl dd { margin: 2px 0 0; font-weight: 700; }
.item-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); align-items: start; }
.item-row:last-child { border-bottom: 0; }
.item-row .n { font-family: var(--mono); font-weight: 700; color: var(--text-3); padding-top: 2px; }
.item-row .photos { margin-top: 10px; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
.sig-view { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: #fff; }
.sig-view img { height: 110px; width: 100%; object-fit: contain; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; font-size: .86rem; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--wing-500); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }

/* --------------------------------------------------------------- Modal & lightbox */
.modal-backdrop { position: fixed; inset: 0; background: rgba(13,22,64,.55); z-index: 80; display: grid; place-items: center; padding: 16px; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: var(--radius-lg); width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); animation: toast-in .25s ease; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; background: var(--surface); }
.lightbox { position: fixed; inset: 0; background: rgba(5,10,30,.92); z-index: 90; display: grid; place-items: center; padding: 20px; }
.lightbox img { max-height: 88vh; border-radius: 10px; }
.lightbox .icon-btn { position: absolute; top: 16px; right: 16px; color: #fff; background: rgba(255,255,255,.12); }

/* --------------------------------------------------------------- Login / install */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.auth-art {
  background: var(--navy-900); color: #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 40px;
  background-image: radial-gradient(circle at 85% 15%, rgba(30,127,216,.5), transparent 45%);
}
.auth-art > * { position: relative; z-index: 1; }
.auth-art h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.12; max-width: 14ch; font-weight: 800; }
.auth-art h2 em { font-style: normal; color: var(--yellow-500); }
.auth-art .scene { position: absolute; left: 0; right: 0; bottom: 70px; height: 220px; opacity: .95; }
.auth-art .facts { display: flex; gap: 22px; font-size: .82rem; color: #b8c3ea; font-weight: 600; flex-wrap: wrap; position: relative; }
.auth-art .facts b { display: block; color: #fff; font-size: 1.3rem; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-form form { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; }
.auth-form .logo { width: 72px; height: 72px; border-radius: 50%; margin-bottom: 4px; }
@media (max-width: 900px) { .auth-page { grid-template-columns: 1fr; } .auth-art { display: none; } }
.install { max-width: 880px; margin: 0 auto; padding: 32px 16px 60px; }
.req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.req-list li { display: flex; gap: 10px; align-items: center; font-size: .9rem; font-weight: 600; }
.req-list .ok { color: var(--ok-600); } .req-list .bad { color: var(--warn-600); }
.req-list svg { width: 18px; height: 18px; flex: none; }

/* --------------------------------------------------------------- Migrations console */
.console {
  background: var(--navy-950); color: #d6ddff; font-family: var(--mono); font-size: .82rem; border-radius: 12px; padding: 16px; line-height: 1.7;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow-x: hidden; overflow-y: auto;
}
@media (max-width: 960px) { .console { max-height: none; } }
.console .ok { color: #7be2a9; } .console .err { color: #ff8b80; } .console .muted { color: #8a95c7; }

/* --------------------------------------------------------------- Tabs */
/* Sem overflow: as abas quebram linha em vez de rolar. O indicador é uma sombra
   interna (não ultrapassa a caixa, então não cria barra de rolagem vertical). */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 18px; }
.tabs button , .tabs a {
  padding: 12px 16px; background: none; border: 0; border-radius: 10px 10px 0 0; font: 700 .9rem var(--font); color: var(--text-2);
  cursor: pointer; box-shadow: inset 0 -3px 0 transparent; transition: color .15s, box-shadow .15s, background .15s;
}
.tabs button:hover , .tabs a:hover { color: var(--navy-800); background: var(--navy-50); }
.tabs button[aria-selected="true"] , .tabs a[aria-selected="true"] { color: var(--navy-800); box-shadow: inset 0 -3px 0 var(--yellow-500); }
@media (max-width: 960px) {
  /* Celular/tablet: grade de botões em pílula, cada aba visível sem rolar. */
  .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; border-bottom: 0; padding: 4px; background: var(--navy-100); border-radius: 14px; }
  .tabs button , .tabs a { border-radius: 10px; padding: 10px 8px; font-size: .84rem; line-height: 1.25; text-align: center; white-space: normal; box-shadow: none; }
  .tabs button:hover , .tabs a:hover { background: rgba(255,255,255,.6); }
  .tabs button[aria-selected="true"] , .tabs a[aria-selected="true"] { background: var(--surface); color: var(--navy-900); box-shadow: inset 0 -3px 0 var(--yellow-500), var(--shadow-sm); }
}

/* --------------------------------------------------------------- Splash */
.splash {
  position: fixed; inset: 0; z-index: 200; background: var(--navy-900); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden; transition: opacity .6s ease, visibility .6s;
  background-image: radial-gradient(circle at 50% 38%, rgba(30,127,216,.35), transparent 55%);
}
.splash.hide { opacity: 0; visibility: hidden; }
.splash .logo-anim { width: 132px; height: 132px; margin-bottom: 18px; }
.splash .logo-anim .disc { transform-origin: 100px 100px; animation: disc-in .7s cubic-bezier(.2,.9,.3,1.3) both; }
.splash .logo-anim .r-top { animation: slide-r .65s .35s cubic-bezier(.2,.9,.3,1) both; }
.splash .logo-anim .r-leg { animation: slide-leg .6s .55s cubic-bezier(.2,.9,.3,1) both; }
.splash .logo-anim .wing { animation: wing-in .7s .8s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes disc-in { from { transform: scale(.2); opacity: 0; } }
@keyframes slide-r { from { transform: translateX(-80px); opacity: 0; } }
@keyframes slide-leg { from { transform: translate(40px, 60px); opacity: 0; } }
@keyframes wing-in { from { transform: translateX(140px) scaleX(.4); opacity: 0; } }
.splash .word { font-weight: 800; font-size: 1.35rem; letter-spacing: -.01em; animation: fade-up .5s 1.1s both; }
.splash .word span { color: var(--yellow-500); }
.splash .tag { font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: #9fb0e6; font-weight: 700; margin-top: 4px; animation: fade-up .5s 1.25s both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } }
.splash .apron { position: absolute; left: 0; right: 0; bottom: 0; height: 190px; }
.splash .apron svg { width: 100%; height: 100%; }
.splash .plane { animation: taxi 2.4s .2s cubic-bezier(.25,.8,.3,1) both; }
@keyframes taxi { from { transform: translateX(-950px); } }
/* Hélice vista de lado: a pá "pisca" no eixo vertical, como numa hélice girando */
.splash .prop { animation: prop .09s linear infinite; }
@keyframes prop { 50% { transform: scaleY(-1); } 25%, 75% { transform: scaleY(.15); } }
@keyframes spin { to { transform: rotate(360deg); } }
.splash .stairs { animation: dock 1.1s 2.2s cubic-bezier(.3,.8,.3,1) both; }
@keyframes dock { from { transform: translateX(-420px); } }
.splash .wheel { transform-box: fill-box; transform-origin: center; animation: roll 1.1s 2.2s linear both; }
@keyframes roll { from { transform: rotate(540deg); } }
.splash .dash { stroke-dasharray: 26 18; animation: runway 1s linear infinite; }
@keyframes runway { to { stroke-dashoffset: -44; } }
.splash .checks { display: flex; gap: 8px; margin-top: 22px; animation: fade-up .4s 1.4s both; }
.splash .checks i { width: 26px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); position: relative; overflow: hidden; }
.splash .checks i::after { content: ""; position: absolute; inset: 0; background: var(--yellow-500); transform: scaleX(0); transform-origin: left; animation: fill .35s both; }
.splash .checks i:nth-child(1)::after { animation-delay: 1.6s; } .splash .checks i:nth-child(2)::after { animation-delay: 1.8s; }
.splash .checks i:nth-child(3)::after { animation-delay: 2s; } .splash .checks i:nth-child(4)::after { animation-delay: 2.2s; }
.splash .checks i:nth-child(5)::after { animation-delay: 2.4s; background: var(--wing-500); }
@keyframes fill { to { transform: scaleX(1); } }
.splash .status-line { margin-top: 10px; font-size: .8rem; color: #b8c3ea; font-weight: 600; height: 1.2em; animation: fade-up .4s 1.4s both; }
.splash .skip { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,.1); color: #fff; border: 0; padding: 8px 14px; border-radius: 99px; font: 700 .8rem var(--font); cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .splash *, .splash { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

/* Loader em linha (mesmo motivo do splash) */
.loader-r { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(249,195,26,.3); border-top-color: var(--yellow-500); animation: spin .8s linear infinite; display: inline-block; }

/* --------------------------------------------------------------- Error page */
.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 20px; background: var(--navy-900); color: #fff; }
.error-page .code { font-family: var(--mono); font-size: 5rem; font-weight: 800; color: var(--yellow-500); line-height: 1; }
.error-page pre { text-align: left; background: rgba(0,0,0,.3); padding: 16px; border-radius: 10px; font-size: .75rem; max-width: 90vw; overflow: auto; }

/* Layouts em duas colunas que empilham no celular */
.split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.filters-dash { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.filters-dash .filters-actions { grid-column: auto; }
@media (max-width: 960px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .filters-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-dash .filters-actions { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .filters-dash { grid-template-columns: minmax(0, 1fr); }
}

/* Ajustes pós-revisão visual */
.tile label svg { width: 24px; height: 24px; margin-bottom: 2px; }
.wizard-head::after { right: -18px; bottom: -40px; width: 44px; height: 120px; opacity: .85; }
.wizard-head .row:first-child { padding-right: 34px; }
@media (max-width: 560px) {
  .stepper span.lbl, .stepper a.current span.lbl { display: none; }
}

/* --------------------------------------------------------------- Operação (chamados, orçamentos, viagens) */
.t-gray { background: var(--na-100); color: var(--na-600); }
.t-blue { background: var(--wing-100); color: var(--wing-600); }
.t-navy { background: var(--navy-100); color: var(--navy-800); }
.t-warn { background: var(--warn-100); color: var(--warn-600); }
.t-ok { background: var(--ok-100); color: var(--ok-600); }
.t-nc { background: var(--nc-100); color: var(--nc-600); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.num, .table th.num { text-align: right; }
.flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 4px 0 18px; }
.flow > div { padding: 10px 12px 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: .78rem; font-weight: 750; color: var(--text-3); }
.flow > div::before { content: ""; display: block; height: 6px; border-radius: 3px; margin-bottom: 8px; background: var(--border); clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.flow > div.done { color: var(--text-2); }
.flow > div.done::before { background: var(--wing-500); }
.flow > div.current { color: var(--navy-900); border-color: var(--yellow-500); box-shadow: 0 0 0 2px var(--yellow-100); }
.flow > div.current::before { background: var(--yellow-500); }
.flow small { display: block; font-weight: 600; color: var(--text-3); margin-top: 2px; }
@media (max-width: 720px) { .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.action-list { display: flex; flex-direction: column; }
.action-list > a, .action-list > div { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); color: inherit; }
.action-list > :last-child { border-bottom: 0; }
.action-list > a:hover { background: var(--navy-50); text-decoration: none; }
.action-list .grow { flex: 1; min-width: 0; }
.action-list .grow strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-list .when { font-size: .78rem; font-weight: 750; white-space: nowrap; }
.when.late { color: var(--nc-600); }
.when.soon { color: var(--warn-600); }
.count-pill { margin-left: auto; min-width: 26px; text-align: center; padding: 1px 9px; border-radius: 99px; font-size: .78rem; font-weight: 800; background: var(--navy-50); color: var(--navy-800); }
.count-pill.hot { background: var(--nc-100); color: var(--nc-600); }
.email-box { white-space: pre-wrap; font-size: .88rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; max-height: 360px; overflow: auto; }
.items-editor .input, .items-editor .select { min-height: 40px; padding: 6px 10px; font-size: .88rem; }
.items-editor td { vertical-align: middle; }
.items-editor .w-num { width: 92px; }
.items-editor .w-money { width: 130px; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; font-variant-numeric: tabular-nums; }
.totals .grand { font-size: 1.25rem; font-weight: 800; color: var(--navy-900); border-top: 2px solid var(--navy-800); padding-top: 8px; }
.bulkbar { position: sticky; bottom: 12px; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: var(--navy-900); color: #fff; box-shadow: var(--shadow-lg); margin-top: 12px; }
@media (max-width: 960px) { .bulkbar { bottom: 84px; } }
.bar-h { height: 8px; border-radius: 99px; background: var(--navy-50); overflow: hidden; }
.bar-h > span { display: block; height: 100%; background: var(--wing-500); border-radius: 99px; }
.neg { color: var(--nc-600); }
.pos { color: var(--ok-600); }
.btn.is-disabled { opacity: .5; pointer-events: none; }
.tabs a, .tabs a:hover { text-decoration: none; }

/* --------------------------------------------------------------- Caixa de entrada */
.inbox-row { align-items: flex-start !important; }
.inbox-row.is-pending { box-shadow: inset 3px 0 0 var(--yellow-500); }
.inbox-check { width: 20px; height: 20px; margin-top: 4px; flex: none; accent-color: var(--wing-500); }
.inbox-row .when { margin-top: 2px; }
@media (max-width: 720px) { .inbox-row { flex-wrap: wrap; } .inbox-row .when { order: -1; width: 100%; padding-left: 32px; } }
.mail-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .88rem; }
.mail-head dt { color: var(--text-3); font-weight: 750; }
.mail-head dd { margin: 0; overflow-wrap: anywhere; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.att-grid a { display: block; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); color: inherit; text-decoration: none; }
.att-grid img { display: block; width: 100%; height: 100px; object-fit: cover; }
.att-grid .att-file { height: 100px; display: grid; place-items: center; color: var(--text-3); }
.att-grid .att-file svg { width: 34px; height: 34px; }
.att-grid span { display: block; padding: 6px 8px; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detected { background: var(--yellow-100); border: 1px dashed var(--yellow-700); border-radius: 10px; padding: 10px 12px; font-size: .85rem; }
.triage-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; padding: 4px; background: var(--navy-50); border-radius: 12px; margin-bottom: 14px; }
.triage-tabs button { border: 0; background: none; border-radius: 9px; padding: 10px 6px; font: 750 .85rem var(--font); color: var(--text-2); cursor: pointer; }
.triage-tabs button[aria-selected="true"] { background: var(--surface); color: var(--navy-900); box-shadow: var(--shadow-sm), inset 0 -3px 0 var(--yellow-500); }

/* Ícone sem tamanho definido pelo contexto: acompanha o texto em vez de ocupar a largura toda. */
:where(svg[aria-hidden="true"]) { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
