/* ============================================================
   Statutory Compliance Calendar & Tracker — FY 2026–27
   Takshashila Institution
   ============================================================ */

/* ---- Tokens ------------------------------------------------ */
:root {
  /* Brand */
  --maroon:        #620d3c;
  --maroon-deep:   #4c0a2e;
  --maroon-tint:   #f6eef2;
  --maroon-line:   #e2cdd7;
  --gold:          #f1a222;
  --gold-ink:      #8a5b06;   /* accessible gold-family text */
  --gold-tint:     #fffbe2;
  --gold-line:     #ecd9a2;

  /* Surfaces & ink */
  --white:         #ffffff;
  --pale:          #fffbe2;
  --page:          #fdfcf9;
  --ink:           #2a2a2a;
  --ink-muted:     #6b6b6b;
  --ink-faint:     #8f8a83;
  --hairline:      #e6e0d8;
  --hairline-soft: #f0ece5;

  /* ---- Status ramp — the four sheet statuses -------------- */
  --st-upcoming:      #f1a222;   /* gold — queued, not started */
  --st-inprogress:    #9c4a76;   /* maroon family — work started */
  --st-completed:     #2f8f68;   /* settled green — done */
  --st-notapplicable: #cbc4ba;   /* muted grey — excluded */

  /* Completed pill surfaces */
  --ok-ink:  #1f6b4a;
  --ok-tint: #eaf5ef;
  --ok-line: #c1e2d2;

  /* In-progress pill surfaces */
  --prog-ink:  #7c3557;
  --prog-tint: #faf3f6;
  --prog-line: #ecdae2;

  /* ---- Urgency ramp — the additive, date-driven layer ----- */
  --urg-overdue:      #b3123f;
  --urg-overdue-tint: #fdecf1;
  --urg-overdue-line: #f3c3d1;
  --urg-duesoon:      #a86a08;
  --urg-duesoon-tint: #fff6df;
  --urg-duesoon-line: #f0dca8;

  /* Type */
  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Space */
  --shell:  1220px;
  --gut:    clamp(1.15rem, 3.5vw, 2.5rem);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur:  160ms;

  /* Elevation scale */
  --z-sticky: 20;
  --z-toast:  60;
}

/* ---- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "tnum" 1, "cv05" 1;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 500; text-wrap: balance; }
p, dl, dd, ol, ul { margin: 0; }
button, input, select { font: inherit; color: inherit; }
table { border-collapse: collapse; }
a { color: var(--maroon); }

.shell { max-width: var(--shell); margin-inline: auto; padding-inline: var(--gut); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: var(--z-toast);
  background: var(--white); color: var(--maroon); padding: .7rem 1rem;
  border: 1px solid var(--maroon); text-decoration: none;
}
.skip-link:focus { left: 1rem; top: 1rem; }

:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Eyebrow ----------------------------------------------- */
.eyebrow {
  margin: 0 0 .55rem;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.eyebrow--onDark { color: rgba(255, 255, 255, .68); }
.eyebrow--gold   { color: var(--gold); }

/* ---- Buttons ----------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem .95rem;
  border-radius: 2px;
  border: 1px solid var(--hairline);
  background: var(--white);
  font-size: .8125rem; font-weight: 500;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn__icon { width: 15px; height: 15px; flex: none; }
.btn:hover { border-color: var(--maroon); color: var(--maroon); }

.btn--primary { background: var(--maroon); border-color: var(--maroon); color: var(--white); }
.btn--primary:hover { background: var(--maroon-deep); border-color: var(--maroon-deep); color: var(--white); }

.btn--quiet { border-color: transparent; background: transparent; color: var(--ink-muted); padding-inline: .4rem; }
.btn--quiet:hover { color: var(--maroon); background: var(--maroon-tint); }

.btn--ghostOnDark {
  background: transparent; color: var(--white);
  border-color: rgba(255, 255, 255, .32);
}
.btn--ghostOnDark:hover { background: rgba(255, 255, 255, .1); color: var(--white); border-color: var(--gold); }
.btn--ghostOnDark:focus-visible { outline-color: var(--gold); }
.btn.is-busy { pointer-events: none; opacity: .6; }
.btn.is-busy .btn__icon { animation: spin 900ms linear infinite; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Masthead ---------------------------------------------- */
.masthead { background: var(--maroon); color: var(--white); }
.masthead__inner {
  display: flex; flex-wrap: wrap; gap: 1.75rem;
  align-items: flex-end; justify-content: space-between;
  padding-block: clamp(1.9rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.25rem);
}
.masthead__title {
  font-size: clamp(1.6rem, 3.1vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--white);
}
.masthead__period {
  margin-top: .55rem;
  font-size: .875rem;
  color: rgba(255, 255, 255, .74);
}
.masthead__sync { display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; }
.masthead__stamp { display: flex; gap: .45rem; align-items: baseline; font-size: .75rem; }
.masthead__stampLabel { color: rgba(255, 255, 255, .6); letter-spacing: .06em; text-transform: uppercase; font-size: .6875rem; }
.masthead__stampValue { color: rgba(255, 255, 255, .92); font-variant-numeric: tabular-nums; }
.masthead__stamp--live .masthead__stampValue { color: var(--gold); font-weight: 600; }

/* Signature band */
.nextband { background: var(--maroon-deep); border-top: 1px solid rgba(255, 255, 255, .12); }
.nextband__inner { padding-block: 1.35rem 1.5rem; border-left: 3px solid var(--gold); padding-left: calc(var(--gut) - 3px); }
.nextband__body { display: flex; flex-wrap: wrap; gap: 1rem 2.75rem; align-items: baseline; justify-content: space-between; }
.nextband__particulars {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.8vw, 1.375rem);
  line-height: 1.35;
  color: var(--white);
  max-width: 62ch;
}
.nextband__meta { display: flex; gap: 2.25rem; flex-wrap: wrap; }
.nextband__meta dt {
  font-size: .625rem; letter-spacing: .13em; text-transform: uppercase;
  color: rgba(255, 255, 255, .55); margin-bottom: .2rem;
}
.nextband__meta dd { font-size: .875rem; color: var(--white); font-variant-numeric: tabular-nums; }
.nextband__meta dd.is-gold { color: var(--gold); font-weight: 600; }

