/* Design system Giacomel — mesmas cores e fontes do site institucional.
   Os componentes usam só os tokens semânticos (--bg, --surface, --text…);
   cada tema define os valores. Tema escuro é o padrão da marca. */
:root {
  /* Paleta da marca */
  --gold:        #C9A84C;
  --gold-dark:   #8B6914;
  --gold-light:  #E2C47A;
  --black:       #0D0D0D;
  --black-soft:  #1A1A1A;
  --black-card:  #111111;
  --off-white:   #F5F0E8;
  --white:       #FFFFFF;

  --radius:      5px;
  --radius-lg:   12px;
  --font-title:  'Playfair Display', serif;
  --font-body:   'Inter', sans-serif;
}

/* ── Tema escuro (padrão) ──────────────────────── */
:root,
:root[data-tema="escuro"] {
  color-scheme: dark;
  --bg:            var(--black);
  --surface:       var(--black-card);
  --surface-2:     var(--black-soft);
  --text:          var(--white);
  --text-soft:     var(--off-white);
  --text-nav:      rgba(245, 240, 232, 0.78);
  --text-muted:    #9A8A70;
  --placeholder:   rgba(154, 138, 112, 0.7);

  --accent:        var(--gold);
  --accent-hover:  var(--gold-light);
  --accent-text:   var(--gold);
  --accent-text-hover: var(--gold-light);
  --on-accent:     var(--black);
  --accent-glow:   rgba(201, 168, 76, 0.08);
  --focus-ring:    rgba(201, 168, 76, 0.15);

  --border:        rgba(201, 168, 76, 0.2);
  --border-soft:   rgba(201, 168, 76, 0.12);
  --border-input:  rgba(201, 168, 76, 0.25);
  --border-strong: rgba(201, 168, 76, 0.45);
  --row-line:      rgba(255, 255, 255, 0.05);
  --hover-bg:      rgba(255, 255, 255, 0.04);
  --neutral-line:  rgba(255, 255, 255, 0.15);

  --danger:        #E5736B;
  --danger-bg:     rgba(229, 115, 107, 0.1);
  --danger-line:   rgba(229, 115, 107, 0.35);
  --success:       #7FC48E;
  --success-bg:    rgba(127, 196, 142, 0.1);
  --success-line:  rgba(127, 196, 142, 0.35);
  --pending:       var(--gold-light);
  --pending-line:  rgba(226, 196, 122, 0.35);

  --glow-top:      rgba(201, 168, 76, 0.10);
  --shadow-card:   0 24px 64px rgba(0, 0, 0, 0.5);
  --shadow-drawer: 0 0 48px rgba(0, 0, 0, 0.7);
  --topbar-bg:     rgba(13, 13, 13, 0.95);
  --overlay:       rgba(0, 0, 0, 0.55);

  --logo:          url('/assets/logo.png');

  --ok-forte:      #1E8A4C;
  --neutro-forte:  #B07A0C;
  --ruim-forte:    #A8432A;
  --ruim:          #E08A73;
  --ruim-line:     rgba(224, 138, 115, 0.4);
  --barra-trilho:  rgba(255, 255, 255, 0.07);
  --barra-c:       #7FA3D6;
}

