@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --surface-raised: #ffffff;
  --primary-pressed: #0052c4;
  --primary-subtle: #e3eeff;
  --primary: #0065ec;
  --primary-dark: #00153f;
  --accent: #ffc857;
  --cyan: #4d94ff;
  --text: #00153f;
  --muted: #5a6682;
  --border: #e1e6ef;
  --donut-empty: #eef1f7;
  --success: #0b7a45;
  --danger: #d32f3f;
  --warning: #9a5b00;
  --info: #0052c4;
  --chart-balance: #9a5b00;
  --chart-cost: #ffc857;
  --chart-income: #0b7a45;
  --chart-expense: #d32f3f;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(11, 42, 102, 0.1);
  --financial-value-area-max-width: 260px;
  --financial-value-max-size: 28px;
  --financial-value-normal-size: 28px;
  --financial-value-min-size: 16px;
  --financial-value-line-height: 1.1;
}

body[data-theme="dark"] {
  --bg: #00153f;
  --surface: #0a2150;
  --surface-2: #12306b;
  --surface-raised: #12306b;
  --primary: #4d94ff;
  --primary-pressed: #8db8ff;
  --primary-subtle: #12306b;
  --primary-dark: #00153f;
  --accent: #ffc857;
  --cyan: #8db8ff;
  --text: #f2f6ff;
  --text-secondary: #bac6de;
  --muted: #92a1c0;
  --border: #1f3f85;
  --donut-empty: #12306b;
  --success: #3dd68c;
  --danger: #ff7380;
  --warning: #ffc857;
  --info: #8db8ff;
  --chart-balance: #ffc857;
  --chart-cost: #ffc857;
  --chart-income: #3dd68c;
  --chart-expense: #ff7380;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

@media (prefers-color-scheme: dark) {
  body[data-theme="auto"] {
    --bg: #00153f;
    --surface: #0a2150;
    --surface-2: #12306b;
    --surface-raised: #12306b;
    --primary: #4d94ff;
    --primary-pressed: #8db8ff;
    --primary-subtle: #12306b;
    --primary-dark: #00153f;
    --accent: #ffc857;
    --cyan: #8db8ff;
    --text: #f2f6ff;
    --text-secondary: #bac6de;
    --muted: #92a1c0;
    --border: #1f3f85;
    --donut-empty: #12306b;
    --success: #3dd68c;
    --danger: #ff7380;
    --warning: #ffc857;
    --info: #8db8ff;
    --chart-balance: #ffc857;
    --chart-cost: #ffc857;
    --chart-income: #3dd68c;
    --chart-expense: #ff7380;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

body[data-theme="dark"],
body[data-theme="auto"] {
  background: var(--bg);
}

/* Rodada 2: contrato visual comum. Variantes de modulo podem especializar
   composicao, mas nao devem redefinir a escala basica da interface. */
body.app {
  font-size: 14px;
  line-height: 1.45;
}

body.app h1,
body.app h2,
body.app h3 {
  letter-spacing: 0;
}

body.app .page-header h1 {
  font-size: 28px;
  line-height: 1.18;
}

body.app .page-header > div:first-child > p {
  font-size: 14px;
  line-height: 1.4;
}

body.app .card {
  border-radius: var(--joozo-radius-lg, 16px);
  padding: 16px;
  box-shadow: 0 10px 26px rgba(11, 42, 102, 0.08);
}

body.app .card-header {
  gap: 12px;
  margin-bottom: 14px;
}

body.app .stat-card .value {
  font-variant-numeric: tabular-nums;
  font-size: var(--financial-value-normal-size);
  line-height: 1.2;
}

body.app .input,
body.app .btn {
  min-height: 42px;
  border-radius: var(--joozo-radius-md, 12px);
}

body.app .input {
  padding: 10px 12px;
  line-height: 1.3;
}

body.app .btn {
  padding: 10px 14px;
  line-height: 1.2;
}

body.app .btn.primary {
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 22%, transparent);
}

body.app .table {
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

body.app .pill,
body.app .tag,
body.app .status,
body.app .status-pill {
  line-height: 1.2;
}

@media (max-width: 960px) {
  body.app .page {
    gap: 16px;
  }

  body.app .page-header h1 {
    font-size: 24px;
    line-height: 1.2;
  }

  body.app .page-header > div:first-child > p {
    font-size: 13px;
  }

  body.app .card {
    padding: 14px;
    border-radius: var(--joozo-radius-md, 12px);
  }

  /* O topbar ja identifica a tela; repetir o nome da rota no H1 cria
     hierarquia duplicada e consome a area de conteudo. Dashboard e excecoes
     porque seu H1 comunica a competencia, nao apenas o nome da rota. */
  body.app[data-page="transactions"] .page-header h1,
  body.app[data-page="accounts"] .page-header h1,
  body.app[data-page="cards"] .page-header h1,
  body.app[data-page="budgets"] .page-header h1,
  body.app[data-page="investments"] .page-header h1,
  body.app[data-page="goals"] .page-header h1,
  body.app[data-page="reports"] .page-header h1,
  body.app[data-page="settings"] .page-header h1,
  body.app[data-page="history-base"] .page-header h1 {
    display: none;
  }

  body.app[data-page="transactions"] .page-header > div:first-child > p,
  body.app[data-page="accounts"] .page-header > div:first-child > p,
  body.app[data-page="cards"] .page-header > div:first-child > p,
  body.app[data-page="budgets"] .page-header > div:first-child > p,
  body.app[data-page="investments"] .page-header > div:first-child > p,
  body.app[data-page="goals"] .page-header > div:first-child > p,
  body.app[data-page="reports"] .page-header > div:first-child > p,
  body.app[data-page="settings"] .page-header > div:first-child > p,
  body.app[data-page="history-base"] .page-header > div:first-child > p {
    display: none;
  }

  body.app .dashboard-page > .page-header {
    gap: 10px;
  }

  body.app .dashboard-page .dashboard-period-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    width: 100%;
    padding: 8px;
  }

  body.app .dashboard-page .dashboard-period-label {
    grid-column: 1 / -1;
  }

  body.app .dashboard-page .dashboard-period-filter label,
  body.app .dashboard-page .dashboard-period-filter select,
  body.app .dashboard-page .dashboard-period-filter .btn {
    width: 100%;
    min-width: 0;
  }

  body.app .dashboard-page .dashboard-period-filter .btn {
    grid-column: 1 / -1;
  }

  body.app .transactions-page > .page-header {
    gap: 10px;
  }

  body.app .transactions-page .transactions-period-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    width: 100%;
    padding: 8px;
  }

  body.app .transactions-page .transactions-period-filter .dashboard-period-label {
    grid-column: 1 / -1;
  }

  body.app .transactions-page .transactions-period-filter label,
  body.app .transactions-page .transactions-period-filter select,
  body.app .transactions-page .transactions-period-filter .btn {
    width: 100%;
    min-width: 0;
  }

  body.app .transactions-page .transactions-period-filter .btn {
    grid-column: 1 / -1;
  }

  body.app .dashboard-page .wealth-journey-card .card-header {
    gap: 10px;
  }

  body.app .dashboard-page .wealth-journey-card .card-header .pill {
    align-self: flex-start;
  }

  body.app .transactions-page .table-mobile-row {
    padding-block: 12px;
  }

  body.app .transactions-page .day-summary-row {
    margin-block: 10px;
  }

  body.app .budgets-page .budget-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  body.app .budgets-page .budget-toolbar form {
    display: contents;
  }

  body.app .budgets-page .budget-toolbar .btn {
    width: 100%;
  }

  body.app .budgets-page .budget-toolbar .btn:last-child {
    grid-column: 1 / -1;
  }

  body.app .budgets-page .table-mobile-row {
    gap: 8px;
    padding: 10px 4px;
  }

  body.app .budgets-page .sparkline-wrap {
    max-width: 100%;
    padding-block: 2px 4px;
  }

  body.app .budgets-page .sparkline {
    min-width: 0;
    height: 52px;
    padding: 2px 0;
  }

  body.app .budgets-page .sparkline-labels,
  body.app .budgets-page .sparkline-values {
    min-width: 0;
    grid-template-columns: repeat(var(--spark-count, 1), minmax(0, 1fr));
  }

  body.app .cards-page .cards-overview {
    padding: 14px;
  }

  body.app .cards-page .cards-overview-grid {
    gap: 12px;
  }

  body.app .cards-page .table-mobile-row {
    padding-block: 12px;
  }
}

body[data-theme="dark"] .card,
body[data-theme="dark"] .statement-row,
body[data-theme="dark"] .future-row,
body[data-theme="dark"] .statement-card,
body[data-theme="dark"] .settings-order-row,
body[data-theme="dark"] .settings-session-row,
body[data-theme="dark"] .table.is-mobile-card .table-row-mobile td,
body[data-theme="dark"] .form-details,
body[data-theme="dark"] .bottom-nav,
body[data-theme="dark"] .sheet-panel {
  background: var(--surface);
  border-color: var(--border);
}

body[data-theme="dark"] .list-item {
  background: rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .more-item {
  background: var(--surface-2);
  border-color: var(--border);
}

body[data-theme="dark"] .progress.light,
body[data-theme="dark"] .category-bar {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .form-details {
  background: var(--bg);
}

body[data-theme="dark"] .form-details[open] {
  background: var(--surface);
}

body[data-theme="dark"] .table th,
body[data-theme="dark"] .table td {
  border-bottom-color: var(--border);
}

body[data-theme="dark"] .table,
body[data-theme="dark"] .table-wrap {
  background: var(--surface);
}

body[data-theme="dark"] .day-summary-row {
  background: #1a2120;
  border: 1px solid var(--border);
}

body[data-theme="dark"] .table th,
body[data-theme="dark"] .table td,
body[data-theme="dark"] .table tr {
  background: transparent;
}

body[data-theme="dark"] .budget-group td,
body[data-theme="dark"] .budget-group-total td,
body[data-theme="dark"] .table-row-mobile.is-group .table-mobile-row,
body[data-theme="dark"] .table-row-mobile.is-group-total .table-mobile-row {
  background: var(--surface-2);
  border-color: var(--border);
}

body[data-theme="dark"] .budget-group-toggle,
body[data-theme="dark"] .account-group-toggle {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--muted);
}

body[data-theme="dark"] .input,
body[data-theme="dark"] select.input,
body[data-theme="dark"] textarea.input,
body[data-theme="dark"] .input-static,
body[data-theme="dark"] .suggest-box .input,
body[data-theme="dark"] .field-suggest .input {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

body[data-theme="dark"] .input::placeholder {
  color: rgba(238, 242, 241, 0.5);
}

body[data-theme="dark"] .sheet-panel {
  background: var(--surface);
}

body[data-theme="dark"] .dashboard-period-filter select {
  color: var(--text);
  background: var(--bg);
  border-color: var(--border);
  color-scheme: dark;
}

body[data-theme="dark"] .pill,
body[data-theme="dark"] .chip {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  color: #ffd36a;
}

body[data-theme="dark"] .tag {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary-pressed);
}

body[data-theme="dark"] .sheet-panel .input,
body[data-theme="dark"] .sheet-panel select.input,
body[data-theme="dark"] .sheet-panel textarea.input,
body[data-theme="dark"] .sheet-panel .input-static {
  background: #142b52;
  color: var(--text);
  border-color: var(--border);
}

body[data-theme="dark"] .btn.primary {
  color: var(--primary-dark);
}

body[data-theme="dark"] .status-active {
  color: var(--success);
}

body[data-theme="dark"] .status-warning {
  color: var(--warning);
}

body[data-theme="dark"] .status-inactive {
  color: var(--danger);
}

@media (prefers-color-scheme: dark) {
  body[data-theme="auto"] .card,
  body[data-theme="auto"] .statement-row,
  body[data-theme="auto"] .future-row,
  body[data-theme="auto"] .statement-card,
  body[data-theme="auto"] .settings-order-row,
  body[data-theme="auto"] .settings-session-row,
  body[data-theme="auto"] .table.is-mobile-card .table-row-mobile td,
  body[data-theme="auto"] .form-details,
  body[data-theme="auto"] .bottom-nav,
  body[data-theme="auto"] .sheet-panel {
    background: var(--surface);
    border-color: var(--border);
  }

  body[data-theme="auto"] .list-item {
    background: rgba(255, 255, 255, 0.04);
  }

  body[data-theme="auto"] .more-item {
    background: var(--surface-2);
    border-color: var(--border);
  }

  body[data-theme="auto"] .progress.light,
  body[data-theme="auto"] .category-bar {
    background: rgba(255, 255, 255, 0.08);
  }

  body[data-theme="auto"] .form-details {
    background: var(--bg);
  }

  body[data-theme="auto"] .form-details[open] {
    background: var(--surface);
  }

  body[data-theme="auto"] .table th,
  body[data-theme="auto"] .table td {
    border-bottom-color: var(--border);
  }

  body[data-theme="auto"] .table,
  body[data-theme="auto"] .table-wrap {
    background: var(--surface);
  }

  body[data-theme="auto"] .day-summary-row {
    background: #1a2120;
    border: 1px solid var(--border);
  }

  body[data-theme="auto"] .table th,
  body[data-theme="auto"] .table td,
  body[data-theme="auto"] .table tr {
    background: transparent;
  }

  body[data-theme="auto"] .budget-group td,
  body[data-theme="auto"] .budget-group-total td,
  body[data-theme="auto"] .table-row-mobile.is-group .table-mobile-row,
  body[data-theme="auto"] .table-row-mobile.is-group-total .table-mobile-row {
    background: var(--surface-2);
    border-color: var(--border);
  }

  body[data-theme="auto"] .budget-group-toggle,
  body[data-theme="auto"] .account-group-toggle {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--muted);
  }

  body[data-theme="auto"] .input,
  body[data-theme="auto"] select.input,
  body[data-theme="auto"] textarea.input,
  body[data-theme="auto"] .input-static,
  body[data-theme="auto"] .suggest-box .input,
  body[data-theme="auto"] .field-suggest .input {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
  }

  body[data-theme="auto"] .input::placeholder {
    color: rgba(238, 242, 241, 0.5);
  }

  body[data-theme="auto"] .sheet-panel {
    background: var(--surface);
  }

  body[data-theme="auto"] .dashboard-period-filter select {
    color: var(--text);
    background: var(--bg);
    border-color: var(--border);
    color-scheme: dark;
  }

  body[data-theme="auto"] .pill,
  body[data-theme="auto"] .chip {
    background: color-mix(in srgb, var(--accent) 20%, var(--surface));
    color: #ffd36a;
  }

  body[data-theme="auto"] .tag {
    background: color-mix(in srgb, var(--primary) 18%, transparent);
    color: var(--primary-pressed);
  }

  body[data-theme="auto"] .sheet-panel .input,
  body[data-theme="auto"] .sheet-panel select.input,
  body[data-theme="auto"] .sheet-panel textarea.input,
body[data-theme="auto"] .sheet-panel .input-static {
  background: #142b52;
  color: var(--text);
  border-color: var(--border);
}

@media (prefers-color-scheme: dark) {
  body[data-theme="auto"] .btn.primary {
    color: var(--primary-dark);
  }

  body[data-theme="auto"] .status-active {
    color: var(--success);
  }

  body[data-theme="auto"] .status-warning {
    color: var(--warning);
  }

  body[data-theme="auto"] .status-inactive {
    color: var(--danger);
  }
}
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: "Poppins", "Inter", sans-serif;
  margin: 0;
}

p {
  margin: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 32px 24px;
  background: linear-gradient(160deg, var(--primary-dark) 0%, #0a2150 58%, var(--primary) 145%);
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100dvh;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.brand-logo {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  max-height: 104px;
  object-fit: contain;
  object-position: center;
}

.brand-logo-light {
  display: block;
}

body[data-theme="light"] .brand-logo-light {
  display: block;
}

body[data-theme="light"] .brand-logo-dark {
  display: none;
}

body[data-theme="dark"] .brand-logo-light {
  display: none;
}

body[data-theme="dark"] .brand-logo-dark {
  display: block;
}

@media (prefers-color-scheme: light) {
  body[data-theme="auto"] .brand-logo-dark {
    display: none;
  }

  body[data-theme="auto"] .brand-logo-light {
    display: block;
  }
}

@media (prefers-color-scheme: dark) {
  body[data-theme="auto"] .brand-logo-light {
    display: none;
  }

  body[data-theme="auto"] .brand-logo-dark {
    display: block;
  }
}

body.auth .brand-logo {
  display: block;
}

/* A sidebar possui fundo escuro fixo; use sempre a variante clara do brand kit. */
.app .sidebar .brand-logo-light {
  display: none;
}

.app .sidebar .brand-logo-dark {
  display: block;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--joozo-blue-400, #4d94ff) 0%, var(--primary) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.brand-name {
  font-weight: 700;
  font-size: 18px;
}

.brand-sub {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.75;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  margin-right: -24px;
  padding-right: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.nav::-webkit-scrollbar {
  width: 5px;
}

.nav::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.nav:hover,
.nav.is-scrolling {
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.nav:hover::-webkit-scrollbar-thumb,
.nav.is-scrolling::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.8);
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-item.is-active {
  background: rgba(77, 143, 255, 0.26);
  box-shadow: inset 3px 0 0 var(--cyan), 0 8px 22px rgba(0, 0, 0, 0.12);
  color: #fff;
}

.nav-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 0 0 auto;
}

.user-card {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.user-name {
  font-weight: 600;
}

.user-meta,
.user-role {
  font-size: 12px;
  opacity: 0.8;
}

.user-role {
  width: fit-content;
  margin-top: 2px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
  opacity: 1;
}

.user-role.is-admin {
  background: rgba(110, 174, 255, 0.24);
  color: #dcecff;
}

.user-role.is-member {
  background: rgba(82, 210, 145, 0.2);
  color: #d9f9e6;
}

.user-role.is-viewer {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
}

.user-role.is-neutral {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.86);
}

.main {
  padding: 24px 32px 96px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar-title {
  display: grid;
  gap: 4px;
}

.topbar-heading-mobile {
  display: none;
  font-family: "Poppins", "Inter", sans-serif;
  font-weight: 600;
  font-size: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workspace-switch .input.small {
  min-width: 180px;
}

.topbar-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: rgba(30, 91, 82, 0.12);
  padding: 8px 12px;
  border-radius: 999px;
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(30, 91, 82, 0.12);
  color: var(--primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.topbar-avatar.profile-toggle {
  border: none;
  padding: 0;
  cursor: pointer;
}

.profile-panel {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  z-index: 45;
}

.profile-panel.is-open {
  display: flex;
}

.profile-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 24, 30, 0.35);
  border: none;
}

.profile-card {
  position: relative;
  margin: 68px 14px 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  min-width: 220px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(30, 91, 82, 0.12);
  color: var(--primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.profile-actions {
  display: grid;
  gap: 8px;
}

.profile-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  color: inherit;
  cursor: pointer;
}

.profile-item .nav-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 960px) {
  .profile-card {
    margin: 60px 12px 0 auto;
    min-width: 200px;
  }
}

.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
}

.dashboard-stack {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row;
  gap: 32px 20px;
}

.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.dashboard-section.is-wide {
  grid-column: 1 / -1;
}

.dashboard-section.is-hidden {
  display: none;
}

.dashboard-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.dashboard-section-heading h2 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.2;
}

.dashboard-section-heading p {
  margin: 6px 0 0;
}

.dashboard-section-overview,
.dashboard-section-attention,
.dashboard-section-investments {
  grid-column: 1 / -1;
}

.dashboard-layout-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  min-width: 0;
}

.dashboard-size-full { grid-column: 1 / -1; }
.dashboard-size-large { grid-column: span 8; }
.dashboard-size-half { grid-column: span 6; }
.dashboard-size-medium { grid-column: span 4; }
.dashboard-size-small { grid-column: span 3; }

.dashboard-architecture-cards,
.dashboard-architecture-planning-budget {
  grid-column: 1 / -1;
}

.dashboard-architecture-planning {
  grid-column: span 8;
}

.dashboard-architecture-planning-budget {
  grid-column: 1 / -1 !important;
}

.dashboard-architecture-flow {
  grid-column: span 8;
}

.dashboard-architecture-category {
  grid-column: span 4;
  container-type: inline-size;
}

.dashboard-architecture-recent {
  grid-column: 1 / -1;
}

.dashboard-stack > .dashboard-section-overview,
.dashboard-stack > .dashboard-section-attention,
.dashboard-stack > .dashboard-section-investments,
.dashboard-stack > .dashboard-architecture-cards,
.dashboard-stack > .dashboard-architecture-recent {
  grid-column: 1 / -1 !important;
}

.dashboard-stack > .dashboard-architecture-flow {
  grid-column: 1 / span 8 !important;
  order: 3 !important;
}

.dashboard-stack > .dashboard-architecture-category {
  grid-column: 1 / -1 !important;
  order: 4 !important;
}

.dashboard-stack > .dashboard-architecture-planning {
  grid-column: span 8 !important;
}

.dashboard-stack > .dashboard-architecture-planning-budget {
  grid-column: 1 / -1 !important;
}

.dashboard-section-attention > .dashboard-layout-grid,
.dashboard-section-investments > .dashboard-layout-grid,
.dashboard-section-overview > .dashboard-layout-grid {
  width: 100%;
}

.dashboard-summary-section .card-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-summary-section .stat-card {
  min-width: 0;
  container-type: inline-size;
}

.dashboard-attention-grid > .attention-card {
  grid-column: span 4 !important;
  min-width: 0;
}

.attention-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 132px;
  container-type: inline-size;
}

