:root {
  color-scheme: light;
  --brand-navy: #1f1c63;
  --brand-navy-deep: #14113f;
  --brand-navy-soft: #ecebf6;
  --brand-orange: #e1621b;
  --brand-orange-dark: #a6400f;
  --brand-orange-soft: #fff0e7;
  --canvas: #f7f5f1;
  --canvas-strong: #efeae2;
  --surface: #ffffff;
  --surface-muted: #fbfaf8;
  --text: #24213c;
  --muted: #6d6978;
  --subtle: #8b8693;
  --line: #e5dfd6;
  --line-strong: #d7cfc4;
  --success: #166a50;
  --success-soft: #e8f5ef;
  --warning: #8a4b08;
  --warning-soft: #fff4dc;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --info: #31568f;
  --info-soft: #eef4ff;
  --shadow-sm: 0 1px 2px rgba(31, 28, 99, .06);
  --shadow-md: 0 16px 38px rgba(31, 28, 99, .1);
  --shadow-lg: 0 28px 70px rgba(20, 17, 63, .2);
  --radius-sm: .5rem;
  --radius-md: .75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.35rem;
  --container: 92rem;
  --focus: 0 0 0 3px rgba(225, 98, 27, .28);
  --font-sans: Aptos, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --z-topbar: 30;
  --z-dropdown: 40;
  --z-overlay: 70;
  --z-toast: 90;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  background: var(--canvas);
  accent-color: var(--brand-orange);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 20rem;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 94% 2%, rgba(225, 98, 27, .055), transparent 25rem),
    var(--canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: "kern" 1, "tnum" 1;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

body.drawer-open,
body.modal-open {
  overflow: hidden;
}

::selection {
  background: var(--brand-orange-soft);
  color: var(--brand-navy-deep);
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  transition:
    color .18s ease,
    background-color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    opacity .18s ease,
    transform .18s ease;
}

button {
  border: 0;
}

button:not(:disabled),
[role="button"]:not([aria-disabled="true"]) {
  cursor: pointer;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .52;
}

a {
  color: var(--brand-navy);
  text-underline-offset: .18em;
}

a:hover {
  color: var(--brand-orange-dark);
}

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid rgba(225, 98, 27, .38);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: calc(var(--z-toast) + 1);
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--brand-navy-deep);
  box-shadow: var(--shadow-lg);
  font-weight: 800;
  transform: translateY(calc(-100% - 1.5rem));
}

.skip-link:focus {
  transform: translateY(0);
}

/* Loading and boot states */
.loading {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.loading-card {
  width: min(22rem, 100%);
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.loading-card img {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.loading-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.loading-spinner {
  width: 1.6rem;
  height: 1.6rem;
  border: 3px solid var(--brand-navy-soft);
  border-top-color: var(--brand-orange);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

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

/* Shared buttons */
.btn,
.primary,
.ghost,
.danger,
.text-button,
.icon-btn {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
}

.btn:active,
.primary:active,
.ghost:active,
.danger:active,
.text-button:active,
.icon-btn:active {
  transform: translateY(1px) scale(.99);
}

.primary {
  border: 1px solid var(--brand-navy);
  background: var(--brand-navy);
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 28, 99, .18);
}

.primary:hover {
  border-color: #2c2878;
  background: #2c2878;
  color: #fff;
  box-shadow: 0 11px 22px rgba(31, 28, 99, .24);
  transform: translateY(-1px);
}

.primary.is-orange {
  border-color: var(--brand-orange-dark);
  background: var(--brand-orange-dark);
}

.primary.is-orange:hover {
  border-color: #8d350c;
  background: #8d350c;
}

.ghost {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--brand-navy);
  box-shadow: var(--shadow-sm);
}

.ghost:hover {
  border-color: rgba(31, 28, 99, .3);
  background: var(--brand-navy-soft);
}

.danger {
  border: 1px solid #efc5c0;
  background: var(--danger-soft);
  color: var(--danger);
}

.danger:hover {
  border-color: #de8e86;
  background: #ffe4e0;
}

.text-button {
  min-height: 2.5rem;
  padding-inline: .7rem;
  background: transparent;
  color: var(--brand-navy);
}

.text-button:hover {
  background: var(--brand-navy-soft);
}

.icon-btn {
  width: 2.75rem;
  padding: 0;
  flex: 0 0 auto;
}

.button-row,
.page-actions,
.table-actions,
.modal-actions,
.drawer-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}

/* Horizontal application shell */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  background: var(--brand-navy-deep);
  color: #fff;
  box-shadow: 0 10px 26px rgba(20, 17, 63, .16);
}

.topbar-main,
.topbar-inner {
  width: min(var(--container), 100%);
  min-height: 4.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-inline: auto;
  padding: .7rem clamp(1rem, 3vw, 2rem);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  color: #fff;
  text-decoration: none;
}

.brand:hover {
  color: #fff;
}

.brand-logo,
.brand-mark {
  width: 3.15rem;
  height: 3.15rem;
  flex: 0 0 3.15rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: .7rem;
  background: var(--brand-orange);
  box-shadow: 0 9px 24px rgba(6, 5, 29, .24);
}

.brand-logo img,
.brand-mark img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transform: scale(1.72);
}

.brand-copy {
  min-width: 0;
  display: grid;
  line-height: 1.15;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: -.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  margin-top: .22rem;
  color: rgba(255, 255, 255, .65);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
}

.topbar-button,
.notification-button,
.user-trigger {
  min-height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .075);
  color: #fff;
}

.topbar-button:hover,
.notification-button:hover,
.user-trigger:hover {
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .13);
}

