/* Painel de Emissão — claro; só a barra lateral e a navbar são escuras. Fonte: Inter. */
:root {
  color-scheme: light;
  --brand: #0E6B45;        /* verde de placa de rodovia */
  --brand-600: #0B5A3A;
  --brand-50: #E9F5EF;
  --brand-ring: rgba(14, 107, 69, .18);
  --chrome: #151B23;       /* sidebar e navbar */
  --chrome-2: #1F2732;
  --chrome-line: rgba(255, 255, 255, .08);
  --chrome-ink: #E7ECF1;
  --chrome-mute: #8D99A6;
  --bg: #F5F7F9;
  --surface: #FFFFFF;
  --ink: #111827;
  --ink-2: #5B6472;
  --ink-3: #8A93A0;
  --line: #E4E8ED;
  --line-2: #EFF2F5;
  --amber: #B7791F; --amber-bg: #FFF6E6; --amber-line: #F3D9A6;
  --red: #C0392B;   --red-bg: #FDECEA;   --red-line: #F3C3BD;
  --blue: #2563EB;  --blue-bg: #EBF2FF;
  --ok: #0E6B45;    --ok-bg: #E9F5EF;    --ok-line: #BFE0CE;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.num, .money { font-variant-numeric: tabular-nums; }
.ico { width: 18px; height: 18px; flex: none; }
code { font: 600 14px ui-monospace, "SF Mono", Menlo, monospace; background: var(--bg); border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; }

/* ================================================================ estrutura */
body.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--chrome) 252px, var(--bg) 252px); }
.side { background: var(--chrome); color: var(--chrome-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 0 12px 16px; border-right: 1px solid #0b0f14; }
.brand { display: flex; align-items: center; gap: 11px; height: 64px; padding: 0 8px; margin-bottom: 8px; border-bottom: 1px solid var(--chrome-line); color: #fff; }
.brand:hover { text-decoration: none; }
.brand-t b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-t small { display: block; color: var(--chrome-mute); font-size: 12px; margin-top: -1px; }
.mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: #fff; }
.mark .ico { width: 19px; height: 19px; }
.mark.lg { width: 42px; height: 42px; border-radius: 11px; }
.mark.lg .ico { width: 23px; height: 23px; }
.side nav { display: grid; gap: 2px; }
.nav-h { display: block; padding: 16px 10px 6px; color: var(--chrome-mute); font-size: 12px; font-weight: 500; }
.side nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 8px; color: #C3CBD4; font-weight: 500; }
.side nav a .ico { width: 17px; height: 17px; color: var(--chrome-mute); }
.side nav a:hover { background: var(--chrome-2); color: #fff; text-decoration: none; }
.side nav a.on { background: var(--chrome-2); color: #fff; }
.side nav a.on .ico { color: #4ADE80; }
.side-foot { margin: auto 10px 0; color: #5F6B78; font-size: 12px; }

.shell { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 28px; background: var(--chrome); color: var(--chrome-ink); border-bottom: 1px solid #0b0f14; }
.nav-toggle { display: none; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 8px; background: none; color: #fff; cursor: pointer; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.crumbs a { color: var(--chrome-mute); }
.crumbs a:hover { color: #fff; text-decoration: none; }
.crumbs .sep { color: #4B5562; }
.crumbs .cur { color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px; border-radius: 10px; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { background: var(--chrome-2); }
.um-t b { display: block; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2; }
.um-t small { color: var(--chrome-mute); font-size: 12px; }
.um-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 24, 40, .14); }
.um-pop a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; color: var(--ink); font-weight: 500; }
.um-pop a:hover { background: var(--bg); text-decoration: none; }
.um-pop .ico { width: 16px; height: 16px; color: var(--ink-2); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 600; font-size: 13px; flex: none; }
.avatar.sm { width: 32px; height: 32px; }
.main { width: 100%; max-width: 1280px; padding: 28px 28px 64px; }

/* ================================================================ cabeçalho de página */
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ph h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.ph p { margin: 4px 0 0; max-width: 70ch; }

/* ================================================================ botões e campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 14px var(--font); cursor: pointer; white-space: nowrap; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.btn:hover { background: #F9FAFB; text-decoration: none; }
.btn .ico { width: 16px; height: 16px; }
.b-pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.b-pri:hover { background: var(--brand-600); border-color: var(--brand-600); }
.b-top { height: 36px; }
.b-lg { height: 44px; font-size: 15px; }
.b-full { width: 100%; }
.b-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: progress; }
.fld { display: block; margin-bottom: 16px; }
.fld > span { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; color: #344054; }
input, textarea, select { width: 100%; padding: 9px 12px; border: 1px solid #D0D5DD; border-radius: 8px; background: #fff; color: var(--ink); font: 400 14px var(--font); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
textarea { line-height: 1.6; resize: vertical; min-height: 230px; }
select.sel { width: auto; padding: 6px 30px 6px 10px; font-size: 13px; }

/* ================================================================ avisos e status */
.note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; font-weight: 500; }
.note .ico { margin-top: 1px; }
.n-ok { background: var(--ok-bg); border-color: var(--ok-line); color: #0A4D32; }
.n-err { background: var(--red-bg); border-color: var(--red-line); color: #8C2A20; }
.n-warn { background: var(--amber-bg); border-color: var(--amber-line); color: #7A4F0E; }
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.s-warn { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-line); }
.s-err { background: var(--red-bg); color: var(--red); border-color: var(--red-line); }
.s-info { background: var(--blue-bg); color: var(--blue); border-color: #C7D8FB; }
.s-info i { animation: blink 1.2s ease-in-out infinite; }
.s-mute { background: #F2F4F7; color: var(--ink-2); border-color: var(--line); }
.dotlabel { display: inline-flex; align-items: center; gap: 7px; }
.dotlabel::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.dotlabel.ok { color: var(--ok); font-weight: 500; }
.dotlabel.ok::before { background: var(--ok); }
.dotlabel.mute { color: var(--ink-2); }

/* ================================================================ painéis e tabelas */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.panel.narrow { max-width: 440px; }
.panel h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-2); padding: 10px 16px; background: #F9FAFB; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td small { display: block; font-size: 12.5px; margin-top: 2px; color: var(--ink-2); }
.tbl .r { text-align: right; }
.tbl tr.off td { opacity: .5; }
.panel:not(.flush) .tbl { margin: 0 -20px -20px; width: calc(100% + 40px); }
.panel:not(.flush) .tbl th { padding: 10px 20px; }
.panel:not(.flush) .tbl td { padding: 12px 20px; }
.tbl.rows tbody tr { cursor: pointer; transition: background .12s; }
.tbl.rows tbody tr:hover td { background: #F9FAFB; }
.tbl.rows td b { font-weight: 600; }
.rowacts { display: inline-flex; gap: 6px; }
.person { display: flex; align-items: center; gap: 10px; }
.person b { display: block; font-weight: 600; }

/* ================================================================ indicadores */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); box-shadow: var(--shadow); }
.kpi span { display: block; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.kpi b { display: block; margin-top: 6px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
a.kpi:hover { border-color: #CDD3DA; text-decoration: none; }
.kpi.k-warn { border-color: var(--amber-line); background: linear-gradient(var(--amber-bg), #fff 70%); }
.kpi.k-warn b { color: var(--amber); }
.filter { margin: -6px 0 12px; color: var(--ink-2); }
.empty { text-align: center; padding: 64px 20px; }
.empty b { display: block; font-size: 16px; font-weight: 600; margin: 14px 0 4px; }
.empty p { margin: 0 auto 20px; max-width: 46ch; }
.empty-ico { width: 40px; height: 40px; padding: 9px; box-sizing: content-box; border-radius: 12px; background: var(--brand-50); color: var(--brand); }

/* ================================================================ placa Mercosul */
.plate { display: inline-flex; flex-direction: column; align-items: center; min-width: 76px; padding-bottom: 2px; border: 1.5px solid #1F2937; border-radius: 4px; background: #fff; color: #111827; font: 700 13.5px/1.15 var(--font); letter-spacing: .06em; overflow: hidden; vertical-align: middle; }
.plate b { display: block; width: 100%; margin-bottom: 1px; background: #1E4FA3; color: #fff; font-size: 7px; font-weight: 600; line-height: 1.6; letter-spacing: .16em; text-align: center; }
.tbl .plate { margin-top: 5px; }
.plates { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ================================================================ detalhe: etapas */
.steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 0 20px; padding: 18px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-3); text-align: center; }
.steps li::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.steps li:first-child::before { display: none; }
.steps .dot { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-3); }
.steps .dot .ico { width: 14px; height: 14px; stroke-width: 2.5; }
.steps li.done { color: var(--ink-2); }
.steps li.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.steps li.done::before, .steps li.now::before { background: var(--brand); }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.now .dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.steps li.fail .dot { border-color: var(--red); color: var(--red); }

/* ================================================================ detalhe: viagem */
.trip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.trip-route { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 1.2fr) minmax(0, 1fr); align-items: center; gap: 20px; padding: 24px; }
.tr-end small { display: block; color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.tr-end b { display: block; margin-top: 2px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.tr-end .uf { display: inline-block; margin-top: 8px; padding: 1px 7px; border-radius: 5px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.tr-end.r { text-align: right; }
.tr-line { display: flex; align-items: center; gap: 10px; color: var(--brand); }
.tr-line i { flex: 1; height: 0; border-top: 2px dashed #9FCFB6; }
.tr-truck { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-50); }
.tr-truck .ico { width: 21px; height: 21px; }
.trip-meta { display: grid; grid-template-columns: 1.4fr 1.3fr .8fr 1fr; margin: 0; border-top: 1px solid var(--line-2); background: #FAFBFC; }
.trip-meta > div { padding: 14px 24px; border-left: 1px solid var(--line-2); }
.trip-meta > div:first-child { border-left: 0; }
.trip-meta dt { color: var(--ink-2); font-size: 12.5px; font-weight: 500; margin-bottom: 4px; }
.trip-meta dd { margin: 0; font-weight: 600; }
.trip-meta .money { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }

/* ================================================================ detalhe: decisão */
.approve { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-radius: var(--radius); border: 1px solid var(--amber-line); background: var(--amber-bg); margin-bottom: 20px; flex-wrap: wrap; }
.approve > div { flex: 1; min-width: 220px; }
.approve b { display: block; font-size: 15px; font-weight: 600; }
.approve .muted { font-size: 13px; }
.approve form { margin: 0; }
.approve.a-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.approve.a-err { background: var(--red-bg); border-color: var(--red-line); }
.approve.a-warn input { flex: 1; min-width: 240px; width: auto; }
.cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols > div > .panel:last-child { margin-bottom: 0; }
.c-users { grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; margin: 0 0 16px; }
.facts > div { grid-column: span 3; }
.facts > .f3 { grid-column: span 1; }
.facts dt { color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.facts dd small { display: block; font-weight: 400; color: var(--ink-2); font-size: 13px; }
.file { display: flex; align-items: center; gap: 8px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line-2); color: var(--ink-2); font-size: 13px; word-break: break-all; }
.file .ico { width: 16px; height: 16px; }
.timeline { list-style: none; margin: 0; padding: 0; max-height: 640px; overflow: auto; }
.timeline li { position: relative; padding: 0 0 18px 22px; }
.timeline li::after { content: ""; position: absolute; left: 4px; top: 14px; bottom: -2px; width: 2px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #A6D3BC; }
.timeline li:first-child::before { background: var(--brand); border-color: var(--brand); }
.timeline time { font-size: 12px; color: var(--ink-3); }
.timeline p { margin: 2px 0 0; overflow-wrap: anywhere; }
.timeline details { margin-top: 4px; }
.timeline summary { cursor: pointer; color: var(--brand); font-size: 13px; font-weight: 500; }
.timeline details p { color: var(--ink-2); font-size: 13px; margin-top: 6px; }
.live { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; color: var(--blue); font-weight: 500; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ================================================================ nova viagem */
.newtrip { max-width: 860px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.step h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.step h2 .n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-size: 12px; font-weight: 700; }
.step > p { margin: 0 0 14px 34px; }
.step > .clients, .step > textarea, .step > .drop { margin-top: 14px; }
.clients { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.client { position: relative; display: block; padding: 14px 16px 14px 46px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.client input { position: absolute; left: 16px; top: 16px; width: 18px; height: 18px; margin: 0; padding: 0; box-shadow: none; accent-color: var(--brand); }
.client:hover { border-color: #C7CED6; }
.client:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.cl-name { display: block; font-weight: 600; font-size: 15px; }
.cl-hint { display: block; color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 20px; border: 1.5px dashed #C7CED6; border-radius: 10px; text-align: center; cursor: pointer; background: #FAFBFC; transition: border-color .12s, background .12s; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-50); }
.drop.has { border-style: solid; border-color: var(--brand); background: var(--brand-50); }
.drop-ico { width: 22px; height: 22px; padding: 9px; box-sizing: content-box; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: var(--brand); }
.drop-t { font-weight: 600; }
.formbar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ================================================================ login (claro) */
body.guest .main { max-width: none; padding: 0; }
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px;
  background: radial-gradient(1200px 500px at 50% -10%, #E3F1EA, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: 0 12px 32px rgba(16, 24, 40, .08); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-brand b { display: block; font-size: 15px; font-weight: 700; }
.login-brand small { color: var(--ink-2); font-size: 13px; }
.login-card h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.login-card > p { margin: 4px 0 24px; }
.login-foot { margin: 20px 0 0; color: var(--ink-3); font-size: 13px; }

/* ================================================================ responsivo */
@media (max-width: 1120px) {
  .cols { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trip-meta { grid-template-columns: 1fr 1fr; }
  .trip-meta > div:nth-child(3) { border-left: 0; }
  .trip-meta > div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
}
@media (max-width: 860px) {
  body.app { display: block; background: var(--bg); }
  .side { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(10, 14, 20, .5); }
  .nav-toggle { display: grid; }
  .topbar { padding: 0 12px; height: 58px; }
  .um-t, .b-top span { display: none; }
  .b-top { width: 38px; padding: 0; }
  .main { padding: 20px 16px 48px; }
  .ph h1 { font-size: 20px; }
  .kpis { gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi b { font-size: 21px; }
  .steps { padding: 14px 4px; }
  .steps li { font-size: 0; gap: 0; }
  .trip-route { grid-template-columns: 1fr; gap: 10px; padding: 18px; }
  .tr-end.r { text-align: left; }
  .tr-line { padding: 2px 0; }
  .trip-meta > div { padding: 12px 18px; }
  .clients { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts > div { grid-column: span 2; } .facts > .f3 { grid-column: span 1; }
  .c-users { grid-template-columns: 1fr; }
  .approve { flex-direction: column; align-items: stretch; }
  .approve form, .approve .btn { width: 100%; }
  .approve form:has(.b-pri) { order: -1; }
  .approve > div { order: -2; }
  .login-card { padding: 24px; }
  /* lista vira cartões */
  .tbl.rows thead { display: none; }
  .tbl.rows tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
  .tbl.rows td { padding: 0; border: 0; }
  .tbl.rows td:nth-child(1), .tbl.rows td:nth-child(4), .tbl.rows td:nth-child(6) { display: none; }
  .tbl.rows td:nth-child(2) { grid-column: 1; }
  .tbl.rows td:nth-child(5) { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; }
  .tbl.rows td:nth-child(3) { grid-column: 1; }
  .tbl.rows td:nth-child(7) { grid-column: 2; grid-row: 2 / span 2; align-self: end; text-align: right; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ================================================================ nova viagem: fichas */
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; scroll-margin-top: 84px; }
.tcard.has-err { border-color: var(--red-line); }
.tc-head { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.tc-n { font-size: 15px; font-weight: 700; letter-spacing: -.01em; min-width: 74px; }
.tc-del { margin-left: auto; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--ink-3); cursor: pointer; }
.tc-del:hover { background: var(--red-bg); color: var(--red); }
.tc-err { margin: 14px 20px 0; padding: 10px 12px; border-radius: 8px; background: var(--red-bg); color: #8C2A20; font-weight: 500; }
.tc-body { padding: 18px 20px 20px; }
.seg { display: inline-flex; padding: 3px; gap: 3px; background: #F2F4F7; border: 1px solid var(--line); border-radius: 10px; position: relative; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 16px; border-radius: 7px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.seg span:hover { color: var(--ink); }
.seg input:checked + span { background: #fff; color: var(--brand); box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 0 0 1px var(--line); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }
.seg.bad { border-color: var(--red); }
.seg .ferr { position: absolute; top: 100%; left: 0; margin-top: 4px; white-space: nowrap; }
.paste { margin-bottom: 18px; }
.paste-open { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border: 1px dashed #B7DCC8; border-radius: 10px; background: var(--brand-50); color: var(--brand); font: 600 14px var(--font); cursor: pointer; text-align: left; }
.paste-open:hover { border-style: solid; }
.paste-open .ico { width: 17px; height: 17px; }
.tcard.filled .paste-open { border-style: solid; }
.paste-box textarea { min-height: 150px; }
.paste-acts { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.paste-msg { margin-right: auto; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.grid .g2 { grid-column: span 2; }
.fld > span em { font-style: normal; font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.fld.bad input, .fld.bad select { border-color: var(--red); box-shadow: 0 0 0 3px #C0392B1A; }
.ferr { display: block; margin-top: 5px; color: var(--red); font-size: 12.5px; font-weight: 500; }
input.up { text-transform: uppercase; letter-spacing: .04em; }
select:disabled { background: #F9FAFB; color: var(--ink-3); }
.only-jt { display: none; }
.tcard.is-jt .only-jt { display: block; }
.drop.sm { flex-direction: row; justify-content: flex-start; gap: 14px; padding: 14px 16px; text-align: left; margin-top: 2px; }
.drop.sm .drop-ico { width: 18px; height: 18px; padding: 8px; }
.drop.sm b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.drop.sm > span { min-width: 0; }
select { text-overflow: ellipsis; }
.main, .shell { min-width: 0; }
html, body { overflow-x: hidden; }
.drop.bad { border-color: var(--red); background: var(--red-bg); }
.drop .ferr { margin: 0 0 0 auto; }
.addtrip { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; margin-bottom: 96px; border: 1.5px dashed #C7CED6; border-radius: var(--radius); background: transparent; color: var(--ink-2); font: 600 14px var(--font); cursor: pointer; }
.addtrip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.sendbar { position: fixed; left: 252px; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 28px; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); backdrop-filter: blur(6px); }
.sb-sum { margin-right: auto; display: flex; flex-direction: column; line-height: 1.3; }
.sb-sum b { font-size: 15px; }
.sb-sum span { font-size: 13px; font-variant-numeric: tabular-nums; }
#trips { max-width: 980px; }
.addtrip { max-width: 980px; }
@media (max-width: 860px) {
  .sendbar { left: 0; padding: 10px 16px; }
  .sendbar .btn:not(.b-pri) { display: none; }
  .tc-head { flex-wrap: wrap; padding: 12px 16px; }
  .tc-body { padding: 16px; }
  .seg { order: 3; width: 100%; } .seg label { flex: 1; } .seg span { text-align: center; }
  .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid .g2 { grid-column: span 2; }
  .drop.sm { align-items: flex-start; }
  .drop.sm .ferr { display: none; }
  .grid .fld:has(select) { grid-column: span 2; }
}

/* ================================================================ nova viagem: modos e importação de planilha */
.modes { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px; background: #EEF1F4; border: 1px solid var(--line); border-radius: 11px; }
.mode { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: 600 14px var(--font); cursor: pointer; }
.mode .ico { width: 16px; height: 16px; }
.mode:hover { color: var(--ink); }
.mode.on { background: #fff; color: var(--brand); box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 0 0 1px var(--line); }
#m-planilha { max-width: 1180px; padding-bottom: 96px; }
.imp-acts { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; margin-top: 14px; }
.imp-acts > .btn { height: auto; min-height: 58px; }
.imp-drop { flex: 1; min-width: 260px; margin: 0 !important; }
.imp-msg { margin: 14px 0 0; }
.imp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.imp-head h2 { margin: 0; }
.imp-count { display: flex; gap: 6px; }
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; background: #F2F4F7; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.pill.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.pill.warn { background: var(--red-bg); border-color: var(--red-line); color: var(--red); }
.imp-table > p { margin: 6px 0 14px; }
.xt-wrap { overflow-x: auto; margin: 0 -22px -22px; border-top: 1px solid var(--line); }
.xt { width: 100%; min-width: 1060px; border-collapse: collapse; }
.xt th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-2); padding: 9px 8px; background: #F9FAFB; border-bottom: 1px solid var(--line); white-space: nowrap; }
.xt th:first-child, .xt td:first-child { padding-left: 22px; }
.xt th.r { text-align: right; }
.xt td { padding: 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.xt tbody tr:last-child td { border-bottom: 0; }
.xt input, .xt select { padding: 7px 9px; font-size: 13.5px; box-shadow: none; }
.xt input.r { text-align: right; }
.xt { min-width: 1180px; }
.xt td:nth-child(2) { width: 96px; } .xt td:nth-child(3) { min-width: 230px; } .xt td:nth-child(4), .xt td:nth-child(5) { width: 108px; } .xt td:nth-child(8) { width: 120px; }
.xt td:nth-child(6), .xt td:nth-child(7) { min-width: 200px; }
.imp-start .imp-msg { margin-left: 0; }
.xt .xn { color: var(--ink-3); font-variant-numeric: tabular-nums; width: 44px; }
.xt .bad { border-color: var(--red); background: #FFF8F7; }
.xt tr.row-bad .xn { color: var(--red); font-weight: 700; }
.xt tr.row-bad td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.xt tr.row-ok td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.att { position: relative; display: inline-flex; align-items: center; gap: 6px; max-width: 170px; height: 34px; padding: 0 12px; border: 1px dashed #B7C0CA; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.att input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.att .ico { width: 15px; height: 15px; flex: none; }
.att span { overflow: hidden; text-overflow: ellipsis; }
.att:hover { border-color: var(--brand); color: var(--brand); }
.att.has { border-style: solid; border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.att.bad { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.xt .tc-del { margin: 0; }
@media (max-width: 860px) {
  .modes { display: flex; } .mode { flex: 1; justify-content: center; padding: 0 8px; }
  .xt-wrap { margin: 0 -16px -16px; }
  .imp-acts > .btn { width: 100%; min-height: 44px; }
}

/* ================================================================ v3 (25/11): sidebar nova, largura total, resumo à direita */
body.app { grid-template-columns: 240px minmax(0, 1fr); background: linear-gradient(90deg, var(--chrome) 240px, var(--bg) 240px); }
.side { padding: 0 14px 14px; gap: 6px; background: var(--chrome); border-right: 1px solid #0b0f14; }
.brand { height: 64px; margin: 0 -14px 10px; padding: 0 20px; border-bottom: 1px solid var(--chrome-line); }
.brand-t b { font-size: 16px; }
.side-cta { display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; margin: 6px 0 14px; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.side-cta:hover { background: #12814F; text-decoration: none; }
.side-cta .ico { width: 17px; height: 17px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 8px; color: #A9B4C0; font-weight: 500; }
.side-nav a .ico { width: 18px; height: 18px; color: #7C8896; }
.side-nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; text-decoration: none; }
.side-nav a.on { background: rgba(255, 255, 255, .08); color: #fff; }
.side-nav a.on .ico { color: #34D399; }
.side-nav a.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #34D399; }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--chrome-line); }
.su-t { flex: 1; min-width: 0; }
.su-t b { display: block; color: #fff; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-t small { color: var(--chrome-mute); font-size: 12px; }
.side-user a, .side-user .logout-f button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: #7C8896; background: none; border: 0; padding: 0; cursor: pointer; }
.side-user .logout-f { margin: 0; }
.side-user a:hover, .side-user .logout-f button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-user a .ico, .side-user .logout-f .ico { width: 17px; height: 17px; }
.top-date { color: var(--chrome-mute); font-size: 13px; }
.main { max-width: none; padding: 28px 32px 56px; }

/* nova viagem: formulário + resumo */
.nv { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.nv-main { min-width: 0; }
#trips, .addtrip, #m-planilha { max-width: none; }
.addtrip { margin-bottom: 0; }
#m-planilha { padding-bottom: 0; }
.sendbar { display: none; }
.nv-side { position: sticky; top: 88px; display: grid; gap: 16px; }
.sum { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.sum h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.sum-list { list-style: none; margin: 0 0 14px; padding: 0; max-height: 46vh; overflow: auto; }
.sum-list li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line-2); cursor: pointer; border-radius: 6px; }
.sum-list li:hover { background: #F9FAFB; }
.sum-list li:last-child { border-bottom: 0; }
.si { width: 8px; height: 8px; border-radius: 50%; background: #F59E0B; flex: none; }
.sum-list li.ok .si { background: var(--brand); }
.st { flex: 1; min-width: 0; }
.st b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st small { color: var(--ink-2); font-size: 12px; }
.sum-list li.ok small { color: var(--ok); }
.sv { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum-tot { display: grid; gap: 6px; margin: 0 0 16px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.sum-tot > div { display: flex; justify-content: space-between; }
.sum-tot dt { color: var(--ink-2); }
.sum-tot dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.sum-tot > div:last-child dd { font-size: 18px; letter-spacing: -.01em; }
.sum .btn + .btn { margin-top: 8px; }
.b-ghost { border-color: transparent; box-shadow: none; color: var(--ink-2); }
.b-ghost:hover { background: #F2F4F7; }
.howto { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #FAFBFC; }
.howto h3 { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; }
.howto ol { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 4px; }
/* fichas: campos alinhados à esquerda e mais compactos */
.tc-body { padding: 18px 20px; }
.grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid .g2 { grid-column: span 2; }
.drop.sm { justify-content: flex-start; text-align: left; }
.ph { margin-bottom: 18px; }

@media (max-width: 1280px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .nv { grid-template-columns: 1fr; }
  .nv-side { position: fixed; left: 240px; right: 0; bottom: 0; top: auto; z-index: 20; display: block; }
  .nv-side .sum { display: flex; align-items: center; gap: 12px; border-radius: 0; border-width: 1px 0 0; padding: 10px 24px; box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); }
  .nv-side .sum h2, .nv-side .sum-list, .nv-side .howto, .nv-side .b-ghost { display: none; }
  .sum-tot { display: flex; gap: 20px; margin: 0 auto 0 0; padding: 0; border: 0; }
  .sum-tot > div { flex-direction: column; }
  .sum .btn { width: auto; }
  .nv-main { padding-bottom: 80px; }
}
@media (max-width: 860px) {
  body.app { background: var(--bg); }
  .nv-side { left: 0; }
  .nv-side .sum { padding: 10px 16px; }
  .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .top-date { display: none; }
  .main { padding: 20px 16px 48px; }
}
/* modo planilha: tabela em largura total, resumo vira barra fixa embaixo */
.nv.nv-wide { grid-template-columns: 1fr; }
.nv.nv-wide .nv-main { padding-bottom: 80px; }
.nv.nv-wide .nv-side { position: fixed; left: 240px; right: 0; bottom: 0; top: auto; z-index: 20; display: block; }
.nv.nv-wide .sum { display: flex; align-items: center; gap: 12px; border-radius: 0; border-width: 1px 0 0; padding: 12px 32px; box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); }
.nv.nv-wide .sum h2, .nv.nv-wide .sum-list, .nv.nv-wide .howto { display: none; }
.nv.nv-wide .sum-tot { display: flex; gap: 28px; margin: 0 auto 0 0; padding: 0; border: 0; }
.nv.nv-wide .sum-tot > div { flex-direction: column; }
.nv.nv-wide .sum .btn { width: auto; margin: 0; }
.nv.nv-wide .sum .b-ghost { order: -1; }
.xt { min-width: 1060px; }
.xt select[data-f=cliente] { min-width: 92px; }
.xt td:nth-child(3) { min-width: 210px; }
.xt td:nth-child(6), .xt td:nth-child(7) { min-width: 190px; }
@media (max-width: 860px) { .nv.nv-wide .nv-side { left: 0; } .nv.nv-wide .sum { padding: 10px 16px; } .nv.nv-wide .sum .b-ghost { display: none; } }
.seg input { width: 1px; height: 1px; padding: 0; margin: 0; left: 0; top: 0; }
.sum-tot dd { white-space: nowrap; } @media (max-width: 860px) { .sum-tot > div:first-child { display: none; } .sum-tot dd { font-size: 16px !important; } }

/* sidebar fixa (25/11): não rola junto com a página */
html, body { overflow-x: clip; }
@media (min-width: 861px) {
  body.app { display: block; padding-left: 240px; background: var(--bg); }
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: 240px; height: auto; overflow-y: auto; z-index: 30; }
  .shell { min-height: 100vh; }
  .nv-side { top: 88px; }
}
@media (min-width: 1101px) { .nv-side { max-height: calc(100vh - 104px); overflow-y: auto; } .sum-list { max-height: none; } .nv:not(.nv-wide) .nv-side .howto { display: none; } }
@media (min-width: 1101px) and (min-height: 900px) { .nv:not(.nv-wide) .nv-side .howto { display: block; } }

/* ================================================================ acompanhamento */
.ph-row { align-items: flex-end; }
.live-ind { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.live-ind .dot { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px #22C55E33; animation: blink 2s ease-in-out infinite; }
.live-ind.off .dot { background: var(--red); box-shadow: 0 0 0 3px #C0392B33; animation: none; }
.kpi-f .kpi { text-align: left; font: inherit; cursor: pointer; border: 1px solid var(--line); }
.kpi-f .kpi:hover { border-color: #CDD3DA; }
.kpi small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 12px; }
.kpi.k-err { border-color: var(--red-line); background: linear-gradient(var(--red-bg), #fff 70%); }
.kpi.k-err b { color: var(--red); }
.acomp { overflow: visible; }
.toolbar { display: flex; flex-direction: column; gap: 12px; padding: 14px 18px 0; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; overflow-x: auto; margin-bottom: -1px; scrollbar-width: none; }
.tabs button { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-2); font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabs i { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #F2F4F7; color: var(--ink-2); font-size: 11.5px; font-weight: 600; display: inline-grid; place-items: center; }
.tabs button.on i { background: var(--brand-50); color: var(--brand); }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; order: -1; }
.filters select { width: auto; min-width: 170px; }
.search { position: relative; flex: 1; min-width: 240px; max-width: 420px; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }
.search input { padding-left: 34px; }
#btnAll { margin-left: auto; }
.bulk { position: sticky; top: 64px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: #F0F7F3; border-bottom: 1px solid var(--ok-line); flex-wrap: wrap; }
.bulk-acts { margin-left: auto; display: flex; gap: 8px; }
.acomp .xt-wrap { margin: 0; border-top: 0; }
.acomp-t { min-width: 1040px; }
.acomp-t th, .acomp-t td { padding-left: 12px; padding-right: 12px; }
.acomp-t th:first-child, .acomp-t td:first-child { padding-left: 18px; }
.acomp-t th:last-child, .acomp-t td:last-child { padding-right: 18px; }
.acomp-t .ck { width: 36px; }
.acomp-t .ck input { width: 16px; height: 16px; padding: 0; box-shadow: none; accent-color: var(--brand); cursor: pointer; }
.acomp-t tbody tr { cursor: pointer; }
.acomp-t tbody tr:hover td { background: #F9FAFB; }
.acomp-t tbody tr.sel td { background: #F0F7F3; }
.acomp-t td b { font-weight: 600; }
.acomp-t .ret { max-width: 250px; }
.acomp-t .ret > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--ink); }
.acomp-t .ret-err > span { color: var(--red); font-weight: 500; }
.acomp-t .ret-warn > span { color: var(--amber); font-weight: 500; }
.acomp-t .acts { white-space: nowrap; }
.acomp-t .acts .btn { margin-left: 4px; }
.acomp-t .acts .btn .ico { width: 14px; height: 14px; }
.modal { width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 24px 64px rgba(16, 24, 40, .25); }
.modal::backdrop { background: rgba(15, 20, 26, .45); }
.modal form { padding: 22px 24px; }
.modal h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.modal > form > p.muted { margin: 0 0 12px; }
.dlg-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.dlg-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.dlg-list li:last-child { border-bottom: 0; }
.dlg-list small { display: block; color: var(--ink-2); font-size: 12.5px; }
.dlg-tot { display: flex; justify-content: space-between; padding: 12px 4px; font-size: 15px; }
.dlg-tot b { font-size: 18px; }
.modal .note { margin: 4px 0 16px; font-size: 13px; }
.dlg-acts { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 860px) {
  .ph-row { align-items: flex-start; }
  .kpi-f { grid-template-columns: 1fr 1fr; }
  .filters { flex-direction: column; align-items: stretch; }
  .search { max-width: none; }
  .filters select, #btnAll { width: 100%; margin: 0; }
  .bulk { top: 58px; }
  .bulk-acts { margin: 0; width: 100%; }
  .bulk-acts .btn { flex: 1; }
}
.acomp-t td.r.num { white-space: nowrap; } .acomp-t td:nth-child(3) { min-width: 170px; }
.bulk[hidden], .acomp .xt-wrap[hidden], .empty[hidden] { display: none !important; }
@media (max-width: 860px) {
  .acomp .xt-wrap { overflow: visible; }
  .acomp-t { min-width: 0; }
  .acomp-t thead tr { display: flex; align-items: center; padding: 8px 16px; }
  .acomp-t thead th { display: none; border: 0; background: none; padding: 0; }
  .acomp-t thead th.ck { display: block; width: auto; }
  .acomp-t thead th.ck::after { content: "Selecionar todas"; margin-left: 8px; font-size: 13px; color: var(--ink-2); vertical-align: 3px; }
  .acomp-t tbody tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
  .acomp-t tbody td { padding: 0 !important; border: 0; background: none !important; }
  .acomp-t td.ck { grid-row: 1 / span 4; padding-top: 2px !important; }
  .acomp-t td:nth-child(2) { display: none; }
  .acomp-t td:nth-child(3) { grid-column: 2; grid-row: 1; min-width: 0; }
  .acomp-t td:nth-child(6) { grid-column: 3; grid-row: 1; text-align: right; font-weight: 600; }
  .acomp-t td:nth-child(4) { grid-column: 2 / span 2; grid-row: 2; font-size: 13px; }
  .acomp-t td:nth-child(5), .acomp-t td:nth-child(7) { display: none; }
  .acomp-t td:nth-child(8) { grid-column: 2 / span 2; grid-row: 3; max-width: none; }
  .acomp-t td:nth-child(9) { grid-column: 2; grid-row: 4; align-self: center; }
  .acomp-t td:nth-child(10) { grid-column: 3; grid-row: 4; }
  .acomp-t tbody tr.sel { background: #F0F7F3; }
}
@media (max-width: 860px) {
  .acomp-t td:nth-child(9) { grid-column: 2 / span 2; grid-row: 4; }
  .acomp-t td:nth-child(10) { grid-column: 2 / span 2; grid-row: 5; text-align: left; margin-top: 4px; }
  .acomp-t td:nth-child(10) .btn:first-child { margin-left: 0; }
  .acomp-t td.ck { grid-row: 1 / span 5; }
}

/* ================================================================ início */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.hello h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.hello p { margin: 4px 0 0; }
.hello-acts { display: flex; gap: 10px; }
.kpis a.kpi small, .kpi small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 12px; }
.kpi.k-brand { background: linear-gradient(135deg, #0E6B45, #0B5A3A); border-color: #0B5A3A; color: #fff; }
.kpi.k-brand span, .kpi.k-brand small { color: #CDEBDD; }
.dash { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.p-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.p-head h2 { margin: 0; }
.p-head.pad { padding: 18px 20px 0; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; height: 230px; align-items: end; }
.bar { display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; gap: 6px; }
.bv { font-size: 11.5px; color: var(--ink-2); font-weight: 600; min-height: 16px; white-space: nowrap; }
.bc { display: flex; align-items: flex-end; justify-content: center; background: repeating-linear-gradient(to top, transparent 0 24.5%, var(--line-2) 24.5% 25%); border-radius: 8px; }
.bc i { display: block; width: 62%; max-width: 46px; border-radius: 7px 7px 3px 3px; background: #9FD3BA; transition: height .3s; }
.bar.today .bc i { background: var(--brand); }
.bl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-transform: capitalize; }
.bl small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11.5px; }
.bar.today .bl { color: var(--brand); }
.ok-state { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 10px; text-align: center; }
.ok-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); margin-bottom: 6px; }
.att-list { list-style: none; margin: 0; padding: 0; }
.att-list a { display: flex; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line-2); color: var(--ink); border-radius: 6px; }
.att-list a:hover { background: #FFF8F7; text-decoration: none; }
.att-ico { color: var(--red); flex: none; margin-top: 1px; }
.att-t { min-width: 0; }
.att-t b { display: block; font-size: 13.5px; }
.att-t small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--red); font-size: 12.5px; }
.mini-h { margin: 20px 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cli-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cli-bars li { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.cn { font-weight: 600; }
.cb { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.cb i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.cv { font-weight: 600; }
.feed { list-style: none; margin: 8px 0 0; padding: 0; }
.feed a { display: grid; grid-template-columns: minmax(0, 1fr) auto 190px; align-items: center; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--line-2); color: var(--ink); }
.feed a:hover { background: #F9FAFB; text-decoration: none; }
.feed .status { justify-self: start; }
.f-main b { display: block; font-weight: 600; }
.f-main small, .f-val small { display: block; color: var(--ink-2); font-size: 12.5px; }
.f-val { text-align: right; font-weight: 600; }
.approve.a-info { background: var(--blue-bg); border-color: #C7D8FB; }
.approve.a-info .live { margin: 0; }
.sum-warn { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 9px 10px; border-radius: 8px; background: var(--amber-bg); color: #7A4F0E; font-size: 12.5px; font-weight: 500; }
.sum-warn .ico { width: 14px; height: 14px; margin-top: 2px; }
@media (max-width: 1100px) { .dash { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .hello-acts { width: 100%; } .hello-acts .btn { flex: 1; }
  .bars { gap: 6px; height: 190px; } .bv { font-size: 10px; }
  .feed a { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 16px; }
  .feed .status { grid-column: 1 / -1; }
  .nv-side .sum-warn { display: none; }
}
.bars-empty { margin: -6px 0 6px; } .panel:has(.bars-empty) .bars { height: 180px; }

/* segurança: 2 etapas */
.otp { font-size: 22px !important; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.c-2fa { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 20px; align-items: start; }
.qr { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 10px 0; }
.qr svg { display: block; width: 220px; height: 220px; }
.secret { font-size: 15px; letter-spacing: .08em; word-break: break-all; }
@media (max-width: 860px) { .c-2fa { grid-template-columns: 1fr; } }

/* ================================================================
   v4 (25/11): design "soft-SaaS" — topo e moldura escuros, menu claro,
   conteúdo num painel arredondado; marca roxa #673de6, fonte DM Sans,
   neutros por preto translúcido, cantos 12/16/24, cards sem sombra.
   (Backup do antes: /home/deploy/backups/emissao-painel-antes-design-*.tar.gz)
   ================================================================ */
:root {
  --brand: #673de6;
  --brand-600: #471ea7;
  --brand-50: #f2f0ff;
  --brand-ring: rgba(123, 102, 255, .28);
  --accent: #7b66ff;
  --chrome: #18181a;
  --chrome-2: rgba(255, 255, 255, .08);
  --chrome-line: rgba(255, 255, 255, .10);
  --chrome-ink: #f8f9fa;
  --chrome-mute: #9d9ea4;
  --side-bg: #e9e9ec;
  --bg: #f5f5f6;
  --surface: #fff;
  --ink: #18181a;
  --ink-2: #58585e;
  --ink-3: #9d9ea4;
  --line: rgba(0, 0, 0, .10);
  --line-2: rgba(0, 0, 0, .06);
  --hover: rgba(0, 0, 0, .05);
  --amber: #9b4600; --amber-bg: #fcf0d9; --amber-line: #ffe399;
  --red: #be1025;   --red-bg: #fdebec;   --red-line: #ffd5d3;
  --blue: #3c5ae6;  --blue-bg: #edf2ff;
  --ok: #007a49;    --ok-bg: #e6f5ee;    --ok-line: #b8f1c9;
  --shadow: none;
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, .15);
  --radius: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "DM Sans", Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --side-w: 260px;
}
body { font-feature-settings: normal; }
code { font-family: "DM Mono", ui-monospace, Menlo, monospace; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a:hover { text-decoration: none; color: var(--brand-600); }

/* ---------- moldura ---------- */
@media (min-width: 861px) {
  body.app { padding-left: calc(var(--side-w) + 8px); padding-right: 8px; background: var(--chrome); }
  .side { top: 64px; left: 8px; bottom: 0; width: var(--side-w); border-radius: 24px 0 0 0; }
  .side .brand { position: fixed; top: 0; left: 8px; width: var(--side-w); height: 64px; margin: 0; padding: 0 12px; border: 0; color: #fff; z-index: 31; background: var(--chrome); }
  .main { border-radius: 0 24px 0 0; min-height: calc(100vh - 64px); }
  .nv-side { top: 88px; }
  .nv.nv-wide .nv-side { left: calc(var(--side-w) + 8px); right: 8px; }
}
@media (min-width: 861px) and (max-width: 1100px) { .nv-side { left: calc(var(--side-w) + 8px); right: 8px; } }
.shell { background: transparent; }
.main { background: var(--bg); padding: 32px 32px 56px; }

/* ---------- topo ---------- */
.topbar { background: var(--chrome); color: var(--chrome-ink); border-bottom: 0; padding: 0 16px 0 24px; }
.crumbs a { color: var(--chrome-mute); }
.crumbs a:hover { color: #fff; }
.crumbs .sep { color: #58585e; }
.crumbs .cur { color: #fff; font-weight: 600; }
.top-date { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; background: #101011; color: #dedee2; font-size: 13px; font-weight: 600;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .2), inset 0 -1px 1px rgba(255, 255, 255, .1); }
.nav-toggle { width: 36px; height: 36px; border-radius: 999px; background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.usermenu summary:hover, .usermenu[open] summary { background: var(--chrome-2); }
.um-pop { border: 0; border-radius: 12px; padding: 4px; box-shadow: inset 0 0 0 1px var(--line), var(--shadow-pop); }
.um-pop a { border-radius: 8px; }
.um-pop a:hover { background: var(--line); }

/* ---------- marca ---------- */
.mark { background: var(--brand); border-radius: 10px; }
.brand-t b { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.brand-t small { color: var(--chrome-mute); }

/* ---------- menu lateral claro ---------- */
.side { background: var(--side-bg); color: var(--ink); border-right: 0; padding: 12px; gap: 4px; }
.side-cta { height: 40px; margin: 4px 0 12px; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 600; box-shadow: none; transition: background .15s ease, transform .1s var(--ease); }
.side-cta:hover { background: var(--brand-600); color: #fff; }
.side-cta:active { transform: scale(.95); }
.side-nav { gap: 2px; }
.side-nav a { height: 40px; padding: 0 12px; gap: 16px; border-radius: 12px; color: var(--ink); font-weight: 600; transition: background .15s ease; }
.side-nav a .ico { width: 20px; height: 20px; color: var(--ink); }
.side-nav a:hover { background: rgba(0, 0, 0, .10); color: var(--ink); }
.side-nav a.on { background: #fff; color: var(--ink); }
.side-nav a.on .ico { color: var(--brand); }
.side-nav a.on::before { display: none; }
.nav-h { color: var(--ink-2); font-weight: 600; }
.side-user { border-top: 1px solid var(--line); padding: 12px 4px 0; }
.su-t b { color: var(--ink); }
.su-t small { color: var(--ink-2); }
.side-user a, .side-user .logout-f button { color: var(--ink-2); border-radius: 999px; }
.side-user a:hover, .side-user .logout-f button:hover { background: rgba(0, 0, 0, .10); color: var(--ink); }
.side::-webkit-scrollbar { width: 6px; } .side::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .15); border-radius: 999px; }
.avatar { background: var(--brand); }

/* ---------- títulos ---------- */
.ph h1, .hello h1 { font-size: 28px; line-height: 36px; font-weight: 400; letter-spacing: -.005em; }
.ph p, .hello p { color: var(--ink-2); }
.panel h2, .sum h2, .step h2, .p-head h2 { font-size: 18px; line-height: 26px; font-weight: 500; letter-spacing: -.1px; }
.modal h2 { font-size: 20px; font-weight: 600; letter-spacing: -.005em; }

/* ---------- botões ---------- */
.btn { height: 40px; padding: 0 16px; border-radius: 12px; border: 0; box-shadow: 0 0 0 1px var(--line); background: #fff; color: var(--ink); font-weight: 600;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .1s var(--ease); }
.btn:hover { background: var(--line); color: #000; }
.btn:active:not(:disabled) { transform: scale(.95); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 1; color: var(--ink-3); background: var(--hover); box-shadow: none; cursor: not-allowed; }
.b-pri { background: var(--brand); color: #fff; box-shadow: none; }
.b-pri:hover { background: var(--brand-600); color: #fff; }
.b-sm { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.b-lg { height: 48px; padding: 0 20px; font-size: 16px; }
.b-top { height: 36px; }
.b-ghost { box-shadow: none; background: transparent; color: var(--ink-2); }
.b-ghost:hover { background: var(--line); color: var(--ink); }
.tc-del { border-radius: 10px; }

/* ---------- campos ---------- */
.fld > span { color: var(--ink); font-weight: 500; font-size: 14px; margin-bottom: 8px; }
.fld > span em { color: var(--ink-3); }
input, textarea, select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; box-shadow: none; color: var(--ink); line-height: 22px;
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease); }
input::placeholder, textarea::placeholder { color: var(--ink-2); opacity: .85; }
input:hover:not(:focus):not(:disabled), textarea:hover:not(:focus), select:hover:not(:focus):not(:disabled) { box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .05); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--brand-ring); }
select:disabled, input:disabled { background: var(--hover); color: var(--ink-3); }
select.sel { border-radius: 10px; }
.fld.bad input, .fld.bad select { border-color: #e73a47; box-shadow: 0 0 0 3px rgba(231, 58, 71, .2); }
.xt input, .xt select { border-radius: 10px; }
.xt .bad { border-color: #e73a47; background: #fff; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
.acomp-t .ck input, .client input { accent-color: var(--brand); }

/* ---------- avisos e status (tint, sem borda) ---------- */
.note { border: 0; border-radius: 12px; color: var(--ink); }
.n-ok { background: var(--ok-bg); } .n-ok .ico { color: #009e5b; }
.n-err { background: var(--red-bg); } .n-err .ico { color: #e73a47; }
.n-warn { background: var(--amber-bg); } .n-warn .ico { color: #e69800; }
.status { height: 22px; padding: 0 8px 0 7px; border: 0; border-radius: 8px; font-size: 12px; font-weight: 600; }
.s-ok { background: var(--ok-bg); color: var(--ok); }
.s-warn { background: var(--amber-bg); color: var(--amber); }
.s-err { background: var(--red-bg); color: var(--red); }
.s-info { background: var(--blue-bg); color: var(--blue); }
.s-mute { background: var(--hover); color: var(--ink-2); }
.pill { border: 0; border-radius: 8px; background: var(--hover); height: 24px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--red-bg); color: var(--red); }
.sum-warn { background: var(--amber-bg); color: var(--amber); border-radius: 10px; }
.tc-err { background: var(--red-bg); color: var(--red); border-radius: 10px; }
.approve { border: 0; border-radius: 16px; background: var(--amber-bg); }
.approve.a-ok { background: var(--ok-bg); }
.approve.a-err { background: var(--red-bg); }
.approve.a-info { background: var(--blue-bg); }
.live-ind { border: 0; box-shadow: 0 0 0 1px var(--line); border-radius: 999px; }

/* ---------- cartões ---------- */
.panel, .kpi, .trip, .step, .tcard, .sum, .steps { border: 1px solid var(--line); border-radius: 16px; box-shadow: none; }
.panel { padding: 20px; }
.kpi { padding: 18px 20px; }
.kpi span { color: var(--ink-2); font-weight: 500; font-size: 14px; }
.kpi b { font-size: 28px; line-height: 36px; font-weight: 500; letter-spacing: -.01em; margin-top: 4px; }
.kpi small, .kpis a.kpi small { color: var(--ink-2); }
a.kpi:hover, .kpi-f .kpi:hover { border-color: rgba(0, 0, 0, .2); background: #fff; }
.kpi.k-warn { border-color: var(--line); background: #fff; box-shadow: inset 0 3px 0 #e69800; }
.kpi.k-warn b { color: var(--amber); }
.kpi.k-err { border-color: var(--line); background: #fff; box-shadow: inset 0 3px 0 #e73a47; }
.kpi.k-err b { color: var(--red); }
.kpi.k-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.kpi.k-brand span, .kpi.k-brand small { color: #e6e8ff; }
.tcard.has-err { border-color: var(--red-line); }
.tc-head, .trip-meta { border-color: var(--line); }
.trip-meta { background: #fff; }
.trip-meta > div { border-color: var(--line); }
.howto { border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.empty-ico { background: var(--brand-50); color: var(--brand); }
.ok-ico { background: var(--ok-bg); color: var(--ok); }

/* ---------- tabelas: só divisórias ---------- */
.tbl th, .xt th { background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); }
.tbl td, .xt td { border-bottom: 1px solid var(--line); }
.tbl.rows tbody tr { transition: background .15s ease; }
.tbl.rows tbody tr:hover td, .acomp-t tbody tr:hover td, .feed a:hover, .sum-list li:hover { background: rgba(0, 0, 0, .04); }
.acomp-t tbody tr.sel td, .acomp-t tbody tr.sel { background: var(--brand-50); }
.bulk { background: var(--brand-50); border-bottom: 1px solid var(--line); }
.xt tr.row-ok td:first-child { box-shadow: inset 3px 0 0 #009e5b; }
.xt tr.row-bad td:first-child { box-shadow: inset 3px 0 0 #e73a47; }
.feed a, .att-list a, .sum-list li { border-color: var(--line); }
.att-list a:hover { background: var(--red-bg); }

/* ---------- abas, segmentos, modos ---------- */
.toolbar { border-bottom: 1px solid var(--line); }
.tabs button { position: relative; z-index: 0; isolation: isolate; height: 44px; padding: 0 16px; border-bottom: 2px solid transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.tabs button:hover { color: var(--ink); }
.tabs button:hover::before { content: ""; position: absolute; inset: 6px 2px; z-index: -1; border-radius: 16px; background: var(--side-bg); }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs button.on:hover::before { display: none; }
.tabs i { background: var(--hover); border-radius: 8px; color: var(--ink-2); }
.tabs button.on i { background: var(--brand-50); color: var(--brand); }
.seg, .modes { background: var(--hover); border: 0; border-radius: 12px; padding: 3px; }
.seg span, .mode { border-radius: 10px; color: var(--ink-2); font-weight: 600; }
.seg input:checked + span, .mode.on { background: #fff; color: #101011; box-shadow: 0 2px 6px rgba(0, 0, 0, .10), inset 0 0 0 1px rgba(0, 0, 0, .05); }
.seg.bad { box-shadow: 0 0 0 1px #e73a47; }

/* ---------- escolha de cliente, upload ---------- */
.client { border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.client:hover { border-color: rgba(0, 0, 0, .2); }
.client:has(input:checked) { border-color: var(--accent); background: var(--brand-50); box-shadow: 0 0 0 1px var(--accent); }
.drop, .addtrip { border: 1.5px dashed rgba(0, 0, 0, .18); border-radius: 16px; background: #fff; }
.drop:hover, .drop.over, .addtrip:hover { border-color: var(--accent); background: var(--brand-50); color: var(--brand); }
.drop.has { border: 1.5px solid var(--accent); background: var(--brand-50); }
.drop.bad { border-color: #e73a47; background: var(--red-bg); }
.drop-ico { border: 0; border-radius: 12px; background: var(--brand-50); color: var(--brand); }
.paste-open { border: 1px dashed rgba(123, 102, 255, .45); border-radius: 12px; background: var(--brand-50); color: var(--brand); }
.att { border: 1px dashed rgba(0, 0, 0, .2); border-radius: 10px; }
.att:hover { border-color: var(--accent); color: var(--brand); }
.att.has { border: 0; background: var(--ok-bg); color: var(--ok); }
.att.bad { border-color: #e73a47; background: var(--red-bg); }

/* ---------- etapas, rota, linha do tempo, gráficos ---------- */
.steps li.done .dot { background: var(--ink); border-color: var(--ink); }
.steps li.done::before, .steps li.now::before { background: var(--ink); }
.steps li.now .dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.steps li.fail .dot { border-color: #e73a47; color: #e73a47; }
.steps li::before, .steps .dot { border-color: var(--line); }
.steps li::before { background: var(--line); }
.tr-end .uf { background: var(--brand-50); color: var(--brand); border-radius: 8px; padding: 2px 8px; }
.tr-line { color: var(--brand); }
.tr-line i { border-top-color: #c9c0ff; }
.tr-truck { background: var(--brand-50); }
.timeline li::before { border-color: #c9c0ff; }
.timeline li:first-child::before { background: var(--brand); border-color: var(--brand); }
.timeline li::after { background: var(--line); }
.timeline summary { color: var(--brand); }
.bc { background: repeating-linear-gradient(to top, transparent 0 24.5%, rgba(0, 0, 0, .06) 24.5% 25%); }
.bc i { background: #c9c0ff; border-radius: 8px 8px 4px 4px; }
.bar.today .bc i { background: var(--brand); }
.bar.today .bl { color: var(--brand); }
.cb { background: rgba(0, 0, 0, .06); }
.cb i { background: var(--brand); }

/* ---------- modal ---------- */
.modal { border-radius: 16px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 8px 28px rgba(0, 0, 0, .25); }
.modal::backdrop { background: rgba(0, 0, 0, .6); }
.dlg-list { border-color: var(--line); border-radius: 12px; }
.dlg-list li { border-color: var(--line); }
.qr { border-color: var(--line); border-radius: 16px; }

/* ---------- login ---------- */
.login { background: radial-gradient(1200px 520px at 50% -10%, #e6e8ff, transparent 60%), var(--bg); }
.login-card { border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 1px 8px -2px rgba(0, 0, 0, .06); }
.login-card h1 { font-size: 28px; line-height: 36px; font-weight: 400; letter-spacing: -.005em; }

/* ---------- celular ---------- */
@media (max-width: 860px) {
  body.app { background: var(--chrome); padding: 0; }
  .side { top: 0; left: 0; border-radius: 0 24px 24px 0; }
  body.nav-open .side { box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); }
  .side .brand { color: var(--ink); border-bottom: 1px solid var(--line); margin: -12px -12px 8px; padding: 0 20px; }
  .side .brand-t small { color: var(--ink-2); }
  .main { border-radius: 16px 16px 0 0; padding: 20px 16px 48px; min-height: calc(100vh - 58px); }
  .topbar { padding: 0 12px; }
  .ph h1, .hello h1 { font-size: 24px; line-height: 32px; }
}
@media (prefers-reduced-motion: reduce) { .btn:active, .side-cta:active { transform: none; } }

/* v4.1: menu lateral — as regras antigas ".side nav a" eram mais específicas e deixavam os itens apagados */
.side nav.side-nav a { color: var(--ink); background: transparent; font-weight: 600; }
.side nav.side-nav a .ico { color: var(--ink); }
.side nav.side-nav a:hover { background: rgba(0, 0, 0, .10); color: var(--ink); }
.side nav.side-nav a.on { background: #fff; color: var(--ink); }
.side nav.side-nav a.on .ico { color: var(--brand); }

/* v4.1: QR nítido (tamanho natural, sem escala quebrada) + chave em destaque */
.qr { display: inline-flex; padding: 12px; margin: 12px 0 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.qr svg { width: auto; height: auto; image-rendering: pixelated; }
.secret { display: inline-block; margin-top: 8px; padding: 6px 12px; border: 0; border-radius: 10px; background: var(--hover); color: var(--ink);
  font: 500 15px/24px "DM Mono", ui-monospace, Menlo, monospace; letter-spacing: .08em; word-break: normal; white-space: normal; user-select: all; }
.kpis .kpi.k-brand small, .kpis a.kpi.k-brand small, .kpis .kpi.k-brand span { color: #e6e8ff; }
/* selects com a mesma altura dos campos e seta própria */
select { -webkit-appearance: none; appearance: none; min-height: 40px; padding-right: 36px;
  background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2358585e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m6 9 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 12px center / 16px; }
select:disabled { background-color: var(--hover); }
select.sel { min-height: 32px; padding-right: 30px; background-position: right 8px center; }
.xt select { min-height: 34px; padding-right: 28px; background-position: right 8px center; background-size: 14px; }

/* fechamento J&T */
.steps.steps4 { grid-template-columns: repeat(4, 1fr); }
.jt-list tbody tr { cursor: pointer; }
.jt-routes td small { display: inline; color: var(--ink-2); font-size: 12px; margin: 0 0 0 2px; }
.jt-routes tfoot td { padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; }
.approve .live { margin: 8px 0 0; }
@media (max-width: 860px) { .jt-routes th:nth-child(2), .jt-routes td:nth-child(2) { display: none; } .steps.steps4 li { font-size: 0; } }
.live[hidden] { display: none !important; }

/* ================================================================
   v5 (25/11): menu lateral recolhido (só ícones, 72px) — abre por cima do conteúdo
   quando o mouse entra (ou o teclado foca) e fecha quando sai.
   ================================================================ */
:root { --side-rail: 72px; }
@media (min-width: 861px) {
  body.app { padding-left: calc(var(--side-rail) + 8px); }
  .nv.nv-wide .nv-side { left: calc(var(--side-rail) + 8px); }
  .side {
    width: var(--side-rail); overflow-x: hidden; overflow-y: auto; z-index: 35;
    transition: width .25s cubic-bezier(.2, .8, .2, 1) .1s, box-shadow .25s ease .1s;
  }
  .side:hover, .side:focus-within {
    width: var(--side-w);
    box-shadow: 12px 0 32px -12px rgba(0, 0, 0, .25);
    transition-delay: .15s;
  }
  /* marca no topo escuro: só o ícone; o nome aparece junto com o menu */
  .side .brand { width: var(--side-rail); padding: 0 19px; overflow: hidden; transition: width .25s cubic-bezier(.2, .8, .2, 1) .1s; }
  .side:hover .brand, .side:focus-within .brand { width: var(--side-w); transition-delay: .15s; }
  .side .brand-t, .side-nav a span, .side-cta, .su-t, .side-user a, .side-user .logout-f { white-space: nowrap; }
  /* recolhido: textos somem, ícones centralizados */
  .side .brand-t, .side-nav a span, .su-t, .side-user a, .side-user .logout-f, .side-cta span.lbl { opacity: 0; transition: opacity .12s ease; }
  .side:hover .brand-t, .side:hover .side-nav a span, .side:hover .su-t, .side:hover .side-user a, .side:hover .side-user .logout-f,
  .side:focus-within .brand-t, .side:focus-within .side-nav a span, .side:focus-within .su-t, .side:focus-within .side-user a, .side:focus-within .side-user .logout-f {
    opacity: 1; transition: opacity .18s ease .22s;
  }
  .side-nav a { padding: 0 14px; }
  .side-cta { justify-content: flex-start; padding: 0 13px; gap: 12px; overflow: hidden; font-size: 0; }
  .side-cta .ico { flex: none; }
  .side:hover .side-cta, .side:focus-within .side-cta { font-size: 14px; }
  .side-user { padding-left: 4px; padding-right: 4px; overflow: hidden; }
  .side-user .avatar { flex: none; }
}
.mark { flex: none; }
.capa-planilha[hidden], .capa-foto[hidden], .capa-texto[hidden] { display: none; } .capa-seg { margin-top: 2px; }

/* ================================================================
   v6 (25/11): menu lateral ESCURO — mesma cor da moldura (#18181a), o conteúdo claro
   fica como um painel arredondado por cima. Ativo = cartão translúcido + ícone roxo.
   ================================================================ */
.side { background: var(--chrome); color: var(--chrome-ink); border-radius: 0; }
.side nav.side-nav a { color: #c6c6cc; }
.side nav.side-nav a .ico { color: #9d9ea4; }
.side nav.side-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side nav.side-nav a:hover .ico { color: #fff; }
.side nav.side-nav a.on { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.side nav.side-nav a.on .ico { color: #9d99ff; }
.nav-h { color: #797980; }
.side-user { border-top-color: rgba(255, 255, 255, .10); }
.su-t b { color: #fff; }
.su-t small { color: #9d9ea4; }
.side-user a, .side-user .logout-f button { color: #9d9ea4; }
.side-user a:hover, .side-user .logout-f button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); }
@media (min-width: 861px) {
  .side:hover, .side:focus-within { box-shadow: 16px 0 40px -16px rgba(0, 0, 0, .6); }
}
@media (max-width: 860px) {
  .side .brand { color: #fff; border-bottom-color: rgba(255, 255, 255, .10); }
  .side .brand-t small { color: #9d9ea4; }
  .side { border-radius: 0 16px 16px 0; }
}
@media (min-width: 861px) { .main { border-radius: 24px 24px 0 0; } }
a.kpi.k-brand:hover, .kpi-f .kpi.k-brand:hover, .kpi.k-brand:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

/* ================================================================ Ajuda (chat) */
.chat { display: flex; flex-direction: column; padding: 0; height: calc(100vh - 220px); min-height: 420px; overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.chat-empty { margin: auto; text-align: center; max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chat-empty[hidden] { display: none; }
.chat-empty b { font-size: 18px; font-weight: 600; }
.chat-empty p { margin: 6px 0 2px; }
.chat-ava { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--brand-50); color: var(--brand); margin-bottom: 6px; }
.chat-ava .ico { width: 22px; height: 22px; }
.chat-sugs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chat-sug { padding: 8px 14px; border: 0; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px var(--line); color: var(--ink); font: 500 13.5px var(--font); cursor: pointer; transition: background .15s ease; }
.chat-sug:hover { background: var(--brand-50); color: var(--brand); }
.msg { display: flex; flex-direction: column; max-width: min(720px, 85%); }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.bot { align-self: flex-start; }
.msg-b { padding: 10px 14px; border-radius: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.msg.me .msg-b { background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.msg.bot .msg-b { background: var(--bg); color: var(--ink); border-bottom-left-radius: 6px; }
.msg time { font-size: 11px; color: var(--ink-3); margin: 4px 6px 0; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: tdot 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tdot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.act { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.act-t { font-weight: 600; font-size: 13px; color: var(--brand); margin-bottom: 4px; }
.act-r { font-size: 13.5px; }
.act-b { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.act-s { margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.act-done { box-shadow: 0 0 0 1px var(--ok-line); } .act-done .act-s { color: var(--ok); }
.act-failed { box-shadow: 0 0 0 1px var(--red-line); } .act-failed .act-s { color: var(--red); }
.act-expired, .act-declined { opacity: .7; }
.b-danger { background: var(--red); color: #fff; box-shadow: none; }
.b-danger:hover { background: #870013; color: #fff; }
.chat-in { display: flex; gap: 10px; align-items: flex-end; padding: 14px 16px; border-top: 1px solid var(--line); background: #fff; }
.chat-in textarea { flex: 1; min-height: 44px; max-height: 160px; resize: none; padding: 10px 14px; border-radius: 22px; line-height: 22px; }
.chat-send { width: 44px; height: 44px; padding: 0; border-radius: 999px; flex: none; }
.chat-send .ico { width: 18px; height: 18px; }
@media (max-width: 860px) { .chat { height: calc(100vh - 190px); } .chat-log { padding: 16px; } .msg { max-width: 92%; } }

/* v7 (25/11): categorias no menu lateral. Aberto: título da seção; recolhido: título vira um traço fino. */
.side-nav .nav-h { position: relative; display: block; height: 30px; padding: 12px 14px 0; margin: 0; overflow: hidden; white-space: nowrap;
  color: #797980; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; line-height: 16px; }
.side-nav .nav-h:first-child { height: 22px; padding-top: 4px; }
@media (min-width: 861px) {
  .side-nav .nav-h { color: transparent; transition: color .12s ease; }
  .side-nav .nav-h::after { content: ""; position: absolute; left: 16px; right: 16px; top: 18px; height: 1px; background: rgba(255, 255, 255, .12); transition: opacity .12s ease; }
  .side-nav .nav-h:first-child::after { display: none; }
  .side:hover .side-nav .nav-h, .side:focus-within .side-nav .nav-h { color: #797980; transition: color .18s ease .22s; }
  .side:hover .side-nav .nav-h::after, .side:focus-within .side-nav .nav-h::after { opacity: 0; }
}
@media (min-width: 861px) { .side-nav .nav-h::after { background: rgba(255, 255, 255, .2); left: 20px; right: 20px; } }
