/* Lab do Fininho — tokens visuais compartilhados por todas as páginas */

:root{
  --bg:#EEF1F4;
  --surface:#FFFFFF;
  --surface-2:#E4E9ED;
  --ink:#1E2530;
  --muted:#5B6672;
  --border:#D7DEE4;
  --accent:#FF7A1A;
  --accent-soft:#FFB238;
  --accent-ink:#1E1208;
  --chrome:#4A5768;
  --danger:#C0392B;
  --success:#2E8B57;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#171C22;
    --surface:#20262E;
    --surface-2:#282F38;
    --ink:#ECEFF2;
    --muted:#96A1AC;
    --border:#333C46;
    --accent:#FF8A33;
    --accent-soft:#FFC066;
    --accent-ink:#1A1006;
    --chrome:#8B96A3;
  }
}
:root[data-theme="dark"]{
  --bg:#171C22;
  --surface:#20262E;
  --surface-2:#282F38;
  --ink:#ECEFF2;
  --muted:#96A1AC;
  --border:#333C46;
  --accent:#FF8A33;
  --accent-soft:#FFC066;
  --accent-ink:#1A1006;
  --chrome:#8B96A3;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  background:var(--bg);
  color:var(--ink);
  font-family:"IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.001ms !important; transition-duration:0.001ms !important; }
}

.wrap{ max-width:1120px; margin:0 auto; padding:32px 20px 80px; }

/* Cabeçalho de marca */
.brand-header{ display:flex; align-items:center; gap:18px; margin-bottom:24px; }
.brand-mark{ height:56px; width:auto; flex-shrink:0; }
:root:not([data-theme="light"]) .brand-mark{ filter:invert(1); }
:root[data-theme="dark"] .brand-mark{ filter:invert(1); }
:root[data-theme="light"] .brand-mark{ filter:invert(0); }

.eyebrow{
  font-family:"IBM Plex Mono", monospace;
  font-size:11.5px; letter-spacing:0.14em; text-transform:uppercase;
  color:var(--chrome); font-weight:600; display:flex; align-items:center; gap:8px;
}
.eyebrow::before{ content:""; width:8px; height:8px; background:linear-gradient(135deg, var(--accent), var(--accent-soft)); display:inline-block; border-radius:1px; }

h1{ font-family:"Sora", "Segoe UI", sans-serif; font-weight:800; font-size:clamp(26px, 4vw, 34px); margin:2px 0 4px; text-wrap:balance; }
h2{ font-family:"Sora", sans-serif; font-weight:700; }
.sub{ color:var(--muted); font-size:14.5px; max-width:60ch; margin:0; }

/* Navegação entre módulos */
.module-nav{ display:flex; gap:6px; flex-wrap:wrap; border-bottom:1px solid var(--border); margin-bottom:28px; }
.nav-btn{
  font-family:"Sora", sans-serif; font-weight:700; font-size:14.5px;
  background:transparent; border:none; color:var(--muted);
  padding:12px 4px; margin-right:22px; cursor:pointer; position:relative; top:1px;
  text-decoration:none; display:inline-block;
}
.nav-btn::after{ content:""; position:absolute; left:0; right:0; bottom:-1px; height:2px; background:transparent; border-radius:2px; }
.nav-btn.active{ color:var(--ink); }
.nav-btn.active::after{ background:var(--accent); }
.nav-btn:hover{ color:var(--ink); }

.card{ background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:22px; }
.form-stack{ display:flex; flex-direction:column; gap:16px; }

.section-label{ font-family:"Sora", sans-serif; font-weight:700; font-size:17px; display:flex; align-items:center; gap:10px; margin:0 0 14px; }
.section-label .dot{ width:9px; height:9px; border-radius:2px; background:var(--chrome); }

summary.section-label{ list-style:none; margin-bottom:0; cursor:pointer; }
summary.section-label::-webkit-details-marker{ display:none; }
summary.section-label::after{ content:'\25be'; margin-left:auto; color:var(--muted); font-size:13px; transition:transform 0.15s; }
details[open] > summary.section-label{ margin-bottom:14px; }
details[open] > summary.section-label::after{ transform:rotate(180deg); }

.field{ display:flex; flex-direction:column; gap:6px; }
.field-row{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width:520px){ .field-row{ grid-template-columns:1fr; } }

label{ font-size:13px; font-weight:600; color:var(--ink); }
.hint{ font-size:12px; color:var(--muted); }
.error-text{ font-size:12.5px; color:var(--danger); min-height:1em; }