/* ── Tema claro ────────────────────────────────── */
:root[data-tema="claro"] {
  color-scheme: light;
  --bg:            #F7F4EE;
  --surface:       #FFFFFF;
  --surface-2:     #FBF9F5;
  --text:          #1A1A1A;
  --text-soft:     #2B2B2B;
  --text-nav:      #3D3A34;
  --text-muted:    #74664E;
  --placeholder:   #A89C86;

  --accent:        var(--gold);
  --accent-hover:  #D6B961;
  --accent-text:   var(--gold-dark);
  --accent-text-hover: #6E5310;
  --on-accent:     var(--black);
  --accent-glow:   rgba(201, 168, 76, 0.13);
  --focus-ring:    rgba(201, 168, 76, 0.25);

  --border:        rgba(139, 105, 20, 0.2);
  --border-soft:   rgba(139, 105, 20, 0.13);
  --border-input:  rgba(139, 105, 20, 0.28);
  --border-strong: rgba(139, 105, 20, 0.45);
  --row-line:      rgba(0, 0, 0, 0.06);
  --hover-bg:      rgba(0, 0, 0, 0.04);
  --neutral-line:  rgba(0, 0, 0, 0.15);

  --danger:        #B3261E;
  --danger-bg:     rgba(179, 38, 30, 0.07);
  --danger-line:   rgba(179, 38, 30, 0.3);
  --success:       #2E7D46;
  --success-bg:    rgba(46, 125, 70, 0.08);
  --success-line:  rgba(46, 125, 70, 0.3);
  --pending:       var(--gold-dark);
  --pending-line:  rgba(139, 105, 20, 0.35);

  --glow-top:      rgba(201, 168, 76, 0.16);
  --shadow-card:   0 24px 64px rgba(60, 45, 10, 0.10);
  --shadow-drawer: 0 0 48px rgba(60, 45, 10, 0.18);
  --topbar-bg:     rgba(255, 255, 255, 0.92);
  --overlay:       rgba(20, 16, 8, 0.35);

  --logo:          url('/assets/logo-tema-claro.png');

  --ok-forte:      #1A7F45;
  --neutro-forte:  #A66F00;
  --ruim-forte:    #A8432A;
  --ruim:          #A8432A;
  --ruim-line:     rgba(168, 67, 42, 0.35);
  --barra-trilho:  rgba(0, 0, 0, 0.07);
  --barra-c:       #3D6BA8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent-text-hover); }

[hidden] { display: none !important; }

/* ── Marca ─────────────────────────────────────── */
.logo-wrap { display: flex; align-items: center; gap: 14px; }
.marca {
  display: block; flex-shrink: 0;
  width: 52px; height: 52px;
  background: var(--logo) center / contain no-repeat;
}
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-text span:first-child {
  font-family: var(--font-title);
  font-size: 1.25rem; font-weight: 700;
  color: var(--accent-text); letter-spacing: 0.06em;
}
.logo-text span:last-child {
  font-size: 0.65rem; letter-spacing: 0.22em;
  color: var(--text-muted); text-transform: uppercase; margin-top: 3px;
}

.section-label {
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent-text); font-weight: 500;
}
.title {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 700; line-height: 1.2;
}
.title em { font-style: normal; color: var(--accent-text); }
.divider { width: 48px; height: 2px; background: var(--accent); margin: 1rem 0 1.25rem; }
.muted { color: var(--text-muted); font-size: 0.9rem; }

/* ── Botão de tema ─────────────────────────────── */
.btn-tema {
  display: grid; place-items: center;
  width: 36px; height: 36px; flex-shrink: 0;
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--accent-text); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-tema:hover { border-color: var(--accent); background: var(--accent-glow); }
.btn-tema.flutuante { position: fixed; top: 16px; right: 16px; z-index: 50; background: var(--surface); }

/* ── Tela de autenticação ──────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 32px 16px;
  background: radial-gradient(ellipse at top, var(--glow-top), transparent 60%), var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-card);
}
.auth-card .logo-wrap { justify-content: center; margin: -12px 0 1rem; }
.auth-card .marca { width: 120px; height: 120px; }
.auth-card header { margin-bottom: 1.5rem; }
.auth-footer {
  margin-top: 1.75rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 0.8rem; color: var(--text-muted);
}

@media (max-width: 480px) {
  .auth-card { padding: 32px 20px; }
}

/* ── Formulários ───────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.82rem; font-weight: 500; color: var(--text-soft); }
.field .hint { font-size: 0.75rem; color: var(--text-muted); }

.input, .select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit; font-size: 0.95rem;
  padding: 0.8rem 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder { color: var(--placeholder); }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.input[readonly] { color: var(--text-muted); cursor: default; }
.select { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
}

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 4.5rem; }
.toggle-password {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--text-muted);
  font: inherit; font-size: 0.78rem; cursor: pointer; padding: 0.4rem 0.6rem;
}
.toggle-password:hover { color: var(--accent-text); }

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.link-button {
  background: none; border: 0; padding: 0;
  color: var(--accent-text); font: inherit; font-size: 0.82rem; cursor: pointer;
}
.link-button:hover { color: var(--accent-text-hover); }

/* ── Botões ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: var(--radius);
  padding: 0.85rem 2rem;
  font: inherit; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, opacity 0.2s;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--on-accent); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--accent-text); border-color: var(--border-strong); font-weight: 500; }
.btn-outline:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-glow); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.82rem; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mensagens ─────────────────────────────────── */
.alert {
  border-radius: var(--radius);
  padding: 0.75rem 0.95rem;
  font-size: 0.85rem; line-height: 1.45;
  border: 1px solid;
}
.alert-error   { color: var(--danger);  background: var(--danger-bg);  border-color: var(--danger-line); }
.alert-success { color: var(--success); background: var(--success-bg); border-color: var(--success-line); }
.alert-info    { color: var(--pending); background: var(--accent-glow); border-color: var(--border); }

