:root {
  --brand: #0b5fa5;
  --brand-dark: #084a82;
  --ink: #1c2230;
  --muted: #6b7280;
  --border: #e3e6ea;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ok: #1a7f37;
  --warn: #b45309;
  --bad: #c8102e;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }

body { margin: 0; background: var(--bg); color: var(--ink); }

[hidden] { display: none !important; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.brand-name { font-weight: 700; font-size: 16px; line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--muted); }

/* ---------- Landing (sign-in / set password) ----------
   Deep VS blue with one line per company flowing into a single white line
   (drawn by js/landing.js on #landing-bg). Headline left, sign-in card right. */
body.on-landing { background: #072f55; }
.landing-bg { position: fixed; inset: 0; width: 100%; height: 100%; display: none; }
body.on-landing .landing-bg { display: block; }

.landing {
  position: relative; z-index: 1;
  min-height: 100vh; max-width: 1180px; margin: 0 auto; padding: 48px 40px;
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 64px; align-items: center;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}
.landing-hero { color: #fff; text-shadow: 0 1px 12px rgba(7, 47, 85, 0.9); }
.landing-title {
  font-size: clamp(44px, 6.4vw, 84px); font-weight: 600; line-height: 0.98;
  letter-spacing: -0.025em; margin: 0 0 22px; max-width: 9ch;
}
.landing-stat {
  font-size: clamp(22px, 2.6vw, 32px); font-weight: 400; line-height: 1.25; margin: 0;
  color: #cfe3f6; font-variant-numeric: tabular-nums;
}
.landing-count { color: #fff; font-weight: 600; }
.landing-sub { margin: 16px 0 0; max-width: 40ch; font-size: 16px; line-height: 1.55; color: #9cc2e6; }

.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 360px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.landing .login-card { width: auto; color: var(--ink); border: none; box-shadow: 0 30px 70px rgba(2, 18, 36, 0.45); }
.login-card h2 { font-size: 20px; font-weight: 600; margin: 0 0 18px; }
/* Checkbox rows inside the card shouldn't get the full-width input styling. */
.login-card label.checkbox-row { display: flex; color: var(--ink); margin: -4px 0 18px; }
.login-card .checkbox-row input { display: inline-block; width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--brand); }
.login-card .btn-primary { padding: 10px 14px; font-size: 14px; }
.login-card input:focus-visible, .login-card button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (max-width: 860px) {
  .landing { grid-template-columns: 1fr; gap: 32px; padding: 40px 16px; align-content: start; }
  .landing-sub { font-size: 15px; }
}
.login-card label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.login-card input, .login-card select, .login-card textarea {
  display: block; width: 100%; margin-top: 5px; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
}
.login-card p.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

button { font-family: inherit; cursor: pointer; }
.btn-primary, .btn-secondary, .btn-danger, .btn-danger-confirm, .btn-link {
  border-radius: 6px; font-size: 13px; padding: 8px 14px; border: 1px solid transparent;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { background: #a9c3dc; cursor: not-allowed; }
.btn-secondary { background: #fff; border-color: var(--border); color: var(--ink); }
.btn-danger { background: #fff; border-color: var(--bad); color: var(--bad); }
.btn-danger-confirm { background: var(--bad); color: #fff; }
.btn-link { background: none; border: none; color: var(--brand); text-decoration: underline; padding: 0; }

.error-text { color: var(--bad); font-size: 13px; }

/* ---------- App shell ---------- */
.app-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.user-box { display: flex; align-items: center; gap: 14px; }
.user-info { text-align: right; }
#user-name { font-weight: 600; font-size: 13px; }
.role-pill {
  display: inline-block; font-size: 11px; color: var(--muted);
  background: var(--bg); border-radius: 10px; padding: 1px 8px; margin-top: 2px;
}

.app-body { display: flex; flex: 1; }
.app-nav { width: 220px; background: var(--panel); border-right: 1px solid var(--border); padding: 16px 0; }
.nav-section-title { font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 14px 20px 6px; letter-spacing: 0.4px; }
.nav-link { display: block; padding: 9px 20px; font-size: 14px; color: var(--ink); text-decoration: none; cursor: pointer; }
.nav-link:hover { background: var(--bg); }
.nav-link.active { background: #e8f1fa; color: var(--brand); font-weight: 600; border-right: 3px solid var(--brand); }

.view-content { flex: 1; padding: 24px 28px; max-width: 1320px; min-width: 0; }
.view-title { font-size: 20px; margin: 0 0 2px; }
.view-subtitle { font-size: 13px; color: var(--muted); margin: 0 0 18px; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.data-table tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: none; }
.table-scroll { overflow-x: auto; }

/* Dashboard detail table: grouped Actual | Budget | % of budget per measure. */
.detail-table { font-size: 12.5px; }
.detail-table th, .detail-table td { white-space: nowrap; padding: 8px 6px; }
.detail-table th:first-child, .detail-table td:first-child { padding-left: 2px; }
.detail-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.detail-table th.grp {
  text-align: center; text-transform: none; font-size: 13px; color: var(--ink);
  border-bottom: 2px solid var(--border); border-left: 1px solid var(--border);
}
.detail-table thead tr:nth-child(2) th { font-size: 11px; }
/* A divider before each measure group. */
.detail-table thead tr:nth-child(2) th:nth-child(3n+1),
.detail-table tbody td:nth-child(3n+2),
.detail-table tfoot td:nth-child(3n+2) { border-left: 1px solid var(--border); }
.detail-table td.muted { color: var(--muted); }
.detail-table td.pct { font-weight: 600; }
.detail-table td.pct.pos { color: var(--ok); }
.detail-table td.pct.neg { color: var(--bad); }
.detail-table td.pct.none { color: var(--muted); font-weight: 400; }

.empty-state { color: var(--muted); font-size: 13px; padding: 10px 0; }

.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
}
.checkbox-row { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); cursor: pointer; }
.form-hint { font-size: 12px; color: var(--muted); }
/* Password box with a Show / Hide button inside it on the right. */
.pw-field { position: relative; display: block; }
.form-row .pw-field input { padding-right: 64px; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  background: none; border: none; padding: 4px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 600; color: var(--brand);
}
.pw-toggle:hover { background: var(--bg); }
.pw-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.brand-pick { display: flex; align-items: center; gap: 12px; }
.brand-pick input[type="color"] { width: 48px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; }
.brand-pick .checkbox-row input { width: auto; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form .form-row { margin-bottom: 0; min-width: 140px; flex: 1; }

.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.badge-neutral { background: var(--bg); color: var(--muted); }
.badge-ok { background: #e6f4ea; color: var(--ok); }
.badge-warn { background: #fdf0e3; color: var(--warn); }
.badge-bad { background: #fbe5e8; color: var(--bad); }

.key-field { display: flex; align-items: center; gap: 8px; font-family: monospace; font-size: 12px; }
.key-field code { background: var(--bg); padding: 3px 8px; border-radius: 4px; word-break: break-all; }

/* Dashboard top: title on the left; FY above a 4 x 3 month grid on the right. */
.dash-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-period { width: 320px; max-width: 100%; }
.dash-period .fy-select { width: 100%; margin-bottom: 6px; }

/* Months April .. March. Click to pick/unpick any months; none picked = the full year. */
.month-help { display: flex; justify-content: flex-end; margin-top: 6px; font-size: 12px; }
.month-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); background: var(--panel);
  border-top: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.month-tab {
  background: var(--panel); color: var(--ink); border: solid var(--border); border-width: 0 1px 1px 0;
  font-size: 13px; font-weight: 600; padding: 9px 4px; text-align: center;
}
.month-tab:hover { background: var(--bg); }
.month-tab.active { background: var(--brand); color: #fff; border-color: rgba(255,255,255,0.35); }
.month-tab.active:hover { background: var(--brand-dark); }
.month-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; position: relative; }

/* Company list across the page: equal-size boxes in a grid. The number of
   columns (--cols) is set by layoutCompanyStrip() so rows come out even,
   and blank fillers complete the last row. 1px gaps over the border
   colour draw the dividing lines. */
.company-strip {
  display: grid; grid-template-columns: repeat(var(--cols, 8), minmax(0, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 16px;
}
.company-tab {
  background: var(--panel); border: none; padding: 11px 8px; font-size: 14px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; min-width: 0;
}
.company-fill { background: var(--panel); }
.company-tab:hover { background: var(--bg); }
.company-tab.active { background: var(--brand); color: #fff; }
.company-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

@media (max-width: 760px) {
  .dash-period { width: 100%; }
}
.fy-select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
  font-weight: 600; background: var(--panel); color: var(--ink);
}
.company-picker { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.company-picker select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.kpi-card .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.kpi-card .value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.kpi-card .delta { font-size: 13px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-card .delta.pos { color: var(--ok); }
.kpi-card .delta.neg { color: var(--bad); }
.kpi-card .delta.none { color: var(--muted); font-weight: 400; }

.chart-wrap { margin-top: 6px; }
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.chart-legend { display: inline-flex; gap: 14px; font-size: 12px; color: var(--muted); }
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-line { display: inline-block; width: 22px; height: 0; border-top: 2.5px solid var(--co, var(--brand)); }
.lg-line.lg-dash { border-top: 2px dashed var(--co-text, var(--brand)); opacity: 0.6; }

.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 10px 16px; font-size: 14px; color: var(--muted); white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.link-row {
  display: grid; grid-template-columns: 160px 1fr 1fr; gap: 20px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.link-row:last-child { border-bottom: none; padding-bottom: 0; }
.link-company { font-weight: 600; font-size: 14px; padding-top: 2px; }
.link-slot { min-width: 0; }
.link-slot-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 6px; }
.flow-link { font-size: 14px; color: var(--brand); font-weight: 600; text-decoration: none; }
.flow-link:hover { text-decoration: underline; }
.flow-url { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.flow-file-note { font-size: 12px; color: var(--muted); margin-top: 4px; }
.flow-file-note code { font-size: 11.5px; background: var(--surface-2, #f1f3f6); padding: 1px 4px; border-radius: 4px; }
.link-add { display: flex; gap: 8px; }
.link-add input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }

.link-add.editing { flex-wrap: wrap; }
.link-add.editing input { flex-basis: 100%; }
.link-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.link-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.field-with-action { display: flex; gap: 8px; }
.field-with-action input { flex: 1; min-width: 0; }
.notice-ok {
  background: #e6f4ea; color: var(--ok); border: 1px solid #b7dfc3; border-radius: 8px;
  padding: 10px 14px; font-size: 13px; font-weight: 600; margin-bottom: 14px;
}
.link-open { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.src-tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.src-flow { background: #e8f1fa; color: var(--brand); }
.src-excel { background: #e6f4ea; color: #107c41; }
.src-other { background: var(--bg); color: var(--muted); }
.notice-bad {
  background: #fbe5e8; color: var(--bad); border: 1px solid #f1b8c1; border-radius: 8px;
  padding: 10px 14px; font-size: 13px; font-weight: 600; margin-bottom: 14px;
}
.sync-status { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sync-status.ok { color: var(--ok); }
.sync-status.bad { color: var(--bad); }
.sync-status.wait { color: var(--warn); }
.pipeline-key { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.pipeline-key code { font-size: 12px; word-break: break-all; }
.pipe-status { white-space: normal; font-size: 12px; }
.pipe-status .pos { color: var(--ok); }
.pipe-status .neg { color: var(--bad); }
.pipe-status .warn { color: var(--warn); }
.pipe-status .muted { color: var(--muted); }
.sp-steps { margin: 4px 0 14px; font-size: 13px; }
.sp-steps summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.sp-steps ol { margin-top: 8px; }
.sp-steps code { font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.sp-steps ul { margin: 4px 0 0; }
#sp-reader-card .muted { color: var(--muted); font-weight: 400; }
#sp-reader-card { margin-bottom: 16px; }
.sp-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; max-width: 760px; }
.sp-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) { .sp-form { grid-template-columns: 1fr; } }
.link-badges { display: flex; gap: 6px; white-space: nowrap; }
a.badge { text-decoration: none; }
a.badge:hover { text-decoration: underline; }
.row-actions { display: flex; gap: 8px; align-items: center; white-space: nowrap; }

@media (max-width: 760px) {
  .link-row { grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  .link-company { grid-column: 1 / -1; }
  .link-fields { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .link-row { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-body { flex-direction: column; }
  .app-nav { width: 100%; border-right: none; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; padding: 10px 12px; }
  .nav-section-title { width: 100%; padding: 8px 8px 2px; }
  .nav-link { padding: 7px 10px; }
  .nav-link.active { border-right: none; border-bottom: 2px solid var(--brand); }
  .view-content { padding: 16px; max-width: 100%; }
  .app-header { padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .login-card { width: 90vw; max-width: 360px; }
}
.info-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }

/* ---------- Dashboard report (styled after the VS Group consolidation deck) ----------
   Crimson section accents, white panels on the light grey page, LKR millions,
   achievement % green when achieved and red when not. */
:root { --deck-red: #c8102e; --deck-blue: #2b6aa6; }

.rep-section { margin-bottom: 26px; }
.rep-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.rep-head h3 {
  margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink);
  padding-left: 12px; border-left: 4px solid var(--deck-red); line-height: 1.15;
}

.rep-hero { display: flex; align-items: center; gap: 18px; margin: 4px 0 16px; }
.rep-hero h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.rep-hero p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.co-logo { display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--border); border-radius: 6px; flex-shrink: 0; overflow: hidden; }
.co-logo img { max-width: 88%; max-height: 82%; object-fit: contain; }
.co-logo-sm { width: 34px; height: 24px; border-radius: 4px; }
.co-logo-md { width: 64px; height: 44px; }
.co-logo-lg { width: 84px; height: 84px; }
.co-logo-blank { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }

.snap-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.snap-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.snap-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.snap-value { font-size: 26px; font-weight: 700; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.snap-lines { min-height: 18px; font-size: 13px; color: var(--muted); }
.snap-lines b { color: var(--ink); }
.snap-lines b.pos, .ach.pos, .rep-panel .pos, .stat .pos, .gap-cell .pos { color: var(--ok); }
.snap-lines b.neg, .ach.neg, .rep-panel .neg, .stat .neg, .gap-cell .neg, .sub-figs .neg { color: var(--bad); }
.ach { font-weight: 700; }
.ach.nm { color: var(--muted); font-weight: 400; }

.rep-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 16px; align-items: start; }
.rep-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.rep-panel-title { font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.rep-quick { margin: 0 0 14px; font-size: 14px; line-height: 1.55; }
.quick-analysis { font-size: 14px; line-height: 1.55; }
.quick-analysis strong { display: block; font-size: 16px; color: var(--co-text, var(--deck-red)); }
.quick-analysis ul { margin: 6px 0 0; padding-left: 20px; }
.quick-analysis li + li { margin-top: 4px; }

.rep-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.rep-table th, .rep-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.rep-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; }
.rep-table thead th.num, .rep-table td.num { text-align: right; }
.rep-table tbody th { text-align: left; font-weight: 600; }
.rep-table tbody tr:last-child th, .rep-table tbody tr:last-child td { border-bottom: none; }
.rep-table td.strong { font-weight: 700; }
.rep-table.compact { font-size: 12px; }
.rep-table.compact th, .rep-table.compact td { padding: 6px 6px; }


/* Subsidiary cards: two per row like the deck. */
.sub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sub-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; min-width: 0; }
.sub-card.empty { background: #fafbfc; }
.sub-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.sub-name { font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; }
.sub-legal { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sub-empty { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.sub-figs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.sub-figs span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.sub-figs strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.sub-figs em { display: block; font-style: normal; font-size: 12px; font-weight: 600; color: var(--ink); }
.sub-sub { font-size: 12px; font-weight: 600; color: var(--deck-red); margin: 10px 0 4px; }


/* Bar lists: logo + name | value | bar | share */
.bar-list { list-style: none; margin: 0; padding: 0; }
.bar-list li {
  display: grid; grid-template-columns: minmax(150px, 1.3fr) 80px minmax(80px, 3fr) 58px;
  align-items: center; gap: 12px; padding: 6px 0; font-size: 13px; font-variant-numeric: tabular-nums;
}
.bl-name { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.bl-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-value { text-align: right; color: var(--muted); }
.bl-track { height: 10px; }
.bl-bar { display: block; height: 100%; border-radius: 5px; background: var(--deck-red); }
.bl-bar.blue { background: var(--deck-blue); }
.bl-bar.green { background: var(--ok); }
.bl-bar.neg { background: #b4232c; }
.bl-share { text-align: right; font-weight: 700; }

.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.stat span { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.stat strong { display: block; font-size: 26px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rep-sub-title { font-weight: 700; font-size: 15px; margin: 4px 0 8px; }
.gap-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 14px; }
.gap-cell span { display: block; font-weight: 700; font-size: 15px; }
.gap-cell strong { display: block; font-size: 20px; margin-top: 4px; }
.gap-cell em { display: block; font-style: normal; font-size: 12px; font-weight: 600; margin-top: 2px; }

/* ---------- Analysis page backgrounds ----------
   body.co-theme (one company): a soft tint of the company colour, and its
   logo large and faded behind the content (#co-watermark). Panels turn
   very slightly see-through so the logo shows through gently.
   body.group-theme (All companies): plain white. Other pages: unchanged. */
body.group-theme { background: #f2f6fb; }
/* Page a little deeper, cards / tables / boxes a lighter wash of the same
   colour (still slightly see-through for the logo), so cards stand out. */
body.co-theme { background: color-mix(in srgb, var(--co) 13%, #ffffff); }
body.co-theme { --panel: color-mix(in srgb, var(--co) 6%, rgb(255 255 255 / 0.9)); }
body.co-theme .data-table thead th, body.co-theme .rep-table thead th { color: color-mix(in srgb, var(--co-text) 55%, #6b7280); }
body.co-theme .card, body.co-theme .rep-panel, body.co-theme .snap-card,
body.co-theme .q-card, body.co-theme .stat, body.co-theme .sub-card { border-color: color-mix(in srgb, var(--co) 22%, #e3e6ea); }
body.co-theme .app-header, body.co-theme .app-nav { background: rgba(255, 255, 255, 0.94); }
.app-body, .app-header { position: relative; z-index: 1; }
.co-watermark {
  position: fixed; z-index: 0; pointer-events: none;
  right: 3vw; bottom: 3vh; width: min(46vw, 620px); height: min(46vw, 620px);
  background: center / contain no-repeat;
  opacity: 0.06; mix-blend-mode: multiply; /* white logo backgrounds disappear */
}
@media (max-width: 760px) {
  .co-watermark { width: 80vw; height: 80vw; right: 10vw; bottom: 8vh; opacity: 0.05; }
}
@media (prefers-reduced-transparency: reduce) {
  body.co-theme { --panel: #ffffff; }
  .co-watermark { display: none; }
}

/* ---------- Company colours ----------
   --co (fill), --co-text (darkened so text and white-on-colour stay
   readable), --co-soft (tint) and --co-budget (budget bars) are set on
   .dash-theme for a single-company view, and on each subsidiary card /
   contribution bar in the group view. Without them the defaults apply.
   Green / red achievement colours never change. */
.rep-head h3 { border-left-color: var(--co, var(--deck-red)); }
.rep-hero h2 { color: var(--co-text, var(--ink)); }
.sub-sub { color: var(--co-text, var(--deck-red)); }
.sub-name { color: var(--co-text, var(--ink)); }
.sub-card[style*="--co:"] { border-top: 3px solid var(--co); }
.dash-theme[style*="--co:"] .snap-card { border-top: 3px solid var(--co); }
.bl-bar.co { background: var(--co, var(--deck-red)); }
.dash-theme .month-tab.active,
.dash-theme .company-tab.active { background: var(--co-text, var(--brand)); }
.dash-theme .month-tab.active:hover { background: var(--co-text, var(--brand-dark)); filter: brightness(0.92); }
.dash-theme .fy-select:focus-visible { outline: 2px solid var(--co, var(--brand)); }

/* ---------- Quarterly analysis ---------- */
.q-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.q-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px 16px 10px; min-width: 0; }
.dash-theme[style*="--co:"] .q-card { border-top: 3px solid var(--co); }
.q-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.q-name { font-size: 22px; font-weight: 700; color: var(--co-text, var(--ink)); line-height: 1; }
.q-range { font-size: 12px; color: var(--muted); margin-top: 4px; }
.q-range-inline { font-size: 12px; color: var(--muted); margin-left: 4px; }
.q-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.q-status.done { background: var(--bg); color: var(--muted); }
.q-status.live { background: #e6f4ea; color: var(--ok); }
.q-status.next { background: #fdf0e3; color: var(--warn); }
.q-headline { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 14px 0 6px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.q-headline span { font-size: 12px; color: var(--muted); }
.q-headline strong { font-size: 22px; }
.q-card .rep-table th, .q-card .rep-table td { padding: 6px 4px; }
.q-card .q-head + .rep-table { margin-top: 10px; }
.q-months tfoot th, .q-months tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: none; }
.q-months td.neg { color: var(--bad); }
.q-months td.muted { color: var(--muted); }
/* Earlier "Highest GP / NP" look: No. 1 large, then 2nd-5th as numbered rows. */
.q-leader { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--border); }
.q-head + .q-leader { margin-top: 10px; }
.q-leader-label { font-size: 13px; color: var(--muted); }
.q-leader-co { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 2px; }
.q-leader-co strong { font-size: 16px; color: var(--co-text, var(--ink)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-leader-value { display: block; font-size: 20px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.q-leader-value.neg { color: var(--bad); }
.q-leader .muted { color: var(--muted); font-size: 14px; }
.q-leader .q-rank { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--border); }
.q-rank { list-style: none; counter-reset: rank 1; margin: 6px 0 0; padding: 0; }
.q-rank li {
  counter-increment: rank; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center; gap: 8px; padding: 5px 0; font-size: 13px;
}
.q-rank li::before { content: counter(rank); font-weight: 700; color: var(--muted); text-align: center; }
.q-rank-co { display: flex; align-items: center; gap: 8px; min-width: 0; }
.q-rank-co > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--co-text, var(--ink)); }
.q-rank-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.q-rank-value.neg { color: var(--bad); }
.q-rank-empty { margin: 6px 0 8px; font-size: 13px; color: var(--muted); }


@media (max-width: 1100px) {
  .q-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sub-grid, .two-col { grid-template-columns: 1fr; }
  .snap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .snap-grid, .stat-row, .gap-row, .rep-split, .q-grid { grid-template-columns: 1fr; }
  .sub-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar-list li { grid-template-columns: minmax(110px, 1fr) 70px minmax(40px, 1fr) 52px; gap: 8px; }
  .rep-hero { align-items: flex-start; }
  .co-logo-lg { width: 60px; height: 60px; }
}

/* Contribution to VS Group (single-company view) */
.share-note { margin: -4px 0 12px; font-size: 13px; color: var(--muted); }
.share-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.share-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.share-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.share-value { font-size: 28px; font-weight: 700; margin: 6px 0 10px; font-variant-numeric: tabular-nums; color: var(--co-text, var(--ink)); }
.share-value.neg { color: var(--bad); }
.share-track { height: 10px; border-radius: 5px; background: var(--co-soft, #e8eef5); overflow: hidden; }
.share-bar { display: block; height: 100%; border-radius: 5px; background: var(--co, var(--brand)); }
.share-bar.neg { background: var(--bad); }
.share-of { margin-top: 8px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .share-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .share-grid { grid-template-columns: 1fr; } }

/* Top 5 by quarter: the GP set and the NP set as separate labelled blocks. */
.q-set { margin-top: 12px; padding: 10px 12px 12px; border-radius: 10px; border: 1px solid var(--border); }
.q-head + .q-set { margin-top: 12px; }
.q-set-gp { background: #f1f6fc; border-color: #c9dbef; }
.q-set-np { background: #f1f9f4; border-color: #c4e3cf; }
.q-set-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--ink); padding-bottom: 8px; border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
.q-set-tag { display: inline-block; min-width: 30px; padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-align: center; color: #fff; }
.q-set-gp .q-set-tag { background: #0b5fa5; }
.q-set-np .q-set-tag { background: #1d7a46; }
.q-leader-top { display: grid; gap: 2px; padding-top: 8px; }
.q-leader-rank { font-size: 12px; color: var(--muted); }
.q-leader-value small { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 2px; }
.q-rank-head { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(0, 0, 0, 0.12); font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.q-set .q-rank { margin-top: 4px; }
.q-set .muted { display: block; padding-top: 8px; color: var(--muted); font-size: 14px; }

/* ---------- Design refresh: app shell, cards, icons, motion ----------
   Same family as the landing page: deep navy (#072f55) frame, ocean blue
   (#0b5fa5) as the main colour, pale sky page. Written for easy reading:
   larger type, strong contrast, calm colour. Landing / sign-in untouched
   (the colour tokens below are scoped to .app-wrap). Green and red keep
   their meaning (achieved / missed). */
.app-wrap {
  --ink: #14233a; --muted: #566a80; --border: #d6e1ec; --bg: #e9f1f9;
  --navy: #072f55; --sky: #8fc3ee;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
}
body:not(.on-landing):not(.co-theme):not(.group-theme) { background: #f2f6fb; }

/* Header and sidebar: one navy frame. */
.app-wrap .app-header, body.co-theme .app-header {
  background: linear-gradient(90deg, #072f55, #0a3d6e); border-bottom: none; color: #fff;
  padding: 14px 28px; box-shadow: 0 2px 12px rgba(7, 47, 85, 0.28);
}
.app-header .brand { gap: 12px; }
.app-header .brand-mark { background: #fff; color: var(--navy); border-radius: 10px; font-size: 16px; padding: 9px 11px; }
.app-header .brand-name { color: #fff; font-size: 18px; }
.app-header .brand-sub { color: #a9cdee; font-size: 12.5px; }
.app-header #user-name { color: #fff; font-size: 14.5px; }
.app-header .role-pill { background: rgba(255, 255, 255, 0.16); color: #dcebf8; font-size: 12px; padding: 2px 10px; }
.app-header .btn-secondary {
  background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.4);
  font-size: 14px; padding: 8px 14px; transition: background 0.2s;
}
.app-header .btn-secondary:hover { background: rgba(255, 255, 255, 0.22); }
.app-header .btn-secondary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.app-wrap .app-nav, body.co-theme .app-nav {
  width: 236px; padding: 20px 10px;
  background: linear-gradient(180deg, #0a3d6e 0%, #072f55 55%, #061f3a 100%); border-right: none;
}
.nav-section-title {
  color: #8fb4d8; font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0.02em;
  margin-top: 14px; padding: 16px 14px 6px; border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 3px 0;
  font-size: 15.5px; color: #dcebf8; border-radius: 10px; border-right: none;
  transition: background 0.2s, color 0.2s;
}
.nav-link .ico { flex: none; color: #8fc3ee; transition: color 0.2s; }
.nav-link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-link.active { background: rgba(255, 255, 255, 0.17); color: #fff; font-weight: 600; box-shadow: inset 4px 0 0 var(--sky); }
.nav-link.active .ico { color: #fff; }

.view-content { padding: 28px 28px; font-size: 15px; }
.view-title { font-size: 26px; color: var(--navy); letter-spacing: -0.01em; }
.view-subtitle { font-size: 14.5px; }

/* Cards: rounder, with a soft blue-tinted shadow. */
.card, .rep-panel, .q-card, .sub-card, .stat, .snap-card, .share-card {
  border-radius: 14px; box-shadow: 0 1px 2px rgba(7, 47, 85, 0.06), 0 8px 22px rgba(7, 47, 85, 0.05);
}
.rep-table, .data-table { font-size: 14.5px; }
/* Tables inside narrow cards keep a smaller size so every column fits. */
.q-card .rep-table, .sub-card .rep-table { font-size: 12.5px; }
.q-card .rep-table th, .q-card .rep-table td { padding: 6px 3px; }
.rep-table.compact { font-size: 12.5px; }

/* Section headings with an icon badge. */
.rep-head { align-items: center; gap: 12px; margin-bottom: 14px; }
.rep-head h3 { border-left: none; padding-left: 0; font-size: 21px; color: var(--navy); }
.rep-head h3:first-child { border-left: 4px solid var(--co, var(--brand)); padding-left: 12px; }
.rep-head-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none;
  border-radius: 11px; background: var(--co-soft, #dcebf8); color: var(--co-text, var(--brand));
}
.rep-hero h2 { font-size: 28px; color: var(--co-text, var(--navy)); }
.rep-hero p { font-size: 14.5px; }
.quick-analysis strong, .sub-sub { color: var(--co-text, var(--brand)); }

/* Top figures: icon badge, big number, margin line. */
.snap-grid { gap: 18px; }
.snap-card {
  --kpi: #0b5fa5; padding: 18px 20px 16px; border-top: 4px solid var(--kpi);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.snap-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(7, 47, 85, 0.08), 0 14px 30px rgba(7, 47, 85, 0.10); }
.kpi-rev { --kpi: #0b5fa5; }
.kpi-gp  { --kpi: #0b857f; }
.kpi-exp { --kpi: #b5701a; }
.kpi-np  { --kpi: #4a45b0; }
.dash-theme[style*="--co:"] .snap-card { --kpi: var(--co-text, var(--co)); }
.snap-top { display: flex; align-items: center; gap: 12px; }
.snap-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; flex: none;
  border-radius: 50%; background: color-mix(in srgb, var(--kpi) 13%, #fff); color: var(--kpi);
}
.snap-ico .ico { width: 24px; height: 24px; }
.snap-label { font-size: 15.5px; color: var(--muted); }
.snap-value { font-size: 31px; margin: 14px 0 6px; letter-spacing: -0.01em; color: var(--ink); }
.snap-lines { font-size: 14px; }

/* Filters: a little larger and easier to hit. */
.month-tab { font-size: 14px; padding: 10px 4px; transition: background 0.15s; }
.company-strip { border-radius: 12px; }
.company-tab { font-size: 15px; padding: 14px 8px; transition: background 0.15s; }
.company-tab:hover, .month-tab:hover { background: #e3eef9; }
.fy-select { font-size: 15px; padding: 9px 12px; border-radius: 8px; }
.share-label { font-size: 15px; }
.share-of { font-size: 13.5px; }

/* Motion, kept to two moments: the top numbers count up (script) and the
   contribution bars grow in. Both off when the visitor prefers reduced motion. */
.bl-bar, .share-bar { transform-origin: left center; animation: bar-grow 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes bar-grow { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .bl-bar, .share-bar { animation: none; }
  .snap-card, .nav-link, .app-header .btn-secondary { transition: none; }
  .snap-card:hover { transform: none; }
}
@media (max-width: 860px) {
  .app-wrap .app-nav, body.co-theme .app-nav { width: 100%; padding: 10px 12px; }
  .view-content { padding: 20px 16px; }
  .snap-value { font-size: 27px; }
}

/* ---------- One common look for every company view ----------
   No per-company colours: a navy hero band (the landing page's company
   lines converging to one), colour-block figure cards, soft sky background. */
body.group-theme {
  background:
    radial-gradient(1100px 520px at 88% -8%, #d3e7fa 0%, rgba(211, 231, 250, 0) 62%),
    radial-gradient(900px 560px at -8% 38%, #dff1ee 0%, rgba(223, 241, 238, 0) 58%),
    #f2f6fb;
  background-attachment: fixed;
}
.dash-band {
  position: relative; margin-bottom: 24px; padding: 24px 26px 22px; border-radius: 22px; overflow: hidden;
  background:
    radial-gradient(620px 260px at 88% -10%, rgba(120, 190, 255, 0.30), rgba(120, 190, 255, 0) 70%),
    linear-gradient(118deg, #072f55 0%, #0a4a85 52%, #0d6dbb 100%);
  isolation: isolate;
  box-shadow: 0 18px 44px rgba(7, 47, 85, 0.28);
}
.dash-band .dash-top { margin-bottom: 18px; }
.dash-band .view-title { color: #fff; font-size: 30px; }
.dash-band .view-subtitle { color: #c3dcf4; margin-bottom: 0; font-size: 15px; }
.dash-band .btn-link { color: #fff; }
.dash-band .month-grid, .dash-band .fy-select { box-shadow: 0 6px 16px rgba(2, 18, 36, 0.28); border-color: transparent; }
.dash-band .company-strip { margin-bottom: 0; border-color: transparent; box-shadow: 0 8px 22px rgba(2, 18, 36, 0.3); }

/* Figure cards: solid colour blocks with a big faded icon. */
.snap-card {
  position: relative; overflow: hidden; border: none; color: #fff;
  box-shadow: 0 10px 26px rgba(7, 47, 85, 0.22);
}
.snap-card:hover { box-shadow: 0 16px 34px rgba(7, 47, 85, 0.30); }
.kpi-rev { background: linear-gradient(135deg, #0a4f8f 0%, #1a82d6 100%); }
.kpi-gp  { background: linear-gradient(135deg, #07645f 0%, #13a89e 100%); }
.kpi-exp { background: linear-gradient(135deg, #8d4f0a 0%, #cc8420 100%); }
.kpi-np  { background: linear-gradient(135deg, #2f2e8f 0%, #5a56d6 100%); }
.snap-card .snap-label { color: rgba(255, 255, 255, 0.92); }
.snap-card .snap-value { color: #fff; font-size: 33px; }
.snap-card .snap-lines { color: rgba(255, 255, 255, 0.88); }
.snap-card .snap-lines b { color: #fff; }
.snap-card .snap-lines b.neg { color: #ffd9dd; }
.snap-card .snap-ico { background: rgba(255, 255, 255, 0.2); color: #fff; }
.snap-bg { position: absolute; right: -14px; bottom: -18px; opacity: 0.14; pointer-events: none; }
.snap-bg .ico { width: 118px; height: 118px; stroke-width: 1.4; }

/* Headings, subsidiary cards and bars in the common blue. */
.rep-head-ico { background: #dcebf8; color: #0b5fa5; }
.rep-hero h2 { color: var(--navy); }
.sub-card { border-top: 4px solid #0b5fa5; }
.sub-card.empty { border-top-color: #b8c6d6; }
.bl-bar.co { background: linear-gradient(90deg, #0b5fa5, #4aa3e8); }
.share-bar { background: linear-gradient(90deg, #0b5fa5, #4aa3e8); }
.share-value { color: var(--navy); }

/* Chart lines draw themselves in; the points fade in after. */
.line-draw { stroke-dasharray: 1; animation: line-draw 1.3s cubic-bezier(0.3, 0.6, 0.2, 1) both; }
@keyframes line-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.dots-in, .area-in { animation: fade-in 0.7s 0.7s ease-out both; }
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .line-draw, .dots-in, .area-in { animation: none; }
}
@media (max-width: 760px) {
  .dash-band { padding: 18px 14px 16px; border-radius: 16px; }
  .dash-band .view-title { font-size: 25px; }
}

/* Company views: logo and name first, then the page name. */
.band-co { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.band-co .co-logo { box-shadow: 0 6px 18px rgba(2, 18, 36, 0.3); border: none; }
.band-co-text { min-width: 0; }
.band-co .view-title { margin: 0; line-height: 1.1; }
.band-legal { margin-top: 3px; font-size: 14px; color: #bcd8f3; }
.band-page {
  display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 15px; font-weight: 600;
}
.dash-band > * { position: relative; z-index: 1; }
@media (max-width: 760px) {
  .band-co { gap: 12px; }
  .band-co .co-logo-lg { width: 60px; height: 60px; }
}

/* Top band only: a company view takes that company's own colour (--band-c is
   its colour, darkened so white text reads). All companies keeps the navy. */
.dash-band.has-color {
  background:
    radial-gradient(620px 260px at 88% -10%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 70%),
    linear-gradient(118deg, color-mix(in srgb, var(--band-c) 52%, #000) 0%, var(--band-c) 55%, color-mix(in srgb, var(--band-c) 78%, #fff) 100%);
  box-shadow: 0 18px 44px color-mix(in srgb, var(--band-c) 45%, transparent);
}
.dash-band.has-color .view-subtitle, .dash-band.has-color .band-legal { color: rgba(255, 255, 255, 0.92); }
.dash-band.has-color .company-tab.active, .dash-band.has-color .month-tab.active { background: var(--band-c); }
.dash-band.has-color .company-tab.active:hover, .dash-band.has-color .month-tab.active:hover { background: var(--band-c); filter: brightness(0.92); }

/* Company name entrance: logo pop, letters rise in one by one, then the
   legal name and page label fade up. Only when .band-animate is present. */
.band-animate .view-title span {
  display: inline-block; white-space: pre; opacity: 0;
  animation: name-letter 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i) * 55ms + 180ms);
}
.band-animate .co-logo { animation: logo-pop 0.55s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.band-animate .band-legal, .band-animate .band-page {
  animation: name-fade 0.6s ease-out both; animation-delay: calc(var(--n) * 55ms + 300ms);
}
.band-animate .band-page { animation-delay: calc(var(--n) * 55ms + 450ms); }
@keyframes name-letter { from { opacity: 0; transform: translateY(0.55em) scale(0.9); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes logo-pop { from { opacity: 0; transform: scale(0.6) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes name-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .band-animate .view-title span, .band-animate .co-logo, .band-animate .band-legal, .band-animate .band-page { animation: none; opacity: 1; }
}

/* All companies: the subtitle under the animated page name fades in after it. */
.band-animate > .view-subtitle { animation: name-fade 0.6s ease-out both; animation-delay: calc(var(--n) * 55ms + 300ms); }
@media (prefers-reduced-motion: reduce) { .band-animate > .view-subtitle { animation: none; opacity: 1; } }

/* ---------- Activity ---------- */
.activity-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.activity-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.activity-head select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 13px; }
@media (max-width: 900px) { .activity-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Change password button when the 3-monthly change is near */
#my-password-btn.btn-due { border-color: #f5b041; color: #f5b041; font-weight: 600; }

/* Data links shown masked until "Show" */
.masked-link { color: var(--muted); word-break: break-all; }
.masked-field { display: inline-flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }

/* A shown link wraps instead of pushing its buttons out of view */
.flow-url.masked-row { white-space: normal; overflow: visible; text-overflow: clip; }
.masked-row .masked-link { overflow-wrap: anywhere; }
button.flow-link { background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }
button.badge-link { border: 0; cursor: pointer; font-family: inherit; line-height: inherit; }

/* Show / Hide on the sign-in password box */
.login-card .pw-field input { padding-right: 64px; }
.login-card .pw-field .pw-toggle { top: calc(50% + 2.5px); }
