:root {
  --ronda-bg: oklch(97.2% 0.006 255);
  --ronda-surface: oklch(100% 0 0);
  --ronda-surface-subtle: oklch(94.8% 0.009 252);
  --ronda-surface-blue: oklch(96.5% 0.025 253);
  --ronda-text: oklch(22% 0.026 255);
  --ronda-text-soft: oklch(43% 0.027 255);
  --ronda-muted: oklch(55% 0.023 255);
  --ronda-border: oklch(88.5% 0.013 252);
  --ronda-border-strong: oklch(80% 0.02 252);
  --ronda-accent: oklch(55% 0.19 254);
  --ronda-accent-hover: oklch(49% 0.2 254);
  --ronda-accent-active: oklch(43% 0.19 254);
  --ronda-accent-soft: oklch(92.5% 0.045 254);
  --ronda-success: oklch(48% 0.14 145);
  --ronda-success-soft: oklch(94% 0.05 145);
  --ronda-warn: oklch(58% 0.15 70);
  --ronda-warn-soft: oklch(94% 0.055 80);
  --ronda-danger: oklch(51% 0.17 28);
  --ronda-danger-soft: oklch(95% 0.045 28);
  --ronda-font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ronda-font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --shadow-card: 0 16px 42px rgba(28, 39, 64, 0.08);
  --shadow-panel: 0 24px 70px rgba(28, 39, 64, 0.18);
  --sidebar-width: 236px;
  --topbar-height: 76px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--ronda-bg);
  color: var(--ronda-text);
  font-family: var(--ronda-font-body);
  text-rendering: geometricPrecision;
}

body {
  min-width: 0;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at top left, color-mix(in oklch, var(--ronda-accent-soft), transparent 26%), transparent 28rem),
    var(--ronda-bg);
  color: var(--ronda-text);
  font-size: 16px;
  line-height: 1.55;
}

body.is-dialog-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 200;
  top: var(--space-4);
  left: var(--space-4);
  padding: var(--space-3) var(--space-4);
  color: oklch(100% 0 0);
  background: var(--ronda-accent);
  border-radius: var(--radius-sm);
  transform: translateY(-150%);
  transition: transform var(--motion-fast) var(--ease-standard);
}

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

:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--ronda-accent), transparent 74%);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: var(--space-6) var(--space-5);
  background: color-mix(in oklch, var(--ronda-surface), var(--ronda-bg) 28%);
  border-right: 1px solid var(--ronda-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  margin-bottom: var(--space-8);
}

.brand strong {
  display: block;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.brand small {
  display: block;
  margin-top: var(--space-1);
  color: var(--ronda-muted);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.brand-mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ronda-accent);
  background: var(--ronda-accent-soft);
  border: 1px solid color-mix(in oklch, var(--ronda-accent), transparent 72%);
  border-radius: 14px;
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-list,
.sidebar-secondary {
  display: grid;
  gap: var(--space-2);
}

.sidebar-secondary {
  margin-top: auto;
  padding-top: var(--space-6);
  border-top: 1px solid var(--ronda-border);
}

.nav-item,
.bottom-nav button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--ronda-text-soft);
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: background var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}

.nav-item {
  padding: var(--space-3) var(--space-4);
  text-align: left;
}

.nav-item svg,
.bottom-nav svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover,
.bottom-nav button:hover {
  color: var(--ronda-text);
  background: var(--ronda-surface-subtle);
}

.nav-item.is-active,
.bottom-nav button.is-active {
  color: var(--ronda-accent);
  background: var(--ronda-accent-soft);
  border-color: color-mix(in oklch, var(--ronda-accent), transparent 72%);
}

.nav-item-secondary {
  color: var(--ronda-muted);
}

