/* Tokens: GN Solutions Design System v1.0. Papéis semânticos, tema escuro invertendo só os papéis. */
:root {
  --deep-teal: #203033; --slate: #385459; --sky: #6db3ca; --green: #6e9a40; --lime: #bad247;
  --warning: #d4a13a; --danger: #b34a3a;
  --bg: #f7f8f8; --surface: #ffffff; --surface-2: #eef1f1; --text: #203033; --text-2: #5a6e72;
  --border: #d7dcdd; --accent: #bad247; --accent-text: #203033; --primary: #203033; --primary-text: #f7f8f8;
  --info: #6db3ca;
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}
/* tema: segue o sistema (padrão) ou o que a pessoa escolher no botão (data-theme no <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1718; --surface: #172224; --surface-2: #1d2b2e; --text: #eef1f1; --text-2: #a8b3b5;
    --border: #2c3d40; --primary: #bad247; --primary-text: #0f1718;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1718; --surface: #172224; --surface-2: #1d2b2e; --text: #eef1f1; --text-2: #a8b3b5;
  --border: #2c3d40; --primary: #bad247; --primary-text: #0f1718;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
.theme-btn { min-width: 34px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 'Source Sans 3', system-ui, sans-serif; }
.mono, .eyebrow, th, .num { font-family: 'Fira Code', ui-monospace, monospace; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
h1, h2, h3 { margin: 0; font-weight: 700; }
h2 { font-size: 24px; margin-bottom: 4px; }
h3 { font-size: 16px; margin: 0 0 12px; }
.lead { font-family: 'Tenor Sans', serif; color: var(--text-2); max-width: 70ch; margin: 0 0 20px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--text-2); }
.eyebrow::before { content: '● '; color: var(--green); }



.btn { font: inherit; font-weight: 600; padding: 7px 14px; border-radius: var(--r-md); border: 1px solid var(--primary); background: var(--primary); color: var(--primary-text); cursor: pointer; transition: opacity .16s var(--ease), background .16s var(--ease); }
.btn:hover:not(:disabled) { opacity: .88; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn.accent { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.sm { padding: 3px 9px; font-size: 13px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--green) 22%, transparent); color: var(--green); }
.pill.warn { background: color-mix(in srgb, var(--warning) 25%, transparent); color: var(--warning); }
.pill.bad { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }
.pill.info { background: color-mix(in srgb, var(--info) 25%, transparent); color: var(--info); }

.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; }
.card.alert { border-color: var(--warning); border-width: 1.5px; }
.kpi .v { font-family: 'Fira Code', monospace; font-size: 30px; font-weight: 500; line-height: 1.1; }
.kpi .l { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.kpi .v.warn { color: var(--warning); } .kpi .v.bad { color: var(--danger); }
.callout { border-left: 3px solid var(--warning); background: color-mix(in srgb, var(--warning) 12%, var(--surface)); padding: 12px 16px; border-radius: 0 var(--r-md) var(--r-md) 0; margin-bottom: 20px; }
.callout.info { border-color: var(--info); background: color-mix(in srgb, var(--info) 12%, var(--surface)); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.r, th.r { text-align: right; }
.clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.bar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-2); margin: 8px 0; }
.bar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-2); }
.legend b { color: var(--text); font-family: 'Fira Code', monospace; font-weight: 500; }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
select, input[type=search], input[type=text] { font: inherit; padding: 6px 10px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
input[type=search] { min-width: 240px; }
.spacer { flex: 1; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--surface); border-left: 1px solid var(--border); padding: 20px; overflow-y: auto; z-index: 10; box-shadow: -8px 0 24px rgba(0,0,0,.12); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--primary); color: var(--primary-text); padding: 10px 18px; border-radius: var(--r-md); z-index: 20; max-width: 90vw; }
.toast.err { background: var(--danger); color: #fff; }
.small { font-size: 12px; }
.count { font-family: 'Fira Code', monospace; font-size: 11px; background: var(--warning); color: #203033; border-radius: 999px; padding: 0 7px; margin-left: 4px; }
.count:empty { display: none; }
.score { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.score b { font-family: 'Fira Code', monospace; font-weight: 500; font-size: 12px; min-width: 26px; text-align: right; }
.v-liberar { background: color-mix(in srgb, var(--green) 22%, transparent); color: var(--green); }
.v-revisar { background: color-mix(in srgb, var(--warning) 25%, transparent); color: var(--warning); }
.v-bloquear { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }
.v-descartar { background: var(--surface-2); color: var(--text-2); }
.v-ok { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.reasons { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; font-size: 13px; }
.reasons li { display: flex; gap: 8px; }
.reasons .w { font-family: 'Fira Code', monospace; min-width: 38px; text-align: right; }
.reasons .w.pos { color: var(--green); } .reasons .w.neg { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.chip.pos { border-color: color-mix(in srgb, var(--green) 50%, transparent); color: var(--green); }
.chip.neg { border-color: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--danger); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.seg button { font: inherit; font-size: 14px; border: 0; background: var(--surface); color: var(--text-2); padding: 6px 12px; cursor: pointer; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--primary); color: var(--primary-text); font-weight: 600; }
tr.new td { animation: flash 2.4s var(--ease); }
@keyframes flash { from { background: color-mix(in srgb, var(--lime) 35%, transparent); } to { background: transparent; } }
tr.done td { opacity: .55; }
tr.clickable { cursor: pointer; }
.acts { display: flex; gap: 4px; white-space: nowrap; justify-content: flex-end; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); }
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi-strip .card { padding: 12px 14px; cursor: pointer; transition: border-color .16s var(--ease); }
.kpi-strip .card:hover, .kpi-strip .card.on { border-color: var(--slate); }
.kpi-strip .nums { display: flex; gap: 14px; margin-top: 6px; }
.kpi-strip .nums div { display: flex; flex-direction: column; }
.kpi-strip .nums b { font-family: 'Fira Code', monospace; font-weight: 500; font-size: 18px; }
.kpi-strip .nums span { font-size: 11px; color: var(--text-2); }
.kpi-strip b.warn { color: var(--warning); } .kpi-strip b.bad { color: var(--danger); } .kpi-strip b.ok { color: var(--green); }
.who { display: flex; flex-direction: column; min-width: 0; }
.who .n { font-size: 12px; color: var(--text-2); }
.date { white-space: nowrap; font-family: 'Fira Code', monospace; font-size: 12px; color: var(--text-2); }
.opt-list { display: grid; gap: 8px; margin: 12px 0 18px; }
.opt-list .btn { text-align: left; }
.opt-list .btn small { display: block; font-weight: 400; opacity: .8; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 10px; }
.section-title h3 { margin: 0; }
svg text { font-family: 'Fira Code', monospace; font-size: 10px; fill: var(--text-2); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


a { color: var(--sky); }

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; padding: 28px; }
.login-card h1 { font-size: 24px; }
.login-card p { margin: 0; }
.login-card label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.login-card input { font: inherit; padding: 9px 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.login-card .btn { padding: 10px; }
.err { color: var(--danger); font-size: 14px; }
.today { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; padding: 10px 14px; margin-bottom: 14px; }
.today b { font-family: 'Fira Code', monospace; font-weight: 500; }
.notice { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--warning) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent); font-size: 14px; margin: 10px 0; }



/* ---------- layout com menu lateral ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .24s var(--ease); }
.side-mini .shell { grid-template-columns: 68px minmax(0, 1fr); }
main { padding: 28px 32px 48px; max-width: 1480px; width: 100%; min-width: 0; }

.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; overflow-y: auto; overflow-x: hidden; z-index: 15; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 14px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.brand { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-name { font-size: 17px; font-weight: 700; white-space: nowrap; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--text-2); cursor: pointer; flex: none; transition: background .16s var(--ease), color .16s var(--ease); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-family: 'Fira Code', monospace; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); padding: 14px 12px 6px; white-space: nowrap; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--text-2); font: inherit; font-weight: 600; font-size: 14.5px; text-align: left; cursor: pointer; white-space: nowrap;
  transition: background .16s var(--ease), color .16s var(--ease); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--surface-2); color: var(--text); }
.nav-item.on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--lime); }
.nav-item.on .ic { color: var(--green); }
.nav-item .label { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.nav-item .count { margin-left: auto; }
.nav-item[hidden] { display: none; }
.nav-item:disabled { opacity: .6; cursor: progress; }

.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
#sync-btn .label { display: flex; flex-direction: column; line-height: 1.25; }
#sync-info { font-weight: 400; font-size: 11px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 2px 12px; }
.theme-btn { white-space: nowrap; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px 2px 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--slate); color: #f7f8f8; font-weight: 700; font-size: 13px; text-transform: uppercase; }
.user-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1; }
.user-info b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* menu recolhido: só ícones */
.side-mini .side { padding: 16px 10px; }
.side-mini .side .label, .side-mini .brand, .side-mini .nav-group, .side-mini .nav-item .count { display: none; }
.side-mini .side-head { justify-content: center; }
.side-mini .nav-item { justify-content: center; padding: 8px; }
.side-mini .nav-group:not(:first-child) { display: block; height: 1px; padding: 0; margin: 8px 6px; background: var(--border); font-size: 0; }
.side-mini .user-row { flex-direction: column; padding: 8px 0 0; }
.side-mini .nav-item[data-view="suspeitos"]::after { content: ''; position: absolute; top: 9px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.side-mini .nav-item[data-view="suspeitos"]:has(.count:empty)::after { display: none; }

/* celular / tela estreita: menu vira gaveta */
.mtop, .backdrop { display: none; }
@media (max-width: 900px) {
  .shell, .side-mini .shell { grid-template-columns: minmax(0, 1fr); }
  .mtop { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 12; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .24s var(--ease); box-shadow: 8px 0 24px rgba(0,0,0,.18); }
  .side-open .side { transform: none; }
  .side-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,24,.45); z-index: 14; }
  #collapse-btn { display: none; }
  .side-mini .side { padding: 16px 12px; }
  .side-mini .side .label, .side-mini .brand { display: revert; }
  .side-mini .nav-group, .side-mini .nav-group:not(:first-child) { display: block; height: auto; margin: 0; background: none; font-size: 10.5px; padding: 14px 12px 6px; }
  .side-mini .nav-item { justify-content: flex-start; padding: 8px 12px; }
  .side-mini .nav-item .count { display: inline-block; }
  .side-mini .nav-item[data-view="suspeitos"]::after { display: none; }
  .side-mini .side-head { justify-content: space-between; }
  .side-mini .user-row { flex-direction: row; padding: 8px 4px 2px 8px; }
  .side-mini .foot-row { display: flex; }
  main { padding: 18px 16px 40px; }
}

