:root {
  /* Rangoli desk — light, colourful CA practice UI.
     Peacock / marigold / lotus / indigo ribbon is the signature. */
  --peacock: #0d8a7b;
  --marigold: #e8a317;
  --lotus: #e45a73;
  --indigo: #3b6cb5;
  --ink: #1b2a4a;
  --wash: #f0f6fb;
  --paper: #ffffff;
  --muted: #5a6b84;
  --rule: #d5e1ee;
  --rule-strong: #b7c9dc;
  --navy: #2c4a7a;
  --navy-deep: #1b2a4a;
  --navy-mid: #3b6cb5;
  --navy-soft: #6b90c9;
  --accent: #0d8a7b;
  --accent-deep: #0a6f63;
  --accent-bright: #2bb8a8;
  --accent-soft: #d5f3ee;
  --cream: #f0f6fb;
  --cream-dark: #e4eef6;
  --gold: #e8a317;
  --gold-soft: #fff3d0;
  --amber: #e8a317;
  --amber-soft: #fff6dc;
  --seal: #e45a73;
  --seal-hover: #c9445e;
  --ok: #0a6f63;
  --ok-bg: #d5f3ee;
  --err: #c0364a;
  --err-bg: #fde8ec;
  --warn-bg: #fff6dc;
  --shadow: 0 1px 2px rgba(27, 42, 74, 0.04), 0 10px 28px rgba(59, 108, 181, 0.08);
  --shadow-lift: 0 6px 16px rgba(27, 42, 74, 0.08), 0 18px 40px rgba(59, 108, 181, 0.12);
  --sidebar: 248px;
  --control-h: 2.3rem;
  --radius: 10px;
  --radius-lg: 14px;
  --sans: "Figtree", "Segoe UI", system-ui, sans-serif;
  --serif: "Fraunces", "Georgia", serif;
  --mono: "IBM Plex Mono", "Consolas", monospace;
  --rangoli: linear-gradient(90deg, var(--peacock) 0 25%, var(--marigold) 25% 50%, var(--lotus) 50% 75%, var(--indigo) 75% 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--wash);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 31px,
    rgba(59, 108, 181, 0.07) 31px 32px
  );
  background-attachment: fixed;
  min-height: 100vh;
  letter-spacing: 0.01em;
}

a { color: var(--navy-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: var(--navy-deep);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: inset -3px 0 0 var(--gold);
}
.brand {
  display: block;
  padding: 1.05rem 1rem 0.9rem;
  border-bottom: 1px solid rgba(228, 212, 180, 0.16);
  color: var(--cream);
  text-decoration: none;
}
.brand:hover { color: var(--cream); text-decoration: none; }
.brand-kicker {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.brand-name {
  display: block;
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.15;
  margin-top: 0.18rem;
}
.brand-sub { display: none; }

.nav { padding: 0.15rem 0 0.6rem; flex: 1; overflow: auto; }
.nav-group {
  padding: 0.2rem 0 0.35rem;
  border-top: 1px solid rgba(228, 212, 180, 0.1);
}
.nav-group:first-child { border-top: 0; }
.nav-kicker {
  display: block;
  padding: 0.5rem 1rem 0.18rem;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.nav a {
  display: block;
  color: rgba(238, 241, 238, 0.88);
  text-decoration: none;
  padding: 0.32rem 1rem 0.32rem 0.85rem;
  font-size: 0.86rem;
  border-left: 3px solid transparent;
  line-height: 1.3;
}
.nav a:hover {
  background: rgba(246, 241, 230, 0.06);
  color: var(--cream);
  text-decoration: none;
}
.nav a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}
.nav a.active {
  background: var(--paper);
  border-left-color: var(--gold);
  color: var(--navy);
  font-weight: 600;
}
.nav a.nav-child {
  padding-left: 1.35rem;
  font-size: 0.82rem;
  color: rgba(238, 241, 238, 0.72);
}
.nav a.nav-dl {
  color: var(--gold-soft);
  font-size: 0.8rem;
}
.nav a.nav-dl:hover { color: var(--gold); }
.nav .nav-label,
.nav a.nav-label,
.nav .nav-sublabel { display: none; }
.sidebar-foot {
  padding: 0.75rem 1rem 0.95rem;
  font-size: 0.7rem;
  line-height: 1.4;
  color: rgba(246,241,230,0.55);
  border-top: 1px solid rgba(228, 212, 180, 0.14);
}
.sidebar-fy {
  color: var(--gold-soft);
  font-family: var(--mono);
  font-size: 0.68rem;
  margin-bottom: 0.15rem;
}
.sidebar-status {
  margin: 0.25rem 0 0.4rem;
  color: rgba(246,241,230,0.7);
}
.token-copy {
  min-height: 1.7rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  margin-left: 0.35rem;
}
.chips + p.muted { display: none; }
.mis-top .chips + p.muted, .mis-top > p.muted { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .fy-pill {
  font-family: var(--serif);
  font-size: 0.92rem;
  color: var(--navy);
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  padding: 0.28rem 0.75rem;
  border-radius: 99px;
  min-height: var(--control-h);
}
.topbar form { margin: 0; }
.topbar select {
  min-height: var(--control-h);
  width: auto;
  max-width: 22rem;
  border-radius: var(--radius);
}
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 0.85rem; color: var(--muted); }
.content { padding: 1.5rem 1.75rem 3rem; flex: 1; }
.page-foot {
  padding: 0.8rem 1.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0 0 0.4rem; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.2rem; }
.lede { color: var(--muted); margin: 0 0 1.2rem; max-width: 46rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-h);
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--navy);
  padding: 0.35rem 1rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  border-radius: var(--radius);
  white-space: nowrap;
}
.btn:hover { background: var(--navy-mid); border-color: var(--navy-mid); text-decoration: none; color: #fff; }
.btn:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
.btn-ghost {
  background: var(--paper);
  color: var(--navy);
  border-color: var(--rule-strong);
  font-weight: 500;
}
.btn-ghost:hover { background: var(--cream-dark); color: var(--navy); border-color: var(--navy-soft); }
.btn-gold {
  background: var(--seal);
  border-color: var(--seal);
  color: #fff;
  font-weight: 600;
}
.btn-gold:hover { background: var(--seal-hover); border-color: var(--seal-hover); color: #fff; }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:hover { background: #a04545; color: #fff; }
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1.25rem;
  margin-bottom: 1rem;
}
.card h2 {
  margin: 0 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.08rem;
}
.card.table-scroll { overflow-x: auto; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; margin-bottom: 1.2rem; }
.kpi {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--navy);
  border-radius: var(--radius);
  padding: 0.8rem 1rem 0.9rem;
  box-shadow: var(--shadow);
}
.kpi .lbl { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi .val { font-family: var(--serif); font-size: 1.28rem; margin-top: 0.3rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi .val.neg { color: var(--err); }

table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th {
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--navy);
  color: var(--cream);
  padding: 0.55rem 0.7rem;
}
table.data td {
  padding: 0.48rem 0.7rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}
table.data tbody tr:nth-child(even) { background: var(--cream); }
table.data tbody tr:hover { background: var(--gold-soft); }
table.data .num, .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-family: var(--mono);
  font-size: 0.86rem;
}
table.data tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
  background: var(--cream-dark);
}
.group-row td { background: var(--navy-deep) !important; color: var(--cream); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }

.chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0.55rem 0 0.9rem;
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  vertical-align: middle;
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  padding: 0.3rem 0.85rem;
  border: 0;
  border-right: 1px solid var(--rule);
  color: var(--navy);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 0;
}
.chip:last-child { border-right: 0; }
button.chip {
  font-family: var(--sans);
  cursor: pointer;
  background: var(--paper);
}
button.chip.active,
button.chip.active:hover {
  background: var(--navy);
  color: #fff;
}
.chip:hover { background: var(--cream-dark); text-decoration: none; color: var(--navy); }
.chip.active { background: var(--navy); color: #fff; font-weight: 600; }
.chip.active:hover { background: var(--navy-mid); color: #fff; }

.flash { padding: 0.7rem 1rem; margin-bottom: 0.8rem; border: 1px solid var(--rule); }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: #b7d2c3; }
.flash.error { background: var(--err-bg); color: var(--err); border-color: #e0b8b4; }

label { display: block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; margin: 0.7rem 0 0.25rem; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%;
  max-width: 28rem;
  min-height: var(--control-h);
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: #fff;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(156, 59, 50, 0.35);
  border-color: var(--navy);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; max-width: 40rem; }
.radio-row { display: flex; gap: 1rem; margin-top: 0.4rem; }
.radio-row label { font-weight: 500; display: inline; }

.badge {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border: 1px solid var(--gold);
  color: var(--navy);
  background: var(--gold-soft);
}
.badge-ok { background: var(--ok-bg); border-color: #b7d2c3; color: var(--ok); }
.badge-off { background: var(--cream-dark); border-color: var(--rule); color: var(--muted); }
code, .token {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--cream);
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--rule);
}
.install-steps ol { margin: 0.35rem 0 0; padding-left: 1.25rem; }
.install-steps li { margin: 0.35rem 0; }
.empty {
  padding: 1.4rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--rule);
  background: var(--paper);
}
.toolbar { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 0.8rem; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
hr.rule { border: 0; border-top: 1px solid var(--gold); margin: 0.4rem 0 1rem; width: 4rem; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--wash);
  background-image:
    radial-gradient(900px 520px at 8% -12%, rgba(13, 138, 123, 0.22), transparent 58%),
    radial-gradient(720px 480px at 100% 0%, rgba(228, 90, 115, 0.16), transparent 52%),
    radial-gradient(820px 520px at 78% 110%, rgba(232, 163, 23, 0.22), transparent 55%);
}
.login-card {
  width: 26rem;
  background: var(--paper);
  padding: 2.2rem 2rem 1.6rem;
  border-top: 5px solid transparent;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  position: relative;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--rangoli);
}
.login-card h1 { font-size: 1.9rem; }
.login-card .btn { width: 100%; max-width: none; margin-top: 1.1rem; padding: 0.65rem; }
.login-foot { margin-top: 1.4rem; font-size: 0.75rem; color: var(--muted); text-align: center; }

.report-head {
  border-bottom: 2px solid var(--navy);
  padding-bottom: 0.75rem;
  margin-bottom: 1.15rem;
}
.report-head .firm {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--navy);
}
.report-head h1 { margin-top: 0.2rem; }
.report-head p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.9rem; }

.tab-rail,
.icai-tabs-primary {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--paper);
  padding: 0 0.35rem;
  margin: 0 0 1.15rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.tab-rail a,
.icai-tabs-primary a {
  flex: 0 0 auto;
  padding: 0.72rem 1.1rem 0.68rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.tab-rail a:hover,
.icai-tabs-primary a:hover {
  color: var(--ink);
  text-decoration: none;
  background: var(--wash);
}
.tab-rail a.active,
.tab-rail a[aria-current="page"],
.icai-tabs-primary a.active,
.icai-tabs-primary a[aria-current="page"] {
  color: var(--navy);
  font-weight: 600;
  background: var(--paper);
  border-bottom-color: var(--gold);
}
.tab-rail a:focus-visible,
.icai-tabs-primary a:focus-visible,
.icai-tabs-sub a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.icai-chrome {
  margin: 0 0 1.15rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}
.icai-chrome-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  padding: 0.65rem 1rem 0.55rem;
  background: var(--paper);
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.icai-chrome-go { margin-left: auto; }
.icai-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--peacock);
  font-weight: 600;
}
.icai-chrome-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.icai-tabs { margin: 0; }
.icai-chrome .icai-tabs-primary {
  margin: 0;
}
.icai-tabs-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.5rem 0.7rem 0.55rem;
  background: var(--paper);
  border-top: 1px solid var(--rule);
}
.icai-tabs-sub a {
  padding: 0.5rem 0.85rem 0.45rem;
  font-size: 0.86rem;
  color: var(--muted);
  text-decoration: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.icai-tabs-sub a:hover {
  color: var(--navy);
  background: transparent;
  text-decoration: none;
}
.icai-tabs-sub a.active,
.icai-tabs-sub a[aria-current="page"] {
  background: transparent;
  color: var(--navy);
  font-weight: 600;
  border-bottom-color: var(--seal);
}
.icai-tabs-sub.wp-files a {
  border: 1px solid var(--rule);
  background: var(--cream);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  color: var(--navy);
  text-decoration: none;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--rule);
}
.icai-tabs-sub.wp-files a:hover { background: #fff; color: var(--navy); text-decoration: none; }
.icai-tabs-sub.wp-files a.active,
.icai-tabs-sub.wp-files a[aria-current="page"] {
  background: var(--navy);
  color: var(--paper);
  border-color: var(--navy);
  font-weight: 600;
}
.icai-block {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.8rem;
  background: var(--warn-bg);
  border: 1px solid var(--gold);
  color: var(--navy);
  font-size: 0.86rem;
}

.report-tabs {
  display: flex;
  gap: 0.15rem;
  border-bottom: 2px solid var(--navy);
  margin: 0 0 1.25rem;
}
.report-tabs a {
  padding: 0.5rem 1.05rem 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
}
.report-tabs a:hover { color: var(--navy); text-decoration: none; }
.report-tabs a.active {
  color: var(--navy);
  font-weight: 600;
  border-bottom-color: var(--gold);
}
.report-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}
.report-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--navy);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.2rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 8.2rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.report-card:hover {
  border-color: var(--navy);
  border-left-color: var(--seal);
  box-shadow: 0 8px 22px rgba(16, 31, 39, 0.1);
  text-decoration: none;
}
.report-card-kind {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.report-card h2 {
  font-family: var(--serif);
  font-size: 1.16rem;
  margin: 0;
  color: var(--navy);
}
.report-card .rule { margin: 0.4rem 0 0.55rem; }
.report-card p { margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.45; flex: 1; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.bs-col h3 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule); padding-bottom: 0.3rem; }