.main-frame {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-height);
  padding: var(--space-4) var(--space-6);
  background: color-mix(in oklch, var(--ronda-bg), var(--ronda-surface) 76%);
  border-bottom: 1px solid var(--ronda-border);
  backdrop-filter: blur(12px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.eyebrow {
  margin: 0;
  color: var(--ronda-muted);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.demo-badge {
  margin: var(--space-1) 0 0;
  color: var(--ronda-text-soft);
  font-size: 13px;
  font-weight: 620;
}

.role-chip,
.ghost-button,
.secondary-button,
.primary-button,
.danger-button,
.text-button {
  min-height: 44px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.015em;
  transition: background var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard);
  touch-action: manipulation;
}

.role-chip,
.ghost-button,
.secondary-button,
.danger-button,
.text-button {
  color: var(--ronda-text);
  background: var(--ronda-surface);
  border: 1px solid var(--ronda-border);
}

.role-chip,
.ghost-button,
.secondary-button,
.primary-button,
.danger-button {
  padding: 0 var(--space-4);
}

.primary-button {
  color: oklch(100% 0 0);
  background: var(--ronda-accent);
  border: 1px solid var(--ronda-accent);
  box-shadow: 0 10px 24px color-mix(in oklch, var(--ronda-accent), transparent 78%);
}

.primary-button:hover {
  color: oklch(100% 0 0);
  background: var(--ronda-accent-hover);
  border-color: var(--ronda-accent-hover);
  transform: translateY(-1px);
}

.primary-button:active {
  color: oklch(100% 0 0);
  background: var(--ronda-accent-active);
  transform: translateY(0);
}

.secondary-button:hover,
.ghost-button:hover,
.role-chip:hover,
.danger-button:hover {
  color: var(--ronda-text);
  background: var(--ronda-surface-subtle);
  border-color: var(--ronda-border-strong);
}

.danger-button {
  color: var(--ronda-danger);
  border-color: color-mix(in oklch, var(--ronda-danger), transparent 72%);
}

.danger-button:hover {
  color: var(--ronda-danger);
  background: var(--ronda-danger-soft);
}

.text-button {
  min-height: 40px;
  padding: 0 var(--space-2);
  color: var(--ronda-accent);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.text-button:hover {
  color: var(--ronda-accent-hover);
  background: var(--ronda-accent-soft);
}

.content {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: var(--space-6);
}

.page-stack {
  display: grid;
  gap: var(--space-6);
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: end;
}

.page-header h1,
.panel h2,
.card h2,
.drawer-title {
  margin: 0;
  color: var(--ronda-text);
  font-weight: 760;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.page-header h1 {
  font-size: clamp(28px, 4vw, 38px);
}

.page-header p {
  max-width: 62ch;
  margin: var(--space-2) 0 0;
  color: var(--ronda-text-soft);
}

.header-actions,
.inline-actions,
.dialog-actions,
.filter-bar,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.month-select,
.field input,
.field select,
.field textarea,
.search-input {
  min-height: 44px;
  width: 100%;
  color: var(--ronda-text);
  background: var(--ronda-surface);
  border: 1px solid var(--ronda-border);
  border-radius: 12px;
  padding: 0 var(--space-4);
  transition: border-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard);
}

.field textarea {
  min-height: 104px;
  padding-top: var(--space-3);
  resize: vertical;
}

.month-select {
  min-width: 178px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-input:focus,
.month-select:focus {
  border-color: var(--ronda-accent);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--ronda-accent), transparent 80%);
  outline: 0;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: var(--space-4);
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.44fr);
  gap: var(--space-4);
  align-items: start;
}

.card,
.panel,
.metric-card,
.empty-state,
.notice,
.drawer-card {
  background: var(--ronda-surface);
  border: 1px solid var(--ronda-border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.card,
.panel,
.empty-state,
.notice,
.drawer-card {
  padding: var(--space-5);
}

.metric-card {
  display: grid;
  gap: var(--space-2);
  min-height: 130px;
  padding: var(--space-5);
}

.metric-card small,
.stat-label,
.section-kicker,
.table-note {
  color: var(--ronda-muted);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.metric-value {
  color: var(--ronda-text);
  font-family: var(--ronda-font-mono);
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.metric-caption,
.muted,
.helper,
.field-hint {
  color: var(--ronda-text-soft);
  font-size: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-4);
}

.panel-head h2,
.card h2 {
  font-size: 20px;
}

.chart-wrap {
  min-height: 278px;
}

.activity-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-axis,
.chart-grid {
  stroke: var(--ronda-border);
  stroke-width: 1;
}

.chart-bar {
  fill: var(--ronda-accent);
}

.chart-bar-muted {
  fill: var(--ronda-accent-soft);
}

.chart-line {
  fill: none;
  stroke: var(--ronda-text);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--ronda-surface);
  stroke: var(--ronda-text);
  stroke-width: 2;
}

.chart-label {
  fill: var(--ronda-muted);
  font-family: var(--ronda-font-body);
  font-size: 12px;
  font-weight: 650;
}

.todo-list,
.invoice-list,
.client-list,
.payment-list,
.history-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.todo-item,
.compact-row,
.mobile-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--ronda-surface);
  border: 1px solid var(--ronda-border);
  border-radius: 14px;
}