/* ── Estrutura com barra lateral ───────────────── */
.app-shell {
  --sidebar-largura: 264px;
  display: grid;
  grid-template-columns: var(--sidebar-largura) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  overflow-y: auto;
}
.sidebar-logo { padding: 4px 8px 20px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.sidebar-logo .marca { width: 44px; height: 44px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-secao {
  font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-muted); padding: 18px 12px 8px;
}
.sidebar-link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-nav);
  font-size: 0.9rem; font-weight: 400;
  transition: background 0.15s, color 0.15s;
}
.sidebar-link svg { flex-shrink: 0; color: var(--text-muted); transition: color 0.15s; }
.sidebar-link:hover { background: var(--hover-bg); color: var(--text); }
.sidebar-link:hover svg { color: var(--accent-text); }
.sidebar-link[aria-current="page"] {
  background: var(--accent-glow); color: var(--accent-text); font-weight: 500;
}
.sidebar-link[aria-current="page"] svg { color: var(--accent-text); }
.sidebar-link[aria-current="page"]::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}

.sidebar-usuario {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px; padding: 14px 8px 0;
  border-top: 1px solid var(--border);
}
.avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-glow); border: 1px solid var(--border-strong);
  color: var(--accent-text); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em;
}
.sidebar-usuario .who { min-width: 0; flex: 1; line-height: 1.25; }
.sidebar-usuario .who strong {
  display: block; font-size: 0.85rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-usuario .who span { font-size: 0.72rem; color: var(--text-muted); }
.sidebar-acoes { display: flex; gap: 4px; }
.sidebar-acoes .btn-tema,
.sidebar-sair {
  width: 34px; height: 34px;
  border-color: transparent; color: var(--text-muted);
}
.sidebar-sair {
  display: grid; place-items: center; flex-shrink: 0;
  background: none; border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.sidebar-acoes .btn-tema:hover,
.sidebar-sair:hover { color: var(--accent-text); border-color: var(--border); background: none; }

.app-main { min-width: 0; }

/* Barra superior: só aparece no celular, para abrir o menu */
.topbar {
  display: none;
  position: sticky; top: 0; z-index: 20;
  align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .marca { width: 36px; height: 36px; }
.menu-toggle {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--accent-text); cursor: pointer;
}
.sidebar-fundo { display: none; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .topbar { display: flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 40;
    width: min(var(--sidebar-largura), 85vw);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .app-shell.menu-aberto .sidebar { transform: none; box-shadow: var(--shadow-drawer); }
  .app-shell.menu-aberto .sidebar-fundo {
    display: block; position: fixed; inset: 0; z-index: 30;
    background: var(--overlay);
  }
}

.container { max-width: 1100px; margin: 0 auto; padding: 40px 32px 64px; }
@media (max-width: 600px) { .container { padding: 28px 16px 48px; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.card + .card { margin-top: 24px; }
.card h2 {
  font-family: var(--font-title);
  font-size: 1.25rem; font-weight: 700; color: var(--text);
  margin-bottom: 0.35rem;
}
@media (max-width: 480px) { .card { padding: 20px; } }

/* ── Cabeçalho de página ───────────────────────── */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.page-head .title { margin-top: 0.4rem; }
.page-head .divider { margin-bottom: 0; }
.voltar { display: inline-block; font-size: 0.85rem; margin-bottom: 1.25rem; }

/* ── Novo usuário ──────────────────────────────── */
.layout-form {
  display: grid; gap: 24px;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
}
.layout-form > .card + .card { margin-top: 0; }
.layout-form .como-funciona { grid-column: 2; grid-row: 1; }
@media (max-width: 1000px) {
  .layout-form { grid-template-columns: 1fr; }
  .layout-form .como-funciona { grid-column: auto; grid-row: auto; }
}

fieldset.field { border: 0; min-width: 0; }
fieldset.field legend { font-size: 0.82rem; font-weight: 500; color: var(--text-soft); margin-bottom: 0.4rem; }
.obrigatorio { color: var(--accent-text); }

.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .radio-cards { grid-template-columns: 1fr; } }
.radio-card { position: relative; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card-body {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 14px 16px 14px 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
}
.radio-card-body::before {
  content: ""; position: absolute; left: 16px; top: 17px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--text-muted);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.radio-card-body strong { font-size: 0.92rem; font-weight: 500; }
.radio-card-body span { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }
.radio-card:hover .radio-card-body { border-color: var(--border-strong); }
.radio-card input:checked + .radio-card-body { border-color: var(--accent); background: var(--accent-glow); }
.radio-card input:checked + .radio-card-body::before {
  border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface-2), inset 0 0 0 8px var(--accent);
}
.radio-card input:focus-visible + .radio-card-body { box-shadow: 0 0 0 3px var(--focus-ring); }

.form-actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 0.5rem; }
@media (max-width: 480px) { .form-actions .btn { flex: 1; } }

.passos { list-style: none; counter-reset: passo; margin-top: 1.25rem; display: flex; flex-direction: column; gap: 1.1rem; }
.passos li { counter-increment: passo; position: relative; padding-left: 42px; display: flex; flex-direction: column; gap: 2px; }
.passos li::before {
  content: counter(passo);
  position: absolute; left: 0; top: -2px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong); color: var(--accent-text);
  font-family: var(--font-title); font-weight: 700; font-size: 0.85rem;
}
.passos strong { font-size: 0.9rem; font-weight: 500; }
.passos span { font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; }

.sucesso { text-align: center; padding: 48px 28px; }
.sucesso p { max-width: 460px; margin: 0.5rem auto 0; }
.sucesso .form-actions { margin-top: 1.75rem; }
.sucesso-icone {
  width: 64px; height: 64px; margin: 0 auto 1.25rem;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-glow); border: 1px solid var(--border-strong);
  color: var(--accent-text); font-size: 1.8rem;
}
.destaque { color: var(--text); font-weight: 500; }

/* ── Painel ────────────────────────────────────── */
.atalhos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 24px; }
.atalho {
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border-soft);
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.atalho:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-2px); }
.atalho svg { color: var(--accent-text); margin-bottom: 6px; }
.atalho strong { font-size: 0.95rem; font-weight: 500; }
.atalho span { font-size: 0.82rem; color: var(--text-muted); }

