/* CrediControl 2 — identidade inspirada nas cédulas do Real:
   tinta azul-marinho, papel frio, guilloché no destaque do dia e números condensados. */

:root {
  --paper: #eef1ed;
  --surface: #ffffff;
  --surface-2: #f6f7f4;
  --ink: #17213a;
  --ink-2: #4f5a6e;
  --ink-3: #6f7889;
  --line: #dce0d9;
  --line-2: #c9cfc6;
  --brand: #2c5f8a;
  --brand-deep: #1f4a6e;
  --brand-ink: #ffffff;
  --brand-soft: #e2ebf3;
  --late: #b3261e;
  --late-soft: #fbe8e6;
  --today: #995400;
  --today-soft: #fbefdb;
  --paid: #2d7a55;
  --paid-soft: #e2f1e8;
  --future: #4f5a6e;
  --future-soft: #ebedf0;
  --s1: #2f6fad;
  --s2: #b98a2e;
  --focus: #2f6fad;
  --shadow: 0 1px 2px rgba(23, 33, 58, .06), 0 8px 24px rgba(23, 33, 58, .06);
  --sheet-shadow: 0 -8px 40px rgba(15, 21, 36, .22);
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 20px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --num: "IBM Plex Sans Condensed", "Arial Narrow", "IBM Plex Sans", system-ui, sans-serif;
  --tab-h: 64px;
  --top-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1524; --surface: #161e30; --surface-2: #1c2538; --ink: #e7ebf2; --ink-2: #a6b0c2; --ink-3: #8a95a9;
    --line: #26314a; --line-2: #33405c; --brand: #7fb0da; --brand-deep: #173a5a; --brand-ink: #0f1524; --brand-soft: #1d3149;
    --late: #f08a80; --late-soft: #3a1d22; --today: #e8b062; --today-soft: #392a15; --paid: #6cc79a; --paid-soft: #16322a;
    --future: #a6b0c2; --future-soft: #222c40; --s1: #4f8ac2; --s2: #b8893a; --focus: #7fb0da;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --sheet-shadow: 0 -8px 40px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1524; --surface: #161e30; --surface-2: #1c2538; --ink: #e7ebf2; --ink-2: #a6b0c2; --ink-3: #8a95a9;
  --line: #26314a; --line-2: #33405c; --brand: #7fb0da; --brand-deep: #173a5a; --brand-ink: #0f1524; --brand-soft: #1d3149;
  --late: #f08a80; --late-soft: #3a1d22; --today: #e8b062; --today-soft: #392a15; --paid: #6cc79a; --paid-soft: #16322a;
  --future: #a6b0c2; --future-soft: #222c40; --s1: #4f8ac2; --s2: #b8893a; --focus: #7fb0da;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --sheet-shadow: 0 -8px 40px rgba(0, 0, 0, .5); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--ink-3); }
.hint { color: var(--ink-3); font-size: 13px; margin: 6px 0; }
.pad { padding: 0 16px; }
p.pad { margin: 10px 0 14px; }
.late-text, .warn-text { color: var(--late); }
code { font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.ico { width: 20px; height: 20px; flex: none; }

/* Valores: números condensados e alinhados */
.money { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.money.muted { color: var(--ink-3); font-weight: 500; }
.money.big { font-size: 24px; }
body.privacy .money { filter: blur(7px); user-select: none; }
body.privacy .hero .money { filter: blur(10px); }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 16px; border-radius: var(--r-s); border: 1px solid transparent; font-weight: 600; font-size: 14.5px; text-decoration: none; cursor: pointer; background: var(--surface); color: var(--ink); border-color: var(--line-2); transition: background .15s, border-color .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--late); border-color: var(--late); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--late); border-color: color-mix(in srgb, var(--late) 40%, transparent); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn.icon-only { padding: 0; width: 36px; }
.btn.wide { width: 100%; }
.btn.light { background: #fff; color: var(--brand-deep); border-color: #fff; }
.btn.outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn.outline-light:hover { background: rgba(255, 255, 255, .1); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.accent { background: var(--brand); color: var(--brand-ink); }
.link { border: 0; background: none; padding: 0; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
.link.muted { color: var(--ink-3); }
.pill { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.pill:hover { border-color: var(--brand); color: var(--brand); }
.quick-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }

/* ---------- Estrutura ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-3); }
.boot img { animation: breathe 1.6s ease-in-out infinite; border-radius: 16px; }
@keyframes breathe { 50% { opacity: .5; transform: scale(.96); } }

.shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0 12px; display: flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 17px; }
.topbar-brand img { border-radius: 8px; }
.topbar-title { font-size: 17px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 959px) {
  .topbar:not(.sub) .topbar-title { display: none; }
  .topbar.sub .topbar-brand { display: none; }
}
@media (min-width: 960px) { .mobile-only { display: none !important; } .topbar-title { font-size: 15px; color: var(--ink-2); font-weight: 500; } }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.demo-flag { font-size: 12px; font-weight: 600; color: var(--today); background: var(--today-soft); border-radius: 999px; padding: 3px 10px; margin: 0; }
.offline-bar { background: var(--today-soft); color: var(--today); font-size: 13px; text-align: center; padding: 6px 12px; }
#view { padding: 16px 16px calc(var(--tab-h) + 32px + env(safe-area-inset-bottom)); max-width: 1120px; margin: 0 auto; outline: none; }

.tabbar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
.tabbar a { position: relative; display: grid; place-items: center; align-content: center; gap: 2px; text-decoration: none; color: var(--ink-3); font-size: 11.5px; font-weight: 500; }
.tabbar a .ico { width: 23px; height: 23px; }
.tabbar a.on { color: var(--brand); font-weight: 600; }
.tabbar a.on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.badge { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--late); color: #fff; font: 600 11px/18px var(--num); text-align: center; }
.rail { display: none; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 236px 1fr; grid-template-rows: auto auto 1fr; }
  .rail { display: flex; flex-direction: column; gap: 6px; grid-row: 1 / -1; position: sticky; top: 0; height: 100vh; padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--line); }
  .rail-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; padding: 4px 8px 18px; }
  .rail-brand img { border-radius: 9px; }
  .rail nav { display: grid; gap: 2px; }
  .rail nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-s); color: var(--ink-2); text-decoration: none; font-weight: 500; }
  .rail nav a:hover { background: var(--surface-2); color: var(--ink); }
  .rail nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
  .rail nav .badge { position: static; margin-left: auto; }
  .rail-add { margin-top: 14px; }
  .rail .demo-flag { margin-top: auto; text-align: center; }
  .topbar { grid-column: 2; }
  .topbar-brand { display: none; }
  .topbar [data-act="add"] { display: none; }
  .topbar .demo-flag { display: none; }
  .tabbar { display: none; }
  .offline-bar { grid-column: 2; }
  #view { grid-column: 2; width: 100%; padding: 24px 32px 48px; }
}

/* ---------- Cabeçalho de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); max-width: 62ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 959px) { .page-head h1 { font-size: 23px; } .page-head .page-actions .btn.primary { display: none; } }

/* ---------- Destaque do dia (guilloché) ---------- */
.hero { position: relative; overflow: hidden; border-radius: var(--r-l); background: var(--brand-deep); color: #fff; margin-bottom: 18px; isolation: isolate; }
:root[data-theme="dark"] .hero { background: #183a5a; }
.hero::before { content: ""; position: absolute; z-index: -1; width: 520px; height: 520px; right: -170px; top: 50%; transform: translateY(-50%); background: url("../icons/guilloche.svg") center / contain no-repeat; opacity: .55; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: auto 0 0 0; height: 6px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.22) 0 2px, transparent 2px 6px); }
.hero-inner { padding: 22px 22px 24px; max-width: 560px; }
.hero-date { margin: 0 0 14px; font-size: 14px; color: rgba(255, 255, 255, .78); }
.hero-date::first-letter { text-transform: uppercase; }
.hero-label { margin: 0; font-size: 15px; color: rgba(255, 255, 255, .88); }
.hero-amount { margin: 2px 0 6px; font: 600 clamp(32px, 11.5vw, 46px)/1.05 var(--num); letter-spacing: -.01em; white-space: nowrap; }
.hero-amount .money { font-weight: 600; }
.hero-amount.quiet { font-size: 30px; }
.hero-sub { margin: 0 0 18px; color: rgba(255, 255, 255, .85); }
.hero-sub b { color: #ffd2cc; font-weight: 600; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (min-width: 700px) { .hero-inner { padding: 30px 34px 32px; } .hero-amount { font-size: 60px; } .hero::before { width: 640px; height: 640px; right: -120px; } }

/* ---------- Blocos e listas ---------- */
.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); margin-bottom: 16px; overflow: hidden; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.block-head h2 { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.block-head h2::first-letter { text-transform: uppercase; }
.block-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.block > .notice { margin: 0 16px 16px; }
.block-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px 16px; }
.count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font: 600 12px/20px var(--num); text-align: center; }
.more-link { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 11px; font-size: 14px; font-weight: 600; text-decoration: none; border-top: 1px solid var(--line); }
.more-link .ico { width: 16px; height: 16px; }
.list { list-style: none; margin: 0; padding: 0; }
.row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.list > .row:first-child { border-top: 0; }
/* Faixa à esquerda indica a situação da parcela */
.row.late::before, .row.today::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--late); }
.row.today::before { background: var(--today); }
.row.blocked::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ink-3); }
.row-main { flex: 1; min-width: 0; display: grid; gap: 1px; text-decoration: none; color: inherit; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: inherit; }
.row-main.with-avatar { display: flex; align-items: center; gap: 12px; }
.row-main.with-avatar > span:last-child { display: grid; gap: 1px; min-width: 0; }
a.row-main:hover .row-title { color: var(--brand); }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { font-size: 13.5px; color: var(--ink-2); }
.row-meta b { font-weight: 600; color: var(--late); }
.row.today .row-meta b { color: var(--today); }
.row-note { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.row-note .ico { width: 14px; height: 14px; }
.row-side { display: grid; justify-items: end; gap: 2px; text-align: right; flex: none; }
.row-amount { font-size: 16.5px; }
.row-sub { font-size: 12px; color: var(--ink-3); }
.row-sub.late { color: var(--late); }
.row-actions { display: flex; gap: 6px; margin-top: 6px; }
.row-side.row-actions { display: flex; margin: 0; }
.list.compact .row { padding: 10px 16px; }
.inst.paid .row-title, .inst.paid .row-amount { color: var(--ink-3); }
/* Parcela: no celular os botões descem para uma linha própria, com área de toque maior */
.row.inst { flex-wrap: wrap; }
.inst-actions { margin: 0; flex: none; }
.inst-actions .btn.primary { padding: 0 14px; }
.inst-actions .wa { color: #1f8f55; }
@media (max-width: 640px) {
  .row.inst { align-items: flex-start; }
  .inst-actions { flex: 1 0 100%; margin-top: 2px; }
  .inst-actions .btn { min-height: 40px; }
  .inst-actions .btn.primary { flex: 1; }
  .inst-actions .btn.icon-only { width: 46px; }
}

.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.chip.late { background: var(--late-soft); color: var(--late); }
.chip.today { background: var(--today-soft); color: var(--today); }
.chip.paid { background: var(--paid-soft); color: var(--paid); }
.chip.future { background: var(--future-soft); color: var(--future); }

.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font: 600 14px var(--num); letter-spacing: .02em; }
.avatar.active { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.avatar.late { background: var(--late-soft); color: var(--late); border-color: transparent; }

.progress { display: block; height: 5px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin-top: 7px; max-width: 320px; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.progress.late > span { background: var(--late); }
.progress.paid > span { background: var(--paid); }

.empty { text-align: center; padding: 36px 20px; color: var(--ink-2); display: grid; justify-items: center; gap: 6px; }
.empty strong { color: var(--ink); font-size: 16px; }
.empty p { margin: 0 0 8px; max-width: 46ch; }
.block .empty { padding: 28px 16px; }

/* ---------- Números da carteira ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; }
.stat { display: grid; gap: 2px; padding: 13px 16px; border-top: 1px solid var(--line); }
.stats .stat:nth-child(odd) { border-right: 1px solid var(--line); }
.stats .stat:nth-child(-n+2) { border-top: 0; }
.stat-label { font-size: 13px; color: var(--ink-2); }
.stat-value { font-size: 21px; }
.stat-value .money { font-weight: 600; }
.stat.late .stat-value { color: var(--late); }
.stat.paid .stat-value { color: var(--paid); }
.stat-sub { font-size: 12px; color: var(--ink-3); }
.row-stats { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); margin-bottom: 16px; }
.row-stats.inner { border: 0; border-radius: 0; margin: 0; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) {
  .row-stats { grid-template-columns: repeat(4, 1fr); }
  .row-stats .stat { border-top: 0; border-right: 1px solid var(--line); }
  .row-stats .stat:last-child { border-right: 0; }
}

/* ---------- Hoje ---------- */
.today-grid { display: grid; gap: 0 18px; }
@media (min-width: 1040px) { .today-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .today-side { position: sticky; top: 76px; } }
.alerts summary { display: flex; align-items: center; gap: 8px; padding: 13px 16px; cursor: pointer; font-weight: 600; color: var(--today); list-style: none; }
.alerts summary::-webkit-details-marker { display: none; }
.alerts[open] summary { border-bottom: 1px solid var(--line); }

/* ---------- Filtros e abas ---------- */
.segmented { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; }
.segmented button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(23, 33, 58, .12); }
.segmented .count { background: transparent; border-color: var(--line-2); }
.form .segmented { margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters > * { flex: 1 1 200px; }
.filters select, .search { min-height: 44px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); padding: 0 12px; }
.search { display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 42px; color: var(--ink); }
.search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }

/* ---------- Calendário ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.cal-head div { display: grid; justify-items: center; }
.cal-head strong { font-size: 16px; }
.cal-head strong::first-letter { text-transform: uppercase; }
.cal-head .muted { font-size: 13px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 10px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--ink-3); padding-bottom: 4px; }
.cal-cell { min-height: 58px; display: grid; align-content: start; justify-items: start; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; text-align: left; }
.cal-cell.blank { border: 0; background: transparent; cursor: default; }
.cal-num { font: 600 13px var(--num); color: var(--ink-2); }
.cal-amt { font-size: 11px; line-height: 1.1; }
.cal-amt .money { font-weight: 600; }
.cal-dot .ico { width: 14px; height: 14px; color: var(--paid); }
.cal-cell.late { background: var(--late-soft); border-color: transparent; }
.cal-cell.late .cal-amt { color: var(--late); }
.cal-cell.today, .cal-cell.future { background: var(--brand-soft); border-color: transparent; }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-cell.is-picked { box-shadow: inset 0 0 0 2px var(--ink); }
.block > .btn.small { margin: 0 10px 12px; }
@media (max-width: 420px) { .segmented button { padding: 0 7px; font-size: 13.5px; } .segmented .count { min-width: 18px; padding: 0 4px; } }
@media (max-width: 520px) { .cal-cell { min-height: 50px; padding: 4px; } .cal-amt { font-size: 9.5px; } .cal-grid { gap: 3px; padding: 6px; } }

/* ---------- Perfil e contrato ---------- */
.profile { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; margin: 4px 0 16px; }
.profile .avatar { width: 56px; height: 56px; font-size: 19px; }
.profile h1 { font-size: 23px; }
.profile-id p { margin: 2px 0 0; color: var(--ink-2); }
.profile-notes { font-size: 14px; color: var(--ink-3) !important; }
.profile-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
@media (min-width: 900px) { .profile { grid-template-columns: auto 1fr auto; } .profile-actions { grid-column: auto; margin: 0; justify-content: flex-end; max-width: 520px; } }
.loan-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 4px 0 4px; }
.loan-client { font-weight: 600; text-decoration: none; }
.loan-head h1 { font: 600 34px/1.15 var(--num); margin: 2px 0 6px; }
.loan-head h1 .muted { font: 400 16px var(--font); }
.loan-state { margin: 0; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.loan-head + .progress { max-width: none; margin: 10px 0 16px; height: 7px; }
.two-col { display: grid; gap: 0 16px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } }
.danger-zone { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin: 8px 0 16px; }
.danger-zone .btn { color: var(--ink-2); }
.rank-pos { width: 28px; flex: none; font: 600 18px var(--num); color: var(--ink-3); text-align: center; }
.rank li:nth-child(-n+3) .rank-pos { color: var(--s2); }

