/* RNF Web App - styles
   Brand: RNF logo navy (#003352), white, teal accents, light grey background. */

:root {
  --navy-950: #00243b;
  --navy-900: #003352;
  --navy-800: #0a4468;
  --navy-700: #1a5a85;
  --navy-100: #e2ecf3;
  --navy-50: #f1f6fa;
  /* Accent = emerald, as on rnfbusinesssolutions.com (names kept as "teal" so existing rules still apply) */
  --teal-700: #047857;
  --teal-600: #059669;
  --teal-500: #34d399;
  --teal-100: #d1fae5;
  --teal-50: #ecfdf5;
  --emerald: #10b981;

  --bg: #f3f6fb;
  --surface: #ffffff;
  --border: #e3e8ef;
  --border-strong: #cfd7e3;
  --text: #0f1b2d;
  --text-2: #44546a;
  --muted: #64748b;

  --good: #15803d;
  --good-bg: #ecfdf3;
  --info: #1d4e89;
  --info-bg: #eef4fc;
  --warning: #a14a06;
  --warning-bg: #fff6e8;
  --critical: #b42318;
  --critical-bg: #fef1f0;
  --neutral: #52627a;
  --neutral-bg: #f1f4f8;

  --demo-bg: #fff4d6;
  --demo-border: #f5d58a;
  --demo-text: #7a4b00;

  --aging-0: #a7c0d3;
  --aging-1: #6890ae;
  --aging-2: #2f6189;
  --aging-3: #003352;
  --font-brand: 'Outfit', 'Plus Jakarta Sans', 'Segoe UI', Arial, sans-serif;
  --hero-photo: url("https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&w=1600&q=70");

  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.04), 0 4px 14px rgba(15, 27, 45, 0.05);
  --shadow-lg: 0 20px 50px rgba(7, 26, 51, 0.18);
  --sidebar-w: 260px;
  --font: 'Plus Jakarta Sans', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.modal-open, body.menu-open { overflow: hidden; }

h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--teal-700); }
button { font-family: inherit; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }

:focus-visible { outline: 3px solid rgba(16, 185, 129, 0.45); outline-offset: 2px; }

.muted { color: var(--muted); }

/* ------------------------------ Buttons ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-lg { min-height: 48px; font-size: 15px; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--navy-900); color: #fff; }
.btn-primary:hover { background: var(--navy-800); }

.btn-secondary { background: #fff; color: var(--navy-900); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--navy-700); background: var(--navy-50); }

.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--navy-50); color: var(--navy-900); }

.btn-demo { background: var(--teal-50); color: var(--teal-700); border-color: var(--teal-500); }
.btn-demo:hover { background: var(--teal-100); }
.btn-demo.is-loading { opacity: 0.7; }

.btn-warning-soft { background: var(--warning-bg); color: var(--warning); border-color: #f3c98b; }
.btn-warning-soft:hover { background: #ffeccc; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(127, 145, 170, 0.14); }
.icon-btn .icon { width: 20px; height: 20px; }

/* ------------------------------ Badges ------------------------------- */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  vertical-align: middle;
}
.tag-demo { background: var(--demo-bg); color: var(--demo-text); border: 1px solid var(--demo-border); }
.tag-live { background: var(--good-bg); color: var(--good); border: 1px solid #a6e3bd; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill .icon { width: 14px; height: 14px; }
.pill-good { background: var(--good-bg); color: var(--good); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-warning { background: var(--warning-bg); color: var(--warning); }
.pill-critical { background: var(--critical-bg); color: var(--critical); }
.pill-neutral { background: var(--neutral-bg); color: var(--neutral); }

/* ------------------------------- Brand ------------------------------- */

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0, 36, 59, 0.25); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--font-brand); font-size: 16px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; }
.brand-text span { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 3px; }