.todo-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.todo-title,
.compact-title {
  margin: 0;
  color: var(--ronda-text);
  font-weight: 720;
}

.todo-copy,
.compact-meta {
  margin: 0;
  color: var(--ronda-text-soft);
  font-size: 14px;
}

.filter-card {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--ronda-surface);
  border: 1px solid var(--ronda-border);
  border-radius: 18px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 190px));
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

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

.data-table th {
  color: var(--ronda-muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.data-table td {
  color: var(--ronda-text);
  font-size: 14px;
}

.data-table td.amount,
.data-table th.amount {
  text-align: right;
  font-family: var(--ronda-font-mono);
  font-variant-numeric: tabular-nums;
}

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

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.status-draft {
  color: var(--ronda-text-soft);
  background: var(--ronda-surface-subtle);
}

.status-review {
  color: var(--ronda-warn);
  background: var(--ronda-warn-soft);
}

.status-issued {
  color: var(--ronda-success);
  background: var(--ronda-success-soft);
}

.status-query {
  color: var(--ronda-accent-active);
  background: var(--ronda-accent-soft);
}

.status-error {
  color: var(--ronda-danger);
  background: var(--ronda-danger-soft);
}

.form-grid {
  display: grid;
  gap: var(--space-4);
}

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

.field {
  display: grid;
  gap: var(--space-2);
}

.field label,
.check-row label {
  color: var(--ronda-text);
  font-size: 13px;
  font-weight: 720;
}

.field-error {
  min-height: 20px;
  margin: 0;
  color: var(--ronda-danger);
  font-size: 13px;
  font-weight: 650;
}

.total-strip {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  background: var(--ronda-surface-blue);
  border: 1px solid color-mix(in oklch, var(--ronda-accent), transparent 76%);
  border-radius: 14px;
}

.total-strip strong {
  font-family: var(--ronda-font-mono);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stepper li {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  color: var(--ronda-muted);
  background: var(--ronda-surface);
  border: 1px solid var(--ronda-border);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 720;
}

.stepper li::before {
  content: "";
  width: 28px;
  height: 4px;
  background: var(--ronda-border);
  border-radius: var(--radius-pill);
}

.stepper li.is-active {
  color: var(--ronda-accent);
  border-color: color-mix(in oklch, var(--ronda-accent), transparent 65%);
  background: var(--ronda-accent-soft);
}

.stepper li.is-active::before,
.stepper li.is-done::before {
  background: var(--ronda-accent);
}

.monthly-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.38fr);
  gap: var(--space-4);
  align-items: start;
}

.csv-tools {
  display: grid;
  gap: var(--space-3);
}

.check-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--ronda-accent);
}

.amount-input {
  max-width: 140px;
  text-align: right;
  font-family: var(--ronda-font-mono);
  font-variant-numeric: tabular-nums;
}

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

.summary-tile {
  padding: var(--space-4);
  background: var(--ronda-surface-subtle);
  border-radius: 14px;
}

.summary-tile strong {
  display: block;
  margin-top: var(--space-1);
  font-family: var(--ronda-font-mono);
  font-size: 19px;
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
}

.empty-state h2,
.notice h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.015em;
}

.empty-state p,
.notice p {
  margin: 0;
  color: var(--ronda-text-soft);
}

.notice {
  display: grid;
  gap: var(--space-3);
  border-color: color-mix(in oklch, var(--ronda-accent), transparent 76%);
  background: var(--ronda-surface-blue);
}