/* ---------- Formulários ---------- */
.form { display: grid; gap: 14px; }
.card-form, .form-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px 16px; }
.form-section { display: grid; gap: 14px; margin-bottom: 14px; }
.form > .form-section { margin: 0; }
.form-section h2 { font-size: 16px; font-weight: 600; }
.field { display: grid; gap: 5px; min-width: 0; }
.field-label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 12.5px; color: var(--ink-3); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .parts input, .block-actions input {
  width: 100%; min-height: 44px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); padding: 9px 12px; color: var(--ink);
}
.block-actions input { width: auto; min-height: 36px; padding: 4px 10px; }
.field textarea { resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .parts input:focus { outline: 0; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.money-input { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); padding-left: 12px; }
.money-input > span { color: var(--ink-3); font-size: 14px; }
.money-input input { border: 0 !important; box-shadow: none !important; font-family: var(--num); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.money-input:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.money-input.suffix { padding: 0 12px 0 0; }
.grid-2 { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-error { margin: 0; color: var(--late); font-weight: 500; min-height: 0; }
.form-error:empty { display: none; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-actions.sticky { position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 8px); z-index: 5; background: color-mix(in srgb, var(--paper) 92%, transparent); padding: 10px 0; backdrop-filter: blur(8px); }
@media (min-width: 960px) { .form-actions.sticky { bottom: 0; } }
.notice { background: var(--brand-soft); color: var(--ink); border-radius: var(--r-s); padding: 10px 12px; font-size: 14px; margin: 0; }
.notice > .ico { width: 17px; height: 17px; vertical-align: -3px; margin-right: 4px; }
.notice.warn { background: var(--today-soft); }
.notice .ico { color: var(--today); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper input { text-align: center; font: 600 18px var(--num) !important; max-width: 90px; }
.stepper .icon-btn { border: 1px solid var(--line-2); font-size: 20px; border-radius: var(--r-s); width: 44px; height: 44px; }
.choice-group { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.choice-group legend { margin-bottom: 6px; }
.choice { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 10px 12px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice input { accent-color: var(--brand); }
.pass { display: flex; align-items: center; gap: 4px; }

.summary { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-2); overflow: hidden; }
.summary-main { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px; gap: 10px; }
.summary-main strong { font: 600 28px var(--num); }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.summary-grid > div { display: grid; padding: 10px 16px; gap: 1px; }
.summary-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.summary-grid > div:nth-child(n+3) { border-top: 1px solid var(--line); }
.summary-grid > div > span { font-size: 12.5px; color: var(--ink-3); }
.summary-grid b, .summary-grid b .money { font-size: 15px; font-weight: 600; }
.summary .notice { margin: 0 12px 12px; }
.parts-editor summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 4px 0; }
.parts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.parts li { display: grid; grid-template-columns: 28px 1fr 1fr; gap: 8px; align-items: center; }
.parts .part-n { font: 600 14px var(--num); color: var(--ink-3); text-align: right; }
.parts .part-paid { grid-column: 2 / -1; color: var(--paid); font-size: 12px; margin-top: -4px; }
.parts .money-input input { min-height: 42px; }

/* ---------- Gráfico ---------- */
.chart { position: relative; padding: 12px 16px 8px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.legend span, .chart-tip span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-x { display: grid; padding: 4px 8px 0; font-size: 12px; color: var(--ink-3); text-align: center; text-transform: capitalize; }
@media (min-width: 960px) { .chart { max-width: 760px; } }
.chart svg .s1 { fill: var(--s1); } .chart svg .s2 { fill: var(--s2); }
.chart svg .zero { fill: var(--line-2); }
.chart svg .axis { stroke: var(--line-2); stroke-width: 1; }
.chart svg text { fill: var(--ink-3); font: 12px var(--font); text-transform: capitalize; }
.chart svg .hit { fill: transparent; }
.chart svg .bar-group { cursor: pointer; outline: none; }
.chart svg .bar-group.on .hit, .chart svg .bar-group:focus-visible .hit { fill: var(--surface-2); }
.chart-tip { position: absolute; top: 34px; width: 170px; display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--r-s); background: var(--ink); color: var(--paper); font-size: 12.5px; pointer-events: none; box-shadow: var(--shadow); }
.chart-tip b { text-transform: capitalize; }
.table-view summary { cursor: pointer; padding: 10px 16px; color: var(--brand); font-weight: 600; font-size: 14px; border-top: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 9px 16px; border-top: 1px solid var(--line); text-align: left; }
table.data th { font-size: 12.5px; color: var(--ink-3); font-weight: 600; background: var(--surface-2); }
table.data .n { text-align: right; }
table.data td::first-letter { text-transform: uppercase; }

/* ---------- Histórico ---------- */
.audit-item { width: 100%; }
.audit-item summary { display: grid; cursor: pointer; list-style: none; }
.audit-item summary::-webkit-details-marker { display: none; }
.audit-item dl { margin: 10px 0 0; display: grid; gap: 6px; font-size: 13.5px; }
.audit-item dl div { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 8px; }
.audit-item dt { color: var(--ink-3); }
.audit-item dd { margin: 0; }
.audit-item s { color: var(--ink-3); }

/* ---------- Menu "Mais" ---------- */
.menu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 15px 16px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); }
.menu-item:first-child { border-top: 0; }
.menu-item:hover { background: var(--surface-2); }
.menu-item > .ico:first-child { color: var(--brand); }
.menu-item > span:not(.chip) { flex: 1; display: grid; }
.menu-item small { color: var(--ink-3); font-size: 13px; }
.menu-item .end { color: var(--ink-3); width: 16px; }
.menu-foot { margin-top: 18px; }

/* ---------- Folhas (sheets) ---------- */
.sheet-host { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(12, 17, 30, .45); opacity: 0; transition: opacity .18s; }
.sheet { position: relative; max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-l) var(--r-l) 0 0; box-shadow: var(--sheet-shadow); transform: translateY(24px); opacity: 0; transition: transform .2s cubic-bezier(.2, .8, .2, 1), opacity .18s; outline: none; padding-bottom: env(safe-area-inset-bottom); }
.sheet::before { content: ""; position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--line-2); }
.sheet-host.in .sheet-backdrop { opacity: 1; }
.sheet-host.in .sheet { transform: none; opacity: 1; }
.sheet-host.out .sheet-backdrop { opacity: 0; }
.sheet-host.out .sheet { transform: translateY(24px); opacity: 0; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 20px 16px 10px 20px; }
.sheet-head h2 { font-size: 19px; }
.sheet-head p { margin: 3px 0 0; color: var(--ink-2); font-size: 14px; }
.sheet-body { padding: 4px 20px 16px; overflow-y: auto; display: grid; gap: 12px; align-content: start; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1 1 auto; }
.sheet-text { margin: 0; color: var(--ink-2); }
@media (min-width: 700px) {
  .sheet-host { align-items: center; justify-items: center; padding: 24px; }
  .sheet { width: min(560px, 100%); border-radius: var(--r-l); max-height: 86vh; transform: translateY(10px) scale(.98); }
  .sheet.small { width: min(420px, 100%); }
  .sheet::before { display: none; }
}
.due-box { display: grid; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.due-box > div { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 14px; border-top: 1px solid var(--line); color: var(--ink-2); }
.due-box > div:first-child { border-top: 0; }
.due-box .total { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.due-box .total .money { font-size: 22px; }
textarea.message { width: 100%; border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 12px; background: var(--surface-2); line-height: 1.5; resize: vertical; font-size: 14.5px; }
.charge-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.charge-head div { display: grid; }
.charge-head span { color: var(--ink-2); font-size: 14px; }
.queue-progress { display: flex; align-items: center; gap: 10px; font: 600 13px var(--num); color: var(--ink-2); }
.queue-progress .progress { flex: 1; margin: 0; max-width: none; }
.sent-check { border: 1px dashed var(--line-2); border-radius: var(--r-s); padding: 10px 12px; }
.sent-check p { margin: 0; font-weight: 600; }
.menu-list { display: grid; gap: 6px; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); text-decoration: none; color: var(--ink); cursor: pointer; text-align: left; font: inherit; }
.menu-list a:hover, .menu-list button:hover { border-color: var(--brand); }
.menu-list .ico { color: var(--brand); width: 24px; height: 24px; }
.menu-list span { display: grid; }
.menu-list small { color: var(--ink-3); }

/* ---------- Avisos rápidos ---------- */
.toasts { position: fixed; z-index: 80; left: 12px; right: 12px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; max-width: 520px; width: max-content; padding: 11px 16px; border-radius: 10px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow); font-size: 14.5px; animation: toast-in .2s ease-out; }
.toast.bad { background: var(--late); color: #fff; }
.toast button { border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
body:not(.in-app) .toasts { bottom: 16px; }
body.locked .toasts { bottom: auto; top: calc(12px + env(safe-area-inset-top)); }
@media (min-width: 960px) { .toasts { bottom: 20px; left: 260px; } }

/* ---------- Telas de entrada ---------- */
#gate { min-height: 100vh; background: var(--brand-deep); position: relative; overflow: hidden; isolation: isolate; }
#gate::before { content: ""; position: absolute; z-index: -1; width: 900px; height: 900px; left: 50%; top: -260px; transform: translateX(-50%); background: url("../icons/guilloche.svg") center / contain no-repeat; opacity: .35; }
.gate-wrap { min-height: 100vh; display: grid; place-content: center; justify-items: center; padding: 24px 16px; gap: 14px; }
.gate-card { width: min(420px, 100%); background: var(--surface); border-radius: var(--r-l); padding: 26px 22px; display: grid; gap: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.gate-card h1 { font-size: 22px; }
.gate-card > p { margin: 0; }
.gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.gate-brand img { border-radius: 12px; }
.gate-brand strong { display: block; font-size: 19px; }
.gate-brand span { color: var(--ink-3); font-size: 13px; }
.gate-alt { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-3); text-align: center; }
.gate-links { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; font-size: 14px; }
.gate-foot { color: rgba(255, 255, 255, .75); font-size: 13px; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .topbar, .tabbar, .rail, .toasts { display: none !important; }
  #view { padding: 0; }
}


/* =========================================================
   Versão 2.1: caixa, previsão, indicadores, perdas, bloqueio
   ========================================================= */
:root { --lost: #6b4a8a; --lost-soft: #efe8f5; --blocked: #4f5a6e; --blocked-soft: #e7e9ee; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --lost: #c3a6e0; --lost-soft: #2c2340; --blocked: #a6b0c2; --blocked-soft: #252e42; } }
:root[data-theme="dark"] { --lost: #c3a6e0; --lost-soft: #2c2340; --blocked: #a6b0c2; --blocked-soft: #252e42; }

.chip.lost { background: var(--lost-soft); color: var(--lost); }
.chip.blocked { background: var(--blocked-soft); color: var(--blocked); font-size: 11px; vertical-align: 1px; }
.avatar.blocked { background: var(--blocked-soft); color: var(--blocked); border-color: transparent; text-decoration: line-through; }
.progress.lost > span { background: var(--lost); }
.paid-text { color: var(--paid); }
.danger-text { color: var(--late) !important; }
.small-link { font-size: 13.5px; }
.inst.lost .row-title, .inst.lost .row-amount { color: var(--ink-3); }

/* Avisos em faixa (bloqueado, perda, atraso) */
.banner { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--r-m); margin: 0 0 16px; font-size: 14.5px; line-height: 1.45; }
.banner > .ico { margin-top: 2px; flex: none; }
.banner > div { flex: 1; }
.banner span { color: var(--ink-2); font-size: 13.5px; }
.banner .btn { flex: none; }
.banner.blocked { background: var(--blocked-soft); color: var(--ink); }
.banner.lost { background: var(--lost-soft); color: var(--ink); }
.banner.lost > .ico { color: var(--lost); }
.banner.late { background: var(--late-soft); color: var(--ink); margin: 0; }
.banner.late > .ico { color: var(--late); }
@media (max-width: 640px) { .banner { flex-wrap: wrap; } .banner > div { flex: 1 1 calc(100% - 40px); } .banner .btn { margin-left: 32px; } }

/* Limite sugerido */
.credit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 16px; margin-bottom: 16px; position: relative; overflow: hidden; }
.credit::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--future); }
.credit.paid::before { background: var(--paid); } .credit.today::before { background: var(--today); } .credit.late::before { background: var(--late); }
.credit-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.credit-top > div { display: grid; }
.credit-label { font-size: 13px; color: var(--ink-2); }
.credit-value { font: 600 26px/1.15 var(--num); }
.credit.late .credit-value { color: var(--late); font-size: 21px; }
.credit-reasons { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; display: grid; gap: 2px; }
.credit.compact { margin: 0; background: var(--surface-2); }
.credit.compact .credit-value { font-size: 22px; }
.form-section > [data-client-panel] { display: grid; gap: 10px; }
.form-section > [data-client-panel]:empty { display: none; }

