/* Central CLT: estilos do front.
   Base visual do simulador (tokens, Exo e DM Mono). Tema claro por padrão; o escuro só entra
   quando a pessoa escolhe (data-theme="dark" em <html>), sem seguir o sistema operacional.
   Regras de uso: docs/central-clt-guia-visual.md. Cor só por token, nunca literal fora deste bloco. */
@import url('https://fonts.googleapis.com/css2?family=Exo:wght@400;500;600;700;800&family=DM+Mono:wght@400&display=swap');
@font-face { font-family: 'Exo Soft'; font-style: normal; font-weight: 400; font-display: swap; src: url('/central_clt/fonts/ExoSoft-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Exo Soft'; font-style: normal; font-weight: 700; font-display: swap; src: url('/central_clt/fonts/ExoSoft-Bold.ttf') format('truetype'); }

/* ---------- 1. Tokens ---------- */
:root {
  --display: 'Exo Soft', 'Exo', 'Segoe UI', system-ui, sans-serif;
  --body: 'Exo', 'Segoe UI', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, Consolas, monospace;

  --bg: #F5F5F5;
  --panel: #FFFFFF;
  --surface: #FFFFFF;
  --ink: #373435;
  --ink-strong: #101828;
  --muted: #66605F;
  --line: #E7E7E7;
  --line2: #D0D5DD;
  --soft: #F0EDED;
  --seg-off: #D9D4D4;
  --hdr: #373435;
  --on-dark: #FFFFFF;

  --brand: #D5040C;
  --brand-2: #B00309;
  --brand-text: #D5040C;
  --brand-soft: #FDEAEB;
  --on-brand: #FFFFFF;
  --focus: rgba(213, 4, 12, .18);

  --green: #1B7A47;
  --green-soft: #E4F3EA;
  --amber: #8A5A00;
  --amber-soft: #FFF1D6;
  --red: #A8231B;
  --red-soft: #FBE9E7;
  --violet: #6A54B3;
  --violet-soft: #ECE8F7;

  --scrim: rgba(30, 28, 29, .45);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 8px 30px -8px rgba(55, 52, 53, .15);
  --shadow-pop: 0 12px 40px -8px rgba(16, 24, 40, .35);
  --gap: 20px;
}
:root[data-theme="dark"] {
  --bg: #1F1D1E;
  --panel: #2A2728;
  --surface: #2A2728;
  --ink: #E9E5E5;
  --ink-strong: #FFFFFF;
  --muted: #ABA5A6;
  --line: #413D3E;
  --line2: #55504F;
  --soft: #343031;
  --seg-off: #4A4546;
  --hdr: #161415;

  --brand: #E5333A;
  --brand-2: #F2575D;
  --brand-text: #FF7A7F;
  --brand-soft: #43231F;
  --focus: rgba(255, 122, 127, .28);

  --green: #5CCB92;
  --green-soft: #1F3A2C;
  --amber: #F2C46B;
  --amber-soft: #44361A;
  --red: #FF8F86;
  --red-soft: #3A1E1B;
  --violet: #B7A7F0;
  --violet-soft: #332D4D;

  --scrim: rgba(0, 0, 0, .6);
  --shadow-card: none;
  --shadow-pop: 0 12px 40px -8px rgba(0, 0, 0, .7);
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body { font-family: var(--body); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--display); color: var(--ink-strong); text-wrap: balance; margin: 0; }
p { margin: 0; }
button { font-family: var(--body); cursor: pointer; color: inherit; touch-action: manipulation; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.num, td, th { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); white-space: nowrap; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; background: var(--panel); color: var(--ink); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; }
.skip:focus { top: 10px; box-shadow: var(--shadow-pop); }
.note { color: var(--muted); font-size: 13px; }
.muted-text { color: var(--muted); }
.mt-12 { margin-top: 12px; }
.mb-16 { margin-bottom: 16px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- 3. Estrutura da página ---------- */
.top { background: var(--hdr); color: var(--on-dark); position: sticky; top: 0; z-index: 50; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; max-width: 1440px; margin: 0 auto; min-height: 64px; }
.thead { display: flex; align-items: center; gap: 18px; min-width: 0; }
.top img.logo { height: 40px; width: auto; display: block; flex: none; object-fit: contain; }
.tdiv { width: 1px; height: 32px; background: rgba(255, 255, 255, .25); flex: none; }
.top h1 { font-size: 18px; font-weight: 700; color: var(--on-dark); line-height: 1.2; }
.top h1 small { display: block; font-family: var(--body); font-weight: 500; font-size: 12px; opacity: .8; margin-top: 2px; }
.tbtns { display: flex; align-items: center; gap: 10px; }
.user-badge { font-size: 13px; opacity: .85; }
.top .btn { background: transparent; color: var(--on-dark); border-color: rgba(255, 255, 255, .35); }
.top .btn:hover { background: rgba(255, 255, 255, .12); }
.btn-tema { width: 36px; height: 36px; padding: 0; border-radius: 50%; }
.btn-logout { white-space: nowrap; }
.main { min-width: 0; }

main.wrap { max-width: 1440px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: minmax(0, 290px) minmax(0, 1fr); gap: 24px; align-items: start; }
.main-content { min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.main-content > div[id] { display: flex; flex-direction: column; gap: var(--gap); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 24px; font-weight: 700; line-height: 1.2; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.side-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-card); position: sticky; top: 88px; min-height: calc(100vh - 104px); max-height: calc(100vh - 104px); overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.psec { display: flex; flex-direction: column; }
.side-title { font-family: var(--display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 8px 8px; }
.pmenu { display: flex; flex-direction: column; gap: 2px; }
.pmi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font-size: 14px; font-weight: 600; text-align: left; text-decoration: none; transition: background .15s, color .15s; }
.pmi svg.i { color: var(--muted); }
.pmi:hover { background: var(--soft); color: var(--ink-strong); }
.pmi.sec { padding-left: 40px; font-weight: 500; }
.side-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 6px 8px; margin: 0; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.side-toggle:hover { background: var(--soft); color: var(--ink-strong); }
.side-toggle svg.i { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .2s; }
.psec.fechado .side-toggle svg.i { transform: none; }
.pgrupo { display: grid; grid-template-rows: 1fr; margin-top: 4px; transition: grid-template-rows .2s ease; }
.pgrupo > .pmenu { min-height: 0; overflow: hidden; transition: visibility .2s; }
.psec.fechado .pgrupo { grid-template-rows: 0fr; }
.psec.fechado .pgrupo > .pmenu { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .pgrupo, .pgrupo > .pmenu, .side-toggle svg.i { transition: none; } }
.pmenu-div { flex: 0 0 auto; width: 100%; height: 1px; margin: 6px 0; background: var(--line); }
.pmi.on { background: var(--brand); color: var(--on-brand); }
.pmi.on svg.i { color: var(--on-brand); }

@media (max-width: 960px) {
  main.wrap { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .side-panel { position: static; min-height: 0; max-height: none; }
  .pmenu { flex-direction: row; flex-wrap: wrap; }
  .pmi { width: auto; }
  .tdiv, .top h1 small { display: none; }
  .user-badge { display: none; }
}

/* ---------- 4. Piloto automático (bloco do menu lateral) ---------- */
.pilot-box { background: var(--soft); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pilot-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pilot-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--ink-strong); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--seg-off); flex: none; }
.dot.ok, .pilot-status.on .dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot.wait, .pilot-status.paused .dot { background: var(--amber); }
.dot.ink { background: var(--ink); }
.dot.off { background: var(--seg-off); }
.pilot-details { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.pilot-details strong { color: var(--ink); }
.pilot-timer { font-size: 12px; }
.pilot-stats { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 12px; color: var(--muted); }
.pilot-stats strong { color: var(--ink); }
.btn-pilot-run { width: 100%; }
.pilot-link { font-size: 12px; font-weight: 600; color: var(--brand-text); text-align: center; text-decoration: none; }
.pilot-link:hover { text-decoration: underline; }
.sw { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; cursor: pointer; }
.sw input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.sw span { position: absolute; inset: 0; background: var(--seg-off); border-radius: 99px; transition: background .15s; }
.sw span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--on-dark); transition: transform .15s; }
.sw input:checked + span { background: var(--brand); }
.sw input:checked + span::after { transform: translateX(18px); }
.sw input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.sw input:disabled + span { opacity: .5; }

/* ---------- 5. Componentes ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); min-width: 0; overflow: hidden; }
.pad { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.card .card { box-shadow: none; }
.card .card + .card, .card > div[id] + div[id] { margin-top: 16px; }
.sec-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: nowrap; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.sec-h > div:first-child { flex: 1 1 auto; min-width: 0; }
.sec-h > div + div { flex: 0 0 auto; }
@media (max-width: 520px) { .sec-h { flex-wrap: wrap; } }
.sec-h h3 { font-size: 16px; font-weight: 700; }
.sec-h p { margin-top: 2px; }
.card-action-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.card-action-row h3 { font-size: 18px; margin: 4px 0 2px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.badge-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--brand-text); }
.eyebrow { display: block; margin-bottom: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--gap); align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; line-height: 1.2; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.danger { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.link { background: none; border: 0; padding: 0; color: var(--brand-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
a.link:hover, button.link:hover { color: var(--brand-2); }

label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
label.f .note { font-weight: 400; }
label.f.marcar { flex-direction: column; justify-content: flex-end; color: var(--ink); font-weight: 500; }
label.f.marcar input { accent-color: var(--brand); margin-right: 6px; }
.help-text { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.in { width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line2); background: var(--panel); color: var(--ink); font-size: 14px; font-weight: 500; transition: border-color .15s, box-shadow .15s; }
.in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.in:disabled { opacity: .6; }
/* Seta própria nos seletores: a nativa fica colada na borda. Mesmo padrão do site (seta de 18 px a 12 px da borda).
   Um ícone embutido (data-URI) não lê tokens, por isso há uma versão por tema, na cor de --muted. */
select.in { appearance: none; padding-right: 40px; background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366605F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] select.in { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ABA5A6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
textarea.in { resize: vertical; font-family: var(--body); }
input[type=range] { accent-color: var(--brand); width: 100%; }
.input-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.input-row .in { max-width: 200px; }
.input-row .btn { height: 41px; padding-top: 0; padding-bottom: 0; }
.var-linha { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 12px; }
.var-linha .in { max-width: none; }
.btn-icone { width: 41px; height: 41px; padding: 0; }
.msg-previa { padding: 12px 14px; margin-bottom: 14px; border-radius: var(--radius-sm); background: var(--soft); font-size: 14px; line-height: 1.5; white-space: pre-line; }
tbody tr.clicavel { cursor: pointer; }
tbody tr.clicavel:hover, tbody tr.clicavel:focus-visible { background: var(--soft); outline: none; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; border: 2px dashed var(--line2); border-radius: var(--radius-sm); background: var(--soft); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone span { color: var(--muted); font-size: 14px; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.sobre { border-color: var(--brand); outline: none; }
.dropzone.sobre { background: var(--bg); }
.dropzone.lendo { cursor: progress; }
.form-grid { display: flex; flex-direction: column; gap: 14px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--soft); border-radius: var(--radius-sm); }
.seg button { border: 0; background: none; border-radius: 8px; padding: 6px 14px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink-strong); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.seg-tabs { align-self: flex-start; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; background: var(--soft); color: var(--ink); white-space: nowrap; }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.wait { background: var(--amber-soft); color: var(--amber); }
.tag.danger { background: var(--red-soft); color: var(--red); }
.tag.viol { background: var(--violet-soft); color: var(--violet); }
.tag.ink { background: var(--ink); color: var(--panel); }
.tag.off { background: var(--soft); color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 12px; border-radius: 999px; background: var(--soft); font-size: 13px; font-weight: 500; }
.chip-remove { border: 0; background: var(--panel); border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; font-size: 15px; line-height: 1; color: var(--muted); }
.chip-remove:hover { color: var(--brand-text); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.fact { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fact b { font-size: 26px; line-height: 1.15; color: var(--ink-strong); }
.fact span { font-size: 13px; color: var(--muted); }
.fact .note { font-size: 12px; }
.fact.ok { background: var(--green-soft); border-color: transparent; }
.fact.ok b { color: var(--green); }
.fact.wait { background: var(--amber-soft); border-color: transparent; }
.fact.wait b { color: var(--amber); }
.stats-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-box { background: var(--soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat-box small { color: var(--muted); font-size: 12px; }
.stat-box strong { font-size: 20px; line-height: 1.2; color: var(--ink-strong); }
a.stat-box { text-decoration: none; color: inherit; }
a.stat-box:hover, a.stat-box:focus-visible { background: var(--line); }
.stat-box .tag { align-self: flex-start; font-size: 16px; padding: 1px 12px; }

.rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.stage { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; overflow: visible; position: relative; }
.stage-atualizar { position: absolute; top: 12px; right: 12px; }
.btn-icone-sm { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; }
.btn-icone-sm:hover { background: var(--soft); color: var(--ink); }
.btn-icone-sm:disabled { opacity: .5; cursor: progress; }
.btn-icone-sm:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.slot-card { display: contents; }
.stage .rot { padding-right: 32px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stage .big { font-size: 36px; font-weight: 700; line-height: 1.1; color: var(--ink-strong); margin-top: 4px; }
.stage .sub { font-size: 14px; font-weight: 600; }
.stage .note { font-size: 12px; }
.stage > div:last-child { margin-top: 10px; }
.stage.hot { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tw table { min-width: 560px; }
td .stack { min-width: 140px; }
th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 12px 22px; white-space: nowrap; }
td { padding: 12px 22px; border-top: 1px solid var(--line); vertical-align: middle; }
td.r, th.r { text-align: right; }
td small { display: block; color: var(--muted); font-size: 12px; }
td small.mono { font-family: var(--mono); }
tbody tr:hover td { background: var(--soft); }
tr[data-cpf], tr[data-lead] { cursor: pointer; }

/* Lista de itens (perfis, e depois bancos): uma linha por item, com a edição na folha lateral */
.lista-itens { display: flex; flex-direction: column; }
.item-lista { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(0, 2.4fr) auto 42px auto; gap: 14px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.item-lista:last-child { border-bottom: 0; }
.item-lista.modelo { grid-template-columns: minmax(150px, 1.1fr) minmax(0, 2.4fr) auto auto; }
.item-lista.off { opacity: .6; }
.item-nome { display: flex; flex-direction: column; min-width: 0; }
.item-nome b { color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-nome small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-resumo { font-size: 13px; color: var(--ink); }
.item-meta { font-size: 13px; color: var(--muted); white-space: nowrap; text-align: right; }
.item-meta b { color: var(--ink-strong); }
.dupla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sub-titulo { font-size: 13px; font-weight: 700; color: var(--ink-strong); margin-top: 4px; }
.mais { border-top: 1px solid var(--line); padding-top: 10px; }
.mais summary { cursor: pointer; }
.rodape-edicao { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
@media (max-width: 760px) {
  .item-lista { grid-template-columns: minmax(0, 1fr) 42px auto; padding: 12px 16px; }
  .item-lista.modelo { grid-template-columns: minmax(0, 1fr) auto; }
  .item-resumo { grid-column: 1 / -1; order: 3; }
  .item-meta { text-align: left; grid-column: 1 / -1; order: 4; }
}
/* Painel fixo do piloto automático (à direita, fora do menu) */
.btn-piloto-topo { display: inline-flex; align-items: center; gap: 8px; }
.btn-piloto-topo[aria-pressed="true"] { background: var(--soft); }
.piloto-topo-estado { opacity: .75; font-weight: 500; }
.conta-card { margin-top: auto; background: var(--soft); border-radius: 12px; padding: 12px; }
.conta-head { display: flex; align-items: center; gap: 10px; }
.conta-selo { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.conta-quem { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conta-quem b { font-size: 14px; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conta-quem small { font-size: 12px; color: var(--muted); }
.conta-acoes { flex: none; display: flex; align-items: center; gap: 2px; }
.piloto-sheet { position: fixed; top: 64px; right: 0; bottom: 0; width: min(860px, 100vw); z-index: 900; background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; }
.piloto-sheet[hidden] { display: none; }
.ps-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.ps-titulo h2 { font-size: 18px; }
.ps-titulo .note { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.ps-acoes { display: flex; align-items: center; gap: 10px; flex: none; }
.ps-abas { padding: 12px 20px 0; }
.ps-pane[hidden] { display: none; }
.ps-pane { display: flex; flex-direction: column; gap: 20px; }
.ps-controle { display: flex; flex-wrap: wrap; gap: 10px; }
.ps-controle .btn { height: 44px; padding-top: 0; padding-bottom: 0; }
.ps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; align-items: start; }
.piloto-sheet.foco { top: 0; width: 100vw; z-index: 950; border-left: 0; }
body.piloto-foco { overflow: hidden; }
.ps-corpo { flex: 1; overflow-y: auto; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 24px; }
.ps-sec h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.ps-sec-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ps-sec-topo h3 { margin: 0; }
.ps-sec .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ps-lista { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; }
.ps-item { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.ps-marca { flex: none; display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; }
.ps-item.ok .ps-marca { color: var(--green); }
.ps-item.bloqueia .ps-marca { color: var(--red); }
.ps-item.aviso .ps-marca { color: var(--amber); }
.ps-estoque { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.ps-estoque > div:not(.prog) { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.ps-estoque b { color: var(--ink); }
@media (min-width: 2200px) { body.piloto-aberto main.wrap { padding-right: 880px; } }
/* Mapa de calor do Painel */
.mc { display: flex; flex-direction: column; gap: 6px; }
.mc-linha { display: grid; gap: 6px; align-items: stretch; }
.mc-c5 { grid-template-columns: minmax(96px, 1.5fr) repeat(5, minmax(0, 1fr)) 48px; }
.mc-c6 { grid-template-columns: minmax(96px, 1.5fr) repeat(6, minmax(0, 1fr)) 48px; }
.mc-cab { margin-bottom: 2px; }
.mc-faixa { font-size: 12px; color: var(--muted); text-align: center; align-self: end; line-height: 1.2; }
.mc-rotulo { font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; align-self: center; line-height: 1.2; }
.mc-rotulo:hover { color: var(--brand-text); }
.mc-total { font-size: 13px; font-weight: 600; color: var(--muted); text-align: right; align-self: center; text-decoration: none; }
.mc-celula { display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-strong); background: var(--soft); transition: outline-color .15s; outline: 2px solid transparent; }
a.mc-celula:hover, a.mc-celula:focus-visible { outline-color: var(--ink-strong); }
.mc-n0 { background: transparent; color: var(--line2); border: 1px dashed var(--line); font-weight: 400; }
.mc-n1 { background: color-mix(in srgb, var(--ink-strong) 10%, var(--panel)); }
.mc-n2 { background: color-mix(in srgb, var(--ink-strong) 24%, var(--panel)); }
.mc-n3 { background: color-mix(in srgb, var(--ink-strong) 48%, var(--panel)); color: var(--panel); }
.mc-n4 { background: color-mix(in srgb, var(--ink-strong) 72%, var(--panel)); color: var(--panel); }
.mc-perigo.mc-n1 { background: color-mix(in srgb, var(--red) 14%, var(--panel)); }
.mc-perigo.mc-n2 { background: color-mix(in srgb, var(--red) 30%, var(--panel)); }
.mc-perigo.mc-n3 { background: color-mix(in srgb, var(--red) 55%, var(--panel)); color: var(--panel); }
.mc-perigo.mc-n4 { background: color-mix(in srgb, var(--red) 80%, var(--panel)); color: var(--panel); }
/* Esqueleto de carregamento (Skeleton do shadcn/ui) */
.esq { background: var(--soft); border-radius: var(--radius-sm); animation: esq-pulso 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes esq-pulso { 50% { opacity: 0.5; } }
.esq-grupo { display: flex; flex-direction: column; gap: 16px; }
.esq-grupo-interno { display: flex; flex-direction: column; gap: 14px; }
.esq-titulo { height: 20px; width: 35%; }
.esq-numero { height: 26px; width: 55%; margin-bottom: 8px; }
.esq-linha { height: 16px; width: 100%; }
.esq-media { width: 70%; }
.esq-curta { width: 40%; }
.esq-linha-tabela { display: grid; grid-template-columns: 2fr 1.5fr 1.5fr 1fr; gap: 24px; align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.vazio { padding: 32px 22px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.vazio b { color: var(--ink); }
.vazio.erro b, .vazio.erro { color: var(--red); }
.notice { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--soft); color: var(--ink); }
.notice.erro { background: var(--red-soft); color: var(--red); }
.notice.aviso { background: var(--amber-soft); color: var(--ink); }
.confirm { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--amber); background: var(--amber-soft); color: var(--ink); }
.confirm > div { display: flex; gap: 8px; flex-wrap: wrap; }
.done { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--green-soft); color: var(--ink); }
.prog { height: 12px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.prog span { display: block; height: 100%; background: var(--brand); transition: width .2s; }
.fn { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: end; padding: 10px 0; }
.fn b { display: block; font-weight: 600; color: var(--ink-strong); }
.fn small { color: var(--muted); font-size: 12px; }
.fn-b { grid-column: 1 / -1; order: 3; height: 14px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.fn-b span { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.fn-b.ok span { background: var(--green); }
.fn-n { text-align: right; font-weight: 700; color: var(--ink-strong); }
.fn-n small { display: block; font-weight: 400; }
.badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.stage .acoes { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.acoes-linha { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-box strong.ok { color: var(--green); }
.stat-box strong.danger { color: var(--red); }
.pmi .cnt { margin-left: auto; padding: 1px 9px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 600; }
.pmi .cnt.zero { background: transparent; color: var(--muted); border: 1px solid var(--line2); }
.pmi.on .cnt { background: var(--on-brand); color: var(--brand); }
.stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--soft); }
.stack span { display: block; height: 100%; }
.stack .ok { background: var(--green); }
.stack .wait { background: var(--amber); }
.stack .ink { background: var(--ink); }
.stack .off { background: var(--seg-off); }
.stack .viol { background: var(--violet); }
.dot.viol { background: var(--violet); }
.stack-legenda { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.stack-item { display: inline-flex; align-items: center; gap: 8px; }
.motivos-list { display: flex; flex-direction: column; gap: 8px; }
.motivo-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: var(--soft); border-radius: var(--radius-sm); font-size: 14px; }
.motivo-row b { font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.card svg[role="img"] { width: 100%; height: auto; display: block; }

.toast { position: fixed; bottom: 22px; right: 22px; z-index: 2000; max-width: min(420px, calc(100vw - 32px)); background: var(--ink); color: var(--panel); padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-pop); }
.toast.erro { background: var(--red); color: var(--panel); }
body:has(.drawer-backdrop:not([hidden])) .toast { bottom: 88px; }
.toast[hidden], .gload[hidden] { display: none; }
.gload { position: fixed; right: 22px; bottom: 22px; z-index: 1900; display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow-pop); font-weight: 600; }
.gload img { width: 20px; animation: ypulse 1.1s ease-in-out infinite; }
@keyframes ypulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.82); opacity: .55; } }

/* ---------- 6. Painel lateral e linha do tempo ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: 1000; display: flex; justify-content: flex-end; animation: fadeIn .15s ease-out; }
.drawer-backdrop[hidden] { display: none; }
.drawer-panel { width: min(560px, 100vw); height: 100%; background: var(--panel); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: slideInRight .2s cubic-bezier(.16, 1, .3, 1); }
@keyframes slideInRight { from { transform: translateX(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer-header { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.drawer-header h3 { font-size: 18px; }
.drawer-header p { margin-top: 4px; font-size: 13px; color: var(--muted); }
.drawer-close { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--muted); padding: 2px 8px; border-radius: 8px; }
.drawer-close:hover { background: var(--soft); color: var(--ink); }
.drawer-body { padding: 24px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.drawer-section { display: flex; flex-direction: column; gap: 16px; }
.drawer-footer { padding: 16px 24px; border-top: 1px solid var(--line); background: var(--soft); display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; position: relative; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 5px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 20px 22px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker { position: absolute; left: -13px; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--panel); border: 2px solid var(--muted); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); z-index: 1; }
.timeline-item.ok .timeline-marker { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.timeline-item.bad .timeline-marker { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.timeline-item.wait .timeline-marker { border-color: var(--amber); color: var(--amber); background: var(--amber-soft); }
.timeline-content b { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--ink-strong); }
.timeline-content b time { font-size: 12px; font-weight: 400; color: var(--muted); }
.timeline-content small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.lead-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 13px; color: var(--muted); }
.lead-summary-grid b { color: var(--ink); }
.search-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-input-wrap { flex: 1; min-width: 240px; }
.search-row + .chips-bar { margin-top: 12px; }
.fb-solta { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.fb-contagem { margin-left: auto; font-size: 13px; color: var(--muted); }
.fb-n .tag { padding: 0 8px; margin-left: 4px; }

/* ---------- 7. Distribuição ---------- */
.action-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.status-box { background: var(--soft); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.dist-rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.dist-trilha { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; text-align: center; }
.trilha-col { background: var(--soft); border-radius: 10px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.trilha-col.ok { background: var(--green-soft); color: var(--green); }
.trilha-col.wait { background: var(--amber-soft); color: var(--amber); }
.trilha-col.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 700; }
.trilha-col.bad { background: var(--red-soft); color: var(--red); }
.trilha-col .icone { font-size: 16px; line-height: 1.2; }
.trilha-col .nome { font-size: 12px; font-weight: 600; }
.trilha-col .info { font-size: 11px; color: var(--muted); }
.lead-chips-wrap { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.remessas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.remessa-card { padding: 12px 14px; display: flex; align-items: center; gap: 10px; cursor: pointer; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.remessa-card.on { border-color: var(--brand); background: var(--brand-soft); }
.envios-list { display: flex; flex-direction: column; gap: 12px; }
.envio-card { padding: 14px 16px; background: var(--soft); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.envio-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.envio-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

/* ---------- 8. Ajustes ---------- */
.config-card { max-width: 780px; }
.config-section-title { font-size: 14px; font-weight: 700; padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.config-form .filters { align-items: start; }
.config-form { display: flex; flex-direction: column; gap: 22px; }
.config-footer { border-top: 1px solid var(--line); padding-top: 16px; display: flex; justify-content: flex-end; gap: 10px; }
.model-card, .profile-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.model-card { background: var(--soft); border-color: transparent; }
.model-header, .profile-header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.model-title, .profile-title { font-size: 14px; font-weight: 600; color: var(--ink-strong); }
.model-text { font-size: 13px; color: var(--muted); white-space: pre-wrap; }
.profile-details { font-size: 13px; color: var(--muted); line-height: 1.5; }
.code-box { background: var(--soft); padding: 14px; border-radius: var(--radius-sm); font-size: 12px; overflow-x: auto; font-family: var(--mono); }
.user-row-name { font-weight: 600; }

/* Regras do motor: cards por banco, painel lateral e acordeão */
.regras { display: flex; flex-direction: column; gap: 18px; }
.regras-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.regras-topo-acoes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mot-lista { display: flex; flex-direction: column; }
.mot-linha { display: grid; grid-template-columns: minmax(0, 2fr) minmax(80px, 1fr) 64px 56px; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
a.mot-linha:hover { background: var(--soft); }
.item-vazamento { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.item-vazamento b { color: var(--ink-strong); }
.pilha { display: flex; flex-direction: column; gap: 18px; }
.mot-nome { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 600; }
.mot-barra { width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: var(--soft); appearance: none; }
.mot-barra::-webkit-progress-bar { background: var(--soft); }
.mot-barra::-webkit-progress-value { background: var(--muted); border-radius: 999px; }
.mot-barra::-moz-progress-bar { background: var(--muted); border-radius: 999px; }
.mot-qtd, .mot-pct { text-align: right; }
.mot-pct { color: var(--muted); }
@media (max-width: 640px) { .mot-linha { grid-template-columns: minmax(0, 1fr) 56px 48px; } .mot-barra { display: none; } }
.regras-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.banco-card { display: flex; flex-direction: column; }
.banco-card .pad { gap: 14px; flex: 1; }
.banco-card.off { background: var(--soft); }
.banco-card.off .banco-fatos, .banco-card.off .banco-tags { opacity: .6; }
.banco-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.banco-cab h3 { font-size: 17px; }
.banco-fatos { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.banco-fatos div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.banco-fatos div:last-child { border-bottom: 0; padding-bottom: 0; }
.banco-fatos dt { color: var(--muted); }
.banco-fatos dd { margin: 0; text-align: right; font-weight: 600; color: var(--ink-strong); }
.banco-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.banco-card .btn { align-self: stretch; margin-top: auto; }

.drawer-panel.regras-painel { width: min(680px, 100vw); }
.drawer-panel.regras-painel-largo { width: min(1180px, 100vw); }
.regras-excluir { margin-right: auto; }
.drawer-body .filters { align-items: start; }
/* Folha com vários cartões (oferta do leilão): o cartão não encolhe para caber, a folha rola. */
.drawer-body > * { flex-shrink: 0; }
.drawer-body .tw table { min-width: 0; }
.link-oferta { white-space: normal; overflow-wrap: anywhere; }
.acordeoes { display: flex; flex-direction: column; gap: 10px; }
.acordeon { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.acordeon > summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.acordeon > summary::-webkit-details-marker { display: none; }
.acordeon > summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-left: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.acordeon[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.acordeon > summary:hover { background: var(--soft); }
.acordeon-t { font-weight: 700; color: var(--ink-strong); }
.acordeon-r { margin-left: auto; font-size: 13px; color: var(--muted); text-align: right; }
.acordeon[open] > summary { border-bottom: 1px solid var(--line); }
.acordeon-c { padding: 14px; display: flex; flex-direction: column; gap: 14px; }

div.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
div.f .note { font-weight: 400; }
.regras-matriz table { min-width: 880px; }
.regras-matriz thead th { vertical-align: bottom; white-space: nowrap; }
.regras-matriz tbody th { text-align: left; font-weight: 500; color: var(--muted); white-space: nowrap; }
.regras-matriz tbody td { min-width: 110px; white-space: nowrap; }
.regras-matriz tr.grupo td { background: var(--soft); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.regras-fontes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.regras-tabela table { min-width: 560px; }
.regras-tabela .in { padding: 6px 8px; min-width: 56px; }
.regras-tabela select.in, .tupla select.in { padding-right: 28px; background-position: right 6px center; background-size: 16px; }
.tupla { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tupla .in { min-width: 0; padding-left: 8px; padding-right: 8px; }
.tupla-parte { display: flex; flex-direction: column; gap: 4px; font-weight: 400; font-size: 12px; color: var(--muted); }
.in.erro { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

/* ---------- 9. Entrada ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--bg); padding: 20px; }
.login-card { width: 100%; max-width: 400px; padding: 0; overflow: hidden; }
.login-header { background: var(--hdr); padding: 28px 24px 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--on-dark); }
.login-header h2 { color: var(--on-dark); font-size: 20px; }
.login-header .note { color: var(--on-dark); opacity: .75; }
.login-logo { height: 44px; width: auto; margin-bottom: 8px; }
.login-form { display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.login-form .btn { width: 100%; }
.login-form .btn.primary { height: 48px; font-size: 15px; margin-top: 4px; }
.senha-wrap { position: relative; display: block; margin-top: 6px; }
.senha-wrap .in { padding-right: 46px; }
.senha-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; }
.senha-toggle:hover { background: var(--soft); color: var(--ink); }
.senha-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }

@media (max-width: 640px) {
  .page-head h2 { font-size: 21px; }
  .sec-h, td, th { padding-left: 16px; padding-right: 16px; }
  .pad { padding: 16px; }
  .stats-duo, .lead-summary-grid { grid-template-columns: 1fr; }
  .dist-trilha { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer-body, .drawer-header, .drawer-footer { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Monitor (Configurações > Monitor) ---------- */
.monitor { display: flex; flex-direction: column; gap: 16px; }
.mon-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.mon-quem { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.mon-quem b { font-family: var(--display); font-size: 18px; color: var(--ink-strong); }
.mon-quem span:last-child { flex-basis: 100%; font-size: 13px; color: var(--muted); }
.monitor table { table-layout: fixed; }
.monitor th:nth-child(1) { width: 25%; }
.monitor th:nth-child(3) { width: 120px; }
.monitor th:nth-child(4) { width: 190px; }
.monitor td:nth-child(1) b { color: var(--ink-strong); }
.monitor td:nth-child(2) { overflow-wrap: anywhere; color: var(--ink); }
.mon-acoes { display: flex; gap: 6px; justify-content: flex-end; }
.mon-folha { display: flex; flex-direction: column; gap: 14px; }
.mon-folha-resumo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; color: var(--ink-strong); font-weight: 600; }
.mon-pre { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--soft); color: var(--ink); font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.mon-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 13px; }
.mon-meta dt { color: var(--muted); }
.mon-meta dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.mon-copia { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.mon-filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.mon-filtros .in { flex: 1 1 200px; }
.mon-so-faltam { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.mon-grupo { display: flex; flex-direction: column; gap: 6px; }
.mon-grupo h4 { margin: 8px 0 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mon-vars { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.mon-var { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.mon-var:last-child { border-bottom: 0; }
.mon-nome { font-family: ui-monospace, Consolas, monospace; font-size: 13px; font-weight: 600; color: var(--ink-strong); overflow-wrap: anywhere; }
.mon-val { min-width: 0; font-size: 13px; }
.mon-valor { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; color: var(--ink); }
.mon-mascara { letter-spacing: .12em; color: var(--muted); user-select: none; }
.mon-vazio { color: var(--muted); font-style: italic; }
.mon-marcas { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 960px) and (min-width: 641px) {
  .monitor .tw table { min-width: 640px; }
}
/* Celular: cada verificação vira um bloco (nome e estado em cima, resultado e ações embaixo), sem rolar de lado */
@media (max-width: 640px) {
  .monitor .tw table { min-width: 0; table-layout: auto; }
  .monitor thead { display: none; }
  .monitor tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
  .monitor tbody td { display: block; padding: 0; border: 0; }
  .monitor td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .monitor td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .monitor td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .monitor td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; text-align: left; }
  .monitor .mon-acoes { justify-content: flex-start; }
}