.attention-card .value {
  font-size: var(--financial-value-normal-size);
  max-width: 100%;
  white-space: nowrap;
  line-height: var(--financial-value-line-height);
  padding-right: 8px;
  box-sizing: border-box;
}

.dashboard-attention-grid .stat-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
}

.attention-card .stat-card-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.attention-card .stat-card-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attention-card .hint {
  margin-top: auto;
}

.attention-card-link {
  color: inherit;
  text-decoration: none;
}

.dashboard-module-header {
  align-items: flex-start;
}

.dashboard-module-header h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.dashboard-module-header p {
  margin: 6px 0 0;
}

.dashboard-card-module {
  min-width: 0;
}

.dashboard-card-panes {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.dashboard-card-pane {
  grid-column: span 6;
  min-width: 0;
  align-self: stretch;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted, var(--surface));
}

.dashboard-card-pane-obligations {
  grid-column: 1 / -1;
}

.investment-summary-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  container-type: inline-size;
}

.investment-summary-metric {
  display: grid;
  gap: 6px;
  width: min(100%, var(--financial-value-area-max-width));
  min-width: 0;
}

.investment-summary-metric .value {
  font-size: var(--financial-value-normal-size);
}

.investment-summary-details {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.investment-summary-details strong {
  color: var(--text);
}

.dashboard-investment-map-inline {
  width: 100%;
  margin-top: 4px;
}

.dashboard-investment-map-inline > .visualization-card {
  min-height: 132px;
}

/* Approved analytics cards retain their compact, equal-width row. */
.dashboard-stack > .dashboard-section:not(.is-wide) > .card,
.dashboard-stack > .dashboard-section:not(.is-wide) > .card-link {
  height: 100%;
}
.dashboard-stack > .dashboard-section:not(.is-wide) > .card-link {
  display: flex;
  flex-direction: column;
}
.dashboard-stack > .dashboard-section:not(.is-wide) > .card-link > * {
  flex-shrink: 0;
}
.dashboard-stack > .dashboard-section:not(.is-wide) > .card-link.visualization-card {
  height: auto;
  align-self: start;
}
.dashboard-stack > .dashboard-expense-calendar-section,
.dashboard-stack > .dashboard-category-month-section,
.dashboard-stack > .dashboard-investment-map-section {
  grid-column: span 4;
  align-self: stretch;
}
.dashboard-stack > .dashboard-expense-calendar-section > .visualization-card,
.dashboard-stack > .dashboard-category-month-section > .visualization-card,
.dashboard-stack > .dashboard-investment-map-section > .visualization-card {
  height: 100%;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}

.grid-two > .card {
  min-width: 0;
  overflow: hidden;
}

/* Dashboard invoice cards contain their previews instead of letting a
   sparkline or action column overlap the next card. */
.dashboard-section > .grid-two {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.dashboard-section > .grid-two > .card {
  height: auto;
  box-sizing: border-box;
}

/* Keep the three billing cards visually related: the row shares one height
   and each header has a stable title/actions arrangement. */
.dashboard-billing-grid {
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.dashboard-billing-grid > .card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dashboard-billing-grid > .card > .card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  min-height: 58px;
}

.dashboard-billing-grid > .card > .card-header h3 {
  min-width: 0;
  line-height: 1.25;
}

.dashboard-billing-grid > .card > .card-header .action-group {
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: flex-start;
}

.dashboard-billing-grid > .card > .statement-list,
.dashboard-billing-grid > .card > .future-list,
.dashboard-billing-grid > .card > .open-obligation-list {
  min-width: 0;
}

/* Keep the financial summary predictable: four readable cards per row on
   desktop, instead of leaving a single orphan card on the last row. */
.dashboard-summary-section .card-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
}

.dashboard-summary-section .stat-card {
  min-width: 0;
  min-height: 138px;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
}

.dashboard-summary-section .stat-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
}

