/* This app ships light-only. Same anti-flash rationale as the
   prior dark-only theme: pinning the palette in :root (and pairing
   with ``<meta name="color-scheme" content="light">`` in base.html)
   means every browser repaints identically, regardless of OS-level
   prefers-color-scheme. Every value below is tuned for ≥ 7:1 contrast
   on white per the high-contrast brief — text colours sit at
   slate-900 / slate-600 / slate-500, borders at slate-300, accents
   at indigo-700. Hardcoded reds / ambers in the templates also got
   re-keyed to darker shades suitable for white. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #d1d5db;
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --primary: #4338ca;
  --primary-hover: #3730a3;
  --positive: #15803d;
  --positive-soft: rgba(21, 128, 61, 0.10);
  --neutral-soft: rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.10);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --nav-h: 64px;
  --status-warn: #d97706;
  --status-bad: #dc2626;

  /* Extended semantic tokens (DESIGN_SYSTEM.md — literal values preserved) */
  --brand-gradient-end: #8b5cf6;
  --text-on-primary: #ffffff;

  --error: #ef4444;
  --error-text: #b91c1c;
  --error-text-dark: #991b1b;

  --status-warn-text-dark: #854d0e;

  --status-bad-soft-08: rgba(220, 38, 38, 0.08);
  --status-bad-soft-10: rgba(220, 38, 38, 0.1);
  --status-bad-soft-12: rgba(220, 38, 38, 0.12);
  --status-bad-soft-18: rgba(220, 38, 38, 0.18);
  --status-bad-border-35: rgba(220, 38, 38, 0.35);

  --status-warn-soft-12: rgba(217, 119, 6, 0.12);
  --status-warn-border-35: rgba(217, 119, 6, 0.35);

  --shadow-sticky-edge: 4px 0 8px -4px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.navbar__inner {
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.navbar__brand {
  flex-shrink: 0;
}

.navbar__spacer {
  display: none;
}

.navbar__menu-toggle {
  display: none;
  flex-shrink: 0;
  width: 40px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.navbar__menu-toggle-icon {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: var(--text-muted);
  box-shadow: 0 -5px 0 var(--text-muted), 0 5px 0 var(--text-muted);
}

@media (max-width: 1040px) {
  .navbar__inner {
    flex-wrap: wrap;
  }

  .navbar__spacer {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    height: 0;
  }

  .navbar__menu-toggle {
    display: inline-flex;
  }

  .navbar__nav.nav-actions {
    order: 5;
    flex: none;
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
    padding: 8px 0 12px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    overflow-x: visible;
  }

  .navbar--nav-open .navbar__nav.nav-actions {
    display: flex;
  }

  .navbar__nav .nav-link,
  .navbar__nav .nav-dropdown__trigger {
    width: 100%;
    justify-content: flex-start;
    border-radius: 8px;
  }

  .navbar__nav .nav-dropdown:hover .nav-dropdown__menu {
    display: none;
  }

  .navbar__nav .nav-dropdown--open .nav-dropdown__menu,
  .navbar__nav .nav-dropdown:focus-within .nav-dropdown__menu {
    display: block;
  }

  .navbar__nav .nav-dropdown__menu {
    position: static;
    margin-top: 0;
    margin-left: 8px;
    border: none;
    box-shadow: none;
    background: var(--surface-2);
  }
}

.navbar__nav {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.navbar__nav.nav-actions {
  flex-wrap: nowrap;
  justify-content: center;
  gap: 2px;
}

.navbar .nav-link,
.navbar .nav-dropdown__trigger {
  height: 34px;
  padding: 0 8px;
  font-size: 13px;
}

.navbar__account {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--brand-gradient-end));
  color: var(--text-on-primary);
  box-shadow: var(--shadow-sm);
}

.brand__name {
  font-size: 16px;
}

.navbar .brand__name {
  font-size: 14px;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--neutral-soft);
}

.nav-link.is-active {
  color: var(--text);
  background: var(--neutral-soft);
}

.nav-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.navbar__nav.nav-actions {
  justify-content: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--neutral-soft);
  border-color: var(--border);
}

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

.icon-btn.is-active {
  color: var(--text);
  background: var(--neutral-soft);
  border-color: var(--border);
}

/* ---------- Page ---------- */
.page {
  flex: 1;
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 12px;
}

.hero {
  margin-bottom: 40px;
}

.hero__title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
  background: linear-gradient(135deg, var(--text) 30%, var(--primary) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__subtitle {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card__label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.card__value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.card__hint {
  font-size: 13px;
  color: var(--text-subtle);
  margin: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.pill--positive {
  color: var(--positive);
  background: var(--positive-soft);
}

.pill--neutral {
  color: var(--text-muted);
  background: var(--neutral-soft);
}

/* ---------- Panel ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.panel__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel__hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-subtle);
}

/* ---------- Page header (hero + actions) ---------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}

.page-header .hero__title { margin-bottom: 10px; }
.page-header .hero__subtitle { margin-bottom: 0; }

.page-header__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 22px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--brand-gradient-end));
  color: var(--text-on-primary);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: var(--shadow-md);
}

.btn--primary:disabled,
.btn--primary[disabled] {
  background: var(--surface-2);
  color: var(--text-subtle);
  border-color: var(--border);
  box-shadow: none;
  filter: none;
  opacity: 1;
}

/* ---------- Error panel ---------- */
.error-panel {
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--error) 35%, var(--border));
  background: color-mix(in srgb, var(--error) 8%, var(--surface));
  border-radius: var(--radius-lg);
  color: var(--text);
}

.error-panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--error-text);
}