/* ---- Sections ---------------------------------------------- */
.section { padding-block: clamp(2rem, 4vw, 3rem); }
.section--flush { padding-top: 1.5rem; }
.section__head { margin-bottom: 1.5rem; }
.section__head--split {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  justify-content: space-between; gap: 1.25rem 2rem;
}
.section__headText { min-width: 0; }
.section__title { font-size: 1.25rem; letter-spacing: -0.005em; }
.section__note { margin-top: .35rem; font-size: .8125rem; color: var(--ink-muted); max-width: 70ch; }
.section__note--gold {
  color: var(--gold-ink); background: var(--gold-tint);
  border: 1px solid var(--gold-line); border-left: 3px solid var(--gold);
  padding: .5rem .75rem; max-width: 62ch;
}

/* ---- "Dates as of" control + criteria panel ---------------- */
.asof { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .85rem; flex: none; }
.field--asof { min-width: 190px; }
.btn--criteria { align-self: flex-end; margin-bottom: 1px; white-space: nowrap; }
.btn--criteria[aria-expanded="true"] { color: var(--maroon); background: var(--maroon-tint); }

.criteria-panel {
  margin-bottom: 1.5rem;
  border: 1px solid var(--hairline); border-left: 3px solid var(--maroon);
  background: var(--white);
  padding: 1.1rem 1.35rem 1.25rem;
}
.criteria-panel__intro { font-size: .8125rem; color: var(--ink-muted); max-width: 82ch; margin-bottom: .9rem; }
.criteria-panel__intro em { font-style: italic; color: var(--ink); }
.criteria-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.criteria-table th {
  text-align: left; font-weight: 600; font-size: .625rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--maroon);
  padding: .4rem .6rem .5rem 0; border-bottom: 1px solid var(--hairline);
}
.criteria-table td { padding: .55rem .6rem .55rem 0; border-bottom: 1px solid var(--hairline-soft); vertical-align: top; }
.criteria-table tr:last-child td { border-bottom: 0; }
.criteria-table td:first-child { font-weight: 600; white-space: nowrap; color: var(--ink); width: 11rem; }
.criteria-table td:last-child { color: var(--ink-muted); }
.criteria-table__group td {
  font-family: var(--font-body); font-weight: 600;
  font-size: .625rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--maroon); background: var(--maroon-tint);
  padding: .45rem .6rem; width: auto; white-space: normal;
}

/* ---- Overview: ring + KPIs --------------------------------- */
.overview {
  display: grid;
  grid-template-columns: minmax(250px, 300px) 1fr;
  gap: 1px;
  border: 1px solid var(--hairline);
  background: var(--hairline);
}

/* Completion ring card */
.ringcard {
  background: var(--white);
  padding: 1.4rem 1.4rem 1.5rem;
  display: flex; flex-direction: column; gap: 1.1rem;
}
.ringcard__chart { position: relative; width: 148px; height: 148px; margin: .15rem auto 0; }
.ringcard__svg { width: 100%; height: 100%; display: block; }
.ringcard__svg .ring__seg {
  transition: stroke-dashoffset .6s var(--ease), stroke-dasharray .6s var(--ease);
}
.ringcard__center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .1rem; pointer-events: none;
}
.ringcard__pct {
  font-family: var(--font-display); font-weight: 600;
  font-size: 2rem; line-height: 1; color: var(--maroon);
  font-variant-numeric: tabular-nums;
}
.ringcard__pctLabel { font-size: .625rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.ringcard__side { min-width: 0; }
.ringcard__caption { font-size: .75rem; color: var(--ink-muted); margin-bottom: .7rem; text-align: center; }

.ringlegend { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; }
.ringlegend__item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .55rem;
  padding: .3rem 0; border-top: 1px solid var(--hairline-soft); font-size: .8125rem;
}
.ringlegend__item:first-child { border-top: 0; }
.ringlegend__dot { width: 9px; height: 9px; border-radius: 2px; }
.ringlegend__label { color: var(--ink); }
.ringlegend__count { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

/* ---- KPIs -------------------------------------------------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: var(--hairline);
  gap: 1px;
}
.kpi {
  padding: 1.15rem 1.25rem 1.05rem;
  background: var(--white);
  position: relative;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.kpi:hover { background: var(--page); }
.kpi::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: transparent; transition: background var(--dur) var(--ease);
}
.kpi--accentMaroon::before        { background: var(--urg-overdue); }
.kpi--accentGold::before          { background: var(--urg-duesoon); }
.kpi--st-upcoming::before         { background: var(--st-upcoming); }
.kpi--st-inprogress::before       { background: var(--st-inprogress); }
.kpi--st-completed::before        { background: var(--st-completed); }
.kpi--st-notapplicable::before    { background: var(--st-notapplicable); }
.kpi__label { font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); font-weight: 600; }
.kpi__value {
  margin-top: .5rem;
  font-size: 1.9rem; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em;
}
.kpi--accentMaroon .kpi__value { color: var(--urg-overdue); }
.kpi--st-completed .kpi__value { color: var(--ok-ink); }
.kpi__foot { margin-top: .5rem; font-size: .72rem; color: var(--ink-faint); }

/* ---- View switch ------------------------------------------- */
.viewswitch-wrap { border-bottom: 1px solid var(--hairline); background: var(--white); }
.viewswitch { display: flex; gap: 1.75rem; }
.viewswitch__tab {
  background: none; border: 0; cursor: pointer;
  padding: .95rem 0; margin-bottom: -1px;
  font-size: .8125rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 2px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.viewswitch__tab:hover { color: var(--ink); }
.viewswitch__tab[aria-selected="true"] { color: var(--maroon); border-bottom-color: var(--gold); }

/* ---- Toolbar ----------------------------------------------- */
.toolbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: var(--white);
  border-bottom: 1px solid var(--hairline);
}
.toolbar__inner {
  display: grid;
  grid-template-columns: minmax(220px, 2.2fr) repeat(3, minmax(140px, 1fr));
  gap: 1rem;
  padding-block: 1rem .85rem;
}
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field__label { font-size: .625rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-muted); font-weight: 600; }
.field__control { position: relative; display: flex; align-items: center; }
.field__icon { position: absolute; left: .65rem; width: 14px; height: 14px; color: var(--ink-faint); pointer-events: none; }

