/* Painel de Controle — "Folha de odds": tabelas densas e comparáveis, algarismos tabulares, tinta azul-marinho sobre papel frio. */

/* ------------------------------------------------------------------ tokens */
:root {
  --font-text: 'Barlow', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace;
  --font-head: 'Barlow Semi Condensed', 'Barlow', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Arial, sans-serif;

  --ink: #0f1a31;
  --ink-2: #18284a;
  --ink-3: #26407a;
  --on-ink: #e9eefb;
  --on-ink-muted: #a9b9d8;

  --paper: #e8edf3;
  --sheet: #fcfdfe;
  --sheet-2: #f2f5f9;
  --rule: #cbd4df;
  --rule-strong: #8393a9;

  --text: #17213a;
  --muted: #566781;
  --faint: #596a82;

  --brand: #16367a;
  --brand-hover: #0f2a63;
  --on-brand: #ffffff;

  --ok: #137a4b;       --ok-bg: #dcf1e6;
  --warn: #8f5600;     --warn-bg: #fcebc4;
  --bad: #bb2d16;      --bad-bg: #fadfd9;
  --info: #1b57ad;     --info-bg: #dfeaf8;
  --focus: #2f6bff;

  --r: 3px;
  --r-lg: 6px;
  --shadow-pop: 0 2px 0 rgba(15, 26, 49, .08), 0 18px 40px -16px rgba(15, 26, 49, .45);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

:root[data-theme='dark'] {
  --ink: #0a1427;
  --ink-2: #111f3b;
  --ink-3: #2a4585;
  --paper: #080f1d;
  --sheet: #0f192c;
  --sheet-2: #14213a;
  --rule: #23365a;
  --rule-strong: #4a6190;
  --text: #e4ebf6;
  --muted: #9db0cc;
  --faint: #7589ab;
  --brand: #3f6fe8;
  --brand-hover: #5a85f2;
  --on-brand: #ffffff;
  --ok: #4cc38a;   --ok-bg: #12382a;
  --warn: #f0b24a; --warn-bg: #3b2e10;
  --bad: #ff7a63;  --bad-bg: #40201a;
  --info: #7fb0ff; --info-bg: #16294d;
  --focus: #7aa2ff;
  --shadow-pop: 0 2px 0 rgba(0, 0, 0, .3), 0 18px 40px -16px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: #0a1427;
    --ink-2: #111f3b;
    --ink-3: #2a4585;
    --paper: #080f1d;
    --sheet: #0f192c;
    --sheet-2: #14213a;
    --rule: #23365a;
    --rule-strong: #4a6190;
    --text: #e4ebf6;
    --muted: #9db0cc;
    --faint: #7589ab;
    --brand: #3f6fe8;
    --brand-hover: #5a85f2;
    --ok: #4cc38a;   --ok-bg: #12382a;
    --warn: #f0b24a; --warn-bg: #3b2e10;
    --bad: #ff7a63;  --bad-bg: #40201a;
    --info: #7fb0ff; --info-bg: #16294d;
    --focus: #7aa2ff;
    --shadow-pop: 0 2px 0 rgba(0, 0, 0, .3), 0 18px 40px -16px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--rule-strong) transparent; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 15px/1.5 var(--font-text);
  font-variant-numeric: tabular-nums;
  accent-color: var(--brand);
  caret-color: var(--brand);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--brand); color: var(--on-brand); }