.status-dot {
  display: inline-block;
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: #9aa8b0;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.status-dot.on { background: #2d5a45; }
.win-steps { margin: 0.4rem 0 1rem; padding-left: 1.25rem; }
.win-steps li { margin: 0.4rem 0; line-height: 1.45; }
.btn-row form { display: inline; }
#sync-log td:nth-child(3),
#sync-log th:nth-child(3) { white-space: nowrap; }

.vouch-lines { font-size: 0.8rem; color: var(--muted); margin: 0.15rem 0 0; padding-left: 0; list-style: none; }
.vouch-lines li { display: flex; justify-content: space-between; gap: 1rem; }

@media print {
  .sidebar, .topbar, .no-print, .chips, .flash, .toolbar { display: none !important; }
  .app-shell { display: block; }
  .main { width: 100%; }
  .content { padding: 0.4rem 0.6rem 1.2rem; }
  body { background: #fff !important; color: #163445; }
  .card { box-shadow: none; border: 0; padding: 0; background: #fff; }
  .nav { display: none !important; }
  table.data th {
    color: #f6f1e6 !important;
    background: #163445 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  table.data tbody tr:nth-child(even) {
    background: #ebe3d2 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  table.data tfoot td {
    background: #ebe3d2 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  a { color: #163445; text-decoration: none; }
  .page-foot {
    display: block !important;
    background: transparent;
    border-top: 1px solid #b08d57;
    color: #163445;
    padding-top: 0.7rem;
  }
  .report-head { border-bottom: 2px solid #163445; }
}
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    box-shadow: inset 0 -3px 0 var(--gold);
  }
  .brand { padding: 0.7rem 1rem 0.55rem; }
  .brand-name { font-size: 1.12rem; }
  .nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.2rem 0.4rem 0.45rem;
    gap: 0;
  }
  .nav-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    border-top: 0;
    border-left: 1px solid rgba(228, 212, 180, 0.14);
    padding: 0 0.2rem;
  }
  .nav-group:first-child { border-left: 0; }
  .nav-kicker {
    padding: 0 0.35rem 0 0.45rem;
    white-space: nowrap;
  }
  .nav a {
    white-space: nowrap;
    padding: 0.4rem 0.55rem;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }
  .nav a.active {
    background: var(--paper);
    color: var(--navy);
    border-bottom-color: var(--gold);
  }
  .nav a.nav-child { display: none; }
  .sidebar-foot { display: none; }
  .form-grid, .two-col { grid-template-columns: 1fr; }
}

.recon {
  margin: 0.85rem 0 1.15rem;
  max-width: 48rem;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.recon-head {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--navy);
  padding: 0.35rem 0.7rem;
  font-weight: 600;
}
.recon-table { margin: 0; }
.recon-table th {
  font-size: 0.78rem;
}
.recon-note {
  margin: 0;
  padding: 0.35rem 0.7rem 0.45rem;
  font-size: 0.8rem;
  border-top: 1px solid var(--rule);
}
.recon-note.ok { color: var(--ok); background: var(--ok-bg); }
.recon-note.diff { color: var(--err); background: var(--err-bg); }
@media print {
  .recon { break-inside: avoid; border-color: #d4cbb8; }
  .recon-head {
    background: #163445 !important;
    color: #f6f1e6 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .recon-note.ok, .recon-note.diff {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.fy-form { margin: 0; }
select.fy-pill {
  font-family: var(--serif);
  font-size: 0.92rem;
  color: var(--navy);
  border: 1px solid var(--gold-soft);
  background: var(--cream);
  padding: 0.2rem 0.7rem;
  border-radius: 99px;
  width: auto;
  max-width: 12rem;
  appearance: auto;
  cursor: pointer;
}
h2.hub-kicker {
  margin: 1.4rem 0 0.5rem;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.map-banner {
  font-family: var(--serif);
  font-size: 1.12rem;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--navy);
  border-radius: var(--radius);
}
.map-banner.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #b7d2c3;
}
.map-desk { padding-top: 0.55rem; }
.map-filters {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0 0.85rem;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0.7rem;
}
.map-filters select {
  width: auto;
  max-width: 18rem;
}
#map-find {
  min-width: 16rem;
  max-width: 22rem;
  width: auto;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--rule);
  background: #fff;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink);
}
.map-status { display: inline-flex; flex-wrap: wrap; gap: 0; }
.map-status .chip { min-height: var(--control-h); }
.map-group-assign {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.map-group-assign select { max-width: 16rem; width: auto; }
table.data tbody tr.map-group td {
  background: rgba(22, 52, 69, 0.1);
  font-weight: 600;
  color: var(--navy);
}
table.data tbody tr.map-group:hover td {
  background: rgba(22, 52, 69, 0.16);
}
table.data tbody tr.map-group td strong { color: var(--navy); }
.map-ledger-name { padding-left: 1.15rem; }
.map-actions { margin-left: auto; }
@media (max-width: 860px) {
  .map-filters {
    flex-direction: column;
    align-items: stretch;
    position: static;
  }
  .map-filters select,
  #map-find {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .map-actions { margin-left: 0; }
}
tr.unmapped-row td { background: var(--err-bg); }
.icai-stmt td.indent { padding-left: 1.6rem; }
.icai-stmt tr.total-row td {
  font-weight: 700;
  border-top: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
  background: var(--cream-dark);
}
.icai-notes {
  margin-top: 1.4rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule);
  font-size: 0.86rem;
}
.icai-notes h2 { font-size: 1rem; }
.icai-notes p { margin: 0.25rem 0; color: var(--muted); }
.unmapped-block {
  border: 1px solid var(--err);
  background: var(--err-bg);
  padding: 1rem 1.1rem;
  margin: 0.5rem 0 1rem;
}
.unmapped-block h2 { color: var(--err); }
.unmapped-block ul { margin: 0.4rem 0 0.8rem; padding-left: 1.2rem; }
@media print {
  .icai-set { padding: 0.2rem 0.4rem; }
  .icai-set .report-head h1 { font-size: 1.45rem; }
  .icai-stmt tr.total-row td {
    background: #ebe3d2 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .map-banner, .unmapped-block { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


.icai-schedules { margin-top: 1.6rem; }
.icai-schedule {
  margin-top: 1.8rem;
  padding-top: 0.35rem;
}
.icai-sch-num {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--navy);
  margin: 0;
  letter-spacing: 0.01em;
}
.icai-sch-title {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 500;
  margin: 0.1rem 0 0.85rem;
  color: var(--navy);
}
.icai-schedule .rule { width: 5.5rem; margin: 0.25rem 0 0.55rem; border-top: 2px solid var(--gold); }

.icai-schedules-run { max-width: 210mm; }
.icai-sch-block { margin: 0.85rem 0 0.55rem; }
.icai-sch-head {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: underline;
  margin: 0 0 0.35rem;
  color: #111;
  break-after: avoid;
  page-break-after: avoid;
}
table.icai-stmt-cols { table-layout: fixed; width: 100%; }
table.icai-stmt-cols col.col-note { width: 2.4rem; }
table.icai-stmt-cols col.col-amt { width: 7.6rem; }
table.icai-stmt-cols th.note,
table.icai-stmt-cols td.note {
  width: 2.4rem;
  max-width: 2.6rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 0.8rem;
  padding-left: 0.08rem;
  padding-right: 0.08rem;
}
table.icai-stmt-cols th.num,
table.icai-stmt-cols td.num { width: 7.6rem; }
@media print {
  .icai-schedules-run {
    page-break-before: auto;
    break-before: auto;
    page-break-inside: auto;
    break-inside: auto;
  }
  .icai-sch-block {
    page-break-inside: auto;
    break-inside: auto;
    page-break-before: auto;
    break-before: auto;
  }
  .icai-sch-head {
    break-after: avoid;
    page-break-after: avoid;
  }
  .icai-sch-block thead { display: table-header-group; }
  .icai-sch-block tr { page-break-inside: avoid; break-inside: avoid; }
  .icai-sch-num { color: #163445; }
}

.icai-face-page {
  page-break-after: always;
  page-break-inside: avoid;
  break-after: page;
  break-inside: avoid;
}
@media screen {
  .icai-face-page {
    max-width: 210mm;
  }
}
@media print {
  .icai-face-page {
    page-break-after: always;
    page-break-inside: avoid;
    break-after: page;
    break-inside: avoid;
  }
  .icai-face-page table.icai-face {
    font-size: 0.78rem;
  }
  .icai-face-page table.icai-face th,
  .icai-face-page table.icai-face td {
    padding: 0.1rem 0.32rem;
  }
  .icai-face-page .icai-sign .sign-space { height: 1.35rem; }
  .icai-face-page .icai-see { margin: 0.35rem 0 0.45rem; font-size: 0.78rem; }
}

.icai-paper {
  background: #fff;
  color: #111;
  border: 1px solid #c8c8c8;
  padding: 1.5rem 1.6rem 1.3rem;
  margin: 0.6rem 0 1.1rem;
}
.icai-paper-head { text-align: center; margin-bottom: 0.35rem; }
.icai-paper-head .co {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: #111;
}
.icai-paper-head .title {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin-top: 0.3rem;
  text-decoration: underline;
  color: #111;
}
.icai-paper-head .period { font-size: 0.9rem; margin-top: 0.2rem; color: #111; }
.icai-paper .inrs { text-align: right; font-size: 0.8rem; margin: 0.45rem 0 0.25rem; color: #111; }
table.icai-face {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  color: #111;
  font-size: 0.9rem;
}
table.icai-face th,
table.icai-face td {
  border: 1px solid #222;
  padding: 0.28rem 0.5rem;
  background: #fff !important;
  color: #111;
  vertical-align: top;
}
table.icai-face th {
  font-weight: 600;
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.82rem;
  color: #111 !important;
  background: #fff !important;
}
table.icai-face td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 0.86rem;
}
table.icai-face td.indent { padding-left: 1.5rem; }
table.icai-face td.indent2 { padding-left: 2.6rem; }
table.icai-face tr.section-row td {
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  background: #fff !important;
  color: #111 !important;
}
table.icai-face tr.total-row td {
  font-weight: 700;
  border-top: 1px solid #111;
  border-bottom: 1px solid #111;
  background: #fff !important;
}
table.icai-face tr.grand-row td {
  font-weight: 700;
  border-top: 1px solid #111;
  border-bottom: 3px double #111;
  background: #fff !important;
}
table.icai-face tbody tr:nth-child(even),
table.icai-face tbody tr:hover { background: #fff; }
.icai-see { margin: 0.85rem 0 1.15rem; font-size: 0.86rem; font-style: italic; color: #111; }
.icai-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 0.4rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #111;
}
.icai-sign p { margin: 0.12rem 0; }
.icai-sign .who, .icai-sign .right { }
.icai-sign .sign-space { height: 2.4rem; }
.icai-sign .right { text-align: right; }
@media print {
  .icai-paper {
    border: 0;
    padding: 0;
    margin: 0;
    background: #fff !important;
    color: #111 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  table.icai-face th, table.icai-face td {
    background: #fff !important;
    color: #111 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .icai-sign { break-inside: avoid; }
}
@media (max-width: 860px) {
  .icai-sign { grid-template-columns: 1fr; }
  .icai-sign .right { text-align: left; }
}

.icai-fa-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.15rem 0 0.5rem;
}
table.icai-fa {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 52rem;
  background: var(--cream);
  color: var(--navy);
}
table.icai-fa th,
table.icai-fa td {
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(22, 52, 69, 0.28);
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}
table.icai-fa thead th {
  background: var(--navy);
  color: var(--cream);
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  border-color: var(--navy-deep);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
table.icai-fa thead th.ppe-band {
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--gold);
}
table.icai-fa thead tr:last-child th {
  background: var(--navy-mid);
  font-size: 0.75rem;
  font-weight: 500;
}
table.icai-fa tbody td {
  background: var(--cream);
  color: var(--navy);
}
table.icai-fa td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  white-space: nowrap;
}
table.icai-fa thead th:first-child,
table.icai-fa td.ppe-name {
  width: 8.5rem;
  max-width: 9.2rem;
  min-width: 7.5rem;
}
table.icai-fa td.ppe-name {
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
table.icai-fa tfoot tr.grand-row td {
  background: var(--navy);
  color: var(--cream);
  font-weight: 700;
  border-top: 2px solid var(--gold);
  border-color: var(--navy-deep);
  border-top-color: var(--gold);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
table.icai-fa-edit { min-width: 48rem; }
.ppe-rate-line {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  font-family: var(--sans);
}
.ppe-work {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.22rem;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  max-width: 9rem;
}
.ppe-work-lbl {
  display: inline;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.ppe-work-chk {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.ppe-work-chk input { width: auto; margin: 0; accent-color: var(--navy); }
.ppe-work .ppe-del-row {
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  margin-left: auto;
}
.fa-form .fa-inp,
table.icai-fa-edit .fa-inp,
.ppe-work .fa-inp {
  width: 100%;
  max-width: 7.2rem;
  font: inherit;
  color: var(--navy);
  background: var(--cream);
  border: 1px solid var(--navy);
  padding: 0.28rem 0.4rem;
}
.fa-form .ppe-name .fa-inp,
.fa-form .ppe-name-inp {
  max-width: none;
  width: 100%;
  text-align: left;
}
.ppe-work .ppe-it-block {
  max-width: 100%;
  width: 100%;
  min-width: 0;
  text-align: left;
  font-size: 0.75rem;
  padding: 0.2rem 0.35rem;
  line-height: 1.2;
}
.ppe-work .ppe-it-rate { max-width: 3.6rem; }
.ppe-work .ppe-put { max-width: 100%; width: 100%; }
.ppe-chk-cell { text-align: center; }
.ppe-del-cell .btn { padding: 0.2rem 0.5rem; font-size: 0.78rem; }
.ppe-toolbar { margin: 0.35rem 0 0.65rem; }
@media (max-width: 860px) {
  .icai-fa-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table.icai-fa td.ppe-name {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
@media print {
  tr.ppe-empty { display: none !important; }
  .ppe-work { display: none !important; }
  table.icai-fa thead th {
    background: #163445 !important;
    color: #f6f1e6 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  table.icai-fa thead tr:last-child th { background: #1e4a5c !important; }
  table.icai-fa tbody td {
    background: #f6f1e6 !important;
    color: #163445 !important;
  }
  table.icai-fa tfoot tr.grand-row td {
    background: #163445 !important;
    color: #f6f1e6 !important;
    border-top-color: #b08d57 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .ppe-rate-line {
    display: block;
    font-size: 0.72rem;
    color: #5d7180;
    font-weight: 400;
  }
  .ppe-rate-line:empty { display: none !important; }
}
.icai-ppe-recon { margin-top: 0.85rem; }
.pack-break { page-break-before: always; break-before: page; }
.icai-pack .pack-break:first-child { page-break-before: auto; break-before: auto; }
.pack-index { padding-left: 1.2rem; }
.icai-note-block { margin-top: 1.2rem; }
.report-tabs { flex-wrap: wrap; }

.report-letterhead, .print-letterhead {
  text-align: center;
  margin: 0 0 1rem;
  color: var(--navy);
}
.print-letterhead { display: none; }
.print-only { display: none; }
.lh-firm {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--navy);
}
.lh-contact, .lh-frn, .lh-co-sub, .lh-amt { font-size: 0.82rem; color: var(--muted); margin-top: 0.1rem; }
.lh-co { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; margin-top: 0.45rem; }
.lh-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  background: var(--cream);
  color: var(--navy);
  padding: 0.35rem 0.6rem;
  margin: 0.55rem 0 0.25rem;
}
.lh-period { font-size: 0.9rem; font-style: italic; }
.icai-controls { margin: 0 0 0.9rem; }
.icai-ctrl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.icai-ctrl-row .chips { margin: 0; }
.icai-ctrl-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
  font-weight: 600;
}
.fa-inp {
  width: 100%;
  max-width: 7.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.15rem 0.3rem;
  border: 1px solid var(--rule);
  background: #fff;
}
.fa-inp.num { text-align: right; }
.report-card-primary {
  background: var(--navy);
  border-color: var(--navy);
  border-left-color: var(--seal);
  color: var(--paper);
}
.report-card-primary .report-card-kind { color: rgba(251, 252, 251, 0.62); }
.report-card-primary h2 { color: var(--paper); }
.report-card-primary p { color: rgba(251, 252, 251, 0.78); }
.report-card-primary .rule { border-top-color: var(--seal); }
.report-card-primary:hover {
  border-color: var(--navy-mid);
  box-shadow: 0 8px 22px rgba(16, 31, 39, 0.18);
}

@media print {
  @page {
    size: A4;
    margin: 16mm 14mm 18mm 14mm;
    @bottom-left { content: "Built by Zerolag Automation LLP"; font-size: 8pt; color: #163445; }
    @bottom-right { content: "Page " counter(page) " of " counter(pages); font-size: 8pt; color: #163445; }
  }
  .sidebar, .topbar, .no-print, .chips, .flash, .toolbar, .report-tabs, .who, .page-foot, .fy-form { display: none !important; }
  .print-letterhead, .print-only { display: block !important; }
  .screen-only { display: none !important; }
  .recon, .icai-ppe-recon { display: none !important; }
  .working-papers { page-break-before: always; break-before: page; }
  .report-letterhead { color: #163445; }
  .lh-title {
    background: #f6f1e6 !important;
    color: #163445 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .icai-paper { border: 0; }
  .fa-inp { border: 0; background: transparent; }
}

.sig-table { width: 100%; max-width: 52rem; }
.sig-table th, .sig-table td { vertical-align: middle; }
.sig-table input[type=text], .sig-table select {
  width: 100%;
  margin: 0;
  max-width: none;
}
.sig-table .din-inp { max-width: 10rem; }
.icai-sign .sign-gap { height: 0.55rem; }

.lh-logo, .logo-preview {
  max-width: 400px;
  max-height: 88px;
  display: block;
  margin: 0 auto 0.5rem;
  object-fit: contain;
}
.logo-preview { margin: 0.5rem 0 0.8rem; }
.pack-cover { text-align: center; page-break-after: always; break-after: page; }
.pack-cover .title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  background: var(--cream);
  color: var(--navy);
  padding: 0.4rem 0.7rem;
  margin: 0.7rem 0 0.5rem;
}
.pack-cover .co { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin-top: 0.4rem; }
.pack-cover .cover-block { text-align: left; max-width: 36rem; margin: 1.4rem auto 0; }
@media print {
  .pack-cover { page-break-after: always; break-after: page; }
  .lh-logo { max-width: 400px; }
}

.paper-card {
  background: #fff;
  color: #111;
  border: 1px solid #c8c8c8;
  padding: 1.5rem 1.6rem 1.3rem;
  margin: 0.6rem 0 1.1rem;
}
.paper-card table.data th,
.paper-card table.data td {
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media print {
  .paper-card {
    border: 0;
    padding: 0;
    margin: 0;
    background: #fff !important;
    box-shadow: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .content .paper-card,
  .content .icai-paper {
    max-width: 100%;
  }
}

.sch-parent td { font-weight: 700; padding-top: 0.7rem; }
.sch-group td { font-weight: 600; padding-left: 1rem; }
.sch-ledger td:first-child { padding-left: 2rem; }
.sch-group-total td { font-weight: 600; padding-left: 1rem; border-top: 1px solid rgba(22,52,69,0.18); }


.icai-pack-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.95rem;
  align-items: baseline;
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--cream);
  border: 1px solid rgba(22,52,69,0.18);
  font-size: 0.85rem;
}
.icai-pack-toc .icai-ctrl-label { margin-right: 0.2rem; }
.icai-pack-toc a { color: var(--navy); text-decoration: none; }
.icai-pack-toc a:hover { text-decoration: underline; }
.icai-pack-toc a.active { font-weight: 700; text-decoration: underline; }
.icai-pack-panel { display: block; }
@media screen {
  .icai-pack.is-focused > .icai-pack-panel { display: none; }
  .icai-pack.is-focused > .icai-pack-panel.is-active { display: block; }
}
.icai-pack [data-pack-panel="cover"] .pack-break {
  page-break-before: auto;
  break-before: auto;
}
@media print {
  .icai-pack-tabs, .icai-pack-toc, .icai-chrome, .tab-rail { display: none !important; }
}
@media (max-width: 720px) {
  .icai-chrome-bar { flex-direction: column; gap: 0.2rem; }
  .icai-tabs-primary, .tab-rail { flex-wrap: wrap; }
  .icai-tabs-primary a, .tab-rail a { padding: 0.65rem 0.8rem 0.6rem; font-size: 0.84rem; }
}

.mis-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin: 0;
}
.mis-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
  margin: 0 0 0.45rem;
}
.mis-top-title { min-width: 0; flex: 1 1 12rem; }
.mis-top-title h1 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mis-top .chips { margin: 0; }
.mis-top > p.muted { display: none; }
.mis-top-actions { margin-left: auto; }
.mis-desk { margin: 0 0 1rem; }
.mis-focus {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--navy);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  padding: 0.35rem 0.6rem;
  margin: 0 0 0.55rem;
}
.mis-focus[hidden],
.mis-focus:empty { display: none; }
.mis-status {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.mis-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.mis-kpi {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--navy);
  border-radius: var(--radius);
  padding: 0.4rem 0.5rem 0.3rem;
  box-shadow: var(--shadow);
  cursor: default;
  color: inherit;
  font: inherit;
}
.mis-kpi:hover { border-color: var(--gold); }
.mis-kpi .lbl {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.mis-kpi { cursor: pointer; }
.mis-kpi .val {
  font-family: var(--serif);
  font-size: 0.9rem;
  margin-top: 0.1rem;
  font-variant-numeric: tabular-nums;
}
.mis-kpi .val.neg { color: var(--err); }
.mis-delta {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  margin-top: 0.1rem;
}
.mis-delta.up { color: var(--ok); }
.mis-delta.down { color: var(--seal); }
.mis-spark {
  display: block;
  width: 100%;
  height: 18px;
  margin-top: 0.2rem;
}
.mis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.mis-panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.5rem 0.55rem 0.4rem;
  min-width: 0;
}
.mis-panel-wide { grid-column: span 2; }
.mis-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin: 0 0 0.3rem;
}
.mis-panel header h2,
.mis-panel-head h2 {
  margin: 0;
  font-size: 0.88rem;
  border: 0;
  padding: 0;
}
.mis-panel header p {
  margin: 0.15rem 0 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.mis-view {
  width: auto;
  max-width: 13.5rem;
  min-height: 1.7rem;
  padding: 0.15rem 0.4rem;
  font-size: 0.72rem;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--navy);
  border-radius: var(--radius);
}
.mis-panel canvas {
  display: block;
  width: 100%;
  height: 132px;
}
#mis-ageing, #mis-gst, #mis-wc, #mis-heat, #mis-ribbon, #mis-waterfall, #mis-mix, #mis-debtors, #mis-vtypes { height: 132px; }
.mis-read {
  min-height: 1.2rem;
  margin: 0.2rem 0 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--navy);
  line-height: 1.35;
}
.mis-read p { margin: 0 0 0.2rem; }
.mis-read ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 4.6rem;
  overflow: auto;
}
.mis-read li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.08rem 0;
  border-top: 1px solid var(--rule);
}
.mis-read li.hi { color: var(--seal); font-weight: 600; }
.mis-read li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mis-read li b { font-weight: 600; white-space: nowrap; }
.mis-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.35rem;
}
.mis-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.3rem;
  vertical-align: middle;
}
.mis-tip {
  position: fixed;
  z-index: 40;
  background: var(--navy);
  color: var(--paper);
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 0.4rem 0.55rem;
  border-radius: 3px;
  pointer-events: none;
  max-width: 16rem;
  box-shadow: var(--shadow);
}
.mis-tip strong { color: var(--gold-soft); font-weight: 600; }
@media (max-width: 1100px) {
  .mis-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mis-grid { grid-template-columns: 1fr 1fr; }
  .mis-panel-wide { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .mis-kpis { grid-template-columns: repeat(2, 1fr); }
  .mis-grid { grid-template-columns: 1fr; }
  .mis-panel-wide { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .mis-kpis { grid-template-columns: 1fr 1fr; }
  .mis-kpi .val { font-size: 0.92rem; }
  .mis-top-title h1 { white-space: normal; }
  .mis-top-actions { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .mis-kpi, .mis-panel { transition: none; }
}

.wp-desk {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem 0.95rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.wp-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.wp-desk h1 { margin: 0 0 0.35rem; font-size: 1.45rem; }
.wp-desk .lede { margin: 0.35rem 0 0.25rem; max-width: 46rem; }
.wp-toolbar { margin: 0 0 0.85rem; }
.wp-register {
  margin: 0 0 1.4rem;
  padding: 0.7rem 0 0.2rem;
  border-top: 1px solid var(--rule);
}
.wp-register-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.55rem;
}
.wp-register-bar h2 {
  margin: 0;
  border: 0;
  padding: 0;
  font-size: 1.05rem;
}
.wp-block {
  border: 1px solid var(--rule);
  background: var(--cream);
  padding: 0.85rem 1rem 1rem;
  margin: 0 0 0.85rem;
  max-width: 48rem;
}
.wp-block-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
}
.wp-block-title { flex: 1 1 16rem; }
.wp-block-title input, .wp-block textarea { max-width: 100%; width: 100%; }
.wp-flags { display: flex; flex-wrap: wrap; gap: 0.55rem 1rem; align-items: center; }
.wp-flags input[type=text] { max-width: 10rem; width: auto; }
.age-edit input.fa-inp { max-width: 100%; width: 100%; }
.age-edit .age-del { white-space: nowrap; }
@media print {
  .wp-desk, .wp-toolbar, .age-del, .note-delete, [data-age-add], #add-note, #add-note-bottom { display: none !important; }
}

/* Ageing */
table.data td.age-old { color: var(--err); font-weight: 600; }
table.ageing-table td:first-child a { color: var(--navy); }

/* Ledger statement */
table.ledger-table td:nth-child(4) { max-width: 18rem; }

/* MIS ratios strip */
.mis-ratios { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.35rem; margin: 0 0 0.6rem; }
@media (max-width: 900px) { .mis-ratios { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mis-ratio { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.35rem 0.5rem; border-left: 3px solid var(--muted); }
.mis-ratio .lbl { font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.mis-ratio .val { font-family: var(--serif); font-size: 0.95rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.mis-ratio.good { border-left-color: var(--ok); }
.mis-ratio.watch { border-left-color: var(--gold); }
.mis-ratio.bad { border-left-color: var(--err); }
.mis-ratio.bad .val { color: var(--err); }

/* ---------- Top navigation (replaces the side panel) ---------- */
.app-shell-top { flex-direction: column; }
.app-shell-top .main { width: 100%; }
.topnav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0 1.25rem;
  min-height: 3.6rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--rule);
}
.topnav::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: var(--rangoli);
}
.topnav .brand { display: flex; flex-direction: column; padding: 0.35rem 0.75rem 0.35rem 0; line-height: 1.05; }
.topnav .brand-kicker { font-size: 0.55rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--peacock); }
.topnav .brand-name { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); }
.menu { display: flex; align-items: stretch; gap: 0.1rem; flex: 1; min-width: 0; }
.menu-item { position: relative; display: flex; align-items: stretch; }
.menu-btn, .menu-link {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0 1.05rem; min-height: 3.6rem;
  background: transparent; border: 0; cursor: pointer;
  color: var(--navy); font: inherit; font-size: 1.02rem; font-weight: 600; letter-spacing: 0.02em;
  border-bottom: 3px solid transparent; text-decoration: none; white-space: nowrap;
}
.menu-btn::after { content: ""; width: 0.45rem; height: 0.45rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: 0.7; }
.menu-btn:hover, .menu-link:hover, .menu-item.open > .menu-btn { color: var(--ink); background: var(--wash); text-decoration: none; }
.menu-item.active > .menu-btn, .menu-link.active { color: var(--peacock); border-bottom-color: var(--peacock); }
.menu-drop {
  display: none; position: absolute; top: 100%; left: 0; z-index: 50;
  min-width: 14rem; padding: 0.35rem 0;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); border-top: 3px solid var(--gold); border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 14px 34px rgba(16, 31, 39, 0.18);
}
.menu-drop-right { left: auto; right: 0; }
.menu-item:hover > .menu-drop, .menu-item.open > .menu-drop, .menu-item:focus-within > .menu-drop { display: block; }
.menu-drop a { display: block; padding: 0.5rem 1rem; color: var(--ink); font-size: 0.95rem; text-decoration: none; }
.menu-drop a:hover { background: var(--cream); color: var(--navy); }
.menu-drop a.active { color: var(--navy); font-weight: 600; box-shadow: inset 3px 0 0 var(--gold); }
.menu-drop a.menu-dl { color: var(--navy-mid); }
.menu-sep { height: 1px; margin: 0.3rem 0; background: var(--rule); }
.menu-note { padding: 0.4rem 0.95rem; font-size: 0.74rem; color: var(--muted); line-height: 1.5; white-space: nowrap; }
.topnav-right { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.topnav-right form { margin: 0; }
.topnav .fy-pill, .topnav .co-pill {
  font-family: var(--sans); font-size: 0.92rem; color: var(--ink);
  background: var(--wash); border: 1px solid var(--rule-strong);
  border-radius: 99px; padding: 0.3rem 0.8rem; min-height: 2.2rem; height: 2.2rem; width: auto;
}
.topnav .co-pill { max-width: 20rem; text-overflow: ellipsis; }
.topnav .fy-pill option, .topnav .co-pill option { color: var(--ink); background: var(--paper); }
.menu-user > .menu-btn { font-weight: 600; }
.app-shell-top .content { padding: 1.25rem 1.75rem 3rem; }
@media (max-width: 1000px) {
  .topnav { flex-wrap: wrap; padding: 0.3rem 0.75rem; }
  .menu { order: 3; flex-basis: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .menu-btn, .menu-link { min-height: 2.6rem; padding: 0 0.6rem; }
  .topnav-right { margin-left: auto; }
  .topnav .co-pill { max-width: 11rem; }
  .menu-item:hover > .menu-drop { display: none; }
  .menu-item.open > .menu-drop { display: block; }
}
@media print { .topnav { display: none !important; } }

/* ---------- Generate financials ---------- */
.gen-hero { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow); padding: 1.25rem 1.4rem 1.2rem; margin: 0 0 1.25rem; }
.gen-head { display: flex; gap: 1rem; align-items: flex-start; }
.gen-head h1 { margin: 0.1rem 0 0.3rem; font-size: 1.35rem; }
.gen-sub { margin: 0; color: var(--muted); max-width: 52rem; font-size: 0.92rem; line-height: 1.5; }
.gen-status { margin-left: auto; white-space: nowrap; padding: 0.45rem 0.9rem; border-radius: 99px; font-weight: 600; font-size: 0.85rem; }
.gen-status.ok { background: #e3efe8; color: var(--ok); }
.gen-status.blocked { background: var(--warn-bg); color: #8a5a12; }
.gen-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; margin-top: 1.1rem; }
@media (max-width: 900px) { .gen-grid { grid-template-columns: 1fr; } }
.gen-card { border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.1rem; background: var(--cream); }
.gen-card h2 { margin: 0 0 0.6rem; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.gen-steps { list-style: none; margin: 0; padding: 0; }
.gen-steps li { display: flex; gap: 0.7rem; padding: 0.5rem 0; border-top: 1px solid var(--rule); align-items: flex-start; }
.gen-steps li:first-child { border-top: 0; }
.gen-steps .mark { flex: 0 0 1.25rem; height: 1.25rem; border-radius: 50%; border: 2px solid var(--rule-strong); margin-top: 0.1rem; position: relative; }
.gen-steps li.done .mark { background: var(--ok); border-color: var(--ok); }
.gen-steps li.done .mark::after { content: ""; position: absolute; left: 0.32rem; top: 0.1rem; width: 0.3rem; height: 0.6rem; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); }
.gen-steps li.todo .mark { border-color: var(--gold); background: var(--warn-bg); }
.gen-steps li.off .mark { opacity: 0.4; }
.gen-steps strong { display: block; font-size: 0.95rem; color: var(--ink); }
.gen-steps span:not(.mark) { font-size: 0.85rem; color: var(--muted); }
.gen-blockers { margin-top: 0.8rem; padding: 0.6rem 0.8rem; background: var(--warn-bg); border-radius: 6px; font-size: 0.85rem; }
.gen-blockers p { margin: 0.2rem 0; }
.gen-actions .gen-btn { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0.95rem; border-radius: 8px; border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink); text-decoration: none; margin-bottom: 0.55rem; cursor: pointer; font: inherit; text-align: left; width: 100%; }
.gen-actions .gen-btn:hover { border-color: var(--navy); text-decoration: none; }
.gen-actions .gen-btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.gen-actions .gen-btn.primary:hover { background: var(--navy-mid); }
.gen-actions .gen-btn.ghost { background: transparent; }
.gen-actions .gen-btn .t { font-weight: 600; font-size: 1rem; }
.gen-actions .gen-btn .d { font-size: 0.78rem; opacity: 0.8; }
.gen-btn-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.gen-btn-row .gen-btn { margin-bottom: 0.55rem; }
.gen-settings { margin-top: 0.4rem; font-size: 0.82rem; color: var(--muted); display: grid; gap: 0.25rem; }
.gen-settings .lbl { display: inline-block; min-width: 6.5rem; font-weight: 600; color: var(--ink); }
.gen-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; margin-top: 1rem; }
@media (max-width: 900px) { .gen-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gen-kpi { border: 1px solid var(--rule); border-radius: 8px; padding: 0.55rem 0.7rem; background: var(--paper); }
.gen-kpi .lbl { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.gen-kpi .val { font-family: var(--serif); font-size: 1.05rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.gen-kpi .val.neg { color: var(--err); }
@media print { .gen-hero { display: none !important; } }

/* ---------- Statement faces: wide amount columns, one page each ---------- */
@media screen {
  .icai-face-page { max-width: 236mm; }
}
table.icai-stmt-cols col.col-amt,
table.icai-stmt-cols th.num,
table.icai-stmt-cols td.num { width: 10.6rem; }
table.icai-face td.num { font-size: 0.84rem; white-space: nowrap; letter-spacing: 0; }
table.icai-face th, table.icai-face td { padding: 0.22rem 0.45rem; line-height: 1.25; }
@media print {
  @page { size: A4 portrait; margin: 10mm 11mm; }
  .icai-face-page { max-width: none; }
  .icai-face-page .icai-paper { border: 0; padding: 0.2rem 0 0; margin: 0; }
  .icai-face-page table.icai-face { font-size: 9pt; }
  .icai-face-page table.icai-face td.num { font-size: 8.6pt; }
  .icai-face-page table.icai-face th,
  .icai-face-page table.icai-face td { padding: 0.06rem 0.28rem; line-height: 1.18; }
  .icai-face-page .icai-paper-head .co { font-size: 12.5pt; }
  .icai-face-page .icai-paper-head .title { font-size: 11pt; margin-top: 0.1rem; }
  .icai-face-page .icai-paper-head .period { font-size: 9pt; }
  .icai-face-page .inrs { margin: 0.15rem 0 0.1rem; font-size: 8pt; }
  .icai-face-page .icai-sign { font-size: 8.4pt; margin-top: 0.35rem; }
  .icai-face-page .icai-sign .sign-space { height: 1rem; }
  .icai-face-page .icai-see { margin: 0.2rem 0; font-size: 8pt; }
  .icai-face-page tr { page-break-inside: avoid; break-inside: avoid; }
}

/* TB mapping: suggestion hint and nil-balance toggle */
.map-hint { font-size: .78rem; color: #8a6d1d; background: #fff6d6; border-radius: 4px; padding: 1px 6px; margin-left: 6px; white-space: nowrap; }
.map-nil-toggle { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }


/* =====================================================================
   Rangoli desk (screen chrome). Statement papers stay black-on-white
   for print; everything here is the light web shell.
   ===================================================================== */
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body {
  background-color: var(--wash);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 31px,
    rgba(59, 108, 181, 0.07) 31px 32px
  );
  background-attachment: fixed;
  color: var(--ink);
  letter-spacing: 0;
}
a { color: var(--indigo); }
a:hover { color: var(--navy); }

h1, h2, h3 { font-family: var(--sans); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-family: var(--serif); font-size: 1.55rem; line-height: 1.2; font-weight: 600; }
h2 { font-size: 1.12rem; }
.lede { font-size: 0.95rem; line-height: 1.55; }
hr.rule { border-top: 3px solid var(--peacock); border-radius: 3px; width: 2.6rem; margin: 0.45rem 0 0.9rem; }

/* ---- top navigation ---- */
.topnav {
  min-height: 3.5rem;
  padding: 0 1.25rem;
  background: var(--paper);
  box-shadow: 0 1px 0 var(--rule);
}
.topnav .brand, .topnav .brand:hover { color: var(--ink); text-decoration: none; }
.topnav .brand { padding-right: 1.1rem; margin-right: 0.35rem; border-right: 1px solid var(--rule); }
.topnav .brand-kicker { color: var(--peacock); font-size: 0.56rem; letter-spacing: 0.18em; }
.topnav .brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.28rem; letter-spacing: -0.02em; color: var(--ink); }
.menu { gap: 0.15rem; }
.menu-btn, .menu-link {
  min-height: 3.5rem; padding: 0 0.7rem; font-size: 0.92rem; font-weight: 600; letter-spacing: 0;
  color: var(--navy); border-bottom-width: 3px;
}
.menu-btn:hover, .menu-link:hover, .menu-item.open > .menu-btn { color: var(--ink); background: var(--wash); }
.menu-item.active > .menu-btn, .menu-link.active { color: var(--peacock); border-bottom-color: var(--peacock); background: var(--accent-soft); }
.menu-btn::after { opacity: 0.55; }
.menu-drop {
  min-width: 15rem; padding: 0.4rem;
  border: 1px solid var(--rule); border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.menu-drop::before {
  content: "";
  display: block;
  height: 4px;
  margin: -0.4rem -0.4rem 0.4rem;
  background: var(--rangoli);
}
.menu-drop a { padding: 0.5rem 0.85rem; border-radius: 6px; font-size: 0.93rem; }
.menu-drop a:hover { background: var(--wash); color: var(--navy); }
.menu-drop a.active { background: var(--accent-soft); color: var(--navy); box-shadow: none; }
.menu-drop a.menu-dl { color: var(--accent-deep); font-weight: 500; }
.menu-sep { margin: 0.35rem 0.4rem; }
.menu-note { padding: 0.4rem 0.85rem; }
.topnav .fy-pill, .topnav .co-pill {
  color: var(--ink); background: var(--wash); border-color: var(--rule-strong);
  font-weight: 500; font-size: 0.88rem; min-height: 2.15rem; height: 2.15rem;
}
.topnav .fy-pill:hover, .topnav .co-pill:hover { background: var(--accent-soft); border-color: var(--peacock); }
.menu-user > .menu-btn { padding-left: 0.6rem; }
.menu-user > .menu-btn::before {
  content: ""; width: 1.55rem; height: 1.55rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--peacock), var(--indigo));
  box-shadow: 0 0 0 2px var(--accent-soft);
  margin-right: 0.25rem;
}
.app-shell-top .content { padding: 1.35rem 1.9rem 3rem; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-foot { background: transparent; border-top: 1px solid var(--rule); color: var(--muted); }

/* ---- buttons ---- */
.btn {
  min-height: var(--control-h);
  padding: 0.4rem 1.05rem;
  background: var(--navy-mid); border-color: var(--navy-mid);
  border-radius: var(--radius);
  font-size: 0.88rem; font-weight: 600;
  box-shadow: 0 1px 2px rgba(20, 33, 61, 0.12);
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, transform 0.06s ease;
}
.btn:hover { background: var(--navy); border-color: var(--navy); box-shadow: 0 3px 8px rgba(20, 33, 61, 0.18); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(13, 138, 123, 0.4); outline-offset: 2px; }
.btn-ghost { background: var(--paper); color: var(--navy); border-color: var(--rule-strong); box-shadow: none; }
.btn-ghost:hover { background: var(--cream); border-color: var(--navy-soft); color: var(--navy); box-shadow: none; }
.btn-gold { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-gold:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn-danger { background: var(--err); border-color: var(--err); }

/* ---- cards, panels, tiles ---- */
.card {
  border-radius: var(--radius-lg);
  border-color: var(--rule);
  padding: 1.25rem 1.4rem 1.35rem;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 1.02rem; padding-bottom: 0.55rem; border-bottom: 1px solid var(--rule); }
.kpis { gap: 0.85rem; }
.kpi {
  border-left: 1px solid var(--rule);
  border-top: 3px solid var(--navy-mid);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 0.95rem;
}
.kpi .lbl { font-size: 0.66rem; letter-spacing: 0.1em; }
.kpi .val { font-family: var(--sans); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; }
.report-index { gap: 1rem; }
.report-card {
  border-left: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.2rem 1.25rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.report-card:hover { transform: translateY(-2px); border-color: var(--navy-soft); border-left-color: var(--navy-soft); box-shadow: var(--shadow-lift); }
.report-card-kind { color: var(--accent-deep); }
.report-card h2 { font-family: var(--sans); font-size: 1.08rem; color: var(--navy); }
.report-card .rule { width: 2rem; border-top-width: 2px; }
.report-card-primary { background: linear-gradient(135deg, var(--peacock), var(--indigo)); border-color: transparent; }
.report-card-primary .report-card-kind { color: #fff3d0; }
.report-card-primary .rule { border-top-color: var(--marigold); }
.empty { border-radius: var(--radius-lg); border-style: dashed; padding: 1.8rem; }
.badge { border-radius: 99px; padding: 0.14rem 0.55rem; border-color: var(--rule-strong); background: var(--cream-dark); color: var(--navy); }
.badge-ok { background: var(--ok-bg); border-color: #a9dcd3; color: var(--ok); }
code, .token { border-radius: 4px; background: var(--cream); border-color: var(--rule); }

/* ---- tables ---- */
table.data { font-size: 0.89rem; }
table.data th {
  background: #f1f5f9;
  color: #334155;
  font-size: 0.7rem; letter-spacing: 0.07em;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid #cbd5e1;
  position: sticky; top: 3.5rem; z-index: 2;
}
.paper-card table.data th { position: static; }
table.data td { padding: 0.5rem 0.75rem; border-bottom-color: #edf2f7; }
table.data tbody tr:nth-child(even) { background: #f8fafc; }
table.data tbody tr:hover { background: #ecf4ff; }
table.data tfoot td { background: var(--cream-dark); border-top: 2px solid var(--navy-mid); border-bottom: 2px solid var(--navy-mid); }
.group-row td { background: var(--navy) !important; }
table.data tbody tr.map-group td { background: #e9eef6; }
table.data tbody tr.map-group:hover td { background: #dfe7f2; }
tr.unmapped-row td { background: #fff5f4; }
.table-scroll { border-radius: var(--radius-lg); }

/* ---- chips (segmented control) ---- */
.chips { border: 1px solid var(--rule-strong); border-radius: 99px; background: var(--paper); padding: 0.18rem; gap: 0.15rem; box-shadow: none; }
.chip, button.chip { border: 0; border-radius: 99px; padding: 0.28rem 0.85rem; min-height: 1.9rem; font-size: 0.83rem; color: var(--navy); background: transparent; }
.chip:hover { background: var(--cream-dark); }
.chip.active, .chip.active:hover, button.chip.active, button.chip.active:hover { background: var(--navy-mid); color: #fff; }
.map-nil-toggle { padding-left: 0.6rem; }

/* ---- forms ---- */
label { font-size: 0.78rem; letter-spacing: 0.02em; color: #334155; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  border-radius: var(--radius);
  border-color: var(--rule-strong);
  background: #fff;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 159, 140, 0.18); }
#map-find { border-radius: var(--radius); border-color: var(--rule-strong); }

/* ---- flashes ---- */
.flash { border-radius: var(--radius); border-left-width: 4px; padding: 0.75rem 1rem; font-size: 0.92rem; }
.flash.ok { border-left-color: var(--ok); }
.flash.error { border-left-color: var(--err); }

/* ---- tab rails ---- */
.tab-rail, .icai-tabs-primary { background: var(--paper); border-radius: var(--radius); }
.tab-rail { border-radius: var(--radius); }
.tab-rail a, .icai-tabs-primary a { color: var(--muted); padding: 0.7rem 1.1rem 0.62rem; }
.tab-rail a:hover, .icai-tabs-primary a:hover { color: var(--ink); background: var(--wash); }
.tab-rail a.active, .tab-rail a[aria-current="page"], .icai-tabs-primary a.active, .icai-tabs-primary a[aria-current="page"] {
  color: var(--peacock); background: var(--accent-soft); border-bottom-color: var(--peacock);
}
.icai-chrome { border-radius: var(--radius-lg); overflow: hidden; }
.icai-chrome-bar { background: var(--paper); color: var(--ink); }
.icai-kicker { color: var(--peacock); }
.icai-chrome-note { color: var(--muted); }
.icai-tabs-sub a.active, .icai-tabs-sub a[aria-current="page"] { border-bottom-color: var(--accent); }
.icai-tabs-sub.wp-files a { border-radius: 99px; }
.icai-tabs-sub.wp-files a.active, .icai-tabs-sub.wp-files a[aria-current="page"] { background: var(--navy-mid); border-color: var(--navy-mid); }
.report-tabs { border-bottom-color: var(--rule); }
.report-tabs a.active { border-bottom-color: var(--accent); }
.icai-block { border-radius: var(--radius); border-color: #f2d49a; background: var(--amber-soft); color: #7a4b05; }
.icai-ctrl-row { border-radius: var(--radius-lg); }
.map-banner { font-family: var(--sans); font-weight: 600; font-size: 1rem; border-radius: var(--radius-lg); background: var(--indigo); border-color: var(--indigo); color: #fff; }
.map-banner.ok { background: var(--ok-bg); border-color: #a9dcd3; }
.map-hint { background: var(--amber-soft); color: #7a4b05; border-radius: 99px; }
.unmapped-block { border-radius: var(--radius-lg); }
.recon { border-radius: var(--radius); overflow: hidden; }
.recon-head { background: var(--navy-mid); }
.wp-desk { border-radius: var(--radius-lg); border-left: 1px solid var(--rule); border-top: 3px solid var(--accent); }
.wp-kicker, .mis-kicker { color: var(--accent-deep); }
.wp-block { border-radius: var(--radius); }
.mis-focus { border-radius: var(--radius); border-left-color: var(--accent); }

/* ---- MIS desk ---- */
.mis-top-title h1 { font-size: 1.3rem; }
.mis-kpis { gap: 0.6rem; }
.mis-kpi {
  border-left: 1px solid var(--rule); border-top: 3px solid var(--navy-mid);
  border-radius: var(--radius); padding: 0.55rem 0.7rem 0.5rem;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.mis-kpi:hover { border-color: var(--rule); border-top-color: var(--accent); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.mis-kpi .val { font-family: var(--sans); font-weight: 600; font-size: 1.05rem; }
.mis-kpi:nth-child(2) { border-top-color: var(--accent); }
.mis-kpi:nth-child(3) { border-top-color: var(--amber); }
.mis-kpi:nth-child(4) { border-top-color: #6366f1; }
.mis-kpi:nth-child(5) { border-top-color: var(--seal); }
.mis-kpi:nth-child(6) { border-top-color: #0ea5e9; }
.mis-kpi:nth-child(7) { border-top-color: #84cc16; }
.mis-kpi:nth-child(8) { border-top-color: #a855f7; }
.mis-ratios { gap: 0.5rem; }
.mis-ratio { border-radius: var(--radius); padding: 0.45rem 0.65rem; }
.mis-ratio .val { font-family: var(--sans); font-weight: 600; }
.mis-grid { gap: 0.75rem; }
.mis-panel { border-radius: var(--radius-lg); padding: 0.75rem 0.85rem 0.6rem; }
.mis-panel-head h2, .mis-panel header h2 { font-size: 0.9rem; }
.mis-view { border-radius: 99px; padding: 0.15rem 0.6rem; border-color: var(--rule-strong); }
.mis-tip { border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); }
.mis-tip strong { color: var(--accent-deep); }
.mis-delta.up { color: var(--ok); }
.mis-delta.down { color: var(--seal); }

/* ---- generate financials ---- */
.gen-hero { border-radius: var(--radius-lg); }
.gen-card { border-radius: var(--radius); background: var(--cream); }
.gen-status.ok { background: var(--ok-bg); }
.gen-status.blocked { background: var(--amber-soft); color: #7a4b05; }
.gen-steps li.todo .mark { border-color: var(--amber); background: var(--amber-soft); }
.gen-actions .gen-btn { border-radius: var(--radius); }
.gen-actions .gen-btn.primary { background: var(--navy-mid); border-color: var(--navy-mid); }
.gen-actions .gen-btn.primary:hover { background: var(--navy); }
.gen-kpi { border-radius: var(--radius); }
.gen-kpi .val { font-family: var(--sans); font-weight: 600; }

/* ---- letterhead on screen ---- */
.lh-title { border-radius: var(--radius); background: var(--cream); }
.paper-card, .icai-paper { border-radius: var(--radius-lg); border-color: #d9dee5; box-shadow: var(--shadow); }

/* ---- login ---- */
.login-wrap {
  background-color: var(--wash);
  background-image:
    radial-gradient(1100px 560px at 8% -12%, rgba(13, 138, 123, 0.22), transparent 58%),
    radial-gradient(800px 500px at 100% 0%, rgba(228, 90, 115, 0.16), transparent 52%),
    radial-gradient(900px 540px at 80% 110%, rgba(232, 163, 23, 0.2), transparent 55%);
}
.login-card {
  width: 27rem; max-width: calc(100vw - 2rem);
  border-top: 0; border-radius: 16px;
  padding: 2.3rem 2.2rem 1.7rem;
  box-shadow: var(--shadow-lift);
}
.login-card .brand-kicker { color: var(--peacock) !important; }
.login-card h1 { font-family: var(--serif); font-size: 2.15rem; font-weight: 700; letter-spacing: -0.02em; }
.login-card .btn { border-radius: var(--radius); background: var(--peacock); border-color: var(--peacock); font-size: 0.95rem; }
.login-card .btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

/* ---- misc ---- */
.status-dot.on { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.token-copy { border-radius: 99px; }
.toolbar h1 { margin-bottom: 0.15rem; }
@media (max-width: 1000px) {
  .topnav .brand { border-right: 0; }
  table.data th { position: static; }
}
@media print {
  table.data th { position: static; }
  .card, .paper-card, .icai-paper { border-radius: 0; box-shadow: none; }
}
/* Amount columns never wrap; the card scrolls sideways instead. */
table.data td.num, table.data th.num, table.data th { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.paper-card.table-scroll, .card.table-scroll { overflow-x: auto; }

/* ---- users and access ---- */
.user-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 12rem)); gap: 0.75rem; margin: 0 0 1rem; }
.user-stat { background: var(--paper); border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 0.6rem 0.9rem; box-shadow: var(--shadow); }
.user-stat .lbl { font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.user-stat .val { font-size: 1.35rem; font-weight: 600; }
.user-cell { display: flex; align-items: center; gap: 0.7rem; }
.user-name { font-weight: 600; }
.avatar {
  flex: 0 0 2.25rem; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3b6ea8, #1f4f86); color: #fff; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.04em;
}
.avatar-admin { background: linear-gradient(135deg, var(--accent), var(--accent-bright)); }
.role-badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 99px; font-size: 0.72rem; font-weight: 600; background: var(--cream-dark); color: var(--navy); }
.role-badge.role-admin { background: var(--accent-soft); color: var(--accent-deep); }
.co-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.co-chip { display: inline-block; padding: 0.12rem 0.55rem; border-radius: 99px; background: #eef3f9; border: 1px solid #d6e0ec; font-size: 0.76rem; color: var(--navy); }
tr.user-off td { opacity: 0.6; }
.btn-danger-ghost { color: var(--err); border-color: #f0c9c5; }
.btn-danger-ghost:hover { background: var(--err-bg); color: var(--err); border-color: var(--err); }
.user-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1rem; }
@media (max-width: 900px) { .user-grid { grid-template-columns: 1fr; } .user-stats { grid-template-columns: 1fr 1fr 1fr; } }
.user-form input[type=text], .user-form input[type=password] { max-width: 100%; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.6rem; margin-top: 0.4rem; }
.role-card {
  display: block; margin: 0; padding: 0.8rem 0.9rem; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  cursor: pointer; font-weight: 400; letter-spacing: 0; background: var(--paper); transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.role-card input { margin: 0 0.4rem 0 0; accent-color: var(--accent); }
.role-card .role-title { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.role-card .role-desc { display: block; margin-top: 0.3rem; font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.role-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 159, 140, 0.15); background: #f4fbfa; }
.co-card.co-soon { opacity: 0.55; }
.co-card.co-off { opacity: 0.45; }
#module-access.is-admin .co-pick { opacity: 0.45; pointer-events: none; }
.co-pick-tools { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.6rem; }
.co-pick-tools .btn { min-height: 1.9rem; padding: 0.2rem 0.7rem; font-size: 0.8rem; }
.co-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.5rem; max-height: 26rem; overflow: auto; padding: 0.15rem; }
.co-card {
  display: block; margin: 0; padding: 0.6rem 0.75rem; border: 1px solid var(--rule); border-radius: var(--radius);
  cursor: pointer; font-weight: 400; letter-spacing: 0; background: var(--paper);
}
.co-card input { margin: 0 0.4rem 0 0; accent-color: var(--accent); }
.co-card .co-name { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.co-card .co-sub { display: block; margin-top: 0.2rem; padding-left: 1.35rem; font-size: 0.76rem; color: var(--muted); }
.co-card.selected { border-color: var(--accent); background: #f4fbfa; }
#company-access.is-admin .co-pick, #company-access.is-admin .co-pick-tools .btn { opacity: 0.45; pointer-events: none; }
/* ---- dashboard sync strip ---- */
.sync-strip { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.45rem 0 0; }
.sync-pill {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.22rem 0.7rem; border-radius: 99px;
  background: var(--paper); border: 1px solid var(--rule); font-size: 0.78rem; color: var(--ink); white-space: nowrap;
}
.sync-pill.ok { background: var(--ok-bg); border-color: #a9dcd3; color: var(--ok); }
.sync-pill.off { background: var(--amber-soft); border-color: #f2d49a; color: #7a4b05; }
.sync-pill.sync-link { color: var(--navy-mid); font-weight: 600; text-decoration: none; }
.sync-pill.sync-link:hover { border-color: var(--navy-mid); }
.mis-top-title h1 { white-space: normal; }

/* ---- sign-off, activity, notifications ---- */
.signoff-card { margin-top: 1rem; padding: 0.9rem 1.1rem 0.8rem; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--cream); }
.signoff-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.signoff-head h2 { margin: 0; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border: 0; padding: 0; }
.signoff-now { font-size: 0.8rem; font-weight: 600; padding: 0.2rem 0.7rem; border-radius: 99px; background: var(--paper); border: 1px solid var(--rule-strong); }
.signoff-now.state-signed { background: var(--ok-bg); color: var(--ok); border-color: #a9dcd3; }
.signoff-now.state-partner { background: var(--accent-soft); color: var(--accent-deep); border-color: #a9dcd3; }
.signoff-now.state-reviewed { background: #e8effa; color: var(--navy-mid); border-color: #c5d5ea; }
.signoff-steps { display: flex; gap: 0; list-style: none; margin: 0.7rem 0 0.6rem; padding: 0; }
.signoff-steps li { flex: 1; position: relative; font-size: 0.82rem; color: var(--muted); padding-top: 1.3rem; text-align: center; }
.signoff-steps li::before { content: ""; position: absolute; top: 0.45rem; left: 0; right: 0; height: 3px; background: var(--rule-strong); }
.signoff-steps li:first-child::before { left: 50%; } .signoff-steps li:last-child::before { right: 50%; }
.signoff-steps li .mark { position: absolute; top: 0; left: calc(50% - 0.5rem); width: 1rem; height: 1rem; border-radius: 50%; background: var(--paper); border: 3px solid var(--rule-strong); box-sizing: border-box; }
.signoff-steps li.done::before, .signoff-steps li.now::before { background: var(--accent); }
.signoff-steps li.done .mark { background: var(--accent); border-color: var(--accent); }
.signoff-steps li.now .mark { border-color: var(--accent); }
.signoff-steps li.now { color: var(--ink); font-weight: 600; }
.signoff-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.4rem 0; }
.signoff-form input[type=text] { max-width: 20rem; margin: 0; }
.signoff-log summary { cursor: pointer; font-size: 0.8rem; color: var(--navy-mid); }
.signoff-log ul { margin: 0.3rem 0 0; padding-left: 1.1rem; font-size: 0.8rem; color: var(--muted); }
.cover-signed { font-weight: 600; color: #0f766e; }
.act-filter { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; align-items: flex-end; padding: 0.8rem 1rem; }
.act-filter label { margin: 0 0 0.2rem; } .act-filter select { width: auto; max-width: 18rem; }
.act-badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 99px; font-size: 0.74rem; font-weight: 600; background: var(--cream-dark); color: var(--navy); }
.act-signoff, .act-sync { background: var(--accent-soft); color: var(--accent-deep); }
.act-sync_failed, .act-backup_failed, .act-mail_failed, .act-mis_pack_failed { background: var(--err-bg); color: var(--err); }
.act-login { background: #e8effa; color: var(--navy-mid); }
.notify-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0.25rem 1rem; }
.notify-grid label { font-weight: 500; margin: 0.15rem 0; }
.role-badge.role-client { background: var(--amber-soft); color: #7a4b05; }
.client-wait { max-width: 44rem; border-top: 3px solid var(--amber); }
.backup-table td { vertical-align: middle; }

/* ---- deferred tax working paper ---- */
.dt-top { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; max-width: 52rem; }
@media (max-width: 800px) { .dt-top { grid-template-columns: 1fr; } }
.dt-table td input[type=text] { min-width: 14rem; }
.dt-table tfoot td { background: var(--cream); border-top: 1px solid var(--rule); border-bottom: 0; font-weight: 400; }
.adj-form { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--rule); }

/* ---- quick wins ---- */
tr.month-row td { background: #eef3f9; font-weight: 600; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); font-size: 0.82rem; }
.vch-link { color: var(--navy-mid); }
.db-filters { display: flex; flex-wrap: wrap; gap: 0.4rem 0.7rem; align-items: flex-end; margin: 0 0 0.9rem; padding: 0.6rem 0.8rem; background: var(--cream); border: 1px solid var(--rule); border-radius: var(--radius); }
.db-filters label { margin: 0 0 0.2rem; }
.db-filters select, .db-filters input[type=text], .db-filters input[type=search] { width: auto; max-width: 22rem; margin: 0; }
input[type=file] { max-width: 28rem; font-size: 0.88rem; }
input[type=file]::file-selector-button {
  min-height: var(--control-h);
  margin-right: 0.7rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--rule-strong);
  border-radius: 99px;
  background: var(--paper);
  color: var(--navy);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--accent-soft); border-color: var(--peacock); }
.bucket-link { color: inherit; text-decoration: underline dotted; }
.bucket-link:hover { color: var(--navy-mid); }

/* ---- desk KPI tiles v3 ---- */
.mis-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem; margin-bottom: 0.7rem; }
.mis-kpi {
  position: relative; border: 1px solid var(--rule); border-top: 0; border-radius: var(--radius-lg);
  padding: 0.8rem 0.95rem 0.7rem; background: var(--paper); box-shadow: var(--shadow); overflow: hidden; min-height: 5.4rem;
}
.mis-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--navy-mid); }
.mis-kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); border-color: var(--rule); }
.mis-kpi .kpi-head { display: flex; align-items: center; gap: 0.45rem; }
.mis-kpi .kpi-icon {
  flex: 0 0 1.5rem; width: 1.5rem; height: 1.5rem; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  background: #e8effa; color: var(--navy-mid); font-weight: 700; font-size: 0.8rem;
}
.mis-kpi .lbl { font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.mis-kpi .val { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 0.35rem; color: var(--ink); }
.mis-kpi .val.neg { color: var(--seal); }
.mis-kpi .mis-delta { margin-left: auto; font-size: 0.7rem; padding: 0.08rem 0.45rem; border-radius: 99px; background: var(--cream-dark); }
.mis-kpi .mis-delta.up { background: var(--ok-bg); color: var(--ok); }
.mis-kpi .mis-delta.down { background: var(--err-bg); color: var(--seal); }
.mis-kpi .mis-spark { margin-top: 0.3rem; opacity: 0.85; }
.mis-kpi:nth-child(n) { border-top: 0; }
.kpi-turnover::before { background: var(--navy-mid); } .kpi-turnover .kpi-icon { background: #e8effa; color: var(--navy-mid); }
.kpi-net_profit::before { background: var(--accent); } .kpi-net_profit .kpi-icon { background: var(--accent-soft); color: var(--accent-deep); }
.kpi-margin::before { background: var(--amber); } .kpi-margin .kpi-icon { background: var(--amber-soft); color: #7a4b05; }
.kpi-receivables::before { background: #6366f1; } .kpi-receivables .kpi-icon { background: #ecebff; color: #4f46e5; }
.kpi-payables::before { background: var(--seal); } .kpi-payables .kpi-icon { background: var(--err-bg); color: var(--seal); }
.kpi-cash_bank::before { background: #0ea5e9; } .kpi-cash_bank .kpi-icon { background: #e0f2fe; color: #0284c7; }
.kpi-working::before { background: #84cc16; } .kpi-working .kpi-icon { background: #f1fbe3; color: #4d7c0f; }
.kpi-gst_net::before { background: #a855f7; } .kpi-gst_net .kpi-icon { background: #f3e8ff; color: #7e22ce; }
@media (max-width: 1100px) { .mis-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .mis-kpis { grid-template-columns: 1fr; } }

/* ---- ratio groups ---- */
.ratio-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; margin: 0 0 0.9rem; }
@media (max-width: 1000px) { .ratio-groups { grid-template-columns: 1fr; } }
.ratio-group { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 0.6rem 0.85rem 0.5rem; box-shadow: var(--shadow); }
.ratio-group h3 { margin: 0 0 0.35rem; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ratio-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.32rem 0; border-top: 1px solid #f1f5f9; font-size: 0.86rem; }
.ratio-row:first-of-type { border-top: 0; }
.ratio-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--rule-strong); flex: 0 0 auto; }
.ratio-row.good .ratio-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ratio-row.watch .ratio-dot { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.ratio-row.bad .ratio-dot { background: var(--seal); box-shadow: 0 0 0 3px var(--err-bg); }
.ratio-label { color: var(--ink); flex: 1; min-width: 0; }
.ratio-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.ratio-row.bad .ratio-val { color: var(--seal); }
.ratio-tag { font-size: 0.66rem; padding: 0.08rem 0.5rem; border-radius: 99px; background: var(--cream-dark); color: var(--muted); min-width: 4.2rem; text-align: center; }
.ratio-row.good .ratio-tag { background: var(--ok-bg); color: var(--ok); }
.ratio-row.watch .ratio-tag { background: var(--amber-soft); color: #7a4b05; }
.ratio-row.bad .ratio-tag { background: var(--err-bg); color: var(--seal); }

.map-sub { max-width: 13rem; min-height: 1.9rem; padding: 0.2rem 0.5rem; font-size: 0.82rem; }

/* ---- PPE register v2: one line per asset, tax working underneath ---- */
.fa-form table.icai-fa { background: var(--paper); color: var(--ink); border-radius: var(--radius); overflow: hidden; }
.fa-form table.icai-fa th, .fa-form table.icai-fa td { border-color: var(--rule); }
.fa-form table.icai-fa thead th { background: var(--navy); color: #fff; font-size: 0.72rem; letter-spacing: 0.04em; }
.fa-form table.icai-fa thead tr:last-child th { background: var(--navy-mid); font-size: 0.7rem; }
.fa-form table.icai-fa thead th.ppe-band { border-bottom: 2px solid var(--accent-bright); }
.fa-form table.icai-fa tbody td { background: var(--paper); color: var(--ink); padding: 0.3rem 0.35rem; vertical-align: middle; }
.fa-form table.icai-fa tbody tr.ppe-row:nth-of-type(4n+1) td, .fa-form table.icai-fa tbody tr.ppe-row:nth-of-type(4n+1) + tr.ppe-tax td { background: #fbfcfe; }
.fa-form table.icai-fa tbody tr.ppe-tax td { background: #f6f8fb; border-top: 0; padding: 0.15rem 0.5rem 0.4rem; }
.fa-form table.icai-fa tbody tr.ppe-row td { border-bottom: 0; }
.fa-form table.icai-fa tbody tr.ppe-tax td { border-bottom: 2px solid var(--rule-strong); }
.fa-form .ppe-name-inp { font-weight: 600; font-size: 0.86rem; border-color: var(--rule-strong); border-radius: 6px; background: #fff; padding: 0.3rem 0.45rem; }
.fa-form table.icai-fa .fa-inp.num { border-color: var(--rule-strong); border-radius: 6px; background: #fff; text-align: right; font-family: var(--mono); font-size: 0.8rem; padding: 0.28rem 0.35rem; max-width: 7.5rem; width: 100%; }
.fa-form table.icai-fa .fa-inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 159, 140, 0.18); outline: 0; }
.fa-form table.icai-fa td.ppe-gross-close, .fa-form table.icai-fa td.ppe-dep-close { color: var(--muted); }
.fa-form table.icai-fa td.ppe-net-cy { font-weight: 700; background: #f3fbf9 !important; }
.fa-form table.icai-fa thead th:first-child, .fa-form table.icai-fa td.ppe-name { width: 13rem; max-width: 14rem; min-width: 11rem; }
.ppe-tax-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; font-size: 0.76rem; color: var(--muted); }
.ppe-tax-k { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--accent-deep); padding: 0.1rem 0.45rem; border-radius: 99px; background: var(--accent-soft); }
.ppe-tax-strip .ppe-it-block { width: auto; max-width: 20rem; min-width: 12rem; font-size: 0.76rem; padding: 0.2rem 0.4rem; border-radius: 6px; background: #fff; border-color: var(--rule-strong); }
.ppe-tax-strip .ppe-it-rate { max-width: 4rem !important; width: 4rem !important; font-size: 0.76rem; }
.ppe-tax-strip .ppe-put { width: 9.5rem !important; max-width: 9.5rem !important; font-size: 0.76rem; padding: 0.2rem 0.35rem; border-radius: 6px; background: #fff; border-color: var(--rule-strong); }
.ppe-tax-strip .ppe-work-lbl { font-size: 0.7rem; color: var(--muted); }
.ppe-tax-strip .ppe-work-chk { font-size: 0.74rem; color: var(--ink); }
.ppe-tax-strip .ppe-work-chk input { accent-color: var(--accent); }
.ppe-tax-strip .ppe-it-dep { margin-left: auto; font-family: var(--mono); font-size: 0.76rem; color: var(--ink); font-weight: 600; }
.ppe-tax-strip .ppe-del-row { min-height: 1.6rem; padding: 0.1rem 0.55rem; font-size: 0.72rem; }
tr.ppe-empty.ppe-tax { display: none; }
.fa-form table.icai-fa tfoot tr.grand-row td { background: var(--navy); color: #fff; border-top-color: var(--accent-bright); }
@media print { tr.ppe-tax { display: none !important; } }
/* PPE register: amount columns keep a usable width; the card scrolls sideways */
.fa-form table.icai-fa { min-width: 96rem; }
.fa-form table.icai-fa thead th.num, .fa-form table.icai-fa td.num { min-width: 7.6rem; white-space: nowrap; }
.fa-form table.icai-fa thead tr:last-child th { white-space: nowrap; }
.fa-form table.icai-fa .fa-inp.num { max-width: none; }

/* ---- MIS comparison ---- */
.mis-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; padding: 0.7rem 1rem; }
.mis-ctrl .chips { margin: 0; }
.mis-cmp h2 { display: flex; align-items: baseline; gap: 0.6rem; }
.mis-cmp-table th:first-child, .mis-cmp-table td:first-child { position: sticky; left: 0; background: var(--paper); z-index: 1; min-width: 16rem; max-width: 22rem; }
.mis-cmp-table thead th:first-child { z-index: 3; }
.mis-cmp-table td.indent { padding-left: 1.6rem; }
.mis-cmp-table tr.mis-grp td { font-weight: 600; color: var(--navy); background: #f3f6fa; }
.mis-cmp-table tr.mis-grp-total td { font-weight: 600; border-top: 1px solid var(--rule-strong); background: #f8fafc; }
.mis-cmp-table tr.total-row td { font-weight: 700; background: var(--cream-dark); border-top: 2px solid var(--navy-mid); }
.mis-cmp-table tr.group-row td { background: var(--navy) !important; color: #fff; position: static; }
.mis-cmp-table td.num { white-space: nowrap; }
/* ---- desk read-outs as clean rows ---- */
.mis-read { font-family: var(--sans); font-size: 0.78rem; color: var(--ink); }
.mis-read p { color: var(--muted); }
.mis-read ul { max-height: 6rem; }
.mis-read li { padding: 0.18rem 0; border-top: 1px solid #edf2f7; }
.mis-read li b { font-family: var(--mono); font-size: 0.76rem; }

/* ---- MIS packs page ---- */
.pack-build { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem 0.9rem; padding: 0.8rem 1rem; }
.pack-build label { margin: 0 0 0.25rem; }
.pack-build input[type=month] { width: 11rem; max-width: 11rem; margin: 0; }
.pack-build .btn { margin-bottom: 0; }
.toolbar .lede { max-width: 60rem; }
/* Sticky table headers overlapped the first row inside scrolling cards; keep headers in flow. */
table.data th { position: static; top: auto; }
.mis-cmp-table thead th:first-child { position: sticky; left: 0; }

/* ---------- CA desk: grouping WP, share capital, notes review, versions, Schedule II ---------- */
.gwp-kpis, .ppe-tiles, .sc-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.6rem; margin: 0 0 1rem; }
.gwp-kpi, .ppe-tile, .sc-kpi { background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--navy); border-radius: 8px; padding: 0.6rem 0.8rem; }
.gwp-kpi .lbl, .ppe-tile .lbl, .sc-kpi .lbl { font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.gwp-kpi .val, .ppe-tile .val, .sc-kpi .val { font-size: 1.25rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.gwp-kpi .val.small { font-size: 0.9rem; }
.gwp-kpi .sub, .ppe-tile .sub, .sc-kpi .sub { font-size: 0.74rem; color: var(--muted); margin-top: 0.15rem; }
.gwp-kpi.ok, .ppe-tile.ok, .sc-kpi.ok { border-left-color: var(--ok); }
.gwp-kpi.warn, .ppe-tile.warn { border-left-color: #d97706; }
.gwp-kpi.bad, .ppe-tile.bad, .sc-kpi.bad { border-left-color: var(--danger, #b42318); }
table.gwp-table td, table.gwp-table th { font-size: 0.82rem; vertical-align: middle; }
table.gwp-table tr.gwp-line-row td { background: var(--navy); color: var(--cream); font-weight: 600; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; }
table.gwp-table tr.status-reviewed td { background: #f1f8f3; }
table.gwp-table tr.status-query td { background: #fff4e5; }
table.gwp-table tr.unmapped-row td:nth-child(3) { color: var(--danger, #b42318); font-weight: 600; }
table.gwp-table .gwp-moved { color: #b45309; font-weight: 700; }
table.gwp-table input[type=text] { width: 100%; min-width: 12rem; font-size: 0.8rem; padding: 0.25rem 0.4rem; }
table.gwp-table select.gwp-status { font-size: 0.8rem; padding: 0.2rem 0.3rem; }
.sc-section { margin: 1rem 0 0.4rem; }
.sc-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.3rem; }
.sc-head h2, .sc-section h2 { margin: 0; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
table.sc-table input[type=text] { width: 100%; min-width: 6rem; font-size: 0.82rem; padding: 0.25rem 0.4rem; }
table.sc-table input.num { text-align: right; font-variant-numeric: tabular-nums; }
table.sc-table td.sc-amt { font-variant-numeric: tabular-nums; font-family: var(--mono); white-space: nowrap; }
.sc-desk textarea { width: 100%; max-width: 60rem; }
.notes-desk { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 960px) { .notes-desk { grid-template-columns: 1fr; } }
.notes-index { position: sticky; top: 0.75rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow); padding: 0.8rem 0.9rem; max-height: calc(100vh - 1.5rem); overflow: auto; }
.notes-index-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.notes-cover { font-size: 0.72rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 99px; background: var(--warn-bg); color: #8a5a12; white-space: nowrap; }
.notes-cover.ok { background: #e3efe8; color: var(--ok); }
.notes-list { list-style: none; margin: 0; padding: 0; }
.notes-list li { display: flex; align-items: center; gap: 0.4rem; padding: 0.28rem 0; border-top: 1px solid var(--rule); font-size: 0.82rem; }
.notes-list li:first-child { border-top: 0; }
.notes-list li a { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); }
.notes-list li.off a { text-decoration: line-through; color: var(--muted); }
.notes-list .n { display: inline-block; min-width: 1.6rem; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.note-state { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.1rem 0.45rem; border-radius: 99px; background: var(--cream-dark); color: var(--muted); white-space: nowrap; }
.note-state.st-reviewed { background: #e3efe8; color: var(--ok); }
.note-state.st-signed { background: var(--navy); color: var(--cream); }
.note-comments { font-size: 0.66rem; font-weight: 700; min-width: 1.2rem; text-align: center; padding: 0.1rem 0.3rem; border-radius: 99px; background: #fff4e5; color: #b45309; }
.notes-settings { margin-top: 0.8rem; border-top: 1px solid var(--rule); padding-top: 0.5rem; }
.notes-settings summary { cursor: pointer; font-size: 0.78rem; font-weight: 600; color: var(--navy); }
.wp-flag-line { display: flex; gap: 0.4rem; align-items: flex-start; font-size: 0.78rem; margin: 0.35rem 0; }
.wp-flag-line input { width: auto; margin-top: 0.15rem; }
.note-review { margin: 0.5rem 0 0.2rem; padding: 0.5rem 0.7rem; background: var(--cream); border: 1px dashed var(--rule-strong); border-radius: 8px; }
.note-review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.note-review-form { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-left: auto; }
.note-review-form input[type=text] { min-width: 14rem; font-size: 0.8rem; padding: 0.28rem 0.45rem; }
.note-review-form .btn { padding: 0.28rem 0.6rem; font-size: 0.76rem; }
.note-review-comments { list-style: none; margin: 0.45rem 0 0; padding: 0; font-size: 0.8rem; }
.note-review-comments li { padding: 0.2rem 0; border-top: 1px solid var(--rule); }
.gen-desk { margin-top: 1rem; }
.version-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.6rem; }
.version-form input[type=text] { flex: 1 1 12rem; font-size: 0.82rem; }
.version-list { list-style: none; margin: 0; padding: 0; }
.version-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; padding: 0.4rem 0; border-top: 1px solid var(--rule); font-size: 0.84rem; }
.version-list form.inline { margin-left: auto; }
.version-kind { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.1rem 0.45rem; border-radius: 99px; background: var(--cream-dark); color: var(--muted); }
.version-kind.k-freeze { background: var(--navy); color: var(--cream); }
.btn.small { padding: 0.2rem 0.5rem; font-size: 0.74rem; }
.ppe-tax-k.sch2 { background: #e3efe8; color: var(--ok); }
.ppe-tax-strip .ppe-sch2-class, .ppe-tax-strip .ppe-method { width: auto; max-width: 18rem; min-width: 9rem; font-size: 0.76rem; padding: 0.2rem 0.4rem; border-radius: 6px; background: #fff; border-color: var(--rule-strong); }
.ppe-tax-strip .ppe-life, .ppe-tax-strip .ppe-residual { max-width: 4rem !important; width: 4rem !important; font-size: 0.76rem; }
.ppe-sch2-dep { font-weight: 600; color: var(--navy); }
.ppe-apply-sch2 { padding: 0.15rem 0.55rem; font-size: 0.72rem; }
.fa-form table.icai-fa tbody tr.ppe-sch2 td { border-bottom: 0; }
table.icai-fa td.ppe-ok { box-shadow: inset 3px 0 0 var(--ok); }
table.icai-fa td.ppe-differs { box-shadow: inset 3px 0 0 #d97706; }
.ppe-py-head { margin: 1rem 0 0.2rem; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
table.icai-fa-py { min-width: 46rem; }
table.icai-face.icai-var col.col-pct { width: 4.5rem; }

.imp-conf { font-variant-numeric: tabular-nums; font-size: 0.78rem; font-weight: 600; }
.imp-conf.high { color: var(--ok); }
.imp-conf.mid { color: var(--amber); }
.imp-conf.low { color: var(--seal); }
tr.mis-gp td { font-weight: 700; background: var(--accent-soft); }

.suite-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.7rem; margin: 0 0 1.1rem; }
.suite-kpi { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 0.85rem 1rem; box-shadow: var(--shadow); }
.suite-kpi .lbl { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.suite-kpi .val { font-family: var(--mono); font-size: 1.15rem; font-weight: 600; color: var(--navy); margin-top: 0.2rem; }
.suite-kpi .val.neg { color: var(--seal); }
.audit-bar { height: 6px; background: var(--cream-dark); border-radius: 99px; overflow: hidden; margin-top: 0.45rem; }
.audit-bar > span { display: block; height: 100%; background: var(--accent); }
.audit-bar-wide { margin: 0 0 1rem; height: 8px; }
.proc-steps { margin: 0; padding-left: 1.2rem; }
.proc-steps li { margin: 0 0 0.7rem; }
.proc-steps p { margin: 0.2rem 0 0; color: var(--muted); }
.audit-add { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.audit-add input[type=text] { flex: 1 1 14rem; }
.letter-desk textarea { width: 100%; min-height: 18rem; font-family: var(--serif); font-size: 0.95rem; line-height: 1.5; }
.letter-body { white-space: pre-wrap; font-family: var(--serif); font-size: 0.95rem; line-height: 1.55; margin: 0; }
@media (max-width: 720px) {
  .suite-kpis { grid-template-columns: repeat(2, 1fr); }
  .audit-add { flex-direction: column; align-items: stretch; }
}
table.db-summary { max-width: 44rem; margin-bottom: 1rem; }
tr.vdb-unbal td { background: var(--err-bg); }
table.vdb-table { min-width: 72rem; }
a.vch-link { font-weight: 600; }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.pay-form .chip { display: flex; align-items: center; gap: 0.4rem; margin: 0.45rem 0; }
.pay-slip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
@media (max-width: 800px) { .pay-slip-grid { grid-template-columns: 1fr; } }
.pay-slip { max-width: 52rem; }
.pay-grid .card { border-top: 3px solid var(--peacock); }
.pay-grid .card:nth-child(4n+2) { border-top-color: var(--marigold); }
.pay-grid .card:nth-child(4n+3) { border-top-color: var(--lotus); }
.pay-grid .card:nth-child(4n+4) { border-top-color: var(--indigo); }

.suite-kpi { border-top: 3px solid var(--peacock); }
.suite-kpi:nth-child(4n+2) { border-top-color: var(--marigold); }
.suite-kpi:nth-child(4n+3) { border-top-color: var(--lotus); }
.suite-kpi:nth-child(4n+4) { border-top-color: var(--indigo); }

.mis-top-title h1 { font-family: var(--serif); }
.toolbar h1 { font-family: var(--serif); }

@media print {
  body {
    background: #fff !important;
    background-image: none !important;
  }
  .topnav::after { display: none !important; }
}

.audit-flag { font-size: 0.72rem; line-height: 1.35; margin: 0.1rem 0; }
.audit-flag-high { color: var(--lotus); font-weight: 600; }
.audit-flag-warn { color: #b45309; }
.audit-flag-info { color: var(--muted); }
.audit-flag-low { color: var(--peacock); }
.audit-findings { margin: 0; padding-left: 1.1rem; }
.audit-findings li { margin: 0.35rem 0; }
ul.audit-findings .audit-flag { margin-right: 0.35rem; }

@media (prefers-reduced-motion: reduce) {
  .btn, .report-card, .mis-kpi { transition: none; }
  .btn:active, .report-card:hover, .mis-kpi:hover { transform: none; }
}

/* =====================================================================
   Desk polish — tabs, menus, cards, period, selects (Rangoli desk)
   ===================================================================== */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.3rem;
  padding: 0 0.85rem;
  margin-left: 0.35rem;
  border: 1px solid var(--rule-strong);
  border-radius: 99px;
  background: var(--paper);
  color: var(--navy);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.nav-toggle::before {
  content: "";
  width: 0.95rem;
  height: 0.7rem;
  background:
    linear-gradient(var(--navy), var(--navy)) 0 0 / 100% 2px no-repeat,
    linear-gradient(var(--navy), var(--navy)) 0 50% / 100% 2px no-repeat,
    linear-gradient(var(--navy), var(--navy)) 0 100% / 100% 2px no-repeat;
}
.nav-toggle[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--peacock); color: var(--peacock); }

.topnav-right {
  flex: 0 0 auto;
  padding-left: 0.85rem;
  margin-left: 0.2rem;
  border-left: 1px solid var(--rule);
  background: var(--paper);
  z-index: 42;
  align-self: stretch;
}
.nav-select {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  margin: 0;
}
.nav-select label {
  display: block;
  margin: 0;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  line-height: 1;
}
.topnav .nav-select .fy-pill,
.topnav .nav-select .co-pill {
  margin: 0;
}

.menu-drop {
  max-height: min(70vh, 28rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.menu-drop-wide { min-width: 17.5rem; }
.menu-label {
  padding: 0.55rem 0.85rem 0.2rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--peacock);
  font-weight: 700;
}
.menu-drop a:focus-visible,
.menu-btn:focus-visible,
.menu-link:focus-visible {
  outline: 2px solid var(--peacock);
  outline-offset: -2px;
}

.mod-chrome {
  margin: 0 0 1.15rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mod-chrome .tab-rail {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.mod-chrome .tab-rail-sub {
  border-top: 1px solid var(--rule);
  background: var(--wash);
  padding: 0.4rem 0.45rem 0.45rem;
  gap: 0.2rem;
  flex-wrap: wrap;
  overflow: visible;
}
.mod-chrome .tab-rail-sub a {
  border-bottom: 0;
  border-radius: 99px;
  padding: 0.38rem 0.85rem;
  font-size: 0.84rem;
}
.mod-chrome .tab-rail-sub a:hover { background: var(--paper); }
.mod-chrome .tab-rail-sub a.active,
.mod-chrome .tab-rail-sub a[aria-current="page"] {
  background: var(--navy-mid);
  color: #fff;
  border-bottom-color: transparent;
}

.tab-rail { scrollbar-width: thin; }
.tab-rail.is-scroll { padding-right: 0.2rem; }

.period-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 0 0.85rem;
}
.period-bar .chips { margin: 0; }
.period-label { margin: 0; }
.period-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.7rem 1rem;
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}
.period-custom label {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.period-custom input[type=date] { width: auto; max-width: none; }

.report-card { position: relative; overflow: hidden; }
.report-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--peacock);
}
.report-card:nth-child(4n+2)::before { background: var(--marigold); }
.report-card:nth-child(4n+3)::before { background: var(--lotus); }
.report-card:nth-child(4n+4)::before { background: var(--indigo); }
.report-card-primary {
  background: linear-gradient(135deg, var(--peacock) 0%, var(--indigo) 100%);
  border-color: transparent;
  color: #fff;
}
.report-card-primary::before { background: var(--marigold); }
.report-card-primary h2,
.report-card-primary p { color: #fff !important; }
.report-card-primary .report-card-kind { color: #fff3d0; }
.report-card-primary .muted,
.report-card-primary .muted.small { color: rgba(255,255,255,0.82) !important; }
.report-card-primary .audit-bar { background: rgba(255,255,255,0.22); }
.report-card-primary .audit-bar > span { background: var(--marigold); }
.report-card-primary:hover { border-color: transparent; color: #fff; }

.empty {
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.4rem;
  background: linear-gradient(180deg, var(--paper), var(--wash));
}
.empty .btn { margin-top: 0.85rem; }

select.mis-view {
  width: auto;
  max-width: 16rem;
  min-height: 1.9rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.card { position: relative; }
.toolbar {
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.toolbar .lede { margin-bottom: 0; }

.flash { box-shadow: var(--shadow); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .topnav .menu {
    display: none;
    order: 4;
    flex-basis: 100%;
    flex-direction: column;
    overflow: visible;
    padding: 0.35rem 0 0.55rem;
    border-top: 1px solid var(--rule);
  }
  .topnav .menu.is-open { display: flex; }
  .topnav .menu-item, .topnav .menu-link { width: 100%; }
  .topnav .menu-btn, .topnav .menu-link { min-height: 2.6rem; width: 100%; justify-content: space-between; }
  .topnav .menu-drop {
    position: static;
    display: none;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    max-height: none;
    padding: 0 0 0.3rem 0.6rem;
  }
  .topnav .menu-drop::before { display: none; }
  .menu-item.open > .menu-drop { display: block; }
  .menu-item:hover > .menu-drop { display: none; }
  .menu-item.open:hover > .menu-drop { display: block; }
  .topnav-right { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .nav-select { flex: 1 1 8rem; }
  .topnav .co-pill { max-width: none; }
}

@media print {
  .mod-chrome, .period-bar, .period-custom, .nav-toggle { display: none !important; }
}
