/* Rito — folha de estilo única. Tokens no :root; a cor de marca vem do escritório. */
@font-face { font-family: "Plex Sans"; src: url("../fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/IBMPlexSans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Serif"; src: url("../fonts/IBMPlexSerif-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Serif"; src: url("../fonts/IBMPlexSerif-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ink: #1C2333;
  --ink-soft: #586273;
  --ink-faint: #8A93A2;
  --paper: #FFFFFF;
  --desk: #EDF0F3;
  --desk-2: #E3E7EC;
  --rule: #D8DEE5;
  --rule-strong: #BCC5D0;
  --brand: #7A2335;
  --brand-ink: #FFFFFF;
  --brand-weak: color-mix(in srgb, var(--brand) 9%, var(--paper));
  --brand-line: color-mix(in srgb, var(--brand) 35%, var(--paper));
  --ok: #1E7A4E;   --ok-bg: #E4F3EB;
  --warn: #9A5300; --warn-bg: #FBEFDD;
  --danger: #B3261E; --danger-bg: #FBE6E4;
  --info: #1F5C99; --info-bg: #E3EDF8;
  --focus: #2B6CB0;
  --sans: "Plex Sans", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Plex Serif", "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --r-sm: 6px; --r-md: 10px;
  --shadow: 0 1px 2px rgba(28, 35, 51, .06);
  --sidebar: 252px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #E6E9EF; --ink-soft: #A5AEBD; --ink-faint: #7A8494;
    --paper: #1A1F2B; --desk: #12161F; --desk-2: #0E1219; --rule: #2C3443; --rule-strong: #3D4758;
    --brand-weak: color-mix(in srgb, var(--brand) 22%, var(--paper));
    --brand-line: color-mix(in srgb, var(--brand) 55%, var(--paper));
    --ok: #5CC28F; --ok-bg: #173226; --warn: #E8A65A; --warn-bg: #36270F;
    --danger: #F08A80; --danger-bg: #3A1A18; --info: #7FB2EA; --info-bg: #15283D; --focus: #7FB2EA;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.55 var(--sans); color: var(--ink); background: var(--desk); }
img { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font: 600 28px/1.2 var(--serif); letter-spacing: -.01em; }
h2 { font: 600 19px/1.3 var(--sans); }
h3 { font: 600 16px/1.35 var(--sans); }
p { margin: 0 0 .8em; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 20px 0; }
code, .code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; background: var(--desk); padding: 2px 6px; border-radius: 4px; word-break: break-all; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); font: 500 14px/1 var(--sans);
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: filter .12s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { filter: brightness(.95); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:hover { background: var(--desk); filter: none; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--brand); padding: 0 8px; }
.btn-quiet:hover { background: var(--brand-weak); filter: none; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { min-height: 30px; padding: 0 11px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
form.inline { display: inline; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions.end { justify-content: flex-end; }

/* ---------- Formulários ---------- */
.field { margin-bottom: 16px; min-width: 0; }
.field label, .label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--ink-faint); font-size: 12.5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule-strong); border-radius: var(--r-sm); }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
input[type=color] { width: 56px; height: 40px; padding: 3px; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--paper); cursor: pointer; }
input[type=file] { font: inherit; font-size: 14px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.field-help { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }
.field-error { margin: 6px 0 0; font-size: 13px; color: var(--danger); font-weight: 500; }
.input-reveal { position: relative; }
.input-reveal input { padding-right: 84px; }
.input-reveal .reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--ink-soft); font: 500 12.5px var(--sans); padding: 6px 8px; cursor: pointer; border-radius: 4px; }
.input-reveal .reveal:hover { color: var(--ink); background: var(--desk); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.check-label { display: block; font-weight: 500; }
.check-help { display: block; color: var(--ink-soft); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 18px; }
.span-2 { grid-column: span 2; }
.fieldset { border: 0; padding: 0; margin: 0 0 8px; }
.fieldset legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--rule); }

