:root {
  --brand: #374e9d;
  --brand-dark: #101936;
  --gold: #e6bb0c;
  --ink: #14203d;
  --muted: #66718a;
  --bg: #f5f7fc;
  --surface: #fff;
  --line: #e4e8f2;
  --danger: #b42318;
  --revenue: #374e9d;
  --expense: #b42318;
}

body {
  color: var(--ink);
  background: radial-gradient(circle at 100% 0, #e9edff 0, transparent 29rem), var(--bg);
}

.side {
  background: linear-gradient(165deg, #111a39 0%, #101936 55%, #1b2a5c 100%);
  box-shadow: 12px 0 36px rgba(16, 25, 54, .08);
}

.brand-lockup { display: block; padding: 7px 12px 20px; }
.brand-lockup img {
  display: block;
  width: 194px;
  height: 45px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);
}

.greeting-chip {
  border-color: #ffffff16;
  background: linear-gradient(145deg, #ffffff14, #ffffff08);
}
.side-nav p, .side-user small { color: #9ba9cd; }
.side a, .side-nav a, .logout { color: #c2cbe0; }
.nav-icon { color: #9fabcf; }
.side-nav a.active {
  background: linear-gradient(90deg, #ffffff20, #ffffff0c);
  box-shadow: inset 3px 0 0 var(--gold), 0 8px 20px #00000012;
}
.avatar { background: linear-gradient(135deg, var(--brand), #6678cf); }
.card, .panel {
  border-color: var(--line);
  box-shadow: 0 10px 28px rgba(30, 45, 85, .05);
}
.btn-primary {
  background: linear-gradient(135deg, #2d4394, #5b72c8);
  box-shadow: 0 8px 16px #374e9d2b;
}
.btn-gold { color: #17234b; }
.btn-light { background: #eef1fb; color: var(--brand); }
label { color: #253454; }
input, textarea, select { border-color: #d6ddeb; color: var(--ink); }
input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px #374e9d18;
}
.data th, .filters, .access-stat { background: #f8f9fd; }
.data th { color: #7b86a0; }
.data tr:hover { background: #fafbff; }
.badge { background: #eef1fb; color: var(--brand); }
.total-preview { background: #f0f3fb; }
.charge-item { grid-template-columns: minmax(190px, 1fr) 130px 210px 40px; }
.item-type { font-weight: 750; color: var(--brand); background: #f8f9fd; }

.login {
  background: radial-gradient(#ffffff18 1px, transparent 1px), linear-gradient(135deg, #344db1, #122458 70%);
  background-size: 14px 14px, auto;
}
.login-card { box-shadow: 0 26px 70px #07102d55; }
.login-brand { display: block; padding: 0 0 25px; }
.login-brand img {
  display: block;
  width: min(285px, 100%);
  height: 66px;
  margin: 0 auto;
  object-fit: contain;
}
.error-logo {
  display: block;
  width: min(290px, 100%);
  height: 68px;
  margin: 0 auto 24px;
  object-fit: contain;
}

@media (max-width: 780px) {
  .brand-lockup img { width: 170px; height: 40px; }
  .charge-item { grid-template-columns: 1fr 130px 140px 40px; }
}

@media (max-width: 580px) {
  .charge-item { grid-template-columns: minmax(0, 1fr) 120px 40px; }
  .charge-item > input { grid-column: 1 / -1; }
}

.table-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.row-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.row-actions form { display: inline; margin: 0; }
.link-danger { padding: 0; border: 0; color: var(--danger); background: transparent; font: inherit; font-weight: 750; cursor: pointer; }
.icon-action {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #dce2f0;
  border-radius: 9px;
  color: var(--brand) !important;
  background: #f3f5fc;
  cursor: pointer;
  transition: transform .15s, background .15s, border-color .15s;
}
.icon-action:hover { transform: translateY(-1px); border-color: #b9c4df; background: #e9edfa; }
.icon-action.danger { color: var(--danger) !important; border-color: #f0d1ce; background: #fff3f1; }
.icon-action.danger:hover { border-color: #e3aaa5; background: #ffe9e6; }
.icon-action svg { width: 16px; height: 16px; }
.btn.is-loading { opacity: .78; cursor: wait; }
.btn.is-loading::before { content: ""; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: button-spin .7s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }
.panel-head .actions form { margin: 0; }
.money-positive { color: var(--success); font-weight: 700; }
.money-revenue { color: var(--revenue); font-weight: 700; }
.money-negative { color: var(--danger); font-weight: 800; }
.notice form { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inline-date { display: flex; align-items: center; gap: 8px; min-width: 245px; }
.inline-date input { min-width: 145px; }
.module-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; margin: -8px 0 18px; }
.utility-nav { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid #ffffff17; }

/* Retorno visual das ações */
.toast-stack {
  position: fixed;
  z-index: 9999;
  top: 22px;
  right: 22px;
  display: grid;
  width: min(410px, calc(100vw - 32px));
  gap: 11px;
  pointer-events: none;
}
.toast {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 30px;
  align-items: start;
  gap: 11px;
  overflow: hidden;
  padding: 15px 13px 15px 15px;
  border: 1px solid #dfe5f2;
  border-radius: 15px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 48px rgba(16, 25, 54, .18);
  animation: toast-in .28s ease-out both;
  pointer-events: auto;
}
.toast::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: currentColor; opacity: .8; }
.toast.is-leaving { animation: toast-out .22s ease-in both; }
.toast-symbol { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; }
.toast-symbol svg { width: 20px; height: 20px; }
.toast-copy { min-width: 0; padding-top: 1px; }
.toast-copy strong { display: block; color: var(--ink); font-size: 13px; }
.toast-copy p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.toast-close { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; color: #7d89a4; background: transparent; cursor: pointer; }
.toast-close:hover { background: #f0f3f9; color: var(--ink); }
.toast-close svg { width: 16px; height: 16px; }
.toast-success { color: #16804a; border-left: 4px solid #28a866; }
.toast-success .toast-symbol { color: #16804a; background: #e8f8ef; }
.toast-error { color: var(--danger); border-left: 4px solid var(--danger); }
.toast-error .toast-symbol { color: var(--danger); background: #fff0ee; }
.toast-warning { color: #a56b00; border-left: 4px solid var(--gold); }
.toast-warning .toast-symbol { color: #8b6200; background: #fff8dc; }
.toast-standalone { position: fixed; z-index: 9999; top: 22px; right: 22px; width: min(410px, calc(100vw - 32px)); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px) scale(.98); } }

/* Histórico financeiro */
.history-tabs { display: flex; gap: 8px; margin: -3px 0 14px; padding-bottom: 2px; overflow-x: auto; }
.history-tabs a { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: #f8f9fd; text-decoration: none; font-size: 12px; font-weight: 800; }
.history-tabs a:hover { color: var(--brand); border-color: #cbd4e8; }
.history-tabs a.active { color: #fff; border-color: var(--brand); background: linear-gradient(135deg, #2d4394, #536ac1); box-shadow: 0 8px 18px #374e9d24; }
.history-tabs a strong { display: grid; place-items: center; min-width: 23px; height: 23px; padding: 0 6px; border-radius: 8px; color: var(--brand); background: #e9edfa; font-size: 10px; }
.history-tabs a.active strong { color: #fff; background: #ffffff24; }
.history-context { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; background: #f8f9fd; }
.history-context strong { font-size: 12px; }
.history-context span { color: var(--muted); font-size: 11px; }
.finance-data .entry-row td:first-child { border-left: 3px solid transparent; }
.finance-data .entry-row.entry-revenue td:first-child { border-left-color: var(--revenue); }
.finance-data .entry-row.entry-expense td:first-child { border-left-color: #d04b42; }
.flow-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 9px; font-size: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.flow-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.flow-badge.revenue { color: var(--revenue); background: #edf1ff; }
.flow-badge.expense { color: #b42318; background: #fff0ee; }
.unit-cell, .entry-description { display: block; color: var(--ink); font-size: 12px; }
.entry-value { white-space: nowrap; font-size: 13px; }

/* Dashboard financeiro */
.dashboard-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 10px 28px rgba(30, 45, 85, .04);
  backdrop-filter: blur(8px);
}
.dashboard-filter-label {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.section-kicker { display: block; margin-bottom: 4px; color: var(--brand); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.dashboard-filter > div strong { font-size: 14px; }
.dashboard-filter form { display: flex; align-items: end; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.dashboard-filter form > div { width: 155px; }
.dashboard-filter form > div:nth-child(3) { width: 245px; }
.dashboard-filter label { margin-bottom: 4px; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-filter input,
.dashboard-filter select { padding: 9px 10px; font-size: 12px; }
.dashboard-filter .btn { padding: 10px 13px; }

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}
.metric-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(30, 45, 85, .05);
}
.metric-card::after {
  content: "";
  position: absolute;
  width: 78px;
  height: 78px;
  right: -35px;
  top: -36px;
  border-radius: 50%;
  background: #374e9d12;
}
.metric-card > span { display: block; color: var(--muted); font-size: 12px; }
.metric-card > strong { display: block; margin: 8px 0 7px; font-size: clamp(21px, 1.65vw, 29px); line-height: 1; letter-spacing: -.055em; white-space: nowrap; }
.metric-card > small { display: block; min-height: 28px; color: #8490a8; font-size: 10px; line-height: 1.4; }
.metric-card::before { content: ""; position: absolute; top: 0; left: 18px; width: 35px; height: 4px; border-radius: 0 0 6px 6px; background: var(--brand); }
.metric-revenue::before,
.metric-pending::before { background: var(--revenue); }
.metric-expense::before,
.metric-payable::before { background: var(--danger); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .85fr); gap: 18px; }
.chart-panel { min-width: 0; }
.chart-panel .panel-head { align-items: flex-start; }
.chart-panel h2 { margin-top: 1px; }
.chart-panel .muted { margin: 5px 0 0; font-size: 12px; }
.chart-key { display: flex; gap: 14px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.chart-key span { display: flex; align-items: center; gap: 6px; }
.chart-key i { width: 9px; height: 9px; border-radius: 3px; }
.key-revenue { background: var(--brand); }
.key-expense { background: var(--expense); }
.chart-canvas-wrap { width: 100%; min-height: 290px; overflow: hidden; }
.chart-canvas-wrap canvas { display: block; width: 100%; height: 290px; }
.chart-empty { min-height: 290px; display: grid; place-items: center; }
.donut-layout { display: flex; min-height: 290px; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.donut-layout canvas { display: block; width: 184px; height: 184px; flex: 0 0 184px; aspect-ratio: 1 / 1; }
.donut-legend { display: grid; width: min(100%, 360px); gap: 9px; }
.donut-legend > div { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 7px; font-size: 10px; }
.donut-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--chart-color, var(--brand)); }
.donut-legend span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.donut-legend strong { color: var(--ink); font-size: 10px; }

.unit-performance { margin-top: 0; }
.unit-performance .muted { margin: 5px 0 0; font-size: 12px; }
.unit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.unit-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(145deg, #fff, #fbfcff); }
.unit-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px 17px 13px; }
.unit-card-head > div { min-width: 0; }
.unit-card-head h3 { margin: 3px 0 2px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.unit-card-head p { margin: 0; color: var(--muted); font-size: 11px; }
.unit-rank { color: var(--gold); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.unit-card-head > a { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--brand); background: #eef1fb; }
.unit-card-head svg { width: 15px; height: 15px; }
.unit-result { margin: 0 17px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.unit-result span,
.unit-money-grid span { display: block; color: var(--muted); font-size: 9px; letter-spacing: .05em; text-transform: uppercase; }
.unit-result strong { display: inline-block; margin: 4px 7px 0 0; font-size: 22px; letter-spacing: -.05em; }
.unit-result small { color: var(--muted); font-size: 10px; }
.unit-money-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 13px 17px; background: var(--line); }
.unit-money-grid > div { min-width: 0; padding: 10px; background: #f8f9fd; }
.unit-money-grid strong { display: block; margin-top: 4px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.unit-card footer { display: flex; flex-wrap: wrap; gap: 7px 13px; padding: 11px 17px; color: #7e8aa4; background: #f4f6fb; font-size: 9px; }

@media (max-width: 1320px) {
  .dashboard-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .donut-layout { display: flex; }
}
@media (max-width: 1000px) {
  .dashboard-filter { align-items: flex-start; flex-direction: column; }
  .dashboard-filter form { justify-content: flex-start; width: 100%; }
  .unit-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .dashboard-cards { grid-template-columns: 1fr 1fr; }
  .dashboard-filter form > div,
  .dashboard-filter form > div:nth-child(3) { width: 100%; }
  .dashboard-filter .btn { flex: 1; }
  .donut-layout canvas { width: 174px; height: 174px; flex-basis: 174px; }
  .unit-money-grid { grid-template-columns: 1fr 1fr; }
  .history-context { align-items: flex-start; flex-direction: column; gap: 4px; }
  .toast-stack, .toast-standalone { top: 12px; right: 12px; width: calc(100vw - 24px); }
}
@media (max-width: 440px) {
  .dashboard-cards { grid-template-columns: 1fr; }
  .chart-key { width: 100%; justify-content: flex-start; }
}

/* Central de ações do Financeiro */
.finance-commandbar {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(30, 45, 85, .05);
}
.finance-commandbar-head { margin-bottom: 15px; }
.finance-commandbar h2 { margin: 0; font-size: 18px; }
.finance-commandbar .muted { margin: 4px 0 0; font-size: 12px; }
.finance-command-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.finance-command {
  position: relative;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8f9fd;
  color: var(--ink);
  text-decoration: none;
}
.finance-command.command-primary { display: flex; align-items: center; gap: 11px; padding: 14px; color: #fff; background: linear-gradient(135deg, #2d4394, #5b72c8); border-color: transparent; }
.finance-command summary { display: flex; align-items: center; gap: 11px; padding: 14px; list-style: none; cursor: pointer; }
.finance-command summary::-webkit-details-marker { display: none; }
.finance-command summary > span:nth-child(2),
.finance-command.command-primary > span:nth-child(2) { min-width: 0; }
.finance-command strong { display: block; font-size: 12px; }
.finance-command small { display: block; margin-top: 3px; color: #7d89a4; font-size: 9px; line-height: 1.35; }
.finance-command.command-primary small { color: #dce3ff; }
.finance-command summary > b { margin-left: auto; color: #8b96ad; font-size: 14px; transition: transform .15s; }
.finance-command[open] summary > b { transform: rotate(180deg); }
.command-icon { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--brand); background: #e9edfb; }
.command-primary .command-icon { color: #fff; background: #ffffff1c; }
.command-icon svg { width: 17px; height: 17px; }
.command-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  left: 0;
  width: min(330px, 82vw);
  overflow: hidden;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(20, 32, 61, .16);
}
.command-menu-right { right: 0; left: auto; }
.command-menu a { display: block; padding: 11px; border-radius: 9px; color: var(--ink); text-decoration: none; }
.command-menu a:hover { background: #f2f4fb; }
.command-menu a + a { border-top: 1px solid var(--line); }
.command-menu strong { color: var(--brand); }
.category-form > div:nth-child(2) { flex-grow: 2; }
.category-explanation { margin: -5px 0 18px; padding: 13px 15px; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; background: #fffbea; }
.category-explanation strong { color: var(--ink); font-size: 12px; }
.category-explanation p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

@media (max-width: 1180px) {
  .finance-command-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .finance-commandbar { padding: 17px; }
  .finance-command-grid { grid-template-columns: 1fr; }
  .command-menu,
  .command-menu-right { position: static; width: auto; margin: 0 8px 8px; box-shadow: none; }
}

/* Valores e cards sem quebra em larguras intermediárias */
.finance-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.finance-summary .card { min-width: 0; }
.finance-summary .card strong {
  overflow: hidden;
  font-size: clamp(21px, 1.75vw, 29px);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 1450px) {
  .finance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-summary .card strong { font-size: 28px; }
}
@media (max-width: 620px) {
  .finance-summary { grid-template-columns: 1fr; }
  .finance-summary .card strong { font-size: 27px; }
}

/* Navegação recolhível e tipografia funcional */
.shell { transition: grid-template-columns .22s ease; }
.side { position: sticky; transition: padding .22s ease; }
.sidebar-toggle { position: absolute; z-index: 4; top: 18px; right: -14px; display: grid; place-items: center; width: 29px; height: 29px; padding: 0; border: 1px solid #dbe1ef; border-radius: 9px; color: var(--brand); background: #fff; box-shadow: 0 7px 18px #10193624; cursor: pointer; }
.sidebar-toggle svg { width: 16px; height: 16px; transition: transform .22s ease; }
.brand-compact { display: none !important; }
.side-nav a, .logout { font-weight: 500; }
.side-nav a.active { font-weight: 600; }
.side-nav p, .agency, .eyebrow, .dashboard-filter-label { font-weight: 650; }
.data th, .filters label, label { font-weight: 600; }
.badge, .flow-badge, .history-tabs a, .btn { font-weight: 650; }
.table-sub, .help, .command-menu small, .finance-command small { font-weight: 400; }
.data a, .unit-rank, .chart-key, .detail span, .access-stat span, .unit-result span, .unit-money-grid span { font-weight: 500; }
.side-user { font-weight: 600; }
.utility-nav { margin: 0; padding: 11px 0 0; border-top: 1px solid #ffffff17; border-bottom: 0; }
.side-user { padding-bottom: 11px; }
.avatar-photo { display: block; object-fit: cover; }
body.sidebar-collapsed .shell { grid-template-columns: 86px minmax(0, 1fr); }
body.sidebar-collapsed .side { padding-inline: 10px; }
body.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
body.sidebar-collapsed .brand-lockup { padding: 5px 5px 21px; }
body.sidebar-collapsed .brand-full { display: none !important; }
body.sidebar-collapsed .brand-compact { display: block !important; width: 48px; height: 48px; margin: 0 auto; object-fit: contain; filter: none; }
body.sidebar-collapsed .greeting-chip, body.sidebar-collapsed .side-nav p, body.sidebar-collapsed .nav-label, body.sidebar-collapsed .side-user-copy { display: none; }
body.sidebar-collapsed .side-nav a, body.sidebar-collapsed .logout { justify-content: center; padding-inline: 8px; }
body.sidebar-collapsed .side-user { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed .nav-icon { flex: 0 0 auto; }

/* Detalhes, configurações e formulários */
.charge-breakdown .item-count { color: var(--muted); font-size: 12px; }
.charge-detail-table .flow-badge { padding: 5px 8px; }
.charge-total-row td { background: #f7f8fc; font-size: 14px; }
.integrated-date-form { display: flex; align-items: end; gap: 12px; margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8f9fd; }
.integrated-date-form > div { width: min(280px, 100%); }
.settings-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.settings-links > a { display: flex; align-items: center; gap: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: #fff; box-shadow: 0 10px 28px rgba(30,45,85,.05); text-decoration: none; }
.settings-links strong { display: block; font-size: 14px; font-weight: 650; }
.settings-links small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; }
.profile-photo-form { display: grid; grid-template-columns: 72px minmax(220px, 1fr) auto; align-items: center; gap: 16px; }
.profile-preview { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 18px; object-fit: cover; }
.profile-placeholder { color: #fff; background: linear-gradient(135deg, var(--brand), #6678cf); font-size: 24px; font-weight: 650; }
.category-form { align-items: end; }

/* Gráficos e leitura financeira */
.finance-command-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-canvas-wrap canvas, .donut-layout canvas { max-width: 100%; }
.donut-layout { display: flex; }
.unit-money-grid > div:nth-child(1) strong, .unit-money-grid > div:nth-child(3) strong { color: var(--revenue); }
.unit-money-grid > div:nth-child(2) strong, .unit-money-grid > div:nth-child(4) strong { color: var(--expense); }
.finance-summary .card:nth-child(1) strong { color: var(--revenue); }
.finance-summary .card:nth-child(2) strong { color: var(--expense); }
.main > .cards:not(.finance-summary) .card:first-child strong, .data td.money-positive { color: var(--revenue); }
.main > .cards:not(.finance-summary) .card:nth-child(4) strong { color: var(--expense); }
.finance-command strong, .history-tabs a, .category-explanation strong { font-weight: 600; }

@media (max-width: 780px) {
  .sidebar-toggle { display: none; }
  body.sidebar-collapsed .shell { grid-template-columns: 1fr; }
  body.sidebar-collapsed .brand-full { display: block !important; }
  body.sidebar-collapsed .brand-compact { display: none !important; }
  body.sidebar-collapsed .greeting-chip, body.sidebar-collapsed .side-nav p, body.sidebar-collapsed .side-user-copy { display: initial; }
  body.sidebar-collapsed .nav-label { display: inline; }
  .settings-links { grid-template-columns: 1fr; }
  .profile-photo-form { grid-template-columns: 72px minmax(0, 1fr); }
  .profile-photo-form .btn { grid-column: 1 / -1; }
  .integrated-date-form { align-items: stretch; flex-direction: column; }
  .side-bottom { display: block; margin-top: 10px; }
  .side-user { display: none; }
  .utility-nav { display: flex; gap: 4px; overflow-x: auto; padding-top: 10px; }
  .utility-nav form { flex: 0 0 auto; }
}
@media (max-width: 620px) { .finance-command-grid { grid-template-columns: 1fr; } }

/* Donut em SVG: proporção preservada em qualquer largura */
.donut-chart { width: 148px; height: 148px; flex: 0 0 148px; aspect-ratio: 1 / 1; }
.donut-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.donut-chart .donut-caption { fill: #7d89a4; font: 500 6px Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: .03em; }
.donut-chart .donut-amount { fill: var(--ink); font: 600 10px Inter, ui-sans-serif, system-ui, sans-serif; }
@media (max-width: 700px) { .donut-chart { width: 140px; height: 140px; flex-basis: 140px; } }
/* 1.5.2 — leitura mais leve, com pesos consistentes no painel */
body{font-family:"Segoe UI",Inter,Arial,sans-serif;font-weight:400;line-height:1.5;-webkit-font-smoothing:antialiased}
h1,h2,h3{font-weight:600}
.top h1,.login-card h1{font-weight:600;letter-spacing:-.02em;line-height:1.25}
.panel h2,.finance-commandbar h2{font-weight:600;letter-spacing:-.01em}
.side-nav a,.logout,.unit-tab{font-weight:500}
.side-nav a.active,.unit-tab.is-active{font-weight:600}
.btn,.history-tabs a,.badge,.flow-badge,.item-type{font-weight:600}
label,.filters label,.dashboard-filter label{font-weight:500;letter-spacing:.02em}
.agency,.eyebrow,.dashboard-filter-label{font-weight:600;letter-spacing:.09em}
.card strong,.metric-card>strong,.finance-summary .card strong,.unit-result strong{font-weight:600;letter-spacing:-.015em;line-height:1.2;font-variant-numeric:tabular-nums}
.money-negative,.money-positive,.money-revenue,.entry-value,.total-preview strong{font-weight:600;letter-spacing:0;font-variant-numeric:tabular-nums}
.unit-cell,.entry-description,.finance-command strong,.settings-links strong,.detail strong,.unit-money-grid strong{font-weight:600}
.unit-cell,.entry-description{font-size:13px;line-height:1.45}
.data th{font-weight:500;letter-spacing:.06em}
.table-sub,.help,.history-context span{line-height:1.55}
.unit-navigation{border-radius:10px;background:#fff;box-shadow:none}

/* 1.6: compact unit navigation and account workflow */
.unit-navigation{align-items:flex-start;max-width:100%}.unit-buttons{flex-wrap:wrap;overflow:visible;min-width:0;max-width:100%;gap:6px}.unit-buttons .unit-tab{flex:0 1 auto;white-space:normal;overflow-wrap:anywhere;max-width:100%;padding:7px 10px;font-size:12px;line-height:1.35;min-height:34px}.top{gap:16px;flex-wrap:wrap}.launch-tools{display:flex;justify-content:flex-end;gap:20px;flex-wrap:wrap;margin:16px 0;font-size:13px}.stage-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px}.stage-chips a{display:flex;align-items:center;gap:8px;padding:9px 12px;border-radius:10px;background:#f6f7fb;font-size:13px;text-decoration:none}.stage-chips b{background:white;padding:2px 7px;border-radius:12px;font-weight:500}.stage-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--stage,#d89016);flex-shrink:0}.stage-review{--stage:#8a5cf5}.stage-overdue{--stage:#dc465a}.stage-upcoming{--stage:#df951b}.stage-scheduled{--stage:#3787f7}.stage-paid{--stage:#139867}.launch-group{border:1px solid #e1e6f1;border-radius:16px;margin:16px 0;background:#fff;overflow:hidden}.launch-group>summary{display:flex;align-items:center;gap:16px;padding:20px;cursor:pointer;list-style:none}.launch-group>summary::-webkit-details-marker{display:none}.launch-group summary strong{font-size:15px;font-weight:600;color:var(--stage)}.launch-group summary small{display:block;color:#6c7b99;margin-top:5px;font-size:13px}.launch-group>summary>b{margin-left:auto;background:#f2f4f8;border-radius:15px;padding:4px 10px;font-size:12px;font-weight:500}.group-chevron{font-size:24px;color:#76839a}.launch-group[open] .group-chevron{transform:rotate(90deg)}.group-content{padding:0 16px 16px}.quick-edit{min-width:160px}.quick-edit>form{display:grid;gap:10px;min-width:220px;padding:14px;background:#f7f8fc;border:1px solid #dfe5f4;border-radius:12px;margin-top:8px}.quick-edit label{display:grid;gap:5px;white-space:normal}.quick-edit .help{white-space:normal}.quick-edit summary{list-style:none;cursor:pointer}.finance-history .history-context{display:none}@media(max-width:600px){.unit-buttons .unit-tab{font-size:11px;padding:6px 8px}.launch-group>summary{padding:15px;gap:10px}.top>.btn{width:auto}}

@media(max-width:1400px){.finance-data{display:block;min-width:0!important;width:100%}.finance-data thead{display:none}.finance-data tbody{display:block}.finance-data .entry-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-bottom:1px solid #e1e6f1;padding:12px 0}.finance-data .entry-row td{display:block;min-width:0;white-space:normal;border-bottom:0;padding:10px}.finance-data .entry-row td:last-child{grid-column:1/-1}.finance-data .row-actions{flex-wrap:wrap;justify-content:flex-start}.quick-edit>form{max-width:350px;min-width:0}.finance-data .entry-row td:nth-child(6):before{content:'Conta bancária';display:block;font-size:11px;color:#71809c;margin-bottom:4px}}@media(max-width:600px){.finance-data .entry-row{grid-template-columns:repeat(2,minmax(0,1fr))}.finance-data .row-actions{align-items:flex-start}.quick-edit{max-width:100%;min-width:0}}
/* 1.8 account editing and table labels */
.data th{ text-transform:none!important;letter-spacing:normal!important;font-size:12px!important;font-weight:500!important}.finance-data td{vertical-align:middle}.launch-value{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.value-dialog{border:1px solid #e0e5f0;border-radius:18px;padding:24px;width:min(560px,94vw);max-height:90vh;overflow:auto;color:#172744;box-shadow:0 20px 70px #17274433;white-space:normal}.value-dialog::backdrop{background:#10204066}.value-dialog label{display:block;white-space:normal}.value-dialog label[hidden]{display:none}.value-dialog .grid{gap:16px}.value-dialog .help{font-size:13px;line-height:1.5;white-space:normal}.value-dialog .panel-head{margin-bottom:12px}.value-dialog input,.value-dialog select{min-width:0;width:100%}.finance-data .row-actions{gap:6px;flex-wrap:wrap}@media(max-width:1400px){.finance-data .entry-row td:nth-child(6):before{content:'Conta'}}
.filters label{text-transform:none!important;letter-spacing:normal!important}.value-dialog [hidden]{display:none!important}

/* 1.8.2: neutral status shortcuts, with color reserved for indicators. */
.finance-history .stage-chips a,
.finance-history .stage-chips a:visited{color:#46536a;font-weight:500;text-decoration:none;border:1px solid transparent;transition:background .15s,border-color .15s}
.finance-history .stage-chips a:hover{color:#26364e;background:#edf0f6;border-color:#dce2ed;text-decoration:none}
.finance-history .stage-chips a:focus-visible{outline:2px solid #65749b;outline-offset:3px}
.finance-history .stage-chips b{color:#526078;font-size:12px}
/* Authentication: secondary actions share the panel style, including visited links. */
.login-card a:not(.btn),
.login-card a:not(.btn):visited {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #596680;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.login-card a:not(.btn):hover {
  color: #334679;
  background: #f2f4fa;
}
.login-card a:not(.btn):focus-visible {
  color: #334679;
  background: #f2f4fa;
  outline: 2px solid #5368b9;
  outline-offset: 3px;
}