/* Caixa */
.cash-card { display: grid; gap: 16px; padding: 20px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; position: relative; overflow: hidden; }
.cash-label { margin: 0; color: var(--ink-2); font-size: 14px; }
.cash-amount { margin: 2px 0 2px; font: 600 clamp(32px, 10vw, 44px)/1.05 var(--num); }
.cash-card.neg .cash-amount { color: var(--late); }
.cash-sub { margin: 0; color: var(--ink-3); font-size: 13px; }
.cash-month { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding-top: 12px; gap: 8px; }
.cash-month div { display: grid; gap: 1px; }
.cash-month dt { font-size: 12.5px; color: var(--ink-3); }
.cash-month dt::first-letter { text-transform: uppercase; }
.cash-month dd { margin: 0; font-size: 16px; }
@media (min-width: 760px) { .cash-card { grid-template-columns: 1fr 1.2fr; align-items: end; } .cash-month { border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 20px; } }
.action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.action-tile { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13px; cursor: pointer; }
.action-tile .ico { width: 22px; height: 22px; color: var(--brand); }
.action-tile:hover { border-color: var(--brand); }
.ledger .row { gap: 10px; }
.ledger-date { flex: none; width: 44px; font: 600 12.5px var(--num); color: var(--ink-3); text-transform: uppercase; }
.ledger .row-side { grid-auto-flow: column; align-items: center; gap: 6px; }
.ledger .row-title { white-space: normal; font-size: 14.5px; }
.row-side.acct { display: flex; align-items: center; gap: 12px; }
@media (max-width: 640px) { .row-side.acct { flex-direction: column; align-items: flex-end; gap: 4px; } }
@media (max-width: 959px) { .topbar.sub .demo-flag { display: none; } }

