:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e5e7ef;
  --text: #1a1c28;
  --muted: #6a6f84;
  --accent: #5b54e8;
  --accent-ink: #ffffff;
  --accent-soft: #eeedfd;
  --ok: #138a5b;
  --ok-soft: #e4f6ee;
  --warn: #a8670a;
  --warn-soft: #fdf3e1;
  --bad: #c43a3a;
  --bad-soft: #fdeaea;
  --info: #2a6fd6;
  --info-soft: #e7f0fd;
  --shadow: 0 1px 2px rgba(20, 22, 40, .04), 0 4px 16px rgba(20, 22, 40, .05);
  --shadow-lg: 0 10px 40px rgba(20, 22, 40, .18);
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1016;
    --surface: #161922;
    --surface-2: #1c202b;
    --border: #272b38;
    --text: #e8eaf2;
    --muted: #979cb0;
    --accent: #7d77f2;
    --accent-soft: #23223f;
    --ok: #3ccf8e;
    --ok-soft: #12291f;
    --warn: #f0b04a;
    --warn-soft: #2e2413;
    --bad: #f07272;
    --bad-soft: #321819;
    --info: #6aa5f7;
    --info-soft: #152238;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 18px; height: 18px; flex-shrink: 0; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-family: var(--serif); font-weight: 600; font-size: 30px; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #8f5be8); color: #fff;
  font-family: Georgia, serif; font-size: 21px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; }
.brand-text small { color: var(--muted); font-size: 12px; }
#nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 500;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.ativo { background: var(--accent-soft); color: var(--accent); }
.nav-cta { margin-top: auto; justify-content: center; }

.main { padding: 32px 40px 64px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; max-width: 640px; }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
section + section { margin-top: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }

