/* =====================================================================
   Rangoli desk (screen chrome). Statement papers stay black-on-white
   for print; everything here is the light web shell.
   ===================================================================== */
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
/* Larger type on screen (the owner found 16px too small). Every size in this
   file is in rem, so this one line scales all text; print keeps 16px so the
   printed statements and packs lay out as before. Must stay after the html
   rule above, which would otherwise win. */
@media screen { html { font-size: 18px; } }
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 var(--page-gutter);
  background: var(--paper);
  box-shadow: 0 1px 0 var(--rule);
}
.topnav .brand, .topnav .brand:hover { color: var(--ink); text-decoration: none; }
.topnav .brand { flex-direction: row; align-items: center; gap: 0.55rem; padding-right: 1.1rem; margin-right: 0.35rem; border-right: 1px solid var(--rule); }
/* The logo mark: an emerald thread rising through three knots (books, financials, tax) on no background, static/img/logo.svg. */
.brand-mark { width: 1.9rem; height: 1.9rem; flex: 0 0 auto; }
.topnav .brand-kicker { color: var(--brand-black); font-size: 0.56rem; letter-spacing: 0.2em; font-weight: 700; }
.topnav .brand-name { font-family: var(--serif); font-weight: 800; font-size: 1.36rem; letter-spacing: -0.015em; color: var(--brand-black); }
.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: 0.9rem var(--page-gutter) 2.2rem; max-width: none; width: 100%; margin: 0; }
.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.65rem; }
.kpi {
  border-left: 1px solid var(--rule);
  border-top: 0;
  border-radius: var(--radius-lg);
  padding: 0.65rem 0.8rem 0.7rem 0.9rem;
}
.kpi .lbl { font-size: 0.62rem; letter-spacing: 0.06em; }
.kpi .val { font-family: var(--sans); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.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.95rem; }
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: var(--topbar-h); 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=email], input[type=tel], input[type=url], 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{ background: var(--paper); border-radius: var(--radius); }
.tab-rail { border-radius: var(--radius); }
.tab-rail a{ color: var(--muted); padding: 0.7rem 1.1rem 0.62rem; }
.tab-rail a:hover{ color: var(--ink); background: var(--wash); }
.gst-hub-tabs { display: flex; flex-direction: column; gap: 0.85rem; margin: 0 0 1.2rem; }
.gst-mini-k {
  display: block; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 700; color: var(--muted); margin: 0 0 0.35rem;
}
.tab-rail-sm a { padding: 0.42rem 0.75rem 0.38rem; font-size: 0.82rem; }
.tab-rail a.active, .tab-rail 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); }
.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-banner-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.map-progress { margin-top: 0.5rem; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.28); overflow: hidden; }
.map-banner.ok .map-progress { background: rgba(0, 0, 0, 0.08); }
.map-progress-fill { height: 100%; background: #fff; border-radius: 99px; transition: width 0.25s ease; }
.map-banner.ok .map-progress-fill { background: var(--ok); }
#map-next-unmapped.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.82rem; }
tr.map-ledger.map-focus { outline: 2px solid var(--accent, #d1483b); outline-offset: -2px; }
.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(--brand-black) !important; font-weight: 700; letter-spacing: 0.2em; }
/* Zerolag FinSutra wordmark: Zerolag black, FinSutra emerald, a little bolder. */
.brand-word-zerolag { color: var(--brand-black); }
.brand-word-finsutra { color: var(--brand-emerald); }
.login-card h1.brand-word { display: flex; align-items: center; gap: 0.65rem; }
.login-card .brand-mark { width: 2.4rem; height: 2.4rem; }
.login-card h1 { font-family: var(--serif); font-size: 2.15rem; font-weight: 800; 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); }
.login-demo-card {
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, var(--wash));
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.login-demo-card:hover, .login-demo-card:focus-visible {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.login-demo-who { font-family: var(--serif); letter-spacing: -0.01em; }

/* ---- 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); }
.signoff-roles { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0.3rem 0; padding: 0; list-style: none; font-size: 0.82rem; color: var(--navy-mid); }
.signoff-warn { margin: 0.4rem 0; padding: 0.45rem 0.7rem; border-left: 3px solid var(--gold, #b8860b); background: var(--paper, #fff); font-size: 0.85rem; }
.signoff-placeholders { margin: 0.5rem 0; padding: 0.5rem 0.8rem; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--paper, #fff); }
.signoff-placeholders h3 { margin: 0 0 0.3rem; font-size: 0.9rem; }
.signoff-placeholders ul { margin: 0; padding-left: 1.1rem; font-size: 0.82rem; }
.signoff-placeholders li { overflow-wrap: anywhere; }
.signoff-sendback { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.3rem 0; }
.signoff-sendback input[type=text] { max-width: 20rem; margin: 0; }
.signed-files { margin: 0.6rem 0 0.2rem; }
.signed-files h3 { margin: 0 0 0.3rem; font-size: 0.9rem; }
.signed-files ul { margin: 0; padding-left: 1.1rem; font-size: 0.82rem; }
.signed-files li { overflow-wrap: anywhere; }
.signed-files .sha { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; color: var(--muted); word-break: break-all; }
.signed-held { border-left: 3px solid var(--gold, #b8860b); }
.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; }
.db-pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; margin: 0.6rem 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; }

/* ---- TB mapping: keyword rules + re-map diff preview ---- */
.map-rules { margin-top: 0.75rem; border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.7rem 0.9rem; background: var(--paper); }
.map-rules summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.map-rules-table { margin: 0.6rem 0; }
.map-rules-table td, .map-rules-table th { padding: 0.35rem 0.5rem; }
.map-rule-add { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.map-rule-add input[type="text"] { min-width: 14rem; }
.map-rule-add select { max-width: 18rem; }
.map-remap-dialog:not([hidden]) { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 1.5rem; }
.map-remap-box { background: var(--paper); border-radius: var(--radius-lg); padding: 1.1rem 1.3rem; max-width: 44rem; width: 100%; max-height: 80vh; display: flex; flex-direction: column; gap: 0.7rem; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.map-remap-scroll { max-height: 22rem; overflow-y: auto; }
#map-remap-table td, #map-remap-table th { padding: 0.3rem 0.55rem; font-size: 0.84rem; }

/* ---- PPE: Schedule III Division I note, additions, depreciation sheets ---- */
.fa-form table.icai-fa { background: var(--paper); color: var(--ink); border-radius: var(--radius); width: 100%; min-width: 0; }
.fa-form table.ppe-note { table-layout: fixed; min-width: 0; }
.fa-form table.ppe-note thead th.ppe-net-h { white-space: normal; line-height: 1.25; font-size: 0.68rem; }
.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.4rem 0.45rem; vertical-align: middle; }
.fa-form table.icai-fa tbody tr.ppe-row { box-shadow: inset 3px 0 0 var(--navy-soft); }
.fa-form table.icai-fa tbody tr.ppe-row:hover td { background: #f3f6fb; }
.fa-form .ppe-name-inp { font-weight: 600; font-size: 0.88rem; border-color: var(--rule-strong); border-radius: 6px; background: #fff; padding: 0.32rem 0.5rem; }
.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; 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: 12rem; max-width: 13rem; min-width: 10rem; }
.fa-form table.icai-fa tfoot tr.grand-row td { background: var(--navy); color: #fff; border-top-color: var(--accent-bright); }
.fa-form table.icai-fa thead th.num, .fa-form table.icai-fa td.num { min-width: 4.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; }
.ppe-sheets { display: flex; gap: 0; border-bottom: 2px solid var(--navy); margin: 0 0 0.85rem; }
.ppe-sheet-tab {
  background: transparent; border: 0; border-bottom: 3px solid transparent;
  margin-bottom: -2px; padding: 0.45rem 1rem; font-weight: 700; font-size: 0.88rem;
  color: var(--muted); cursor: pointer; font-family: var(--sans);
}
.ppe-sheet-tab:hover { color: var(--navy); }
.ppe-sheet-tab[aria-selected="true"] { color: var(--navy-deep); border-bottom-color: var(--peacock); }
.ppe-sheet-kicker {
  margin: 0 0 0.35rem; font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 800; color: var(--peacock);
}
.ppe-sheet-title { margin: 1.1rem 0 0.35rem; font-size: 1rem; color: var(--navy-deep); }
.ppe-view-lab { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.ppe-view-lab select { min-height: 2rem; font-size: 0.82rem; }
table.icai-fa tr.ppe-ghead td {
  background: #e8eef6 !important; color: var(--navy-deep); font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase; font-weight: 800;
  padding: 0.38rem 0.7rem; border-top: 2px solid var(--navy);
}
table.icai-fa tr.ppe-gsub td {
  background: #f4f7fb !important; font-weight: 700; border-top: 1px solid var(--rule-strong);
}
table.icai-fa tr.ppe-ghead.ppe-gempty, table.icai-fa tr.ppe-gsub.ppe-gempty { display: none; }
table.icai-fa tr.ppe-gnil td { color: var(--muted); background: var(--paper); }
table.icai-fa tr.ppe-row td.ppe-name { padding-left: 1.35rem; }
.ppe-group { display: block; margin-top: 0.28rem; max-width: 14rem; font-size: 0.74rem; padding: 0.18rem 0.35rem; }
.ppe-add-lab { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.ppe-add-lab select { min-height: 2rem; font-size: 0.82rem; }
.ppe-view-lab { white-space: nowrap; }
.ppe-method { min-width: 9rem; }
.fa-form.ppe-view-asset tr.ppe-ghead,
.fa-form.ppe-view-asset tr.ppe-gsub,
.fa-form.ppe-view-asset tr.ppe-gnil { display: none; }
.fa-form.ppe-view-asset tr.ppe-row td.ppe-name { padding-left: 0.5rem; }
.fa-form[data-active-sheet="add"] .ppe-note-only,
.fa-form[data-active-sheet="dep"] .ppe-note-only { display: none !important; }
table.ppe-add { min-width: 42rem; }
table.ppe-dep-books, table.ppe-dep-tax { min-width: 62rem; }
.ppe-sch2-class, .ppe-it-block { min-width: 16rem; max-width: 24rem; }
.ppe-nil-add { color: var(--muted); }
select.ppe-sch2-class:has(option:checked[value=""]),
select.ppe-it-block:has(option:checked[value=""]),
select.ppe-method:has(option:checked[value=""]) {
  border-color: #d97706; background: #fff8ec;
}
.ppe-sch2-dep, .ppe-it-dep, .ppe-books-dep { font-weight: 600; font-family: var(--mono); }
.ppe-apply-sch2 { padding: 0.15rem 0.55rem; font-size: 0.72rem; }
@media print {
  .ppe-sheets, .ppe-view-lab, .ppe-gadd, .ppe-group, .ppe-del-row { display: none !important; }
  .ppe-sheet[hidden] { display: none !important; }
  table.icai-fa tr.ppe-row td.ppe-name { padding-left: 1.1rem; }
}

/* ---- 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-span-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.85rem 1.2rem;
  width: 100%;
}
.mis-span-grid fieldset {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 0.55rem 0.8rem 0.75rem;
  margin: 0;
  background: var(--wash, #f7f5f1);
}
.mis-span-grid legend {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--navy);
  padding: 0 0.35rem;
}
.mis-span-grid label { margin: 0.35rem 0 0; }
.mis-span-grid input[type=date] { max-width: none; }
.mis-ctrl .chip input { margin-right: 0.3rem; }
.pack-pub { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
.pack-pub form { display: flex; flex-wrap: wrap; gap: 0.3rem; 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; }

.mis-glance {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.65rem;
  margin: 0 0 1rem;
}
.mis-kpi {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--peacock);
  border-radius: var(--radius-lg);
  padding: 0.7rem 0.85rem 0.8rem;
  box-shadow: var(--shadow);
}
.mis-kpi:nth-child(4n+2) { border-top-color: var(--marigold); }
.mis-kpi:nth-child(4n+3) { border-top-color: var(--lotus); }
.mis-kpi:nth-child(4n+4) { border-top-color: var(--indigo); }
.mis-kpi .lbl {
  font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.mis-kpi .val {
  font-family: var(--mono); font-size: 1.05rem; font-weight: 650;
  color: var(--navy-deep); margin-top: 0.25rem;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.mis-kpi .val.is-neg, .mis-stmt .is-neg { color: var(--err); }
.mis-kpi .chg { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }
.mis-kpi .chg.is-pos { color: var(--ok); }
.mis-kpi .chg.is-neg { color: var(--err); }
.mis-desk { margin-top: 0.2rem; }
.mis-paper h2 {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.45rem 0.7rem;
  margin: 0 0 0.85rem;
}
.mis-paper .table-scroll { overflow-x: auto; }
table.data.mis-stmt {
  width: 100%;
  min-width: 56rem;
  table-layout: fixed;
  border-collapse: collapse;
}
table.data.mis-stmt th,
table.data.mis-stmt td {
  padding: 0.42rem 0.7rem;
  vertical-align: middle;
  overflow-wrap: break-word;
  word-break: normal;
}
table.data.mis-stmt thead th {
  background: var(--navy);
  color: #fff;
}
table.data.mis-stmt th:first-child,
table.data.mis-stmt td:first-child {
  width: 32%;
  text-align: left;
  position: static;
  min-width: 0;
  max-width: none;
}
table.data.mis-stmt thead th:first-child {
  background: var(--navy);
  color: #fff;
}
table.data.mis-stmt tbody td:first-child {
  background: var(--paper);
}
table.data.mis-stmt tbody tr:nth-child(even) td:first-child { background: #f8fafc; }
table.data.mis-stmt th.num,
table.data.mis-stmt td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 0.84rem;
  width: auto;
}
table.data.mis-stmt td.pct { font-size: 0.8rem; color: var(--navy); }
table.data.mis-stmt thead th {
  white-space: normal;
  line-height: 1.25;
  vertical-align: bottom;
}
table.data.mis-stmt tr.mis-band td {
  background: var(--navy) !important;
  color: #fff;
  font-weight: 650;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.38rem 0.7rem;
}
table.data.mis-stmt tr.mis-total td,
table.data.mis-stmt tr.mis-total td:first-child {
  font-weight: 700;
  background: var(--cream);
  border-top: 1px solid var(--rule-strong);
}
table.data.mis-stmt tr.mis-gp td,
table.data.mis-stmt tr.mis-gp td:first-child { background: var(--accent-soft); }
table.data.mis-stmt tfoot tr.mis-grand td,
table.data.mis-stmt tfoot tr.mis-grand td:first-child {
  font-weight: 700;
  background: var(--navy);
  color: #fff;
  border-top: 2px solid var(--gold);
}
table.data.mis-stmt tfoot tr.mis-grand td.is-neg { color: #ffd0d6; }
@media (max-width: 720px) {
  table.data.mis-stmt th:first-child,
  table.data.mis-stmt td:first-child { width: 40%; }
  .mis-glance { grid-template-columns: repeat(2, 1fr); }
}
/* ---- 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], .pack-build input[type=date], .pack-build select { width: 11rem; max-width: 14rem; margin: 0; }
.pack-build .btn { margin-bottom: 0; }
.pack-kinds { display: flex; flex-wrap: wrap; gap: 0.35rem; width: 100%; }
.pack-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.55rem 0.8rem; }
.pack-fields[hidden], .pack-compare-note[hidden] { display: none !important; }
.chip-radio {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1px solid var(--rule); border-radius: 99px; padding: 0.28rem 0.75rem;
  font-size: 0.82rem; font-weight: 600; color: var(--muted); cursor: pointer;
  background: var(--paper);
}
.chip-radio input { margin: 0; }
.chip-radio:has(input:checked) {
  border-color: var(--peacock); background: var(--accent-soft); color: var(--navy-deep);
}
.pack-compare-note { width: 100%; margin: 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(4) { 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 input.gwp-sub { min-width: 8rem; max-width: 14rem; }
table.gwp-table select.gwp-status { font-size: 0.8rem; padding: 0.2rem 0.3rem; }
.gwp-sub-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.6rem;
  margin: 0.55rem 0 0; padding: 0.45rem 0 0; border-top: 1px solid var(--rule);
}
.gwp-sub-bar input[type=text] { min-width: 14rem; max-width: 22rem; min-height: var(--control-h); }
.gwp-preview { margin: 0 0 1rem; }
.gwp-preview > summary { cursor: pointer; font-weight: 650; }
.gwp-preview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.8rem; margin-top: 0.7rem;
}
.gwp-preview-block h3 { margin: 0 0 0.3rem; font-size: 0.82rem; }
.gwp-preview-block table { margin: 0; }
.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; }
.sc-note-h { margin: 1.1rem 0 0.45rem; font-size: 1rem; }
.notes-desk { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: 1rem; align-items: start; }
/* One column on a narrow screen, and the column may shrink: a plain 1fr
   took the width of the widest note and ran the page to ~2,000px. The
   index stops being sticky and scrolls in a short box of its own. */
.notes-desk > * { min-width: 0; }
@media (max-width: 960px) {
  .notes-desk { grid-template-columns: minmax(0, 1fr); }
  .notes-desk .notes-index { position: static; max-height: 45vh; }
}
.notes-index { position: sticky; top: calc(var(--topbar-h) + 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 - var(--topbar-h) - 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; }
/* Note names are what you navigate by: wrap to a second line rather than
   cutting "Share application money pending allotment" to "Share applicat...". */
.notes-list li a {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--navy);
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.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; overflow-wrap: anywhere; }
.suite-kpi .val.neg { color: var(--seal); }
a.suite-kpi-link { display: block; text-decoration: none; color: inherit; cursor: pointer; }
a.suite-kpi-link:hover { border-color: var(--lotus); transform: translateY(-1px); }
a.suite-kpi-link .hint { font-size: 0.68rem; color: var(--muted); margin-top: 0.3rem; }
tr.flag-row-high td:first-child { box-shadow: inset 3px 0 0 var(--lotus); }
tr.flag-row-warn td:first-child { box-shadow: inset 3px 0 0 #d97706; }
table.flag-details-table { min-width: 78rem; }
table.flag-details-table td.flag-finding { min-width: 18rem; max-width: 28rem; white-space: normal; }
.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.55rem 0.7rem; align-items: flex-end; }
/* A register row asking for the fields its file did not hold (a scanned
   return): the same shape as the add form, in the row itself. */
.challan-fill > td { background: var(--wash); }
.challan-fill-form { display: flex; flex-wrap: wrap; gap: 0.4rem 0.7rem; align-items: flex-end; }
.challan-fill-form label { display: flex; flex-direction: column; font-size: 0.78rem; color: var(--muted); }
.challan-fill-form label > input { min-width: 8rem; }
.audit-add label {
  display: flex; flex-direction: column; gap: 0.2rem; margin: 0;
  font-size: 0.78rem; color: var(--muted); flex: 1 1 10rem; max-width: 16rem;
}
.audit-add label > input, .audit-add label > select {
  flex: none; width: 100%; max-width: none; min-height: var(--control-h);
  height: var(--control-h); box-sizing: border-box; color: var(--ink); font-size: 0.92rem;
}
.audit-add input[type=text] { flex: none; }
.audit-add input[type=file] { width: auto; max-width: 22rem; height: auto; }
.audit-add button { height: var(--control-h); }
.challan-enter .audit-add {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); align-items: end;
}
.challan-enter .audit-add label { max-width: none; flex: none; }
.challan-enter .audit-add button { justify-self: start; }
table.challan-reg { min-width: 76rem; }
table.data.challan-reg td:not(.num):not(.flag-finding):not(.wrap):not(.col-flags):not(.keep),
.paper-card table.data.challan-reg td:not(.num):not(.flag-finding):not(.wrap):not(.col-flags):not(.keep),
table.data.challan-reg th,
.paper-card table.data.challan-reg th {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
table.challan-reg .btn { white-space: nowrap; }
.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, minmax(0, 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); }
/* The salary journal's lines scroll in their box on a phone rather than squeeze a column to a letter a line. */
#journal-lines td:first-child { min-width: 9rem; }
#journal-lines td:nth-child(2) { min-width: 14rem; }

.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; }
}

/* The licence banner on every page (templates/_licence_banner.html). */
.flash.licence-banner { background: var(--amber-soft, #fff4d6); border-color: #f1d58a; color: #7a5200; }
.flash.licence-banner.is-ended { background: var(--err-bg); border-color: var(--err); color: var(--err); }
.user-leave-note { margin: 0.2rem 0 0.6rem; }