/* ---------- Mensagens ---------- */
.flash-stack { display: grid; gap: 8px; margin-bottom: 18px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r-sm); border: 1px solid; font-size: 14px; }
.alert p:last-child { margin-bottom: 0; }
.alert-success { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); }
.alert-error { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.alert-warning { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }
.alert-info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }
.alert .alert-close { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; opacity: .7; }
.alert a { color: inherit; font-weight: 600; }
.result { margin-top: 10px; font-size: 13.5px; }
.result.ok { color: var(--ok); } .result.err { color: var(--danger); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tone-ok { background: var(--ok-bg); color: var(--ok); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-danger { background: var(--danger-bg); color: var(--danger); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-muted { background: var(--desk); color: var(--ink-soft); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 4px; background: var(--desk); color: var(--ink-soft); font-size: 12.5px; font-weight: 500; }

/* ---------- Painéis e tabelas ---------- */
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow); margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--rule); }
.panel-head h2 { font-size: 16px; }
.panel-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.panel-body { padding: 20px; }
.panel-body > :last-child { margin-bottom: 0; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--rule); background: color-mix(in srgb, var(--desk) 45%, var(--paper)); border-radius: 0 0 var(--r-md) var(--r-md); }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--ink-soft); padding: 10px 14px; border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--desk) 40%, var(--paper)); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--desk) 35%, var(--paper)); }
.table .t-right { text-align: right; }
.table a.row-link { color: var(--ink); font-weight: 500; text-decoration: none; }
.table a.row-link:hover { color: var(--brand); text-decoration: underline; }
.cell-sub { display: block; font-size: 12.5px; color: var(--ink-soft); }
.empty { padding: 36px 24px; text-align: center; color: var(--ink-soft); }
.empty-title { font-weight: 600; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 10px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 9px 22px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--ink-soft); }
dl.facts dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* Números de resumo: régua horizontal, não cards repetidos */
.ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); margin-bottom: 20px; overflow: hidden; }
.ledger > * { padding: 16px 20px; border-right: 1px solid var(--rule); }
.ledger > *:last-child { border-right: 0; }
.ledger .lv { font: 600 22px/1.2 var(--serif); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger .lk { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.ledger .lv.warn { color: var(--warn); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--brand); border-bottom-color: var(--brand); }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.cols-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.stack > * + * { margin-top: 12px; }
.stack > a { display: block; }
.split { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Estrutura do app ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--paper); border-right: 1px solid var(--rule); display: flex; flex-direction: column; }
.brandbar { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.brandbar img { max-height: 34px; max-width: 150px; object-fit: contain; }
.brand-mark { width: 34px; height: 34px; border-radius: 7px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font: 600 15px var(--serif); flex: none; }
.brand-name { font-weight: 600; font-size: 14.5px; line-height: 1.25; min-width: 0; overflow-wrap: anywhere; }
.brand-sub { display: block; font-weight: 400; font-size: 12px; color: var(--ink-soft); }
.nav { padding: 10px 10px 18px; flex: 1; }
.nav-group { margin-top: 14px; }
.nav-title { padding: 0 10px 6px; font-size: 12px; color: var(--ink-faint); font-weight: 500; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 14px; }
.nav a:hover { background: var(--desk); color: var(--ink); }
.nav a.active { background: var(--brand-weak); color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.nav a .soon { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--ink-faint); }
.scrim { display: none; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--ink-soft); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 0 28px; height: 60px; background: color-mix(in srgb, var(--desk) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; background: none; border: 0; color: var(--ink); padding: 6px; cursor: pointer; border-radius: 6px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; color: var(--ink-soft); }
.icon-btn:hover { background: var(--desk-2); color: var(--ink); }
.dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); border: 2px solid var(--desk); }
.usermenu { position: relative; }
.usermenu > button { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 6px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--ink); }
.usermenu > button:hover { background: var(--desk-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 12.5px; font-weight: 600; flex: none; }
.usermenu .who { text-align: left; line-height: 1.2; font-size: 13.5px; font-weight: 500; }
.usermenu .who small { display: block; color: var(--ink-soft); font-weight: 400; font-size: 12px; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: 0 10px 30px rgba(28, 35, 51, .14); padding: 6px; display: none; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--desk); }
.content { padding: 28px; max-width: 1220px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--ink-soft); max-width: 70ch; }
.crumb { font-size: 13px; margin-bottom: 6px; }
.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:hover { color: var(--brand); }
.banner { padding: 10px 28px; font-size: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--rule); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.info { background: var(--info-bg); color: var(--info); }
.banner.dark { background: var(--ink); color: var(--paper); }
.banner .btn { min-height: 30px; }
.banner.dark .btn-ghost { color: var(--paper); border-color: color-mix(in srgb, var(--paper) 40%, transparent); }
.banner.dark .btn-ghost:hover { background: color-mix(in srgb, var(--paper) 12%, transparent); }

