/* pixcob: base visual. Sem CDN, sem estilo inline (a política de segurança só aceita arquivos do próprio app).
   Estrutura: tokens -> base -> layout (menu lateral) -> componentes -> telas. */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --ink: #172033;
  --ink-2: #3b465c;
  --muted: #5b6578;
  --line: #e0e5ee;
  --line-strong: #c8d0de;
  --brand: #1d4ed8;
  --brand-dark: #1a3fae;
  --brand-soft: #e8efff;
  --side: #0f1d38;
  --side-ink: #c9d3e8;
  --ok: #157a3b;
  --ok-soft: #e6f5ec;
  --warn: #9a5b00;
  --warn-soft: #fff1d2;
  --bad: #b42318;
  --bad-soft: #fdeceb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* -------------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); background: var(--bg); color: var(--ink); }
h1 { font-size: 1.55rem; line-height: 1.25; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 1rem 0 .5rem; }
p { margin: 0 0 .75rem; }
a { color: var(--brand); }
.muted { color: var(--muted); font-size: .9rem; }
.mono { font-family: var(--mono); font-size: .88rem; word-break: break-all; }
.right { text-align: right; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.help { color: var(--muted); font-size: .85rem; margin: .2rem 0 .6rem; }
.optional { font-weight: 400; color: var(--muted); font-size: .85rem; }
.required { color: var(--bad); font-weight: 600; font-size: .85rem; }
:focus-visible { outline: 3px solid #93b4ff; outline-offset: 2px; }

/* ------------------------------------------------------------------ layout */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-ink); padding: 1.1rem .9rem; display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; padding: .2rem .5rem; letter-spacing: .01em; }
.sidebar .brand img { display: block; width: auto; }
.sidebar .brand small { display: block; font-weight: 400; font-size: .75rem; color: #8fa0c4; }
.nav { display: flex; flex-direction: column; gap: .15rem; }
.nav a { color: var(--side-ink); text-decoration: none; padding: .55rem .75rem; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .14); color: #fff; }
.nav .nav-sep { height: 1px; background: rgba(255, 255, 255, .12); margin: .5rem .5rem; }
.who { margin-top: auto; padding: .75rem; border-radius: 10px; background: rgba(255, 255, 255, .06); font-size: .85rem; }
.who strong { color: #fff; display: block; }
.who form { margin-top: .5rem; }
.who .link { color: #b9c7e6; background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.mobile-bar { display: none; }
.scrim { display: none; }
.sidebar { grid-column: 1; grid-row: 1; align-self: start; }
.main { grid-column: 2; grid-row: 1; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.main { min-width: 0; }
.container { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.75rem 3rem; }
.page-head { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-head .sub { color: var(--muted); font-size: .95rem; }
.page-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: .6rem; font-size: .9rem; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--brand); text-decoration: underline; }

/* páginas sem menu (login, erro) */
body.bare { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
body.bare .container { width: 100%; max-width: 460px; padding: 0; }

/* ------------------------------------------------------------- faixas/avisos */
.platform-banner { display: flex; gap: 1rem; justify-content: space-between; align-items: center; padding: .55rem 1.25rem; background: #92400e; color: #fff; font-size: .9rem; flex-wrap: wrap; }
.banner-button { margin: 0; padding: .3rem .8rem; background: #fff; color: #7c2d12; border: 0; border-radius: 6px; font: inherit; cursor: pointer; }
.homolog-banner { background: var(--warn-soft); color: var(--warn); border: 1px solid #f0cf86; border-radius: var(--radius); padding: .55rem .9rem; margin: 0 0 1rem; font-weight: 600; font-size: .9rem; }
.flash { padding: .7rem .95rem; border-radius: var(--radius); margin: 0 0 1rem; border: 1px solid transparent; }
.flash-error { background: var(--bad-soft); color: #7a1b13; border-color: #f5c2bd; }
.flash-success { background: var(--ok-soft); color: #0f5a2a; border-color: #b6e0c5; }
.flash-info { background: var(--brand-soft); color: #173a96; border-color: #c3d4fb; }
.flash-warn { background: var(--warn-soft); color: #6f4200; border-color: #f0cf86; }

/* ------------------------------------------------------------------ cartões */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; margin-bottom: 1rem; }
.card > h2:first-child, .card-head h2 { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }

/* ----------------------------------------------------------------- selos */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .12rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; background: #eef1f6; color: var(--ink-2); }
.badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-ok { background: #e3f4ea; color: #0f6a31; }
.badge-warn { background: #fff0cc; color: #7a4a00; }
.badge-orange { background: #ffe4d1; color: #983700; }
.badge-bad { background: #fde7e5; color: #a11d13; }
.badge-purple { background: #eee7fd; color: #5a2bb0; }
.badge-info { background: #e3ecff; color: #173a96; }
.badge-sky { background: #def3fa; color: #0a5b75; }
.badge-off { background: #eceff4; color: #3b465c; }
a.badge { text-decoration: none; }
.badge-lg { font-size: .9rem; padding: .22rem .8rem; }

/* ----------------------------------------------------------------- botões */
button, .button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1.05rem; border: 1px solid transparent; border-radius: 8px; background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
button:hover, .button:hover, .btn:hover { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: #f3f5f9; }
.btn-ghost { background: transparent; color: var(--brand); border-color: transparent; }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-danger { background: #fff; color: var(--bad); border-color: #efb4af; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-block { width: 100%; }
.btn-lg { padding: .75rem 1.3rem; font-size: 1rem; }
button.small, .btn-sm { padding: .3rem .7rem; font-size: .85rem; }
button.link { background: none; color: var(--brand); padding: 0; border: 0; font-weight: 500; text-decoration: underline; }
button:disabled { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }
a.action { display: inline-flex; padding: .25rem .7rem; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--brand); font-size: .85rem; font-weight: 600; text-decoration: none; }
a.action:hover { background: var(--brand-soft); }
a.link-back { display: inline-block; padding: .25rem .75rem; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink-2); text-decoration: none; font-size: .85rem; }
a.link-back:hover { background: #f3f5f9; }
.actions { display: flex; flex-direction: column; gap: .6rem; }
.actions .group-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .4rem 0 0; font-weight: 700; }
.actions form { margin: 0; }
.actions .btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.actions hr { border: 0; border-top: 1px solid var(--line); margin: .5rem 0; }
.row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.row select { max-width: 240px; }

/* -------------------------------------------------------------- formulários */
label { display: block; margin: .8rem 0 .25rem; font-weight: 600; font-size: .9rem; }
input, select, textarea { width: 100%; padding: .55rem .7rem; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 3px solid #cddcff; }
textarea.mono { min-height: 6rem; font-size: .85rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.filters { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.filters > div { flex: 1 1 150px; min-width: 130px; }
.filters .grow { flex: 2 1 240px; }
.filters > div { display: flex; flex-direction: column; }
.filters label { margin: 0 0 .25rem; }
.filters .filter-actions { flex: 0 0 auto; display: flex; gap: .5rem; align-items: center; padding-bottom: 1px; }

/* ----------------------------------------------------------------- tabelas */
.table-wrap { margin: 0 -.3rem; padding: 0 .3rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: #f8f9fc; white-space: nowrap; }
th.right, td.right { text-align: right; }
tbody tr:hover { background: #f8faff; }
tbody tr:last-child td { border-bottom: 0; }
td .cell-main { font-weight: 600; }
td .cell-sub { color: var(--muted); font-size: .82rem; }
table.kv th { background: none; text-transform: none; font-size: .9rem; letter-spacing: 0; color: var(--muted); width: 38%; font-weight: 500; }

/* ------------------------------------------------------------- abas e filtros rápidos */
nav.tabs, .chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 1rem; }
a.tab, a.chip { display: inline-flex; gap: .35rem; align-items: center; padding: .35rem .85rem; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--ink-2); text-decoration: none; font-size: .88rem; font-weight: 500; }
a.tab:hover, a.chip:hover { background: #f3f5f9; }
a.tab-on, a.chip-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .count { font-size: .75rem; opacity: .75; }

/* ------------------------------------------------- detalhe da cobrança (piloto) */
.charge-head { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1rem; }
.charge-amount { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.charge-meta { color: var(--muted); font-size: .92rem; margin-top: .25rem; }
.charge-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 1rem; align-items: start; }
.charge-side { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem 1.2rem; margin: 0; }
.facts dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.facts dd { margin: .1rem 0 0; font-weight: 600; word-break: break-word; }
.facts .wide { grid-column: span 2; }
.pay-card { text-align: center; }
.pay-card .qr { width: 220px; max-width: 100%; height: auto; margin: .2rem auto .8rem; display: block; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 10px; padding: .5rem; background: #fff; }
.qr { display: block; margin: 1rem auto; image-rendering: pixelated; }
.pay-card .copy-field { text-align: left; }
.pay-card textarea { min-height: 4.6rem; font-size: .78rem; resize: none; background: #f8f9fc; }
.pay-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .6rem; }
.pay-actions .full { grid-column: 1 / -1; }
.pay-state { padding: 1.1rem; border-radius: var(--radius); font-weight: 600; }
.pay-state.ok { background: var(--ok-soft); color: var(--ok); }
.pay-state.off { background: #eef1f6; color: #4a5568; }
.copy-done { color: var(--ok); font-size: .85rem; font-weight: 600; min-height: 1.2rem; margin-top: .3rem; }
.notice { border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1rem; border: 1px solid; }
.notice-bad { background: var(--bad-soft); border-color: #f5c2bd; color: #7a1b13; }
.notice-warn { background: var(--warn-soft); border-color: #f0cf86; color: #6f4200; }
.notice strong { display: block; margin-bottom: .15rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 .4rem; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid var(--line); margin-left: .3rem; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -.43rem; top: .3rem; width: .75rem; height: .75rem; border-radius: 50%; background: var(--line-strong); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.timeline li.t-ok::before { background: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.timeline li.t-warn::before { background: #d98a00; box-shadow: 0 0 0 1px #d98a00; }
.timeline li.t-error::before { background: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.timeline li.t-info::before { background: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.timeline .t-title { font-weight: 600; }
.timeline .t-meta { color: var(--muted); font-size: .82rem; }
.timeline .t-line { color: var(--ink-2); font-size: .88rem; }
.tone-ok { color: var(--ok); font-weight: 600; }
.tone-warn { color: var(--warn); font-weight: 600; }
.tone-error { color: var(--bad); font-weight: 600; }
.tone-info { font-weight: 600; }

details.more { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .6rem; }
details.more > summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .9rem; }
details.more table { margin-top: .5rem; }
.charge-meta .badge { vertical-align: middle; }
.actions .btn-row .button { flex: 1 1 auto; }

/* ---------------------------------------------------------------- simulador */
details.sim { border: 2px dashed #c98a1b; border-radius: var(--radius); background: #fffaf0; margin-bottom: 1rem; }
details.sim > summary { cursor: pointer; padding: .7rem 1rem; font-weight: 700; color: #7a4b00; list-style: none; display: flex; align-items: center; gap: .6rem; }
details.sim > summary::-webkit-details-marker { display: none; }
details.sim > summary::after { content: "mostrar"; margin-left: auto; font-size: .78rem; font-weight: 500; color: #8a5a00; }
details.sim[open] > summary::after { content: "recolher"; }
details.sim .sim-body { padding: 0 1rem 1rem; }
.sim-box { border: 2px dashed #c98a1b; background: #fffaf0; }
.sim-tag { display: inline-block; background: #b36b00; color: #fff; border-radius: 4px; padding: .1rem .45rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.sim-inline { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-top: .3rem; }
.sim-notify { font-weight: 400; font-size: .8rem; color: var(--muted); }

/* ----------------------------------------------------- listas (tabela → cartões) */
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 1100px) {
  .charge-layout { grid-template-columns: 1fr; }
  .charge-side { position: static; order: -1; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .main { grid-column: 1; }
  .mobile-bar { grid-column: 1; grid-row: 1; }
  .main { grid-row: 2; }
  .sidebar { position: fixed; z-index: 30; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .18s ease; }
  .nav-toggle:checked ~ .sidebar { box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-toggle:checked ~ .scrim { display: block; }
  .scrim { position: fixed; inset: 0; background: rgba(15, 29, 56, .45); z-index: 20; }
  .mobile-bar { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 10; }
  .mobile-bar label { margin: 0; cursor: pointer; padding: .35rem .7rem; border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px; font-weight: 600; font-size: .9rem; }
  .mobile-bar .brand { color: #fff; font-weight: 700; text-decoration: none; }
  .container { padding: 1rem 1rem 2.5rem; }
  .grid2 { grid-template-columns: 1fr; }
  .charge-amount { font-size: 1.8rem; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts .wide { grid-column: 1 / -1; }
  /* tabelas viram cartões empilhados, com o nome da coluna antes de cada valor */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .75rem; padding: .35rem .2rem; background: #fff; }
  table.stack td { border: 0; padding: .3rem .7rem; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; text-align: left; flex: 0 0 38%; }
  table.stack td.cell-first { display: block; text-align: left; font-size: 1.02rem; }
  table.stack td.cell-first::before { display: none; }
  table.stack td.cell-actions { justify-content: flex-end; }
  table.stack td.cell-actions::before { display: none; }
}
@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr; }
  .pay-actions { grid-template-columns: 1fr; }
  .page-head .page-actions, .page-head .page-actions .button { width: 100%; }
}
@media print { .sidebar, .mobile-bar, .page-actions, .actions { display: none; } .shell { display: block; } }
a.cell-main { color: var(--ink); text-decoration: none; font-weight: 600; }
a.cell-main:hover { color: var(--brand); text-decoration: underline; }
.cell-sub { color: var(--muted); font-size: .82rem; }

.charge-side .card { margin-bottom: 0; }
.facts dd.money, .facts dd { color: var(--ink); }
input[type="checkbox"], input[type="radio"] { width: auto; padding: 0; margin: 0 .4rem 0 0; accent-color: var(--brand); }
label.sim-notify { display: inline-flex; align-items: center; margin: 0 0 .4rem; font-weight: 400; font-size: .8rem; color: var(--muted); }
details.sim { margin-top: 1rem; }
details.sim .row { align-items: flex-start; justify-content: flex-start; gap: 1.2rem 2rem; }
details.sim form { margin: 0; }
details.sim form.row { margin-top: .9rem; align-items: flex-end; }
details.sim form.row label:not(.sim-notify) { margin: 0; }
details.sim form.row input[name="amount"] { max-width: 180px; }
details.sim form button { margin-top: .2rem; }

/* ------------------------------------------------------------ Fase B: menus, formulários, acesso */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; padding: .3rem .75rem; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font-size: .85rem; font-weight: 600; color: var(--ink-2); user-select: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: " ▾"; font-size: .75rem; }
.menu[open] > summary { background: #f3f5f9; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 15; min-width: 250px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(16, 24, 40, .18); padding: .35rem; text-align: left; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--ink); padding: .5rem .7rem; border-radius: 6px; font: inherit; font-size: .9rem; font-weight: 500; margin: 0; cursor: pointer; text-decoration: none; }
.menu-list a:hover, .menu-list button:hover { background: #f3f5f9; }
.menu-list .danger { color: var(--bad); }
.menu-list form { margin: 0; }
.menu-list .menu-form { padding: .4rem .5rem; border-top: 1px solid var(--line); }
.menu-list .menu-form:first-child { border-top: 0; }
.menu-list .menu-form label { margin: 0 0 .2rem; font-size: .78rem; color: var(--muted); }
.menu-list .menu-form input, .menu-list .menu-form textarea { font-size: .85rem; padding: .4rem .5rem; }
.menu-list .menu-form button { margin-top: .4rem; background: var(--brand); color: #fff; text-align: center; }
.menu-list .menu-form button:hover { background: var(--brand-dark); }
.row-actions { display: flex; gap: .4rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.queue-note { margin: 0 0 1rem; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.4rem 0 .6rem; }
.section-title h2 { margin: 0; }
.form-card { max-width: 760px; margin-left: auto; margin-right: auto; }
.form-section { padding: 1.1rem 0 0; margin-top: 1.1rem; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.form-section > h2 { margin-bottom: .2rem; }
.form-section > .section-help { color: var(--muted); font-size: .88rem; margin: 0 0 .5rem; }
.form-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.inline-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form > div { flex: 1 1 200px; }
.inline-form button { margin-top: 0; }
.avatar { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; font-size: .85rem; margin-right: .6rem; flex: 0 0 auto; }
.person { display: flex; align-items: center; }
.person .cell-main { line-height: 1.2; }
.auth-card { max-width: 420px; margin: 0 auto; }
.auth-head { text-align: center; margin-bottom: 1.1rem; }
.auth-head .auth-logo { display: block; margin: 0 auto .8rem; height: 44px; width: auto; }
.auth-head h1 { font-size: 1.4rem; }
.error-card { text-align: center; padding: 2rem 1.5rem; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--line-strong); letter-spacing: -.03em; line-height: 1; }
.kpi { display: flex; flex-direction: column; gap: .15rem; }
.kpi .kpi-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .kpi-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi-grid .card { margin: 0; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: .55rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.list-plain li:last-child { border-bottom: 0; }
@media (max-width: 860px) {
  .menu-list { position: fixed; left: 1rem; right: 1rem; top: auto; bottom: 1rem; min-width: 0; }
  .form-card { max-width: none; }
}
label.check { display: flex; align-items: flex-start; gap: .5rem; font-weight: 500; margin: .9rem 0 .2rem; }
label.check input { margin-top: .2rem; flex: 0 0 auto; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.form-grid > div { min-width: 0; }
input, select { min-height: 2.6rem; }
.filters .filter-actions { flex: 0 0 auto; flex-direction: row; align-items: center; }
input[type="checkbox"], input[type="radio"] { min-height: 0; }
.sim-submit { display: flex; flex-direction: column; gap: .2rem; }
.sim-submit label.sim-notify { margin: 0; }
.sim-inline button { background: #fff; color: #7a4b00; border-color: #c98a1b; padding: .28rem .7rem; font-size: .82rem; margin: 0; }
.sim-inline button:hover { background: #fff1d2; }
.sim-inline { margin-top: .5rem; }

.cell-body { display: block; }
@media (max-width: 860px) {
  .cell-body { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; text-align: right; }
}
.charge-layout.no-side { grid-template-columns: minmax(0, 1fr); }

/* ------------------------------------------------------------- Fase C: início e painéis */
a.kpi-link { text-decoration: none; color: inherit; transition: box-shadow .12s ease, border-color .12s ease; }
a.kpi-link:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(29, 78, 216, .15); }
main a.kpi-link, main a.kpi-link:hover { color: inherit; text-decoration: none; font-weight: inherit; }
.kpi .kpi-sub { color: var(--muted); font-size: .85rem; }
.kpi .kpi-value { margin: .1rem 0; }
.delta { font-weight: 600; color: var(--muted); }
.delta-up { color: var(--ok); }
.delta-down { color: var(--bad); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.two-col > .card { margin: 0; }
.push { margin-left: auto; }
.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li { display: flex; align-items: center; gap: .8rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.ranking li:last-child { border-bottom: 0; }
.rank-n { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; font-size: .8rem; }
.chart { width: 100%; height: auto; display: block; }
.chart-bar { fill: var(--brand); }
.chart-bar:hover { fill: var(--brand-dark); }
.chart-base { stroke: var(--line-strong); stroke-width: 2; }
.chart-label { fill: var(--muted); font-size: 22px; }
.kv-table th, .kv-table td { padding: .45rem .5rem; }
.period-form { margin-bottom: 1rem; }
.notice-info { background: var(--brand-soft); border-color: #c3d4fb; color: #173a96; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
a.badge-link { text-decoration: none; }
.cell-sub { display: block; }
.error-ref { margin: 1rem 0; color: var(--muted); }
.error-ref strong { display: block; margin-top: .25rem; font-size: 1.6rem; letter-spacing: .08em; color: var(--text, #111827); }
pre.stack { background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: 8px; overflow-x: auto; font-size: .8rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.note-form textarea { width: 100%; min-height: 4.5rem; }
.group-count { font-variant-numeric: tabular-nums; font-weight: 700; }
.inline-note { display: flex; flex-direction: column; gap: .4rem; margin-top: .4rem; min-width: 11rem; }
.inline-note input { min-width: 0; width: 100%; }
a.action.mono { white-space: nowrap; }
.logo-preview { max-width: 100%; height: auto; max-height: 120px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .5rem; }
.kv-list { margin: 0; }
.kv-list > div { display: flex; gap: .75rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.kv-list dt { flex: 0 0 8.5rem; color: var(--muted); font-weight: 600; }
.kv-list dd { margin: 0; }
.kpi .kpi-value { white-space: nowrap; font-size: clamp(1.15rem, 4.8vw, 1.6rem); }

/* Paginação da fila de pagamentos (PLANO 13.11-H, achado 4) */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin: 1rem 0; }
.pager-links { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