/* Previsão */
.day-group h3 { display: flex; justify-content: space-between; gap: 10px; padding: 10px 16px; margin: 0; font-size: 13.5px; font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line); color: var(--ink-2); }
.day-group:first-of-type h3 { border-top: 0; }
.day-group h3 span::first-letter { text-transform: uppercase; }

/* Indicadores */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { display: grid; align-content: start; gap: 3px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); border-top: 3px solid var(--line-2); }
.kpi.paid { border-top-color: var(--paid); } .kpi.today { border-top-color: var(--today); } .kpi.late { border-top-color: var(--late); }
.kpi-label { font-size: 13px; color: var(--ink-2); }
.kpi-value { font: 600 24px/1.15 var(--num); }
.kpi-value .money { font-weight: 600; }
.kpi.late .kpi-value { color: var(--late); }
.kpi-text { font-size: 12.5px; color: var(--ink-3); }
.aging { list-style: none; margin: 0; padding: 8px 16px 14px; display: grid; gap: 10px; }
.aging li { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 12px; }
.aging-label { display: grid; font-size: 14px; font-weight: 500; }
.aging-label small { color: var(--ink-3); font-weight: 400; font-size: 12px; }
.aging-bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.aging-bar > span { display: block; height: 100%; background: var(--s1); border-radius: 5px; }
.aging li.late .aging-bar > span { background: var(--late); }
.aging-value { font-size: 15px; min-width: 96px; text-align: right; }
@media (max-width: 480px) { .aging li { grid-template-columns: 1fr auto; } .aging-bar { grid-column: 1 / -1; grid-row: 2; } }