.table-wrap { overflow-x: auto; margin-top: 1rem; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 560px; }
.table th {
  text-align: left; font-weight: 500; font-size: 0.72rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted);
  padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--border);
}
.table td { padding: 0.85rem 0.75rem; border-bottom: 1px solid var(--row-line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .email { color: var(--text-muted); font-size: 0.82rem; }

.badge {
  display: inline-block; border-radius: 999px;
  padding: 0.2rem 0.65rem; font-size: 0.72rem; font-weight: 500;
  border: 1px solid;
}
.badge-gold    { color: var(--accent-text); border-color: var(--border-strong); background: var(--accent-glow); }
.badge-neutral { color: var(--text-soft); border-color: var(--neutral-line); }
.badge-ok      { color: var(--success); border-color: var(--success-line); background: var(--success-bg); }
.badge-pending { color: var(--pending); border-color: var(--pending-line); }

.page-loading {
  min-height: 60vh; display: grid; place-items: center; color: var(--accent-text);
}

/* ── Análise Regime Híbrido ────────────────────── */
.badge-ruim  { color: var(--ruim); border-color: var(--ruim-line); }
.badge-score { min-width: 2.6rem; text-align: center; font-size: 0.82rem; font-weight: 600; }
.container-largo { max-width: 1240px; }
.btn-perigo { color: var(--danger); border-color: var(--danger-line); }
.btn-perigo:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-bg); }
.btn-perigo.confirmando { background: var(--danger); color: #fff; border-color: var(--danger); }

.filtro { margin-bottom: 0.5rem; }
.filtro .input { max-width: 360px; }
.tabela-clicavel tbody tr { cursor: pointer; transition: background 0.15s; }
.tabela-clicavel tbody tr:hover, .tabela-clicavel tbody tr:focus-visible { background: var(--hover-bg); outline: none; }
.tabela-clicavel .parecer { color: var(--text-soft); font-size: 0.84rem; }
.legenda-score { margin-top: 1rem; font-size: 0.8rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Formulário */
.layout-analise {
  display: grid; gap: 24px;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
}
@media (max-width: 1100px) { .layout-analise { grid-template-columns: 1fr; } }
.form-secoes { display: flex; flex-direction: column; gap: 20px; }
.form-secoes .card + .card { margin-top: 0; }
.form-secoes h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 0.75rem; }
.passo-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: inline-grid; place-items: center;
  border: 1px solid var(--border-strong); color: var(--accent-text);
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 600;
}
.grade-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; margin-top: 0.75rem; }
.grade-campos .col-2 { grid-column: span 2; }
@media (max-width: 640px) { .grade-campos { grid-template-columns: 1fr; } .grade-campos .col-2 { grid-column: auto; } }
.grade-tributos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.85rem 1rem; }
.subgrupo { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px dashed var(--border); }
.subgrupo h3 { font-size: 0.88rem; font-weight: 500; margin-bottom: 0.85rem; }
.subgrupo h3 .muted { font-size: 0.8rem; font-weight: 400; }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.5; }