.error-panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.error-panel__hint {
  margin: 6px 0 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.error-panel__list {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.6;
}

.error-panel__list li { margin: 0; }

/* ---------- Projects section ---------- */
.projects-section {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 22px 6px;
}

.projects-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.projects-section__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.projects-section__meta {
  font-size: 13px;
  color: var(--text-subtle);
}

.table-scroll {
  overflow-x: auto;
  margin: 0 -22px;
  padding: 0 22px 18px;
}

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

.projects-table th,
.projects-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.projects-table thead th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.projects-table thead tr:first-child th { border-bottom: 1px solid var(--border); }

.projects-table tbody tr:last-child td { border-bottom: none; }

.th--right, .td--right { text-align: right; }
.th--center, .td--center { text-align: center; }
.th--super { color: var(--primary); }
.th--sub { font-weight: 500; text-transform: none; letter-spacing: 0; }

.th--sticky, .td--sticky {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
}
.projects-table thead .th--sticky { background: var(--surface-2); }

.td--num {
  font-variant-numeric: tabular-nums;
}

.td--muted {
  color: var(--text-subtle);
}

.months-input {
  width: 80px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.months-input:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.months-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

/* Hide number-input spinner arrows for a cleaner look */
.months-input::-webkit-outer-spin-button,
.months-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.months-input { -moz-appearance: textfield; }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .navbar__inner {
    gap: 8px;
    padding: 0 12px;
  }
  .nav-links {
    display: none;
  }
  .page {
    padding: 36px 18px 64px;
  }
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .page-header__actions {
    padding-top: 0;
  }
}

/* ---------- Dashboard chrome (LHS nav + RHS panel) ---------- */
/* Mirrors the Set Up layout grid so both top-level inner pages feel
   parallel: pick a thing on the left, edit it on the right. */
.dash-layout {
  display: grid;
  grid-template-columns: minmax(220px, 22%) 1fr;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}
@media (max-width: 820px) {
  .dash-layout { grid-template-columns: 1fr; }
}

.dash-nav {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 8px 6px;
  position: sticky;
  top: calc(var(--nav-h) + 12px);
}
.dash-nav__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  padding: 6px 10px 8px;
  margin: 0;
}
.dash-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
}
.dash-nav__link:hover {
  background: var(--neutral-soft);
  color: var(--text);
}
.dash-nav__link.is-active {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--text);
  font-weight: 600;
}
.dash-nav__count {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-subtle);
  background: var(--neutral-soft);
  padding: 0 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}
.dash-nav__link.is-active .dash-nav__count {
  background: color-mix(in srgb, var(--primary) 22%, transparent);
  color: var(--text);
}

/* ---------- Dashboard (legacy single-column layout, kept for now) ---------- */
.dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1120px;
}

.dash-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px 24px;
}

.dash-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.dash-panel__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dash-panel__badge {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--surface-2);
}

.dash-panel__lede {
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-group-total {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.dash-panel__meta {
  font-size: 14px;
  color: var(--text-muted);
}

.dash-panel__hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-muted);
}

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

.dash-table th,
.dash-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.dash-table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--surface-2);
}

.dash-table tbody tr:last-child td {
  border-bottom: none;
}

.td--strong {
  font-weight: 600;
}

.dash-flag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.dash-flag--critical {
  color: var(--error-text-dark);
  background: var(--status-bad-soft-12);
  border: 1px solid var(--status-bad-border-35);
}

.dash-flag--warning {
  color: var(--status-warn-text-dark);
  background: var(--status-warn-soft-12);
  border: 1px solid var(--status-warn-border-35);
}

.dash-flag--ok {
  color: var(--text-subtle);
  background: var(--neutral-soft);
}

.dash-empty {
  margin: 0;
  padding: 12px 0 4px;
  color: var(--text-muted);
  font-size: 14px;
}

.td--variance-neg {
  color: var(--error-text);
}

/* ---------- Login ---------- */
.login-layout {
  max-width: 440px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 28px 26px 30px;
}

.login-card__title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-card__hint {
  margin: 0 0 22px;
  font-size: 14px;
  color: var(--text-muted);
}

.card__head--stack {
  flex-direction: column;
  align-items: flex-start;
}

.card__title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card__sub {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.auth-body {
  background: var(--bg);
}

.page--narrow {
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 16px 64px;
}

.messages-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.messages-list__item {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 14px;
}

.messages-list__item--error {
  background: color-mix(in srgb, var(--status-bad) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--status-bad) 35%, var(--border));
}

.messages-list__item--success {
  background: color-mix(in srgb, var(--positive) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--positive) 35%, var(--border));
}

.messages-list__item--info,
.messages-list__item--warning {
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.field {
  display: block;
}

.field--grow {
  flex: 1 1 16rem;
  min-width: 16rem;
}

.field__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

legend.field__label {
  padding: 0;
}

.field__input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

.field__help {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.field__error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  color: var(--text);
  font-size: 14px;
}

.field__error--bare {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--status-bad);
  font-size: 0.9rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Shared page header (DESIGN_SYSTEM.md — dashboard rhythm) ---------- */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.dashboard--control > .page-head {
  margin-bottom: 0;
}

.page-head__start {
  flex: 1 1 auto;
  min-width: 0;
}

.page-head__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.page-head__lede {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-muted);
  max-width: 52rem;
}

.inline-form {
  display: inline;
}

.admin-user-form__card {
  max-width: 32rem;
}

.settings__flash[hidden] {
  display: none;
}

/* Xero OAuth tenant picker (single-use screen) */
.xero-pick {
  max-width: 560px;
  margin: 2rem auto;
}

.xero-pick__intro {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

.xero-pick__form {
  margin-top: 1.25rem;
}

.xero-pick__fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.xero-pick__radio-label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.5rem 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.xero-pick__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  align-items: center;
}

.dash-table__actions {
  white-space: nowrap;
}

.muted {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form__errors {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--status-bad-soft-08);
  border: 1px solid var(--status-bad-border-35);
  color: var(--error-text-dark);
  font-size: 14px;
}