/* Lista de passos do onboarding (é de fato uma sequência) */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--rule); }
.steps li:last-child { border-bottom: 0; }
.steps .n { counter-increment: s; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--rule-strong); display: grid; place-items: center; font: 600 13px var(--sans); color: var(--ink-soft); }
.steps .n::before { content: counter(s); }
.steps li.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.done .n::before { content: "✓"; }
.steps li.done h3 { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--rule-strong); }
.steps p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.progress { height: 6px; background: var(--desk-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

.mod-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0; }
.mod-list a { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.mod-list a:hover { background: var(--desk); }
.mod-list .ic { color: var(--brand); margin-top: 2px; }
.mod-list strong { display: block; font-weight: 500; font-size: 14px; }
.mod-list span { font-size: 12.5px; color: var(--ink-soft); }

.notif { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--rule); }
.notif:last-child { border-bottom: 0; }
.notif .mark { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--rule-strong); }
.notif.unread .mark { background: var(--brand); }
.notif.level-danger .mark { background: var(--danger); }
.notif-title { font-weight: 500; }
.notif-time { font-size: 12.5px; color: var(--ink-faint); }

/* Gráfico de barras simples (receita) */
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; align-items: end; height: 170px; padding: 8px 4px 0; }
.bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; }
.bar i { display: block; width: 100%; max-width: 46px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar b { font-size: 11.5px; font-weight: 500; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.bar span { font-size: 12px; color: var(--ink-soft); }

/* Matriz de permissões */
.perm-group { border: 1px solid var(--rule); border-radius: var(--r-md); margin-bottom: 14px; }
.perm-group h3 { padding: 11px 16px; border-bottom: 1px solid var(--rule); font-size: 14.5px; display: flex; justify-content: space-between; align-items: center; }
.perm-group .check { padding: 9px 16px; border-bottom: 1px solid var(--rule); }
.perm-group .check:last-child { border-bottom: 0; }

/* Planos */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.plan { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 22px; display: flex; flex-direction: column; position: relative; }
.plan.highlight { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.plan.current { border-style: dashed; }
.plan .ribbon { position: absolute; top: -11px; left: 20px; background: var(--brand); color: var(--brand-ink); font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 999px; }
.plan h3 { font: 600 20px var(--serif); }
.plan .desc { color: var(--ink-soft); font-size: 14px; min-height: 42px; margin: 6px 0 14px; }
.plan .price { font: 600 30px/1 var(--serif); font-variant-numeric: tabular-nums; }
.plan .price small { font: 400 14px var(--sans); color: var(--ink-soft); }
.plan .price-alt { font-size: 13px; color: var(--ink-soft); margin: 6px 0 16px; min-height: 20px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 18px; font-size: 14px; flex: 1; }
.plan li { padding: 5px 0 5px 22px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 10px; height: 5px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.plan li.limit::before { border: 0; width: 6px; height: 6px; background: var(--ink-faint); border-radius: 50%; transform: none; top: 12px; left: 4px; }
.cycle-switch { display: inline-flex; padding: 3px; background: var(--desk-2); border-radius: 8px; gap: 2px; }
.cycle-switch button { border: 0; background: transparent; padding: 7px 14px; border-radius: 6px; font: 500 14px var(--sans); color: var(--ink-soft); cursor: pointer; }
.cycle-switch button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
[data-cycle="monthly"] [data-cycle-show="yearly"], [data-cycle="yearly"] [data-cycle-show="monthly"] { display: none !important; }
.meter { display: grid; gap: 4px; }
.meter .bar-track { height: 6px; background: var(--desk-2); border-radius: 999px; overflow: hidden; }
.meter .bar-track span { display: block; height: 100%; background: var(--ink-soft); }
.meter .bar-track span.full { background: var(--warn); }

/* PIX */
.pix-box { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.qr { width: 200px; height: 200px; background: #fff; padding: 10px; border: 1px solid var(--rule); border-radius: var(--r-sm); }
.qr svg { width: 100%; height: 100%; display: block; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; min-width: 0; }
.copy-field input[readonly] { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }

/* ---------- Telas de acesso (auth) ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); }
.auth-aside { background: var(--ink); color: #E8EBF0; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside .brand-mark { background: var(--brand); }
.auth-aside h2 { font: 500 30px/1.25 var(--serif); max-width: 22ch; color: #fff; letter-spacing: -.01em; margin-bottom: 14px; }
.auth-aside p { color: #AEB6C3; max-width: 46ch; }
.auth-aside .folio { position: absolute; right: 48px; bottom: 96px; width: 330px; transform: rotate(-3deg); }
.auth-main { background: var(--paper); padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; }
.auth-main.wide { justify-content: flex-start; }
.auth-main h1 { font-size: 26px; margin-bottom: 6px; }
.auth-main .lead { color: var(--ink-soft); margin-bottom: 26px; }
.auth-links { margin-top: 18px; font-size: 14px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.auth.single { grid-template-columns: 1fr; background: var(--desk); }
.auth.single .auth-main { max-width: 760px; width: 100%; margin: 40px auto; border-radius: var(--r-md); border: 1px solid var(--rule); justify-content: flex-start; }
.checklist { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 6px; font-size: 14px; }
.checklist li { display: flex; gap: 8px; align-items: center; }
.checklist .yes { color: var(--ok); font-weight: 600; } .checklist .no { color: var(--danger); font-weight: 600; }

/* Peça "publicação capturada" usada no acesso e no site */
.slip { background: #FBFBF8; color: #22262E; border-radius: 4px; padding: 18px 20px 16px; box-shadow: 0 18px 40px rgba(0,0,0,.35); font-size: 12.5px; line-height: 1.55; border-top: 5px solid var(--brand); }
.slip .slip-meta { display: flex; justify-content: space-between; font-size: 11px; color: #6B7280; margin-bottom: 8px; }
.slip .slip-text mark { background: color-mix(in srgb, var(--brand) 18%, #fff); color: inherit; padding: 0 2px; border-radius: 2px; }
.slip .slip-out { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #C9CDD4; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.slip .slip-out strong { font: 600 18px var(--serif); color: var(--brand); }

/* ---------- Site público ---------- */
.site-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 40px; max-width: 1240px; margin: 0 auto; gap: 16px; }
.site-head nav { display: flex; gap: 20px; align-items: center; font-size: 14.5px; }
.site-head nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-head nav a:not(.btn):hover { color: var(--brand); }
.hero { max-width: 1240px; margin: 0 auto; padding: 48px 40px 72px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; }
.hero h1 { font: 600 clamp(36px, 4.6vw, 56px)/1.08 var(--serif); letter-spacing: -.02em; max-width: 16ch; }
.hero .lead { font-size: 18px; color: var(--ink-soft); max-width: 50ch; margin: 22px 0 30px; line-height: 1.6; }
.hero-figure { position: relative; padding: 24px 0 72px 24px; }
.hero-figure .slip { font-size: 13.5px; max-width: 470px; }
.hero-figure .slip + .slip { position: absolute; right: -8px; bottom: -64px; width: 250px; transform: rotate(2.5deg); box-shadow: 0 14px 30px rgba(28,35,51,.22); border-top-color: var(--ink); }
.hero-figure .timeline { margin-top: 16px; display: flex; gap: 6px; }
.hero-figure .timeline span { flex: 1; height: 26px; border-radius: 3px; background: var(--desk-2); font-size: 11px; display: grid; place-items: center; color: var(--ink-soft); }
.hero-figure .timeline span.off { background: transparent; border: 1px dashed var(--rule-strong); }
.hero-figure .timeline span.due { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.band { background: var(--paper); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.band-inner { max-width: 1240px; margin: 0 auto; padding: 64px 40px; }
.band h2 { font: 600 30px/1.2 var(--serif); margin-bottom: 10px; max-width: 26ch; }
.band .intro { color: var(--ink-soft); max-width: 62ch; margin-bottom: 36px; font-size: 16.5px; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 2px solid var(--ink); }
.flow > div { padding: 18px 22px 6px 0; }
.flow .step-n { font: 600 14px var(--serif); color: var(--brand); }
.flow h3 { margin: 6px 0 6px; font-size: 16.5px; }
.flow p { color: var(--ink-soft); font-size: 14.5px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 40px; }
.features h3 { display: flex; gap: 10px; align-items: center; font-size: 16px; margin-bottom: 6px; }
.features .ic { color: var(--brand); }
.features p { color: var(--ink-soft); font-size: 14.5px; }
.site-foot { max-width: 1240px; margin: 0 auto; padding: 30px 40px 50px; color: var(--ink-soft); font-size: 13.5px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-foot a { color: var(--ink-soft); }

/* E-mail preview */
.email-preview { border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; background: #F3F4F6; }
.email-preview iframe { width: 100%; height: 520px; border: 0; display: block; background: #F3F4F6; }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
  .cols { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; gap: 30px; }
  .hero-figure { max-width: 560px; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(15, 20, 30, .4); z-index: 35; display: none; }
  .scrim.open { display: block; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .content { padding: 20px 16px; }
  .banner { padding: 10px 16px; }
  .usermenu .who { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { padding: 32px 22px; }
  .cols-even { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-head { padding: 16px 20px; }
  .site-head nav a:not(.btn) { display: none; }
  .hero, .band-inner { padding-left: 20px; padding-right: 20px; }
  .pix-box { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .features, .flow { grid-template-columns: 1fr; }
  .ledger > div { border-right: 0; border-bottom: 1px solid var(--rule); }
  .steps li { grid-template-columns: 30px minmax(0, 1fr); }
  .steps li .btn { grid-column: 2; justify-self: start; }
  h1 { font-size: 24px; }
  .hero-figure .slip + .slip { position: static; width: auto; margin-top: 14px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .banner, .actions, .btn { display: none !important; }
  .shell { display: block; } body { background: #fff; }
}

/* Diálogo de confirmação */
dialog.confirm { border: 1px solid var(--rule); border-radius: var(--r-md); padding: 22px; max-width: 420px; width: calc(100% - 32px); background: var(--paper); color: var(--ink); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog.confirm::backdrop { background: rgba(15, 20, 30, .45); }
dialog.confirm p { margin: 0 0 18px; font-size: 15px; }

/* ---------- Módulos jurídicos e financeiros ---------- */
.nav a .count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: 11.5px; font-weight: 600; text-align: center; line-height: 20px; }
.nav a .count.danger { background: var(--danger); color: #fff; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--rule); }
.row-item:last-child { border-bottom: 0; }
a.row-item:hover { background: color-mix(in srgb, var(--desk) 50%, var(--paper)); }
.row-item.focus { background: var(--brand-weak); }
.date-chip { width: 46px; flex: none; text-align: center; border-radius: 8px; padding: 4px 0; line-height: 1.1; }
.date-chip b { display: block; font: 600 18px var(--serif); }
.date-chip span { font-size: 11.5px; text-transform: lowercase; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details.small summary { cursor: pointer; color: var(--brand); margin-top: 2px; }

/* Fila de publicações */
.pub { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.pub:hover { background: color-mix(in srgb, var(--desk) 50%, var(--paper)); }
.pub-date { text-align: center; border-right: 1px solid var(--rule); padding-right: 12px; }
.pub-date b { display: block; font: 600 17px var(--serif); }
.pub-date span { font-size: 11.5px; color: var(--ink-soft); }
.pub-title { font-weight: 600; }
.pub-text { font-size: 14px; color: var(--ink-soft); margin: 3px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pub-meta { font-size: 12.5px; color: var(--ink-faint); }
.pub-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.pub-full { font: 15px/1.75 var(--serif); white-space: normal; max-height: 70vh; overflow-y: auto; }
.ai-panel { border-color: var(--brand-line); }
.ai-panel .panel-head h2 { display: flex; gap: 8px; align-items: center; color: var(--brand); }

/* Linha do tempo de andamentos */
.timeline { list-style: none; margin: 0; padding: 8px 20px 16px 20px; }
.timeline li { position: relative; padding: 10px 0 10px 22px; border-left: 2px solid var(--rule); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--rule-strong); }
.timeline li.tl-djen::before { border-color: var(--brand); background: var(--brand); }
.timeline li.tl-interno::before { border-color: var(--ok); }
.timeline .tl-date { font-weight: 600; font-size: 13px; margin-right: 8px; }
.timeline .tl-src { font-size: 11.5px; color: var(--ink-faint); }
.timeline p { margin: 2px 0 0; font-size: 14px; }
.timeline.compact { padding: 6px 0 0; }
.chat { display: grid; gap: 8px; max-height: 360px; overflow-y: auto; }
.msg { padding: 10px 13px; border-radius: 10px; font-size: 14px; max-width: 90%; }
.msg-user { background: var(--desk); justify-self: end; }
.msg-assistant { background: var(--brand-weak); }

/* Calendário mensal */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-h { padding: 8px; font-size: 12px; color: var(--ink-soft); text-align: center; border-bottom: 1px solid var(--rule); }
.cal-d { min-height: 104px; padding: 4px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d.out { background: color-mix(in srgb, var(--desk) 45%, var(--paper)); }
.cal-d.out .cal-n { color: var(--ink-faint); }
.cal-n { align-self: flex-end; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: 13px; color: var(--ink); text-decoration: none; }
.cal-n:hover { background: var(--desk-2); }
.cal-d.today .cal-n { background: var(--brand); color: var(--brand-ink); }
.cal-ev { display: block; font-size: 11.5px; line-height: 1.3; padding: 2px 5px; border-radius: 4px; background: var(--info-bg); color: var(--info); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.t-audiencia, .cal-ev.t-sessao { background: var(--brand-weak); color: var(--brand); }
.cal-ev.t-prazo { background: var(--warn-bg); color: var(--warn); }
.cal-ev.t-interno { background: var(--desk-2); color: var(--ink-soft); }

/* Quadros (tarefas, captação) */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; align-items: start; }
.kanban.six { grid-template-columns: repeat(6, minmax(190px, 1fr)); }
.kcol { background: var(--desk-2); border-radius: var(--r-md); padding: 10px; min-height: 140px; }
.kcol.drop { outline: 2px dashed var(--brand); outline-offset: -4px; }
.kcol h2 { font-size: 14px; padding: 4px 4px 10px; }
.kcard { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.kcard.dragging { opacity: .5; }
.kcard-title { display: block; font-weight: 500; color: var(--ink); text-decoration: none; margin-bottom: 4px; }
.kcard-move { display: flex; justify-content: space-between; margin-top: 8px; gap: 6px; }
.kcard-move select { min-height: 30px; font-size: 12.5px; padding: 2px 6px; }

/* Editor de modelos */
.editor-bar { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--rule-strong); border-bottom: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; background: var(--desk); }
.editor-bar button { border: 1px solid transparent; background: transparent; padding: 4px 9px; border-radius: 4px; cursor: pointer; font: 500 13px var(--sans); color: var(--ink); }
.editor-bar button:hover { background: var(--paper); border-color: var(--rule); }
.editor { min-height: 460px; border: 1px solid var(--rule-strong); border-radius: 0 0 var(--r-sm) var(--r-sm); padding: 28px 34px; background: #fff; color: #111; font: 15px/1.7 "Times New Roman", Georgia, serif; outline: none; overflow-y: auto; max-height: 75vh; }
.editor:focus { border-color: var(--focus); }
.editor h2 { text-align: center; font-size: 17px; margin-bottom: 14px; }
.editor p { text-align: justify; }
.vars .pill { border: 1px solid var(--rule); cursor: pointer; margin: 0 4px 6px 0; font: 500 12.5px var(--sans); }
.vars .pill:hover { border-color: var(--brand); color: var(--brand); }
.tool-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tool-opt input { position: absolute; opacity: 0; }
.tool-opt span { display: inline-block; padding: 7px 12px; border: 1px solid var(--rule-strong); border-radius: 999px; font-size: 13.5px; cursor: pointer; }
.tool-opt input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.tool-opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.bars.two .pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bars.two .pair i { width: 40%; max-width: 22px; }
.bars.two .pair i.desp { background: var(--rule-strong); }
.bars.two .bar { height: 150px; }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: middle; background: var(--brand); }
.legend.d { background: var(--rule-strong); }

/* Portal do cliente */
.portal-head { background: var(--paper); border-bottom: 1px solid var(--rule); }
.portal-inner { max-width: 860px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.portal-head .portal-inner { padding-top: 14px; padding-bottom: 14px; }

@media (max-width: 880px) {
  .cal-d { min-height: 64px; }
  .cal-ev { font-size: 0; height: 6px; padding: 0; }
  .pub { grid-template-columns: 52px minmax(0, 1fr); }
  .pub-side { grid-column: 2; flex-direction: row; align-items: center; }
  .kanban, .kanban.six { grid-template-columns: repeat(4, 260px); }
  .kanban.six { grid-template-columns: repeat(6, 230px); }
}
.cal-d.hol { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--warn) 7%, transparent) 6px 12px); }
.cal-hol { font-size: 10.5px; color: var(--warn); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; order: -1; }