input[type="number"], input[type="text"], input[type="tel"], input[type="email"], input[type="password"], textarea, select{
  font-family:"IBM Plex Mono", monospace; font-variant-numeric:tabular-nums; font-size:14.5px;
  color:var(--ink); background:var(--surface-2); border:1px solid var(--border); border-radius:7px;
  padding:10px 12px; width:100%; transition:border-color .15s ease;
}
select{ font-family:"IBM Plex Sans", sans-serif; cursor:pointer; }
textarea{ font-family:"IBM Plex Sans", sans-serif; resize:vertical; min-height:64px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
input:disabled{ opacity:0.65; cursor:not-allowed; }

.checkline{ display:flex; align-items:flex-start; gap:8px; font-size:13px; color:var(--muted); }
.checkline input{ width:16px; height:16px; margin-top:2px; accent-color:var(--accent); }

.preset-row{ display:flex; flex-wrap:wrap; gap:8px; margin-top:2px; }
.chip{
  font-family:"IBM Plex Mono", monospace; font-size:12.5px; padding:7px 11px; border-radius:999px;
  border:1px solid var(--border); background:var(--surface-2); color:var(--muted); cursor:pointer;
  transition:all .15s ease; white-space:nowrap;
}
.chip:hover{ border-color:var(--chrome); color:var(--ink); }
.chip.active{ background:var(--chrome); border-color:var(--chrome); color:#fff; }
.chip.flag-verde.active{ background:var(--success); border-color:var(--success); }
.chip.flag-amarela.active{ background:#C99A1E; border-color:#C99A1E; }
.chip.flag-vermelha.active{ background:var(--danger); border-color:var(--danger); }

.divider{ height:1px; background:var(--border); margin:4px 0; }

.actions{ display:flex; gap:12px; margin-top:4px; flex-wrap:wrap; }
button.primary, button.ghost, a.primary, a.ghost{
  font-family:"IBM Plex Sans", sans-serif; font-weight:600; font-size:14.5px; padding:12px 20px;
  border-radius:8px; cursor:pointer; border:1px solid transparent; flex:1; min-width:140px;
  text-align:center; text-decoration:none; display:inline-block;
}
button.primary, a.primary{ background:var(--accent); color:var(--accent-ink); }
button.primary:hover, a.primary:hover{ filter:brightness(1.06); }
button.primary.alt{ background:var(--chrome); color:#fff; }
button.ghost, a.ghost{ background:transparent; border-color:var(--border); color:var(--muted); }
button.ghost:hover, a.ghost:hover{ color:var(--ink); border-color:var(--muted); }
button.danger{ background:var(--danger); color:#fff; }
button.link-btn{
  background:transparent; border:none; color:var(--chrome); font-family:"IBM Plex Sans", sans-serif;
  font-weight:600; font-size:12.5px; text-decoration:underline; cursor:pointer; padding:0; text-align:left;
}
button[disabled], a[disabled]{ opacity:.55; cursor:not-allowed; }

table{ width:100%; border-collapse:collapse; }
table th, table td{ text-align:left; padding:10px 8px; border-bottom:1px solid var(--border); font-size:13px; }
table th{ color:var(--muted); font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:0.04em; }
table td.num, table th.num{ text-align:right; font-family:"IBM Plex Mono", monospace; font-variant-numeric:tabular-nums; }

.badge{ display:inline-block; font-size:11px; font-weight:600; padding:3px 8px; border-radius:999px; background:var(--surface-2); color:var(--muted); }
.badge.status-aguardando_aprovacao{ background:#DCEBFF; color:#1D4E8C; }
.badge.status-aprovado{ background:#DFF3E6; color:var(--success); }
.badge.status-em_impressao{ background:#3A2318; color:var(--accent); }
.badge.status-concluido{ background:var(--surface-2); color:var(--chrome); }
.badge.status-recusado{ background:#FBE1DE; color:var(--danger); }

.stat-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:14px; }
.stat-card{ background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:16px; }
.stat-card .stat-label{ font-size:11.5px; text-transform:uppercase; letter-spacing:0.06em; color:var(--muted); font-weight:600; }
.stat-card .stat-value{ font-family:"IBM Plex Mono", monospace; font-size:26px; font-weight:600; margin-top:6px; }

footer.note{ margin-top:28px; font-size:12px; color:var(--muted); max-width:70ch; }

.auth-shell{ max-width:420px; margin:0 auto; padding:60px 20px; }
.auth-shell .card{ margin-top:24px; }

/* Paginação */
.paginacao{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; margin-top:14px; padding-top:14px; border-top:1px solid var(--border); }
.paginacao .pg-tamanho-wrap{ display:flex; align-items:center; gap:8px; }
.paginacao .pg-tamanho-wrap label{ font-weight:400; color:var(--muted); font-size:12.5px; }
.paginacao .pg-tamanho-wrap select{ width:auto; padding:6px 10px; font-size:12.5px; }
.paginacao .pg-nav{ display:flex; align-items:center; gap:12px; }
.paginacao .pg-nav button{ min-width:auto; padding:7px 14px; font-size:12.5px; flex:none; }
.paginacao .pg-nav span{ white-space:nowrap; }

/* Modal de visualização */
.modal-overlay{
  position:fixed; inset:0; background:rgba(10,12,15,0.55); z-index:100;
  display:flex; align-items:flex-start; justify-content:center; padding:6vh 20px; overflow-y:auto;
}
.modal-box{ width:100%; max-width:600px; }
.modal-header{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; }
.modal-header .section-label{ margin:0; }
.modal-box .field p{ margin:0; font-size:14px; }

[hidden]{ display:none !important; }