.notification-button {
  position: relative;
  width: 2.75rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.notification-button .nav-badge,
.notification-button .badge {
  position: absolute;
  top: -.35rem;
  right: -.35rem;
}

.user-menu {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .35rem .65rem .35rem .4rem;
}

.user-trigger .profile-photo {
  width: 2.05rem;
  height: 2.05rem;
}

.user-trigger-copy {
  min-width: 0;
  display: grid;
  text-align: left;
}

.user-trigger-copy strong,
.user-trigger-copy small {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-trigger-copy strong {
  color: #fff;
  font-size: .84rem;
}

.user-trigger-copy small {
  color: rgba(255, 255, 255, .62);
  font-size: .7rem;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  z-index: var(--z-dropdown);
  width: min(17rem, calc(100vw - 2rem));
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.user-dropdown[hidden],
.user-dropdown.closed {
  display: none;
}

.user-dropdown button,
.user-dropdown a {
  width: 100%;
  min-height: 2.6rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem .75rem;
  border-radius: .45rem;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}

.user-dropdown button:hover,
.user-dropdown a:hover {
  background: var(--brand-navy-soft);
}

.primary-nav {
  border-top: 1px solid rgba(255, 255, 255, .09);
  background: var(--brand-navy);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
}

.primary-nav-inner,
.primary-nav > ul,
.primary-nav > .nav-list {
  width: min(var(--container), 100%);
  min-width: max-content;
  display: flex;
  align-items: stretch;
  gap: .15rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
  list-style: none;
}

.nav-link {
  position: relative;
  min-height: 3.15rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem .9rem;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, .72);
  font-size: .86rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link::after {
  position: absolute;
  right: .8rem;
  bottom: 0;
  left: .8rem;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
  content: "";
}

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

.nav-link.active,
.nav-link[aria-current="page"] {
  background: rgba(225, 98, 27, .14);
  color: #fff;
}

.nav-link.active::after,
.nav-link[aria-current="page"]::after {
  background: var(--brand-orange);
}

.nav-badge,
.badge {
  min-width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: .34rem;
  border-radius: 999px;
  background: var(--brand-orange-dark);
  color: #fff;
  font-size: .68rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.workspace {
  width: min(var(--container), 100%);
  margin-inline: auto;
  padding: clamp(1.4rem, 3vw, 2.4rem) clamp(1rem, 3vw, 2rem) 4rem;
  scroll-margin-top: 8rem;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.45rem;
}

.page-title {
  min-width: 0;
}

.page-kicker {
  display: block;
  margin-bottom: .35rem;
  color: var(--brand-orange-dark);
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.page-head h1,
.page-title h1 {
  margin: 0;
  color: var(--brand-navy-deep);
  font-size: clamp(1.65rem, 2.8vw, 2.35rem);
  font-weight: 850;
  letter-spacing: -.035em;
  line-height: 1.08;
  text-wrap: balance;
}

.page-head p,
.page-title p {
  max-width: 65ch;
  margin: .45rem 0 0;
  color: var(--muted);
  text-wrap: pretty;
}

/* Dashboard */
.dashboard-overview,
.overview-grid {
  display: grid;
  grid-template-columns: minmax(20rem, .88fr) minmax(0, 1.52fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.hero-summary {
  position: relative;
  min-height: 15.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.35rem, 3vw, 2rem);
  border-radius: var(--radius-xl);
  background: var(--brand-navy-deep);
  color: #fff;
  box-shadow: 0 18px 42px rgba(20, 17, 63, .18);
}

.hero-summary::before {
  position: absolute;
  top: -5rem;
  right: -4rem;
  width: 15rem;
  height: 15rem;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 41% 59% 65% 35%;
  content: "";
  transform: rotate(19deg);
}

.hero-summary::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 42%;
  height: .3rem;
  background: var(--brand-orange);
  content: "";
}

.hero-summary > * {
  position: relative;
  z-index: 1;
}

.hero-label {
  color: rgba(255, 255, 255, .68);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero-value {
  display: block;
  margin: .5rem 0;
  color: #fff;
  font-size: clamp(2.3rem, 5vw, 4.35rem);
  font-weight: 850;
  letter-spacing: -.055em;
  line-height: .98;
  font-variant-numeric: tabular-nums;
}

.hero-summary p {
  max-width: 42ch;
  margin: .6rem 0 0;
  color: rgba(255, 255, 255, .72);
  font-size: .92rem;
}

.hero-meta {
  display: flex;
  gap: 1.4rem;
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .11);
}

.hero-meta span {
  display: grid;
  gap: .12rem;
  color: rgba(255, 255, 255, .62);
  font-size: .72rem;
}

.hero-meta strong {
  color: #fff;
  font-size: .92rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card {
  min-width: 0;
  min-height: 7.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px rgba(31, 28, 99, .08);
  transform: translateY(-1px);
}

.metric-card .metric-label,
.metric-card > span:first-child {
  color: var(--muted);
  font-size: .79rem;
  font-weight: 750;
}

.metric-card .metric-value,
.metric-card > strong {
  display: block;
  margin: .45rem 0 .2rem;
  color: var(--brand-navy-deep);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 850;
  letter-spacing: -.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.metric-card small {
  color: var(--subtle);
  font-size: .73rem;
}

.metric-card[data-tone="danger"],
.metric-card.is-overdue {
  border-top: 3px solid var(--danger);
}

.metric-card[data-tone="warning"],
.metric-card.is-warning {
  border-top: 3px solid var(--brand-orange);
}

.metric-card[data-tone="success"],
.metric-card.is-paid {
  border-top: 3px solid var(--success);
}

.metric-card[data-tone="info"] {
  border-top: 3px solid var(--brand-navy);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(18rem, .75fr);
  gap: 1rem;
  align-items: start;
}

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

.grid-span-full,
.span-2 {
  grid-column: 1 / -1;
}

.panel {
  min-width: 0;
  margin-bottom: 1rem;
  padding: clamp(1rem, 2vw, 1.35rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel.is-flat {
  box-shadow: none;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-head h2,
.panel > h2 {
  margin: 0;
  color: var(--brand-navy-deep);
  font-size: 1.08rem;
  font-weight: 850;
  letter-spacing: -.018em;
}

.panel-head p,
.panel > p {
  max-width: 64ch;
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .88rem;
}

.panel-link {
  flex: 0 0 auto;
  color: var(--brand-navy);
  font-size: .82rem;
  font-weight: 850;
}

.outflow-note {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  margin-bottom: 1rem;
  padding: .85rem 1rem;
  border-left: 3px solid var(--brand-orange);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--brand-orange-soft);
  color: #6f3211;
  font-size: .84rem;
}

.outflow-note strong {
  color: var(--brand-orange-dark);
}

/* Alerts and breakdowns */
.alert-list,
.movement-list,
.breakdown-list {
  display: grid;
  gap: .2rem;
}

.alert-item,
.movement-item,
.breakdown-item {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  padding: .9rem .15rem;
  border-bottom: 1px solid var(--line);
}

.alert-item:last-child,
.movement-item:last-child,
.breakdown-item:last-child {
  border-bottom: 0;
}

.alert-indicator {
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  background: var(--brand-orange);
  box-shadow: 0 0 0 4px var(--brand-orange-soft);
}

.alert-item.is-overdue .alert-indicator {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.alert-copy,
.movement-copy {
  min-width: 0;
}

.alert-copy strong,
.movement-copy strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: .9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-copy small,
.movement-copy small {
  display: block;
  margin-top: .15rem;
  color: var(--muted);
  font-size: .75rem;
}

.alert-value,
.money {
  color: var(--brand-navy-deep);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.breakdown-bar {
  height: .48rem;
  margin-top: .45rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--canvas-strong);
}

.breakdown-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-orange);
}

/* Filters and forms */
.filters {
  display: grid;
  grid-template-columns: minmax(13rem, 1.4fr) repeat(3, minmax(9rem, .7fr)) auto;
  gap: .75rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.filters.compact {
  display: flex;
  flex-wrap: wrap;
}

.filters.compact > * {
  flex: 1 1 10rem;
}

.filters.compact > .primary,
.filters.compact > .ghost,
.filters.compact > button {
  flex: 0 0 auto;
}

label,
.field {
  min-width: 0;
  display: grid;
  gap: .38rem;
  color: #4f4a5b;
  font-size: .78rem;
  font-weight: 800;
}

label .optional,
.field .optional {
  color: var(--subtle);
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: .68rem .78rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 1px 1px rgba(31, 28, 99, .025);
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #a09aa6;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #c4baae;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-orange);
  outline: 0;
  box-shadow: var(--focus);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"],
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
}

input[aria-invalid="true"]:focus,
select[aria-invalid="true"]:focus,
textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(180, 35, 24, .18);
}

.readonly,
input:read-only {
  background: var(--surface-muted);
  color: var(--muted);
}

.help-text,
.field-help {
  color: var(--subtle);
  font-size: .72rem;
  font-weight: 600;
}

.field-error {
  color: var(--danger);
  font-size: .73rem;
  font-weight: 750;
}

.form-grid,
.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}

.form-grid.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.full,
.field-full {
  grid-column: 1 / -1;
}

.form-section {
  grid-column: 1 / -1;
  margin-top: .45rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.form-section h3 {
  margin: 0 0 .8rem;
  color: var(--brand-navy-deep);
  font-size: .92rem;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  margin-top: .45rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

label.check,
.check {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: .55rem;
}

label.check input,
.check input {
  width: 1.1rem;
  height: 1.1rem;
  min-height: 1.1rem;
  flex: 0 0 auto;
  margin: 0;
}

.segmented-control {
  display: inline-flex;
  gap: .2rem;
  padding: .22rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--canvas);
}

.segmented-control button {
  min-height: 2.35rem;
  padding: .5rem .8rem;
  border-radius: .45rem;
  background: transparent;
  color: var(--muted);
  font-size: .79rem;
  font-weight: 800;
}

.segmented-control button:hover {
  color: var(--brand-navy);
}

.segmented-control button.active,
.segmented-control button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--brand-navy);
  box-shadow: var(--shadow-sm);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}

.data-table th,
.data-table td {
  padding: .82rem .9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: var(--surface-muted);
  color: var(--muted);
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  color: var(--text);
  font-size: .84rem;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: #fdfcfb;
}

.data-table tbody tr.is-overdue td {
  background: rgba(255, 240, 238, .52);
}

.data-table .cell-title {
  display: block;
  color: var(--text);
  font-weight: 800;
}

.data-table .cell-meta {
  display: block;
  margin-top: .15rem;
  color: var(--muted);
  font-size: .72rem;
}

.data-table .table-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.data-table .table-actions > * {
  min-height: 2.25rem;
  padding: .45rem .65rem;
  font-size: .73rem;
}

.status-badge,
.method-badge,
.type-badge {
  min-height: 1.65rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .69rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.status-badge::before {
  width: .42rem;
  height: .42rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-badge.is-paid,
.status-badge[data-status="pago"],
.status-badge[data-status="paga"] {
  border-color: #c7e6d7;
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.is-overdue,
.status-badge[data-status="atrasado"],
.status-badge[data-status="atrasada"] {
  border-color: #f0c4bf;
  background: var(--danger-soft);
  color: var(--danger);
}

.status-badge.is-due-today,
.status-badge[data-status="vence-hoje"] {
  border-color: #f0d5a4;
  background: var(--warning-soft);
  color: var(--warning);
}

.status-badge.is-pending,
.status-badge[data-status="pendente"] {
  border-color: #d4d8e8;
  background: var(--brand-navy-soft);
  color: var(--brand-navy);
}

.status-badge.is-cancelled,
.status-badge[data-status="cancelado"],
.status-badge[data-status="cancelada"] {
  border-color: #ded9df;
  background: #f4f1f3;
  color: #68616d;
}

.method-badge,
.type-badge {
  border-color: #e2dcd3;
  background: var(--surface-muted);
  color: #514b59;
}

.method-badge.is-boleto,
.method-badge[data-method="boleto"] {
  border-color: #d7d4e8;
  background: var(--brand-navy-soft);
  color: var(--brand-navy);
}

.method-badge.is-cheque,
.method-badge[data-method="cheque"] {
  border-color: #efd3bf;
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
}

.method-badge.is-deposit,
.method-badge[data-method="deposito"] {
  border-color: #c9dfef;
  background: var(--info-soft);
  color: var(--info);
}

/* Empty, error and feedback states */
.empty-state {
  min-height: 15rem;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  text-align: center;
}

.empty-state-inner {
  max-width: 30rem;
}

.empty-state-icon {
  width: 3.35rem;
  height: 3.35rem;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  border-radius: 1rem;
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
  font-size: 1.35rem;
}

.empty-state h2,
.empty-state h3 {
  margin: 0;
  color: var(--brand-navy-deep);
  font-size: 1.15rem;
}

.empty-state p {
  max-width: 46ch;
  margin: .45rem auto 1.15rem;
  color: var(--muted);
}

.flash,
.inline-alert {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin-bottom: 1rem;
  padding: .82rem .95rem;
  border: 1px solid #d7d4e8;
  border-radius: var(--radius-sm);
  background: var(--brand-navy-soft);
  color: var(--brand-navy);
  font-size: .84rem;
  font-weight: 750;
}

.flash.error,
.inline-alert.is-error {
  border-color: #efc5c0;
  background: var(--danger-soft);
  color: var(--danger);
}

.flash.success,
.inline-alert.is-success {
  border-color: #c7e6d7;
  background: var(--success-soft);
  color: var(--success);
}

.flash.warning,
.inline-alert.is-warning {
  border-color: #f0d5a4;
  background: var(--warning-soft);
  color: var(--warning);
}

.toast-region {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: var(--z-toast);
  width: min(24rem, calc(100vw - 2rem));
  display: grid;
  gap: .65rem;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: .7rem;
  padding: .9rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-navy);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  pointer-events: auto;
  animation: toast-in .22s ease-out both;
}

.toast.is-success {
  border-left-color: var(--success);
}

.toast.is-error {
  border-left-color: var(--danger);
}

.toast.is-warning {
  border-left-color: var(--brand-orange);
}

.toast strong {
  display: block;
  font-size: .86rem;
}

.toast p {
  margin: .18rem 0 0;
  color: var(--muted);
  font-size: .76rem;
}

.toast button {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: .4rem;
  background: transparent;
  color: var(--muted);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-.6rem);
  }
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: .35rem;
  background: #ebe7e2;
  color: transparent !important;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .62), transparent);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.3s ease-in-out infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

/* Drawers and dialogs */
.drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  justify-content: flex-end;
  visibility: hidden;
  pointer-events: none;
}

.drawer.open,
.drawer[aria-hidden="false"] {
  visibility: visible;
  pointer-events: auto;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 17, 63, .48);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .22s ease;
}

.drawer-panel {
  position: relative;
  z-index: 1;
  width: min(38rem, 94vw);
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(1rem, 3vw, 1.6rem);
  background: var(--surface);
  box-shadow: -20px 0 55px rgba(20, 17, 63, .2);
  transform: translateX(100%);
  transition: transform .24s ease;
}

.drawer.open .drawer-backdrop,
.drawer[aria-hidden="false"] .drawer-backdrop {
  opacity: 1;
}

.drawer.open .drawer-panel,
.drawer[aria-hidden="false"] .drawer-panel {
  transform: translateX(0);
}

.drawer-head,
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2,
.modal-head h2 {
  margin: 0;
  color: var(--brand-navy-deep);
  font-size: 1.25rem;
  letter-spacing: -.02em;
}

.drawer-head p,
.modal-head p {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .84rem;
}

.drawer-actions {
  position: sticky;
  bottom: 0;
  justify-content: flex-end;
  margin: 1.25rem -1.6rem -1.6rem;
  padding: 1rem 1.6rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(20, 17, 63, .5);
  backdrop-filter: blur(2px);
}

.modal.open,
.modal[aria-hidden="false"] {
  display: flex;
}

.modal-dialog,
.modal-box {
  width: min(36rem, 100%);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: dialog-in .18s ease-out both;
}

.modal-dialog.is-wide,
.modal-box.is-wide {
  width: min(48rem, 100%);
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.discard-prompt {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(20, 17, 63, .62);
  backdrop-filter: blur(3px);
}

.discard-card {
  width: min(30rem, 100%);
  padding: clamp(1.15rem, 4vw, 1.6rem);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: dialog-in .18s ease-out both;
}

.discard-card h2 {
  margin: .35rem 0 .45rem;
  color: var(--brand-navy-deep);
  font-size: 1.3rem;
}

.discard-card p {
  margin: 0;
  color: var(--muted);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(.5rem) scale(.985);
  }
}

/* Login */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 15% 15%, rgba(225, 98, 27, .12), transparent 25rem),
    var(--canvas);
}

.login-frame {
  width: min(68rem, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(22rem, .75fr);
  gap: 1rem;
}

.login-info {
  position: relative;
  min-height: 38rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: var(--radius-xl);
  background: var(--brand-navy-deep);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.login-info::after {
  position: absolute;
  right: -5rem;
  bottom: -7rem;
  width: 20rem;
  height: 20rem;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 43% 57% 63% 37%;
  content: "";
  transform: rotate(18deg);
}

.login-info > * {
  position: relative;
  z-index: 1;
}

.login-info .eyebrow {
  margin-bottom: 1rem;
  color: #ffbd93;
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.login-info h1 {
  max-width: 13ch;
  margin: 0;
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 850;
  letter-spacing: -.05em;
  line-height: 1.02;
  text-wrap: balance;
}

.login-info > p {
  max-width: 52ch;
  margin: 1.2rem 0 1.8rem;
  color: rgba(255, 255, 255, .72);
  font-size: 1rem;
}

.login-benefits {
  display: grid;
  gap: .65rem;
}

.benefit {
  display: grid;
  grid-template-columns: 2.45rem minmax(0, 1fr);
  gap: .75rem;
  padding: .8rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .045);
}

.benefit i {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: .55rem;
  background: rgba(225, 98, 27, .22);
  color: #fff;
  font-style: normal;
}

.benefit strong {
  display: block;
  color: #fff;
  font-size: .85rem;
}

.benefit small {
  display: block;
  margin-top: .12rem;
  color: rgba(255, 255, 255, .62);
  font-size: .74rem;
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.6rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.login-form {
  width: min(24rem, 100%);
  display: grid;
  gap: .85rem;
  margin-inline: auto;
}

.login-logo {
  width: 8.5rem;
  height: 8.5rem;
  margin: 0 auto .2rem;
  overflow: hidden;
  border: 1px solid rgba(31, 28, 99, .12);
  border-radius: 1.25rem;
  background: var(--brand-orange);
  box-shadow: 0 16px 35px rgba(31, 28, 99, .14);
}

.login-logo img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transform: scale(1.62);
}

.login-brand-copy {
  display: grid;
  gap: .15rem;
  margin-bottom: .55rem;
  text-align: center;
}

.login-brand-copy strong {
  color: var(--brand-navy-deep);
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: -.02em;
}

.login-brand-copy span {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.login-form .primary {
  width: 100%;
  margin-top: .3rem;
}

.developer-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .72rem;
}

.developer-footer img {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
}

.developer-footer a {
  font-weight: 850;
}

.login-footer {
  grid-column: 1 / -1;
  margin-top: .15rem;
}

.login-version {
  grid-column: 1 / -1;
  color: var(--subtle);
  font-size: .68rem;
  text-align: center;
}

/* Profile and administrative helpers */
.profile-photo {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: .8rem;
  background: var(--brand-navy);
  color: #fff;
  font-weight: 900;
  object-fit: cover;
}

.photo-row {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.photo-options {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: .6rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.single {
  max-width: 64rem;
  margin-inline: auto;
}

.password-choice-dialog,
.greeting-dialog {
  text-align: center;
}

.password-choice-dialog .greeting-label,
.greeting-dialog .greeting-label {
  display: inline-flex;
  padding: .3rem .6rem;
  border-radius: 999px;
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
  font-size: .7rem;
  font-weight: 900;
}

.password-choice-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
  margin-top: 1rem;
  text-align: left;
}

.password-choice-error:not(:empty) {
  margin-top: .8rem;
  padding: .7rem;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: .78rem;
  font-weight: 750;
  text-align: left;
}

/* Responsive layout */
@media (max-width: 72rem) {
  .dashboard-overview,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .hero-summary {
    min-height: 13rem;
  }

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

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

  .filters > :first-child {
    grid-column: span 2;
  }
}

@media (max-width: 60rem) {
  .topbar-main,
  .topbar-inner {
    gap: .75rem;
  }

  .content-grid,
  .content-grid.equal {
    grid-template-columns: 1fr;
  }

  .grid-span-full,
  .span-2 {
    grid-column: auto;
  }

  .login-frame {
    grid-template-columns: 1fr;
    max-width: 34rem;
  }

  .login-info {
    display: none;
  }

  .login-footer,
  .login-version {
    grid-column: auto;
  }
}

@media (max-width: 48rem) {
  .topbar {
    position: relative;
  }

  .topbar-main,
  .topbar-inner {
    min-height: 4.2rem;
    padding-block: .55rem;
  }

  .brand-copy small,
  .user-trigger-copy {
    display: none;
  }

  .primary-nav-inner,
  .primary-nav > ul,
  .primary-nav > .nav-list {
    padding-inline: .7rem;
  }

  .nav-link {
    min-height: 3rem;
    padding-inline: .75rem;
  }

  .workspace {
    padding-top: 1.25rem;
  }

  .page-head {
    align-items: stretch;
  }

  .page-actions {
    justify-content: flex-end;
  }

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

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

  .filters > :first-child {
    grid-column: 1 / -1;
  }

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

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table {
    background: transparent;
  }

  .data-table tbody {
    display: grid;
    gap: .75rem;
  }

  .data-table tbody tr {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .data-table th,
  .data-table td {
    white-space: normal;
  }

  .data-table td {
    display: grid;
    grid-template-columns: minmax(7.25rem, .8fr) minmax(0, 1.2fr);
    gap: .75rem;
    align-items: start;
    padding: .68rem .8rem;
    font-size: .8rem;
    text-align: right;
  }

  .data-table td::before {
    grid-column: 1;
    grid-row: 1 / span 20;
    color: var(--muted);
    content: attr(data-label);
    font-size: .67rem;
    font-weight: 900;
    letter-spacing: .05em;
    text-align: left;
    text-transform: uppercase;
  }

  .data-table td > * {
    min-width: 0;
    grid-column: 2;
  }

  .data-table td:last-child {
    border-bottom: 0;
  }

  .data-table .cell-title,
  .data-table .cell-meta {
    text-align: right;
  }

  .data-table .table-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .alert-item,
  .movement-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .alert-value,
  .movement-item > :last-child {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 38rem) {
  .topbar-main,
  .topbar-inner {
    padding-inline: .8rem;
  }

  .brand-logo,
  .brand-mark {
    width: 2.8rem;
    height: 2.8rem;
    flex-basis: 2.8rem;
  }

  .brand-copy strong {
    max-width: 10.5rem;
    font-size: .88rem;
  }

  .topbar-actions {
    gap: .35rem;
  }

  .topbar-button {
    width: 2.75rem;
    padding: 0;
  }

  .topbar-button .label {
    display: none;
  }

  .workspace {
    padding-inline: .75rem;
  }

  .page-head {
    display: grid;
  }

  .page-actions {
    justify-content: stretch;
  }

  .page-actions > * {
    flex: 1 1 auto;
  }

  .hero-summary {
    min-height: 14rem;
  }

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

  .metric-card {
    min-height: 6.5rem;
  }

  .filters,
  .form-grid,
  .form,
  .form-grid.three-columns,
  .settings-grid,
  .password-choice-fields {
    grid-template-columns: 1fr;
  }

  .filters > :first-child,
  .full,
  .field-full,
  .form-section,
  .form-actions {
    grid-column: auto;
  }

  .filters > button,
  .filters > .primary,
  .filters > .ghost {
    width: 100%;
  }

  .panel-head {
    display: grid;
  }

  .panel-head > .primary,
  .panel-head > .ghost,
  .panel-head > button {
    width: 100%;
  }

  .segmented-control {
    width: 100%;
    overflow-x: auto;
  }

  .segmented-control button {
    flex: 1 0 auto;
  }

  .drawer-panel {
    width: 100%;
    max-width: none;
  }

  .drawer-actions {
    margin-right: -1rem;
    margin-bottom: -1rem;
    margin-left: -1rem;
    padding-inline: 1rem;
  }

  .drawer-actions > *,
  .modal-actions > *,
  .form-actions > * {
    flex: 1 1 100%;
  }

  .modal {
    align-items: flex-end;
    padding: .5rem;
  }

  .modal-dialog,
  .modal-box {
    width: 100%;
    max-height: calc(100dvh - 1rem);
    border-radius: var(--radius-lg) var(--radius-lg) .65rem .65rem;
  }

  .toast-region {
    top: .6rem;
    right: .6rem;
    width: calc(100vw - 1.2rem);
  }

  .login {
    place-items: start center;
    overflow-y: auto;
  }

  .login-card {
    padding: 1.4rem 1rem;
  }

  .login-logo {
    width: 7.5rem;
    height: 7.5rem;
  }
}

@media (pointer: coarse) {
  .nav-link,
  .data-table .table-actions > *,
  .segmented-control button {
    min-height: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  :root {
    --canvas: #fff;
    --surface: #fff;
  }

  .topbar,
  .page-actions,
  .filters,
  .table-actions,
  .toast-region,
  .drawer,
  .modal,
  .developer-footer {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .workspace {
    width: 100%;
    padding: 0;
  }

  .panel,
  .metric-card,
  .hero-summary {
    break-inside: avoid;
    box-shadow: none;
  }

  .hero-summary {
    border: 1px solid #aaa;
    background: #fff;
    color: #000;
  }

  .hero-summary * {
    color: #000 !important;
  }
}

/* Dashboard com navegação lateral inspirado na referência enviada */
:root {
  --rail-width: 4.75rem;
  --topbar-height: 4.8rem;
  --canvas: #f4f7fa;
  --surface-muted: #f8fafc;
  --line: #e3e8ee;
  --line-strong: #d3dae3;
  --shadow-sm: 0 1px 3px rgba(20, 17, 63, .05);
  --shadow-md: 0 10px 28px rgba(20, 17, 63, .08);
}

body {
  background: var(--canvas);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
}

.side-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: calc(var(--z-topbar) + 1);
  width: var(--rail-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #171a2e;
  color: #fff;
  box-shadow: 7px 0 22px rgba(20, 17, 63, .1);
}

.rail-mark {
  width: 100%;
  height: var(--topbar-height);
  display: grid;
  place-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: -.04em;
  text-decoration: none;
}

.rail-mark:hover {
  background: rgba(255, 255, 255, .05);
  color: #fff;
}

.app-frame {
  min-width: 0;
  grid-column: 2;
}

.topbar {
  min-height: var(--topbar-height);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  color: var(--text);
  box-shadow: 0 2px 9px rgba(20, 17, 63, .045);
  backdrop-filter: blur(14px);
}

.topbar-main,
.topbar-inner {
  width: 100%;
  min-height: var(--topbar-height);
  padding: .65rem clamp(1rem, 2.4vw, 2.2rem);
}

.topbar-leading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.topbar .brand {
  color: var(--brand-navy-deep);
}

.topbar .brand:hover {
  color: var(--brand-navy);
}

.topbar .brand-logo {
  width: 2.75rem;
  height: 2.75rem;
  flex-basis: 2.75rem;
  border-color: var(--line);
  border-radius: .55rem;
  box-shadow: none;
}

.topbar .brand-copy strong {
  color: var(--brand-navy-deep);
}

.topbar .brand-copy small {
  color: var(--muted);
}

.topbar-divider {
  width: 1px;
  height: 2.15rem;
  flex: 0 0 1px;
  background: var(--line);
}

.topbar-page {
  overflow: hidden;
  color: #303241;
  font-size: .9rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-button,
.notification-button,
.user-trigger {
  border-color: var(--line);
  background: #fff;
  color: var(--brand-navy-deep);
  box-shadow: none;
}

.topbar-button:hover,
.notification-button:hover,
.user-trigger:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

.topbar-button {
  border-color: var(--brand-navy);
  background: var(--brand-navy);
  color: #fff;
}

.topbar-button:hover {
  border-color: var(--brand-navy-deep);
  background: var(--brand-navy-deep);
  color: #fff;
}

.user-trigger-copy strong {
  color: var(--text);
}

.user-trigger-copy small {
  color: var(--muted);
}

.side-rail .primary-nav {
  width: 100%;
  flex: 1;
  overflow: visible;
  border: 0;
  background: transparent;
}

.side-rail .primary-nav-inner {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: .75rem .65rem;
}

.side-rail .nav-link {
  width: 3.35rem;
  min-height: 3.35rem;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: .6rem;
  color: rgba(255, 255, 255, .56);
}

.side-rail .nav-link:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.side-rail .nav-link.active,
.side-rail .nav-link[aria-current="page"] {
  background: var(--brand-orange);
  color: #fff;
  box-shadow: 0 8px 18px rgba(166, 64, 15, .26);
}

.side-rail .nav-link::before {
  position: absolute;
  top: 50%;
  left: calc(100% + .7rem);
  z-index: var(--z-dropdown);
  padding: .5rem .7rem;
  border-radius: .4rem;
  background: #171a2e;
  color: #fff;
  box-shadow: var(--shadow-md);
  content: attr(data-label);
  font-size: .74rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-.3rem, -50%);
  transition: opacity .15s ease, transform .15s ease;
}

.side-rail .nav-link:hover::before,
.side-rail .nav-link:focus-visible::before {
  opacity: 1;
  transform: translate(0, -50%);
}

.side-rail .nav-link::after {
  display: none;
}

.nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.side-rail .nav-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.side-rail .nav-badge {
  position: absolute;
  top: .28rem;
  right: .25rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 .22rem;
  border: 2px solid #171a2e;
  background: #fff;
  color: var(--danger);
  font-size: .56rem;
}

.workspace {
  width: min(100%, 92rem);
  min-height: calc(100dvh - var(--topbar-height));
  padding: clamp(1.4rem, 2.6vw, 2.35rem) clamp(1rem, 3vw, 2.5rem) 4rem;
  scroll-margin-top: calc(var(--topbar-height) + 1rem);
}

.page-head {
  align-items: center;
  margin-bottom: 1.15rem;
}

.page-head h1,
.page-title h1 {
  font-size: clamp(1.55rem, 2.2vw, 2.05rem);
}

.page-kicker {
  letter-spacing: .08em;
}

.scope-strip {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: -.25rem 0 1rem;
  padding: .65rem .8rem;
  border-left: 3px solid var(--brand-orange);
  background: #fff;
  color: var(--muted);
  font-size: .78rem;
}

.scope-strip > span {
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
  font-weight: 900;
}

.scope-strip p {
  margin: 0;
}

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

.board-card {
  min-width: 0;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.board-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 13px 30px rgba(20, 17, 63, .1);
  transform: translateY(-1px);
}

.board-card-head {
  min-height: 2.7rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.board-card-head h2 {
  margin: .1rem 0 0;
  color: #27293a;
  font-size: .9rem;
  font-weight: 750;
  letter-spacing: -.012em;
}

.board-card-head > span {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
}

.board-eyebrow {
  color: var(--brand-orange-dark);
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.donut-card {
  min-height: 18rem;
  grid-column: span 5;
}

.kpi-card {
  min-height: 18rem;
  grid-column: span 3;
  display: flex;
  flex-direction: column;
}

.open-card {
  min-height: 18rem;
  grid-column: span 4;
}

.priorities-card {
  min-height: 20rem;
  grid-column: span 7;
}

.status-card {
  min-height: 20rem;
  grid-column: span 5;
}

.donut-layout {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(9rem, .9fr);
  align-items: center;
  gap: 1rem;
}

.donut-wrap {
  position: relative;
  width: min(12rem, 100%);
  margin: 0 auto;
}

.donut-chart {
  width: 100%;
  transform: rotate(-90deg);
}

.donut-track,
.donut-segment {
  fill: none;
  stroke-width: 6;
}

.donut-track {
  stroke: #eef1f5;
}

.donut-segment {
  stroke-linecap: butt;
}

.donut-segment.chart-accounts,
.legend-dot.chart-accounts {
  stroke: var(--brand-navy);
  background: var(--brand-navy);
}

.donut-segment.chart-employees,
.legend-dot.chart-employees {
  stroke: var(--brand-orange);
  background: var(--brand-orange);
}

.donut-segment.chart-withdrawals,
.legend-dot.chart-withdrawals {
  stroke: #e9ad45;
  background: #e9ad45;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.donut-center strong {
  color: var(--brand-navy-deep);
  font-size: 1.45rem;
  line-height: 1;
}

.donut-center span {
  margin-top: .2rem;
  color: var(--muted);
  font-size: .65rem;
}

.chart-legend {
  display: grid;
  gap: .75rem;
}

.chart-legend > div {
  display: grid;
  grid-template-columns: .65rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .7rem;
}

.chart-legend strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.legend-dot {
  width: .55rem;
  height: .55rem;
  border-radius: .15rem;
}

.board-kpi {
  display: block;
  margin: auto 0 .5rem;
  color: #171827;
  font-size: clamp(1.9rem, 3vw, 3rem);
  font-weight: 780;
  letter-spacing: -.055em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kpi-card > p {
  margin: .35rem 0 1.2rem;
  color: var(--muted);
  font-size: .77rem;
}

.kpi-foot {
  display: flex;
  gap: 1.1rem;
  margin-top: auto;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
}

.kpi-foot span {
  display: grid;
  color: var(--muted);
  font-size: .64rem;
}

.kpi-foot strong {
  color: var(--brand-navy-deep);
  font-size: .9rem;
}

.risk-copy,
.progress-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  color: var(--muted);
  font-size: .7rem;
}

.risk-copy {
  margin-top: 1.65rem;
}

.risk-copy strong {
  color: var(--danger);
}

.risk-progress,
.priority-progress {
  width: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #edf1f5;
  appearance: none;
}

.risk-progress {
  height: .48rem;
  margin: .55rem 0 .45rem;
}

.risk-progress::-webkit-progress-bar,
.priority-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #edf1f5;
}

.risk-progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--brand-orange);
}

.risk-progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--brand-orange);
}

.progress-caption strong {
  color: var(--brand-orange-dark);
}

.priority-bars {
  display: grid;
  gap: .65rem;
}

.priority-row {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr) 1.5rem;
  align-items: center;
  gap: .75rem;
  color: var(--muted);
  font-size: .68rem;
}

.priority-row strong {
  color: var(--text);
  text-align: right;
}

.priority-progress {
  height: .45rem;
}

.priority-progress.is-overdue::-webkit-progress-value {
  background: var(--danger);
}

.priority-progress.is-overdue::-moz-progress-bar {
  background: var(--danger);
}

.priority-progress.is-today::-webkit-progress-value {
  background: var(--brand-orange);
}

.priority-progress.is-today::-moz-progress-bar {
  background: var(--brand-orange);
}

.priority-progress.is-upcoming::-webkit-progress-value {
  background: var(--brand-navy);
}

.priority-progress.is-upcoming::-moz-progress-bar {
  background: var(--brand-navy);
}

.compact-alert-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem .75rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.compact-alert-list button {
  min-width: 0;
  display: grid;
  grid-template-columns: .5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
  padding: .55rem;
  border-radius: .45rem;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.compact-alert-list button:hover {
  background: var(--surface-muted);
}

.compact-alert-list button > span:nth-child(2) {
  min-width: 0;
  display: grid;
}

.compact-alert-list strong,
.compact-alert-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-alert-list strong {
  font-size: .72rem;
}

.compact-alert-list small {
  color: var(--muted);
  font-size: .61rem;
}

.compact-alert-list b {
  color: var(--brand-navy-deep);
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.status-chart {
  width: 100%;
  height: auto;
  margin-top: .15rem;
  overflow: visible;
}

.chart-grid-line {
  fill: none;
  stroke: #e9edf2;
  stroke-width: 1;
}

.chart-bar {
  fill: var(--brand-navy);
}

.chart-bar.is-pending {
  fill: #5d66a7;
}

.chart-bar.is-overdue {
  fill: var(--danger);
}

.chart-bar.is-today {
  fill: var(--brand-orange);
}

.chart-bar.is-withdrawal {
  fill: #e9ad45;
}

.chart-value {
  fill: var(--text);
  font-size: 11px;
  font-weight: 800;
  text-anchor: middle;
}

.chart-label {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 650;
  text-anchor: middle;
}

.chart-empty {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: .76rem;
}

.recent-panel {
  margin-top: 1rem;
  border-radius: .65rem;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 72rem) {
  .donut-card,
  .kpi-card {
    grid-column: span 6;
  }

  .open-card {
    grid-column: span 12;
    min-height: 15rem;
  }

  .priorities-card,
  .status-card {
    grid-column: span 6;
  }
}

@media (max-width: 60rem) {
  :root {
    --rail-width: 0rem;
  }

  .app-shell {
    display: block;
  }

  .app-frame {
    width: 100%;
  }

  .side-rail {
    inset: auto 0 0;
    width: 100%;
    height: 4.35rem;
    flex-direction: row;
    background: rgba(23, 26, 46, .98);
    box-shadow: 0 -7px 24px rgba(20, 17, 63, .14);
    backdrop-filter: blur(12px);
  }

  .rail-mark {
    display: none;
  }

  .side-rail .primary-nav {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .side-rail .primary-nav::-webkit-scrollbar {
    display: none;
  }

  .side-rail .primary-nav-inner {
    min-width: max-content;
    height: 100%;
    flex-direction: row;
    justify-content: center;
    gap: .2rem;
    padding: .45rem .75rem;
  }

  .side-rail .nav-link {
    width: 3.1rem;
    min-height: 3.1rem;
  }

  .side-rail .nav-link::before {
    display: none;
  }

  .workspace {
    padding-bottom: 7rem;
  }
}

@media (max-width: 48rem) {
  .donut-card,
  .kpi-card,
  .open-card,
  .priorities-card,
  .status-card {
    grid-column: span 12;
    min-height: auto;
  }

  .donut-layout {
    grid-template-columns: minmax(8rem, .8fr) minmax(9rem, 1fr);
  }

  .compact-alert-list {
    grid-template-columns: 1fr;
  }

  .status-chart {
    max-height: 16rem;
  }
}

@media (max-width: 38rem) {
  .topbar-leading {
    gap: .7rem;
  }

  .topbar .brand-copy,
  .topbar-divider,
  .user-trigger-copy {
    display: none;
  }

  .topbar-page {
    max-width: 7.5rem;
    font-size: .78rem;
  }

  .topbar-main {
    gap: .55rem;
    padding-inline: .75rem;
  }

  .board-card {
    padding: 1rem;
  }

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

  .chart-legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chart-legend > div {
    grid-template-columns: .55rem minmax(0, 1fr);
  }

  .chart-legend strong {
    grid-column: 2;
  }

  .priority-row {
    grid-template-columns: 5.7rem minmax(0, 1fr) 1rem;
    gap: .45rem;
  }
}

@media print {
  .side-rail {
    display: none !important;
  }

  .app-shell,
  .app-frame {
    display: block;
  }

  .board-card {
    break-inside: avoid;
    box-shadow: none;
  }
}
