:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --bg-soft: #0f1218;
  --surface: #13161e;
  --surface-2: #191d27;
  --surface-3: #212633;
  --border: #252b38;
  --border-strong: #323a4b;
  --text: #e7eaf0;
  --text-2: #b4bccc;
  --muted: #828ba0;
  --primary: #7c8cff;
  --primary-2: #6573f0;
  --primary-soft: rgba(124, 140, 255, 0.14);
  --green: #3ecf8e;
  --green-soft: rgba(62, 207, 142, 0.13);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.13);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.13);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 8px 24px rgba(0, 0, 0, 0.25);
  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 14px; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; color: var(--text-2); word-break: break-all; }
::selection { background: rgba(124, 140, 255, 0.35); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { flex-shrink: 0; vertical-align: middle; }
.swatch { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.nowrap { white-space: nowrap; }
.num { text-align: right; }
.inline { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.link { color: var(--primary); font-size: 13px; }
.link:hover { color: #a5b0ff; text-decoration: underline; }

.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.brand-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #7c8cff, #3ecf8e); color: #0b0d12; }
.brand-text { display: flex; flex-direction: column; font-weight: 700; font-size: 15px; line-height: 1.15; }
.brand-text small { font-weight: 500; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--primary-soft); color: #c7cdff; }
.nav-link.active .icon { color: var(--primary); }
.sidebar-cta { margin-top: 4px; }
.sidebar-foot { margin-top: auto; font-size: 11px; color: var(--muted); padding: 0 8px; }
.sidebar { overflow-y: auto; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid var(--border); }
.sidebar-user-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-name small { font-size: 11px; font-weight: 500; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover; }
.avatar-letter { display: grid; place-items: center; background: var(--primary-soft); color: #c7cdff; font-weight: 700; font-size: 13px; }

.main-public { max-width: 720px; margin: 0 auto; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; padding: 28px; }
.auth-brand { justify-content: center; padding: 0 0 4px; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-hint { text-align: center; }
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn-discord:hover { background: #4752c4; border-color: #4752c4; color: #fff; }

.main { padding: 26px 32px 60px; width: 100%; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--surface-3); color: var(--text);
  font: 500 13px var(--font); cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: #2a3040; color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #0b0d12; font-weight: 600; }
.btn-primary:hover { background: #95a1ff; color: #0b0d12; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-ok { background: var(--green-soft); color: var(--green); border-color: rgba(62, 207, 142, 0.3); }
.btn-ok:hover { background: rgba(62, 207, 142, 0.22); color: var(--green); }
.btn-in { background: var(--green-soft); color: var(--green); border-color: rgba(62, 207, 142, 0.25); }
.btn-in:hover { background: rgba(62, 207, 142, 0.22); color: #6ee7b7; }
.btn-out { background: var(--red-soft); color: var(--red); border-color: rgba(248, 113, 113, 0.25); }
.btn-out:hover { background: rgba(248, 113, 113, 0.22); color: #fca5a5; }
.btn-danger { background: rgba(248, 113, 113, 0.16); color: #fca5a5; border-color: rgba(248, 113, 113, 0.35); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.28); color: #fff; }
.btn-icon { width: 32px; height: 32px; padding: 0; }
.btn-ok-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ok-ghost:hover { background: var(--green-soft); color: var(--green); border-color: rgba(62, 207, 142, 0.4); }
.btn-danger-ghost:hover { background: var(--red-soft); color: var(--red); border-color: rgba(248, 113, 113, 0.4); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card > h2 { margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head.spaced { margin-top: 22px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
.narrow { max-width: 560px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi-head { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; font-size: 13px; }
.kpi-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; }
.pos-bg { background: var(--green-soft); color: var(--green); }
.neg-bg { background: var(--red-soft); color: var(--red); }
.accent-bg { background: var(--primary-soft); color: var(--primary); }
.muted-bg { background: var(--surface-3); color: var(--text-2); }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.delta { display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.delta.up, .delta.good { background: var(--green-soft); color: var(--green); }
.delta.down, .delta.bad { background: var(--red-soft); color: var(--red); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--green-soft); color: var(--green); }
.badge-warn { background: var(--amber-soft); color: var(--amber); }
.badge-bad { background: var(--red-soft); color: var(--red); }
.badge-muted { background: var(--surface-3); color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; height: 20px; border-radius: 6px; font-size: 11px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.chip-muted { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.chip-link { background: var(--primary-soft); color: #b8c0ff; }
.chip-link:hover { color: #fff; }
.chip-in { background: var(--green-soft); color: var(--green); }
.chip-out { background: var(--red-soft); color: var(--red); }
.cat-pill { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.banner-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.banner-body .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner-info { border-color: rgba(124, 140, 255, 0.35); background: linear-gradient(90deg, rgba(124, 140, 255, 0.1), transparent); }
.banner-info > .icon { color: var(--primary); }
.banner-bad { border-color: rgba(248, 113, 113, 0.35); background: linear-gradient(90deg, rgba(248, 113, 113, 0.1), transparent); }
.banner-bad > .icon { color: var(--red); }
.banner-warn { border-color: rgba(251, 191, 36, 0.3); background: linear-gradient(90deg, rgba(251, 191, 36, 0.08), transparent); }
.banner-warn > .icon { color: var(--amber); }

.flashes { display: flex; flex-direction: column; gap: 8px; }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); font-weight: 500; animation: flash-in 0.2s ease-out; }
.flash-success { border-color: rgba(62, 207, 142, 0.35); color: #a7f3d0; }
.flash-error { border-color: rgba(248, 113, 113, 0.4); color: #fecaca; background: rgba(248, 113, 113, 0.08); }
.flash-info { border-color: rgba(124, 140, 255, 0.35); color: #c7d2fe; }
.flash-close { background: none; border: 0; color: inherit; opacity: 0.6; cursor: pointer; padding: 4px; display: grid; place-items: center; }
.flash-close:hover { opacity: 1; }
.flash.is-hiding { opacity: 0; transform: translateY(-4px); transition: 0.25s; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } }

.month-nav { display: flex; align-items: center; gap: 4px; }
.month-picker input { width: 160px; }

input, select, textarea {
  width: 100%;
  height: 38px; padding: 0 11px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: 14px var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 64px; line-height: 1.45; }
select { cursor: pointer; padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23828ba0' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input:hover, select:hover, textarea:hover { border-color: #3d4659; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.18); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12); }
input::placeholder, textarea::placeholder { color: #5b6476; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; padding: 0; accent-color: var(--primary); cursor: pointer; }
input[type="color"] { padding: 3px; width: 64px; cursor: pointer; }
input[type="file"] { height: auto; padding: 7px; }
input[type="file"]::file-selector-button { background: var(--surface-3); color: var(--text); border: 0; border-radius: 6px; padding: 6px 12px; margin-right: 10px; cursor: pointer; font: 500 13px var(--font); }
input[type="month"], input[type="date"] { color-scheme: dark; }
input[type="number"] { appearance: textfield; }
input[type="search"]::-webkit-search-cancel-button { filter: invert(0.6); }

.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.req { color: var(--red); }
.hint { font-size: 11.5px; color: var(--muted); }
.field-error { color: #fca5a5; font-size: 12px; font-weight: 500; }
.input-prefix, .input-suffix { position: relative; display: flex; align-items: center; }
.input-prefix span { position: absolute; left: 11px; color: var(--muted); font-size: 13px; pointer-events: none; }
.input-prefix input { padding-left: 36px; font-variant-numeric: tabular-nums; font-weight: 600; }
.input-suffix span { position: absolute; right: 12px; color: var(--muted); pointer-events: none; }
.input-suffix input { padding-right: 30px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 14px; min-height: 38px; align-items: center; }
.radio { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; color: var(--text-2); font-size: 13px; }
.field-inline { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.field-inline input { width: 96px; }
.counter { font-size: 11px; color: var(--muted); text-align: right; margin-top: -2px; }
.counter.is-near { color: var(--amber); }

.segmented { display: inline-flex; gap: 0; padding: 4px; margin: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); width: max-content; }
.seg { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 18px; border-radius: 7px; color: var(--muted); font-weight: 600; transition: 0.15s; }
.seg:hover span { color: var(--text); }
.seg-entrada input:checked + span { background: var(--green-soft); color: var(--green); }
.seg-saida input:checked + span { background: var(--red-soft); color: var(--red); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); }

.installments { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 0 14px; }
.installments[open] { padding-bottom: 14px; }
.installments summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; list-style: none; }
.installments summary::-webkit-details-marker { display: none; }
.installments summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 16px; }
.installments[open] summary::after { content: "−"; }
.installment-preview { margin-top: 12px; font-size: 13px; }
.installment-preview strong { color: var(--text); }
.scope-field { padding: 12px 14px; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--border); }

.danger-zone { border-color: rgba(248, 113, 113, 0.22); }
.danger-zone h2 { color: #fca5a5; margin-bottom: 8px; }
.danger-form, .danger-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.danger-form select { width: auto; min-width: 220px; }

.toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; }
.filters select { width: auto; height: 32px; font-size: 13px; }
.search-box { position: relative; display: flex; align-items: center; min-width: 240px; flex: 0 1 300px; }
.search-box .icon { position: absolute; left: 10px; color: var(--muted); }
.search-box input { height: 32px; padding-left: 32px; font-size: 13px; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.summary-strip { display: flex; flex-wrap: wrap; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.summary-strip > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 18px; border-right: 1px solid var(--border); min-width: 140px; }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip strong { font-size: 16px; white-space: nowrap; }
.summary-strip .strip-actions { flex-direction: row; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.summary-strip .strip-progress { flex: 1; justify-content: center; min-width: 200px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card .table-wrap { border: 0; background: transparent; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th.num { text-align: right; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.015); }
.table tfoot th { border-top: 1px solid var(--border-strong); border-bottom: 0; color: var(--text); font-size: 13px; text-transform: none; letter-spacing: 0; }
.table-compact td, .table-compact th { padding: 7px 10px; }
.table .group-row td { background: var(--bg-soft); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 6px 12px; }
.table tr.is-paid .tx-title { color: var(--text-2); }
.table tr.is-late td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.col-check { width: 36px; }
.col-actions { width: 1%; white-space: nowrap; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.tx-title { font-weight: 600; display: inline-block; margin-right: 6px; }
.tx-title:hover { color: var(--primary); }
.tx-meta { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.tx-notes { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 12px; margin-top: 3px; max-width: 520px; }
.matrix td a:hover { color: var(--primary); }

.bulk-bar { position: sticky; top: 10px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--primary); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.bulk-bar > span { margin-right: auto; }

.chart { width: 100%; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar-in { fill: var(--green); opacity: 0.9; }
.chart .bar-out { fill: var(--red); opacity: 0.85; }
.chart .bar-hit { fill: transparent; }
.chart .bar-group:hover .bar-in, .chart .bar-group:hover .bar-out { opacity: 1; }
.chart .bar-group:hover .bar-hit { fill: rgba(255, 255, 255, 0.03); }
.chart .line-balance { fill: none; stroke: var(--primary); stroke-width: 2; stroke-dasharray: 4 4; }
.legend { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-line::before { content: ""; width: 16px; border-top: 2px dashed var(--primary); }

.hbar { width: 100%; height: 8px; display: block; }
.hbar-track { fill: var(--surface-3); }
.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cat-row { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: 13px; }
.cat-row:hover .cat-name { color: #fff; }
.cat-name { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; min-width: 0; }
.cat-value { display: inline-flex; gap: 8px; align-items: baseline; font-weight: 600; white-space: nowrap; }
.cat-value small { font-weight: 500; font-size: 11px; }
.cat-list .hbar { height: 6px; }

.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list li.is-late .mini-title { color: #fca5a5; }
.mini-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mini-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-title:hover { color: var(--primary); }
.mini-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.mini-side { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 600; }
.all-done { display: flex; align-items: center; gap: 8px; color: var(--green); padding: 10px 0; }

.kv-list { list-style: none; margin: 0; padding: 0; }
.kv-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.kv-list li:last-child { border-bottom: 0; }
.kv-list li a:hover { color: var(--primary); }
.kv-list li.kv-sub { padding-top: 0; margin-top: -4px; }
.kv-list li:has(+ .kv-sub) { border-bottom: 0; }
.rank { margin: 0; padding-left: 22px; display: flex; flex-direction: column; }
.rank li { padding: 7px 0; border-bottom: 1px solid var(--border); color: var(--muted); }
.rank li > span, .rank li > strong { color: var(--text); }
.rank li { display: list-item; }
.rank li strong { float: right; margin-left: 10px; }
.rank li a:hover { color: var(--primary); }

.credit-numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.credit-numbers div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--bg-soft); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.credit-numbers strong { font-size: 16px; }
.meter { display: flex; align-items: center; gap: 10px; }
.meter .hbar { height: 10px; }
.meter-label { font-weight: 700; font-size: 13px; min-width: 52px; text-align: right; }
.meter-ok .meter-label { color: var(--green); }
.meter-warn .meter-label { color: var(--amber); }
.meter-bad .meter-label { color: var(--red); }
.credit-available { margin: 12px 0 8px; font-weight: 600; }
.credit-bad { border-color: rgba(248, 113, 113, 0.3); }
.credit-warn { border-color: rgba(251, 191, 36, 0.3); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.plan-card { display: flex; flex-direction: column; gap: 14px; transition: border-color 0.15s, transform 0.15s; }
.plan-card:hover { border-color: var(--border-strong); transform: translateY(-1px); color: inherit; }
.plan-quitado, .plan-interrompido { opacity: 0.7; }
.plan-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.plan-top h3 { font-size: 15px; margin-bottom: 4px; }
.plan-top .muted { display: inline-flex; align-items: center; gap: 4px; }
.plan-progress { display: flex; align-items: center; gap: 10px; }
.plan-progress .small { white-space: nowrap; color: var(--text-2); }
.plan-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; }
.plan-facts div { display: flex; flex-direction: column; gap: 2px; }
.plan-facts dt { font-size: 11px; color: var(--muted); }
.plan-facts dd { margin: 0; font-weight: 600; font-size: 13px; white-space: nowrap; }

.group-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 6px 0 8px; }
.group-title:not(:first-child) { margin-top: 20px; }
.cat-manage { list-style: none; margin: 0; padding: 0; }
.cat-manage li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); }
.cat-manage li:last-child { border-bottom: 0; }

.import-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px; }
.import-form input[type="file"] { width: auto; flex: 1; min-width: 240px; }
.path { margin-top: 12px; }

.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); }
.steps strong { color: var(--text); }
.card > p.muted.small { margin-top: 12px; }
.suggestions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sug { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--border); border-left-width: 3px; }
.sug-p1 { border-left-color: var(--red); }
.sug-p2 { border-left-color: var(--amber); }
.sug-p3 { border-left-color: var(--primary); }
.sug-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sug-main .badge { align-self: flex-start; }
.sug-save { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.sug-save strong { font-size: 16px; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.mini-stats div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.mini-stats strong { font-size: 16px; }
.cat-form { display: flex; align-items: center; gap: 8px; }
.cat-form select { height: 30px; font-size: 12.5px; max-width: 210px; }
.only-this { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.only-this input { width: 13px; height: 13px; }
.chart .bar-single { fill: var(--primary); opacity: 0.75; }
.chart .bar-single.is-current { fill: var(--red); opacity: 0.85; }
.chart .bar-group:hover .bar-single { opacity: 1; }
.tips { margin: 16px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.tips strong { color: var(--text); }
.cuts .card-head code { font-size: 11px; }
.due-form { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.due-form input { width: 70px; height: 30px; }
.pay-side { display: inline-flex; align-items: center; gap: 12px; }
.pay-side select { height: 30px; font-size: 12.5px; width: auto; }
#pagamentos > p.muted { margin: 8px 0 10px; }
.prev-bill-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prev-bill-form label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.prev-bill-form .input-prefix { width: 170px; }
.prev-bill-form input { height: 32px; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 56px 20px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); }
.empty p { color: var(--muted); max-width: 420px; }
.empty .btn { margin-top: 6px; }

.error-page { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 80px 20px; }
.error-code { font-size: 64px; font-weight: 800; background: linear-gradient(135deg, #7c8cff, #3ecf8e); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }

.dialog { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 22px; max-width: 420px; width: calc(100% - 32px); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); }
.dialog::backdrop { background: rgba(5, 6, 10, 0.7); backdrop-filter: blur(2px); }
.dialog h3 { font-size: 16px; margin-bottom: 8px; }
.dialog p { color: var(--text-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

@media (min-width: 2000px) {
  .main { padding: 32px 48px 72px; }
  .plan-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; gap: 10px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand-text, .sidebar-foot { display: none; }
  .nav { flex-direction: row; }
  .nav-link span { display: none; }
  .sidebar-cta { width: auto; margin: 0 0 0 auto; }
  .sidebar-cta span { display: none; }
  .main { padding: 18px 16px 48px; }
  .grid-2, .grid-2-1, .grid-1-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .kpis { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .summary-strip > div { flex: 1 1 45%; border-right: 0; border-bottom: 1px solid var(--border); }
  .plan-facts { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