.overlay-root {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--space-5);
  background: rgba(19, 28, 45, 0.5);
}

.dialog,
.drawer {
  width: min(100%, 560px);
  max-height: min(860px, calc(100dvh - 40px));
  overflow: auto;
  color: var(--ronda-text);
  background: var(--ronda-surface);
  border: 1px solid var(--ronda-border);
  border-radius: 22px;
  box-shadow: var(--shadow-panel);
}

.drawer {
  width: min(100%, 640px);
  justify-self: end;
  height: calc(100dvh - 40px);
}

.dialog-inner {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-6);
}

.drawer-head,
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.drawer-title {
  font-size: 24px;
}

.close-button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  color: var(--ronda-text-soft);
  background: var(--ronda-surface-subtle);
  border: 1px solid var(--ronda-border);
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
}

.close-button:hover {
  color: var(--ronda-text);
  background: var(--ronda-surface-blue);
  border-color: var(--ronda-border-strong);
}

.dialog-actions {
  justify-content: flex-end;
  padding-top: var(--space-3);
}

.toast-region {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 120;
  display: grid;
  gap: var(--space-2);
  width: min(360px, calc(100vw - 32px));
}

.toast {
  padding: var(--space-3) var(--space-4);
  color: var(--ronda-text);
  background: var(--ronda-surface);
  border: 1px solid var(--ronda-border);
  border-left: 4px solid var(--ronda-accent);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  font-size: 14px;
  font-weight: 650;
}

.toast-err {
  border-left-color: var(--ronda-danger);
}

.toast-warn {
  border-left-color: var(--ronda-warn);
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: start;
}

.import-tools {
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: var(--ronda-surface-subtle);
  border: 1px solid var(--ronda-border);
  border-radius: 16px;
}

.import-review {
  margin-bottom: var(--space-4);
  overflow: hidden;
}

.compact-table td,
.compact-table th {
  padding: 11px 10px;
}

.removed-rows {
  display: grid;
  gap: var(--space-3);
}

.removed-rows summary {
  min-height: 44px;
  padding: var(--space-3) 0;
  color: var(--ronda-text);
  font-weight: 720;
  cursor: pointer;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.chart-total {
  margin: var(--space-2) 0 0;
  color: var(--ronda-text-soft);
  font-size: 14px;
  font-weight: 650;
}

.chart-value-label {
  fill: var(--ronda-text);
  font-family: var(--ronda-font-mono);
}

.batch-actions {
  margin-top: var(--space-4);
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(120px, 0.32fr) minmax(0, 1fr);
  gap: var(--space-3) var(--space-4);
  margin: 0;
  padding: var(--space-4);
  background: var(--ronda-surface-subtle);
  border-radius: 14px;
}

.detail-list dt {
  color: var(--ronda-muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  color: var(--ronda-text);
  overflow-wrap: anywhere;
}

.form-grid > h2,
.drawer-card h2 {
  margin: 0;
}

.field [aria-invalid="true"] {
  border-color: var(--ronda-danger);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--ronda-danger), transparent 82%);
}

.bottom-nav {
  display: none;
}

@media (max-width: 1060px) {
  .dashboard-grid,
  .split-grid,
  .monthly-layout {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: minmax(0, 1fr) minmax(140px, 170px) minmax(140px, 170px);
  }
}