.dashboard-summary-section .stat-card-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.dashboard-summary-section .stat-card-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-summary-section .stat-card-icon.is-green { color: #087f5b; background: #e2f5eb; }
.dashboard-summary-section .stat-card-icon.is-red { color: #c94b43; background: #fde9e7; }
.dashboard-summary-section .stat-card-icon.is-amber { color: #a56800; background: #fff3d8; }
.dashboard-summary-section .stat-card-icon.is-purple { color: #7651b8; background: #f0e9ff; }
.dashboard-summary-section .stat-card-icon.is-cyan { color: #087f91; background: #e1f7fa; }
.dashboard-summary-section .stat-card-icon.is-slate { color: #52627a; background: #edf1f7; }

.dashboard-summary-section .stat-card:nth-child(1),
.dashboard-summary-section .stat-card:nth-child(3),
.dashboard-summary-section .stat-card:nth-child(7) {
  grid-column: span 4;
}

.dashboard-summary-section .stat-card:nth-child(1) { order: 1; }
.dashboard-summary-section .stat-card:nth-child(3) { order: 2; }
.dashboard-summary-section .stat-card:nth-child(7) { order: 3; }
.dashboard-summary-section .stat-card:nth-child(2),
.dashboard-summary-section .stat-card:nth-child(4),
.dashboard-summary-section .stat-card:nth-child(5),
.dashboard-summary-section .stat-card:nth-child(6) {
  grid-column: span 3;
  min-height: 116px;
}
.dashboard-summary-section .stat-card:nth-child(2) { order: 4; }
.dashboard-summary-section .stat-card:nth-child(4) { order: 5; }
.dashboard-summary-section .stat-card:nth-child(5) { order: 6; }
.dashboard-summary-section .stat-card:nth-child(6) { order: 7; }

.dashboard-summary-section .stat-card .value {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: nowrap;
}

.dashboard-summary-section .stat-card .hint {
  margin-top: auto;
  line-height: 1.35;
}

/* Keep invoice cards readable while the sidebar still occupies the viewport.
   The mobile breakpoint below remains responsible for the single-column flow. */
@media (min-width: 961px) and (max-width: 1240px) {
  .dashboard-section > .grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-summary-section .card-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .dashboard-summary-section .stat-card:nth-child(1),
  .dashboard-summary-section .stat-card:nth-child(3),
  .dashboard-summary-section .stat-card:nth-child(7) {
    grid-column: span 2;
  }

  .dashboard-summary-section .stat-card:nth-child(2),
  .dashboard-summary-section .stat-card:nth-child(4),
  .dashboard-summary-section .stat-card:nth-child(5),
  .dashboard-summary-section .stat-card:nth-child(6) {
    grid-column: span 3;
  }
}

/* Match the two-column summary rhythm used by the Mobile overview on
   tablets, keeping financial values readable beside the sidebar. */
@media (min-width: 721px) and (max-width: 960px) {
  .investments-page .account-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.billing-current-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.billing-current-card,
.billing-benefits-card {
  min-width: 0;
}

.billing-usage-line {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.billing-usage-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.billing-usage-heading strong {
  color: var(--text);
}

.billing-feature-list,
.billing-plan-features {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.billing-feature-list li,
.billing-plan-features li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 13px;
}

.billing-feature-list strong,
.billing-plan-features strong {
  color: var(--text);
  font-weight: 650;
}

.billing-feature-check {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  background: rgba(46, 140, 79, 0.16);
  color: #46c77a;
  font-weight: 700;
}

.billing-plan-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 100%;
}

.billing-plan-card.is-highlighted {
  border-color: rgba(74, 136, 255, 0.72);
  box-shadow: 0 14px 30px rgba(74, 136, 255, 0.14);
}

.billing-plan-card .card-header {
  margin-bottom: 0;
}

.billing-plans-section {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.billing-plans-section > .card-header {
  margin-bottom: 0;
}

.billing-plans-section > .card-header h2 {
  margin: 0;
  font-size: 20px;
}

.billing-plan-lead {
  min-height: 38px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.billing-upgrade-prompt {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 176, 65, 0.42);
  border-radius: var(--radius-sm, 8px);
  background: rgba(245, 176, 65, 0.09);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.billing-upgrade-prompt strong {
  color: var(--text);
}

.billing-upgrade-prompt span {
  color: var(--muted);
}

.billing-upgrade-prompt .btn {
  justify-self: start;
  margin-top: 4px;
}

.billing-recommended {
  background: rgba(74, 136, 255, 0.18);
  color: #78a8ff;
}

.billing-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.billing-price small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.billing-plan-card form,
.billing-plan-card .btn {
  width: 100%;
}

.billing-plan-card form {
  margin-top: auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.budget-empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.empty-state {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 48%, var(--surface));
}

.empty-state strong {
  color: var(--text);
  font-size: 14px;
}

.empty-state p {
  margin: 0;
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}

.loading-state[hidden] {
  display: none !important;
}

.loading-state::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid color-mix(in srgb, var(--primary) 24%, transparent);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: joozo-spin 0.8s linear infinite;
}

.loading-state.is-error::before {
  display: none;
}

@keyframes joozo-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .loading-state::before {
    animation: none;
  }
}

.budget-empty-state p {
  margin: 0;
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(15, 24, 30, 0.12);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.account-list-header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.account-list-header-tools .sub-tabs {
  margin: 0;
  padding: 6px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
}

.account-list-header-tools .module-tabs {
  margin: 0;
}

.account-list-header-tools .module-tabs,
.account-list-header-tools .sub-tabs {
  display: inline-flex;
  max-width: 100%;
  gap: 8px;
  padding: 6px;
  overflow-x: auto;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-2));
}

.account-list-header-tools .module-tabs,
.account-list-header-tools .sub-tabs,
.recurring-status-tabs {
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
}

.account-list-header-tools .module-tabs::-webkit-scrollbar,
.account-list-header-tools .sub-tabs::-webkit-scrollbar,
.recurring-status-tabs::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.account-list-header-tools .module-tab,
.account-list-header-tools .sub-tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.account-list-header-tools .module-tab span,
.account-list-header-tools .sub-tab span {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--text);
  font-size: 11px;
  text-align: center;
}

.account-list-header-tools .module-tab.is-active,
.account-list-header-tools .sub-tab.is-active {
  background: var(--surface);
  color: var(--primary-dark, var(--text));
  box-shadow: var(--shadow);
}

.account-list-header-tools .module-tab.is-active span,
.account-list-header-tools .sub-tab.is-active span {
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
}

.stat-card .label {
  color: var(--muted);
  font-size: 13px;
}

.stat-card .value {
  font-size: var(--financial-value-normal-size);
  margin-top: 12px;
  display: block;
  max-width: 100%;
  white-space: nowrap;
  line-height: 1.1;
  padding-right: 8px;
  box-sizing: border-box;
}

.stat-card.is-featured {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 72%, var(--cyan) 150%);
  border-color: color-mix(in srgb, var(--primary) 48%, transparent);
  color: #fff;
  box-shadow: 0 18px 34px rgba(11, 42, 102, 0.26);
}

.stat-card.is-featured .label,
.stat-card.is-featured .hint {
  color: rgba(246, 248, 251, 0.78);
}

.stat-card.is-featured .value {
  font-size: var(--financial-value-normal-size);
}

.stat-card.is-featured .value.positive {
  color: #63e6a6;
}

.stat-card.is-featured .value.negative {
  color: #ff8f8f;
}

body.app[data-theme="light"] .stat-card.is-featured {
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  color: var(--text);
  box-shadow: var(--shadow);
}

body.app[data-theme="light"] .stat-card.is-featured .label,
body.app[data-theme="light"] .stat-card.is-featured .hint {
  color: var(--muted);
}

body.app[data-theme="light"] .stat-card.is-featured .value {
  color: var(--text);
}

body.app[data-theme="light"] .stat-card.is-featured .value.positive {
  color: var(--success);
}

body.app[data-theme="light"] .stat-card.is-featured .value.negative {
  color: var(--danger);
}

@media (prefers-color-scheme: light) {
  body.app[data-theme="auto"] .stat-card.is-featured {
    background: color-mix(in srgb, var(--primary) 7%, var(--surface));
    border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
    color: var(--text);
    box-shadow: var(--shadow);
  }

  body.app[data-theme="auto"] .stat-card.is-featured .label,
  body.app[data-theme="auto"] .stat-card.is-featured .hint {
    color: var(--muted);
  }

  body.app[data-theme="auto"] .stat-card.is-featured .value {
    color: var(--text);
  }

  body.app[data-theme="auto"] .stat-card.is-featured .value.positive {
    color: var(--success);
  }

  body.app[data-theme="auto"] .stat-card.is-featured .value.negative {
    color: var(--danger);
  }
}

.stat-card.is-investment-summary {
  border-color: rgba(247, 183, 51, 0.35);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface));
}

.stat-card.is-investment-summary .label::before {
  content: 'Patrimonio';
  display: inline-flex;
  margin-right: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(247, 183, 51, 0.18);
  color: var(--warning);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.value.positive {
  color: #1e8f4a;
}

.value.negative {
  color: #c04b3f;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

body.hide-values .mask-value {
  color: transparent !important;
  text-shadow: 0 0 10px rgba(28, 36, 40, 0.45);
  user-select: none;
}

html.hide-values-preload .mask-value {
  color: transparent !important;
  text-shadow: 0 0 10px rgba(28, 36, 40, 0.45);
  user-select: none;
}

/* Keep semantic income/expense colors from overriding value privacy. */
body.hide-values .value.mask-value {
  color: transparent !important;
}

html.hide-values-preload .value.mask-value {
  color: transparent !important;
}

body.hide-values [data-pay-base],
body.hide-values [data-pay-total] {
  color: transparent !important;
  text-shadow: 0 0 10px rgba(28, 36, 40, 0.45);
}

html.hide-values-preload [data-pay-base],
html.hide-values-preload [data-pay-total] {
  color: transparent !important;
  text-shadow: 0 0 10px rgba(28, 36, 40, 0.45);
}

body[data-theme="dark"].hide-values .mask-value {
  text-shadow: 0 0 12px rgba(238, 242, 241, 0.45);
}

@media (prefers-color-scheme: dark) {
  body[data-theme="auto"].hide-values .mask-value {
    text-shadow: 0 0 12px rgba(238, 242, 241, 0.45);
  }
}

body.hide-values .mask-value::selection {
  background: transparent;
}

.hint.delta {
  margin-top: 4px;
  font-weight: 600;
}

.hint.delta.positive {
  color: #1e8f4a;
}

.hint.delta.negative {
  color: var(--danger);
}

.pill {
  font-size: 12px;
  padding: 4px 10px;
  background: rgba(240, 180, 41, 0.15);
  border-radius: 999px;
  color: #6b4500;
}

.chart-placeholder {
  height: 180px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(30, 91, 82, 0.08), rgba(240, 180, 41, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

.action-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions-inline {
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.actions-inline .btn,
.actions-inline .inline-form {
  flex: 0 0 auto;
}

.history-base-actions {
  flex-wrap: nowrap;
  align-items: center;
  white-space: nowrap;
}

.history-base-actions form {
  display: inline-flex;
  margin: 0;
}

.module-tabs,
.sub-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
  padding: 6px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
}

.module-tab,
.sub-tab {
  padding: 10px 16px;
  border-radius: 11px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.module-tab.is-active,
.sub-tab.is-active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 3px 12px rgba(15, 42, 82, 0.1);
}

.sub-tabs {
  margin-top: -10px;
  padding: 3px;
  background: transparent;
}

.sub-tab {
  padding: 7px 12px;
  font-size: 13px;
}

@media (max-width: 720px) {
  .module-tabs,
  .sub-tabs {
    overflow-x: auto;
    white-space: nowrap;
  }
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.action-group form {
  margin: 0;
}

.dashboard-period-filter {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.dashboard-period-filter label {
  display: block;
}

.dashboard-period-filter select {
  min-width: 112px;
  padding: 9px 30px 9px 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.dashboard-period-label {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 196px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.card-actions .btn.icon {
  width: 32px;
  height: 32px;
}

.card-actions .card-action-primary {
  order: -1;
}

.card-actions .card-action-form-primary {
  order: -1;
}

.card-actions .card-action-primary:not(.primary) {
  border-color: rgba(30, 91, 82, 0.35);
  background: rgba(30, 91, 82, 0.12);
}

.card-actions .card-action-secondary {
  opacity: 0.86;
}

body.app .cards-table .card-actions .card-action-secondary {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

body.app .cards-table .card-actions {
  min-width: 0;
}

body.app .cards-table tr.is-inactive .card-actions .card-action-secondary {
  color: var(--muted);
  border-color: var(--border);
  background: var(--surface-2);
}

.card-actions .card-action-primary {
  box-shadow: 0 4px 12px rgba(30, 91, 82, 0.16);
}

.account-actions {
  align-items: center;
  gap: 6px;
  min-width: 76px;
}

.account-actions .btn.icon {
  width: 32px;
  height: 32px;
}

.account-actions .account-action-secondary {
  opacity: 0.86;
}

.cards-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.statement-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: #ffffff;
}

.card-visual {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  min-height: 110px;
  background: linear-gradient(135deg, #1a4a43, #2f6b61);
  color: #fff;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.card-visual.has-image {
  background-color: #e7eaef;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.card-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10, 25, 22, 0.15), rgba(10, 25, 22, 0.68));
}

.card-visual.has-image .card-visual-overlay {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.35));
}

.card-visual-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
}

.card-visual.has-image .card-visual-content {
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 8px;
  border-radius: 10px;
  backdrop-filter: blur(6px);
}

.card-brand {
  font-size: 14px;
  font-weight: 600;
}

.card-meta {
  font-size: 12px;
  opacity: 0.8;
}

.statement-info {
  display: grid;
  gap: 8px;
}

.statement-list {
  display: grid;
  gap: 12px;
}

.statement-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.statement-row-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.statement-row-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.statement-row-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.statement-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.statement-row-values {
  display: grid;
  gap: 8px;
  text-align: right;
  align-content: center;
}

.card-thumb {
  position: relative;
  width: 64px;
  height: 40px;
  flex: 0 0 64px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(30, 91, 82, 0.9), rgba(240, 180, 41, 0.6));
  box-shadow: 0 8px 18px rgba(15, 24, 30, 0.16);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  overflow: hidden;
}

.card-thumb--visa {
  background: linear-gradient(135deg, #102a63, #1e78c9);
}

.card-thumb--mastercard {
  background: linear-gradient(135deg, #8b1e2d, #e76f34);
}

.card-thumb--amex {
  background: linear-gradient(135deg, #146c8d, #39b8c7);
}

.card-thumb--elo {
  background: linear-gradient(135deg, #4b238d, #d13c74);
}

.card-thumb--hipercard {
  background: linear-gradient(135deg, #7d1c2d, #bf3e4b);
}

.card-thumb-fallback {
  grid-area: 1 / 1;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 100%;
  line-height: 1;
}

.card-thumb-fallback svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.card-thumb-mark {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.card-thumb.has-image {
  background-color: transparent;
  padding: 0;
}

.card-thumb.has-image .card-thumb-fallback {
  opacity: 0.2;
}

.card-thumb img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 0;
  display: block;
  position: relative;
  z-index: 1;
}

.card-thumb.is-broken {
  background: linear-gradient(135deg, rgba(30, 91, 82, 0.95), rgba(240, 180, 41, 0.75));
}

.card-thumb.is-broken .card-thumb-fallback {
  display: inline-flex;
}

.card-thumb.is-broken img {
  display: none;
}

.future-list {
  display: grid;
  gap: 12px;
}

.future-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px) 120px;
  gap: 20px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
}

/* The dashboard can place three cards in one row. Keep the nested invoice
   preview inside its card when that row becomes narrower than the preview's
   desktop columns. */
.dashboard-section .future-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.dashboard-section .future-sparkline {
  justify-content: flex-start;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.dashboard-section .future-actions {
  justify-content: flex-start;
  min-width: 0;
}

.future-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.future-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.future-title-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.future-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.future-sparkline {
  display: flex;
  justify-content: center;
}

.sparkline {
  width: 100%;
  height: auto;
  aspect-ratio: var(--spark-aspect, 4);
  display: block;
  stroke: var(--primary);
  stroke-width: 2;
  fill: none;
}

.sparkline-canvas {
  display: block;
  width: 100% !important;
  height: 70px !important;
}

.sparkline circle {
  fill: var(--primary);
}

.sparkline-wrap {
  display: grid;
  gap: 8px;
  justify-items: stretch;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  min-width: 0;
}

.dashboard-section .sparkline-wrap {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.sparkline-wrap.is-compact {
  max-width: 160px;
  gap: 6px;
}

.sparkline-labels {
  display: grid;
  gap: 8px;
  font-size: 10px;
  color: var(--muted);
  grid-template-columns: repeat(var(--spark-count, 1), minmax(0, 1fr));
  justify-items: center;
}

.sparkline-wrap.is-compact .sparkline-labels {
  font-size: 9px;
}

.sparkline-values {
  display: grid;
  gap: 8px;
  font-size: 9px;
  font-weight: 600;
  color: var(--text);
  margin-top: 0;
  grid-template-columns: repeat(var(--spark-count, 1), minmax(0, 1fr));
  justify-items: center;
}

.sparkline-labels span,
.sparkline-values span {
  text-align: center;
}

.sparkline-values span {
  white-space: nowrap;
}

.sparkline polyline {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.future-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  align-self: center;
}

.statement-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.statement-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.statement-bulk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 12px;
  flex-wrap: wrap;
}

.statement-sort .field {
  margin: 0;
}

.statement-sort .muted.small {
  font-weight: 600;
}

.statement-label {
  color: var(--muted);
  font-size: 12px;
}

.statement-value {
  font-size: 17px;
  font-weight: 600;
}

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: rgba(30, 91, 82, 0.12);
  color: var(--success);
}

.status-pill.is-closed {
  background: rgba(240, 180, 41, 0.18);
  color: #7a5a11;
}

.status-pill.is-paid {
  background: rgba(46, 140, 79, 0.18);
  color: #1e8f4a;
}

.progress {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(30, 91, 82, 0.12);
  overflow: hidden;
}

.progress span {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-pressed));
  border-radius: 999px;
}

.progress.light {
  background: rgba(30, 91, 82, 0.08);
}

.progress.is-over {
  background: rgba(192, 75, 63, 0.15);
}

.progress.is-over span {
  background: linear-gradient(90deg, #c04b3f, #e07a70);
}

.progress.is-warning {
  background: rgba(240, 180, 41, 0.2);
}

.progress.is-warning span {
  background: linear-gradient(90deg, #f0b429, #f7d774);
}

.statement-meta,
.statement-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.pay-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.pay-summary strong {
  color: var(--text);
  font-weight: 600;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
}

.list-title {
  font-weight: 600;
}

.list-value {
  font-weight: 600;
}

.list-value.positive {
  color: #1e8f4a;
}

.list-value.negative {
  color: #c04b3f;
}

.list-footer {
  margin-top: 12px;
}

.category-list {
  display: grid;
  gap: 14px;
}

.category-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.category-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-value {
  font-weight: 600;
}

.category-bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: rgba(30, 91, 82, 0.08);
  overflow: hidden;
}

.category-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(30, 91, 82, 0.6), rgba(30, 91, 82, 0.2));
}

.donut-layout {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  align-items: center;
}

.donut-chart-wrap {
  position: relative;
  width: 160px;
  height: 160px;
}

.donut-chart {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--donut, conic-gradient(var(--donut-empty) 0% 100%));
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.donut-center {
  position: absolute;
  inset: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  z-index: 1;
}

.donut-total {
  font-size: 16px;
  font-weight: 600;
}

.donut-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.donut-legend {
  display: grid;
  gap: 10px;
}

.donut-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.donut-legend-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 14px;
}

.donut-legend-info > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-legend-value {
  flex: 0 0 auto;
  white-space: nowrap;
  font-weight: 600;
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.report-tab {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.report-tab:hover {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  color: var(--primary);
}

.report-tab.is-active {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  color: var(--text);
}

.flow-list {
  display: grid;
  gap: 16px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-key {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
}

.chart-key.is-balance { background: var(--chart-balance); }
.chart-key.is-income { background: var(--chart-income); }
.chart-key.is-expense { background: var(--chart-expense); }

.balance-history-chart {
  margin: 4px 0 20px;
  padding: 4px 0 0;
}

.balance-history-chart svg {
  display: block;
  width: 100%;
  height: 190px;
  overflow: visible;
}

.dashboard-history-chart {
  position: relative;
  width: 100%;
  height: clamp(210px, 28vw, 280px);
  padding: 8px 4px 0;
}

.dashboard-history-chart canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.chart-grid-line {
  stroke: var(--border);
  stroke-dasharray: 4 5;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line.is-balance { stroke: var(--chart-balance); }
.chart-line.is-cost { stroke: var(--chart-cost); stroke-dasharray: 8 5; }
.chart-line.is-income { stroke: var(--chart-income); }
.chart-line.is-expense { stroke: var(--chart-expense); }

.chart-point.is-balance { fill: var(--chart-balance); }
.chart-point.is-cost { fill: var(--chart-cost); }
.chart-point.is-income { fill: var(--chart-income); }
.chart-point.is-expense { fill: var(--chart-expense); }

.chart-legend .legend-market::before,
.chart-legend .legend-cost::before {
  content: '';
  width: 18px;
  height: 3px;
  border-radius: 3px;
  background: var(--chart-balance);
}

.chart-legend .legend-cost::before {
  background: var(--chart-cost);
}

.balance-history-labels {
  display: grid;
  gap: 0;
  color: var(--muted);
  font-size: 10px;
  padding-inline: 12px;
}

.balance-history-labels span {
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}

.dashboard-page .balance-history-chart {
  padding-inline: 4px;
}

.flow-item {
  display: grid;
  gap: 8px;
}

.flow-label {
  font-size: 12px;
  color: var(--muted);
}

.flow-value {
  font-weight: 600;
}

.flow-value.positive {
  color: var(--success);
}

.flow-value.negative {
  color: var(--danger);
}

.budget-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.budget-indent {
  padding-left: calc(var(--depth, 0) * 16px);
}

.budget-group td {
  background: var(--surface-2);
  font-weight: 600;
}

.budget-group .muted {
  font-weight: 500;
}

.budget-detail td {
  color: var(--muted);
}

.budget-group-total td {
  background: var(--surface-2);
  font-weight: 600;
  border-top: 1px solid var(--border);
}

.budget-row.is-focus-target td {
  animation: budget-focus-pulse 2.2s ease-out;
}

@keyframes budget-focus-pulse {
  0%, 100% { box-shadow: inset 0 0 0 0 color-mix(in srgb, var(--primary) 0%, transparent); }
  20% { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 72%, transparent); }
}

.budget-group-toggle,
.account-group-toggle {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

.account-group-spacer {
  display: inline-block;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
}

.budget-group-toggle svg,
.account-group-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.budget-group-toggle.is-collapsed svg,
.account-group-toggle.is-collapsed svg {
  transform: rotate(-90deg);
}

.budget-row.is-hidden,
.account-row.is-hidden,
.table-row-mobile.is-hidden {
  display: none;
}

.table-row-mobile.is-group .table-mobile-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.table-row-mobile.is-group-total .table-mobile-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.budget-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.budget-overview-main {
  display: grid;
  gap: 10px;
}

.budget-overview-value {
  font-size: 28px;
  font-weight: 700;
}

.budget-overview-meta {
  font-size: 12px;
  color: var(--muted);
}

.budget-overview-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.budget-alerts {
  display: grid;
  gap: 10px;
}

.budget-alert-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(11, 42, 102, 0.06);
}

.budget-alert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.budget-alert-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.budget-alert-meta .negative {
  color: #c04b3f;
  font-weight: 700;
}

.budget-alert-trend {
  max-width: 160px;
}

.budget-alert-trend .sparkline {
  stroke: var(--primary);
}

.budget-alert-trend .sparkline-canvas {
  height: 58px !important;
}

.budget-alert-trend .sparkline circle {
  fill: var(--primary);
}

/* Keep the budget panel compact when several category alerts are present.
   Two alert columns prevent the right side from creating a very tall card
   while the overview remains mostly empty on the left. */
@media (min-width: 721px) {
  .budget-alerts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
  }
}

body[data-theme="dark"] .budget-alert-item {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--border);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

body[data-theme="dark"] .budget-alert-item .status-warning {
  background: rgba(240, 180, 41, 0.2);
  color: #ffd166;
}

body[data-theme="dark"] .budget-alert-item .status-inactive {
  background: rgba(255, 112, 105, 0.16);
  color: #ff8d86;
}

body[data-theme="dark"] .budget-alert-item .status-active {
  background: rgba(80, 202, 137, 0.16);
  color: #69d99b;
}

body[data-theme="dark"] .budget-alert-meta .negative {
  color: #ff8d86;
}

@media (prefers-color-scheme: dark) {
  body[data-theme="auto"] .budget-alert-item {
    background: rgba(255, 255, 255, 0.045);
    border-color: var(--border);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
  }

  body[data-theme="auto"] .budget-alert-item .status-warning {
    background: rgba(240, 180, 41, 0.2);
    color: #ffd166;
  }

  body[data-theme="auto"] .budget-alert-item .status-inactive {
    background: rgba(255, 112, 105, 0.16);
    color: #ff8d86;
  }

  body[data-theme="auto"] .budget-alert-item .status-active {
    background: rgba(80, 202, 137, 0.16);
    color: #69d99b;
  }

  body[data-theme="auto"] .budget-alert-meta .negative {
    color: #ff8d86;
  }
}

@media (max-width: 720px) {
  .billing-current-grid {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .statement-card {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-grid .card {
    padding: 14px;
  }

  .stat-card .value {
    font-size: var(--financial-value-normal-size);
  }

  .stat-card .label,
  .stat-card .hint {
    font-size: 11px;
  }

  .donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .donut-legend {
    width: 100%;
  }

  .report-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .report-tab {
    white-space: nowrap;
  }
}

@media (max-width: 1200px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 14px;
  align-content: start;
  justify-items: stretch;
  min-width: 0;
}

.field.is-hidden {
  display: none;
}

.field-suggest .suggest-box,
.suggest-box {
  position: relative;
  width: 100%;
}

.field-suggest .input,
.suggest-box .input {
  width: 100%;
}

.suggest-list {
  position: absolute;
  inset: calc(100% + 6px) 0 auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  display: none;
  z-index: 20;
}

.suggest-list.is-open {
  display: grid;
  gap: 4px;
}

.suggest-item {
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.suggest-item:hover {
  background: var(--surface-2);
}

.suggest-title {
  font-weight: 600;
  font-size: 14px;
}

.suggest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 15px;
  font-family: "Inter", sans-serif;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-group .input {
  flex: 1;
  min-width: 0;
}

.input-static {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  background: var(--surface-2);
  color: var(--text);
}

.input-readonly {
  display: flex;
  align-items: center;
  color: var(--muted);
  background: #f7f7f5;
}

.input[type="color"] {
  padding: 4px;
  height: 46px;
}

.input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 4px;
}

.input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}

.input.input-inline {
  padding: 8px 10px;
  font-size: 13px;
  min-width: 180px;
}

.table .input.input-inline {
  width: 100%;
}

.input-textarea {
  min-height: 88px;
  resize: vertical;
}

.input:focus {
  outline: 2px solid rgba(30, 91, 82, 0.18);
  border-color: rgba(30, 91, 82, 0.45);
}

.select-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-with-icon .category-preview {
  display: flex;
  align-items: center;
}

.select-with-icon .icon-pill {
  flex: 0 0 auto;
}

.select-with-icon .input {
  flex: 1 1 auto;
  min-width: 160px;
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

.hint-text {
  color: var(--muted);
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 24px rgba(30, 91, 82, 0.2);
}

.btn.secondary {
  background: rgba(30, 91, 82, 0.12);
  color: var(--primary);
}

.btn.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}

.sidebar .btn.ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.btn.full {
  width: 100%;
}

[data-toggle-values-icon] .icon-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-toggle-values-icon] .icon-eye svg {
  width: 20px;
  height: 20px;
}

.topbar-values-toggle {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
}

[data-toggle-values-icon] .icon-eye-closed {
  display: none;
}

.hide-values [data-toggle-values-icon] .icon-eye-open {
  display: none;
}

.hide-values [data-toggle-values-icon] .icon-eye-closed {
  display: inline-flex;
}

.hide-values-preload [data-toggle-values-icon] .icon-eye-open {
  display: none;
}

.hide-values-preload [data-toggle-values-icon] .icon-eye-closed {
  display: inline-flex;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible,
.btn.icon:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 55%, #fff);
  outline-offset: 3px;
  transform: none;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid transparent;
}

.alert.error {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 42%, var(--border));
  color: var(--danger);
}

.alert.success {
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--success) 38%, var(--border));
  color: var(--success);
}

.investment-quote-alert {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 14px;
  background: rgba(240, 180, 41, 0.1);
  border-color: rgba(240, 180, 41, 0.35);
  color: var(--text);
}

.investment-quote-alert span {
  color: var(--muted);
}

.investment-quote-alert .btn {
  margin-left: auto;
}

@media (max-width: 720px) {
  .investment-quote-alert .btn {
    margin-left: 0;
  }
}

.alert.is-hidden {
  display: none;
}

.link {
  color: var(--primary);
  font-weight: 600;
}

.form-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: start;
}

.form-grid .input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-width: 0;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.account-inline-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.account-parent-field {
  display: grid;
  gap: 16px;
}

.icon-color-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.icon-color-choice {
  display: grid;
  grid-template-columns: 30px minmax(42px, 1fr) 18px;
  align-items: center;
  min-height: 56px;
  min-width: 0;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.icon-color-choice > span:not(.icon-color-dot) {
  min-width: 0;
  white-space: nowrap;
}

.icon-color-choice:hover,
.icon-color-choice:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.icon-color-dot {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  display: grid;
  place-items: center;
  color: var(--icon-foreground, #ffffff);
  cursor: inherit;
}

.icon-color-dot svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-color-dot .icon-fallback {
  color: inherit;
  font-size: 12px;
  font-weight: 600;
}

.icon-color-chevron {
  width: 20px;
  height: 20px;
  color: var(--muted);
  justify-self: end;
  pointer-events: none;
}

.icon-spot {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f0f3f2;
  display: grid;
  place-items: center;
  color: var(--icon-foreground, #ffffff);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-spot svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.icon-spot .icon-fallback {
  font-size: 12px;
  font-weight: 600;
  color: inherit;
}

.icon-spot:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 24, 30, 0.12);
}

.icon-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.icon-picker-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.icon-picker-modal.is-open {
  display: flex;
}

body.has-icon-modal {
  overflow: hidden;
}

.icon-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 24, 30, 0.45);
}

.icon-picker-panel {
  position: relative;
  width: min(720px, calc(100% - 32px));
  height: min(760px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(15, 24, 30, 0.18);
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  overflow: hidden;
}

.icon-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 6px 2px 0;
  scrollbar-color: color-mix(in srgb, var(--primary) 55%, transparent) transparent;
  scrollbar-width: thin;
}

.icon-picker-grid::-webkit-scrollbar {
  width: 6px;
}

.icon-picker-grid::-webkit-scrollbar-track {
  background: transparent;
}

.icon-picker-grid::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--primary) 55%, transparent);
  border-radius: 999px;
}