.login-form__errors p {
  margin: 0;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.login-form input[type='text'],
.login-form input[type='password'] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.login-form input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.login-field__error {
  margin: 0;
  font-size: 13px;
  color: var(--error-text);
}

.login-submit {
  margin-top: 6px;
  width: 100%;
  justify-content: center;
}

.nav-links__dropdown {
  position: relative;
}

.nav-details {
  position: relative;
}

.nav-summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

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

.nav-summary.is-active {
  color: var(--text);
  background: var(--neutral-soft);
}

.nav-details__menu {
  list-style: none;
  margin: 6px 0 0;
  padding: 8px 0;
  min-width: 180px;
  position: absolute;
  left: 0;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.nav-details__menu a {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-muted);
}

.nav-details__menu a:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* ---------- Navbar report dropdowns ---------- */
.nav-dropdown {
  position: relative;
}

.nav-dropdown__trigger {
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.nav-dropdown__caret {
  margin-left: 2px;
  font-size: 0.75em;
  opacity: 0.75;
}

.nav-dropdown__menu {
  display: none;
  list-style: none;
  margin: 6px 0 0;
  padding: 8px 0;
  min-width: 180px;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu,
.nav-dropdown--open .nav-dropdown__menu {
  display: block;
}

.nav-dropdown__item {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown__item:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-dropdown__item.is-active {
  color: var(--text);
  background: var(--neutral-soft);
}

/* ---------- Forecast 12M ---------- */

.forecast-12m__scroll {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.forecast-12m__table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.forecast-12m__th,
.forecast-12m__cell {
  padding: 8px 10px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.forecast-12m__th--sticky,
.forecast-12m__row-label {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
  min-width: 220px;
  max-width: 320px;
  background: var(--surface);
  box-shadow: var(--shadow-sticky-edge);
}

.forecast-12m__th--corner {
  z-index: 4;
  vertical-align: bottom;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted);
}

.forecast-12m__row-label {
  font-weight: 500;
  color: var(--text);
}

.forecast-12m__month-group {
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
  border-left: 1px solid var(--border);
}

.forecast-12m__month-group--locked {
  background: color-mix(in srgb, var(--surface-2) 88%, var(--primary) 12%);
}

.forecast-12m__month-group--forecast {
  background: var(--surface-2);
}

.forecast-12m__subth {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  border-left: 1px solid var(--border);
}

.forecast-12m__subth--actual {
  background: color-mix(in srgb, var(--surface) 92%, var(--primary) 8%);
}

.forecast-12m__subth--forecast {
  background: var(--surface);
}

.forecast-12m__subth--var {
  background: color-mix(in srgb, var(--surface) 94%, var(--text-subtle) 6%);
}

.forecast-12m__cell--actual {
  background: color-mix(in srgb, var(--surface) 96%, var(--primary) 4%);
}

.forecast-12m__cell--forecast {
  background: var(--surface);
}

.forecast-12m__cell--variance {
  background: var(--surface-2);
}

.forecast-12m__cell--muted {
  color: var(--text-subtle);
  background: var(--surface-2);
}

.forecast-12m__var--bad {
  color: var(--error-text-dark);
  font-weight: 600;
  background: color-mix(in srgb, var(--status-bad-soft-18) 50%, var(--surface-2) 50%);
}

.forecast-12m__section-row th {
  padding: 12px 14px;
  font-size: 11pt;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.forecast-12m__subheader-row th {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-2) 85%, var(--surface) 15%);
  border-bottom: 1px solid var(--border);
}

.forecast-12m__data-row--total .forecast-12m__row-label,
.forecast-12m__data-row--grand .forecast-12m__row-label,
.forecast-12m__data-row--balance .forecast-12m__row-label {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
}

.forecast-12m__data-row--total .forecast-12m__cell,
.forecast-12m__data-row--grand .forecast-12m__cell {
  font-weight: 700;
  border-top: 1px solid var(--border);
}

/* ---------- Period selector (report pages) ---------- */
.period-selector {
  margin-bottom: 24px;
}

.period-selector__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.period-selector__section-label {
  margin: 12px 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.period-selector__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.period-selector__buttons .btn {
  font-size: 13px;
}

.period-selector__shortcut.is-selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.period-selector__custom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 12px;
}

.period-selector__custom-row > .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.period-selector__custom-row .field__input[type="date"],
.period-selector__custom-row .field__input[type="month"] {
  min-width: 160px;
  padding: 8px 10px;
  font-size: 14px;
}

.period-selector__custom-row .field__input[type="date"]:focus-visible,
.period-selector__custom-row .field__input[type="month"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.period-selector__custom-sep {
  padding-bottom: 8px;
  color: var(--text-muted);
}

.period-selector__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard--landing .dashboard__landing-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.dashboard__landing-actions {
  margin-bottom: 28px;
}

.dashboard__landing-actions .btn[disabled],
.dashboard__landing-actions .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Dashboard (consolidated FS period selector) ---------- */
.dashboard__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dashboard__period-error {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text);
  background: var(--status-bad-soft-10);
  border: 1px solid var(--status-bad-border-35);
}

.dashboard__section-label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.dashboard__period-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.dashboard__period-row:last-of-type {
  margin-bottom: 16px;
}

.dashboard__custom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 20px;
}

.dashboard__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.dashboard__date-input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  min-width: 11rem;
}

.dashboard__date-input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.dashboard__custom-sep {
  align-self: center;
  padding-bottom: 10px;
  color: var(--text-subtle);
  font-size: 14px;
}

.dashboard__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.dashboard__saved {
  font-size: 14px;
  font-weight: 600;
  color: var(--positive);
  visibility: hidden;
}

.dashboard__saved.is-visible {
  visibility: visible;
}

.dashboard__status-heading {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.dashboard__status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 20px;
}

.dashboard__status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.dashboard__status-dot--ok {
  background: var(--positive);
}

.dashboard__status-dot--warn {
  background: var(--status-warn);
}

.dashboard__status-dot--bad {
  background: var(--status-bad);
}

.conso-report__error {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.conso-report__error-title {
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.conso-report__error-body {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.conso-report__fetch-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--text) 35%, transparent);
}

.conso-report__fetch-overlay-inner {
  padding: 1.25rem 1.75rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.conso-report__fetch-msg {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.dashboard__status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-subtle);
}

.dashboard__status-code {
  font-weight: 600;
  color: var(--text);
}

/* ---------- Dashboard control panel ---------- */
.dashboard--control {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dashboard__pack {
  padding: 0.85rem 1rem 1rem;
}

.dashboard__pack-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.dashboard__pack-head .btn.btn--primary:disabled,
.dashboard__pack-head .btn.btn--primary[disabled] {
  background: linear-gradient(135deg, var(--primary), var(--brand-gradient-end));
  color: var(--text-on-primary);
  border-color: transparent;
  opacity: 0.42;
  box-shadow: var(--shadow-sm);
}

.dashboard__pack-head-text {
  min-width: 0;
  flex: 1;
}

.dashboard__section-title--tight {
  margin: 0 0 0.2rem;
}

.dashboard__section-lead--tight {
  margin: 0;
  font-size: 0.85rem;
}

.dashboard__pack-form {
  margin: 0;
  padding: 0;
}

.dashboard__pack-options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.dashboard__pack .dashboard__pack-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.dashboard__pack-legend {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
}

.dashboard__pack-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: baseline;
  margin: 0;
}

.dashboard__pack .dashboard__pack-entities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
}

.dashboard__pack .dashboard__pack-check {
  font-size: 0.88rem;
}

.dashboard__period-nest {
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dashboard__period-nest .period-selector.card {
  margin: 0;
  box-shadow: none;
  border: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.dashboard__period-nest .period-selector--comparative {
  margin-top: 0;
}

.dashboard__period-nest .card__head {
  padding-bottom: 0.35rem;
}

.dashboard__period-nest .period-selector__title {
  font-size: 1rem;
}

.dashboard__hero .dashboard__hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard__hero .dashboard__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
}

.dashboard__subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.dashboard__section-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.dashboard__section-lead {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.dashboard__entity-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (max-width: 1100px) {
  .dashboard__entity-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .dashboard__entity-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dashboard__entity-card {
  padding: 0.85rem 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 0;
}

.dashboard__entity-code {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.dashboard__entity-name {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.dashboard__entity-status-badge {
  margin: 0.35rem 0 0;
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.dashboard__entity-status-badge--xero {
  color: var(--positive);
  background: var(--positive-soft);
  border: 1px solid color-mix(in srgb, var(--positive) 28%, var(--border));
}

.dashboard__entity-status-badge--import {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
}

.dashboard__entity-status-badge--nodata {
  color: var(--text-muted);
  background: var(--neutral-soft);
  border: 1px solid var(--border);
}

.dashboard__entity-lines {
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dashboard__entity-line {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.35rem 0.5rem;
  align-items: center;
  margin: 0;
  font-size: 0.8rem;
}

.dashboard__entity-line-label {
  margin: 0;
  font-weight: 600;
  color: var(--text-muted);
}

.dashboard__entity-line-value {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  color: var(--text);
}

.dashboard__entity-line-value .dashboard__entity-line-state {
  flex: 1;
}

.dashboard__entity-line-icon {
  flex-shrink: 0;
  width: 1.1rem;
  text-align: center;
  font-weight: 700;
  color: var(--text-subtle);
}

.dashboard__entity-line-icon--ok {
  color: var(--positive);
}

.dashboard__entity-line-icon--empty {
  color: var(--text-subtle);
  font-weight: 600;
}

.dashboard__entity-line-period {
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard__entity-line-state {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dashboard__entity-actions {
  margin-top: auto;
  padding-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dashboard__entity-actions .btn {
  width: 100%;
  justify-content: center;
}

.dashboard__entity-connect-link {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.dashboard__entity-connect-link:hover {
  color: var(--text);
}

.dashboard__empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.missing-data-gate {
  margin-top: 1rem;
  border-color: color-mix(in srgb, var(--status-warn) 40%, var(--border));
}

.missing-data-gate__title {
  margin: 0;
  font-size: 1.05rem;
}

.missing-data-gate__body {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.missing-data-gate__actions {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.missing-data-modal {
  max-width: 28rem;
  border: 1px solid var(--border);
}

.missing-data-modal::backdrop {
  background: color-mix(in srgb, var(--text) 40%, transparent);
}

.missing-data-modal__inner {
  padding: 1rem 1.1rem;
  margin: 0;
}

.missing-data-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.missing-data-modal__body {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.missing-data-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn.is-selected {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  color: var(--text);
}

.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  pointer-events: none;
}

.btn:not(.btn--primary):disabled,
.btn:not(.btn--primary)[disabled] {
  opacity: 0.45;
}

/* ---------- Consolidated P&L / BS report table ---------- */
.conso-pl__header {
  margin-bottom: 24px;
}

.conso-pl__header-title {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.conso-pl__header-subtitle {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}

.conso-pl__header-period {
  margin: 0;
  font-size: 14px;
  color: var(--text-subtle);
}

.conso-report__switcher {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.conso-report__switcher-btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.conso-report__switcher-btn:hover {
  color: var(--text);
  background: var(--surface);
}

.conso-report__switcher-btn.is-active {
  color: var(--text);
  font-weight: 600;
  background: var(--surface-elevated);
  box-shadow: var(--shadow-sm);
}

.conso-pl__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.conso-pl__col--consolidated,
.conso-pl__th--consolidated {
  border-left: 2px solid var(--border);
}

.conso-pl__table:not(.conso-pl--m2m-edit) .conso-pl__col--m2m,
.conso-pl__table:not(.conso-pl--m2m-edit) .conso-pl__th--m2m {
  background: var(--surface-2);
  color: var(--text-subtle);
}

.conso-pl__row-label--indent {
  padding-left: 28px;
}

.conso-pl__m2m-input {
  display: none;
  width: 100%;
  min-width: 5rem;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.conso-pl__m2m-input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.conso-pl--m2m-edit .conso-pl__m2m-display {
  display: none;
}

.conso-pl--m2m-edit .conso-pl__m2m-input {
  display: block;
}

.conso-pl--entities-hidden .conso-pl__col--entity,
.conso-pl--entities-hidden .conso-pl__th--entity {
  display: none;
}

.conso-pl--comparative-hidden .conso-pl__col--comparative,
.conso-pl--comparative-hidden .conso-pl__th--comparative {
  display: none;
}

.conso-pl--m2m-column-hidden .conso-pl__col--m2m,
.conso-pl--m2m-column-hidden .conso-pl__th--m2m {
  display: none;
}

.conso-pl__col--comparative,
.conso-pl__th--comparative {
  text-align: right;
}

.conso-pl__toolbar-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.dashboard--landing > .card > .card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.xero-import-modal {
  border: none;
  padding: 0;
  max-width: min(28rem, 100vw - 2rem);
  background: transparent;
}

.xero-import-modal::backdrop {
  background: color-mix(in srgb, var(--text) 40%, transparent);
}

.xero-import-modal__panel {
  width: 100%;
}

.xero-import-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.xero-import-modal__title {
  margin: 0;
  font-size: 1.125rem;
}

.xero-import-modal__close {
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.15rem 0.45rem;
}

.xero-import-modal__form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.xero-import-modal__form .field {
  margin: 0;
}

.xero-import-modal__form .field__label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.xero-import-modal__period {
  margin: 0;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.xero-import-modal__form .field__error--bare {
  margin-top: 0.25rem;
}

.xero-import-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.conso-report__saved {
  font-size: 14px;
  font-weight: 600;
  color: var(--positive);
  visibility: hidden;
}

.conso-report__saved.is-visible {
  visibility: visible;
}

.conso-report__toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.conso-report__toast.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.conso-report__toast-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}

.conso-report__toast-link:hover,
.conso-report__toast-link:focus {
  color: var(--primary-hover);
}

.entity-report-tabs {
  margin-bottom: 1rem;
}

.entity-report-tabs__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.entity-report-tabs__tab {
  padding: 0.5rem 0.9rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.entity-report-tabs__tab:hover {
  color: var(--text);
}

.entity-report-tabs__tab.is-active {
  color: var(--text);
  border-bottom-color: var(--primary);
}

.entity-report-tabs__panel[hidden] {
  display: none !important;
}

.imported-data__warn {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: color-mix(in srgb, var(--status-warn) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--status-warn) 35%, var(--border));
  border-radius: var(--radius-md);
}

.imported-data__section-head th {
  padding: 0.5rem 0.65rem;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  color: var(--text-muted);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

.imported-data__zero-details {
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.imported-data__zero-summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
}

.imported-data__zero-scroll {
  margin-top: 0.5rem;
}

.imported-data__row--zero td,
.imported-data__row--zero th {
  color: var(--text-muted);
}

.imported-data__row--unmapped td,
.imported-data__row--unmapped th {
  background: color-mix(in srgb, var(--status-warn) 12%, var(--surface));
}

.imported-data__editor-cell {
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  vertical-align: top;
}

.imported-data__editor {
  max-width: 52rem;
}

.imported-data__inline-select {
  min-width: 12rem;
  margin: 0.25rem 0.35rem 0.25rem 0;
}

.imported-data__label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 14px;
  margin-right: 0.5rem;
}

.imported-data__readonly {
  font-weight: 600;
}

.imported-data__inline-err {
  color: var(--status-bad);
  font-size: 13px;
  margin: 0.35rem 0 0;
}

.imported-data__create-inline {
  margin-top: 0.5rem;
  padding: 0.5rem 0;
}

.imported-data__create-bs {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
}

.imported-data__create-bs-summary {
  font-weight: 600;
  cursor: pointer;
}

.imported-data__create-bs-fields {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.imported-data__hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.btn--small {
  padding: 0.25rem 0.55rem;
  font-size: 13px;
}

.conso-report__warnings {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--status-warn-border-35);
  border-radius: var(--radius-md);
  background: var(--status-warn-soft-12);
}

.conso-report__warnings-title {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--text);
}

.conso-report__warnings-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 14px;
}

.conso-report__currency {
  margin-right: 2px;
}

.conso-bs__flip-form {
  display: inline-flex;
  margin: 0;
}

/* Balance Sheet — subsection indent + flippable line toggle (shell) */
.conso-bs__row-label--subsection {
  padding-left: 28px;
}

.conso-bs__row-label--line {
  padding-left: 44px;
}

.conso-bs__row-label--with-flip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conso-bs__flip-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.conso-bs__flip-toggle:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-2));
}

.conso-bs__flip-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Mapping Manager / History ---------- */
.mapping-manager__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.mapping-manager__tab {
  margin-bottom: -1px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
}

.mapping-manager__tab:hover {
  color: var(--text);
  background: var(--neutral-soft);
}

.mapping-manager__tab.is-active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
}

.mapping-manager__panel[hidden] {
  display: none;
}

.mapping-manager__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.mapping-manager__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  flex: 1;
}

.mapping-manager__filters > .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 10rem;
}

.mapping-manager__filters .field__input {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.mapping-manager__filters .field__input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.mapping-manager__table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.mapping-manager__row.is-hidden {
  display: none;
}

.mapping-manager__row--unmapped {
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.mapping-manager__warning {
  color: var(--text-muted);
  margin-right: 4px;
}

.mapping-manager__muted {
  color: var(--text-subtle);
  font-style: italic;
}

.mapping-manager__ic-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.mapping-manager__empty {
  margin: 0;
  padding: 28px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.mapping-manager__add-panel {
  margin-top: 20px;
  max-width: 42rem;
}

.mapping-manager__add-panel-body {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mapping-manager__fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mapping-manager__radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.mapping-manager__add-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mapping-manager__title--inline {
  font-size: 1.1rem;
  margin: 0;
}

.mapping-manager__tree-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.mapping-manager__tree-toolbar .btn {
  font-size: 13px;
}

.map-tree {
  font-size: 14px;
  color: var(--text);
}

.map-tree__unmapped-block {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
  border: 1px solid var(--border);
}

.map-tree__unmapped-block.is-hidden {
  display: none;
}

.map-tree__unmapped-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.map-tree__branch {
  border-bottom: 1px solid var(--border);
}

.map-tree__branch:last-child {
  border-bottom: 0;
}

.map-tree__row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 2.25rem;
  padding: 4px 8px 4px 4px;
}

.map-tree__reorder {
  display: inline-flex;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}

.map-tree__reorder-btn {
  min-width: 1.65rem;
  padding: 2px 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

.map-tree__reorder-btn:hover {
  background: var(--neutral-soft);
  color: var(--text);
}

.map-tree__reorder-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.map-tree__row--account {
  padding-left: 2rem;
  position: relative;
}

.map-tree__row--account:hover {
  background: var(--neutral-soft);
}

.map-tree__row--account:hover .map-tree__edit-btn {
  opacity: 1;
}

.map-tree__toggle {
  flex: 0 0 1.75rem;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.map-tree__toggle:hover {
  background: var(--neutral-soft);
  color: var(--text);
}

.map-tree__toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.map-tree__toggle[aria-expanded="false"] .map-tree__chev {
  transform: rotate(-90deg);
}

.map-tree__chev {
  display: inline-block;
  transition: transform 0.15s ease;
}

.map-tree__label {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: var(--text);
}

.map-tree__label--sec {
  font-weight: 700;
  font-size: 0.95rem;
}

.map-tree__label--muted {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 13px;
}

.map-tree__meta {
  font-size: 12px;
  color: var(--text-subtle);
  margin-left: 4px;
}

.map-tree__children {
  padding-left: 0.5rem;
}

.map-tree__children[hidden] {
  display: none;
}

.map-tree__edit-btn {
  opacity: 0;
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  padding: 4px 10px;
}

.map-tree__branch.is-hidden,
.map-tree__row.is-hidden {
  display: none;
}

/* ---------- Mapping Manager: edit mapping (canonical dialog) ---------- */
.mapping-edit-dialog {
  max-width: min(28rem, 100vw - 2rem);
  width: calc(100% - 2rem);
  padding: 0;
  border: none;
}

/* Inset matches .settings__dialog-panel; block-end uses :root --radius-md for extra footer air vs the title row */
.mapping-edit-dialog.card {
  padding: 1.25rem 1.5rem calc(1.25rem + var(--radius-md));
}

.mapping-edit-dialog::backdrop {
  background: color-mix(in srgb, var(--text) 35%, transparent);
}

.mapping-edit-dialog__inner {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 100dvh - 2rem);
}

.mapping-edit-dialog__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.mapping-edit-dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mapping-edit-dialog__body #edit-pl-fields,
.mapping-edit-dialog__body #edit-bs-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mapping-edit-dialog__actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.mapping-edit-dialog__readonly {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}

.mapping-edit-dialog__section-readonly {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 14px;
}

.mapping-edit-dialog__ic-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
}

.mapping-edit-dialog__label-spaced {
  margin-top: 8px;
}

.mapping-edit-dialog .field__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.mapping-edit-dialog .field__input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.mapping-edit-dialog .field__input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.mapping-history__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
}

.mapping-history__filters > .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 10rem;
}

.mapping-history__filters .field__input {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.mapping-history__filters .field__input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

/* ---------- Settings ---------- */
.settings__page-head {
  margin-bottom: 1.5rem;
}

.settings__section-card {
  margin-bottom: 1.5rem;
}

.settings__section-card:last-child {
  margin-bottom: 0;
}

.settings__section-head {
  margin-bottom: 1rem;
}

.settings__section-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.settings__section-desc {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-muted);
  max-width: 52rem;
}

.settings__section-desc strong {
  font-weight: 600;
  color: var(--text);
}

.settings__flash {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.settings__flash--error {
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  color: var(--text);
}

.settings__flash--success {
  border: 1px solid color-mix(in srgb, var(--positive) 35%, var(--border));
  background: var(--positive-soft);
  color: var(--text);
}

.settings__table-wrap,
.imports-page__list-wrap,
.entity-imports-panel__list-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  margin-bottom: 12px;
}

.settings__row--inactive {
  opacity: 0.55;
  background: var(--surface-2);
}

.settings__row--inactive .settings__name-display {
  color: var(--text-muted);
}

.settings__code {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.settings__active-input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.settings__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settings__name-input {
  width: 100%;
  min-width: 12rem;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.settings__name-input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.settings__footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.settings__add-row[hidden] {
  display: none;
}

.settings__add-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.settings__add-form .field {
  margin: 0;
}

.settings__add-form .settings__name-input {
  width: auto;
  min-width: 14rem;
}

.settings__code-input {
  width: 6rem;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  text-transform: uppercase;
}

.settings__placeholder-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-line;
}

/* ---------- Account Setup (unmapped queue) ---------- */
.account-setup {
  max-width: 720px;
  margin: 0 auto;
}

.account-setup__header {
  margin-bottom: 24px;
}

.account-setup__badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.account-setup__title {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.account-setup__counter {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}

.account-setup__notice {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.account-setup__section-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
}

.account-setup__account {
  margin-bottom: 20px;
}

.account-setup__form {
  margin-bottom: 24px;
}

.account-setup__details {
  display: grid;
  gap: 12px;
  margin: 0;
}

.account-setup__details--compact {
  gap: 8px;
}

.account-setup__detail {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 8px 16px;
  align-items: baseline;
}

.account-setup__detail dt {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.account-setup__detail dd {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.account-setup__form .field {
  margin-bottom: 16px;
}

.account-setup__form .field__input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.account-setup__fieldset {
  margin: 0 0 16px;
  padding: 0;
  border: none;
}

.account-setup__fieldset > legend.field__label {
  margin-bottom: 8px;
}

.account-setup__radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 16px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.account-setup__radio input {
  accent-color: var(--primary);
}

.account-setup__or {
  margin: 8px 0 16px;
}

.account-setup__panel {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.account-setup__summary {
  margin-bottom: 16px;
  padding: 14px 16px;
}

.account-setup__summary-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.account-setup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

@media (max-width: 520px) {
  .account-setup__detail {
    grid-template-columns: 1fr;
  }
}

.conso-pl__cell--dash {
  color: var(--text-subtle);
}

/* ---------- Report rows: inline drill-down + line notes ---------- */
.report-row--expandable {
  cursor: pointer;
}

.report-row--expandable.is-expanded {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.report-line-note-col {
  width: 2.5rem;
  min-width: 2.5rem;
  text-align: center;
  vertical-align: middle;
}

.report-line-note-cell {
  position: relative;
  text-align: center;
  vertical-align: middle;
}

.report-line-note-cell--empty {
  background: transparent;
}

.report-line-note__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.report-line-note__icon:hover {
  background: var(--surface-2);
  color: var(--text);
}

tr.report-row--expandable:hover .report-line-note__icon {
  opacity: 1;
}

.report-line-note__marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  opacity: 1;
}

.report-line-note__marker:hover {
  background: var(--surface-2);
  color: var(--text);
}

.report-line-note__editor {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 5;
  margin-top: 4px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 220px;
}

.report-line-note__textarea {
  width: 100%;
  min-height: 72px;
  font: inherit;
  resize: vertical;
}

.report-drilldown-row__cell {
  padding: 0 0 8px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.report-drilldown-panel {
  padding: 8px 12px 12px;
}

.report-drilldown-inline__loading,
.report-drilldown-inline__empty,
.report-drilldown-inline__error {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.report-drilldown-inline__error {
  color: var(--status-bad);
}

.report-notes__subheading {
  margin: 16px 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.report-notes__line-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 14px;
  color: var(--text);
}

.report-notes__line-list li {
  margin-bottom: 6px;
}

.pdf-report-notes {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.pdf-report-notes__title {
  margin: 0 0 8px;
  font-size: 14px;
}

.pdf-report-notes__general {
  font-size: 12px;
  white-space: pre-wrap;
}

.pdf-drilldown-subrow__label {
  font-weight: 400;
  color: var(--text-muted);
  padding-left: 12px !important;
}

.pdf-drilldown-subrow .forecast-12m__cell {
  font-size: 12px;
  color: var(--text-muted);
}

.report-row--drillable:hover {
  background: var(--neutral-soft);
}

/* ---------- Report notes (screen only) ---------- */
.report-notes {
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.report-notes__bar {
  padding: 8px 12px;
}

.report-notes__expandable {
  padding: 0 14px 14px;
}

.report-notes__label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.report-notes__textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  resize: vertical;
  min-height: 96px;
  background: var(--surface);
  color: var(--text);
}

.report-notes__textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.report-notes__hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-subtle);
}

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

.btn--ghost:hover {
  border-color: var(--border);
  background: var(--neutral-soft);
}

/* ---------- Recent activity ---------- */
.activity-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.activity-page__page-head {
  margin-bottom: 1.25rem;
}

.activity-page__filters {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.activity-page__fieldset {
  margin: 0 0 14px;
  padding: 0;
  border: none;
}

.activity-page__legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.activity-page__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.activity-page__check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}

.activity-page__dates {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 14px 0;
}

.activity-page__dates > .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-page__dates .field__input[type="date"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}

.activity-page__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.activity-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity-timeline__item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.activity-timeline__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--neutral-soft);
  color: var(--primary);
  font-size: 16px;
}

.activity-timeline__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
}

.activity-timeline__time {
  font-size: 13px;
  color: var(--text-subtle);
}

.activity-timeline__action {
  font-size: 14px;
  font-weight: 600;
}

.activity-timeline__entity {
  margin: 6px 0 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.activity-timeline__desc {
  margin: 0;
  font-size: 14px;
}

.activity-timeline__empty {
  padding: 24px 0;
  color: var(--text-muted);
}

.activity-page__pager {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Imports list (single card — DATA_MODEL imported_amounts batches) */
.imports-page__head {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.imports-page__head .page-head {
  margin-bottom: 0;
}

.imports-page__import-btn {
  flex-shrink: 0;
}

.imports-page__lead {
  font-size: 14px;
}

.imports-page__filters {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.imports-page__filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}

.imports-page__filter-row > .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 12rem;
}

.imports-page__filter-row .field__input {
  min-width: 12rem;
}

.imports-page__scroll {
  margin-top: 0.75rem;
}

.imports-page__col-num {
  text-align: right;
}

.imports-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.imports-page__delete-form {
  display: inline;
}

.imports-page__empty {
  padding: 1rem 0;
  color: var(--text-muted);
}

.import-batch-detail {
  max-width: 28rem;
  width: calc(100% - 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
}

.import-batch-detail::backdrop {
  background: color-mix(in srgb, var(--text) 40%, transparent);
}

.import-batch-detail__inner {
  padding: 1.1rem 1.2rem 1.15rem;
}

.import-batch-detail__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.import-batch-detail__list {
  margin: 0;
  padding: 0;
}

.import-batch-detail__row {
  display: grid;
  grid-template-columns: minmax(7rem, 42%) 1fr;
  gap: 0.25rem 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  font-size: 0.88rem;
}

.import-batch-detail__row dt {
  margin: 0;
  font-weight: 600;
  color: var(--text-muted);
}

.import-batch-detail__row dd {
  margin: 0;
  word-break: break-word;
}

.import-batch-detail__actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Dashboard recent activity */
.dashboard__activity {
  margin-top: 1.5rem;
}

.dashboard__activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dashboard__activity-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(5.5rem, 7rem) 5.5rem 1fr;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  font-size: 0.8rem;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .dashboard__activity-row {
    grid-template-columns: 7rem 1fr;
    grid-template-rows: auto auto;
  }
  .dashboard__activity-time {
    grid-column: 1;
  }
  .dashboard__activity-type {
    grid-column: 2;
    justify-self: end;
    text-align: right;
  }
  .dashboard__activity-entity {
    grid-column: 1;
  }
  .dashboard__activity-desc {
    grid-column: 1 / -1;
  }
}

.dashboard__activity-time {
  font-size: 0.72rem;
  color: var(--text-subtle);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dashboard__activity-type {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  min-width: 0;
}

.dashboard__activity-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1;
}

.dashboard__activity-label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.78rem;
}

.dashboard__activity-entity {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.dashboard__activity-desc {
  color: var(--text-muted);
  min-width: 0;
}

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

.period-selector--comparative {
  margin-top: 1rem;
}

.period-selector__comp-fields {
  margin-top: 0.75rem;
}

/* Entity report — imports sidebar */
.entity-imports-panel {
  margin-bottom: 1rem;
}

.entity-imports-panel__summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.35rem 0;
}

.entity-imports-panel__body {
  padding-top: 0.5rem;
}

.entity-imports-panel__list-wrap {
  margin-bottom: 0;
}

.entity-imports-panel__num {
  text-align: right;
}

.entity-imports-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.entity-imports-panel__delete {
  display: inline;
}

.entity-imports-panel__empty {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.entity-imports-panel__footer {
  margin: 8px 0 0;
  font-size: 13px;
}

/* Import modal — reporting period blocks */
.xero-import-modal__post-preview {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.xero-import-modal__section-title {
  margin: 0.75rem 0 0.25rem;
  font-weight: 600;
  font-size: 14px;
}

.xero-import-modal__hint {
  margin: 0 0 0.5rem;
  font-size: 13px;
  color: var(--text-muted);
}

.xero-import-modal__period-block {
  margin-bottom: 0.75rem;
}

.xero-import-modal__date-row {
  margin-top: 0.5rem;
}

.report-map-unmapped {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ---------- Publish title modal (report toolbar) ---------- */
.publish-title-modal,
.mapping-dialog {
  max-width: 26rem;
  width: calc(100% - 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  box-shadow: var(--shadow-md);
}

.mapping-dialog--lg {
  max-width: 36rem;
}

.publish-title-modal::backdrop,
.mapping-dialog::backdrop {
  background: color-mix(in srgb, var(--text) 40%, transparent);
}

.publish-title-modal__inner,
.mapping-dialog__inner {
  padding: 1.1rem 1.2rem 1.15rem;
}

.publish-title-modal__title,
.mapping-dialog__title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.publish-title-modal__lead,
.mapping-dialog__lead {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.publish-title-modal .field,
.mapping-dialog .field {
  margin-bottom: 1rem;
}

.publish-title-modal .field__input,
.mapping-dialog .field__input {
  padding: 8px 10px;
  font-size: 14px;
}

.publish-title-modal .field__input:focus-visible,
.mapping-dialog .field__input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.publish-title-modal .field__label,
.mapping-dialog .field__label {
  font-size: 0.82rem;
  font-weight: 600;
}

.publish-title-modal__actions,
.mapping-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.mapping-dialog__fieldset {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mapping-dialog__radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.mapping-dialog__ic-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- Published reports list ---------- */
.published-reports__page-head {
  margin-bottom: 1.25rem;
}

.published-reports__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin: 1.25rem 0;
}

.published-reports__filters > .field {
  min-width: 10rem;
}

.published-reports__filters .field__input {
  min-width: 10rem;
}

.published-reports__scroll {
  margin-top: 0.5rem;
}

.published-reports__cell--muted {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.published-reports__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.published-reports__delete-form {
  display: inline;
}

.published-reports__row {
  cursor: pointer;
}

.published-reports__row:hover {
  background: var(--surface-2);
}

.published-report-detail {
  max-width: 28rem;
  width: calc(100% - 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
}

.published-report-detail::backdrop {
  background: color-mix(in srgb, var(--text) 40%, transparent);
}

.published-report-detail__inner {
  padding: 1.1rem 1.2rem 1.15rem;
}

.published-report-detail__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.published-report-detail__list {
  margin: 0;
  padding: 0;
}

.published-report-detail__row {
  display: grid;
  grid-template-columns: minmax(7rem, 42%) 1fr;
  gap: 0.25rem 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  font-size: 0.88rem;
}

.published-report-detail__row dt {
  margin: 0;
  font-weight: 600;
  color: var(--text-muted);
}

.published-report-detail__row dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}

.published-report-detail__actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

/* Entity scope modal (LOGIC.md §1) — same shell as .publish-title-modal */
.entity-scope-modal {
  max-width: min(37.5rem, calc(100% - 2rem));
  width: calc(100% - 2rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.entity-scope-modal::backdrop {
  background: color-mix(in srgb, var(--text) 40%, transparent);
}

.entity-scope-modal.card:hover {
  transform: none;
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.entity-scope-modal__inner {
  padding: 1.1rem 1.2rem 1.15rem;
}

.entity-scope-modal__title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.entity-scope-modal__lead {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.entity-scope-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.entity-scope-modal__label,
.entity-scope-modal__legend {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.entity-scope-modal__legend {
  margin-bottom: 0.5rem;
}

.entity-scope-modal__select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
}

.entity-scope-modal__select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.entity-scope-modal__selected-block {
  margin-bottom: 1rem;
}

.entity-scope-modal__selected-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.entity-scope-modal__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.15rem 0;
}

.entity-scope-modal__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--primary) 14%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.entity-scope-modal__pill:hover {
  background: color-mix(in srgb, var(--primary) 20%, var(--surface-2));
  border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
}

.entity-scope-modal__pill-code {
  padding: 0 0.1rem 0 0;
  user-select: none;
}

.entity-scope-modal__pill-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 0.15rem;
  min-width: 1.35rem;
  min-height: 1.35rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.entity-scope-modal__pill-remove:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}

.entity-scope-modal__pill-remove:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.entity-scope-modal__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 0.25rem;
}

.entity-scope-modal__add-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 8rem;
}

.entity-scope-modal__add.entity-scope-modal__add {
  padding-inline: 10px;
}

.entity-scope-modal__add-dropdown {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 3;
  min-width: min(100%, 14rem);
  max-width: 18rem;
  max-height: 12rem;
  overflow-y: auto;
  padding: 0.35rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.entity-scope-modal__add-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.entity-scope-modal__add-option:hover {
  background: var(--surface-2);
}

.entity-scope-modal__add-option:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.entity-scope-modal__add-empty {
  padding: 0.5rem 0.65rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.entity-scope-modal__footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Dashboard + consolidated toolbar: entity scope trigger */
.select-entities-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.select-entities-btn__icon {
  display: inline-flex;
  font-size: 0.55rem;
  line-height: 1;
  opacity: 0.72;
  transform: translateY(1px);
}

.select-entities-btn__text {
  text-align: left;
}

.dashboard__pack-entities--modal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.settings__section-lead {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.settings__dialog {
  padding: 0;
  border: none;
  max-width: min(32rem, 100vw - 2rem);
  background: transparent;
}

.settings__dialog::backdrop {
  background: color-mix(in srgb, var(--text) 35%, transparent);
}

.settings__dialog-panel {
  padding: 1.25rem 1.5rem;
}

.settings__dialog-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.settings__dialog-panel .field {
  margin-bottom: 1rem;
}

.settings__dialog-panel .field__input {
  padding: 0.45rem 0.5rem;
}

.settings__dialog-fieldset {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}

.settings__dialog-fieldset > legend.field__label {
  margin-bottom: 0.5rem;
}

.settings__entity-group-checks {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-start;
}

.settings__entity-groups-empty {
  text-align: center;
  vertical-align: middle;
  padding: 2rem 1.25rem 2.25rem;
  color: var(--text-muted);
}

.settings__entity-groups-empty-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.settings__entity-groups-empty-hint {
  margin: 0 auto;
  max-width: 22rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.settings__row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.settings__dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