@media (max-width: 760px) {
  body {
    background: var(--ronda-bg);
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    min-height: 68px;
    padding: var(--space-3) var(--space-4);
  }

  .topbar-settings {
    display: none;
  }

  .role-chip {
    max-width: 152px;
    padding: 0 var(--space-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .content {
    padding: var(--space-4) var(--space-4) calc(94px + env(safe-area-inset-bottom));
  }

  .page-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions > *,
  .form-actions > *,
  .dialog-actions > * {
    flex: 1 1 auto;
  }

  .metrics-grid,
  .summary-grid,
  .form-grid.two,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .filter-card {
    padding: var(--space-3);
  }

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

  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .data-table tbody {
    display: grid;
    gap: var(--space-3);
  }

  .data-table tr {
    padding: var(--space-4);
    background: var(--ronda-surface);
    border: 1px solid var(--ronda-border);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border: 0;
    text-align: right;
  }

  .data-table td > .field-error,
  .data-table td > input {
    max-width: min(100%, 210px);
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--ronda-muted);
    font-family: var(--ronda-font-body);
    font-size: 12px;
    font-weight: 760;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
  }

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

  .row-actions button {
    width: 100%;
  }

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

  .dialog,
  .drawer {
    max-height: calc(100dvh - 20px);
    border-radius: 20px;
  }

  .drawer {
    height: calc(100dvh - 20px);
  }

  .dialog-inner {
    padding: var(--space-5);
  }

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

  .overlay-root {
    padding: var(--space-3);
    place-items: end center;
  }

  .toast-region {
    right: var(--space-4);
    bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .bottom-nav {
    position: fixed;
    z-index: 60;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom));
    background: color-mix(in oklch, var(--ronda-surface), var(--ronda-bg) 12%);
    border-top: 1px solid var(--ronda-border);
    box-shadow: 0 -14px 34px rgba(28, 39, 64, 0.08);
  }

  .bottom-nav button {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-height: 58px;
    padding: var(--space-1) var(--space-2);
    font-size: 11px;
    line-height: 1.1;
  }

  .bottom-nav svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 420px) {
  .topbar {
    gap: var(--space-3);
  }

  .demo-badge {
    font-size: 12px;
  }

  .page-header h1 {
    font-size: 28px;
  }

  .metric-card,
  .card,
  .panel,
  .empty-state,
  .notice {
    padding: var(--space-4);
  }

  .todo-item {
    grid-template-columns: 1fr;
  }

  .amount-input {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* Access, accounts and recipient controls share Buen Cierre's approved visual tokens. */
[hidden] { display: none !important; }
.auth-mode.app-shell { grid-template-columns: minmax(0, 1fr); }
.auth-mode .sidebar, .auth-mode .topbar-actions, body.auth-mode .bottom-nav { display: none; }
body.auth-mode .content { max-width: 1120px; padding-bottom: 40px; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); align-items: center; gap: 64px; min-height: calc(100dvh - 160px); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; font-size: 25px; }
.auth-intro h1 { max-width: 12ch; font-size: clamp(34px, 4vw, 54px); line-height: 1.08; letter-spacing: -.03em; }
.auth-intro > p { max-width: 40ch; color: var(--ronda-text-soft); }
.auth-benefits { margin: 28px 0 0; padding-left: 20px; color: var(--ronda-text-soft); }
.auth-benefits li { margin: 12px 0; }
.auth-card { padding: 28px; box-shadow: var(--shadow-card); }
.auth-card h2 { font-size: 25px; margin: 0 0 8px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--ronda-surface-subtle); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.auth-tabs button { min-height: 44px; border: 0; background: transparent; color: var(--ronda-text-soft); border-radius: 9px; font: inherit; font-weight: 650; cursor: pointer; }
.auth-tabs button.is-active { background: var(--ronda-surface); color: var(--ronda-accent-active); box-shadow: 0 1px 4px #10203816; }
.auth-card .primary-button { width: 100%; min-height: 48px; }
.auth-link { min-height: 44px; padding: 8px; color: var(--ronda-accent-active); background: none; border: none; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.auth-environment { color: var(--ronda-text-soft); font-size: 13px; text-align: center; margin: 18px 0 0; }
.auth-feedback { background: var(--ronda-success-soft); color: var(--ronda-text); padding: 12px; border-radius: 10px; }
.recipient-fields { display: grid; gap: 12px; padding: 16px; background: var(--ronda-surface-blue); border: 1px solid var(--ronda-border); border-radius: 12px; }
.recipient-fields h3 { margin: 0; font-size: 16px; }
@media (max-width: 780px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; min-height: 0; }
  .auth-intro h1 { font-size: 32px; max-width: none; }
  .auth-brand { margin-bottom: 12px; font-size: 21px; }
  .auth-benefits, .auth-intro > .eyebrow { display: none; }
  .auth-intro > p { margin-bottom: 0; max-width: none; }
  .auth-card { padding: 20px; }
  body.auth-mode .content { padding-top: 20px; }
}