/* coluna de ação sempre visível: fica presa à direita quando a tabela rola de lado */
table.sticky-last th:last-child, table.sticky-last td:last-child { position: sticky; right: 0; background: var(--surface); box-shadow: -10px 0 10px -10px rgba(0,0,0,.35); z-index: 1; }
table.sticky-last tr:hover td:last-child { background: var(--surface-2); }
tr.clickable:hover td { background: var(--surface-2); }
td.todo { min-width: 260px; max-width: 420px; font-size: 13.5px; line-height: 1.4; }

/* "o que fazer agora" */
.todo-card { margin-bottom: 18px; border-left: 3px solid var(--lime); }
.tasks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.tasks li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.tasks li:last-child { border-bottom: 0; }
.task-n { font-family: 'Fira Code', monospace; font-size: 20px; font-weight: 500; min-width: 48px; text-align: right; color: var(--text); }
.task-t { flex: 1; font-size: 14.5px; }
.todo-box { border: 1px solid var(--border); border-left: 3px solid var(--lime); border-radius: var(--r-md); padding: 10px 14px; margin: 10px 0; background: var(--surface-2); }
.todo-box ul { margin: 6px 0 8px; padding-left: 18px; }
.drawer table { font-size: 13px; }
.drawer h3 { margin-top: 14px; }
@media (max-width: 720px) { .tasks li { flex-wrap: wrap; } .task-n { min-width: 0; text-align: left; } }