@media (max-width: 720px) {
  .icon-picker-panel {
    width: calc(100% - 24px);
    height: min(720px, calc(100vh - 24px));
    max-height: calc(100vh - 24px);
    padding: 14px;
    border-radius: 16px;
  }
}

.icon-option {
  border: 1px solid var(--border);
  background: #f5f6f4;
  border-radius: 14px;
  min-height: 84px;
  padding: 11px 7px 9px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  cursor: pointer;
  color: var(--primary);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.icon-option svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.icon-option .icon-fallback {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
}

.icon-option-label {
  width: 100%;
  min-height: 2.3em;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.icon-option:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 91, 82, 0.4);
  box-shadow: 0 10px 18px rgba(15, 24, 30, 0.12);
}

.icon-option.is-selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent);
}

.icon-option.is-selected .icon-option-label {
  color: var(--primary);
  font-weight: 700;
}

.goal-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(30, 91, 82, 0.08);
}

.goal-tab {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.goal-tab span {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(30, 91, 82, 0.12);
  color: var(--text);
}

.goal-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.settings-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(30, 91, 82, 0.08);
  flex-wrap: wrap;
  box-sizing: border-box;
}

.settings-tab {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

body[data-theme="light"] .report-tab,
body[data-theme="light"] .goal-tab,
body[data-theme="light"] .settings-tab {
  color: var(--primary-dark);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row-info {
  display: grid;
  gap: 4px;
}

.settings-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.settings-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(30, 91, 82, 0.15);
  position: relative;
  transition: background 0.2s ease;
}

.toggle-track::after {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  position: absolute;
  top: 3px;
  left: 3px;
  box-shadow: 0 6px 12px rgba(15, 24, 30, 0.15);
  transition: transform 0.2s ease;
}

.settings-toggle input:checked + .toggle-track {
  background: rgba(30, 91, 82, 0.7);
}

.settings-toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.settings-order-list {
  display: grid;
  gap: 10px;
}

.settings-order-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.settings-order-row.is-dragging {
  opacity: 0.6;
}

.settings-dashboard-presets{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:12px 14px;margin-bottom:16px;border:1px solid var(--border);border-radius:14px;background:var(--surface-2)}
.settings-dashboard-presets .btn{min-height:34px;padding:7px 11px;font-size:.78rem}
.settings-order-list{gap:18px}
.settings-order-group{display:grid;gap:8px}
.settings-order-group-heading{display:flex;align-items:center;padding:0 4px}
.settings-order-group-heading h4{margin:0;font-size:.95rem}
.settings-order-group-heading span{display:block;margin-top:2px}
.settings-order-group-list{display:grid;gap:8px}
.settings-order-group .settings-order-row{background:var(--surface-raised,var(--surface))}
.settings-order-group-toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:0;border:0;background:transparent;color:inherit;text-align:left;font:inherit;cursor:pointer}
.settings-order-group-chevron{display:none}

.settings-drag-handle {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 91, 82, 0.12);
  color: var(--primary);
  cursor: grab;
}

.settings-drag-handle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.settings-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.settings-check span {
  display: grid;
  gap: 4px;
}

.settings-order-actions {
  display: flex;
  gap: 6px;
}

.settings-widget-section {
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.icon-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.icon-button:hover:not(:disabled),
.icon-button:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

.icon-button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.dashboard-preset-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}

.dashboard-preset-bar > div:first-child {
  display: grid;
  gap: 4px;
}

.dashboard-preset-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-settings-preview {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.dashboard-settings-preview-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-settings-preview-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.dashboard-settings-preview-item {
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.dashboard-settings-preview-item::before {
  content: attr(data-preview-index);
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-bottom: 4px;
  border-radius: 50%;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  font-size: 10px;
}

.settings-session-list {
  display: grid;
  gap: 12px;
}

.settings-session-row {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.settings-session-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.settings-danger {
  border-color: rgba(192, 75, 63, 0.25);
}

.settings-danger .card-header h3 {
  color: #c04b3f;
}

.goal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.goal-card {
  display: grid;
  gap: 12px;
}

.goal-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.goal-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.goal-card-title strong {
  display: block;
}

.goal-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(30, 91, 82, 0.12);
  overflow: hidden;
}

.goal-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-pressed));
}

.goal-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.goal-next-step {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  background: rgba(30, 91, 82, 0.07);
  border-radius: 0 8px 8px 0;
}

.goal-next-step.is-complete {
  border-left-color: #2d8a5d;
}

.wealth-journey-card {
  display: grid;
  gap: 14px;
}

.wealth-journey-card .card-header {
  align-items: flex-start;
}

.wealth-journey-card h3 {
  margin-top: 4px;
}

.wealth-journey-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(30, 91, 82, 0.12);
  overflow: hidden;
}

.wealth-journey-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--primary));
}

.wealth-journey-next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--primary);
  background: rgba(30, 91, 82, 0.07);
  border-radius: 0 8px 8px 0;
}

.wealth-journey-next > div {
  display: grid;
  gap: 3px;
}

.wealth-journey-next strong {
  font-size: 15px;
}

.wealth-journey-goal {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.wealth-journey-goal > div {
  display: grid;
  gap: 3px;
}

.wealth-journey-goal strong {
  font-size: 14px;
}

.wealth-journey-goal-target {
  text-align: right;
}

@media (min-width: 721px) {
  .wealth-journey-card {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr);
    column-gap: 24px;
  }

  .wealth-journey-card > .card-header,
  .wealth-journey-card > .wealth-journey-progress {
    grid-column: 1 / -1;
  }

  .wealth-journey-card > .wealth-journey-next {
    grid-column: 1 / -1;
    height: 100%;
  }

  .wealth-journey-card:has(> .wealth-journey-goal) > .wealth-journey-next {
    grid-column: 1;
  }

  .wealth-journey-card > .wealth-journey-goal {
    grid-column: 2;
    height: 100%;
    padding-top: 0;
    border-top: 0;
    border-left: 1px solid var(--border);
    padding-left: 24px;
  }
}

/* On wide dashboards, keep the compact journey beside the financial trend.
   Below this breakpoint both sections return to the full-width reading flow. */
@media (min-width: 1280px) {
  .dashboard-stack > .dashboard-section.wealth-journey-section,
  .dashboard-stack > .dashboard-section.dashboard-flow-section {
    grid-column: span 1;
    align-self: stretch;
  }

  .dashboard-stack > .dashboard-section.dashboard-flow-section {
    order: 3 !important;
  }

  .dashboard-stack > .dashboard-section.wealth-journey-section > .card,
  .dashboard-stack > .dashboard-section.dashboard-flow-section > .card {
    height: 100%;
  }

  .dashboard-stack > .dashboard-section.wealth-journey-section > .wealth-journey-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) minmax(0, 1fr);
    align-content: stretch;
  }

  .dashboard-stack > .dashboard-section.wealth-journey-section > .wealth-journey-card > .wealth-journey-next,
  .dashboard-stack > .dashboard-section.wealth-journey-section > .wealth-journey-card > .wealth-journey-goal {
    grid-column: 1 / -1;
    align-self: stretch;
  }

  .dashboard-stack > .dashboard-section.wealth-journey-section > .wealth-journey-card > .wealth-journey-goal {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    padding-left: 0;
  }
}

.open-obligation-list {
  display: grid;
  gap: 8px;
}

.open-obligation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

.open-obligation-row:last-child {
  border-bottom: 0;
}

.open-obligation-row > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.open-obligation-row strong,
.open-obligation-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-obligation-value {
  flex: 0 0 auto;
  font-weight: 700;
}

.goal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.goal-empty {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.goal-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}

.goal-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.goal-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.goal-detail-body {
  display: grid;
  gap: 16px;
}

.goal-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(var(--success) var(--goal-progress), var(--surface-2) 0);
  display: grid;
  place-items: center;
  margin: 8px 0;
}

.goal-ring > div {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #ffffff;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.goal-ring strong {
  font-size: 20px;
  color: var(--text);
}

.goal-detail-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.goal-detail-info strong {
  display: block;
  margin-top: 4px;
}

.goal-detail-tip {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(240, 180, 41, 0.12);
  color: #7a5a11;
  font-size: 12px;
}

.goal-deposit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

@media (max-width: 960px) {
  .goal-empty {
    flex-direction: column;
    align-items: flex-start;
  }
  .goal-tabs {
    flex-wrap: wrap;
  }
}

.form-details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
}

.form-details + .form-details {
  margin-top: 6px;
}

.form-details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-details summary::-webkit-details-marker {
  display: none;
}

.details-chevron {
  color: var(--muted);
  font-size: 14px;
  transition: transform 0.2s ease;
}

.form-details[open] .details-chevron {
  transform: rotate(90deg);
}

.form-details[open] {
  background: #ffffff;
}

.investment-section-details > summary {
  list-style: none;
  cursor: pointer;
}

.investment-section-details > summary::-webkit-details-marker {
  display: none;
}

.investment-section-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0;
  min-height: 48px;
}

.investment-section-summary > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.investment-section-summary > span:first-child::before {
  content: none;
}

.investment-section-summary::after {
  content: '';
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  margin-left: 4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.investment-section-details[open] > .investment-section-summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
  border-color: var(--primary);
}

.investment-section-details[open] > summary {
  margin-bottom: 16px;
}