.input-afixo { position: relative; display: flex; align-items: center; }
.input-afixo > span {
  position: absolute; right: 0.95rem;
  color: var(--text-muted); font-size: 0.85rem; pointer-events: none;
}
.input-afixo .input { padding-right: 2.2rem; text-align: right; }
.input-afixo.prefixo > span { right: auto; left: 0.95rem; }
.input-afixo.prefixo .input { padding-right: 0.95rem; padding-left: 2.6rem; }

/* Prévia */
.previa { position: sticky; top: 24px; }
@media (max-width: 1100px) { .previa { position: static; order: -1; } }
.previa .veredito { margin-top: 1rem; padding: 16px 18px; gap: 14px; }
.previa .veredito-numero { font-size: 2.2rem; }
.previa .veredito-titulo { font-size: 0.95rem; }
.previa-linhas { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.55rem; font-size: 0.86rem; }
.previa-linhas > div { display: flex; justify-content: space-between; gap: 1rem; }
.previa-linhas span { color: var(--text-muted); }
.previa-dif { padding-top: 0.6rem; border-top: 1px solid var(--border); }
.positivo { color: var(--success); }
.negativo { color: var(--ruim); }
.previa .alert { margin-top: 1rem; font-size: 0.8rem; }

/* Veredito (mesmas faixas da skill: verde ≥ 60, âmbar 40–59, vermelho < 40) */
.veredito {
  display: flex; align-items: center; gap: 18px;
  border-radius: var(--radius-lg); padding: 18px 22px; color: #fff;
}
.veredito-bom    { background: var(--ok-forte); }
.veredito-neutro { background: var(--neutro-forte); }
.veredito-ruim   { background: var(--ruim-forte); }
.veredito-score { display: flex; align-items: baseline; flex-shrink: 0; }
.veredito-numero { font-family: var(--font-title); font-size: 2.6rem; font-weight: 700; line-height: 1; }
.veredito-de { font-size: 0.9rem; opacity: 0.8; margin-left: 2px; }
.veredito-rotulo { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
.veredito-titulo { font-size: 1.05rem; font-weight: 600; line-height: 1.3; margin-top: 2px; }

/* Relatório */
.barra-acoes { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.barra-acoes-botoes { display: flex; gap: 8px; flex-wrap: wrap; }
.relatorio {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); padding: 36px 40px;
}
@media (max-width: 600px) { .relatorio { padding: 24px 18px; } }
.relatorio-topo { display: flex; gap: 28px; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.relatorio-marca { padding-right: 28px; border-right: 1px solid var(--border); }
.relatorio-marca .marca { width: 96px; height: 96px; }
@media (max-width: 600px) { .relatorio-topo { flex-direction: column; align-items: flex-start; } .relatorio-marca { border: 0; padding: 0; } }
.relatorio-topo .title { margin: 0.35rem 0 0.15rem; }
.relatorio-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 0.75rem; font-size: 0.84rem; color: var(--text-soft); }
.relatorio-intro { margin: 22px 0; font-size: 0.92rem; line-height: 1.6; color: var(--text-soft); }
.nota-veredito { font-size: 0.8rem; margin: 0.6rem 0 1.75rem; }

.comparativo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .comparativo { grid-template-columns: 1fr; } }
.regime {
  position: relative; padding: 26px 22px 18px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2);
}
.regime.melhor { border: 2px solid var(--accent); }
.regime-tag {
  position: absolute; top: -11px; left: 16px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--accent-text);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; padding: 3px 10px; border-radius: 999px;
}
.regime.melhor .regime-tag { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.regime-label { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.regime-valor { font-family: var(--font-title); font-size: 1.8rem; font-weight: 700; margin: 6px 0 2px; }
.regime-taxa { font-size: 0.84rem; color: var(--text-muted); }
.regime-linhas { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; font-size: 0.84rem; }
.regime-linhas > div { display: flex; justify-content: space-between; gap: 12px; }
.regime-linhas span { color: var(--text-muted); }
.regime-linhas b { font-weight: 500; text-align: right; }
.diferenca { margin-top: 14px; font-size: 0.86rem; color: var(--text-soft); }

.secao-relatorio { margin-top: 32px; }
.secao-relatorio h2 {
  font-family: var(--font-title); font-size: 1.15rem; font-weight: 700;
  margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border);
}
.fator { margin-bottom: 16px; }
.fator-label { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.86rem; margin-bottom: 6px; }
.fator-label span { color: var(--text-soft); }
.fator-label b { color: var(--accent-text); font-weight: 600; white-space: nowrap; }
.barra { height: 8px; border-radius: 99px; background: var(--barra-trilho); overflow: hidden; }
.barra-fill { height: 100%; border-radius: 99px; }
.fill-a { background: var(--accent); }
.fill-b { background: var(--ok-forte); }
.fill-c { background: var(--barra-c); }
.fill-d { background: var(--gold-light); }

.tabelas-pgdas { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .tabelas-pgdas { grid-template-columns: 1fr; } }
.tabelas-pgdas h4 { font-size: 0.86rem; font-weight: 500; color: var(--accent-text); margin-bottom: 0.4rem; }
.tabela-compacta { min-width: 0; }
.tabela-compacta td:last-child, .tabela-compacta th:last-child { text-align: right; }
.tabela-compacta .total td { font-weight: 600; border-top: 1px solid var(--border); }
.nota-pgdas { font-size: 0.8rem; margin-top: 0.9rem; }
.texto-obs { white-space: pre-wrap; font-size: 0.9rem; color: var(--text-soft); line-height: 1.6; }

.aviso { margin-top: 20px; border-radius: var(--radius); padding: 16px 18px; font-size: 0.84rem; line-height: 1.6; border: 1px solid; }
.aviso-info { background: var(--accent-glow); border-color: var(--border); color: var(--text-soft); }
.aviso-atencao { background: var(--danger-bg); border-color: var(--danger-line); color: var(--text-soft); }
.aviso b { color: var(--text); }

.relatorio-rodape {
  margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--text-muted); line-height: 1.6;
}
.relatorio-rodape > span:first-child { max-width: 560px; }
.rodape-autor { text-align: right; }
.rodape-autor b { color: var(--text-soft); font-weight: 500; }