a { color: var(--brand); text-underline-offset: .18em; }
:root[data-theme='dark'] a { color: var(--info); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: .005em; text-wrap: balance; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.15rem; }
p { margin: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.2em; }
.mono { font-family: var(--font-mono); font-size: .88em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.num { text-align: right; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { top: 8px; }

/* ------------------------------------------------------------------ barra superior */
.bar { background: var(--ink); color: var(--on-ink); border-bottom: 1px solid #000; }
.bar-in { max-width: 1400px; margin: 0 auto; padding: 0 24px; display: flex; align-items: stretch; gap: 28px; min-height: 52px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 700 1.1rem/1 var(--font-head); letter-spacing: .02em; text-transform: uppercase; }
.brand .i { width: 26px; height: 26px; stroke-width: 1.5; color: #8fb0ff; }
.tabs { display: flex; align-items: stretch; gap: 2px; flex: 1; }
.tab { display: flex; align-items: center; gap: 8px; padding: 0 14px; white-space: nowrap; color: var(--on-ink-muted); text-decoration: none; font: 600 .95rem/1 var(--font-head); letter-spacing: .03em; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab:hover { color: #fff; background: var(--ink-2); }
.tab[aria-current='page'] { color: #fff; border-bottom-color: #8fb0ff; background: var(--ink-2); }
.bar-right { display: flex; align-items: center; gap: 14px; }
.who { color: var(--on-ink-muted); font-size: .875rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid transparent; background: transparent; color: var(--on-ink-muted); border-radius: var(--r); cursor: pointer; }
.icon-btn:hover { color: #fff; background: var(--ink-2); }
.bar form { margin: 0; display: flex; align-items: center; }
.bar .linkbtn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid #36496f; color: var(--on-ink); padding: 7px 12px; border-radius: var(--r); font: 600 .875rem/1 var(--font-head); letter-spacing: .03em; cursor: pointer; }
.bar .linkbtn:hover { background: var(--ink-2); border-color: #5a73a6; }

/* faixa de resumo (logo abaixo da barra) */
.strip { background: var(--ink-2); color: var(--on-ink); border-bottom: 1px solid #000; }
.strip-in { max-width: 1400px; margin: 0 auto; padding: 0 24px; min-height: 42px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; font-size: .9rem; }
.strip b { font-weight: 700; }
.strip .sep { width: 1px; height: 18px; background: #36496f; }
.strip .grow { flex: 1; }
.strip .dim { color: var(--on-ink-muted); }
.strip .lamp { background: transparent; }

/* ------------------------------------------------------------------ miolo */
.wrap { max-width: 1400px; margin: 0 auto; padding: 22px 24px 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 16px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .875rem; margin-bottom: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }

/* mensagens */
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border: 1px solid; border-radius: var(--r); margin: 0 0 14px; font-weight: 500; }
.notice.ok { color: var(--ok); background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.notice.err { color: var(--bad); background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.notice .i { margin-top: 2px; }
.notice span { flex: 1; color: var(--text); }
.notice button { background: transparent; border: 0; color: inherit; cursor: pointer; padding: 2px; border-radius: 2px; }

/* folha (painel branco azulado) */
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); }
.sheet + .sheet { margin-top: 20px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.sheet-head h2 { font-size: 1.05rem; }
.sheet-body { padding: 16px 18px; }
.tools { display: flex; align-items: center; gap: 10px; }
.search { position: relative; }
.search .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input[type='search'] { padding-left: 36px; width: 280px; }

/* ------------------------------------------------------------------ a folha de odds (tabela) */
.tablewrap { overflow-x: auto; }
table.odds { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.odds th, .odds td { padding: 0 14px; height: 58px; border-bottom: 1px solid var(--rule); vertical-align: middle; text-align: left; }
.odds thead th { height: 40px; background: var(--sheet-2); border-bottom: 2px solid var(--ink); font: 600 .78rem/1.1 var(--font-head); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); white-space: nowrap; }
:root[data-theme='dark'] .odds thead th { border-bottom-color: var(--rule-strong); }
.odds thead th.num { text-align: right; }
.odds th button { all: unset; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; color: inherit; }
.odds th button:hover { color: var(--text); }
.odds th button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.odds th button .i { width: .95em; height: .95em; opacity: .55; }
.odds th[aria-sort='ascending'] button, .odds th[aria-sort='descending'] button { color: var(--text); }
.odds th[aria-sort] button .i { opacity: 1; }
.odds tbody tr { cursor: pointer; }
.odds tbody tr:hover td { background: var(--sheet-2); }
.odds td.num, .odds tfoot td.num { text-align: right; font-weight: 500; font-size: 1rem; }
.odds tfoot td.num { font-weight: 700; }
.odds td.key { font-weight: 700; color: var(--ink); }
:root[data-theme='dark'] .odds td.key { color: var(--text); }
.odds .plat { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; min-width: 190px; }
.odds .plat strong { font: 700 1.05rem/1.2 var(--font-head); color: var(--text); letter-spacing: .01em; }
.odds .plat:hover strong { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .15em; }
.odds .plat .dom { color: var(--muted); font-size: .85rem; }
.odds .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; flex: none; }
.odds .platrow { display: flex; align-items: center; }
.dot.is-ok { background: #1fa86a; }
.dot.is-warn { background: #e4a11b; }
.dot.is-bad { background: #e0432a; }
.dot.is-off { background: var(--faint); }
.odds td .sub { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
.odds .pos { color: var(--ok); }
.odds .neg { color: var(--bad); }
.odds .nodata { color: var(--faint); }
.odds .states { display: flex; gap: 6px; flex-wrap: nowrap; }
.odds .nodata { color: var(--faint); }
.odds tfoot td { height: 56px; border-top: 3px double var(--ink); border-bottom: 0; background: var(--sheet-2); font-weight: 700; font-size: 1rem; }
:root[data-theme='dark'] .odds tfoot td { border-top-color: var(--rule-strong); }
.odds tfoot td:first-child { font: 700 .95rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .09em; }
.odds tr[hidden] { display: none; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }

/* barra de participação */
.cell-bar { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; min-width: 120px; }
svg.share { display: block; width: 100%; height: 4px; border-radius: 1px; }
.share-bg { fill: var(--rule); }
.share-fg { fill: var(--ink-3); }
:root[data-theme='dark'] .share-fg { fill: var(--brand); }

/* lâmpadas de estado */
.lamp { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 7px; border: 1px solid; border-radius: 2px; font: 600 .72rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.lamp i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lamp.is-ok { color: var(--ok); background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.lamp.is-warn { color: var(--warn); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.lamp.is-bad { color: var(--bad); background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.lamp.is-info { color: var(--info); background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 40%, transparent); }
.lamp.is-off { color: var(--muted); background: transparent; border-color: var(--rule-strong); }

/* ------------------------------------------------------------------ botões e campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; background: var(--brand); color: var(--on-brand); border: 1px solid var(--brand); border-radius: var(--r); font: 600 .9rem/1.1 var(--font-text); cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s; }
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--rule-strong); }
.btn.ghost:hover { background: var(--sheet-2); border-color: var(--muted); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 85%, #000); border-color: color-mix(in srgb, var(--bad) 85%, #000); }
.btn.sm { padding: 6px 11px; font-size: .84rem; }

.field { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: .875rem; color: var(--muted); margin: 0 0 14px; }
.field.inline { flex-direction: row; align-items: center; gap: 10px; margin: 0; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566781' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 16px; padding-right: 36px; }
:root[data-theme='dark'] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239db0cc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
input[type='text'], input[type='email'], input[type='password'], input[type='search'], select {
  font: 400 1rem/1.2 var(--font-text); color: var(--text); background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--r);
  padding: 9px 11px; min-width: 0; width: 100%;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: var(--muted); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0 18px; }
.hint { color: var(--muted); font-size: .85rem; margin-top: -8px; margin-bottom: 14px; }

/* ------------------------------------------------------------------ páginas: plataforma */
.cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols > .sheet + .sheet { margin-top: 0; }
.stack { display: grid; gap: 20px; min-width: 0; }
.cols > * { min-width: 0; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
.links a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--rule-strong); border-radius: 2px; text-decoration: none; color: var(--text); font-size: .88rem; font-weight: 500; }
.links a:hover { background: var(--sheet-2); }

.ledger { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ledger th, .ledger td { padding: 11px 18px; border-bottom: 1px solid var(--rule); text-align: left; font-weight: 400; }
.ledger tr:last-child th, .ledger tr:last-child td { border-bottom: 0; }
.ledger th { color: var(--muted); width: 42%; }
.ledger td { text-align: right; font-weight: 600; font-size: 1.02rem; }
.ledger tr.total th, .ledger tr.total td { border-top: 3px double var(--ink); border-bottom: 0; background: var(--sheet-2); font-weight: 700; }
:root[data-theme='dark'] .ledger tr.total th, :root[data-theme='dark'] .ledger tr.total td { border-top-color: var(--rule-strong); }
.ledger td.pos { color: var(--ok); }
.ledger td.neg { color: var(--bad); }
.ledger td.text { text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.ledger td.mono { font-size: .88rem; }

.control { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.control:last-child { border-bottom: 0; }
.control .what { flex: 1; min-width: 0; }
.control .what strong { display: flex; align-items: center; gap: 10px; font: 700 1rem/1.2 var(--font-head); letter-spacing: .01em; flex-wrap: wrap; }
.control .what p { color: var(--muted); font-size: .86rem; margin-top: 3px; }
.control form { margin: 0; }
.danger-zone { margin-top: 24px; border-top: 3px double var(--rule-strong); }
details.fold { border-bottom: 1px solid var(--rule); }
details.fold:last-child { border-bottom: 0; }
details.fold summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary .what { flex: 1; }
details.fold summary strong { font: 700 1rem/1.2 var(--font-head); display: block; }
details.fold summary p { color: var(--muted); font-size: .86rem; margin-top: 3px; }
details.fold summary .chev { transition: transform .2s var(--ease); color: var(--muted); }
details.fold[open] summary .chev { transform: rotate(180deg); }
details.fold .fold-body { padding: 0 18px 16px; }

/* tarefas */
.list { width: 100%; border-collapse: collapse; }
.list th, .list td { padding: 11px 18px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
.list thead th { background: var(--sheet-2); border-bottom: 2px solid var(--ink); font: 600 .78rem/1.1 var(--font-head); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
:root[data-theme='dark'] .list thead th { border-bottom-color: var(--rule-strong); }
.list tbody tr:hover td { background: var(--sheet-2); }
.list tr:last-child td { border-bottom: 0; }
.list td.t { white-space: nowrap; color: var(--muted); }
.list td a.job { font-weight: 600; text-decoration: none; }
.list td a.job:hover { text-decoration: underline; }

.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; margin: 0; border-bottom: 1px solid var(--rule); }
.meta > div { padding: 12px 18px; border-right: 1px solid var(--rule); }
.meta > div:last-child { border-right: 0; }
.meta dt { color: var(--muted); font-size: .8rem; }
.meta dd { margin: 2px 0 0; font-weight: 600; }
.tape { margin: 0; background: color-mix(in srgb, var(--ink) 88%, #000); color: #d6e4ff; padding: 16px 18px; max-height: 62vh; overflow: auto; font: 12.5px/1.6 var(--font-mono); white-space: pre-wrap; word-break: break-word; border-radius: 0 0 var(--r-lg) var(--r-lg); scrollbar-color: #3a4f7a #070d19; }
.tape:empty::before { content: 'Aguardando a saída da tarefa…'; color: #7f93b8; }

/* ------------------------------------------------------------------ boleto de confirmação (assinatura) */
dialog.slip { padding: 0; border: 1px solid var(--ink); border-radius: 4px; background: var(--sheet); color: var(--text); width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); overflow: visible; }
dialog.slip::backdrop { background: rgba(8, 14, 28, .62); }
dialog.slip[open] { animation: slip-in .22s var(--ease); }
@keyframes slip-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.slip-head { background: var(--ink); color: var(--on-ink); padding: 14px 20px; display: flex; align-items: center; gap: 12px; border-radius: 3px 3px 0 0; }
.slip-head .i { width: 26px; height: 26px; stroke-width: 1.5; color: #8fb0ff; }
.slip-head h2 { font-size: 1.2rem; color: #fff; }
.slip-head small { display: block; font: 500 .8rem/1.2 var(--font-text); color: var(--on-ink-muted); margin-top: 3px; }
.slip[data-tone='danger'] .slip-head { background: #5c1608; }
.slip[data-tone='danger'] .slip-head .i { color: #ffb4a3; }
.slip[data-tone='warn'] .slip-head { background: #5a3a00; }
.slip-lines { margin: 0; padding: 6px 20px 14px; }
.slip-lines > div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px dotted var(--rule-strong); }
.slip-lines dt { color: var(--muted); font-size: .85rem; }
.slip-lines dd { margin: 0; font-weight: 600; }
.slip-lines dd.effect { font-weight: 400; }
.slip-tear { border-top: 2px dashed var(--rule-strong); margin: 0; position: relative; }
.slip-tear::before, .slip-tear::after { content: ''; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 1px solid var(--ink); }
.slip-tear::before { left: -9px; clip-path: inset(0 0 0 50%); }
.slip-tear::after { right: -9px; clip-path: inset(0 50% 0 0); }
.slip-foot { padding: 16px 20px 20px; }
.slip-otp { display: block; font-weight: 500; font-size: .875rem; color: var(--muted); }
.slip-otp input { margin-top: 6px; font: 600 1.7rem/1 var(--font-text); letter-spacing: .5em; text-align: center; padding: 12px 8px 12px 18px; }
.slip-err { color: var(--bad); font-weight: 500; font-size: .875rem; margin-top: 8px; }
.slip-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ------------------------------------------------------------------ entrada (login / 2FA) */
body.gate { background: var(--paper); }
.gate-grid { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 5fr) minmax(360px, 6fr); }
.gate-side { background: var(--ink); color: var(--on-ink); padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.gate-side .brand { font-size: 1.25rem; }
.gate-side h1 { font-size: clamp(2rem, 3.2vw, 2.9rem); color: #fff; max-width: 14ch; line-height: 1.05; }
.gate-side p { color: var(--on-ink-muted); max-width: 38ch; margin-top: 14px; font-size: 1.05rem; }
.gate-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--on-ink-muted); font-size: .95rem; }
.gate-side li { display: flex; align-items: center; gap: 10px; }
.gate-side li .i { color: #8fb0ff; }
.gate-main { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.gate-card { width: min(420px, 100%); }
.gate-card h2 { font-size: 1.6rem; margin-bottom: 6px; }
.gate-card > p { color: var(--muted); margin-bottom: 22px; }
.gate-card .btn { width: 100%; padding: 12px 16px; font-size: 1rem; }
.secret { font: 600 1.15rem/1.4 var(--font-mono); letter-spacing: .12em; text-align: center; padding: 12px; border: 1px dashed var(--rule-strong); border-radius: var(--r); background: var(--sheet); word-break: break-all; }
.steps { margin: 0 0 18px; padding-left: 20px; color: var(--muted); display: grid; gap: 6px; }
.steps li::marker { font-weight: 700; color: var(--text); }
.uri { word-break: break-all; font-size: .8rem; color: var(--muted); }
.otp-big { font: 600 1.7rem/1 var(--font-text) !important; letter-spacing: .5em; text-align: center; padding: 12px 8px 12px 18px !important; }

/* ------------------------------------------------------------------ responsivo */
@media (max-width: 1100px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .search input[type='search'] { width: 220px; }
}
@media (max-width: 860px) {
  .gate-grid { grid-template-columns: 1fr; }
  .gate-side { padding: 28px 24px; gap: 20px; }
  .gate-side ul { display: none; }
  .bar-in { flex-wrap: wrap; gap: 4px 16px; padding: 8px 16px 0; }
  .tabs { order: 3; flex-basis: 100%; overflow-x: auto; }
  .tab { padding: 12px 12px; }
  .who { display: none; }
  .wrap { padding: 16px 14px 56px; }
  .strip-in { padding: 8px 16px; gap: 10px 16px; }
  .slip-lines > div { grid-template-columns: 1fr; gap: 2px; }
  .sheet-head { padding: 12px 14px; }
  .tools, .search, .search input[type='search'] { width: 100%; }
  .page-head { align-items: stretch; }
  .page-head > form, .page-head > form .btn { width: 100%; }
  .odds th, .odds td { padding: 0 10px; }
  .odds thead th:first-child, .odds tbody td:first-child, .odds tfoot td:first-child { position: sticky; left: 0; z-index: 1; background: var(--sheet); box-shadow: 1px 0 0 var(--rule); }
  .odds thead th:first-child, .odds tfoot td:first-child { background: var(--sheet-2); }
  .odds tbody tr:hover td:first-child { background: var(--sheet-2); }
  .control { flex-wrap: wrap; }
  .meta > div { border-right: 0; border-bottom: 1px solid var(--rule); }
  .ledger th, .ledger td { padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------ complementos */
.states { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cell-bar { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 130px; }
.strip .lamp { background: transparent; }
.strip .lamp.is-ok { color: #74e3ac; border-color: rgba(116, 227, 172, .45); background: rgba(116, 227, 172, .08); }
.strip .lamp.is-warn { color: #ffd37a; border-color: rgba(255, 211, 122, .45); background: rgba(255, 211, 122, .08); }
.strip .lamp.is-bad { color: #ffa592; border-color: rgba(255, 165, 146, .5); background: rgba(255, 165, 146, .08); }
.strip a.dim { text-decoration: underline; text-underline-offset: .2em; }
.page-head h1 { letter-spacing: .005em; }
.empty h1 { margin-bottom: 8px; color: var(--text); }
.empty p + p { margin-top: 12px; }
.sheet-body + .sheet-body { padding-top: 0; }
.sheet > .ledger + .sheet-body { padding-top: 12px; border-top: 1px solid var(--rule); }
.control .states { margin-top: 0; }

/* ------------------------------------------------------------------ ajustes da revisão final */
.odds td.nodata { text-align: left; font-weight: 400; }
.odds tbody td:last-child { min-width: 168px; }
.odds .states { flex-wrap: wrap; }
.control .what { flex: 1 1 230px; }
.control form { flex: none; }
@media (max-width: 860px) {
  .ledger { table-layout: fixed; }
  .ledger th { width: 36%; }
  .ledger td, .ledger td.text { overflow-wrap: anywhere; min-width: 0; }
  .control { padding: 14px; }
}

.stack > * { min-width: 0; }
.sheet { min-width: 0; }

/* seta do select (depois da regra genérica dos campos, que redefine o fundo) */
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566781' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 16px;
}
:root[data-theme='dark'] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239db0cc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239db0cc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  }
}
/* a régua dupla é o gesto do TOTAL; entre controles basta uma linha simples */
.danger-zone { margin-top: 0; border-top: 1px solid var(--rule); }