.field input,
.field select {
  width: 100%;
  padding: .5rem .7rem;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: var(--white);
  font-size: .8125rem;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.field input { padding-left: 2rem; }
.field input::placeholder { color: var(--ink-faint); }
.field input:hover, .field select:hover { border-color: var(--ink-faint); }
.field input:focus, .field select:focus { border-color: var(--maroon); }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
                    linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 51%, calc(100% - 10px) 51%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 1.9rem;
}

.toolbar__chips {
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem;
  align-items: center; justify-content: space-between;
  padding-bottom: .9rem;
}
.chipsets { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.chips--urgency { position: relative; padding-left: 1.25rem; }
.chips--urgency::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 22px; background: var(--hairline);
}
.chips__label {
  font-size: .625rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600; margin-right: .1rem;
}
.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem .75rem;
  border: 1px solid var(--hairline);
  border-radius: 100px;
  background: var(--white);
  font-size: .75rem; font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--ink-faint); }
.chip__count {
  font-variant-numeric: tabular-nums;
  font-size: .6875rem;
  color: var(--ink-faint);
  background: var(--hairline-soft);
  padding: 0 .35rem; border-radius: 100px; min-width: 1.35em; text-align: center;
}
.chip.is-active { background: var(--maroon); border-color: var(--maroon); color: var(--white); }
.chip.is-active .chip__count { background: rgba(255, 255, 255, .18); color: var(--white); }
.chip.is-quiet { opacity: .5; }

/* Urgency chips take on their own colour when active */
.chip--urgency[data-urgency="overdue"].is-active {
  background: var(--urg-overdue); border-color: var(--urg-overdue);
}
.chip--urgency[data-urgency="duesoon"].is-active {
  background: var(--urg-duesoon); border-color: var(--urg-duesoon);
}