/* ── Impressão ─────────────────────────────────── */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .sidebar, .sidebar-fundo, .topbar, .nao-imprimir, .btn-tema { display: none !important; }
  .app-shell { display: block; }
  .container { padding: 0; max-width: none; }
  .relatorio { border: 0; padding: 0; }
  .veredito, .regime, .barra, .barra-fill, .aviso, .regime-tag { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .secao-relatorio, .comparativo, .aviso { break-inside: avoid; }
}

/* ── Conferência de cartão ponto ───────────────── */
.btn.confirmando { background: var(--danger); color: #fff; border-color: var(--danger); }
.input.invalido { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }

.grade-ponto-dados { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem 1.25rem; margin-top: 0.75rem; }
.grade-ponto-dados > .field { grid-column: span 2; }
.grade-ponto-dados > .field:nth-child(-n+2) { grid-column: span 3; }
@media (max-width: 700px) {
  .grade-ponto-dados { grid-template-columns: 1fr; }
  .grade-ponto-dados > .field, .grade-ponto-dados > .field:nth-child(-n+2) { grid-column: auto; }
}
.grade-ponto-regras { display: grid; grid-template-columns: repeat(3, minmax(0, 170px)) 1fr; gap: 1rem 1.25rem; align-items: start; margin-top: 0.75rem; }
@media (max-width: 900px) { .grade-ponto-regras { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grade-ponto-regras { grid-template-columns: 1fr; } }
.checks { display: flex; flex-direction: column; gap: 0.55rem; padding-top: 1.6rem; }
@media (max-width: 900px) { .checks { padding-top: 0; grid-column: 1 / -1; } }
.check { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 0.85rem; color: var(--text-soft); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.input-hora { width: 76px; padding: 0.5rem 0.4rem; text-align: center; font-variant-numeric: tabular-nums; font-size: 0.88rem; }
.tabela-jornada { min-width: 620px; }
.tabela-jornada td, .tabela-jornada th { padding: 0.45rem 0.5rem; }
.tabela-jornada tfoot td { font-weight: 600; border-top: 1px solid var(--border); padding-top: 0.7rem; }
.tabela-jornada input[type="radio"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.calc { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-soft); }

.lista-feriados { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 0.9rem; }
.chip-feriado {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.3rem 0.35rem 0.3rem 0.7rem; border-radius: 999px;
  background: var(--accent-glow); border: 1px solid var(--border); font-size: 0.8rem;
}
.chip-feriado b { color: var(--accent-text); font-weight: 600; }
.chip-feriado button {
  width: 20px; height: 20px; border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: var(--text-muted); font-size: 1rem; line-height: 1;
}
.chip-feriado button:hover { background: var(--danger-bg); color: var(--danger); }
.add-feriado { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 10px; max-width: 640px; }
@media (max-width: 560px) { .add-feriado { grid-template-columns: 1fr; } }

.resumo-ponto { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 1rem; }
.tile {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border-soft);
}
.tile-rotulo { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.tile-valor { font-family: var(--font-title); font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-detalhe { font-size: 0.75rem; color: var(--text-muted); }
.tile.destaque-pos { border-color: var(--success-line); }
.tile.destaque-pos .tile-valor { color: var(--success); }
.tile.destaque-neg { border-color: var(--danger-line); }
.tile.destaque-neg .tile-valor { color: var(--danger); }

.tabela-ponto { min-width: 900px; font-size: 0.84rem; }
.tabela-ponto th { padding: 0.55rem 0.4rem; white-space: nowrap; }
.tabela-ponto td { padding: 0.3rem 0.4rem; }
.tabela-ponto .col-extra { display: none; }
.tabela-ponto.mostrar-extra .col-extra { display: table-cell; }
.tabela-ponto .input-hora { width: 64px; padding: 0.4rem 0.3rem; font-size: 0.84rem; }
.select-tipo { padding: 0.4rem 1.8rem 0.4rem 0.5rem; font-size: 0.8rem; width: 150px; }
.col-data { white-space: nowrap; }
.col-data span { color: var(--text-muted); font-size: 0.78rem; margin-left: 2px; }
.col-data small { display: block; font-size: 0.7rem; color: var(--accent-text); max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.tabela-ponto tr.dia-descanso td { background: var(--accent-glow); }
.tabela-ponto tr.dia-abonado td { opacity: 0.75; }
.tabela-ponto tr.dia-falta td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.tabela-ponto tr.dia-erro td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.tabela-ponto tr:has(+ .linha-alertas:not([hidden])) td { border-bottom: 0; }
.linha-alertas td { padding: 0 0.4rem 0.6rem 0.4rem; display: table-cell; }
.linha-alertas td span { display: inline-block; margin: 2px 12px 2px 0; font-size: 0.76rem; }

.alerta-erro { color: var(--danger); }
.alerta-aviso { color: var(--pending); }
.alerta-info { color: var(--text-muted); }
.alerta-erro::before { content: "● "; }
.alerta-aviso::before { content: "▲ "; }
.alerta-info::before { content: "○ "; }

.ocorrencias { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; margin-top: 0.5rem; }

@media print {
  .tabela-ponto { min-width: 0; font-size: 9pt; }
  .tabela-ponto .input, .tabela-jornada .input, .select-tipo { border: 0; background: none; padding: 0; width: auto; box-shadow: none; appearance: none; }
  .add-feriado, .chip-feriado button { display: none !important; }
  .card { break-inside: avoid; border: 0; padding: 12px 0; }
  .tabela-ponto tr { break-inside: avoid; }
}