/* Long investment tables should not block painting for rows below the fold. */
.investments-page .investment-section-details[open] .table-wrap {
  content-visibility: auto;
  contain-intrinsic-size: 0 420px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

/* Conditional account fields must stay hidden despite component display rules. */
.form [hidden] {
  display: none !important;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.budget-toolbar {
  align-items: center;
}

.budget-toolbar form {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.budget-toolbar .input,
.budget-toolbar .btn {
  height: 44px;
}

.budget-toolbar .btn {
  padding: 0 16px;
}

.competence-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.input.small {
  padding: 8px 10px;
  font-size: 13px;
  min-height: 36px;
}

.table-wrap {
  overflow-x: auto;
}

.cards-table-wrap {
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
}

.investment-actions {
  flex-wrap: nowrap;
  gap: 6px;
  white-space: nowrap;
}

.investment-actions .btn.icon {
  width: 32px;
  height: 32px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

@media (min-width: 721px) {
  .transactions-page .transactions-table {
    table-layout: fixed;
    min-width: 0;
  }

  .transactions-page .transactions-table th:nth-child(1),
  .transactions-page .transactions-table td:nth-child(1) { width: 8%; }
  .transactions-page .transactions-table th:nth-child(2),
  .transactions-page .transactions-table td:nth-child(2) { width: 14%; }
  .transactions-page .transactions-table th:nth-child(3),
  .transactions-page .transactions-table td:nth-child(3) { width: 9%; }
  .transactions-page .transactions-table th:nth-child(4),
  .transactions-page .transactions-table td:nth-child(4) { width: 9%; }
  .transactions-page .transactions-table th:nth-child(5),
  .transactions-page .transactions-table td:nth-child(5) { width: 12%; }
  .transactions-page .transactions-table th:nth-child(6),
  .transactions-page .transactions-table td:nth-child(6) { width: 7%; }
  .transactions-page .transactions-table th:nth-child(7),
  .transactions-page .transactions-table td:nth-child(7) { width: 11%; }
  .transactions-page .transactions-table th:nth-child(8),
  .transactions-page .transactions-table td:nth-child(8) { width: 9%; }
  .transactions-page .transactions-table th:nth-child(9),
  .transactions-page .transactions-table td:nth-child(9) { width: 8%; }
  .transactions-page .transactions-table th:nth-child(10),
  .transactions-page .transactions-table td:nth-child(10) { width: 13%; }

  .transactions-page .transactions-table td:nth-child(2),
  .transactions-page .transactions-table td:nth-child(5),
  .transactions-page .transactions-table td:nth-child(6),
  .transactions-page .transactions-table td:nth-child(7),
  .transactions-page .transactions-table td:nth-child(9) {
    overflow-wrap: anywhere;
  }

  .transactions-page .transactions-table td:nth-child(4),
  .transactions-page .transactions-table td:nth-child(8),
  .transactions-page .transactions-table td:nth-child(10) {
    white-space: nowrap;
  }

  .transactions-page .transactions-table .actions-inline {
    justify-content: flex-start;
  }

  .transactions-page .transactions-table {
    font-size: 13px;
  }

  .transactions-page .transactions-table .status {
    padding: 3px 6px;
    font-size: 11px;
  }

  .cards-table {
    table-layout: fixed;
  }

  .cards-table th:nth-child(1),
  .cards-table td:nth-child(1) {
    width: 18%;
  }

  .cards-table th:nth-child(2),
  .cards-table td:nth-child(2) {
    width: 19%;
  }

  .cards-table th:nth-child(3),
  .cards-table td:nth-child(3) {
    width: 13%;
  }

  .cards-table th:nth-child(4),
  .cards-table td:nth-child(4) {
    width: 10%;
  }

  .cards-table th:nth-child(5),
  .cards-table td:nth-child(5) {
    width: 14%;
  }

  .cards-table th:nth-child(6),
  .cards-table td:nth-child(6) {
    width: 9%;
  }

  .cards-table th:last-child,
  .cards-table td:last-child {
    width: 18%;
  }

  .cards-table td:nth-child(5) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cards-table td:last-child {
    overflow: visible;
    white-space: nowrap;
  }

  .cards-table td:first-child {
    min-width: 0;
  }

  .cards-table th,
  .cards-table td {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .cards-table .card-label {
    min-width: 0;
  }

  .cards-table .card-label > div:last-child {
    min-width: 0;
  }

  .cards-table td:nth-child(5),
  .cards-table td:last-child {
    white-space: normal;
  }

  .cards-table td:last-child .card-actions {
    justify-content: flex-start;
    gap: 4px;
    flex-wrap: nowrap;
  }

  .cards-table td:last-child .card-actions .btn.icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
  }
}

.table-row-mobile {
  display: none;
}

.table-mobile-row {
  display: grid;
  gap: 10px;
  padding: 10px 6px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  width: 100%;
  position: relative;
  z-index: 1;
}

.table-mobile-swipe {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: var(--surface);
}

.table-mobile-swipe .table-mobile-row {
  transition: transform 0.2s ease;
}

.table-mobile-swipe.is-revealed .table-mobile-row {
  transform: translateX(-72px);
}

.table-mobile-action {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(192, 75, 63, 0.12);
  border-left: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 0;
}

.table-mobile-action .btn.icon {
  width: 36px;
  height: 36px;
}

.table-mobile-swipe.is-revealed .table-mobile-action {
  opacity: 1;
  pointer-events: auto;
}

.table-mobile-row.compact {
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 6px 10px;
  cursor: pointer;
}

.table-mobile-row.compact:focus-visible {
  outline: 2px solid rgba(30, 91, 82, 0.25);
  outline-offset: 2px;
  border-radius: 12px;
}

.table-mobile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-mobile-row.compact .table-mobile-main {
  gap: 4px;
}

.table-mobile-row.compact .table-mobile-title {
  gap: 2px;
}

.table-mobile-row.compact .table-mobile-title strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-mobile-row.compact .table-mobile-meta {
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

  .table-mobile-row.compact .table-mobile-side {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

.table-mobile-row.compact .table-mobile-value {
  font-size: 13px;
}

.table-mobile-row.compact .status {
  font-size: 10px;
  padding: 3px 8px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  padding: 0;
}

.table-mobile-main {
  display: grid;
  gap: 6px;
}

.table-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.table-mobile-head .table-mobile-title {
  min-width: 0;
}

.table-mobile-title {
  display: grid;
  gap: 4px;
}

.table-mobile-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.table-mobile-side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.table-mobile-value {
  font-weight: 600;
}

.table-mobile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-mobile-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.icon-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table td strong {
  display: block;
}

.table tr.is-inactive {
  opacity: 0.6;
}

.day-summary td {
  padding: 0;
  border-bottom: none;
}

.day-summary-row {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 8px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3f4f2;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.day-summary-title {
  font-weight: 600;
  color: var(--text);
}

.day-summary-values {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

.day-summary-item strong {
  color: var(--text);
  font-weight: 600;
  margin-left: 4px;
}

.day-summary-item.positive strong {
  color: #1e8f4a;
}

.day-summary-item.negative strong {
  color: #c04b3f;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(30, 91, 82, 0.12);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

.tag.small {
  padding: 2px 8px;
  font-size: 10px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(240, 180, 41, 0.18);
  color: #7a5a11;
  font-size: 11px;
  font-weight: 600;
}

.chip-remove {
  border: none;
  background: transparent;
  color: inherit;
  margin-left: 6px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.keyword-editor {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.keyword-label {
  font-size: 11px;
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-active {
  background: rgba(30, 143, 74, 0.12);
  color: #1a6a38;
}

.status-warning {
  background: rgba(240, 180, 41, 0.18);
  color: #6b4500;
}

.status-inactive {
  background: rgba(192, 75, 63, 0.12);
  color: #8f2e25;
}

.status-neutral {
  background: color-mix(in srgb, var(--muted) 14%, transparent);
  color: var(--muted);
}

.card-label {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-label > div:last-child {
  min-width: 0;
}

.card-label strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted.small {
  font-size: 12px;
}

.status-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}

.toggle-field .settings-toggle {
  pointer-events: auto;
}
.statement-box {
  display: grid;
  gap: 4px;
}

.statement-next-action {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.account-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-name-copy {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.2;
}

.account-system-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.2;
}

.account-system-lock {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  min-width: 32px;
  height: 32px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: #eef3f2;
  color: var(--icon-foreground, var(--primary));
  font-size: 15px;
  font-weight: 600;
}

.icon-pill svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon-pill.is-filled {
  color: var(--icon-foreground, #fff);
}

.icon-pill.is-filled.is-empty {
  font-size: 0;
  color: transparent;
}

.mobile-type-icon {
  display: inline-flex;
  flex: 0 0 auto;
}

.icon-pill.is-outline,
.icon-pill.is-color {
  background: transparent;
  border: 1px solid var(--border);
}

.btn.small {
  padding: 8px 12px;
  font-size: 12px;
}

.btn.icon {
  padding: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.btn.icon svg {
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.btn.danger {
  background: rgba(192, 75, 63, 0.12);
  color: #c04b3f;
  border: 1px solid rgba(192, 75, 63, 0.25);
  box-shadow: none;
}

.btn.danger:hover {
  background: rgba(192, 75, 63, 0.18);
}

.auth {
  background: radial-gradient(circle at 20% 20%, #ffffff 0%, #f7f9fc 50%, #e9f0f8 100%);
}

.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.auth-panel {
  padding: 48px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-brand {
  color: var(--primary-dark);
}

.auth-side {
  background: radial-gradient(circle at 78% 18%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 28%),
    linear-gradient(160deg, var(--primary-dark) 0%, var(--joozo-navy-800, #0a2150) 60%, var(--primary) 145%);
  color: #fff;
  padding: 48px;
  display: flex;
  align-items: center;
}

.auth-side-content {
  display: grid;
  gap: 16px;
  max-width: 360px;
}

.auth-metrics {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.metric-value {
  font-size: 24px;
  font-weight: 700;
  display: block;
}

.metric-label {
  font-size: 13px;
  opacity: 0.8;
}

.bottom-nav {
  position: fixed;
  bottom: 14px;
  left: 14px;
  right: 14px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  display: none;
  gap: 8px;
  align-items: center;
  z-index: 10;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.bottom-nav.is-nav-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(calc(100% + 24px));
}

.bottom-item {
  flex: 1;
  text-align: center;
  font-size: 12px;
  display: grid;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  min-width: 0;
  justify-items: center;
  -webkit-tap-highlight-color: transparent;
}

.bottom-item:focus {
  outline: none;
  box-shadow: none;
}

.bottom-item:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 62%, #fff);
  outline-offset: 3px;
  box-shadow: none;
}

.bottom-item.is-active {
  background: rgba(30, 91, 82, 0.1);
  color: var(--primary);
}

.bottom-item .nav-icon {
  margin: 0 auto;
}

.bottom-item.is-fab {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 16px 24px rgba(30, 91, 82, 0.35);
  margin-top: -30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  transition: transform 0.24s ease, opacity 0.24s ease, box-shadow 0.24s ease;
}

.bottom-nav.is-fab-hidden .bottom-item.is-fab {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: scale(0) !important;
  box-shadow: none !important;
}

.bottom-item.is-fab .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.bottom-item.is-fab .nav-icon svg {
  stroke: #fff;
  transition: transform 0.25s ease;
}

.bottom-item.is-fab.is-open .nav-icon svg {
  transform: rotate(45deg);
}

.notify-toggle {
  position: relative;
}

.notify-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #b42318;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.notify-panel {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  z-index: 45;
}

.notify-panel.is-open {
  display: flex;
}

.notify-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 24, 30, 0.4);
  border: none;
}

.notify-card {
  position: relative;
  width: min(420px, 92vw);
  max-height: 80vh;
  margin: 80px 18px 18px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 16px;
  overflow: hidden;
}

.notify-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.notify-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notify-list {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.notify-item-form {
  margin: 0;
}

.notify-item {
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  position: relative;
}

.notify-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  position: absolute;
  top: 14px;
  right: 14px;
}

.notify-item.is-read {
  opacity: 0.7;
}

.notify-item.is-read::before {
  background: transparent;
}

.notify-title {
  font-weight: 600;
}

.notify-body {
  font-size: 12px;
  color: var(--muted);
}

.notify-time {
  font-size: 11px;
  color: var(--muted);
}

.notify-empty {
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  font-size: 12px;
  color: var(--muted);
}

.fab-menu {
  position: fixed;
  inset: 0;
  display: block;
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.fab-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.fab-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 24, 30, 0.5);
  opacity: 0;
  border: none;
  transition: opacity 0.2s ease;
}

.fab-menu.is-open .fab-backdrop {
  opacity: 1;
}

.fab-actions {
  position: absolute;
  bottom: 110px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

.fab-action {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%) translate(0, 0) scale(0.2);
  opacity: 0;
  width: 90px;
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  color: #f5f7f6;
  font-size: 11px;
  pointer-events: auto;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  transition-delay: var(--delay, 0ms);
  -webkit-tap-highlight-color: transparent;
}

.fab-action:focus {
  outline: none;
  box-shadow: none;
}

.fab-action:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 62%, #fff);
  outline-offset: 3px;
  box-shadow: none;
}

.fab-action:active {
  transform: translate(-50%, -50%) translate(var(--x, 0px), var(--y, 0px)) scale(0.98);
}

.bottom-item:active {
  transform: scale(0.98);
}

.fab-menu.is-open .fab-action {
  transform: translate(-50%, -50%) translate(var(--x, 0px), var(--y, 0px)) scale(1);
  opacity: 1;
  animation: fab-pop 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--delay, 0ms);
}

@keyframes fab-pop {
  0% {
    transform: translate(-50%, -50%) translate(0, 0) scale(0.2);
    opacity: 0;
  }
  70% {
    transform: translate(-50%, -50%) translate(var(--x, 0px), var(--y, 0px)) scale(1.08);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--x, 0px), var(--y, 0px)) scale(1);
    opacity: 1;
  }
}

.fab-icon {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 12px 24px rgba(15, 24, 30, 0.18);
  display: grid;
  place-items: center;
  color: var(--primary);
}

.fab-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.fab-label {
  font-size: 11px;
}

.more-sheet {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 42;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.more-sheet.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.more-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 24, 30, 0.45);
  border: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.more-panel {
  position: relative;
  width: min(520px, 94vw);
  max-height: 70vh;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding: 18px 18px 24px;
  box-shadow: 0 -16px 32px rgba(15, 24, 30, 0.18);
  display: grid;
  gap: 14px;
  overflow-y: auto;
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.mobile-filter-trigger,
.mobile-filter-sheet {
  display: none;
}

.mobile-filter-current {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.more-sheet.is-open .more-backdrop {
  opacity: 1;
}

.more-sheet.is-open .more-panel {
  transform: translateY(0);
  opacity: 1;
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 24, 30, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 60;
}

.dialog-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: transparent;
}

.dialog-card {
  position: relative;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  width: min(420px, 100%);
  padding: 18px;
  display: grid;
  gap: 12px;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.dialog-overlay.is-open .dialog-card {
  transform: translateY(0) scale(1);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-header h4 {
  margin: 0;
  font-size: 18px;
}

.dialog-desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.dialog-close {
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 1;
}

.is-dialog-open {
  overflow: hidden;
}

.calc-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 60;
}

.calc-overlay.is-open {
  display: flex;
}

.calc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 24, 30, 0.5);
  border: none;
}

.calc-panel {
  position: relative;
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 20px;
  box-shadow: 0 -16px 36px rgba(15, 24, 30, 0.25);
  display: grid;
  gap: 16px;
  z-index: 1;
}

[data-theme="dark"] .calc-panel {
  background: #141a1c;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.calc-display {
  display: grid;
  gap: 6px;
}

.calc-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.calc-value {
  font-size: 24px;
  font-weight: 700;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.calc-key {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

[data-theme="dark"] .calc-key {
  background: #1a2124;
  border-color: rgba(255, 255, 255, 0.08);
  color: #e7ecef;
}

.calc-key-func {
  color: var(--primary);
}

.calc-key-op {
  color: var(--accent);
  font-weight: 700;
}

[data-theme="dark"] .calc-key-op {
  color: #f2c14f;
}

.calc-key-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 12px 22px rgba(30, 91, 82, 0.25);
}

.calc-key-equals {
  background: var(--accent);
  color: #1c2428;
  border: none;
  box-shadow: 0 12px 22px rgba(240, 180, 41, 0.3);
}

[data-theme="dark"] .calc-key-equals {
  background: var(--accent);
  color: #1c2428;
  border: none;
}

.calc-key-wide {
  grid-column: span 2;
}

@media (min-width: 961px) {
  .calc-overlay {
    align-items: center;
  }

  .calc-panel {
    border-radius: 20px;
  }
}

.category-sheet {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 45;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.category-sheet.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.category-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 24, 30, 0.45);
  border: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.category-panel {
  position: relative;
  width: min(520px, 94vw);
  max-height: 72vh;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding: 18px 18px 20px;
  box-shadow: 0 -16px 32px rgba(15, 24, 30, 0.18);
  display: grid;
  gap: 12px;
  overflow-y: auto;
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.category-sheet.is-open .category-backdrop {
  opacity: 1;
}

.category-sheet.is-open .category-panel {
  transform: translateY(0);
  opacity: 1;
}

.category-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.category-search {
  width: 100%;
}

.category-list {
  display: grid;
  gap: 8px;
}

.category-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.category-option:hover {
  border-color: rgba(30, 91, 82, 0.35);
  background: rgba(30, 91, 82, 0.06);
}

.category-option.is-selected {
  border-color: rgba(30, 91, 82, 0.55);
  background: rgba(30, 91, 82, 0.08);
}

.category-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.category-option-label {
  flex: 1;
}

.category-option.is-hidden {
  display: none;
}

.category-quick-btn.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.filter-sheet {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 44;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.filter-sheet.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.filter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 24, 30, 0.45);
  border: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.filter-panel {
  position: relative;
  width: min(520px, 94vw);
  max-height: 78vh;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding: 18px 18px 24px;
  box-shadow: 0 -16px 32px rgba(15, 24, 30, 0.18);
  display: grid;
  gap: 12px;
  overflow-y: auto;
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.filter-sheet.is-open .filter-backdrop {
  opacity: 1;
}

.filter-sheet.is-open .filter-panel {
  transform: translateY(0);
  opacity: 1;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.filters-inline {
  display: flex;
}

@media (min-width: 1350px) {
  .transactions-page .filters-inline {
    display: grid;
    grid-template-columns: minmax(160px, 1.05fr) minmax(145px, 1.1fr) minmax(145px, 1.1fr) 84px 108px minmax(125px, 1fr) minmax(125px, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .transactions-page .filters-inline .input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .transactions-page .filters-inline .btn {
    white-space: nowrap;
  }
}

@media (min-width: 721px) and (max-width: 1349px) {
  .transactions-page .filters-inline {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
  }

  .transactions-page .filters-inline .input,
  .transactions-page .filters-inline .btn {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .transactions-page .filters-inline input[name="q"] {
    grid-column: span 2;
  }
}

.only-mobile {
  display: none;
}

.only-desktop {
  display: block;
}

.show-mobile {
  display: none;
}

.hide-mobile {
  display: inline-flex;
}

.more-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.more-list {
  display: grid;
  gap: 8px;
}

.more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 14px;
}

.is-overlay-open {
  overflow: hidden;
}

.sheet {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  z-index: 40;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sheet.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 24, 30, 0.4);
  cursor: default;
}

.sheet-panel {
  position: relative;
  height: 100%;
  width: min(560px, 100%);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 40px rgba(15, 24, 30, 0.15);
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(20px);
  transition: transform 0.2s ease;
}

.sheet.is-open .sheet-panel {
  transform: translateX(0);
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.form-header {
  position: sticky;
  top: -24px;
  z-index: 2;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  min-height: 52px;
  margin: -24px -24px 0;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.form-header-title {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}

.sheet-panel .input,
.sheet-panel .input-static {
  min-height: 56px;
}

.sheet-panel .btn {
  min-height: 48px;
}

.balance-adjustment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.balance-adjustment-panel {
  width: min(640px, 100%);
  padding: 26px;
  gap: 24px;
}

.balance-adjustment-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.2;
}

.balance-adjustment-account {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.balance-adjustment-close {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.balance-adjustment-close:hover,
.balance-adjustment-close:focus-visible {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.balance-adjustment-form {
  margin-top: 0;
  gap: 20px;
}

.balance-adjustment-form > label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 16px;
}

.balance-adjustment-form > label .input {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
}

.balance-adjustment-form textarea.input {
  min-height: 94px;
  resize: vertical;
}

.balance-adjustment-panel > .alert.info {
  margin: 0;
  padding: 0 16px;
  background: transparent;
  border: 0;
  color: var(--text);
}

.balance-adjustment-form > .btn.primary {
  min-height: 46px;
}

.balance-adjustment-history {
  display: grid;
  gap: 12px;
}

.form-header-action:hover {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
}

.form-header-action:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 55%, #fff);
  outline-offset: 2px;
}

.form-header-action svg {
  width: 20px;
  height: 20px;
}

.form-header-save:disabled {
  color: var(--muted);
  opacity: 0.55;
  cursor: not-allowed;
}

.form-header-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: form-header-spin 0.8s linear infinite;
}

.form-header-save.is-saving .form-header-check {
  display: none;
}

.form-header-save.is-saving .form-header-spinner {
  display: block;
}

@keyframes form-header-spin {
  to { transform: rotate(360deg); }
}

.report-trend {
  display: grid;
  gap: 12px;
}

.report-trend-row {
  display: grid;
  grid-template-columns: 90px 1fr 160px;
  gap: 12px;
  align-items: center;
}

.report-trend-label {
  font-size: 12px;
  color: var(--muted);
}

.report-trend-bars {
  display: grid;
  gap: 6px;
}

.report-trend-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(30, 91, 82, 0.12);
  overflow: hidden;
}

.report-trend-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.report-trend-income span {
  background: linear-gradient(90deg, rgba(30, 143, 74, 0.7), rgba(30, 143, 74, 0.3));
}

.report-trend-expense span {
  background: linear-gradient(90deg, rgba(192, 75, 63, 0.7), rgba(192, 75, 63, 0.3));
}

.report-trend-values {
  display: grid;
  gap: 4px;
  justify-items: end;
  font-size: 12px;
}

.report-trend-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 6px;
}

.legend-income {
  background: rgba(30, 143, 74, 0.7);
}

.legend-expense {
  background: rgba(192, 75, 63, 0.7);
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 0 12px calc(150px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 8;
    margin: 0 -12px;
    padding: 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .page-header {
    align-items: flex-start;
    gap: 12px;
  }

  .card {
    padding: 12px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 8px;
  }

  .form-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .form-inline .input,
  .form-inline .btn {
    width: 100%;
  }

  .settings-tabs {
    width: 100%;
    flex-wrap: wrap;
    overflow: visible;
    border-radius: 16px;
    padding: 8px;
    gap: 6px;
  }

  .settings-tab {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .settings-order-row {
    grid-template-columns: 30px 1fr auto;
    align-items: flex-start;
  }

  .col-hide-sm {
    display: none;
  }

  .table.is-mobile-card thead {
    display: none;
  }

  .table.is-mobile-card tbody tr:not(.table-row-mobile) {
    display: none;
  }

  .table.is-mobile-card tbody tr.day-summary {
    display: table-row;
  }

  .table.is-mobile-card .table-row-mobile {
    display: table-row;
  }

  .table.is-mobile-card .table-row-mobile.is-hidden {
    display: none;
  }

  .table.is-mobile-card .table-row-mobile td {
    padding: 0;
  }

  .table {
    font-size: 12px;
  }

  .table th,
  .table td {
    padding: 8px 6px;
  }

  .page {
    gap: 10px;
  }

  .reports-page {
    width: 100%;
    overflow-x: hidden;
  }

  .reports-page .card-grid {
    grid-template-columns: 1fr;
  }

  .reports-page .report-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
  }

  .reports-page .report-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    white-space: normal;
    text-align: center;
    padding: 8px 10px;
    font-size: 12px;
  }

  .reports-page .reports-filter-card {
    padding: 0;
    overflow: hidden;
  }

  .reports-page .reports-filter-card > summary {
    list-style: none;
    cursor: pointer;
    margin: 0;
    padding: 14px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .reports-page .reports-filter-card > summary::-webkit-details-marker {
    display: none;
  }

  .reports-page .reports-filter-card > summary::after {
    content: '+';
    color: var(--primary);
    font-size: 20px;
    line-height: 1;
  }

  .reports-page .reports-filter-card[open] > summary::after {
    content: '\2013';
  }

  .reports-page .reports-filter-card > form {
    padding: 0 14px 14px;
  }

  .donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .donut-chart-wrap {
    width: 140px;
    height: 140px;
  }

  .donut-center {
    inset: 18px;
  }

  .donut-legend {
    width: 100%;
  }

  .donut-legend-row {
    align-items: center;
  }

  .donut-legend-info {
    min-width: 0;
  }

  .donut-legend-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
  }

  .donut-legend-value {
    flex-shrink: 0;
  }

  .dashboard-stack {
    grid-template-columns: 1fr;
  }

  .dashboard-section > .grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-summary-section .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-legend {
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 8px;
  }

  .balance-history-chart svg {
    height: 150px;
  }

  .filters-inline {
    display: none;
  }

  .only-mobile {
    display: block;
  }

  .only-desktop {
    display: none !important;
  }

  .show-mobile {
    display: inline-flex;
  }

  .hide-mobile {
    display: none !important;
  }

  .competence-form {
    margin-bottom: 12px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .competence-form .input {
    min-width: 120px;
  }

  .period-pill {
    display: none;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .summary-grid .stat-card {
    padding: 12px;
    min-height: 116px;
    display: flex;
    flex-direction: column;
  }

  .transactions-summary-top {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .transactions-summary-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  }

  .transactions-summary-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .transactions-summary-icon.is-green { color: #087f5b; background: #e2f5eb; }
  .transactions-summary-icon.is-red { color: #c94b43; background: #fde9e7; }
  .transactions-summary-icon.is-amber { color: #a56800; background: #fff3d8; }
  .transactions-summary-icon.is-purple { color: #7651b8; background: #f0e9ff; }
  .transactions-summary-icon.is-blue { color: #1769c2; background: #e4efff; }
  .transactions-summary-icon.is-cyan { color: #087f91; background: #e1f7fa; }

  .summary-grid .stat-card .label {
    font-size: 11px;
  }

  .summary-grid .stat-card .value {
    font-size: var(--financial-value-normal-size);
  }

  .summary-grid .stat-card .hint {
    font-size: 10px;
    margin-top: auto;
  }

  .summary-accordion {
    border: none;
    padding: 0;
    box-shadow: none;
    background: transparent;
    margin: 0;
  }

  .summary-accordion summary {
    padding: 6px 0;
  }

  .summary-accordion .summary-content {
    margin-top: 6px;
  }

  .summary-accordion .card {
    box-shadow: none;
  }

  .summary-accordion .card-grid {
    margin-top: 6px;
  }

  .mobile-competence {
    display: flex;
    justify-content: center;
    margin: 0 0 4px;
  }

  .table-mobile-row {
    padding: 8px 4px 8px;
  }

  .table-mobile-row.compact {
    padding: 6px 4px 8px;
    gap: 10px;
  }

  .table-mobile-row.compact .icon-pill {
    flex-basis: 36px;
    width: 36px;
    min-width: 36px;
    height: 36px;
  }

  .table-mobile-row.compact .icon-pill svg {
    width: 20px;
    height: 20px;
  }

  .table-mobile-status {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .transactions-page .card-header .transactions-list-actions {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .transactions-page .table-mobile-side {
    min-width: 0;
    max-width: 116px;
  }

  .transactions-page .table-mobile-row.compact {
    grid-template-columns: 36px minmax(0, 1fr) minmax(0, 116px);
    min-width: 0;
  }

  .transactions-page .table-mobile-main,
  .transactions-page .table-mobile-status {
    min-width: 0;
  }

  .transactions-page .table-mobile-main {
    overflow: hidden;
  }

  .transactions-page .table-mobile-meta > span {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .transactions-page .table-mobile-status-label {
    color: var(--muted);
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
  }

  .transactions-page .table-mobile-status-label.is-confirmed {
    color: var(--success);
  }

  .transactions-page .table-mobile-status-label.is-provisional {
    color: var(--warning);
  }

  .transactions-page .day-summary-row {
    top: 56px;
  }

  .transactions-page .table-wrap {
    padding-bottom: 16px;
  }

.status-dot,
.type-dot {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
  }

  .status-dot svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
  }

  .status-dot.is-confirmed {
    background: #5fb36d;
  }

  .status-dot.is-provisional {
    background: #c9b27a;
  }

.summary-accordion {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-accordion summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-accordion summary::-webkit-details-marker {
  display: none;
}

.summary-accordion summary::after {
  content: '+';
  font-size: 18px;
  color: var(--primary);
}

.summary-accordion[open] summary::after {
  content: '–';
}

.summary-accordion .summary-content {
  margin-top: 12px;
}

.mobile-competence {
  margin: 8px 0 12px;
}

  .topbar {
    align-items: center;
    flex-wrap: nowrap;
  }

  .topbar-title .eyebrow,
  .topbar-heading {
    display: none;
  }

  .topbar-heading-mobile {
    display: block;
  }

  .topbar-user {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .sheet-panel {
    padding: 20px 16px 110px;
  }

  .form-header {
    top: -20px;
    margin: -20px -16px 0;
    padding-inline: 8px;
  }

  .sheet-panel .form-grid,
  .sheet-panel .form-row {
    grid-template-columns: 1fr;
  }

  .sheet-panel .form-grid .field {
    width: 100%;
  }

  .sheet-panel .form {
    margin-top: 8px;
    gap: 16px;
  }

  .sheet-panel .field {
    gap: 8px;
  }

  .sheet-panel .input {
    padding: 10px 12px;
    font-size: 14px;
  }

  .budget-overview {
    grid-template-columns: 1fr;
  }

  .budget-alert-trend {
    max-width: 100%;
  }

  .sheet-panel .input-textarea {
    min-height: 70px;
  }

  .statement-row,
  .future-row {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .statement-row-values {
    text-align: left;
  }

  .future-sparkline,
  .future-actions,
  .statement-actions {
    justify-content: flex-start;
  }

  .sparkline-wrap {
    justify-items: center;
    min-width: 0;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .sparkline-wrap.is-compact {
    max-width: none;
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    align-items: center;
    justify-items: center;
    bottom: calc(14px + env(safe-area-inset-bottom));
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  body.app[data-page="accounts"] .bottom-nav,
  body.app[data-page="categories"] .bottom-nav {
    position: fixed !important;
    left: 14px !important;
    right: auto !important;
    top: auto !important;
    bottom: calc(14px + env(safe-area-inset-bottom)) !important;
    width: calc(100dvw - 28px) !important;
    max-width: calc(100dvw - 28px) !important;
    z-index: 10 !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 64px minmax(0, 1fr) minmax(0, 1fr);
  }

  body.app[data-page="accounts"] .bottom-nav {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  body.app[data-page="accounts"] .bottom-nav.is-nav-hidden {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  body.app[data-page="categories"] .bottom-nav.is-nav-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(calc(100% + 24px)) !important;
  }

  body.app[data-page="accounts"] .bottom-nav.is-fab-hidden .bottom-item.is-fab {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  body.app[data-page="accounts"] .bottom-nav .bottom-item,
  body.app[data-page="categories"] .bottom-nav .bottom-item {
    min-width: 0;
    width: 100%;
  }

  body.app[data-page="accounts"] .account-list-header-tools,
  body.app[data-page="categories"] .account-list-header-tools {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    justify-content: flex-end;
  }

  body.app .desktop-filter-tabs {
    display: none !important;
  }

  body.app .mobile-filter-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    max-width: 100%;
    padding: 8px 12px;
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
    color: var(--primary-dark, var(--text));
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
  }

  body.app .mobile-filter-icon {
    font-size: 17px;
    line-height: 1;
  }

  body.app .recurring-mobile-filter-trigger {
    margin-bottom: 14px;
  }

  body.app .mobile-filter-sheet {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
  }

  body.app .mobile-filter-sheet.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.app .mobile-filter-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 24, 30, .45);
  }

  body.app .mobile-filter-panel {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: 70vh;
    overflow-y: auto;
    padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    background: var(--surface);
    box-shadow: 0 -16px 32px rgba(15, 24, 30, .18);
    transform: translateY(24px);
    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
  }

  body.app .mobile-filter-sheet.is-open .mobile-filter-panel {
    transform: translateY(0);
    opacity: 1;
  }

  body.app .mobile-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }

  body.app .mobile-filter-options {
    display: grid;
    gap: 8px;
  }

  body.app .mobile-filter-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
  }

  body.app .mobile-filter-option.is-active {
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    color: var(--primary-dark, var(--text));
  }

  body.has-mobile-filter-sheet {
    overflow: hidden;
  }

  body.app[data-page="accounts"] .account-list-header-tools .sub-tabs,
  body.app[data-page="categories"] .account-list-header-tools .sub-tabs {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  body.app[data-page="accounts"] .account-list-header-tools .module-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
  }

  body.app[data-page="categories"] .account-list-header-tools .sub-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  body.app[data-page="accounts"] .account-list-header-tools .module-tab,
  body.app[data-page="categories"] .account-list-header-tools .sub-tab,
  body.app .recurring-rules-page .recurring-status-tab {
    min-width: 0;
    justify-content: center;
    gap: 4px;
    padding-inline: 4px;
    font-size: 12px;
  }

  body.app[data-page="recurring-rules"] .recurring-status-tabs,
  body.app .recurring-rules-page .recurring-status-tabs {
    display: flex;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex-wrap: wrap;
    overflow: visible;
  }

  body.app .recurring-rules-page .recurring-status-tab {
    flex: 1 1 calc(50% - 8px);
  }

  .notify-card {
    width: calc(100% - 24px);
    margin: 70px 12px 12px;
  }

  .fab-actions {
    bottom: calc(120px + env(safe-area-inset-bottom));
  }

  .sheet {
    justify-content: center;
    align-items: flex-end;
  }

  .sheet-panel {
    width: 100%;
    height: min(92dvh, 820px);
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    border-left: none;
    padding-bottom: calc(110px + env(safe-area-inset-bottom));
    transform: translateY(20px);
  }

  .balance-adjustment-panel {
    padding: 26px 26px calc(110px + env(safe-area-inset-bottom));
  }

  .sheet.is-open .sheet-panel {
    transform: translateY(0);
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-side {
    display: none;
  }

  .auth-panel {
    padding: 32px 24px;
  }

  .report-trend-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .report-trend-values {
    justify-items: start;
  }
}

@media (max-width: 720px) {
  .dashboard-summary-section .card-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-summary-section .stat-card,
  .dashboard-summary-section .stat-card:nth-child(1),
  .dashboard-summary-section .stat-card:nth-child(2),
  .dashboard-summary-section .stat-card:nth-child(3),
  .dashboard-summary-section .stat-card:nth-child(4),
  .dashboard-summary-section .stat-card:nth-child(5),
  .dashboard-summary-section .stat-card:nth-child(6),
  .dashboard-summary-section .stat-card:nth-child(7) {
    grid-column: auto;
  }

  .dashboard-section > .grid-two {
    grid-template-columns: 1fr;
  }

  .dashboard-stack > .dashboard-section:not(.is-wide) > .card,
  .dashboard-stack > .dashboard-section:not(.is-wide) > .card-link {
    height: auto;
  }

  .dashboard-billing-grid {
    grid-auto-rows: auto;
  }

  .dashboard-billing-grid > .card {
    height: auto;
  }

  .dashboard-billing-grid > .card > .card-header {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .dashboard-billing-grid > .card > .card-header .action-group {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .dashboard-summary-section .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-summary-section .stat-card {
    min-height: 104px;
    padding: 12px;
  }

  .dashboard-summary-section .stat-card.is-featured {
    grid-column: 1 / -1;
    min-height: 116px;
  }

  .dashboard-summary-section .stat-card .value {
    font-size: var(--financial-value-normal-size);
  }

  .dashboard-summary-section .stat-card .hint {
    font-size: 10px;
  }
}

.type-dot.type-cartao {
  color: #00153f;
}

.type-dot.type-receita,
.type-dot.type-despesa,
.type-dot.type-transferencia {
  color: #fff;
}

.type-dot.type-neutral {
  color: var(--text);
}

/* Dashboard composition: fixed rows with predictable 12-column reflow. */
.dashboard-widget-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
  border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--warning) 8%, var(--surface-raised));
  color: var(--text);
  font-size: 13px;
}

.dashboard-widget-error .btn {
  flex: 0 0 auto;
}

.dashboard-stack > .dashboard-section-overview { order: 1 !important; }
.dashboard-stack > .dashboard-section-attention { order: 2 !important; }
.dashboard-stack > .dashboard-architecture-flow { order: 3 !important; }
.dashboard-stack > .dashboard-architecture-recent,
.dashboard-stack > .dashboard-architecture-category { order: 4 !important; }
.dashboard-stack > .dashboard-architecture-flow {
  grid-column: 1 / -1 !important;
  order: 3 !important;
}
.dashboard-stack > .dashboard-architecture-recent {
  grid-column: 1 / span 8 !important;
  order: 4 !important;
}
.dashboard-stack > .dashboard-architecture-category {
  grid-column: 9 / span 4 !important;
  order: 4 !important;
}
.dashboard-stack > .dashboard-architecture-cards { order: 5 !important; }
.dashboard-stack > .dashboard-section-investments { order: 6 !important; }
.dashboard-stack > .dashboard-architecture-planning,
.dashboard-stack > .dashboard-architecture-planning-budget { order: 7 !important; }
.dashboard-stack > .dashboard-visualization-layout {
  grid-column: 1 / -1 !important;
  order: 8 !important;
}

@container (max-width: 420px) {
  .dashboard-architecture-category .donut-layout {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .dashboard-architecture-category .donut-legend {
    width: 100%;
  }
}

/* Desktop composition: keep related dashboard widgets on the same 12-column row. */
@media (min-width: 1101px) {
  .dashboard-stack {
    align-items: stretch;
  }

  .dashboard-stack > .dashboard-architecture-flow,
  .dashboard-stack > .dashboard-architecture-recent,
  .dashboard-stack > .dashboard-architecture-category {
    align-self: stretch;
  }

  .dashboard-stack > .dashboard-architecture-flow > .card,
  .dashboard-stack > .dashboard-architecture-recent > .card,
  .dashboard-stack > .dashboard-architecture-category > .card-link {
    height: 100%;
  }

  .dashboard-stack > .dashboard-architecture-flow {
    grid-row: 3 !important;
  }

  .dashboard-stack > .dashboard-architecture-recent,
  .dashboard-stack > .dashboard-architecture-category {
    grid-row: 4 !important;
  }

  .dashboard-stack > .dashboard-architecture-planning,
  .dashboard-stack > .dashboard-architecture-planning-budget {
    grid-column: span 6 !important;
  }

  .dashboard-attention-grid > .attention-card {
    grid-column: 1 / -1 !important;
  }

  .dashboard-attention-grid:has(> .attention-card:nth-child(2)):not(:has(> .attention-card:nth-child(3))) > .attention-card {
    grid-column: span 6 !important;
  }

  .dashboard-attention-grid:has(> .attention-card:nth-child(3)):not(:has(> .attention-card:nth-child(4))) > .attention-card {
    grid-column: span 4 !important;
  }

  .dashboard-attention-grid:has(> .attention-card:nth-child(4)) > .attention-card {
    grid-column: span 3 !important;
  }

  .dashboard-stack:has(> .dashboard-architecture-planning:not(.is-hidden)):not(:has(> .dashboard-architecture-planning-budget:not(.is-hidden))) > .dashboard-architecture-planning,
  .dashboard-stack:has(> .dashboard-architecture-planning-budget:not(.is-hidden)):not(:has(> .dashboard-architecture-planning:not(.is-hidden))) > .dashboard-architecture-planning-budget {
    grid-column: 1 / -1 !important;
  }

  .dashboard-stack > .dashboard-visualization-layout {
    grid-column: 1 / -1 !important;
  }
}

.dashboard-summary-section .card-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-summary-section .stat-card,
.dashboard-attention-grid .attention-card {
  grid-column: auto;
  min-height: 132px;
}

.dashboard-summary-section .stat-card:nth-child(1),
.dashboard-summary-section .stat-card:nth-child(2),
.dashboard-summary-section .stat-card:nth-child(3),
.dashboard-summary-section .stat-card:nth-child(4),
.dashboard-summary-section .stat-card:nth-child(5),
.dashboard-summary-section .stat-card:nth-child(6),
.dashboard-summary-section .stat-card:nth-child(7) {
  grid-column: auto;
  order: initial;
}

@media (max-width: 1100px) {
  .dashboard-summary-section .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-architecture-flow,
  .dashboard-architecture-category,
  .dashboard-architecture-planning,
  .dashboard-architecture-planning-budget {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 720px) {
  .dashboard-stack {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .dashboard-layout-grid,
  .dashboard-card-panes {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .dashboard-size-full,
  .dashboard-size-large,
  .dashboard-size-half,
  .dashboard-size-medium,
  .dashboard-size-small,
  .dashboard-attention-grid > .attention-card,
  .dashboard-card-pane,
  .dashboard-architecture-flow,
  .dashboard-architecture-category,
  .dashboard-architecture-planning,
  .dashboard-architecture-planning-budget {
    grid-column: 1 / -1 !important;
  }

  .dashboard-stack > .dashboard-architecture-flow {
    grid-column: 1 / -1 !important;
    order: 3 !important;
  }

  .dashboard-stack > .dashboard-architecture-recent {
    grid-column: 1 / -1 !important;
    order: 4 !important;
  }

  .dashboard-stack > .dashboard-architecture-category {
    grid-column: 1 / -1 !important;
    order: 4 !important;
  }

  .dashboard-summary-section .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-summary-section .stat-card.is-featured,
  .dashboard-summary-section .stat-card-total-wealth {
    grid-column: 1 / -1;
  }

  /* Keep dashboard cards readable on narrow screens without letting long
     currency values widen the page or collide with neighboring content. */
  .dashboard-summary-section .stat-card,
  .dashboard-attention-grid .attention-card {
    padding: 14px;
    min-height: 116px;
  }

  .dashboard-summary-section .stat-card .label,
  .dashboard-attention-grid .attention-card .label {
    font-size: 12px;
    line-height: 1.25;
  }

  .dashboard-summary-section .stat-card .value,
  .dashboard-attention-grid .attention-card .value {
    font-size: var(--financial-value-normal-size);
    line-height: var(--financial-value-line-height);
    margin-top: 9px;
    overflow-wrap: anywhere;
  }

  .dashboard-summary-section .stat-card .hint,
  .dashboard-attention-grid .attention-card .hint {
    font-size: 11px;
    line-height: 1.3;
  }

  .dashboard-summary-section .stat-card-icon,
  .dashboard-attention-grid .attention-card .stat-card-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .dashboard-summary-section .stat-card-icon svg,
  .dashboard-attention-grid .attention-card .stat-card-icon svg {
    width: 16px;
    height: 16px;
  }

  .dashboard-stack > .dashboard-architecture-flow,
  .dashboard-stack > .dashboard-architecture-category,
  .dashboard-stack > .dashboard-architecture-planning,
  .dashboard-stack > .dashboard-architecture-planning-budget {
    grid-column: 1 / -1 !important;
  }

  .dashboard-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .dashboard-module-header {
    flex-direction: column;
  }

  .investment-summary-card {
    flex-direction: column;
  }

  .investment-summary-details {
    width: 100%;
    text-align: left;
  }

  .dashboard-preset-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-preset-actions {
    justify-content: flex-start;
  }

  .dashboard-settings-preview-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-settings-preview-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-order-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }

  .settings-order-row .settings-toggle {
    grid-column: 2;
  }

  .settings-order-row .settings-order-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 720px) {
  .cards-page .table-mobile-row {
    gap: 4px;
    padding-block: 8px;
  }

  .cards-page .table-mobile-actions.card-actions {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    transform: translateY(-2px);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .cards-page .table-mobile-actions.card-actions::-webkit-scrollbar {
    display: none;
  }

  .cards-page .cards-overview {
    padding: 8px;
  }

  .cards-page .cards-overview .card-header {
    margin-bottom: 8px;
  }

  .cards-page .cards-overview-grid {
    gap: 4px 8px;
  }

  .cards-page .cards-overview-alert,
  .cards-page .cards-overview-note {
    margin-top: 8px;
    padding-top: 8px;
  }

  .reports-page .reports-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .reports-page .reports-summary-grid .stat-card {
    min-height: 100px;
    padding: 10px;
  }

  .reports-page .reports-summary-grid .stat-card .value {
    font-size: 16px;
    white-space: nowrap;
  }

  .reports-page .reports-summary-grid .stat-card .hint,
  .reports-page .reports-summary-grid .stat-card .delta {
    font-size: 10px;
    line-height: 1.2;
  }

  .budgets-page .budget-summary-grid {
    gap: 8px;
  }

  .budgets-page .budget-summary-grid .stat-card {
    min-height: 92px;
    padding: 10px;
  }

  .budgets-page .budget-summary-grid .stat-card .value {
    font-size: var(--financial-value-normal-size);
  }

  .budgets-page .budget-list-card .table-mobile-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'main side' 'main actions';
    align-items: start;
  }

  .budgets-page .budget-list-card .table-mobile-main {
    grid-area: main;
    min-width: 0;
  }

  .budgets-page .budget-list-card .table-mobile-side {
    grid-area: side;
    justify-content: flex-end;
    min-width: 0;
  }

  .budgets-page .budget-list-card .table-mobile-actions {
    grid-area: actions;
    justify-content: flex-end;
    align-self: start;
    min-width: 0;
  }

  .budgets-page .budget-list-card .table-mobile-row .sparkline-wrap {
    max-height: 28px;
  }

  .budgets-page .budget-list-card .table-mobile-row .sparkline {
    height: 24px;
  }
}

@media (max-width: 420px) {
  .budgets-page .budget-summary-grid .stat-card {
    min-height: 88px;
  }
}

@supports (container-type: inline-size) {
  .kpi-value {
    font-size: clamp(
      var(--financial-value-min-size),
      13cqi,
      var(--financial-value-max-size)
    );
  }

  .dashboard-summary-section .stat-card .value {
    font-size: clamp(
      var(--financial-value-min-size),
      13cqi,
      var(--financial-value-max-size)
    );
  }

  .dashboard-attention-grid .attention-card .value {
    font-size: clamp(
      var(--financial-value-min-size),
      13cqi,
      var(--financial-value-max-size)
    );
  }
}

@media (max-width: 720px) {
  .budgets-page .table-mobile-row {
    gap: 6px;
    padding: 9px 4px 10px;
  }

  .budgets-page .table-mobile-meta {
    gap: 4px 8px;
    font-size: 10px;
  }

  .budgets-page .budget-progress {
    margin-top: 4px;
  }

  .budgets-page .budget-progress .progress {
    height: 6px;
  }

  .budgets-page .table-mobile-row .sparkline-wrap {
    max-height: 42px;
    overflow: hidden;
  }

  .budgets-page .table-mobile-row .sparkline {
    height: 34px;
  }

  .budgets-page .table-mobile-row .sparkline-labels {
    display: none;
  }

  .budgets-page .table-mobile-actions .action-group {
    gap: 4px;
  }

  .budgets-page .table-mobile-actions .btn.icon {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 720px) {
  /* Acoes secundarias continuam tocaveis, mas precisam ser descobriveis sem hover. */
  .budgets-page .table-mobile-actions .action-group,
  .accounts-page .table-mobile-actions.account-actions {
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
  }

  .budgets-page .table-mobile-actions .action-group .btn.icon,
  .budgets-page .table-mobile-actions .action-group form .btn.icon,
  .accounts-page .table-mobile-actions.account-actions .btn.icon {
    width: auto;
    min-width: 0;
    height: 42px;
    flex: 0 0 auto;
    gap: 6px;
    padding: 8px 10px;
  }

  .budgets-page .table-mobile-actions .action-group .btn.icon::after,
  .budgets-page .table-mobile-actions .action-group form .btn.icon::after,
  .accounts-page .table-mobile-actions.account-actions .btn.icon::after {
    content: attr(aria-label);
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
  }

  .sparkline-wrap {
    overflow-x: auto;
    padding: 0 6px 6px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .sparkline {
    height: auto;
    min-width: calc(var(--spark-count, 1) * 72px);
    padding: 6px 0;
  }

  .sparkline-labels,
  .sparkline-values {
    gap: 4px;
    font-size: 9px;
    min-width: calc(var(--spark-count, 1) * 72px);
    grid-template-columns: repeat(var(--spark-count, 1), minmax(72px, 1fr));
  }

  .sparkline-values {
    font-size: 8px;
  }

  .sparkline-values span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 360px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* Azul is the shared visual language between the web and the mobile app. */
body.app .topbar-user,
body.app .topbar-avatar {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
}

body.app .topbar-avatar {
  color: var(--primary);
}

body.app .card-visual {
  background: linear-gradient(135deg, #0b2a66, #0f5fea);
}

body.app .card-thumb {
  background: linear-gradient(135deg, rgba(15, 95, 234, 0.88), rgba(247, 183, 51, 0.65));
}

body.app .sparkline {
  stroke: var(--primary);
}

body.app .sparkline circle {
  fill: var(--primary);
}

body.app .status-pill,
body.app .progress.light,
body.app .report-tab.is-active,
body.app .btn.secondary {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}

body.app .status-pill.is-paid,
body.app .value.positive,
body.app .hint.delta.positive,
body.app .list-value.positive,
body.app .flow-value.positive {
  color: var(--success);
}

body.app .progress span,
body.app .goal-progress span {
  background: linear-gradient(90deg, var(--primary), var(--cyan));
}

body.app .report-tab:hover,
body.app .report-tab.is-active {
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  color: var(--text);
}

body.app .input:focus {
  outline-color: color-mix(in srgb, var(--primary) 20%, transparent);
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
}

body.app .btn.primary {
  box-shadow: 0 14px 24px color-mix(in srgb, var(--primary) 24%, transparent);
}

.transactions-summary-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.transactions-summary-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.transactions-summary-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.transactions-summary-icon.is-green { color: #087f5b; background: #e2f5eb; }
.transactions-summary-icon.is-red { color: #c94b43; background: #fde9e7; }
.transactions-summary-icon.is-amber { color: #a56800; background: #fff3d8; }
.transactions-summary-icon.is-purple { color: #7651b8; background: #f0e9ff; }
.transactions-summary-icon.is-blue { color: #1769c2; background: #e4efff; }
.transactions-summary-icon.is-cyan { color: #087f91; background: #e1f7fa; }

.transactions-page .summary-grid .stat-card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
}

.transactions-page .summary-grid .stat-card .value {
  margin-top: 12px;
}

.transactions-page .summary-grid .stat-card .hint {
  margin-top: auto;
  line-height: 1.3;
}

body.app .summary-grid .stat-card.is-featured {
  min-height: 142px;
}

.cards-overview {
  background: linear-gradient(135deg, #0b2a66 0%, #0e3e86 64%, #0f5fea 150%);
  border-color: rgba(72, 220, 236, 0.24);
  color: #f6f8fb;
}

.cards-overview .card-header {
  margin-bottom: 18px;
}

.cards-overview .eyebrow,
.cards-overview .label,
.cards-overview .cards-overview-note {
  color: rgba(246, 248, 251, 0.72);
}

.cards-overview h3 {
  margin-top: 4px;
}

.cards-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.cards-overview-grid > div {
  display: grid;
  gap: 6px;
}

.cards-overview-grid strong {
  font-size: 21px;
}

.cards-overview .positive {
  color: #63e6a6;
}

.cards-overview .negative {
  color: #ff8f8f;
}

.cards-overview .warning-value {
  color: #ffd36a;
}

.cards-overview-alert,
.cards-overview-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
}

.cards-overview-alert {
  color: #ffb0b0;
}

body.app[data-theme="light"] .cards-overview {
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  color: var(--text);
}

body.app[data-theme="light"] .cards-overview .eyebrow,
body.app[data-theme="light"] .cards-overview .label,
body.app[data-theme="light"] .cards-overview .cards-overview-note {
  color: var(--muted);
}

body.app[data-theme="light"] .cards-overview .warning-value {
  color: var(--warning);
}

body.app[data-theme="light"] .cards-overview-alert {
  color: var(--danger);
}

body.app[data-theme="light"] .cards-overview-alert,
body.app[data-theme="light"] .cards-overview-note {
  border-top-color: var(--border);
}

@media (prefers-color-scheme: light) {
  body.app[data-theme="auto"] .cards-overview {
    background: color-mix(in srgb, var(--primary) 7%, var(--surface));
    border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
    color: var(--text);
  }

  body.app[data-theme="auto"] .cards-overview .eyebrow,
  body.app[data-theme="auto"] .cards-overview .label,
  body.app[data-theme="auto"] .cards-overview .cards-overview-note {
    color: var(--muted);
  }

  body.app[data-theme="auto"] .cards-overview .warning-value {
    color: var(--warning);
  }

  body.app[data-theme="auto"] .cards-overview-alert {
    color: var(--danger);
  }

  body.app[data-theme="auto"] .cards-overview-alert,
  body.app[data-theme="auto"] .cards-overview-note {
    border-top-color: var(--border);
  }
}

body.app .day-summary-row {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
}

body.app .day-summary-title {
  color: var(--primary);
}

body.app .day-summary-item.positive strong {
  color: var(--success);
}

body.app .day-summary-item.negative strong {
  color: var(--danger);
}

body.app .chart-placeholder {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 9%, var(--surface)), color-mix(in srgb, var(--accent) 10%, var(--surface)));
}

body.app .budget-alert-item {
  background: color-mix(in srgb, var(--surface) 94%, var(--primary));
  border-color: color-mix(in srgb, var(--primary) 18%, var(--border));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--primary) 10%, transparent);
}

body.app .budget-alert-item .icon-pill {
  flex: 0 0 auto;
}

body.app .budget-alert-trend .sparkline {
  stroke: var(--primary);
}

body.app .budget-alert-trend .sparkline circle {
  fill: var(--primary);
}

body.app .category-bar,
body.app .report-trend-bar {
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
}

body.app .category-bar span,
body.app .goal-progress span {
  background: linear-gradient(90deg, var(--primary), var(--cyan));
}

body.app .goal-tabs,
body.app .goal-tab span,
body.app .tag {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

body.app .chip {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  color: #ffe09a;
}

body.app[data-theme="light"] .chip {
  color: #805600;
  border-color: color-mix(in srgb, #c78300 38%, transparent);
  background: color-mix(in srgb, #f0b429 18%, var(--surface));
}

body.app .goal-ring {
  background: conic-gradient(var(--primary) var(--goal-progress), var(--donut-empty) 0);
}

body.app .toggle-track {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
}

body.app .settings-toggle input:checked + .toggle-track {
  background: var(--primary);
}

body.app .table-mobile-row.compact:focus-visible {
  outline-color: color-mix(in srgb, var(--primary) 35%, transparent);
}

body.app .bottom-item.is-active {
  background: color-mix(in srgb, var(--primary) 11%, transparent);
}

body.app .bottom-item.is-fab,
body.app .calc-key-primary {
  box-shadow: 0 16px 24px color-mix(in srgb, var(--primary) 32%, transparent);
}

body.app .category-option:hover {
  border-color: color-mix(in srgb, var(--primary) 38%, transparent);
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

body.app .category-option.is-selected {
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
}

body.app .icon-option {
  background: color-mix(in srgb, var(--surface) 92%, var(--primary));
  border-color: var(--border);
}

body.app .icon-option:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  box-shadow: 0 10px 18px color-mix(in srgb, var(--primary) 14%, transparent);
}

body.auth .auth-logo {
  width: min(320px, 100%);
  height: auto;
  max-height: 74px;
  object-fit: contain;
  object-position: left center;
}

/* Keep the classic focused login layout while applying the new brand. */
body.auth {
  background: radial-gradient(circle at 50% -12%, rgba(51, 214, 246, 0.18), transparent 34%),
    linear-gradient(145deg, #f8fbff 0%, #eef4fb 58%, #e4edf8 100%);
}

body.auth .auth-shell {
  display: block;
  width: 100vw;
  max-width: 100vw;
  min-height: 100vh;
  margin: 0 auto;
}

body.auth .auth-panel {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-width: 0;
  padding: clamp(36px, 8vh, 88px) clamp(24px, 7vw, 64px);
  justify-content: center;
  gap: 28px;
}

body.auth .auth-brand {
  justify-content: center;
  padding-bottom: 8px;
}

body.auth .auth-logo {
  object-position: center;
}

body.auth .auth-header,
body.auth .auth-panel > .form,
body.auth .auth-panel > .alert {
  width: min(430px, calc(100vw - 48px));
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

body.auth .auth-header h1 {
  color: var(--primary-dark);
  letter-spacing: -0.035em;
}

body.auth .auth-header p {
  color: #50627b;
}

body.auth .auth-panel > .form {
  gap: 18px;
}

body.auth .checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

body.auth .checkbox-field input {
  flex: 0 0 auto;
  margin-top: 3px;
}

body.auth .checkbox-field span {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.auth .input {
  background: rgba(255, 255, 255, 0.88);
  border-color: #c9d7e9;
  box-shadow: 0 8px 22px rgba(11, 42, 102, 0.05);
}

body.auth .btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 14px 24px rgba(0, 119, 255, 0.22);
}

body.auth .auth-side {
  display: none;
}

@media (prefers-color-scheme: dark) {
  body.auth {
    color: #f6f8fb;
    background: radial-gradient(circle at 50% -12%, rgba(0, 198, 255, 0.16), transparent 34%),
      linear-gradient(145deg, var(--joozo-navy-800, #0a2150) 0%, var(--primary-dark) 100%);
  }

  body.auth .auth-header h1 {
    color: #ffffff;
  }

  body.auth .auth-header p {
    color: #c8d5ea;
  }

  body.auth .input {
    color: #f6f8fb;
    background: rgba(4, 14, 38, 0.72);
    border-color: #6d7e9d;
  }

  body.auth .input::placeholder {
    color: #aab8d0;
  }

  body.auth .field span,
  body.auth .form-footer {
    color: #d3ddf0;
  }
}

@media (max-width: 720px) {
  .cards-page .table-mobile-actions.card-actions {
    min-width: 0;
    justify-content: flex-start;
    gap: 6px;
  }

  .cards-page .table-mobile-actions.card-actions .btn.icon {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    gap: 6px;
    padding: 8px 10px;
  }

  .cards-page .table-mobile-actions.card-actions .btn.icon::after {
    content: attr(aria-label);
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
  }

  .cards-page .table-mobile-actions.card-actions .btn.icon svg {
    flex-basis: 14px;
    width: 14px;
    height: 14px;
  }

  .investments-page .investment-table.is-mobile-card thead {
    display: table-header-group;
  }

  .investments-page .investment-table.is-mobile-card tbody tr:not(.table-row-mobile) {
    display: table-row;
  }

  .investments-page .investment-table {
    min-width: 680px;
  }

  .investments-page .investment-positions-table {
    min-width: 960px;
  }

  .investments-page .investment-movements-table {
    min-width: 920px;
  }

  .investments-page .investment-accounts-table {
    min-width: 640px;
  }

  .reconciliation-table.is-mobile-card thead {
    display: table-header-group;
  }

  .reconciliation-table.is-mobile-card tbody tr:not(.table-row-mobile) {
    display: table-row;
  }

  .reconciliation-table {
    min-width: 720px;
  }

  .cards-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
  }

  .cards-overview-grid strong {
    font-size: 17px;
  }
}
body.is-investment-navigating::before {
  content: '';
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary, #1769e8);
  transform-origin: left center;
  animation: investment-navigation-progress 1.2s ease-in-out infinite;
}

.investment-asset-editor {
  min-width: 88px;
}

.investment-asset-editor summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
}

.investment-asset-editor summary::-webkit-details-marker {
  display: none;
}

.investment-asset-editor[open] summary {
  margin-bottom: 10px;
}

.investment-asset-editor .form-grid {
  min-width: min(620px, 82vw);
  margin-bottom: 8px;
}

.investment-asset-create {
  margin-bottom: 14px;
}

.investment-history-note {
  margin: 8px 0 0;
}

.investment-status-field {
  min-width: 240px;
  border: 0;
  padding: 0;
  margin: 0;
}

.investment-status-field legend {
  display: block;
  font-size: .78rem;
  color: var(--muted, #68747a);
  margin-bottom: 6px;
}

.investment-segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border, #d8e0e5);
  border-radius: 10px;
  background: var(--surface-soft, #f4f7f9);
}

.investment-segmented-option {
  cursor: pointer;
  margin: 0;
  color: var(--muted, #68747a);
  font-size: .78rem;
  font-weight: 600;
}

.investment-segmented-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.investment-segmented-option span {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  white-space: nowrap;
}

.investment-segmented-option:hover span,
.investment-segmented-option:focus-within span,
.investment-segmented-option.is-selected span {
  color: var(--primary, #1769e8);
  background: var(--surface, #fff);
  box-shadow: 0 1px 3px rgba(16, 38, 61, .12);
}

@media (max-width: 720px) {
  .wealth-journey-next {
    align-items: stretch;
    flex-direction: column;
  }

  .wealth-journey-next .btn {
    width: 100%;
  }

  .wealth-journey-goal {
    align-items: stretch;
    flex-direction: column;
  }

  .wealth-journey-goal-target {
    text-align: left;
  }

  .investment-status-field {
    min-width: 0;
  }

  .investment-segmented {
    display: flex;
    width: 100%;
  }

  .investment-segmented-option {
    flex: 1 1 0;
    text-align: center;
  }
}

@keyframes investment-navigation-progress {
  0% { transform: scaleX(0.08); opacity: 0.55; }
  50% { transform: scaleX(0.65); opacity: 1; }
  100% { transform: scaleX(0.96); opacity: 0.65; }
}

/* Contas fixas: cards responsivos e ações compactas no padrão dos demais módulos. */
.recurring-rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.recurring-status-tabs {
  display: inline-flex;
  max-width: 100%;
  gap: 8px;
  padding: 6px;
  overflow-x: auto;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-2));
}

.recurring-status-tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.recurring-status-tab span {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--text);
  font-size: 11px;
  text-align: center;
}

.recurring-status-tab:hover,
.recurring-status-tab:focus-visible,
.recurring-status-tab.is-active {
  background: var(--surface);
  color: var(--primary-dark, var(--text));
  box-shadow: var(--shadow);
}

.recurring-status-tab.is-active span {
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
}

.recurring-rule-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.recurring-rule-card > div:first-child {
  min-width: 0;
}

.recurring-rule-card > div:first-child > strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-rule-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.recurring-rule-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-category-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.recurring-rule-details {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.recurring-rule-details > summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.recurring-rule-details[open] > summary {
  margin-bottom: 12px;
}

.recurring-rule-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
}

.recurring-rule-actions form {
  margin: 0;
}

.recurring-rule-actions .btn.icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.recurring-rule-actions .btn.icon svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 1180px) {
  .recurring-rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .recurring-rule-grid {
    grid-template-columns: 1fr;
  }
}
.budget-summary-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.budget-summary-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.budget-summary-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.budget-summary-icon.is-blue { color: #1769c2; background: #e4efff; }
.budget-summary-icon.is-red { color: #c94b43; background: #fde9e7; }
.budget-summary-icon.is-green { color: #087f5b; background: #e2f5eb; }
.budget-summary-icon.is-amber { color: #a56800; background: #fff3d8; }

.budgets-page .budget-summary-grid .stat-card {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
}

.budget-overview-main {
  container-type: inline-size;
}

.kpi-value {
  display: block;
  width: min(100%, var(--financial-value-area-max-width));
  max-width: 100%;
  font-size: var(--financial-value-normal-size);
  font-weight: 800;
  line-height: var(--financial-value-line-height);
  letter-spacing: normal;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow-wrap: normal;
  text-overflow: clip;
}

.budgets-page .budget-summary-grid .value {
  margin-top: 12px;
}

/* Final KPI token override: container sizing is shared by every KPI value. */
@supports (container-type: inline-size) {
  .kpi-value {
    font-size: clamp(
      var(--financial-value-min-size),
      13cqi,
      var(--financial-value-max-size)
    );
  }
}

.budgets-page .budget-summary-grid .hint {
  margin-top: auto;
  line-height: 1.3;
}

.budgets-page .budget-trend-chart {
  width: 154px;
  min-width: 154px;
  padding: 4px 0 0;
}

.budgets-page .budget-trend-chart .sparkline-canvas {
  display: block;
  width: 154px;
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(35, 126, 241, 0.06), rgba(35, 126, 241, 0.16));
}

.budgets-page .budget-trend-chart .sparkline {
  width: 154px;
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(35, 126, 241, 0.06), rgba(35, 126, 241, 0.16));
}

.budgets-page .budget-trend-chart .sparkline-area {
  fill: rgba(35, 126, 241, 0.14);
  stroke: none;
}

.budgets-page .budget-trend-chart .sparkline polyline {
  stroke: #0f6fea;
  stroke-width: 2.2;
}

.budgets-page .budget-trend-chart .sparkline circle {
  fill: #0f6fea;
  stroke: #0f6fea;
}
/* Financial visualization surfaces */
.visualization-card{overflow:hidden}.heatmap-calendar{display:grid;grid-template-columns:repeat(7,minmax(12px,1fr));gap:5px}.heatmap-calendar.compact{grid-template-columns:repeat(14,minmax(10px,1fr));margin-top:12px}.heatmap-calendar.full{grid-template-columns:repeat(7,minmax(26px,1fr));gap:7px;padding:8px 0}.heatmap-cell{display:block;min-width:12px;min-height:12px;border-radius:4px;background:var(--border-subtle,#e7ebf2);outline:none}.heatmap-cell.level-1{background:color-mix(in srgb,var(--heat-color,var(--primary)) 24%,var(--surface,#fff))}.heatmap-cell.level-2{background:color-mix(in srgb,var(--heat-color,var(--primary)) 42%,var(--surface,#fff))}.heatmap-cell.level-3{background:color-mix(in srgb,var(--heat-color,var(--primary)) 64%,var(--surface,#fff))}.heatmap-cell.level-4,.heatmap-cell.level-5{background:color-mix(in srgb,var(--heat-color,var(--primary)) 84%,var(--surface,#fff))}.heatmap-legend{display:flex;align-items:center;gap:6px;margin-top:12px;font-size:.75rem;color:var(--text-muted)}.heatmap-list,.category-month-heatmap{display:grid;gap:10px;margin-top:10px}.heatmap-row{display:grid;grid-template-columns:minmax(90px,1fr) 2fr;align-items:center;gap:10px;font-size:.82rem}.heatmap-strip{display:flex;gap:4px}.heatmap-strip .heatmap-cell{flex:1;min-width:10px}.concentration-map{display:flex;gap:5px;min-height:64px;align-items:stretch;margin-top:12px}.concentration-tile{display:flex;flex-direction:column;justify-content:center;align-items:center;min-width:42px;padding:6px;border-radius:8px;background:color-mix(in srgb,var(--primary) 18%,var(--surface-raised));border:1px solid color-mix(in srgb,var(--primary) 34%,var(--border));color:var(--text);font-size:.75rem;overflow:hidden}.concentration-tile:nth-child(3n+2){background:color-mix(in srgb,var(--cyan) 18%,var(--surface-raised));border-color:color-mix(in srgb,var(--cyan) 34%,var(--border))}.concentration-tile:nth-child(3n+3){background:color-mix(in srgb,var(--accent) 16%,var(--surface-raised));border-color:color-mix(in srgb,var(--accent) 34%,var(--border))}.concentration-tile small{font-size:.68rem;opacity:.8}.concentration-tile em{font-style:normal;font-size:.62rem;margin-top:3px}.concentration-map.full .concentration-tile:first-child{background:color-mix(in srgb,var(--primary) 28%,var(--surface-raised))}@media(max-width:720px){.heatmap-calendar.full{grid-template-columns:repeat(7,minmax(22px,1fr));gap:6px}.heatmap-row{grid-template-columns:1fr}.concentration-map{min-height:72px}}
.heatmap-weekdays{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px;padding:8px 0 0;color:var(--muted);font-size:.68rem;font-weight:800;letter-spacing:.06em;text-align:center}.heatmap-weekdays.compact{gap:5px;padding-top:10px;font-size:.58rem}.heatmap-cell{position:relative;display:flex;align-items:flex-end;justify-content:flex-end;padding:4px;color:var(--text);font-size:.72rem}.heatmap-cell b{font-size:.7rem;font-weight:700;line-height:1;opacity:.86}.heatmap-cell.calendar-blank{background:transparent;pointer-events:none}.calendar-navigation{display:flex;align-items:center;gap:8px}.calendar-navigation strong{min-width:130px;text-align:center;font-size:.9rem}.category-month-header{display:grid;grid-template-columns:minmax(90px,1fr) 2fr;align-items:center;gap:10px;color:var(--muted);font-size:.68rem;font-weight:800;letter-spacing:.04em;text-align:center}.category-month-header .heatmap-strip{width:100%}.category-month-header .heatmap-strip strong{flex:1;min-width:10px}.category-month-header.compact{grid-template-columns:1fr 2fr;gap:10px;font-size:.58rem}.concentration-tile.is-other{background:color-mix(in srgb,var(--muted) 18%,var(--surface-raised));border-color:color-mix(in srgb,var(--muted) 34%,var(--border))}.concentration-map.full .concentration-tile{min-width:48px}@media(max-width:720px){.heatmap-weekdays{gap:6px}.category-month-header{grid-template-columns:1fr 2fr;gap:8px}.calendar-navigation strong{min-width:110px;font-size:.82rem}}

.joozo-chart-tooltip{position:fixed;z-index:1000;max-width:280px;padding:10px 12px;border:1px solid var(--border,#d8e0eb);border-radius:10px;background:var(--surface-raised,#fff);color:var(--text,#10233f);box-shadow:0 12px 28px rgba(16,35,63,.18);font-size:.78rem;line-height:1.35;pointer-events:none}
.heatmap-calendar.compact{grid-template-columns:repeat(7,minmax(0,1fr))}.visualization-card .category-month-header{margin-bottom:2px}.visualization-card .heatmap-row{border-top:1px solid color-mix(in srgb,var(--border) 55%,transparent);padding-top:8px}.visualization-card .concentration-map:not(.full){overflow-x:auto;padding-bottom:3px}.visualization-card .concentration-map:not(.full) .concentration-tile{flex:0 0 auto;min-width:48px}
@media(max-width:720px){.category-month-header,.category-month-header.compact{grid-template-columns:1fr}.category-month-header>span{display:none}.category-month-header .heatmap-strip{width:100%}}

/* Heatmap semantics: expenses use a restrained coral scale; zero remains neutral. */
.heatmap-calendar .heatmap-cell{--expense-heat:#d8796f;background:var(--surface-2,#eef1f7);color:var(--text)}
.heatmap-calendar .heatmap-cell.level-1{background:color-mix(in srgb,var(--expense-heat) 22%,var(--surface,#fff))}
.heatmap-calendar .heatmap-cell.level-2{background:color-mix(in srgb,var(--expense-heat) 40%,var(--surface,#fff))}
.heatmap-calendar .heatmap-cell.level-3{background:color-mix(in srgb,var(--expense-heat) 58%,var(--surface,#fff))}
.heatmap-calendar .heatmap-cell.level-4,.heatmap-calendar .heatmap-cell.level-5{background:color-mix(in srgb,var(--expense-heat) 76%,var(--surface,#fff))}
.heatmap-calendar .heatmap-cell:not(.calendar-blank):hover,.heatmap-calendar .heatmap-cell:not(.calendar-blank):focus-visible{outline:2px solid color-mix(in srgb,var(--expense-heat) 70%,var(--text));outline-offset:2px}
body[data-theme="dark"] .heatmap-calendar .heatmap-cell{--expense-heat:#e58b80;background:#12306b}
body[data-theme="dark"] .heatmap-calendar .heatmap-cell.level-1{background:color-mix(in srgb,var(--expense-heat) 24%,#12306b)}
body[data-theme="dark"] .heatmap-calendar .heatmap-cell.level-2{background:color-mix(in srgb,var(--expense-heat) 40%,#12306b)}
body[data-theme="dark"] .heatmap-calendar .heatmap-cell.level-3{background:color-mix(in srgb,var(--expense-heat) 58%,#12306b)}
body[data-theme="dark"] .heatmap-calendar .heatmap-cell.level-4,body[data-theme="dark"] .heatmap-calendar .heatmap-cell.level-5{background:color-mix(in srgb,var(--expense-heat) 74%,#12306b)}
body[data-theme="dark"] .category-month-heatmap .heatmap-cell.level-1,body[data-theme="dark"] .heatmap-list .heatmap-cell.level-1{background:color-mix(in srgb,var(--heat-color) 28%,var(--surface-raised))}
body[data-theme="dark"] .category-month-heatmap .heatmap-cell.level-2,body[data-theme="dark"] .heatmap-list .heatmap-cell.level-2{background:color-mix(in srgb,var(--heat-color) 42%,var(--surface-raised))}
body[data-theme="dark"] .category-month-heatmap .heatmap-cell.level-3,body[data-theme="dark"] .heatmap-list .heatmap-cell.level-3{background:color-mix(in srgb,var(--heat-color) 56%,var(--surface-raised))}
body[data-theme="dark"] .category-month-heatmap .heatmap-cell.level-4,body[data-theme="dark"] .category-month-heatmap .heatmap-cell.level-5,body[data-theme="dark"] .heatmap-list .heatmap-cell.level-4,body[data-theme="dark"] .heatmap-list .heatmap-cell.level-5{background:color-mix(in srgb,var(--heat-color) 70%,var(--surface-raised))}
body[data-theme="dark"] .concentration-tile:nth-child(3n+3){background:color-mix(in srgb,var(--primary) 20%,var(--surface-raised));border-color:color-mix(in srgb,var(--primary) 38%,var(--border))}
.heatmap-calendar .heatmap-cell.level-1,.heatmap-legend .heatmap-cell.level-1{background:#f4d9d4}.heatmap-calendar .heatmap-cell.level-2,.heatmap-legend .heatmap-cell.level-2{background:#eab8b0}.heatmap-calendar .heatmap-cell.level-3,.heatmap-legend .heatmap-cell.level-3{background:#df9289}.heatmap-calendar .heatmap-cell.level-4,.heatmap-calendar .heatmap-cell.level-5,.heatmap-legend .heatmap-cell.level-4,.heatmap-legend .heatmap-cell.level-5{background:#d06f68}
body[data-theme="dark"] .heatmap-calendar .heatmap-cell.level-1,body[data-theme="dark"] .heatmap-legend .heatmap-cell.level-1{background:#9b5b64}body[data-theme="dark"] .heatmap-calendar .heatmap-cell.level-2,body[data-theme="dark"] .heatmap-legend .heatmap-cell.level-2{background:#b96b70}body[data-theme="dark"] .heatmap-calendar .heatmap-cell.level-3,body[data-theme="dark"] .heatmap-legend .heatmap-cell.level-3{background:#d27b78}body[data-theme="dark"] .heatmap-calendar .heatmap-cell.level-4,body[data-theme="dark"] .heatmap-calendar .heatmap-cell.level-5,body[data-theme="dark"] .heatmap-legend .heatmap-cell.level-4,body[data-theme="dark"] .heatmap-legend .heatmap-cell.level-5{background:#e58b80}
@media (prefers-color-scheme: dark){body[data-theme="auto"] .heatmap-calendar .heatmap-cell.level-1,body[data-theme="auto"] .heatmap-legend .heatmap-cell.level-1{background:#9b5b64}body[data-theme="auto"] .heatmap-calendar .heatmap-cell.level-2,body[data-theme="auto"] .heatmap-legend .heatmap-cell.level-2{background:#b96b70}body[data-theme="auto"] .heatmap-calendar .heatmap-cell.level-3,body[data-theme="auto"] .heatmap-legend .heatmap-cell.level-3{background:#d27b78}body[data-theme="auto"] .heatmap-calendar .heatmap-cell.level-4,body[data-theme="auto"] .heatmap-calendar .heatmap-cell.level-5,body[data-theme="auto"] .heatmap-legend .heatmap-cell.level-4,body[data-theme="auto"] .heatmap-legend .heatmap-cell.level-5{background:#e58b80}}

/* Wide dashboard rhythm uses the full twelve-column contract. */
@media (min-width: 1280px) {
  .dashboard-stack {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .dashboard-stack > .dashboard-section {
    grid-column: span 3;
  }

  .dashboard-stack > .dashboard-section.is-wide {
    grid-column: 1 / -1;
  }

  .dashboard-stack > .dashboard-section.dashboard-expense-calendar-section,
  .dashboard-stack > .dashboard-section.dashboard-category-month-section,
  .dashboard-stack > .dashboard-section.dashboard-investment-map-section {
    grid-column: span 2;
    width: 100%;
    min-width: 0;
    justify-self: stretch;
  }

  .dashboard-stack > .dashboard-section.wealth-journey-section,
  .dashboard-stack > .dashboard-section.dashboard-flow-section {
    grid-column: span 3;
  }

  .dashboard-stack > .dashboard-section.dashboard-expense-calendar-section > .visualization-card,
  .dashboard-stack > .dashboard-section.dashboard-category-month-section > .visualization-card,
  .dashboard-stack > .dashboard-section.dashboard-investment-map-section > .visualization-card {
    width: 100%;
    min-width: 0;
  }

  .dashboard-billing-grid > .dashboard-recent-card .list {
    gap: 4px;
  }

  .dashboard-billing-grid > .dashboard-recent-card .list-item {
    padding: 5px 10px;
  }

  .dashboard-billing-grid > .dashboard-recent-card .list-title {
    font-size: 13px;
    line-height: 1.15;
  }

  .dashboard-billing-grid > .dashboard-recent-card .muted.small {
    font-size: 11px;
    line-height: 1.1;
  }

  .dashboard-billing-grid > .dashboard-recent-card .list-footer {
    margin-top: 8px;
  }

  .dashboard-billing-grid {
    grid-auto-rows: 382px;
  }

  .dashboard-billing-grid > .card {
    height: 100%;
    min-height: 0;
  }
}
/* Visualization layout: the category map occupies the left column while the
   calendar and portfolio concentration stack in the right column. */
@media (min-width: 1280px) {
  .dashboard-stack > .dashboard-section.dashboard-category-month-section {
    grid-column: 1 / span 3;
    grid-row: span 2;
  }

  .dashboard-stack > .dashboard-section.dashboard-expense-calendar-section {
    grid-column: 4 / span 3;
    align-self: start;
  }

  .dashboard-stack > .dashboard-section.dashboard-investment-map-section {
    grid-column: 4 / span 3;
    align-self: start;
  }

  .dashboard-stack > .dashboard-category-month-section > .visualization-card {
    height: 100%;
  }

  .dashboard-stack > .dashboard-expense-calendar-section > .visualization-card,
  .dashboard-stack > .dashboard-investment-map-section > .visualization-card {
    height: auto;
  }
}
/* Keep the category and open-account cards aligned when they share a row. */
@media (min-width: 1280px) {
  .dashboard-stack > .dashboard-categories-section,
  .dashboard-stack > .dashboard-obligations-section {
    align-self: stretch;
  }

  .dashboard-stack > .dashboard-categories-section > .card,
  .dashboard-stack > .dashboard-obligations-section > .card {
    height: 100%;
  }
}

/* Billing cards share one desktop row with equal columns and height. */
@media (min-width: 1280px) {
  .dashboard-section > .dashboard-billing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: max-content;
    align-items: stretch;
  }

  .dashboard-section > .dashboard-billing-grid > .card {
    height: 100%;
    min-height: 0;
  }
}

/* Keep the visualization trio grouped in the requested two-column layout. */
@media (min-width: 1280px) {
  .dashboard-stack > .dashboard-section.dashboard-category-month-section {
    order: 6 !important;
  }

  .dashboard-stack > .dashboard-section.dashboard-investment-map-section {
    order: 7 !important;
  }
}

/* Keep visualization cards together without moving the group above prior dashboard sections. */
.dashboard-visualization-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  min-width: 0;
}

@media (min-width: 1280px) {
  .dashboard-stack > .dashboard-visualization-layout {
    grid-column: 1 / -1;
    order: 6;
  }

  .dashboard-widget-error {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-visualization-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .dashboard-visualization-layout.is-single {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-visualization-layout.is-single > .dashboard-section {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .dashboard-visualization-layout.is-double > .dashboard-section {
    grid-column: span 1;
    grid-row: auto;
  }

.dashboard-visualization-layout > .dashboard-expense-calendar-section,
.dashboard-visualization-layout > .dashboard-investment-map-section {
    align-self: start;
  }
}

@media (max-width: 720px) {
  .budget-overview {
    gap: 12px;
  }

  .budget-overview-main {
    padding: 2px 0 4px;
  }

  .budget-alerts {
    grid-template-columns: minmax(0, 1fr);
  }

  .budget-alert-item:nth-child(n + 4) {
    display: none;
  }

  .budget-alert-trend {
    display: none;
  }

  .settings-order-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
  }

  .settings-order-group-toggle > span:first-child {
    min-width: 0;
  }

  .settings-order-group-chevron {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    transition: transform .2s ease;
  }

  .settings-order-group.is-collapsed .settings-order-group-list {
    display: none;
  }

  .settings-order-group.is-collapsed .settings-order-group-chevron {
    transform: rotate(-90deg);
  }
}

@media (prefers-color-scheme: dark){body[data-theme="auto"] .heatmap-calendar .heatmap-cell{--expense-heat:#e58b80;background:#12306b}body[data-theme="auto"] .heatmap-calendar .heatmap-cell.level-1{background:color-mix(in srgb,var(--expense-heat) 24%,#12306b)}body[data-theme="auto"] .heatmap-calendar .heatmap-cell.level-2{background:color-mix(in srgb,var(--expense-heat) 40%,#12306b)}body[data-theme="auto"] .heatmap-calendar .heatmap-cell.level-3{background:color-mix(in srgb,var(--expense-heat) 58%,#12306b)}body[data-theme="auto"] .heatmap-calendar .heatmap-cell.level-4,body[data-theme="auto"] .heatmap-calendar .heatmap-cell.level-5{background:color-mix(in srgb,var(--expense-heat) 74%,#12306b)}body[data-theme="auto"] .category-month-heatmap .heatmap-cell.level-1,body[data-theme="auto"] .heatmap-list .heatmap-cell.level-1{background:color-mix(in srgb,var(--heat-color) 28%,var(--surface-raised))}body[data-theme="auto"] .category-month-heatmap .heatmap-cell.level-2,body[data-theme="auto"] .heatmap-list .heatmap-cell.level-2{background:color-mix(in srgb,var(--heat-color) 42%,var(--surface-raised))}body[data-theme="auto"] .category-month-heatmap .heatmap-cell.level-3,body[data-theme="auto"] .heatmap-list .heatmap-cell.level-3{background:color-mix(in srgb,var(--heat-color) 56%,var(--surface-raised))}body[data-theme="auto"] .category-month-heatmap .heatmap-cell.level-4,body[data-theme="auto"] .category-month-heatmap .heatmap-cell.level-5,body[data-theme="auto"] .heatmap-list .heatmap-cell.level-4,body[data-theme="auto"] .heatmap-list .heatmap-cell.level-5{background:color-mix(in srgb,var(--heat-color) 70%,var(--surface-raised))}body[data-theme="auto"] .concentration-tile:nth-child(3n+3){background:color-mix(in srgb,var(--primary) 20%,var(--surface-raised));border-color:color-mix(in srgb,var(--primary) 38%,var(--border))}}