.toolbar__meta { display: flex; align-items: center; gap: .75rem; }
.toolbar__count { font-size: .75rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* ---- Table ------------------------------------------------- */
.tablewrap { border: 1px solid var(--hairline); background: var(--white); overflow-x: auto; }
.register { width: 100%; min-width: 960px; font-size: .8125rem; }
.register thead th {
  background: var(--pale);
  text-align: left; font-weight: 600;
  font-size: .625rem; letter-spacing: .12em; text-transform: uppercase; color: var(--maroon);
  padding: .8rem .85rem;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
.register tbody td {
  padding: .85rem;
  border-bottom: 1px solid var(--hairline-soft);
  vertical-align: top;
}
.register tbody tr { transition: background var(--dur) var(--ease); }
.register tbody tr:hover { background: var(--page); }
.register tbody tr:last-child td { border-bottom: 0; }

/* Left accent: urgency first (it is the thing to notice), else sheet status */
.register tbody tr.is-upcoming     { box-shadow: inset 3px 0 0 var(--st-upcoming); }
.register tbody tr.is-inprogress   { box-shadow: inset 3px 0 0 var(--st-inprogress); }
.register tbody tr.is-completed    { box-shadow: inset 3px 0 0 var(--st-completed); }
.register tbody tr.is-notapplicable{ box-shadow: inset 3px 0 0 var(--st-notapplicable); }
.register tbody tr.is-duesoon      { box-shadow: inset 3px 0 0 var(--urg-duesoon); }
.register tbody tr.is-overdue      { box-shadow: inset 3px 0 0 var(--urg-overdue); }
.register tbody tr.is-notapplicable .cell-part,
.register tbody tr.is-notapplicable .cell-date b { color: var(--ink-muted); }
.register tbody tr.is-next { background: var(--gold-tint); }
.register tbody tr.is-next:hover { background: #fdf6d6; }

.col-sl    { width: 48px; }
.col-date  { width: 132px; }
.col-auth  { width: 150px; }
.col-status{ width: 176px; }
.col-rem   { width: 200px; }
.col-link  { width: 92px; }

.cell-sl   { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.cell-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-date b { font-weight: 600; display: block; }
.cell-date span { color: var(--ink-faint); font-size: .6875rem; }
.cell-date__in { display: block; margin-top: .15rem; color: var(--ink-faint); }
.cell-part { color: var(--ink); max-width: 46ch; }
.cell-auth { color: var(--ink-muted); }
.cell-rem  { color: var(--ink-muted); max-width: 34ch; }
.cell-empty { color: var(--ink-faint); }

.statuscell { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }

/* Status pills — read straight from the sheet */
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .22rem .55rem .22rem .5rem;
  border-radius: 2px;
  border: 1px solid;
  font-size: .6875rem; font-weight: 600; letter-spacing: .02em;
  white-space: nowrap;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.pill--upcoming   { color: var(--gold-ink);  border-color: var(--gold-line);  background: var(--gold-tint); }
.pill--inprogress { color: var(--prog-ink);  border-color: var(--prog-line);  background: var(--prog-tint); }
.pill--completed  { color: var(--ok-ink);    border-color: var(--ok-line);    background: var(--ok-tint); }
.pill--notapplicable {
  color: var(--ink-faint); border-color: var(--hairline); background: var(--white);
  border-style: dashed; font-weight: 500;
}
.pill--notapplicable::before { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }

/* Urgency badges — the additive, date-driven signal beside the status */
.urg {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .16rem .48rem;
  border-radius: 100px;
  border: 1px solid;
  font-size: .625rem; font-weight: 600; letter-spacing: .01em;
  white-space: nowrap;
}
.urg::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.urg--overdue { color: var(--urg-overdue); border-color: var(--urg-overdue-line); background: var(--urg-overdue-tint); }
.urg--duesoon { color: var(--urg-duesoon); border-color: var(--urg-duesoon-line); background: var(--urg-duesoon-tint); }
.urg--overdue::before { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.linkout { display: inline-flex; align-items: center; gap: .35rem; color: var(--maroon); text-decoration: none; font-weight: 500; border-bottom: 1px solid transparent; }
.linkout:hover { border-bottom-color: var(--gold); }
.linkout svg { width: 11px; height: 11px; }

/* ---- Timeline ---------------------------------------------- */
.months { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.month { background: var(--white); padding: 1.25rem 1.35rem 1.35rem; transition: background var(--dur) var(--ease); }
.month:hover { background: #fffefb; }
.month.is-empty { background: var(--page); }
.month__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.month__name { font-family: var(--font-display); font-size: 1.0625rem; }
.month__total { font-size: .75rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.month.is-current .month__name { color: var(--maroon); }
.month__badge {
  display: inline-block; margin-left: .55rem; font-family: var(--font-body);
  font-size: .5625rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold-ink); background: var(--gold-tint);
  border: 1px solid var(--gold-line); padding: .1rem .35rem; vertical-align: middle;
}

.bar { display: flex; height: 5px; margin: .9rem 0 .8rem; background: var(--hairline-soft); overflow: hidden; border-radius: 2px; }
.bar__seg { height: 100%; transition: width .5s var(--ease); }
.bar__seg--upcoming      { background: var(--st-upcoming); }
.bar__seg--inprogress    { background: var(--st-inprogress); }
.bar__seg--completed     { background: var(--st-completed); }
.bar__seg--notapplicable { background: var(--st-notapplicable); }

.legend { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .6875rem; color: var(--ink-muted); }
.legend span { display: inline-flex; align-items: center; gap: .35rem; font-variant-numeric: tabular-nums; }
.legend i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.legend__flag { color: var(--urg-overdue); font-weight: 600; }
.legend__flag i { background: var(--urg-overdue); }

.month__list { list-style: none; padding: 0; margin: 1rem 0 0; border-top: 1px solid var(--hairline-soft); }
.month__item { display: flex; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--hairline-soft); }
.month__item:last-child { border-bottom: 0; }
.month__item.is-next { background: var(--gold-tint); box-shadow: inset 3px 0 0 var(--gold); padding-left: .65rem; margin-inline: -.65rem; padding-right: .65rem; }
.month__item.is-overdue .month__day { color: var(--urg-overdue); }
.month__day {
  flex: none; width: 2.6rem; text-align: left;
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: .8125rem;
}
.month__day small { display: block; font-weight: 400; font-size: .625rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }
.month__what { min-width: 0; }
.month__what p { font-size: .8125rem; line-height: 1.45; }
.month__what .month__auth { font-size: .6875rem; color: var(--ink-faint); margin-top: .25rem; }
.month__status {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
  margin-top: .35rem; font-size: .6875rem; color: var(--ink-muted);
}
.month__status .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot--upcoming      { background: var(--st-upcoming); }
.dot--inprogress    { background: var(--st-inprogress); }
.dot--completed     { background: var(--st-completed); }
.dot--notapplicable { background: var(--st-notapplicable); box-shadow: inset 0 0 0 1px var(--ink-faint); }
.month__status .urg { margin-left: .15rem; }
.month__tag {
  display: inline-block; margin-top: .4rem;
  font-size: .5625rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
  color: var(--gold-ink);
}
.month__none { margin-top: 1rem; font-size: .8125rem; color: var(--ink-faint); }

/* ---- States ------------------------------------------------ */
.state { padding-block: clamp(2rem, 4vw, 3rem); }

.skeleton-hero { display: grid; grid-template-columns: minmax(250px, 300px) 1fr; gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.skeleton-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--hairline); }
.skeleton-rows { margin-top: 1.5rem; border: 1px solid var(--hairline); background: var(--white); }
.skel { background: linear-gradient(90deg, var(--hairline-soft) 25%, #f7f4ef 37%, var(--hairline-soft) 63%); background-size: 400% 100%; animation: shimmer 1.5s ease-in-out infinite; }
.skel--ring { height: 240px; background-color: var(--white); }
.skel--kpi { height: 112px; background-color: var(--white); }
.skel--row { height: 52px; border-bottom: 1px solid var(--hairline-soft); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.notice { border: 1px solid var(--maroon-line); border-left: 3px solid var(--maroon); background: var(--white); padding: 1.75rem 1.9rem; max-width: 74ch; }
.notice__title { font-size: 1.1875rem; line-height: 1.35; }
.notice__reason { margin-top: .75rem; font-size: .8125rem; color: var(--ink-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-word; }
.notice__help { margin-top: 1.1rem; font-size: .875rem; }
.notice__steps { margin: .75rem 0 0; padding-left: 1.1rem; font-size: .875rem; color: var(--ink); }
.notice__steps li { margin-bottom: .5rem; padding-left: .2rem; }
.notice__steps code { background: var(--gold-tint); border: 1px solid var(--gold-line); padding: 0 .25rem; font-size: .8125rem; }
.notice__actions { margin-top: 1.4rem; display: flex; gap: .6rem; flex-wrap: wrap; }

.empty { border: 1px solid var(--hairline); background: var(--white); padding: 3rem 1.9rem 3.25rem; text-align: left; }
.empty__title { font-size: 1.125rem; }
.empty__body { margin: .5rem 0 1.25rem; font-size: .875rem; color: var(--ink-muted); max-width: 60ch; }

/* ---- Footer ------------------------------------------------ */
.footer { border-top: 1px solid var(--hairline); background: var(--white); margin-top: 2rem; }
.footer__inner { padding-block: 2rem 2.5rem; font-size: .8125rem; color: var(--ink-muted); }
.footer__muted { margin-top: .3rem; color: var(--ink-faint); }

/* ---- Toast ------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 1.75rem; transform: translate(-50%, 8px);
  z-index: var(--z-toast);
  background: var(--maroon); color: var(--white);
  padding: .7rem 1.1rem; border-radius: 2px;
  font-size: .8125rem; box-shadow: 0 6px 20px rgba(42, 42, 42, .14);
  opacity: 0; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--ink); }

/* ---- Responsive -------------------------------------------- */
@media (max-width: 1080px) {
  .toolbar__inner { grid-template-columns: 1fr 1fr; }
  .field--search { grid-column: 1 / -1; }
  .overview { grid-template-columns: 1fr; }
  .skeleton-hero { grid-template-columns: 1fr; }
  .ringcard { flex-direction: row; align-items: center; gap: 1.75rem; }
  .ringcard__chart { margin: 0; flex: none; }
  .ringcard__side { flex: 1; }
  .ringcard__caption { text-align: left; }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .masthead__inner { align-items: flex-start; }
  .masthead__sync { width: 100%; flex-direction: column; align-items: flex-start; gap: .5rem; }
  .section__head--split { flex-direction: column; }
  .asof { width: 100%; align-items: stretch; }
  .field--asof { flex: 1; min-width: 0; }
  .criteria-table { font-size: .75rem; }
  .criteria-table td:first-child { width: auto; }
  .nextband__body { display: block; }
  .nextband__meta { margin-top: 1rem; gap: 1.5rem; }
  .ringcard { flex-direction: column; text-align: center; }
  .ringcard__caption { text-align: center; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .toolbar { position: static; }
  .toolbar__inner { grid-template-columns: 1fr; }
  .chipsets { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .chips--urgency { padding-left: 0; }
  .chips--urgency::before { display: none; }
  .toolbar__meta { width: 100%; justify-content: space-between; }

  /* Table becomes stacked records */
  .tablewrap { border: 0; overflow: visible; }
  .register, .register thead, .register tbody, .register tr, .register td { display: block; width: auto; min-width: 0; }
  .register thead { display: none; }
  .register tbody tr {
    border: 1px solid var(--hairline); background: var(--white);
    margin-bottom: .75rem; padding: 1rem 1.1rem;
    display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem;
  }
  .register tbody tr:hover { background: var(--white); }
  .register tbody td { border: 0; padding: 0; }
  .cell-sl { display: none; }
  .cell-date { grid-column: 1; grid-row: 1; }
  .cell-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .statuscell { align-items: flex-end; }
  .cell-part { grid-column: 1 / -1; font-weight: 500; }
  .cell-auth, .cell-rem, .cell-link { grid-column: 1 / -1; font-size: .75rem; }
  .cell-rem::before { content: "Remarks — "; color: var(--ink-faint); }
  .months { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .kpis { grid-template-columns: 1fr; }
}

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

/* ---- Print ------------------------------------------------- */
/* ============================================================
   LEDGER  —  Fund Utilisation & Financial Summary panels
   ============================================================ */

.ledger__inner { padding-block: clamp(1.5rem, 3.5vw, 2.75rem); }

.ledger__loading { padding-block: 2rem; display: grid; gap: .8rem; }

/* head */
.ledger__head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.1rem;
}
.ledger__headText .section__title { font-size: 1.35rem; margin-top: .1rem; }
.ledger__headActions { display: flex; gap: .5rem; flex: none; }

/* toolbar */
.ledger__toolbar {
  display: flex; gap: 1rem 1.25rem; align-items: flex-end; flex-wrap: wrap;
  padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--hairline);
}
.ledger__toolbar .field--search { flex: 1 1 240px; }

/* column filter chips */
.ledger__colfilter { display: flex; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.ledger__colfilterLabel { font-size: .625rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-muted); font-weight: 600; }
.lchips { display: flex; flex-wrap: wrap; gap: .4rem; }
.lchip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .34rem .6rem; font-size: .75rem; cursor: pointer;
  border: 1px solid var(--hairline); background: var(--white); color: var(--ink-muted);
  border-radius: 999px; transition: all var(--dur) var(--ease);
}
.lchip:hover { border-color: var(--ink-faint); color: var(--ink); }
.lchip.is-on { border-color: var(--maroon); color: var(--maroon); background: var(--maroon-tint); }
.lchip__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; opacity: .35; }
.lchip.is-on .lchip__dot { opacity: 1; }
.lchip__grp { font-size: .62rem; color: var(--ink-faint); }

/* KPIs (reuse .kpi from the register, tuned for money) */
.kpis--ledger { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 1.5rem; }
/* Exact figures run longer than compact ones — size to fit, keep on one line. */
.kpis--ledger .kpi__value { font-size: clamp(1.02rem, 2vw, 1.45rem); letter-spacing: -0.01em; font-variant-numeric: tabular-nums lining-nums; overflow-wrap: normal; word-break: keep-all; }
.kpi[style*="--kpi-accent"]::before { background: var(--kpi-accent); }

/* cards */
.ledger__card { border: 1px solid var(--hairline); background: var(--white); border-radius: 4px; padding: 1.1rem 1.25rem 1.25rem; margin-bottom: 1.5rem; }
.ledger__card--table { padding: 0; overflow: hidden; }
.ledger__cardHead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ledger__cardTitle { font-size: 1.02rem; font-weight: 600; }
.ledger__empty { color: var(--ink-muted); font-size: .85rem; padding: 1rem 0; }

/* viz — grouped horizontal bars */
.lviz { display: grid; gap: 1rem; }
.lviz__row { display: grid; gap: .4rem; }
.lviz__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.lviz__name { font-size: .82rem; font-weight: 600; color: var(--ink); }
.lviz__total { font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--maroon); font-weight: 600; }
.lviz__bars { display: grid; gap: .28rem; }
.lviz__line { display: grid; grid-template-columns: minmax(0, 92px) 1fr auto; align-items: center; gap: .55rem; }
.lviz__lineLab { font-size: .68rem; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lviz__track { position: relative; height: 12px; background: var(--hairline-soft); border-radius: 999px; overflow: hidden; }
.lviz__fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; transition: width .5s var(--ease); }
.lviz__lineVal { font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--ink-muted); white-space: nowrap; }
.lviz__lineVal--solo { font-weight: 600; color: var(--ink); }
.lviz__line:has(.lviz__lineVal--solo) { grid-template-columns: 1fr auto; }
.lviz__legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .72rem; color: var(--ink-muted); }
.lviz__legend span { display: inline-flex; align-items: center; gap: .35rem; }
.lviz__legend i { width: 10px; height: 10px; border-radius: 2px; flex: none; }

/* composition strip */
.lviz__comp { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px dashed var(--hairline); display: grid; gap: .5rem; }
.lviz__compHead { display: flex; justify-content: space-between; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); font-weight: 600; }
.lstack { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--hairline-soft); }
.lstack__seg { height: 100%; transition: width .5s var(--ease); }

/* ledger table */
.lt { width: 100%; min-width: 640px; font-size: .8125rem; }
.lt thead th { position: sticky; top: 0; z-index: 1; background: var(--maroon); color: #fff; text-align: right; padding: .6rem .85rem; font-weight: 600; font-size: .72rem; letter-spacing: .03em; }
.lt thead th.lt__lab { text-align: left; }
.lth { display: inline-flex; flex-direction: column; align-items: flex-end; gap: .1rem; }
.lth small { font-weight: 400; opacity: .8; font-size: .62rem; }
.lth__dot { display: none; }
.lt__lab { text-align: left; }
.lt__num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lt tbody th, .lt tbody td, .lt tfoot th, .lt tfoot td { padding: .5rem .85rem; border-bottom: 1px solid var(--hairline-soft); }
.lt__section td, .lt__section th { background: var(--maroon-tint); font-weight: 700; border-bottom: 1px solid var(--maroon-line); }
.lt__section--income th, .lt__section--income td { background: var(--ok-tint); border-bottom-color: var(--ok-line); }
.lt__section--expense th, .lt__section--expense td { background: #fbeef4; border-bottom-color: var(--maroon-line); }
.lt__kind { margin-left: .5rem; font-size: .58rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.lt__num--total { color: var(--maroon); }
.lt__item:hover td, .lt__item:hover th { background: var(--page); }
.lt__none { color: var(--ink-faint); font-style: italic; text-align: center; padding: 1rem !important; }
.lt__grand th, .lt__grand td { background: var(--maroon-deep); color: #fff; font-weight: 700; border-bottom: 0; }

@media (max-width: 640px) {
  .lviz__line { grid-template-columns: minmax(0, 70px) 1fr auto; }
}

@media print {
  .ledger__toolbar, .ledger__colfilter, .ledger__headActions { display: none !important; }
  .lt { min-width: 0; font-size: 10px; }
  .ledger__card { border-color: var(--hairline); break-inside: avoid; }
  .lt thead th, .lt__grand th, .lt__grand td { background: var(--white) !important; color: var(--ink) !important; }
}

@media print {
  .toolbar, .viewswitch-wrap, .masthead__sync, .toast, .footer, .skip-link, .asof, .criteria-panel { display: none !important; }
  .masthead, .nextband { background: var(--white) !important; color: var(--ink) !important; }
  .masthead__title, .nextband__particulars, .masthead__period, .nextband__meta dd { color: var(--ink) !important; }
  .overview { grid-template-columns: minmax(250px, 300px) 1fr; }
  .register { min-width: 0; font-size: 10px; }
  .tablewrap { overflow: visible; }
  body { background: var(--white); }
  .urg--overdue::before { animation: none !important; }
}

/* ============================================================
   ACCESS PORTAL  —  the soft gate shown before the dashboard
   ============================================================ */

/* While locked, the dashboard chrome is not rendered at all: it can't
   be tabbed to, read by a screen reader, or glimpsed behind the card. */
body.locked { overflow: hidden; }
body.locked .skip-link,
body.locked .masthead,
body.locked #main,
body.locked .footer { display: none !important; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(1.1rem, 4vw, 2.5rem);
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(241, 162, 34, 0.20), transparent 60%),
    radial-gradient(90% 70% at 85% 110%, rgba(241, 162, 34, 0.10), transparent 55%),
    linear-gradient(160deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  overflow: auto;
}
body:not(.locked) .gate,
.gate[hidden] { display: none; }

.gate__card {
  width: min(30rem, 100%);
  background: var(--page);
  border: 1px solid var(--maroon-line);
  border-radius: 18px;
  padding: clamp(1.6rem, 4vw, 2.6rem) clamp(1.4rem, 4vw, 2.4rem);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55), 0 2px 0 rgba(255, 255, 255, 0.6) inset;
  text-align: center;
}

/* Takshashila logo */
.gate__mark {
  width: 88px;
  height: 88px;
  margin: 0 auto 1.15rem;
}
.gate__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gate__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-ink);
}
.gate__title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.5vw, 1.95rem);
  font-weight: 600;
  color: var(--maroon);
}
.gate__lede {
  margin: 0 auto 1.5rem;
  max-width: 26rem;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.gate__form { text-align: left; }
.gate__label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.gate__field { position: relative; display: flex; align-items: center; }
.gate__input {
  width: 100%;
  padding: 0.8rem 4.2rem 0.8rem 0.95rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--maroon-line);
  border-radius: 11px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gate__input::placeholder { color: var(--ink-faint); }
.gate__input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-tint);
}
.gate__input[aria-invalid="true"] {
  border-color: var(--urg-overdue);
  box-shadow: 0 0 0 3px var(--urg-overdue-tint);
}
.gate__toggle {
  position: absolute;
  right: 0.4rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--maroon);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}