/* Menu lateral no computador: atalhos secundários e usuário */
.rail-more { display: grid; gap: 2px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.rail-more a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--r-s); color: var(--ink-3); text-decoration: none; font-size: 14px; }
.rail-more a .ico { width: 18px; height: 18px; }
.rail-more a:hover { background: var(--surface-2); color: var(--ink); }
.rail-more a.on { color: var(--brand); background: var(--brand-soft); }
.rail-foot { margin-top: auto; display: grid; gap: 8px; }
.rail-user { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; color: var(--ink-3); overflow: hidden; }
.rail-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail .demo-flag { margin-top: 0; }

/* ---------- Revisão visual ---------- */
/* Lista de parcelas mais respirada, títulos de bloco com mais presença */
.block-head h2 { font-size: 16px; }
.row { padding: 13px 16px; }
.row-meta { line-height: 1.4; }
.hero-inner { position: relative; }
.stat-value { font-size: 22px; }
.stat-sub a { color: inherit; }
.page-head { margin-top: 2px; }
/* Botões do topo e da barra com destaque mais claro do item ativo */
.tabbar a.on .ico { stroke-width: 2.2; }
.icon-btn.accent { box-shadow: 0 2px 8px rgba(31, 74, 110, .25); }
/* Seleção de chips e segmentos com transição curta (resposta ao toque) */
.segmented button, .pill, .btn, .action-tile { transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:active, .action-tile:active, .pill:active { transform: translateY(1px); }
/* Campos de data e seleção com a mesma altura dos demais */
.block-actions select { min-height: 36px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); padding: 4px 10px; }

/* ---------- Lembretes por SMS ---------- */
.sms-status { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.sms-status > div { flex: 1; min-width: 0; }
.sms-status p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.sms-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.sms-status.ok .sms-dot { background: var(--paid); box-shadow: 0 0 0 4px var(--paid-soft); }
.sms-status.bad { border-color: color-mix(in srgb, var(--late) 35%, var(--line)); }
.sms-status.bad .sms-dot { background: var(--late); box-shadow: 0 0 0 4px var(--late-soft); }
@media (max-width: 520px) { .sms-status { flex-wrap: wrap; } .sms-status .btn { margin-left: 22px; } }
.check.big { font-weight: 600; font-size: 15px; }
.sms-tpl { gap: 6px; }
.sms-tpl .link { justify-self: start; }
.sms-preview { display: grid; gap: 4px; justify-items: start; }
.sms-bubble { max-width: 320px; padding: 9px 12px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.sms-bubble:empty { display: none; }