.brand-light .brand-logo { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12); }
.brand-light .brand-text strong { color: #fff; }
.brand-light .brand-text span { color: var(--teal-500); }
.brand-dark .brand-text strong { color: var(--navy-900); }
.brand-dark .brand-text span { color: var(--teal-700); }

/* ------------------------------- Login ------------------------------- */

.login-page {
  display: grid;
  grid-template-columns: minmax(380px, 5fr) 7fr;
  min-height: 100vh;
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 48px 56px;
  color: #dbe6f4;
  background:
    radial-gradient(circle at 85% 10%, rgba(16, 185, 129, 0.16), transparent 45%),
    var(--navy-900);
}
.login-brand-body { max-width: 440px; }
.login-brand h1 { color: #fff; font-size: 34px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 16px; }
.login-brand-body > p { font-size: 16px; color: #b8c9df; margin-bottom: 36px; }
.login-features { display: grid; gap: 22px; }
.login-features li { display: flex; gap: 14px; align-items: flex-start; }
.login-features strong { display: block; color: #fff; font-size: 15px; margin-bottom: 2px; }
.login-features span { font-size: 14px; color: #a9bdd8; }
.login-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.14);
  color: var(--teal-500);
}
.login-feature-icon .icon { width: 20px; height: 20px; }
.login-brand-foot { font-size: 13px; color: #8aa3c4; }

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: var(--surface);
}
.login-card { width: 100%; max-width: 420px; }
.login-mobile-brand { display: none; margin-bottom: 28px; }
.login-card h2 { font-size: 28px; font-weight: 700; color: var(--navy-900); letter-spacing: -0.01em; }
.login-card > .muted { margin: 6px 0 28px; }

.form { display: grid; gap: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-wrap > .icon { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.input-wrap input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px 0 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
}
.input-wrap:focus-within { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.input-wrap.has-error { border-color: var(--critical); }
.input-wrap.has-error:focus-within { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.14); }
.input-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.input-action:hover { color: var(--navy-900); }
.field-error { min-height: 0; margin-top: 6px; font-size: 13px; color: var(--critical); }
.field-error:empty { display: none; }

.form-alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--info-bg);
  color: var(--navy-800);
  font-size: 14px;
  border: 1px solid #cddcf0;
}
.form-alert[hidden] { display: none; }
.form-alert .icon { margin-top: 1px; color: var(--info); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 13px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.demo-note {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--demo-bg);
  border: 1px solid var(--demo-border);
  color: var(--demo-text);
  font-size: 13px;
}
.demo-note .icon { margin-top: 1px; }

/* ------------------------------- Shell ------------------------------- */

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 16px;
  background: var(--demo-bg);
  border-bottom: 1px solid var(--demo-border);
  color: var(--demo-text);
  font-size: 13.5px;
  text-align: center;
}
.demo-banner strong { letter-spacing: 0.04em; }

.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: var(--sidebar-w);
  height: 100vh;
  padding: 24px 16px 16px;
  background: var(--navy-900);
  color: #c4d3e6;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 28px; }
.sidebar-close { display: none; color: #fff; }

.nav { display: grid; gap: 14px; overflow-y: auto; margin: 0 -8px; padding: 0 8px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent; }
.nav-group { display: grid; gap: 2px; }
.nav-group-label { padding: 0 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #7f97b8; }
.nav .nav-link { min-height: 38px; padding: 7px 12px; font-size: 14px; }
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--teal-500); color: var(--navy-950); font-size: 11px; font-weight: 700; text-align: center; }
.nav-badge[hidden] { display: none; }
.shell-rnf .sidebar { background: linear-gradient(180deg, #003352 0%, #003a4e 60%, #004450 100%); }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #c4d3e6;
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-link.is-active { background: rgba(16, 185, 129, 0.14); color: #fff; box-shadow: inset 3px 0 0 var(--teal-500); }
.nav-link.is-active .icon { color: var(--teal-500); }
.nav-soon {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #9fb6d3;
  font-size: 11px;
  font-weight: 600;
}

.sidebar-footer { margin-top: auto; display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.company-chip { display: flex; align-items: center; gap: 10px; padding: 8px; }
.company-chip-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.company-chip-text strong { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-chip-text span { font-size: 12px; color: #9fb6d3; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal-500);
  color: var(--navy-950);
  font-size: 13px;
  font-weight: 700;
}
.avatar-sm { width: 34px; height: 34px; font-size: 12px; }

.sidebar-overlay { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.main-head { position: sticky; top: 0; z-index: 30; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.menu-btn { display: none; color: var(--navy-900); margin-left: -8px; }
.topbar-title { font-size: 18px; font-weight: 700; color: var(--navy-900); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.content { flex: 1; outline: none; }
.page { max-width: 1320px; margin: 0 auto; padding: 28px 32px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }

.app-footer { padding: 16px 32px 24px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ------------------------------- Cards ------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  min-width: 0;
}
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-title { font-size: 16.5px; font-weight: 700; color: var(--navy-900); }
.card-subtitle { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.card-header-right { flex-shrink: 0; }

.mini-heading { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 20px 0 10px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: 24px; align-items: start; }

/* ------------------------------ Welcome ------------------------------ */

.welcome { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--teal-700); letter-spacing: 0.02em; margin-bottom: 4px; }
.welcome-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.01em;
}
.welcome-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; font-size: 13.5px; color: var(--text-2); }
.welcome-meta li { display: flex; align-items: center; gap: 7px; }
.welcome-meta .icon { width: 16px; height: 16px; color: var(--muted); }
.welcome-meta strong { color: var(--text); font-weight: 600; }

/* ---------------------------- Stat cards ----------------------------- */

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.stat-card {
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.stat-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
}
.stat-icon .icon { width: 19px; height: 19px; }
.stat-icon-teal { background: var(--teal-50); color: var(--teal-700); }
.stat-icon-navy { background: var(--navy-100); color: var(--navy-800); }
.stat-icon-good { background: var(--good-bg); color: var(--good); }
.stat-icon-critical { background: var(--critical-bg); color: var(--critical); }
.stat-label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}
.stat-value.is-negative { color: var(--critical); }
.stat-hint { margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.stat-foot {
  margin-top: auto;
  padding-top: 12px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.stat-foot-warning { color: var(--warning); }
.stat-foot-good { color: var(--good); }

/* ------------------------------- Chart ------------------------------- */

.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

.bar-sales { fill: var(--teal-600); background: var(--teal-600); }
.bar-expenses { fill: var(--navy-800); background: var(--navy-800); }

.chart-area { position: relative; width: 100%; min-height: 240px; overflow: hidden; }
.chart-area[hidden] { display: none; }
.chart-svg { display: block; overflow: visible; }
.chart-grid { stroke: #e9edf3; stroke-width: 1; }
.chart-baseline { stroke: var(--border-strong); }
.chart-axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-band { fill: var(--navy-50); }

.chart-tooltip {
  position: absolute;
  top: 0;
  z-index: 5;
  display: grid;
  gap: 4px;
  min-width: 200px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(15, 27, 45, 0.12);
  font-size: 13px;
  pointer-events: none;
}
.chart-tooltip[hidden] { display: none; }
.chart-tooltip strong { color: var(--navy-900); margin-bottom: 2px; }
.tip-row { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.tip-row b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.tip-total { padding-top: 4px; border-top: 1px solid var(--border); }

.chart-note { margin-top: 14px; font-size: 13px; color: var(--muted); }

.table-wrap { position: relative; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.data-table thead th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--navy-50); }
.data-table tbody th { font-weight: 600; color: var(--text); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.is-negative { color: var(--critical); }

/* ------------------------------- Tasks ------------------------------- */

.task-list { display: grid; }
.task {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.task:first-child { border-top: 0; padding-top: 0; }
.task-main strong { display: block; font-size: 14.5px; font-weight: 600; color: var(--text); }
.task-meta { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.task-meta .icon { width: 14px; height: 14px; }
.task-side { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.task.is-done .task-main strong { color: var(--muted); text-decoration: line-through; }
.empty-inline { color: var(--muted); font-size: 14px; }

/* ------------------------- Accounting Journey ------------------------ */

.journey-progress { margin-bottom: 24px; }
.journey-progress-text { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; color: var(--text-2); }
.journey-progress-text strong { color: var(--text); }
.progress { height: 8px; border-radius: 999px; background: var(--navy-100); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 999px; background: var(--teal-500); }

.journey { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 16px; counter-reset: step; }
.journey-step:nth-child(4n)::after { display: none; }
.journey-step { position: relative; display: flex; flex-direction: column; gap: 12px; }
.journey-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 21px;
  left: 52px;
  right: -10px;
  height: 2px;
  background: var(--border);
}
.journey-step.is-done:not(:last-child)::after { background: var(--teal-500); }
.journey-marker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: #fff;
  color: var(--muted);
}
.journey-marker .icon { width: 20px; height: 20px; }
.is-done .journey-marker { background: var(--teal-600); border-color: var(--teal-600); color: #fff; }
.is-progress .journey-marker { border-color: var(--navy-700); color: var(--navy-700); background: var(--info-bg); }
.is-action .journey-marker { border-color: #e89a3c; color: var(--warning); background: var(--warning-bg); }
.journey-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.journey-step-no { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.journey-body h3 { font-size: 14.5px; font-weight: 700; color: var(--navy-900); line-height: 1.3; }
.journey-body p { font-size: 13px; color: var(--text-2); }
.journey-date { font-size: 12px; color: var(--muted); }

/* --------------------------- AR / AP --------------------------------- */

.arap-intro {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: -4px;
}
.arap-intro .icon { margin-top: 2px; color: var(--navy-700); }
.arap-intro strong { color: var(--navy-900); }

.arap-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.arap-totals > div { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--navy-50); }
.arap-caption { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.arap-caption .icon { width: 15px; height: 15px; }
.arap-total, .arap-overdue-value { font-size: 22px; font-weight: 700; color: var(--navy-900); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.arap-totals small { font-size: 12.5px; color: var(--muted); }
.arap-overdue.has-overdue { background: var(--warning-bg); }
.arap-overdue.has-overdue .arap-caption, .arap-overdue.has-overdue .arap-overdue-value { color: var(--warning); }
.arap-overdue:not(.has-overdue) .arap-caption .icon { color: var(--good); }

.aging-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--neutral-bg); }
.aging-seg { flex-basis: 0; min-width: 4px; }
.aging-0 { background: var(--aging-0); }
.aging-1 { background: var(--aging-1); }
.aging-2 { background: var(--aging-2); }
.aging-3 { background: var(--aging-3); }

.aging-list { display: grid; margin-top: 10px; }
.aging-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.aging-list li:last-child { border-bottom: 0; }
.aging-label { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 500; }
.aging-label small { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.aging-amount { font-variant-numeric: tabular-nums; font-weight: 600; }

.largest-list { display: grid; }
.largest-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.largest-list li { min-width: 0; }
.largest-list li > span:first-child { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.largest-list strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.largest-list small { font-size: 12.5px; color: var(--muted); }
.largest-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; }

/* ----------------------------- Activities ---------------------------- */

.activity-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
.activity { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--border); }
.activity-list .activity:nth-child(-n+2) { border-top: 0; padding-top: 0; }
.activity-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; }
.tone-teal { background: var(--teal-50); color: var(--teal-700); }
.tone-navy { background: var(--navy-100); color: var(--navy-800); }
.tone-good { background: var(--good-bg); color: var(--good); }
.tone-warning { background: var(--warning-bg); color: var(--warning); }
.activity-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.activity-type { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.activity-body strong { font-size: 14.5px; font-weight: 600; color: var(--text); }
.activity-body small { font-size: 13px; color: var(--text-2); }
.activity-time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* --------------------------- Empty / error --------------------------- */

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 56px 24px; }
.empty-state h2 { font-size: 20px; color: var(--navy-900); }
.empty-state p { max-width: 460px; color: var(--text-2); }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 16px; background: var(--teal-50); color: var(--teal-700); }
.empty-icon .icon { width: 26px; height: 26px; }
.error-state .empty-icon { background: var(--critical-bg); color: var(--critical); }

.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, #e9edf3 0%, #f3f5f9 50%, #e9edf3 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton-title { height: 64px; max-width: 460px; }
.skeleton-card { height: 150px; }
.skeleton-block { height: 320px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ------------------------------- Modal ------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(7, 26, 51, 0.5);
}
.modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 0 24px; }
.modal-header h2 { font-size: 18px; color: var(--navy-900); padding-top: 8px; }
.modal-body { display: grid; gap: 14px; padding: 12px 24px 20px; color: var(--text-2); font-size: 14.5px; }
.modal-body .demo-note { margin-top: 0; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--navy-50); border-radius: 0 0 16px 16px; }
.task-detail-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13.5px; }
.task-detail-meta > span:last-child { display: inline-flex; align-items: center; gap: 6px; }
.task-detail-meta .icon { width: 15px; height: 15px; }
.detail-list { display: grid; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.detail-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 14px; }
.detail-list li:first-child { border-top: 0; }
.detail-list strong { color: var(--text); font-variant-numeric: tabular-nums; }

.upload-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--navy-800);
}
.upload-box:hover { border-color: var(--teal-500); background: var(--teal-50); }
.upload-box span { display: flex; flex-direction: column; }
.upload-box small { color: var(--muted); }
.upload-box input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-chosen { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.upload-chosen[hidden] { display: none; }

/* ------------------------------- Toast ------------------------------- */

#toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; max-width: min(400px, calc(100vw - 32px)); }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.3s, transform 0.3s;
}
.toast .icon { margin-top: 1px; }
.toast-good .icon { color: var(--teal-500); }
.toast-critical { background: var(--critical); }
.toast-hide { opacity: 0; transform: translateY(8px); }

/* --------------------------- Page sections --------------------------- */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 24px; font-weight: 700; color: var(--navy-900); letter-spacing: -0.01em; }
.page-desc { margin-top: 4px; color: var(--text-2); font-size: 14.5px; max-width: 640px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--navy-100); border-radius: 12px; width: fit-content; max-width: 100%; }
.tab {
  min-height: 40px;
  padding: 8px 18px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover { color: var(--navy-900); }
.tab.is-active { background: #fff; color: var(--navy-900); box-shadow: 0 1px 3px rgba(15, 27, 45, 0.1); }

.mini-stats { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 16px; }
.mini-stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.mini-stat span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.mini-stat strong { font-size: 22px; font-weight: 700; color: var(--navy-900); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-stat-warning { background: var(--warning-bg); border-color: #f3d3a5; }
.mini-stat-warning strong, .mini-stat-warning span { color: var(--warning); }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-count, .toolbar-hint { font-size: 13px; color: var(--muted); }
.toolbar-count { margin-left: auto; }
.toolbar-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  max-width: 380px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
}
.search-box:focus-within { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.search-box .icon { position: absolute; left: 12px; color: var(--muted); }
.search-box input { width: 100%; height: 40px; padding: 0 12px 0 38px; border: 0; background: transparent; font: inherit; font-size: 14px; outline: none; border-radius: var(--radius-sm); }

.select-box { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; font-size: 13px; color: var(--text-2); font-weight: 500; }
.select-box select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.select-box select, .input-plain select {
  height: 40px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.select-box select:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.select-box select:disabled { background-color: var(--neutral-bg); color: var(--muted); cursor: not-allowed; }

.input-plain input, .input-plain select { padding-left: 14px; }
.input-plain select { width: 100%; border: 0; height: 46px; }
.input-plain input[readonly], .input-plain select:disabled { color: var(--text-2); background-color: var(--neutral-bg); border-radius: var(--radius-sm); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.responsive-table td, .responsive-table th { vertical-align: middle; }
.responsive-table tbody tr:hover { background: var(--navy-50); }
.doc-no { font-weight: 600; color: var(--navy-800); font-variant-numeric: tabular-nums; }
.cell-party { white-space: normal; min-width: 180px; }
.overdue-note { display: block; font-size: 12px; color: var(--critical); font-weight: 500; }
.cell-stack { display: flex; flex-direction: column; line-height: 1.35; }
.cell-sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.doc-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; white-space: normal; min-width: 220px; }
.doc-name .icon { color: var(--muted); }
.cell-action { text-align: right; }

.empty-compact { padding: 40px 16px; }

/* ------------------------- Financial reports ------------------------- */

.report-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.report-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  color: var(--text);
}
.report-option:hover { border-color: var(--teal-500); }
.report-option.is-active { border-color: var(--teal-600); box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.25); background: var(--teal-50); }
.report-option strong { display: block; font-size: 14.5px; color: var(--navy-900); }
.report-option small { display: block; font-size: 12.5px; color: var(--muted); }
.report-option-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; background: var(--navy-100); color: var(--navy-800); }
.report-option.is-active .report-option-icon { background: var(--teal-600); color: #fff; }

.report-controls { padding-bottom: 16px; border-bottom: 1px solid var(--border); }

.report-doc { max-width: 860px; margin: 0 auto; }
.report-demo-banner {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 24px;
  border: 1px dashed #e0b45c;
  border-radius: var(--radius-sm);
  background: var(--demo-bg);
  color: var(--demo-text);
  font-size: 13.5px;
}
.report-demo-banner .icon { margin-top: 1px; }
.report-doc-head { text-align: center; margin-bottom: 20px; }
.report-company { font-size: 14px; font-weight: 600; color: var(--text-2); }
.report-doc-head h2 { font-size: 22px; color: var(--navy-900); margin: 2px 0; }
.report-date { font-size: 13.5px; color: var(--muted); }

.report-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-table thead th { padding: 8px 10px; border-bottom: 2px solid var(--navy-900); font-size: 12.5px; color: var(--text-2); font-weight: 600; text-align: left; white-space: nowrap; }
.report-table th, .report-table td { padding: 7px 10px; text-align: left; font-weight: 400; }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; width: 150px; }
.report-table-multi .num { width: 120px; }
.rt-line th { padding-left: 24px; color: var(--text); }
.report-table-multi .rt-line th { padding-left: 10px; }
.rt-line { border-bottom: 1px solid #eef1f5; }
.rt-heading th { padding-top: 18px; font-weight: 700; color: var(--navy-900); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.rt-subheading th { padding-top: 10px; font-weight: 600; color: var(--text-2); font-style: italic; }
.rt-subtotal th, .rt-subtotal td { font-weight: 600; border-top: 1px solid var(--border-strong); }
.rt-total th, .rt-total td { font-weight: 700; color: var(--navy-900); border-top: 1px solid var(--navy-900); border-bottom: 3px double var(--navy-900); background: var(--navy-50); }

.report-foot { margin-top: 20px; display: grid; gap: 12px; }
.report-checks { display: grid; gap: 6px; }
.report-checks li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; }
.report-checks .is-ok { color: var(--good); }
.report-checks .is-fail { color: var(--critical); }
.report-notes { display: grid; gap: 4px; padding-left: 18px; list-style: disc; font-size: 13.5px; color: var(--text-2); }
.report-prepared { font-size: 12px; color: var(--muted); }

/* ------------------------ Two-portal welcome page --------------------- */

.welcome-page { min-height: 100vh; display: flex; flex-direction: column; background:
  radial-gradient(circle at 90% 0%, rgba(16, 185, 129, 0.10), transparent 40%),
  radial-gradient(circle at 0% 100%, rgba(11, 37, 69, 0.06), transparent 40%), var(--bg); }
.welcome-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 40px; }
.welcome-main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 24px 40px; display: grid; gap: 28px; align-content: start; }
.welcome-intro { text-align: center; max-width: 640px; margin: 16px auto 0; }
.welcome-intro h1 { font-size: 34px; line-height: 1.2; color: var(--navy-900); letter-spacing: -0.015em; margin-bottom: 10px; }
.welcome-intro p { font-size: 16px; color: var(--text-2); }
.portal-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.portal-card { display: flex; flex-direction: column; gap: 14px; padding: 32px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow); border-top: 4px solid var(--navy-900); }
.portal-card-rnf { border-top-color: var(--teal-500); }
.portal-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; background: var(--navy-100); color: var(--navy-800); }
.portal-card-rnf .portal-icon { background: var(--teal-50); color: var(--teal-700); }
.portal-icon .icon { width: 26px; height: 26px; }
.portal-card h2 { font-size: 22px; color: var(--navy-900); }
.portal-card > p { color: var(--text-2); font-size: 15px; }
.portal-meta { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--navy-50); font-size: 13.5px; color: var(--text-2); }
.portal-card .btn { margin-top: auto; }
.btn-teal { background: var(--teal-600); color: #fff; }
.btn-teal:hover { background: var(--teal-700); }
.btn.is-loading { opacity: 0.7; }
.welcome-note { max-width: 760px; margin: 0 auto; }
.welcome-footer { padding: 16px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ------------------------- Shell additions -------------------------- */

.sidebar .nav { flex: 1 1 auto; min-height: 0; }
.client-switcher { display: inline-flex; align-items: center; gap: 8px; margin-left: 16px; font-size: 13px; color: var(--text-2); font-weight: 500; min-width: 0; }
.client-switcher select { height: 38px; max-width: 280px; min-width: 0; padding: 0 30px 0 12px; border: 1px solid var(--teal-500); border-radius: var(--radius-sm);
  background: var(--teal-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--navy-900); appearance: none; -webkit-appearance: none; cursor: pointer; text-overflow: ellipsis; }

/* --------------------------- Shared pieces --------------------------- */

.small { font-size: 12.5px; }
.text-good { color: var(--good); }
.text-critical { color: var(--critical); }
.cell-strong { font-weight: 600; color: var(--text); }
.welcome-side { flex-shrink: 0; }
.grid-side { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.grid-side-reverse { grid-template-columns: minmax(260px, 1fr) minmax(0, 2.4fr); }

.info-box { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius); background: var(--info-bg);
  border: 1px solid #cddcf0; color: var(--navy-800); font-size: 14px; }
.info-box .icon { margin-top: 2px; }
.info-warning { background: var(--warning-bg); border-color: #f3d3a5; color: var(--warning); }
.info-box a { color: inherit; font-weight: 600; }

.change { font-weight: 600; font-size: 13px; white-space: nowrap; }
.change.is-good { color: var(--good); }
.change.is-bad { color: var(--critical); }
.compare-table th, .compare-table td { padding: 9px 10px; }

.insights { display: grid; gap: 8px; }
.insights li { display: flex; gap: 8px; font-size: 14px; color: var(--text-2); }
.insights .icon { width: 16px; height: 16px; margin-top: 3px; color: var(--teal-600); }

.trend-line { fill: none; stroke: var(--teal-600); stroke-width: 2; stroke-linejoin: round; }
.trend-point { fill: var(--teal-600); stroke: #fff; stroke-width: 2; }
.trend-point.is-negative { fill: var(--critical); }

.sort-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: inherit; }
.dt .data-table th, .dt .data-table td { white-space: normal; padding: 10px; }
.dt .data-table .num, .dt .data-table .pill, .dt .data-table .cell-action { white-space: nowrap; }
.dt .data-table td:has(> .pill), .dt .data-table td[data-label*="date" i] { white-space: nowrap; }
.cell-action { text-align: right; }
.cell-action .btn + .btn { margin-left: 6px; }
.sort-btn:hover, .sort-btn.is-active { color: var(--navy-900); }
.sort-arrow { font-size: 10px; opacity: 0.6; }
.num .sort-btn { flex-direction: row-reverse; }
.data-table tfoot th, .data-table tfoot td { font-weight: 700; background: var(--navy-50); border-top: 2px solid var(--border-strong); font-variant-numeric: tabular-nums; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 20px; margin: 0; }
.detail-grid dt { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.detail-grid dd { margin: 2px 0 0; font-size: 14.5px; color: var(--text); }
.detail-list-plain { border: 0; }
.detail-list-plain li { padding: 10px 0; }
.detail-list li > span { display: inline-flex; align-items: center; gap: 8px; }
.detail-list .icon { width: 16px; height: 16px; color: var(--muted); }
.detail-total { font-weight: 700; border-top: 2px solid var(--border-strong) !important; }

.bar-list { display: grid; gap: 14px; }
.bar-list-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 5px; }
.bar-list-top strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-list-top small { color: var(--muted); font-weight: 500; }
.bar-track { height: 8px; border-radius: 999px; background: var(--navy-100); overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: 999px; background: var(--navy-700); }

.textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; font-size: 14.5px; color: var(--text); resize: vertical; }
.textarea:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.demo-inline { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; color: var(--demo-text); }
.check-ok, .check-fail { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.check-ok { color: var(--good); }
.check-fail { color: var(--critical); }
.link-btn { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--navy-800); cursor: pointer; text-align: left; }
.link-btn:hover { color: var(--teal-700); text-decoration: underline; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--teal-50); color: var(--teal-700); font-size: 13.5px; font-weight: 500; }
.chip-list .icon { width: 15px; height: 15px; }

/* Journey editing */
.journey-edit select, .inline-select select { height: 32px; padding: 0 26px 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; font: inherit; font-size: 13px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center;
  appearance: none; -webkit-appearance: none; cursor: pointer; }

/* Action Centre */
.action-summary { display: flex; gap: 12px; align-items: center; padding: 16px 20px; border-radius: var(--radius); background: var(--navy-900); color: #dbe6f4; }
.action-summary strong { color: #fff; }
.action-summary .icon { width: 22px; height: 22px; color: var(--teal-500); flex-shrink: 0; }
.action-group-title { display: flex; gap: 12px; align-items: center; }
.action-group-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--navy-100); color: var(--navy-800); flex-shrink: 0; }
.action-list { display: grid; }
.action-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.action-item:first-child { border-top: 0; padding-top: 0; }
.action-main { display: flex; flex-direction: column; min-width: 0; }
.action-main strong { font-size: 14.5px; }
.action-main small { font-size: 13px; color: var(--text-2); }
.action-answer { color: var(--teal-700) !important; font-style: italic; }
.action-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.action-item.is-done .action-main strong { color: var(--muted); text-decoration: line-through; }

/* Notifications */
.notification-list { display: grid; }
.notification { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--border); }
.notification:first-child { border-top: 0; padding-top: 0; }
.notification-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.notification-body small { color: var(--text-2); font-size: 13px; }
.notification-body time { font-size: 12px; color: var(--muted); }
.notification.is-unread .notification-body strong::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--teal-500); vertical-align: middle; }
.notification-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Accountant: KPIs, modules, notes, checklist, matrix */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { display: flex; gap: 14px; align-items: center; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0; background: var(--navy-100); color: var(--navy-800); }
.kpi-label { display: block; font-size: 13px; color: var(--text-2); font-weight: 500; }
.kpi-value { display: block; font-size: 26px; font-weight: 700; color: var(--navy-900); line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; color: var(--muted); }
.kpi-warning .kpi-icon { background: var(--warning-bg); color: var(--warning); }
.kpi-critical .kpi-icon { background: var(--critical-bg); color: var(--critical); }
.kpi-good .kpi-icon { background: var(--good-bg); color: var(--good); }
.kpi-teal .kpi-icon { background: var(--teal-50); color: var(--teal-700); }
.kpi-teal { grid-column: span 2; }

.mini-progress { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; }
.mini-progress .progress { flex: 1; height: 6px; }
.mini-progress small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.module-link { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--navy-900); text-decoration: none; font-size: 14px; font-weight: 500; }
.module-link:hover { border-color: var(--teal-500); background: var(--teal-50); }
.module-link .icon { color: var(--teal-700); }