/* ---------- Componentes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.step {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700;
}

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 9px 15px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad-soft); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 18px; font-size: 15px; width: 100%; }
.btn svg { width: 16px; height: 16px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted);
}
.badge svg { width: 13px; height: 13px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

.aviso { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; align-items: flex-start; }
.aviso svg { margin-top: 1px; }
.aviso.warn { background: var(--warn-soft); color: var(--warn); }
.aviso.bad { background: var(--bad-soft); color: var(--bad); }
.aviso.info { background: var(--info-soft); color: var(--info); }
.aviso a { color: inherit; font-weight: 600; text-decoration: underline; }
.aviso ul { margin: 4px 0 0; padding-left: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted); }
.field small { color: var(--muted); font-size: 12px; }
.opcao { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; cursor: pointer; font-size: 14px; }
.opcao[hidden] { display: none; }
.opcao input { margin-top: 3px; width: auto; flex: none; accent-color: var(--accent, currentColor); }
.opcao small { display: block; color: var(--muted); font-size: 12px; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; }
.row { display: flex; gap: 8px; }
.row > :first-child { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 14px; }
.spacer { flex: 1; }

/* ---------- Painel ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { display: flex; gap: 14px; align-items: center; }
.stat-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon.warn { background: var(--warn-soft); color: var(--warn); }
.stat-icon.ok { background: var(--ok-soft); color: var(--ok); }
.stat-icon.info { background: var(--info-soft); color: var(--info); }
.stat strong { display: block; font-size: 25px; line-height: 1.1; font-weight: 700; }
.stat span { color: var(--muted); font-size: 13px; }

.test-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.test-card {
  --cor: hsl(var(--hue) 68% 56%);
  --cor-soft: hsl(var(--hue) 75% 95%);
  position: relative; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); overflow: hidden; transition: transform .15s, box-shadow .15s;
}
@media (prefers-color-scheme: dark) { .test-card { --cor-soft: hsl(var(--hue) 35% 18%); --cor: hsl(var(--hue) 70% 68%); } }
.test-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--cor); }
.test-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.test-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sigla {
  display: grid; place-items: center; min-width: 46px; height: 46px; padding: 0 8px; border-radius: 12px;
  background: var(--cor-soft); color: var(--cor); font-weight: 700; font-size: 14px;
}
.test-card .desc { color: var(--muted); font-size: 13px; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.test-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.test-card-foot > span { font-size: 12.5px; color: var(--muted); }
.test-card-foot div { display: flex; gap: 6px; }
.test-card.novo { align-items: center; justify-content: center; text-align: center; border-style: dashed; box-shadow: none; color: var(--muted); min-height: 200px; }
.test-card.novo::before { display: none; }
.test-card.novo:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.test-card.novo svg { width: 28px; height: 28px; }

/* ---------- Listas ---------- */
.lista { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.lista-item { display: flex; align-items: center; gap: 14px; padding: 13px 18px; color: var(--text); border-top: 1px solid var(--border); }
.lista-item:first-child { border-top: 0; }
.lista-item:hover { background: var(--surface-2); text-decoration: none; }
.lista-item .info { flex: 1; min-width: 0; }
.lista-item .info strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista-item .info span { color: var(--muted); font-size: 13px; }
.avatar {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: hsl(var(--hue, 245) 70% 94%); color: hsl(var(--hue, 245) 55% 42%); font-weight: 600; font-size: 14px;
}
@media (prefers-color-scheme: dark) { .avatar { background: hsl(var(--hue, 245) 30% 22%); color: hsl(var(--hue, 245) 70% 75%); } }
.thumb-mini { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); flex-shrink: 0; }
.vazio { padding: 40px 20px; text-align: center; color: var(--muted); }
.vazio svg { width: 34px; height: 34px; margin-bottom: 8px; opacity: .6; }
.vazio p { margin-bottom: 14px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.tabela-wrap { overflow-x: auto; }
.tabela-clicavel tbody tr { cursor: pointer; }
.tabela-clicavel tbody tr:hover { background: var(--surface-2); }

.busca { position: relative; max-width: 360px; width: 100%; }
.busca svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.busca input { padding-left: 38px; }
.filtros { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filtros select { width: auto; min-width: 220px; }

/* ---------- Nova correção ---------- */
.nova-grid { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.nova-grid .lado { position: sticky; top: 24px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 34px 20px; border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; color: var(--muted); transition: border-color .15s, background .15s;
}
.dropzone svg { width: 30px; height: 30px; color: var(--accent); }
.dropzone strong { color: var(--text); }
.dropzone.sobre, .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.thumbs:empty { display: none; }
.thumb { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 3/4; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .pg { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 6px; }
.thumb button { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumb button svg { width: 14px; height: 14px; }
.provedores { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.prov { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; }
.prov:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.prov input { width: auto; margin: 3px 0 0; accent-color: var(--accent); }
.prov-body { display: flex; flex-direction: column; }
.prov-body small { color: var(--muted); font-size: 12.5px; }
.dica { font-size: 12.5px; color: var(--muted); margin-top: 12px; display: flex; gap: 8px; }
.dica svg { width: 15px; height: 15px; margin-top: 2px; }

/* ---------- Correção ---------- */
.av-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.av-side .card + .card { margin-top: 16px; }
.dados-lista { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.dados-lista dt { color: var(--muted); }
.dados-lista dd { margin: 0; font-weight: 500; }
.fotos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.fotos img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); cursor: zoom-in; display: block; }
.res-tabela input { border-color: transparent; background: transparent; padding: 6px 8px; }
.res-tabela input:hover { border-color: var(--border); }
.res-tabela input:focus { background: var(--surface); }
.res-tabela td { padding: 4px 6px; }
.res-tabela th { padding: 8px; }
.res-tabela .rm { opacity: 0; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; }
.res-tabela tr:hover .rm { opacity: 1; }
.res-tabela .rm:hover { color: var(--bad); background: var(--bad-soft); }
.processando { text-align: center; padding: 50px 20px; }
.processando h2 { margin: 18px 0 6px; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: gira 0.9s linear infinite; margin: 0 auto; }
.spinner.sm { width: 13px; height: 13px; border-width: 2px; margin: 0; }
@keyframes gira { to { transform: rotate(360deg); } }
details summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; font-size: 20px; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: '–'; }
details[open] summary { margin-bottom: 14px; }
.legenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 14px; height: 14px; border-radius: 50%; border: 3px solid; display: inline-block; }
.bruto { white-space: pre-wrap; background: var(--surface-2); padding: 14px; border-radius: 10px; font-size: 12.5px; max-height: 420px; overflow: auto; border: 1px solid var(--border); }
.leitura { white-space: pre-wrap; color: var(--text); font-size: 13.5px; margin-bottom: 14px; }

/* ---------- Skill ---------- */
.skill-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.skill-editor { min-height: 560px; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; line-height: 1.6; tab-size: 2; }
.ajuda h3 { margin-bottom: 8px; }
.ajuda ol, .ajuda ul { padding-left: 18px; margin: 0; color: var(--muted); font-size: 13px; }
.ajuda li + li { margin-top: 6px; }
.ajuda code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 12px; }

/* ---------- Config ---------- */
.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.prov-card .card-head h2 { display: flex; align-items: center; gap: 10px; }
.prov-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-weight: 700; font-size: 14px; }
.prov-logo.claude { background: #f6e6dc; color: #b8552c; }
.prov-logo.gpt { background: #dff3ec; color: #0f8a68; }
@media (prefers-color-scheme: dark) { .prov-logo.claude { background: #3a2318; color: #f0a07a; } .prov-logo.gpt { background: #11302a; color: #5fd3b1; } }
.prov-card p.muted { font-size: 13px; margin-bottom: 14px; }

/* ---------- Modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(12, 14, 24, .5); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; z-index: 50; animation: surge .15s ease-out; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-height: calc(100vh - 40px); overflow: auto; padding: 24px; border: 1px solid var(--border); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; }
.lightbox { padding: 0; background: #000; max-width: 92vw !important; border: 0; }
.lightbox img { display: block; max-width: 92vw; max-height: 90vh; margin: 0 auto; }
@keyframes surge { from { opacity: 0; } }
#toast-root { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 380px; animation: surge .2s; }
.toast.erro { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

/* ---------- Relatório impresso ---------- */
#print-root { display: none; }
@media print {
  @page { size: A4 portrait; margin: 16mm; }
  body { background: #fff; color: #000; font-size: 11.5pt; }
  .app, #modal-root, #toast-root { display: none !important; }
  #print-root { display: block; }
}
.rel { font-family: var(--font); color: #000; }
.rel header { display: flex; justify-content: space-between; border-bottom: 2px solid #222; padding-bottom: 10px; margin-bottom: 18px; }
.rel h1 { font-size: 19pt; }
.rel h2 { font-size: 12.5pt; margin: 18px 0 8px; border-bottom: 1px solid #bbb; padding-bottom: 4px; }
.rel table { font-size: 10.5pt; }
.rel th, .rel td { border: 1px solid #bbb; padding: 6px 8px; color: #000; }
.rel th { background: #f1f1f1; }
/* cada foto em uma página só: cabe na área útil do A4 (178 × 265 mm com margem de 16 mm),
   menos o título, sem distorcer (largura e altura automáticas mantêm a proporção) */
.rel .rel-foto { break-before: page; page-break-before: always; break-inside: avoid; page-break-inside: avoid; text-align: center; }
.rel .rel-foto h2 { text-align: left; }
.rel .rel-foto img { display: block; margin: 0 auto; width: auto; height: auto; max-width: 100%; object-fit: contain; border: 1px solid #bbb;
  /* na impressão, 100vh é a altura útil da página: cabe em retrato, paisagem ou com cabeçalho do navegador */
  max-height: min(240mm, calc(100vh - 22mm)); }
.rel .assinatura { margin-top: 60px; text-align: center; }
.rel .assinatura div { border-top: 1px solid #000; width: 300px; margin: 0 auto 4px; }
.rel .nota-ia { font-size: 9pt; color: #444; margin-top: 24px; }
.rel p { white-space: pre-wrap; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .av-grid, .nova-grid, .skill-grid, .config-grid { grid-template-columns: 1fr; }
  .nova-grid .lado { position: static; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .brand { padding: 0 8px 0 0; }
  .brand-text, .nav-cta { display: none; }
  #nav { flex-direction: row; }
  .nav-link span { display: none; }
  .main { padding: 22px 16px 48px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: 25px; }
}
.res-tabela td:first-child { min-width: 300px; }

/* ---------- Transcrição de inventários (IFP-II) ---------- */
.transc-bloco { margin-bottom: 10px; overflow-x: auto; }
.transc { border-collapse: collapse; width: 100%; min-width: 640px; table-layout: fixed; }
.transc th, .transc td { border: 1px solid var(--border); text-align: center; padding: 0; font-size: 12px; }
.transc th { padding: 3px 0 1px; font-weight: 600; line-height: 1.15; }
.transc th small { display: block; font-weight: 400; font-size: 10px; color: var(--muted, #6b7080); }
.transc th.rot, .transc td.rot { width: 64px; text-align: left; padding: 0 6px; font-weight: 600; }
.transc input { width: 100%; border: 0; background: transparent; text-align: center; font: 600 15px var(--font); padding: 5px 0; color: inherit; }
.transc input:focus { outline: 2px solid var(--accent, #4b5bdc); outline-offset: -2px; }
.transc td.duvida { background: var(--warn-soft); }
.transc td.branco { background: var(--bad-soft); }
.transc td.editado { box-shadow: inset 0 -3px 0 var(--accent, #4b5bdc); }
.transc-evoc tr.duvida td { background: var(--warn-soft); }
.transc-evoc tr.branco td { background: var(--bad-soft); }
.transc-evoc tr.riscada td { text-decoration: line-through; color: var(--muted, #6b7080); }
.transc-evoc tr.editado td:first-child { box-shadow: inset 3px 0 0 var(--accent, #4b5bdc); }
.transc-evoc td.num { width: 32px; text-align: center; }
.legenda-transc { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; margin-bottom: 10px; }
.legenda-transc i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1px solid var(--border); }
.rel .transc { min-width: 0; font-size: 9pt; }
.rel .transc th, .rel .transc td { padding: 2px 0; border-color: #bbb; }
.rel .transc th.rot, .rel .transc td.rot { width: 52px; padding: 0 4px; }

/* ---------- Usuário logado ---------- */
.usuario-box { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.usuario-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); padding: 4px; border-radius: 10px; }
.usuario-link:hover { background: var(--surface-2); text-decoration: none; }
.usuario-link .avatar { width: 34px; height: 34px; font-size: 13px; }
.usuario-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.usuario-txt strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usuario-txt small { color: var(--muted); font-size: 11.5px; }
#sair .usuario-txt { display: none; }
#sair svg { width: 18px; height: 18px; }

/* ---------- Login ---------- */
body.deslogado .app { display: none; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.login { width: 100%; max-width: 400px; padding: 30px 28px; }
.login h1 { font-size: 24px; margin-bottom: 16px; }
.login-marca { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-marca div { display: flex; flex-direction: column; line-height: 1.25; }
.login-marca small { color: var(--muted); font-size: 12.5px; }

/* ---------- Fotos: câmera e celular ---------- */
.fotos-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fotos-acoes:empty { display: none; }
#celularStatus:not(:empty) { margin-top: 10px; }
.so-celular { display: none !important; }
@media (pointer: coarse) {
  .so-celular { display: inline-flex !important; }
  .dropzone .so-celular { display: block !important; }
  .so-pc { display: none !important; }
  .fotos-acoes .btn { flex: 1; justify-content: center; padding: 14px; font-size: 16px; }
}
.qr-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr { width: 220px; height: 220px; flex-shrink: 0; background: #fff; border-radius: 12px; padding: 6px; display: grid; place-items: center; }
.qr svg { width: 100%; height: 100%; }
.qr-passos { flex: 1; min-width: 200px; padding-left: 18px; display: grid; gap: 8px; }

/* ---------- Administração ---------- */
.perfil-grid { align-items: start; }
.cobranca-filtros { align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.cobranca-filtros .field { margin-bottom: 0; }
.tabela-clicavel tbody tr { cursor: pointer; }

@media print { #login-root { display: none !important; } }
@media (max-width: 820px) {
  .usuario-box { margin: 0 0 0 auto; padding: 0; border: 0; }
  .usuario-box .usuario-txt { display: none; }
}
.field[hidden] { display: none !important; }