.gate__toggle:hover { background: var(--maroon-tint); }
.gate__toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.gate__error {
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--urg-overdue);
}

.gate__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1.15rem;
  padding: 0.85rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  background: var(--maroon);
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
.gate__submit svg { width: 16px; height: 16px; }
.gate__submit:hover { background: var(--maroon-deep); }
.gate__submit:active { transform: translateY(1px); }
.gate__submit:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.gate__note {
  margin: 1.35rem auto 0;
  max-width: 26rem;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--ink-faint);
}
.gate__note--warn { color: var(--urg-overdue); font-weight: 600; }

/* Wrong-token shake */
.gate--shake .gate__card { animation: gate-shake 0.4s ease; }
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .gate--shake .gate__card { animation: none; }
}

/* ============================================================
   ENHANCEMENTS — Attention · Outlook · Calendar · Analytics ·
   Financial summary · Data health.  Uses the existing tokens so
   the new sections read as one dashboard, not bolt-ons.
   ============================================================ */
:root {
  --info:      #3b6ea5;
  --info-tint: #eef3f9;
  --info-line: #cfe0f0;
  --amber-ink: #b45309;
}

/* ---- Data health pill (masthead) ---------------------------- */
.health {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .32rem .6rem; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.08);
  font-size: .72rem; color: rgba(255,255,255,.94); white-space: nowrap;
}
.health__dot { width: 8px; height: 8px; border-radius: 50%; background: #ccc; flex: none; }
.health__label { font-weight: 600; }
.health__when { color: rgba(255,255,255,.7); }
.health--ok    .health__dot { background: #59d09a; box-shadow: 0 0 0 3px rgba(89,208,154,.22); }
.health--stale .health__dot { background: var(--gold); box-shadow: 0 0 0 3px rgba(241,162,34,.22); }
.health--cache .health__dot { background: var(--gold); }
.health--error .health__dot { background: #ff6b8a; box-shadow: 0 0 0 3px rgba(255,107,138,.22); }
.health--load  .health__dot { background: rgba(255,255,255,.6); animation: healthPulse 1.1s var(--ease) infinite; }
@keyframes healthPulse { 0%,100%{opacity:.35} 50%{opacity:1} }

/* ---- Attention Center --------------------------------------- */
.attn { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.25rem 1.75rem; align-items: start; }
.attn__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .7rem; }
.att {
  display: grid; gap: .12rem; text-align: left; cursor: pointer;
  padding: .75rem .8rem; border-radius: 6px;
  border: 1px solid var(--hairline); background: var(--white);
  position: relative; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.att:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(40,20,30,.07); }
.att.is-active { border-width: 1px; box-shadow: 0 0 0 2px currentColor inset; }
.att__dot { position: absolute; top: .8rem; right: .8rem; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.att__n { font-size: 1.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.att__label { font-size: .78rem; font-weight: 600; color: var(--ink); }
.att__sub { font-size: .68rem; color: var(--ink-faint); }
.att--overdue    { color: var(--urg-overdue); }
.att--today      { color: var(--amber-ink); }
.att--next7      { color: var(--gold-ink); }
.att--next30     { color: var(--info); }
.att--inprogress { color: var(--st-inprogress); }

.attn__listHead { font-size: .625rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-muted); font-weight: 600; margin-bottom: .5rem; }
.attitem {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem;
  width: 100%; text-align: left; cursor: pointer;
  padding: .5rem .3rem; border: 0; border-bottom: 1px solid var(--hairline-soft); background: transparent;
  transition: background var(--dur) var(--ease);
}
.attitem:hover { background: var(--page); }
.attitem__timing { font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.attitem__timing.is-overdue { color: var(--urg-overdue); }
.attitem__timing.is-today   { color: var(--amber-ink); }
.attitem__timing.is-soon    { color: var(--gold-ink); }
.attitem__main { min-width: 0; display: grid; gap: .1rem; }
.attitem__what { font-size: .84rem; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attitem__meta { font-size: .72rem; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att__clear { color: var(--ok-ink); background: var(--ok-tint); border: 1px solid var(--ok-line); border-radius: 6px; padding: .8rem 1rem; font-size: .85rem; }

/* ---- 30-Day Outlook ----------------------------------------- */
.outlook__line { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: .55rem; }
.outlook__line::before { content: ""; position: absolute; left: 5px; top: .4rem; bottom: .4rem; width: 2px; background: var(--hairline); }
.outlook__item { position: relative; padding-left: 1.4rem; }
.outlook__node { position: absolute; left: 0; top: .55rem; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--hairline); }
.outlook__card { display: block; width: 100%; text-align: left; cursor: pointer; border: 1px solid var(--hairline); border-radius: 6px; background: var(--white); padding: .55rem .75rem; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.outlook__card:hover { border-color: var(--maroon-line); background: var(--maroon-tint); }
.outlook__top { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.outlook__date { font-size: .72rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.outlook__rel { font-size: .72rem; font-weight: 700; color: var(--gold-ink); }
.outlook__what { display: block; font-size: .86rem; font-weight: 600; color: var(--ink); margin: .15rem 0; }
.outlook__meta { font-size: .74rem; color: var(--ink-muted); }
.outlook__item.is-done .outlook__what { color: var(--ink-faint); text-decoration: line-through; }
.outlook__item.is-done .outlook__card { background: var(--page); }
.outlook__empty, .cal__detailPrompt { color: var(--ink-muted); font-size: .85rem; padding: .5rem 0; }

/* ---- Compliance Calendar ------------------------------------ */
.cal__nav { display: flex; gap: .35rem; }
.cal__title { font-family: var(--font-display); font-size: 1.15rem; color: var(--maroon); margin: .25rem 0 1rem; }
.cal { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.cal__dows { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal__dow { text-align: center; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; padding: .2rem 0; }
.cal__cells { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal__cell { aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .2rem; padding: .3rem .2rem; border: 1px solid var(--hairline-soft); border-radius: 5px; background: var(--white); cursor: default; }
.cal__cell--blank { border: 0; background: transparent; }
.cal__cell.has-items { cursor: pointer; border-color: var(--hairline); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.cal__cell.has-items:hover { border-color: var(--maroon-line); box-shadow: 0 2px 8px rgba(40,20,30,.06); }
.cal__cell.is-today { outline: 2px solid var(--gold); outline-offset: -2px; }
.cal__cell.is-selected { border-color: var(--maroon); box-shadow: 0 0 0 2px var(--maroon-tint) inset; }
.cal__cell.tone--overdue { background: var(--urg-overdue-tint); }
.cal__cell.tone--duesoon { background: var(--gold-tint); }
.cal__num { font-size: .78rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.cal__cell:disabled .cal__num { color: var(--ink-faint); font-weight: 400; }
.cal__dots { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; align-items: center; }
.cal__dot { width: 6px; height: 6px; border-radius: 50%; }
.cal__more { font-size: .56rem; color: var(--ink-faint); font-weight: 600; }
.cal__detail { border: 1px solid var(--hairline); border-radius: 6px; background: var(--page); padding: .9rem 1rem; min-height: 120px; }
.cal__detailHead { font-size: .78rem; font-weight: 700; color: var(--maroon); margin-bottom: .6rem; }
.cal__detailList { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.cal__detailItem { display: grid; gap: .12rem; width: 100%; text-align: left; cursor: pointer; border: 0; background: var(--white); border: 1px solid var(--hairline-soft); border-radius: 5px; padding: .5rem .6rem; transition: border-color var(--dur) var(--ease); }
.cal__detailItem:hover { border-color: var(--maroon-line); }
.cal__detailWhat { font-size: .82rem; font-weight: 600; color: var(--ink); }
.cal__detailMeta { font-size: .72rem; color: var(--ink-muted); }
.cal__detailStatus { font-size: .72rem; color: var(--ink-muted); }
.cal__detailStatus .is-overdue { color: var(--urg-overdue); }

/* ---- Analytics: workload + authority ------------------------ */
.analytics { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.analytics__card { border: 1px solid var(--hairline); border-radius: 6px; background: var(--white); padding: 1.1rem 1.2rem 1.25rem; }
.analytics__title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }

.wl__plot { display: flex; align-items: flex-end; gap: .35rem; height: 200px; }
.wl__col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .3rem; height: 100%; cursor: pointer; border: 0; background: transparent; padding: 0; }
.wl__count { font-size: .72rem; font-weight: 700; color: var(--ink-muted); font-variant-numeric: tabular-nums; min-height: 1em; }
.wl__bar { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.wl__stack { width: 72%; max-width: 34px; display: flex; flex-direction: column-reverse; border-radius: 3px 3px 0 0; overflow: hidden; background: var(--hairline-soft); transition: opacity var(--dur) var(--ease); }
.wl__col:hover .wl__stack { opacity: .85; }
.wl__col.is-selected .wl__stack { outline: 2px solid var(--maroon); outline-offset: 1px; }
.wl__col.is-current .wl__x { color: var(--maroon); font-weight: 700; }
.wl__seg--completed { background: var(--st-completed); }
.wl__seg--open      { background: var(--st-upcoming); }
.wl__seg--overdue   { background: var(--urg-overdue); }
.wl__seg--na        { background: var(--st-notapplicable); }
.wl__x { font-size: .6rem; color: var(--ink-muted); white-space: nowrap; transform: rotate(-32deg); transform-origin: center; margin-top: .3rem; }
.wl__legend, .analytics ~ * .wl__legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: 1.4rem; font-size: .7rem; color: var(--ink-muted); }
.wl__legend span { display: inline-flex; align-items: center; gap: .35rem; }
.wl__key { width: 10px; height: 10px; border-radius: 2px; }
.wl__key--completed { background: var(--st-completed); }
.wl__key--open { background: var(--st-upcoming); }
.wl__key--overdue { background: var(--urg-overdue); }
.wl__key--na { background: var(--st-notapplicable); }

.authority { display: grid; gap: .5rem; }
.auth__row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: .6rem; width: 100%; text-align: left; cursor: pointer; border: 0; background: transparent; padding: .2rem 0; }
.auth__name { font-size: .78rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth__track { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--hairline-soft); }
.auth__seg { height: 100%; transition: opacity var(--dur) var(--ease); }
.auth__seg--completed { background: var(--st-completed); }
.auth__seg--open      { background: var(--st-upcoming); }
.auth__seg--overdue   { background: var(--urg-overdue); }
.auth__row:hover .auth__seg { opacity: .82; }
.auth__row.is-selected .auth__track { outline: 2px solid var(--maroon); outline-offset: 1px; }
.auth__total { font-size: .76rem; font-weight: 700; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* ---- Ring interactivity ------------------------------------- */
.ring__seg { transition: stroke-dashoffset .6s var(--ease), stroke-dasharray .6s var(--ease), opacity var(--dur) var(--ease); }
.ringcard__svg:hover .ring__seg { opacity: .55; }
.ringcard__svg .ring__seg:hover { opacity: 1; }
.ringlegend__btn { display: inline-flex; align-items: center; gap: .5rem; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; padding: .2rem .25rem; border-radius: 4px; transition: background var(--dur) var(--ease); }
.ringlegend__btn:hover { background: var(--page); }

/* ---- Financial summary (fund tab) --------------------------- */
.fin { margin-bottom: 1.75rem; }
.fin__head { margin-bottom: .9rem; }
.fin__title { font-size: 1.05rem; font-weight: 600; color: var(--maroon); }
.fin__note { font-size: .78rem; color: var(--ink-muted); margin-top: .15rem; }
.fin__kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1.4rem; }
.fin__kpi { border: 1px solid var(--hairline); border-radius: 6px; background: var(--white); padding: .85rem .95rem; border-left: 3px solid var(--hairline); }
.fin__kpi--income { border-left-color: var(--st-completed); }
.fin__kpi--expense { border-left-color: var(--maroon); }
.fin__kpi--net { border-left-color: var(--gold); }
.fin__kpi--util { border-left-color: var(--info); }
.fin__kpiLabel { font-size: .625rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); font-weight: 600; }
.fin__kpiValue { font-size: 1.3rem; font-weight: 700; margin-top: .35rem; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.fin__kpiValue.is-neg { color: var(--urg-overdue); }
.fin__kpiValue.is-pos { color: var(--ok-ink); }
.fin__kpiFoot { font-size: .68rem; color: var(--ink-faint); margin-top: .3rem; }
.fin__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.5rem; align-items: start; }
.fin__block { border: 1px solid var(--hairline); border-radius: 6px; background: var(--white); padding: 1rem 1.1rem 1.15rem; }
.fin__blockTitle { font-size: .82rem; font-weight: 600; color: var(--ink); margin-bottom: .85rem; }
.ive__row { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.ive__lab { font-size: .74rem; color: var(--ink-muted); }
.ive__track { height: 14px; background: var(--hairline-soft); border-radius: 999px; overflow: hidden; }
.ive__fill { display: block; height: 100%; border-radius: 999px; transition: width .5s var(--ease); }
.ive__fill--income { background: var(--st-completed); }
.ive__fill--expense { background: var(--maroon); }
.ive__fill--net { background: var(--gold); }
.ive__fill--neg { background: var(--urg-overdue); }
.ive__val { font-size: .76rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ent { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; }
.ent__card { border: 1px solid var(--hairline-soft); border-radius: 5px; background: var(--page); padding: .75rem .8rem; }
.ent__name { font-size: .82rem; font-weight: 700; color: var(--maroon); margin-bottom: .6rem; }
.ent__net { font-size: .76rem; color: var(--ink-muted); margin-top: .3rem; }
.ent__net b { font-variant-numeric: tabular-nums; }
.ent__net .is-neg { color: var(--urg-overdue); }
.ent__net .is-pos { color: var(--ok-ink); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .attn, .cal, .analytics, .fin__grid { grid-template-columns: 1fr; }
  .fin__grid { gap: 1rem; }
}
@media (max-width: 560px) {
  .fin__kpis { grid-template-columns: 1fr 1fr; }
  .wl__plot { height: 160px; }
  .cal__detail { min-height: 0; }
}

@media print {
  .cal__nav, .health, .att, .attn__list, .wl__legend { break-inside: avoid; }
  #tabCalendar, #tabAnalytics { display: none !important; }
}