.pill { white-space: nowrap; }
.todo-w { min-width: 240px; }
.vol { display: flex; flex-direction: column; gap: 1px; font-size: 13px; white-space: nowrap; color: var(--text-2); }
.vol b { font-family: 'Fira Code', monospace; font-weight: 500; color: var(--text); }
.vol .bad b, .vol .bad { color: var(--danger); } .vol .warn b, .vol .warn { color: var(--warning); }
table.fit td.todo { width: 100%; }
.todo-w { min-width: 200px; }
th.c, td.c { text-align: center; }
.rule-yes { color: var(--green); font-weight: 700; } .rule-no { color: var(--text-2); opacity: .6; } .rule-conf { color: var(--danger); font-weight: 700; cursor: help; }
.rule-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.rule-line:last-child { border-bottom: 0; }
th.c { text-transform: none; letter-spacing: 0; font-size: 11px; white-space: nowrap; line-height: 1.25; padding: 6px 6px; }
.sit { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }

/* página pública do resumo de bloqueados (link do e-mail): as duas marcas juntas, como no e-mail.
   GN dá o esqueleto (Deep Teal, lima, neutros, fontes); Unifardas entra no logo, vermelho e azul-marinho */
.pedido-logo { background: #fff; border-bottom: 4px solid; border-image: linear-gradient(90deg, #e83338 50%, #bad247 50%) 1; }
.pedido-logo-in { max-width: 760px; margin: 0 auto; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pedido-logo img { display: block; width: 200px; max-width: 55%; height: auto; }
.pedido-gn { display: flex; flex-direction: column; align-items: flex-end; }
.pedido-gn .eyebrow { font-size: 9.5px; color: #5a6e72; }
.pedido-gn .eyebrow::before { content: none; }
.pedido-gn b { color: #203033; font-size: 17px; white-space: nowrap; }
.pedido-gn i { font-style: normal; color: #bad247; }
.pedido-hero { background: #203033; color: #fff; }
.pedido-hero-in { max-width: 760px; margin: 0 auto; padding: 28px 16px 26px; display: flex; flex-direction: column; gap: 6px; }
.pedido-marca { font-weight: 700; letter-spacing: .22em; font-size: 13px; margin-bottom: 14px; }
.pedido-marca i { font-style: normal; color: #5a6e72; font-weight: 400; margin: 0 6px; }
.pedido-eyebrow { color: #a8b3b5; }
.pedido-eyebrow::before { color: #e83338; }
.pedido-hero h1 { font-size: 30px; line-height: 1.15; }
.pedido-hero p { margin: 0; font-family: 'Tenor Sans', serif; color: #a8b3b5; }
.pedido-hero .mono { color: #fff; font-size: 14px; }
.pedido-faixa { display: flex; height: 4px; }
.pedido-faixa i { display: block; }
.pedido-faixa i:nth-child(1) { flex: 30; background: #e83338; }
.pedido-faixa i:nth-child(2) { flex: 25; background: #021654; }
.pedido-faixa i:nth-child(3) { flex: 25; background: var(--sky); }
.pedido-faixa i:nth-child(4) { flex: 20; background: var(--lime); }
.pedido-page { max-width: 760px; margin: 0 auto; padding: 28px 16px 48px; }
.pedido-item { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 16px 18px; border-radius: var(--r-lg); }
.pedido-item.foco { border-color: var(--lime); box-shadow: 0 0 0 2px color-mix(in srgb, var(--lime) 45%, transparent); }
.pedido-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pedido-info > * { overflow: hidden; text-overflow: ellipsis; }
.pedido-de { font-size: 17px; margin-top: 4px; }
.pedido-assunto { margin-top: 6px; padding-left: 10px; border-left: 3px solid var(--sky); }
.pedido-act { flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 190px; }
.pedido-act .pill { align-self: flex-end; }
.pedido-item.suspeito { opacity: .75; }
.pedido-alerta { display: flex; flex-direction: column; gap: 4px; margin-top: 22px; padding: 14px 16px; border-left: 4px solid var(--danger); background: var(--surface-2); border-radius: var(--r-lg); font-size: 14px; color: var(--text-2); }
.pedido-alerta > b { color: var(--text); }
.pedido-rodape { margin-top: 18px; text-align: center; }
@media (max-width: 560px) { .pedido-item { flex-direction: column; align-items: stretch; } .pedido-act { min-width: 0; } .pedido-act .pill { align-self: flex-start; } }
.pedido-de { color: #021654; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pedido-de { color: var(--text); } }
:root[data-theme="dark"] .pedido-de { color: var(--text); }