.rec-grid { padding: 4px 0 8px; }
.checklist { display: grid; gap: 4px; margin-bottom: 14px; }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14.5px; }
.checklist label:hover { background: var(--navy-50); }
.checklist input { width: 18px; height: 18px; accent-color: var(--teal-600); }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }

.note-list { display: grid; gap: 12px; }
.note { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--navy-50); border-left: 3px solid var(--teal-500); }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.note-meta strong { color: var(--navy-900); }
.note p { font-size: 14.5px; }

.journey-matrix th, .journey-matrix td { text-align: center; padding: 10px 8px; }
.journey-matrix tbody th { text-align: left; white-space: normal; min-width: 180px; }
.journey-matrix .matrix-head { display: inline-block; max-width: 96px; white-space: normal; font-size: 11.5px; line-height: 1.3; }
.journey-matrix tr.is-selected { background: var(--teal-50); }
.matrix-cell { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; }
.matrix-cell .icon { width: 15px; height: 15px; }
.matrix-completed { background: var(--teal-600); color: #fff; }
.matrix-in-progress { background: var(--info-bg); color: var(--info); border: 1px solid var(--navy-700); }
.matrix-action-required { background: var(--warning-bg); color: var(--warning); border: 1px solid #e89a3c; }
.matrix-not-started { background: #fff; color: var(--muted); border: 1px solid var(--border-strong); }
.matrix-legend { flex-wrap: wrap; margin-top: 14px; }

/* ------------------------- Interactive dashboard ---------------------- */

.welcome-logo { width: 112px; height: 112px; border-radius: 50%; margin: 0 auto 18px; display: block; box-shadow: 0 12px 30px rgba(0, 36, 59, 0.28); }
.welcome-intro h1 { font-family: var(--font-brand); font-weight: 400; letter-spacing: 0.02em; }

/* Hero banner */
.hero {
  position: relative; overflow: hidden; padding: 26px 28px 22px; border-radius: 18px; color: #d7e6f0;
  background: radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.28), transparent 45%), linear-gradient(135deg, #003352 0%, #00284a 55%, #003d5c 100%);
  box-shadow: 0 14px 34px rgba(0, 36, 59, 0.22);
}
.hero-rnf { background: radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.34), transparent 50%), linear-gradient(135deg, #003352 0%, #003b4f 60%, #004a55 100%); }
.hero-mark { position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; border-radius: 50%; opacity: 0.08; pointer-events: none; }
.hero-top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.hero-eyebrow { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal-500); font-weight: 600; margin-bottom: 6px; }
.hero-title { font-family: var(--font-brand); font-weight: 400; font-size: 30px; line-height: 1.15; color: #fff; letter-spacing: 0.01em; }
.hero-meta, .hero-period { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 13.5px; color: #a9c4d6; }
.hero-meta .icon, .hero-period .icon { width: 15px; height: 15px; }
.hero-period { position: relative; margin-top: 14px; }
.hero-period strong { color: #fff; }

.segmented { display: inline-flex; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); }
.segmented button { min-height: 36px; padding: 6px 16px; border: 0; border-radius: 9px; background: transparent; color: #cfe0ea; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background 0.2s, color 0.2s; }
.segmented button:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.segmented button.is-active { background: #fff; color: var(--navy-900); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }

.quick-actions { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.quick-action { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12); color: #d7e6f0; text-decoration: none; font-size: 13px; line-height: 1.3; transition: background 0.2s, transform 0.2s, border-color 0.2s; }
.quick-action:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-2px); border-color: rgba(16, 185, 129, 0.6); }
.quick-action > .icon:first-child { width: 20px; height: 20px; color: var(--teal-500); flex-shrink: 0; }
.quick-action > .icon:last-child { width: 16px; height: 16px; margin-left: auto; opacity: 0.6; }
.quick-action strong { display: block; font-size: 20px; color: #fff; font-variant-numeric: tabular-nums; }
.quick-attention { border-color: rgba(245, 213, 138, 0.55); }
.quick-attention > .icon:first-child { color: #f5d58a; }

/* Interactive stat cards */
.stat-link { text-decoration: none; color: inherit; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; position: relative; }
.stat-link:hover, .stat-link:focus-visible { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 51, 82, 0.12); border-color: var(--teal-500); }
.stat-top .chip { margin-left: auto; }
.chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip-good { background: var(--good-bg); color: var(--good); }
.chip-bad { background: var(--critical-bg); color: var(--critical); }
.stat-visual { height: 34px; margin-top: 12px; display: flex; align-items: center; }
.stat-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-more { display: inline-flex; align-items: center; gap: 2px; color: var(--teal-700); font-weight: 600; opacity: 0; transform: translateX(-4px); transition: opacity 0.2s, transform 0.2s; white-space: nowrap; }
.stat-more .icon { width: 14px; height: 14px; }
.stat-link:hover .stat-more, .stat-link:focus-visible .stat-more { opacity: 1; transform: none; }

.sparkline { width: 100%; height: 34px; overflow: visible; }
.spark-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-area { opacity: 0.14; }
.spark-teal .spark-line { stroke: var(--teal-600); } .spark-teal .spark-area, .spark-teal .spark-dot { fill: var(--teal-600); }
.spark-navy .spark-line { stroke: var(--navy-800); } .spark-navy .spark-area, .spark-navy .spark-dot { fill: var(--navy-800); }
.spark-good .spark-line { stroke: var(--good); } .spark-good .spark-area, .spark-good .spark-dot { fill: var(--good); }
.spark-bad .spark-line { stroke: var(--critical); } .spark-bad .spark-area, .spark-bad .spark-dot { fill: var(--critical); }

.split-bar { display: flex; gap: 2px; width: 100%; height: 10px; border-radius: 6px; overflow: hidden; background: var(--neutral-bg); }
.split-bar span { flex-basis: 0; min-width: 4px; }
.cash-0 { background: var(--teal-600); } .cash-1 { background: #5fc4b6; } .cash-2 { background: #b6e6de; }

/* Chart interactions */
.legend-toggles { gap: 8px; }
.legend-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: #fff;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: opacity 0.2s, background 0.2s; }
.legend-toggle:hover { background: var(--navy-50); }
.legend-toggle[aria-pressed="false"] { opacity: 0.45; text-decoration: line-through; }
.bar { transition: opacity 0.2s; }
.bar.is-dim { opacity: 0.25; }
.chart-axis.is-selected { fill: var(--navy-900); font-weight: 700; }
.chart-hit:focus { outline: none; }
.chart-hit:focus-visible { fill: rgba(16, 185, 129, 0.12); }
.tip-hint { font-size: 11.5px; color: var(--teal-700); font-weight: 600; }
.chart-note { display: flex; align-items: center; gap: 6px; }
.chart-note .icon { width: 15px; height: 15px; color: var(--teal-600); flex-shrink: 0; }

.month-detail { margin-top: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--navy-50); border: 1px solid var(--navy-100); animation: rise 0.25s ease-out; }
.month-detail[hidden] { display: none; }
.month-detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.month-detail-head h3 { font-size: 16px; color: var(--navy-900); }
.month-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; }
.md-figures { display: grid; gap: 10px; }
.md-figures > div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--border); }
.md-figures span { font-size: 12.5px; color: var(--muted); }
.md-figures strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.md-figures small { font-size: 12px; color: var(--muted); }
.md-figures small.up { color: var(--good); } .md-figures small.down { color: var(--critical); }
.md-cats-title { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }

/* Donut */
.donut { display: grid; gap: 16px; }
.donut-figure { position: relative; width: 200px; height: 200px; margin: 0 auto; }
.donut-svg { width: 100%; height: 100%; overflow: visible; }
.donut-seg { cursor: pointer; transition: stroke-width 0.2s, opacity 0.2s; outline: none; }
.donut.has-focus .donut-seg { opacity: 0.35; }
.donut.has-focus .donut-seg.is-active { opacity: 1; stroke-width: 32; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 0 40px; }
.donut-center span { font-size: 11.5px; color: var(--muted); line-height: 1.25; max-width: 110px; }
.donut-center strong { font-size: 14px; color: var(--navy-900); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -0.01em; }
.donut-center small { font-size: 12px; color: var(--teal-700); font-weight: 600; min-height: 16px; }
.donut-legend { display: grid; gap: 2px; }
.donut-key { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left; }
.donut-key:hover, .donut-key.is-active { background: var(--navy-50); }
.donut-key-label { flex: 1; min-width: 0; }
.donut-key-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.donut-key-value small { margin-left: 6px; color: var(--muted); font-weight: 500; }

.largest-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 2px 6px; margin: 0 -6px; border-radius: 8px; color: inherit; text-decoration: none; }
.largest-link:hover { background: var(--navy-50); }
.largest-list li { padding: 8px 0; }
.arap-card > .btn { margin-top: 12px; }

/* Accountant dashboard */
.kpi-link { text-decoration: none; color: inherit; position: relative; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.kpi-link:hover, .kpi-link:focus-visible { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 51, 82, 0.12); border-color: var(--teal-500); }
.kpi-arrow { position: absolute; right: 14px; top: 14px; width: 16px; height: 16px; color: var(--muted); opacity: 0; transition: opacity 0.2s; }
.kpi-link:hover .kpi-arrow { opacity: 1; }

.hero-ring { position: relative; flex-shrink: 0; width: 112px; height: 112px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: conic-gradient(var(--teal-500) calc(var(--pct) * 1%), rgba(255, 255, 255, 0.12) 0); }
.hero-ring::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: #00304d; }
.hero-ring strong, .hero-ring span { position: relative; }
.hero-ring strong { font-size: 24px; color: #fff; }
.hero-ring span { font-size: 10.5px; line-height: 1.25; color: #a9c4d6; text-transform: uppercase; letter-spacing: 0.06em; }

.pipeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pipeline-col { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); border-top: 4px solid var(--neutral);
  text-decoration: none; color: inherit; background: var(--surface); transition: transform 0.2s, box-shadow 0.2s; min-width: 0; }
.pipeline-col:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pipeline-head { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.pipeline-head strong { font-size: 26px; color: var(--navy-900); }
.pipeline-clients { display: flex; flex-wrap: wrap; gap: 6px; }
.pipeline-chip { padding: 3px 9px; border-radius: 999px; background: var(--navy-50); font-size: 12px; font-weight: 500; color: var(--navy-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cat-docs { border-top-color: #d99a2b; } .cat-book { border-top-color: var(--navy-700); }
.cat-review { border-top-color: #5f86ad; } .cat-ready { border-top-color: var(--teal-600); }

.closing-list { display: grid; gap: 4px; }
.closing-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 44px; align-items: center; gap: 12px; width: 100%; padding: 9px 8px;
  border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left; }
.closing-row:hover { background: var(--navy-50); }
.closing-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.closing-row .bar-track span { background: var(--teal-600); }
.closing-pct { font-weight: 700; color: var(--navy-900); text-align: right; font-variant-numeric: tabular-nums; }

.grid-2 .activity-list { grid-template-columns: minmax(0, 1fr); }
.grid-2 .activity-list .activity:nth-child(2) { border-top: 1px solid var(--border); padding-top: 14px; }
.grid-2 .activity { flex-wrap: wrap; }
.grid-2 .activity-time { width: 100%; padding-left: 52px; margin-top: -6px; }

/* Gentle motion and polish */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dashboard > * { animation: rise 0.35s ease-out both; }
.dashboard > *:nth-child(2) { animation-delay: 0.04s; } .dashboard > *:nth-child(3) { animation-delay: 0.08s; }
.dashboard > *:nth-child(4) { animation-delay: 0.12s; } .dashboard > *:nth-child(n+5) { animation-delay: 0.16s; }
.dashboard.is-updating { opacity: 0.6; transition: opacity 0.2s; pointer-events: none; }
.card { transition: box-shadow 0.2s; }
.card:hover { box-shadow: 0 2px 4px rgba(0, 51, 82, 0.04), 0 10px 26px rgba(0, 51, 82, 0.07); }
.card-title { letter-spacing: -0.005em; }
.page-title { font-family: var(--font-brand); font-weight: 400; letter-spacing: 0.01em; }
.topbar-title { font-family: var(--font-brand); font-weight: 400; letter-spacing: 0.02em; font-size: 19px; }

/* ------------- Website theme (matches rnfbusinesssolutions.com) ------------- */

h1, h2, h3, .card-title, .page-title, .hero-title, .topbar-title, .stat-value, .kpi-value, .welcome-title,
.arap-total, .arap-overdue-value, .mini-stat strong, .pipeline-head strong, .report-doc-head h2, .modal-header h2 {
  font-family: var(--font-brand);
}
.page-title { font-weight: 700; font-size: 26px; letter-spacing: -0.01em; }
.card-title { font-weight: 600; font-size: 17px; }
.stat-value, .kpi-value { font-weight: 700; letter-spacing: -0.01em; }

/* Brand wordmark: RNF BUSINESS SOLUTIONS, with BUSINESS in emerald */
.brand-text strong { font-family: var(--font-brand); font-weight: 800; font-size: 16px; letter-spacing: -0.01em; text-transform: none; }
.brand-text strong em { font-style: normal; color: var(--teal-500); }
.brand-dark .brand-text strong em { color: var(--teal-600); }
.brand-text span { display: inline-block; width: fit-content; margin-top: 4px; padding: 1px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: none; border: 1px solid rgba(52, 211, 153, 0.45); background: rgba(16, 185, 129, 0.12); }
.brand-light .brand-text span { color: #6ee7b7; }
.brand-logo { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }

/* Frame: dark navy sidebar and top bar, like the website header */
.sidebar { background: #00243b; }
.shell-rnf .sidebar { background: linear-gradient(180deg, #00243b 0%, #002b3d 100%); }
.nav-link.is-active { background: rgba(16, 185, 129, 0.14); box-shadow: inset 3px 0 0 var(--emerald); }
.nav-group-label { color: #6f8eaa; }
.topbar { background: #003352; border-bottom: 1px solid rgba(255, 255, 255, 0.08); backdrop-filter: none; }
.topbar-title { color: #fff; font-weight: 700; font-size: 19px; letter-spacing: -0.005em; }
.menu-btn { color: #fff; }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.topbar .avatar { background: var(--teal-500); color: #00243b; }
.client-switcher { color: #bac7db; }
.client-switcher select { background-color: rgba(255, 255, 255, 0.08); border-color: rgba(52, 211, 153, 0.55); color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.client-switcher select option { color: var(--text); background: #fff; }

/* Buttons */
.btn { border-radius: 12px; font-weight: 700; }
.btn-emerald { background: var(--emerald); color: #fff; }
.btn-emerald:hover { background: var(--teal-600); }
.btn-light { background: #f4f6fc; color: var(--navy-900); }
.btn-light:hover { background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.btn-teal { background: var(--emerald); }
.btn-teal:hover { background: var(--teal-600); }

/* Dashboard banners: navy over the city photo, as on the website hero */
.hero, .hero-rnf {
  background:
    linear-gradient(105deg, rgba(0, 36, 59, 0.97) 0%, rgba(0, 51, 82, 0.9) 48%, rgba(0, 51, 82, 0.62) 100%),
    var(--hero-photo) center 35% / cover no-repeat, #003352;
  border-radius: 20px;
}
.hero-title { font-weight: 800; font-size: 32px; letter-spacing: -0.02em; }
.hero-eyebrow { color: #6ee7b7; letter-spacing: 0.18em; font-weight: 700; }
.hero-mark { opacity: 0.06; }
.quick-action { backdrop-filter: blur(6px); background: rgba(0, 36, 59, 0.45); }
.quick-action:hover { border-color: rgba(52, 211, 153, 0.7); }
.segmented { backdrop-filter: blur(6px); }
.hero-ring::before { background: #00304b; }

/* Cards */
.card, .stat-card, .mini-stat, .kpi { border-radius: var(--radius); border-color: #e2e8f2; }
.stat-card { overflow: hidden; }
.stat-link::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--navy-900), var(--emerald)); opacity: 0; transition: opacity 0.2s; }
.stat-link:hover::before { opacity: 1; }
.stat-link:hover, .stat-link:focus-visible, .kpi-link:hover { border-color: var(--emerald); }
.stat-icon-teal, .kpi-teal .kpi-icon { background: var(--teal-50); color: var(--teal-600); }
.tag-demo { border-radius: 6px; }

/* Welcome screen */
.welcome-page { background: #00243b; color: #f4f6fc; }
.site-header { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 48px;
  background: rgba(0, 51, 82, 0.92); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.site-header-tag { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0; padding: 9px 16px; border-radius: 12px; background: #f4f6fc; color: var(--navy-900); font-size: 13.5px; font-weight: 700; }
.site-header-tag .icon { width: 15px; height: 15px; color: var(--emerald); }
.site-hero { flex: 1; position: relative; padding: 56px 24px 48px;
  background: linear-gradient(180deg, rgba(0, 36, 59, 0.78) 0%, rgba(0, 36, 59, 0.86) 55%, #00243b 100%), var(--hero-photo) center 30% / cover no-repeat, #00243b; }
.site-hero-inner { max-width: 1080px; margin: 0 auto; text-align: center; display: grid; gap: 18px; }
.site-kicker { font-family: var(--font-brand); font-weight: 800; letter-spacing: 0.32em; text-transform: uppercase; color: #fff; font-size: 15px; }
.site-kicker-sub { margin-top: -12px; letter-spacing: 0.24em; text-transform: uppercase; color: #bac7db; font-size: 12.5px; font-weight: 600; }
.site-hero h1 { font-family: var(--font-brand); font-weight: 800; font-size: clamp(36px, 6vw, 64px); line-height: 1.05; letter-spacing: -0.03em; color: #fff; margin-top: 18px; }
.site-lead { max-width: 640px; margin: 0 auto; font-size: 18px; color: #e2ecf8; }
.site-hero .portal-cards { margin-top: 22px; text-align: left; }
.site-hero .portal-card { background: rgba(0, 51, 82, 0.55); border: 1px solid rgba(255, 255, 255, 0.14); border-top: 3px solid #f4f6fc; color: #f4f6fc;
  backdrop-filter: blur(12px); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); transition: transform 0.25s, border-color 0.25s; }
.site-hero .portal-card:hover { transform: translateY(-4px); border-color: rgba(52, 211, 153, 0.5); }
.site-hero .portal-card-rnf { border-top-color: var(--teal-500); }
.portal-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.site-hero .portal-icon { background: rgba(255, 255, 255, 0.1); color: #f4f6fc; }
.site-hero .portal-card-rnf .portal-icon { background: rgba(16, 185, 129, 0.16); color: var(--teal-500); }
.portal-role { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: #bac7db; }
.site-hero .portal-card h2 { font-family: var(--font-brand); font-weight: 700; font-size: 24px; color: #fff; }
.site-hero .portal-card > p { color: #bac7db; }
.site-hero .portal-meta { background: rgba(0, 36, 59, 0.55); color: #bac7db; }
.site-hero .portal-meta strong { color: #fff; }
.site-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin-top: 8px; }
.site-points li { display: flex; align-items: center; gap: 10px; font-family: var(--font-brand); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 0.02em; color: #fff; }
.site-points li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--teal-500); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18); }
.site-demo-note { display: flex; gap: 10px; max-width: 780px; margin: 6px auto 0; padding: 12px 16px; border-radius: 12px; text-align: left; font-size: 13px;
  background: rgba(253, 230, 138, 0.1); border: 1px solid rgba(253, 230, 138, 0.35); color: #fde68a; }
.site-demo-note .icon { margin-top: 1px; }
.welcome-page .welcome-footer { background: #00243b; color: #8fa7c4; }

/* ---------------------------- Responsive ----------------------------- */

@media (max-width: 1100px) {
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1599px) {
  .grid-side { grid-template-columns: 1fr; }
}

@media (max-width: 1279px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .portal-cards { grid-template-columns: 1fr; }
  .welcome-header { padding: 18px 20px; }
  .client-switcher > span { display: none; }
  .client-switcher { margin-left: 4px; }
  .client-switcher select { max-width: 200px; }
}

@media (max-width: 900px) and (min-width: 641px) {
  .journey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey-step:nth-child(2n)::after { display: none; }
}

@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
}

/* Below 1280px the sidebar becomes a slide-out menu so tables keep their full width. */
@media (max-width: 1279px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }
  .menu-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .menu-open .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(7, 26, 51, 0.45); }
  .sidebar-close, .menu-btn { display: inline-flex; }
}

@media (max-width: 1024px) {
  .topbar { padding: 0 24px; }
  .page { padding: 24px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-mobile-brand { display: block; }
  .grid-2 { grid-template-columns: 1fr; }
  .activity-list { grid-template-columns: 1fr; }
  .activity-list .activity:nth-child(2) { border-top: 1px solid var(--border); padding-top: 14px; }
  .report-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tablets: stacked table cards, two per row */
@media (min-width: 641px) and (max-width: 900px) {
  .responsive-table tbody { display: grid !important; grid-template-columns: 1fr 1fr; column-gap: 28px; }
}

@media (max-width: 900px) {
  /* Tables become stacked cards on tablets and phones */
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table th, .responsive-table td { display: block; width: 100%; }
  .responsive-table tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .responsive-table tbody tr:hover { background: transparent; }
  .responsive-table th, .responsive-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0; border: 0; white-space: normal; text-align: right; }
  .responsive-table th[data-label], .responsive-table td[data-label] { min-width: 0; }
  .dt .responsive-table th, .dt .responsive-table td { padding: 3px 0; white-space: normal; }
  .responsive-table tfoot tr { border-bottom: 0; }
  .responsive-table tfoot td:empty { display: none; }
  .responsive-table [data-label]::before { content: attr(data-label); font-size: 12.5px; font-weight: 500; color: var(--muted); text-align: left; flex-shrink: 0; }
  .responsive-table .num { text-align: right; }
  .responsive-table .cell-party, .responsive-table .doc-name { min-width: 0; }
  .responsive-table .cell-action { justify-content: flex-end; padding-top: 8px; }
  .responsive-table .cell-action:empty { display: none; }
  .responsive-table .cell-stack { align-items: flex-end; text-align: right; }
  .responsive-table .doc-name .icon { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .demo-banner { font-size: 12.5px; padding: 8px 12px; text-align: left; justify-content: flex-start; }
  .demo-banner .icon { display: none; }
  .topbar { height: 58px; padding: 0 16px; }
  .topbar .avatar { display: none; }
  .page { padding: 18px 16px 28px; gap: 18px; }
  .card { padding: 18px 16px; }
  .welcome-title { font-size: 21px; }
  .welcome-meta { flex-direction: column; gap: 6px; }
  .stat-grid { grid-template-columns: 1fr; gap: 14px; }
  .stat-card { padding: 16px 18px; }
  .stat-top { margin-bottom: 10px; }
  .stat-icon { width: 34px; height: 34px; }
  .stat-value { font-size: 24px; }
  .stat-foot { margin-top: 10px; padding-top: 10px; }
  .card-header { flex-wrap: wrap; }
  .journey { grid-template-columns: 1fr; row-gap: 0; }
  .journey-step { flex-direction: row; gap: 14px; padding-bottom: 22px; }
  .journey-step:not(:last-child)::after { top: 46px; bottom: 0; left: 21px; right: auto; width: 2px; height: auto; display: block; }
  .journey-step:not(:last-child):nth-child(n)::after { display: block; }
  .arap-totals { grid-template-columns: 1fr; }
  .arap-total, .arap-overdue-value { font-size: 20px; }
  .activity { flex-wrap: wrap; }
  .activity-time { width: 100%; padding-left: 52px; margin-top: -6px; }
  .login-panel { padding: 32px 16px; align-items: flex-start; }
  .login-card h2 { font-size: 24px; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; }
  .app-footer { padding: 12px 16px 20px; }
  .page-title { font-size: 21px; }
  .welcome-intro h1 { font-size: 26px; }
  .welcome-logo { width: 84px; height: 84px; }
  .site-header { padding: 14px 16px; }
  .site-header .brand-text span { display: none; }
  .site-header-tag { padding: 7px 10px; font-size: 12px; }
  .site-hero { padding: 36px 16px 32px; }
  .site-kicker { letter-spacing: 0.2em; font-size: 13px; }
  .site-kicker-sub { letter-spacing: 0.12em; font-size: 11px; }
  .site-lead { font-size: 16px; }
  .site-points { flex-direction: column; align-items: flex-start; }
  .topbar-title { font-size: 16px; }
  .hero { padding: 20px 18px 18px; border-radius: 14px; }
  .hero-title { font-size: 23px; }
  .hero-top { flex-direction: column; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding: 6px 8px; }
  .quick-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quick-action { padding: 10px; gap: 8px; }
  .quick-action > .icon:last-child { display: none; }
  .quick-action strong { font-size: 17px; }
  .hero-ring { width: 92px; height: 92px; align-self: flex-start; }
  .pipeline { grid-template-columns: 1fr 1fr; gap: 8px; }
  .month-detail-grid { grid-template-columns: 1fr; }
  .stat-more { opacity: 1; transform: none; }
  .brand-text strong { font-size: 14px; }
  .portal-card { padding: 22px 18px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-icon { display: none; }
  .kpi-label { font-size: 12.5px; }
  .kpi-value { font-size: 22px; }
  .welcome { flex-direction: column; align-items: stretch; }
  .action-item, .notification { flex-wrap: wrap; }
  .action-side, .notification-actions { width: 100%; justify-content: flex-start; }
  .topbar-title { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .client-switcher select { max-width: 130px; font-size: 13px; }
  .topbar .tag { display: none; }
  .page-head .btn { width: 100%; }
  .tabs { width: 100%; }
  .tab { flex: 1; padding: 8px 10px; }
  .mini-stats { grid-template-columns: 1fr; gap: 10px; }
  .mini-stat { flex-direction: row; justify-content: space-between; align-items: center; padding: 12px 16px; }
  .mini-stat strong { font-size: 18px; }
  .search-box { max-width: none; flex-basis: 100%; }
  .select-box { flex: 1 1 140px; }
  .select-box select { flex: 1; min-width: 0; }
  .toolbar-count { margin-left: 0; width: 100%; }
  .toolbar-actions { margin-left: 0; width: 100%; }
  .toolbar-actions .btn { flex: 1; }
  .field-row { grid-template-columns: 1fr; }
  .report-picker { grid-template-columns: 1fr; gap: 8px; }
  .report-option { padding: 10px 12px; }
  .report-table { font-size: 13px; }
  .report-table .num { width: auto; }
  .rt-line th { padding-left: 12px; }
  .report-table-multi { min-width: 560px; }
}

/* ------------------ Plain-language help for business owners ------------------ */

/* "What am I looking at? / What does it mean? / What can I do next?" */
.guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid #e2e8f2; box-shadow: var(--shadow); }
.guide-col { padding: 16px 18px; border-left: 1px solid #e8edf4; }
.guide-col:first-child { border-left: 0; }
.guide-col:last-child { background: var(--teal-50); }
.guide-q { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-family: var(--font-brand); font-weight: 700; font-size: 13.5px; color: var(--navy-900); }
.guide-q .icon { width: 16px; height: 16px; color: var(--teal-600); }
.guide-col p { font-size: 14px; color: var(--text-2); }
.guide-col p strong { color: var(--text); }
.guide-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.tip { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); }
.tip .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--teal-600); flex-shrink: 0; }

/* "?" help tips */
.help-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 4px; border-radius: 50%;
  background: var(--navy-100); color: var(--navy-800); font-size: 11.5px; font-weight: 800; cursor: help; vertical-align: middle; flex-shrink: 0; }
.help-bubble { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 20; width: max-content; max-width: 240px;
  padding: 8px 10px; border-radius: 8px; background: #00243b; color: #f4f6fc; font-size: 12.5px; font-weight: 500; line-height: 1.4; text-align: left;
  white-space: normal; letter-spacing: 0; text-transform: none; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transition: opacity 0.15s; pointer-events: none; }
.help-tip:hover .help-bubble, .help-tip:focus .help-bubble { opacity: 1; visibility: visible; }

/* Hero additions */
.hero-period-pick { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.hero-pick-label { display: inline-flex; align-items: center; font-size: 12px; color: #a9c4d6; font-weight: 600; }
.hero-pick-label .help-tip { background: rgba(255, 255, 255, 0.15); color: #fff; }
.hero-status { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 13.5px; color: #cfe0ea; }
.hero-status .icon { width: 15px; height: 15px; color: var(--teal-500); }
.hero-status strong { color: #fff; }
.hero-status a { color: #6ee7b7; font-weight: 700; }

/* Quick answers */
.qa-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; counter-reset: qa; }
.qa-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.qa-list li:nth-child(-n+2) { border-top: 0; }
.qa-num { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--navy-900); color: #fff; font-family: var(--font-brand); font-weight: 700; font-size: 12.5px; }
.qa-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.qa-q { font-size: 14px; color: var(--navy-900); }
.qa-a { font-size: 14px; color: var(--text-2); }
.qa-link { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; font-size: 12.5px; font-weight: 700; color: var(--teal-700); text-decoration: none; white-space: nowrap; padding-top: 2px; }
.qa-link .icon { width: 14px; height: 14px; }
.qa-link:hover { text-decoration: underline; }

/* Profit vs money in bank */
.pc-compare { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 14px; }
.pc-box { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 12px; background: var(--navy-50); border: 1px solid var(--navy-100); min-width: 0; }
.pc-box span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pc-box strong { font-family: var(--font-brand); font-size: 20px; color: var(--navy-900); white-space: nowrap; }
.pc-box small { font-size: 12px; color: var(--muted); }
.pc-vs { font-family: var(--font-brand); font-weight: 800; color: var(--muted); font-size: 13px; }
.pc-lead { font-size: 14px; color: var(--text-2); margin-bottom: 10px; }
.pc-reasons { display: grid; gap: 8px; margin-bottom: 14px; }
.pc-reasons li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text); }
.pc-arrow { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; font-weight: 800; font-size: 14px; }
.pc-up .pc-arrow { background: var(--good-bg); color: var(--good); }
.pc-down .pc-arrow { background: var(--critical-bg); color: var(--critical); }
.stack { display: grid; gap: 24px; align-content: start; }

/* Other owner-friendly pieces */
.journey-tech { font-size: 11.5px; color: var(--muted); margin-top: -4px; }
.action-summary { align-items: flex-start; }
.action-summary-list { display: grid; gap: 4px; margin-top: 6px; }
.action-summary-list a { color: #6ee7b7; font-weight: 600; text-decoration: none; }
.action-summary-list a:hover { text-decoration: underline; }
.action-summary-list li::before { content: '• '; color: #6ee7b7; }
.stock-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stock-legend li { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid #e2e8f2; font-size: 13px; color: var(--text-2); }
.toggle-line { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.toggle-line input { width: 18px; height: 18px; accent-color: var(--teal-600); }
.report-explain { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 20px; padding: 16px 18px; border-radius: 12px; background: var(--teal-50); border: 1px solid var(--teal-100); }
.report-explain p, .report-explain li { font-size: 13.5px; color: var(--text-2); }
.report-explain ul { padding-left: 16px; list-style: disc; display: grid; gap: 3px; }

@media (max-width: 1100px) {
  .guide { grid-template-columns: 1fr; }
  .guide-col { border-left: 0; border-top: 1px solid #e8edf4; }
  .guide-col:first-child { border-top: 0; }
  .report-explain { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .qa-list { grid-template-columns: 1fr; }
  .qa-list li:nth-child(2) { border-top: 1px solid var(--border); }
  .qa-list li { flex-wrap: wrap; }
  .qa-link { margin-left: 38px; }
  .stock-legend { grid-template-columns: 1fr; }
  .hero-period-pick { align-items: stretch; width: 100%; }
  .pc-compare { grid-template-columns: 1fr; }
  .pc-vs { display: none; }
}

/* --------------------------- Simple owner dashboard --------------------------- */

.dashboard-simple { gap: 22px; }
.hero-simple { padding: 24px 28px; }
.hero-simple .hero-meta { font-size: 14.5px; color: #cfe0ea; }

/* Four key numbers */
.big-numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.big-number { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px 20px 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid #e2e8f2; box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; overflow: hidden; }
.big-number::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--navy-800); }
.big-teal::before { background: var(--emerald); } .big-good::before { background: var(--good); } .big-bad::before { background: var(--critical); }
.big-number:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 51, 82, 0.12); border-color: var(--emerald); }
.big-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.big-label .icon { width: 18px; height: 18px; color: var(--teal-600); }
.big-value { font-family: var(--font-brand); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--navy-900); white-space: nowrap; }
.big-bad .big-value { color: var(--critical); }
.big-text { font-size: 13.5px; color: var(--muted); }
.big-change { font-size: 13px; font-weight: 700; }
.big-change.is-good { color: var(--good); } .big-change.is-bad { color: var(--critical); }

/* Insights */
.section-title { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.section-title h2 { font-family: var(--font-brand); font-size: 21px; font-weight: 700; color: var(--navy-900); }
.insight-key { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 8px; }
.dot-good { background: var(--good); } .dot-watch { background: #d99a2b; } .dot-action { background: var(--critical); }
.insight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.insight { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid #e2e8f2; border-top: 4px solid var(--good); box-shadow: var(--shadow); }
.insight-watch { border-top-color: #d99a2b; } .insight-action { border-top-color: var(--critical); }
.insight-head { display: flex; align-items: center; justify-content: space-between; }
.insight-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--good-bg); color: var(--good); }
.insight-watch .insight-icon { background: var(--warning-bg); color: var(--warning); } .insight-action .insight-icon { background: var(--critical-bg); color: var(--critical); }
.insight-tone { font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--good); }
.insight-watch .insight-tone { color: var(--warning); } .insight-action .insight-tone { color: var(--critical); }
.insight h3 { font-family: var(--font-brand); font-size: 17px; font-weight: 700; color: var(--navy-900); line-height: 1.3; }
.insight p { font-size: 14px; color: var(--text-2); flex: 1; }
.insight-link { display: inline-flex; align-items: center; gap: 2px; font-size: 13.5px; font-weight: 700; color: var(--teal-700); text-decoration: none; }
.insight-link .icon { width: 15px; height: 15px; }
.insight-link:hover { text-decoration: underline; }

/* Next steps */
.todo-list { display: grid; gap: 4px; margin-bottom: 16px; }
.todo-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.todo-list li:first-child { border-top: 0; padding-top: 0; }
.todo-list strong { display: block; font-size: 14.5px; color: var(--text); }
.todo-list small { font-size: 13px; color: var(--muted); }
.todo-num { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--emerald); color: #fff; font-family: var(--font-brand); font-weight: 800; font-size: 13px; }
.todo-done { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--good-bg); color: var(--good); }
.todo-done p { color: var(--text-2); font-size: 14px; }

/* Progress strip */
.progress-strip { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid #e2e8f2;
  box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: border-color 0.2s; }
.progress-strip:hover { border-color: var(--emerald); }
.progress-strip-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; background: var(--teal-50); color: var(--teal-600); }
.progress-strip-body { flex: 1; display: grid; gap: 8px; min-width: 0; }
.progress-strip-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 600; font-size: 14.5px; color: var(--text); }
.progress-strip-link { display: inline-flex; align-items: center; gap: 2px; font-size: 13.5px; font-weight: 700; color: var(--teal-700); white-space: nowrap; }
.progress-strip-link .icon { width: 15px; height: 15px; }

/* Fold-out common questions */
.faq { padding: 0; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary > span { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-brand); font-weight: 700; font-size: 16px; color: var(--navy-900); }
.faq summary > span .icon { color: var(--teal-600); }
.faq summary small { color: var(--muted); font-size: 13px; }
.faq summary::after { content: '▾'; color: var(--muted); font-size: 16px; transition: transform 0.2s; }
.faq[open] summary::after { transform: rotate(180deg); }
.faq .qa-list { padding: 0 22px 18px; }

@media (max-width: 1100px) {
  .big-numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .big-numbers { gap: 10px; }
  .big-number { padding: 14px 14px 12px; }
  .big-value { font-size: 20px; }
  .big-label { font-size: 12.5px; }
  .big-text { font-size: 12.5px; }
  .insight-grid { grid-template-columns: 1fr; gap: 12px; }
  .section-title h2 { font-size: 18px; }
  .progress-strip { flex-wrap: wrap; padding: 14px; }
  .progress-strip-icon { display: none; }
  .faq summary { padding: 14px 16px; flex-wrap: wrap; }
  .faq .qa-list { padding: 0 16px 14px; }
}

@media (max-width: 380px) {
  .big-numbers { grid-template-columns: 1fr; }
  .big-value { font-size: 24px; }
}

/* ------------------------- Invoices, bills and tax (AR / AP) ------------------------- */

.btn[hidden] { display: none; }
.nav-tag { margin-left: auto; padding: 1px 6px; border-radius: 5px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em;
  background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }

.hero-buttons { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.hero-btn { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: #fff;
  background: var(--emerald); border: 1px solid rgba(255, 255, 255, 0.15); transition: transform 0.2s, background 0.2s; }
.hero-btn:hover { transform: translateY(-2px); background: var(--teal-600); }
.hero-btn .icon { width: 22px; height: 22px; flex-shrink: 0; }
.hero-btn strong { display: block; font-size: 14px; }
.hero-btn small { display: block; font-size: 12px; opacity: 0.85; }
.hero-btn-light { background: rgba(255, 255, 255, 0.1); }
.hero-btn-light:hover { background: rgba(255, 255, 255, 0.18); }

.lines { display: grid; gap: 6px; margin-bottom: 6px; }
.line-head, .line-row { display: grid; grid-template-columns: minmax(0, 2.4fr) 70px 110px 100px 36px; gap: 6px; align-items: center; }
.line-head { font-size: 12px; color: var(--muted); font-weight: 600; }
.line-row input { height: 40px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; font: inherit; font-size: 14px; min-width: 0; }
.line-row input:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.line-total { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.line-row .icon-btn { width: 36px; height: 36px; color: var(--muted); }

.totals { display: grid; gap: 4px; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--navy-50); border: 1px solid var(--navy-100); }
.totals > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.totals dt { color: var(--text-2); }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.totals-final { padding-top: 6px; margin-top: 4px; border-top: 2px solid var(--navy-900); }
.totals-final dt, .totals-final dd { font-family: var(--font-brand); font-weight: 800; font-size: 16px; color: var(--navy-900); }

.submission-list { display: grid; }
.submission { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.submission:first-child { border-top: 0; padding-top: 0; }
.submission-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.submission-main small { font-size: 12.5px; color: var(--muted); }
.submission-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.flag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.flag-list .pill { white-space: normal; }
.message-from-rnf { color: var(--warning) !important; font-weight: 600; display: inline-flex; gap: 6px; align-items: flex-start; }
.message-from-rnf .icon { width: 14px; height: 14px; margin-top: 2px; }
.message-from-client { color: var(--teal-700) !important; font-style: italic; }
.warn-list { padding-left: 16px; list-style: disc; display: grid; gap: 4px; font-size: 13.5px; }

@media (max-width: 1100px) {
  .hero-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .hero-buttons { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-btn { padding: 10px; gap: 8px; }
  .hero-btn small { display: none; }
  .hero-btn strong { font-size: 13px; }
  .line-head { display: none; }
  .line-row { grid-template-columns: 1fr 1fr 36px; grid-template-areas: 'd d d' 'q p x' 't t t'; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
  .line-row [data-l="desc"] { grid-area: d; }
  .line-row [data-l="qty"] { grid-area: q; }
  .line-row [data-l="price"] { grid-area: p; }
  .line-row [data-l="total"] { grid-area: t; text-align: left; }
  .line-row .icon-btn { grid-area: x; }
  .submission { flex-direction: column; }
  .submission-side { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}

/* Language switch (BM | EN) */
.lang-switch { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); flex-shrink: 0; }
.lang-switch button { min-width: 38px; min-height: 30px; padding: 2px 8px; border: 0; border-radius: 7px; background: transparent; color: #cfe0ea;
  font: inherit; font-size: 12.5px; font-weight: 800; letter-spacing: 0.04em; cursor: pointer; }
.lang-switch button:hover { color: #fff; }
.lang-switch button.is-active { background: var(--emerald); color: #fff; }
.site-header-right { display: flex; align-items: center; gap: 10px; }

/* In-portal invoice view */
.modal-wide { max-width: 820px; }
.invoice-frame { padding: 28px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 6px 20px rgba(0, 51, 82, 0.08); overflow-x: auto; }
@media (max-width: 640px) {
  .invoice-frame { padding: 14px; }
  .invoice-frame .invoice-sheet { font-size: 13px; }
  .invoice-frame .inv-title { font-size: 21px; }
  .invoice-frame .invoice-sheet th, .invoice-frame .invoice-sheet td { padding: 6px 4px; font-size: 12px; }
  .invoice-frame .invoice-sheet th { letter-spacing: 0; text-transform: none; }
  .invoice-frame .invoice-sheet .n { white-space: normal; }
}

/* ---------------- Phone / tablet / desktop refinements ---------------- */

.bottom-nav, .dt-sort-mobile { display: none; }
.brand-text span { font-size: 11.5px; }
.hero-ring span { font-size: 11px; }

/* Wide tables: first column stays in place while swiping, with a hint above */
.report-table-multi tbody th, .report-table-multi thead th:first-child,
.journey-matrix tbody th, .journey-matrix thead th:first-child { position: sticky; left: 0; z-index: 1; background: #fff; }
.report-table-multi .rt-total th { background: var(--navy-50); }
.journey-matrix thead th:first-child { background: var(--navy-50); }
.journey-matrix tr.is-selected th { background: var(--teal-50); }
.table-wrap.is-scrollable::before { content: 'Swipe sideways to see all columns  →'; position: sticky; left: 0; display: block; padding: 0 0 8px;
  font-size: 12px; font-weight: 600; color: var(--teal-700); white-space: nowrap; }
.table-wrap { -webkit-overflow-scrolling: touch; scrollbar-width: thin; }

@media (max-width: 900px) {
  /* App-style bottom bar on phones and tablets */
  .bottom-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: #00243b; border-top: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18); }
  .bottom-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 4px 2px; border: 0; border-radius: 12px;
    background: none; color: #9fb6c9; font: inherit; font-size: 11.5px; font-weight: 600; text-decoration: none; cursor: pointer; }
  .bottom-link .icon { width: 22px; height: 22px; }
  .bottom-link:hover { color: #fff; }
  .bottom-link.is-active { color: #fff; background: rgba(16, 185, 129, 0.16); }
  .bottom-link.is-active .icon { color: var(--teal-500); }
  .main { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  #toast-root { bottom: calc(82px + env(safe-area-inset-bottom)); }
  .menu-btn { display: none !important; }
  .topbar { padding-left: 16px; }

  /* Touch-friendly controls */
  .dt-sort-mobile { display: inline-flex; }
  .legend-toggle { min-height: 40px; padding: 6px 14px; }
  .btn-sm { min-height: 38px; }
  .select-box select, .search-box input { height: 44px; }
  .checklist input { width: 22px; height: 22px; }
  #sales-chart .chart-tooltip { display: none !important; }
}

@media (max-width: 640px) {
  .report-table-multi { min-width: 0; }
  .report-table-multi tbody th { min-width: 150px; max-width: 180px; white-space: normal; }
  .report-table th, .report-table td { padding: 7px 8px; }
  .largest-link { flex-wrap: wrap; row-gap: 4px; }
  .largest-right { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
  .toolbar { gap: 10px; }
  .dt-sort-mobile { flex: 1 1 100%; }
  .page-head { gap: 12px; }
}

/* ------------------------------- Print ------------------------------- */
/* Printing (or "Save as PDF") from the Reports screen prints only the report. */

@media print {
  body { background: #fff; font-size: 12px; }
  .bottom-nav, .table-wrap.is-scrollable::before { display: none !important; }
  .sidebar, .sidebar-overlay, .main-head, .app-footer, .page-head, .report-picker, .report-controls, #toast-root, #modal-root { display: none !important; }
  .shell, .main, .page, .card { display: block; padding: 0; margin: 0; border: 0; box-shadow: none; max-width: none; }
  .report-doc { max-width: none; }
  .report-demo-banner { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rt-total th, .rt-total td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-wrap { overflow: visible; }
  .report-table-multi { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Corporate statutory & compliance records (My Company) ---------- */
.statutory .st-tabs { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.st-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.st-tab:hover { color: var(--navy-900); border-color: var(--navy-700); }
.st-tab.is-active { background: var(--navy-950); border-color: var(--navy-950); color: #fff; }
.st-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--navy-50); color: var(--navy-900); font-size: 12px; text-align: center; }
.st-tab.is-active .st-count { background: rgba(255, 255, 255, .18); color: #fff; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.st-card { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  transition: box-shadow .2s, border-color .2s; }
.st-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.st-icon { flex-shrink: 0; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--navy-50); color: var(--navy-800); }
.st-icon .icon { width: 26px; height: 26px; }
.st-body { flex: 1; min-width: 0; }
.st-body h3 { margin: 0 0 4px; font-size: 15px; line-height: 1.3; color: var(--navy-950); }
.st-sub { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--teal-600); }
.st-date { margin: 0; font-size: 12.5px; color: var(--muted); }
.st-btn { flex-shrink: 0; background: var(--info-bg); color: #2563eb; border: 1px solid #bfd4f6; white-space: nowrap; }
.st-btn:hover { background: #dfeafb; }
.st-pending { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--neutral-bg); color: var(--neutral); font-size: 12.5px; font-weight: 600; }
.st-pending .icon { width: 14px; height: 14px; }
.st-card.is-pending .st-icon { background: var(--neutral-bg); color: var(--neutral); }
@media (max-width: 640px) {
  .statutory .st-tabs { flex-wrap: nowrap; overflow-x: auto; margin-left: -4px; margin-right: -4px; padding: 0 4px 14px; scrollbar-width: thin; }
  .st-tab { flex-shrink: 0; min-height: 40px; padding: 8px 14px; font-size: 13px; }
  .st-grid { grid-template-columns: 1fr; }
  .st-card { flex-wrap: wrap; padding: 14px; }
  .st-icon { width: 44px; height: 44px; }
  .st-btn, .st-pending { width: 100%; justify-content: center; }
}

/* Client-only demo copy: one portal card, centred */
.portal-cards.portal-cards-single { grid-template-columns: minmax(0, 520px); justify-content: center; }


/* ------------- v8 design review: AR/AP overview, dashboard cards (client portal) ------------- */
.arap-overview { margin-bottom: 0; }
.timing-list .timing-label { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.timing-ok .bar-track span { background: var(--teal-500); }
.timing-watch .bar-track span { background: #d99a2b; }
.timing-late .bar-track span { background: var(--critical); }
.timing-late .bar-list-top strong { color: var(--critical); }
.party-list { display: grid; }
.party-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.party-list li:first-child { border-top: 0; padding-top: 0; }
.party-main { min-width: 0; display: grid; gap: 2px; }
.party-main strong { font-size: 14.5px; color: var(--text); }
.party-main small { font-size: 13px; color: var(--muted); }
.party-side { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.party-side > strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.review-steps { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--info-bg); font-size: 13.5px; color: var(--text-2); list-style: none; }
.review-steps li { display: inline-flex; align-items: center; gap: 6px; }
.review-steps .icon { width: 16px; height: 16px; color: var(--info); }

.insight-todo { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--navy-50, #f4f7fb); font-size: 13.5px; color: var(--text); flex: 0 0 auto !important; }
.insight-todo strong { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

.dash-pair { align-items: start; }
.ac-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 1700px) { .ac-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ac-tile { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: inherit; text-decoration: none; transition: border-color 0.2s; }
.ac-tile:hover { border-color: var(--emerald); }
.ac-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px; background: var(--good-bg); color: var(--good); }
.ac-icon .icon { width: 17px; height: 17px; }
.ac-body { display: grid; gap: 1px; min-width: 0; }
.ac-count { font-family: var(--font-brand); font-size: 22px; line-height: 1.1; color: var(--navy-900); }
.ac-label { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.ac-body small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.ac-action { background: var(--critical-bg); border-color: #f5c9c4; }
.ac-action .ac-icon { background: #fff; color: var(--critical); }
.ac-action .ac-count { color: var(--critical); }
.ac-watch { background: var(--warning-bg); border-color: #f3d3a5; }
.ac-watch .ac-icon { background: #fff; color: var(--warning); }
.ac-watch .ac-count { color: var(--warning); }
.ac-info { background: var(--info-bg); border-color: #bfd4f6; }
.ac-info .ac-icon { background: #fff; color: var(--info); }
.ac-clear .ac-count { color: var(--good); }

.apg-headline { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.apg-headline strong { font-family: var(--font-brand); font-size: 20px; color: var(--navy-900); }
.apg-headline span { font-size: 14px; font-weight: 600; color: var(--teal-700); }
.apg-now { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 6px; padding: 12px 14px; border-radius: 12px; background: var(--info-bg); color: var(--info); }
.apg-now.is-waiting { background: var(--warning-bg); color: var(--warning); }
.apg-now strong { display: block; color: var(--text); font-size: 14.5px; }
.apg-now small { font-size: 13px; color: var(--text-2); }
.apg-steps { display: grid; margin: 8px 0 12px; list-style: none; }
.apg-step { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); }
.apg-step:first-child { border-top: 0; }
.apg-step .icon { width: 17px; height: 17px; color: var(--muted); }
.apg-step small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.apg-completed .icon { color: var(--good); }
.apg-in-progress, .apg-action-required { font-weight: 700; color: var(--text); }
.apg-in-progress .icon { color: var(--info); }
.apg-action-required .icon, .apg-action-required small { color: var(--warning); }
.apg-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

.stock-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stock-stats > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--navy-50, #f4f7fb); }
.stock-stats span { font-size: 12.5px; color: var(--muted); }
.stock-stats strong { font-family: var(--font-brand); font-size: 18px; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.stock-stats .is-watch { background: var(--warning-bg); } .stock-stats .is-watch strong { color: var(--warning); }
.stock-stats .is-critical { background: var(--critical-bg); } .stock-stats .is-critical strong { color: var(--critical); }
.stock-attention { display: grid; margin-bottom: 10px; }
.stock-attention li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.stock-attention li:first-child { border-top: 0; }
.stock-attention strong { display: block; font-size: 14px; }
.stock-attention small { font-size: 12.5px; color: var(--muted); }
.stock-card .btn-block { margin-top: 10px; }

@media (max-width: 640px) {
  .ac-tile { padding: 10px; gap: 8px; }
  .ac-count { font-size: 19px; }
  .ac-body small { display: none; }
  .ac-icon { width: 28px; height: 28px; }
  .party-list li { flex-direction: column; align-items: stretch; }
  .party-side { justify-content: space-between; }
  .apg-step { grid-template-columns: 20px minmax(0, 1fr); row-gap: 0; }
  .apg-step small { grid-column: 2; white-space: normal; }
}
/* ------------- v9: deadlines, cash forecast (client portal) ------------- */
.dl-list { display: grid; }
.dl-item { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.dl-list .dl-item:first-child { border-top: 0; }
.dl-date { display: grid; justify-items: center; padding: 6px 4px; border-radius: 10px; background: var(--info-bg); color: var(--navy-900); line-height: 1.1; }
.dl-date strong { font-family: var(--font-brand); font-size: 20px; }
.dl-date small { font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.dl-you .dl-date { background: var(--warning-bg); } .dl-overdue .dl-date { background: var(--critical-bg); } .dl-done .dl-date { background: var(--good-bg); }
.dl-main { display: grid; gap: 2px; min-width: 0; }
.dl-main strong { font-size: 14.5px; color: var(--text); line-height: 1.35; }
.dl-main small { font-size: 12.5px; color: var(--muted); }
.dl-main .dl-note { color: var(--text-2); }
.dl-side { display: grid; justify-items: end; gap: 4px; }
.dl-when { font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.dl-overdue .dl-when { color: var(--critical); }
.dl-done .dl-main strong { color: var(--text-2); }

.cash-headline { display: grid; gap: 2px; margin-bottom: 12px; }
.cash-headline strong { font-family: var(--font-brand); font-size: 26px; line-height: 1.15; color: var(--good); }
.cash-watch .cash-headline strong { color: var(--warning); } .cash-action .cash-headline strong { color: var(--critical); }
.cash-headline span { font-size: 13.5px; color: var(--text-2); }
.cash-gauge { position: relative; display: block; height: 10px; border-radius: 999px; background: var(--navy-100); overflow: hidden; }
.cash-gauge span { display: block; height: 100%; border-radius: 999px; background: var(--teal-500); }
.cash-watch .cash-gauge span { background: #d99a2b; } .cash-action .cash-gauge span { background: var(--critical); }
.cash-gauge i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--surface); }
.cash-scale { position: relative; display: flex; justify-content: space-between; margin: 4px 0 12px; font-size: 11.5px; color: var(--muted); }
.cash-scale span:nth-child(2) { position: absolute; left: 25%; transform: translateX(-50%); }
.cash-scale span:nth-child(3) { position: absolute; left: 50%; transform: translateX(-50%); }
.cash-meaning { padding: 10px 12px; border-radius: 10px; background: var(--good-bg); font-size: 13.5px; color: var(--text); margin-bottom: 10px; }
.cash-watch .cash-meaning { background: var(--warning-bg); } .cash-action .cash-meaning { background: var(--critical-bg); }
.cash-card .btn-block, .deadlines-card .btn-block { margin-top: 12px; }
.text-good { color: var(--good); }

@media (max-width: 640px) {
  .dl-item { grid-template-columns: 50px minmax(0, 1fr); gap: 10px; }
  .dl-item { align-items: start; }
  .dl-side { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
  .dl-side .btn { flex-basis: 100%; justify-content: flex-start; padding-left: 0; }
}
/* Let pop-up buttons wrap instead of spilling out when there are many (e.g. invoice details). */
.modal-footer { flex-wrap: wrap; }
.cash-card .detail-list strong { white-space: nowrap; }

/* ------------- v10: Simple / Full dashboard view, where my sales money goes ------------- */
.view-switch { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: -4px 0 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.view-switch .segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--navy-100); border: 0; }
.view-switch .segmented button { min-height: 34px; padding: 6px 16px; border: 0; border-radius: 999px; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--text-2); cursor: pointer; }
.view-switch .segmented button.is-active { background: var(--surface); color: var(--navy-900); box-shadow: var(--shadow); }
.dashboard .simple-only { display: none; }
.dashboard.is-simple .simple-only { display: block; }
.dashboard.is-simple .full-only { display: none; }
.full-only { display: grid; gap: 24px; }

/* v12: Simple view keeps one short line per card; the longer explanations show in Full view only. */
.dashboard .dash-brief { display: none; }
.dashboard.is-simple .dash-brief { display: block; }
.dashboard.is-simple .dash-detail { display: none !important; }
.dashboard.is-simple .insight { gap: 6px; padding: 16px; }
.dashboard.is-simple .insight h3 { font-size: 16px; }
.dashboard.is-simple .insight-short { flex: 1; font-size: 14px; color: var(--text-2); }
.dashboard.is-simple .big-change { margin-top: 2px; }
.dashboard.is-simple .ac-tile { align-items: center; }
.verdict { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 16px; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid #e2e8f2; border-left: 6px solid var(--good); box-shadow: var(--shadow); }
.verdict-watch { border-left-color: #d99a2b; } .verdict-action { border-left-color: var(--critical); }
.verdict-light { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px var(--good-bg); }
.verdict-watch .verdict-light { background: #d99a2b; box-shadow: 0 0 0 4px var(--warning-bg); }
.verdict-action .verdict-light { background: var(--critical); box-shadow: 0 0 0 4px var(--critical-bg); }
.verdict p { flex: 1 1 260px; margin: 0; font-size: 16px; color: var(--text-2); }
.verdict p strong { font-family: var(--font-brand); color: var(--navy-900); }
.verdict-counts { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.vc { padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.vc-action { background: var(--critical-bg); color: var(--critical); }
.vc-watch { background: var(--warning-bg); color: var(--warning); }
.vc-good { background: var(--good-bg); color: var(--good); }
.show-more { text-align: center; }
.show-more .btn { white-space: normal; }

.money-split li .bar-track span { background: var(--navy-700); }
.money-split .ms-profit .bar-track span { background: var(--teal-500); }
.money-split .ms-profit strong { color: var(--good); }
.money-split .ms-loss .bar-track span { background: var(--critical); }
.money-split .ms-loss strong { color: var(--critical); }
.money-split-card .btn-block { margin-top: 12px; }
.money-split-card .insight-todo { margin-top: 14px; }
@media (max-width: 640px) {
  .view-switch { justify-content: space-between; }
}
/* ------------- v11: more attractive Money Earned vs Money Spent chart ------------- */
.bar-sales { fill: url(#rnf-grad-sales); }
.bar-expenses { fill: url(#rnf-grad-expenses); }
.legend-swatch.bar-sales { background: linear-gradient(180deg, #10b981, #047857); }
.legend-swatch.bar-expenses { background: linear-gradient(180deg, #1a5a85, #003352); }
.legend-swatch.line-profit { height: 4px; width: 16px; border-radius: 999px; background: #b7791f; box-shadow: 0 0 0 0 transparent; position: relative; }
.legend-swatch.line-profit::after { content: ''; position: absolute; left: 4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #b7791f; border: 2px solid #fff; box-sizing: border-box; }
.legend-toggle .legend-swatch.line-profit { margin: 0 2px; }
.profit-line { fill: none; stroke: #b7791f; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.profit-area { fill: url(#rnf-grad-profit); }
.profit-dot { fill: #b7791f; stroke: #fff; stroke-width: 2; transition: opacity 0.2s; }
.profit-dot.is-dim { opacity: 0.3; }
.profit-label { fill: var(--navy-900); font-size: 12px; font-weight: 700; font-family: var(--font); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.chart-callout text { fill: var(--navy-900); font-size: 11.5px; font-weight: 700; font-family: var(--font); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.chart-callout.is-dim { opacity: 0.3; }
.chart-band { fill: rgba(16, 185, 129, 0.08); }
.chart-grid { stroke: #eef2f7; }

/* Bars grow up, then the profit line fades in, on the first showing only */
.chart-svg.is-intro .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: bar-grow 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.chart-svg.is-intro .profit-layer, .chart-svg.is-intro .chart-callout { animation: chart-fade 0.5s ease-out 0.55s both; }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes chart-fade { from { opacity: 0; } to { opacity: 1; } }

/* Twelve-month summary above the chart */
.chart-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.cs-tile { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--navy-50, #f4f7fb); min-width: 0; }
.cs-label { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.cs-label i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.cs-sales .cs-label i { background: #059669; } .cs-expenses .cs-label i { background: #0a4468; }
.cs-profit .cs-label i { background: #b7791f; border-radius: 50%; } .cs-best .cs-label i { background: none; width: auto; height: auto; }
.cs-best .cs-label i::before { content: '★'; color: #b7791f; font-style: normal; font-size: 12px; }
.cs-tile strong { font-family: var(--font-brand); font-size: 22px; line-height: 1.2; color: var(--navy-900); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-tile small { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) {
  .chart-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .cs-tile strong { font-size: 19px; }
}#sales-chart .legend-toggles { flex-wrap: wrap; min-width: 0; }
@media (max-width: 640px) {
  #sales-chart .legend-toggle { padding: 6px 10px; font-size: 12.5px; }
}

/* ------------- v13: official receipts and My Customers ------------- */
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--good-bg); cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--teal-600); flex: 0 0 auto; }
.check-row span { display: grid; gap: 2px; }
.check-row small { color: var(--text-2); font-size: 13px; }
.receipt-side { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  #ar-receipts .detail-list li { flex-direction: column; align-items: flex-start; }
  .receipt-side { justify-content: flex-start; }
}

/* ------------- v14: full report list, grouped like the accounting system's report menu ------------- */
.report-group { grid-column: 1 / -1; margin: 6px 0 -2px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.report-group:first-child { margin-top: 0; }
.report-table td:not(.num) { text-align: left; }
.report-sum { white-space: nowrap; }

/* ------------- v15: simpler report picker for business owners (Client Portal) ------------- */
.report-picker-main { gap: 16px; }
.report-picker-main .report-option { padding: 20px; gap: 14px; }
.report-picker-main .report-option strong { font-size: 16px; }
.report-picker-main .report-option small { font-size: 13.5px; margin-top: 2px; }
.report-picker-main .report-option-icon { width: 46px; height: 46px; border-radius: 12px; }
.report-more { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.report-more > summary { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; list-style: none; }
.report-more > summary::-webkit-details-marker { display: none; }
.report-more > summary > span:nth-child(2) { flex: 1; }
.report-more > summary strong { display: block; font-size: 15px; color: var(--navy-900); }
.report-more > summary small { display: block; font-size: 13px; color: var(--muted); }
.report-more > summary > .icon { width: 20px; height: 20px; color: var(--muted); transition: transform 0.2s; }
.report-more[open] > summary > .icon { transform: rotate(90deg); }
.report-more-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 28px; padding: 4px 20px 20px; border-top: 1px solid var(--border); }
.report-more-groups .report-group { margin: 14px 0 6px; }
.report-more-groups ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.report-link { width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--navy-800); text-align: left; cursor: pointer; }
.report-link:hover { background: var(--navy-50, #f4f7fb); color: var(--teal-700); }
.report-link.is-active { background: var(--teal-50); color: var(--teal-700); box-shadow: inset 3px 0 0 var(--teal-600); }
@media (max-width: 1100px) { .report-more-groups { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .report-more-groups { grid-template-columns: 1fr; }
  .report-picker-main .report-option { padding: 14px 16px; }
}

/* ------------- v16: My Business Overview, roomier "wow" design ------------- */
.dashboard-simple { gap: 36px; }

/* Hero: two columns (welcome + verdict | period + profit ring), soft glows */
.hero-wow { padding: 34px 36px 30px; border-radius: 24px; box-shadow: 0 24px 60px rgba(0, 36, 59, 0.28); }
.hero-wow::before, .hero-wow::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; filter: blur(10px); }
.hero-wow::before { width: 420px; height: 420px; right: -120px; top: -180px; background: radial-gradient(circle, rgba(16, 185, 129, 0.35), transparent 65%); }
.hero-wow::after { width: 360px; height: 360px; left: -140px; bottom: -220px; background: radial-gradient(circle, rgba(56, 189, 248, 0.18), transparent 65%); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; }
.hero-wow .hero-title { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.1; }
.hero-wow .hero-meta { margin-top: 10px; font-size: 15px; }
.hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 18px; }
.hero-wow .hero-buttons { z-index: 1; margin-top: 28px; gap: 14px; }
.hero-wow .hero-btn { padding: 16px 18px; border-radius: 16px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); }
.hero-wow .hero-btn-light { background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.14); backdrop-filter: blur(8px); }
.hero-wow .hero-btn strong { font-size: 15px; }

/* The verdict sits inside the hero as a glass panel */
.hero-wow .verdict { margin: 22px 0 0; max-width: 640px; padding: 14px 18px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); border-left-width: 1px; box-shadow: none; backdrop-filter: blur(8px); border-radius: 16px; }
.hero-wow .verdict p { color: #cfe0ea; font-size: 15.5px; }
.hero-wow .verdict p strong { color: #fff; }
.hero-wow .verdict-light { animation: pulse-light 2.2s ease-in-out infinite; }
.hero-wow .vc { background: rgba(255, 255, 255, 0.92); }
@keyframes pulse-light { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }

/* Profit ring */
.hero-ring-card { position: relative; width: 168px; height: 168px; }
.margin-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.margin-ring circle { fill: none; stroke-width: 11; }
.ring-track { stroke: rgba(255, 255, 255, 0.12); }
.ring-value { stroke: url(#rnf-ring-grad); stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.55)); animation: ring-draw 1.2s cubic-bezier(.2, .8, .2, 1) both 0.2s; }
.hero-ring-card.is-loss .ring-track { stroke: rgba(248, 113, 113, 0.35); }
@keyframes ring-draw { from { stroke-dashoffset: var(--ring-dash); } to { stroke-dashoffset: 0; } }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 26px; }
.ring-text strong { font-family: var(--font-brand); font-size: 30px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.ring-text span { font-size: 11.5px; line-height: 1.3; color: #a9c4d6; }
.hero-ring-card.is-loss .ring-text strong { color: #fca5a5; }

/* Key numbers: bigger cards with an icon bubble and a 6-month trend line */
.big-numbers { gap: 20px; }
.big-number { gap: 8px; padding: 24px 24px 20px; border-radius: 20px; border: 1px solid #e6edf5; box-shadow: 0 10px 30px rgba(0, 51, 82, 0.07); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.big-number::before { display: none; }
.big-label { gap: 10px; font-size: 14.5px; }
.big-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: #e7f8f1; }
.big-icon .icon { width: 20px; height: 20px; color: var(--teal-600); }
.big-navy .big-icon { background: #e6eef6; } .big-navy .big-icon .icon { color: var(--navy-800); }
.big-good .big-icon { background: #fdf3dc; } .big-good .big-icon .icon { color: #b7791f; }
.big-bad .big-icon { background: var(--critical-bg); } .big-bad .big-icon .icon { color: var(--critical); }
.big-bank .big-icon { background: #e3f4fb; } .big-bank .big-icon .icon { color: #0b7aa6; }
.big-value { font-size: clamp(24px, 2.2vw, 31px); margin-top: 4px; }
.big-spark { display: block; margin-top: auto; padding-top: 10px; }
.big-spark svg { display: block; width: 100%; height: 38px; overflow: visible; }
.big-spark small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.spark-line { fill: none; stroke: var(--teal-600); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 400; animation: spark-draw 1.1s ease-out both 0.3s; }
.spark-area { fill: rgba(16, 185, 129, 0.12); }
.big-navy .spark-line { stroke: var(--navy-800); } .big-navy .spark-area { fill: rgba(10, 68, 104, 0.1); }
.big-good .spark-line { stroke: #b7791f; } .big-good .spark-area { fill: rgba(183, 121, 31, 0.12); }
.big-bad .spark-line { stroke: var(--critical); } .big-bad .spark-area { fill: rgba(220, 38, 38, 0.1); }
@keyframes spark-draw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
.acct-bar { display: flex; gap: 3px; height: 12px; margin-top: 14px; }
.acct-bar i { display: block; border-radius: 6px; background: #0b7aa6; }
.acct-bar i:nth-child(2) { background: #38bdf8; } .acct-bar i:nth-child(3) { background: #a5d8f0; } .acct-bar i:nth-child(n+4) { background: #cbe7f4; }
.acct-bar + small { margin-top: 10px; }

/* Section titles with a short line underneath */
.dashboard .section-title { margin-bottom: 18px; align-items: flex-end; }
.dashboard .section-title h2 { font-size: 24px; }
.section-sub { margin: 4px 0 0; font-size: 14.5px; color: var(--muted); }

/* Insight cards: softly tinted by meaning, more room */
.dashboard .insight-grid { gap: 20px; }
.dashboard .insight, .dashboard.is-simple .insight { padding: 22px 22px 20px; gap: 10px; border-radius: 20px; border: 1px solid #e6edf5; border-top-width: 1px; box-shadow: 0 10px 28px rgba(0, 51, 82, 0.06); transition: transform 0.2s, box-shadow 0.2s; }
.dashboard .insight:hover { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(0, 51, 82, 0.11); }
.dashboard .insight-good { background: linear-gradient(160deg, #ecfdf5 0%, #fff 55%); }
.dashboard .insight-watch { background: linear-gradient(160deg, #fff7e6 0%, #fff 55%); }
.dashboard .insight-action { background: linear-gradient(160deg, #fef2f2 0%, #fff 55%); }
.dashboard .insight-icon { width: 44px; height: 44px; border-radius: 14px; }
.dashboard .insight-tone { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.dashboard.is-simple .insight h3 { font-size: 17px; }
.dashboard.is-simple .insight-short { font-size: 14.5px; }

/* Cards lower on the page: more padding and rounder corners */
.dashboard .card { padding: 26px; border-radius: 20px; border-color: #e6edf5; box-shadow: 0 10px 30px rgba(0, 51, 82, 0.06); }
.dashboard .grid-2 { gap: 28px; }
.dashboard .view-switch { margin: -12px 0 -8px; }

@media (max-width: 1100px) {
  .hero-wow .hero-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-right { flex-direction: row-reverse; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .hero-ring-card { width: 136px; height: 136px; }
  .ring-text strong { font-size: 24px; }
}
@media (max-width: 640px) {
  .dashboard-simple { gap: 26px; }
  .hero-wow { padding: 24px 20px 20px; border-radius: 20px; }
  .hero-right { flex-direction: column; align-items: stretch; }
  .hero-right .segmented { align-self: stretch; }
  .hero-right .segmented button { flex: 1; }
  .hero-ring-card { align-self: center; }
  .hero-wow .hero-btn { padding: 12px 14px; }
  .big-numbers { gap: 14px; }
  .big-number { padding: 18px; }
  .dashboard .card { padding: 20px; }
  .dashboard .section-title h2 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .ring-value, .spark-line, .hero-wow .verdict-light { animation: none; }
}
@media (max-width: 640px) {
  .hero-wow .verdict { margin-top: 16px; padding: 12px 14px; }
  .hero-wow .verdict p { font-size: 14.5px; }
  .hero-right { gap: 14px; }
  .hero-ring-card { width: 120px; height: 120px; }
  .ring-text strong { font-size: 22px; }
  .ring-text span { font-size: 10.5px; padding: 0 4px; }
  .hero-wow .hero-buttons { margin-top: 18px; }
}

/* ------------- v17: custom period on My Business Overview ------------- */
.segmented .period-custom { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.segmented .period-custom .icon { width: 15px; height: 15px; }
.period-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
@media (max-width: 640px) {
  .hero-right .segmented { flex-wrap: wrap; }
  .hero-right .segmented .period-custom { flex-basis: 100%; justify-content: center; }
}

/* Long company names in the sidebar chip: cut with "…" instead of spilling out of the closed drawer on phones. */
.sidebar { overflow-x: hidden; }
.company-chip-text { min-width: 0; }
.company-chip-text strong, .company-chip-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Hidden help bubbles must not widen the page on phones (found at 375 px on My Stock). */
.help-bubble { display: none; max-width: min(240px, calc(100vw - 32px)); }
.help-tip:hover .help-bubble, .help-tip:focus .help-bubble { display: block; }
