/* =====================================================================
   PACE Training Portal — compiled stylesheet
   Refreshed design system (rer-detail-v2 mock):
     - Fonts: Inter (body + display), Roboto Mono (codes)
     - Brand ramp + ink scale + soft shadow scale + larger radii
     - Dark-navy sidebar, blurred translucent topbar
     - New chrome: hero card, action-card with tabs, .tbl, recon strip,
       .dl-row, .att list, sticky activity log, .badge state pills
   Existing class names (.btn, .field, .input, .card, .modal-backdrop, …)
   are preserved so every other module page renders without HTML changes.
   ===================================================================== */

/* ----------------------------- Tokens ----------------------------- */
/* PACE design system v3 — premium enterprise refresh.
   Brand anchored on PACE Blue #1E5AA8 and Deep Corporate Blue #134B8A.
   8px spacing system · radius 8/12/16/20 · soft layered shadows ·
   white sidebar · 72px glass topbar. All legacy aliases preserved so the
   36 module views render unchanged. */
:root {
  /* Brand ramp — PACE Blue #1D69A7 (600) · Deep Corporate Blue #175C95 (700),
     sampled from the revised PACE training-centers mock. */
  --brand-950: #0A3157;  /* deepest navy — sidebar gradient base */
  --brand-900: #0E4170;  /* hero / sidebar gradient top, auth base */
  --brand-800: #114E81;
  --brand-700: #175C95;  /* Deep Corporate Blue — hover, table header, H2 */
  --brand-600: #1D69A7;  /* PACE Blue — primary CTA, sidebar active, links */
  --brand-500: #2E84C9;  /* lighter brand — gradient top, focus ring */
  --brand-400: #5AA0DA;  /* dashed accents, row hover bar */
  --brand-200: #B6D6EE;  /* hover borders */
  --brand-100: #E4F0FA;  /* Light Blue — active nav, KPI tint, info pills */
  --brand-50:  #F1F7FC;  /* row hover, subtle surfaces */

  /* Ink scale — text #11233A / secondary #6C7E92 (cool navy neutrals) */
  --ink:   #11233A;
  --ink-2: #3C4F66;
  --ink-3: #6C7E92;
  --ink-4: #97A5B5;
  --ink-5: #C9D3DE;

  /* Surfaces & lines */
  --line:     #E6ECF3;   /* default border */
  --line-2:   #EFF3F8;   /* hairline separators */
  --surface:  #FFFFFF;   /* cards, modals */
  --canvas:   #F2F6FB;   /* app background */
  --canvas-2: #EAF0F7;   /* inset wells, ghost-button hover */

  /* Accent palette — used sparingly for category coding (never on primary CTAs) */
  --teal:    #00A3A3;
  --emerald: #12B76A;
  --purple:  #7F56D9;
  --orange:  #F79009;

  /* Semantics (Untitled-UI ramps) */
  --green-700:#027A48; --green-600:#12B76A; --green-100:#D1FADF; --green-50:#ECFDF3;
  --amber-700:#B54708; --amber-600:#F79009; --amber-100:#FEF0C7; --amber-50:#FFFAEB;
  --red-700:  #B42318; --red-600:  #F04438; --red-100:  #FEE4E2; --red-50: #FEF3F2;
  --slate-100:#F2F4F7; --slate-600:#475467;
  --purple-100:#EBE9FE; --purple-700:#5925DC;
  --orange-100:#FFEAD5; --orange-700:#B93815;

  /* Shadow scale — soft, layered, premium */
  --sh-1: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --sh-2: 0 4px 8px -2px rgba(16,24,40,.06), 0 12px 24px -10px rgba(16,24,40,.12);
  /* Card resting shadow (pace-requisition mock) — a crisp 1px contact shadow
     plus a long, soft ambient falloff. Used by .card and the wizard .sec. */
  --sh-card: 0 1px 3px rgba(20,40,70,.07), 0 8px 22px -14px rgba(20,40,70,.22);
  --sh-focus: 0 10px 30px -10px rgba(30,90,168,.30);

  /* Radius scale — 8 / 12 / 16 / 20 */
  --r-xl: 20px; --r-lg: 16px; --r-md: 12px; --r-sm: 8px;

  /* Tabular numerals helper for inline use */
  --tnum: "tnum" 1, "lnum" 1;

  /* Legacy aliases — keep the old token names working so other modules
     don't need any HTML changes. They point at the refreshed ramp. */
  --primary:        var(--brand-600);
  --primary-dark:   var(--brand-700);
  --primary-tint:   var(--brand-100);
  --accent:         var(--orange);
  --slate:          var(--ink-2);
  --surface-light:  var(--canvas);
  --surface-card:   var(--surface);
  --success:        var(--green-600);
  --warning:        var(--amber-600);
  --error:          var(--red-600);
  --info:           var(--brand-600);
  --text:           var(--ink);
  --muted:          var(--ink-3);
  --border:         var(--line);
  --border-strong:  var(--ink-5);

  --radius:    var(--r-md);
  --radius-sm: var(--r-sm);
  --radius-lg: var(--r-lg);
  --shadow-sm: var(--sh-1);
  --shadow-md: var(--sh-2);
  --shadow-lg: 0 16px 40px -12px rgba(16,24,40,.22);
  --transition: 200ms cubic-bezier(.4, 0, .2, 1);

  --sidebar-w: 264px;
  --topbar-h:  70px;

  /* Login-brand accents (additive) — mirror the redesigned sign-in screen so the
     authenticated app reads as the same product: bright #2477FF→#11B4FF CTA
     gradient, #2BB4FF focus, deep space-blue dark surfaces. Existing --brand-*
     tokens are untouched (tables/pills/badges keep their semantic colours). */
  --accent-1: #2477FF; --accent-2: #11B4FF;     /* primary CTA gradient */
  --accent-ico-1: #1769FF; --accent-ico-2: #00B4FF;
  --accent-soft: #5AD8FF;                        /* gradient-text / accent bar top */
  --focus:      #2BB4FF;
  --focus-ring: rgba(43,180,255,.22);
  --space-1: #071A3A;  /* deep login navy — dark hero/sidebar base */
  --space-2: #02040C;  /* near-black space base */
}

/* ----------------------------- Reset ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, 'SF Pro', 'Segoe UI', Roboto, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -.05px;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 70% -10%, #F2F7FC 0%, rgba(242,247,252,0) 60%),
    linear-gradient(180deg, #EDF2F8 0%, #E7EEF6 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { line-height: 1.2; margin: 0 0 .5em; color: var(--ink); font-weight: 600; letter-spacing: -.2px; }
h1 { font-size: 30px; } h2 { font-size: 24px; } h3 { font-size: 18px; } h4 { font-size: 15.5px; }
p { margin: 0 0 1em; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .caption { font-size: 12px; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mono  { font-family: 'Roboto Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-feature-settings: var(--tnum); }
.serif { font-family: 'Inter', sans-serif; }
.num   { font-variant-numeric: tabular-nums; }

/* Visible focus ring everywhere (§13 Accessibility). */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ----------------------------- Buttons ---------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  font: inherit; font-weight: 600; font-size: 13px;
  padding: 9px 14px; border-radius: var(--r-md); border: 1px solid var(--line);
  cursor: pointer; transition: var(--transition); white-space: nowrap; text-decoration: none;
  background: #fff; color: var(--ink-2);
}
.btn:hover { border-color: var(--brand-200); color: var(--brand-700); background: var(--brand-50); }
.btn:disabled, .btn.is-loading { opacity: .55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
/* Primary CTA (pace-requisition mock): vertical brand gradient with an inset
   top highlight; hovering lifts 1px; disabled keeps the shape but fades to a
   light-blue tint instead of an opacity wash so the rail reads intentional. */
.btn-primary { background: linear-gradient(100deg, var(--accent-1), var(--accent-2)); color: #fff; border: 0; box-shadow: 0 12px 26px -12px rgba(36,119,255,.72), inset 0 1px 0 rgba(255,255,255,.28); }
.btn-primary:hover { color: #fff; background: linear-gradient(100deg, var(--accent-1), var(--accent-2)); border: 0; }
.btn-primary:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 16px 32px -12px rgba(36,119,255,.78), inset 0 1px 0 rgba(255,255,255,.28); }
.btn-primary:not(:disabled):active { transform: translateY(0); }
.btn-primary:disabled { background: linear-gradient(100deg, #9FC2DF, #86B0D2); box-shadow: none; opacity: .9; }
/* Secondary (the "Save draft" pattern): a real bordered white button that
   outlines in brand on hover rather than washing grey. */
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--ink-5); box-shadow: var(--sh-1); }
.btn-secondary:hover { background: #fff; color: var(--brand-700); border-color: var(--brand-600); }
.btn-ghost { background: none; border: 0; box-shadow: none; color: var(--ink-3); padding: 9px 12px; }
.btn-ghost:hover { background: var(--canvas-2); color: var(--ink); }
.btn-destructive { background: var(--red-600); color: #fff; border: 0; }
.btn-destructive:hover { filter: brightness(.95); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-lg { padding: 12px 18px; font-size: 14.5px; border-radius: var(--r-md); }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); color: #fff; border: 0; }

/* ----------------------------- Forms ------------------------------ */
.field { margin-bottom: 16px; }
.field label, .label, .field-label {
  display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 8px; color: var(--ink-2);
}
.field .help, .hint { font-size: 11.5px; color: var(--ink-4); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
/* Inline icons in hints carry a viewBox but no width/height — constrain them so
   they don't balloon to the flex container's height. */
.field .help svg, .hint svg { width: 14px; height: 14px; flex-shrink: 0; }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: 13.5px; color: var(--ink);
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: #fff; transition: var(--transition); outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.input[aria-invalid="true"], .input.is-error,
.select[aria-invalid="true"], .select.is-error,
.textarea[aria-invalid="true"], .textarea.is-error { border-color: var(--red-600); }
.input.is-error:focus, .select.is-error:focus, .textarea.is-error:focus,
.input[aria-invalid="true"]:focus, .select[aria-invalid="true"]:focus, .textarea[aria-invalid="true"]:focus {
  border-color: var(--red-600); box-shadow: 0 0 0 3px rgba(212, 74, 58, .15);
}
.field-error { color: var(--red-600); font-size: 12px; margin-top: 4px; }
.req { color: var(--red-600); font-weight: 700; margin-left: 2px; }
td > .field-error { margin-top: 6px; line-height: 1.3; }
.input-group { display: flex; gap: 8px; flex-wrap: wrap; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.checkbox input { accent-color: var(--accent-ico-1); width: 16px; height: 16px; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; margin: 0 0 16px; }
legend { font-weight: 600; padding: 0 6px; color: var(--brand-700); }

/* Segmented Yes/No control */
.seg { display: inline-flex; background: var(--canvas-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 3px; }
.seg label { position: relative; cursor: pointer; margin: 0; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 8px 22px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); transition: var(--transition); }
.seg input:checked + span { background: #fff; color: var(--brand-700); box-shadow: var(--sh-1); }
.seg label:hover span { color: var(--ink); }

.form-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-top: 14px; }
.form-row .fg { flex: 1; min-width: 170px; }

/* ----------------------------- Cards ------------------------------ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--sh-card);
  margin-bottom: 18px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--line-2);
}
.card-head h3, .card-head h4 { margin: 0; }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.card-eyebrow { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-4); font-weight: 600; }
.card-title { font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 600; letter-spacing: -.1px; color: var(--ink); }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; }
/* In-card sub-section divider (used to club related blocks into one card). */
.card-sub { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--canvas-2); }
.card-sub .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.card-subtitle { font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600; letter-spacing: -.1px; color: var(--ink); }
.collapse-btn { margin-left: auto; color: var(--ink-4); cursor: pointer; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; transition: var(--transition); }
.collapse-btn:hover { background: var(--canvas-2); color: var(--ink); }
.collapse-btn svg { transition: .2s; width: 16px; height: 16px; }
.card.collapsed .collapse-btn svg { transform: rotate(-90deg); }
.card.collapsed .card-body,
.card.collapsed .card-foot,
.card.collapsed table { display: none; }

/* ----------------------------- KPI cards -------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  /* Explicit row + column gap, in case a parent stylesheet sets `gap: 0`. */
  row-gap: 20px;
  column-gap: 20px;
  margin-bottom: 8px;
}
.kpi {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--sh-1);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--brand-200); }
.kpi .kpi-ico { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-100); color: var(--brand-700); }
.kpi .kpi-ico svg { width: 20px; height: 20px; }
.kpi .kpi-label { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 1.2px; font-weight: 600; padding-right: 48px; }
.kpi .kpi-value { font-family: 'Inter', sans-serif; font-size: 36px; font-weight: 700; color: var(--ink); margin: 8px 0 2px; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; max-width: 100%; overflow: hidden; }
.kpi .kpi-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; }
.kpi .kpi-delta.up { color: var(--green-600); }
.kpi .kpi-delta.down { color: var(--red-600); }
.kpi.kpi-accent { background: linear-gradient(155deg, var(--brand-800), var(--accent-1)); border-color: transparent; box-shadow: var(--sh-2); }
.kpi.kpi-accent .kpi-label { color: rgba(255,255,255,.82); }
.kpi.kpi-accent .kpi-value { color: #fff; }
.kpi.kpi-accent .kpi-ico { background: rgba(255,255,255,.18); color: #fff; }
.kpi.kpi-accent .kpi-delta.up { color: #b9f5d4; }
.kpi.kpi-accent .kpi-delta.down { color: #ffc9c4; }
/* Soft semantic tints — opt-in per card via the kpi_card `variant` param.
   Each recolours the card surface, border, icon chip and value. */
.kpi-tint { box-shadow: var(--sh-1); }
.kpi-tint.kpi-success { background: var(--green-50);  border-color: var(--green-100); }
.kpi-tint.kpi-success .kpi-ico { background: var(--green-100); color: var(--green-700); }
.kpi-tint.kpi-success .kpi-value { color: var(--green-700); }
.kpi-tint.kpi-warning { background: var(--amber-50);  border-color: var(--amber-100); }
.kpi-tint.kpi-warning .kpi-ico { background: var(--amber-100); color: var(--amber-700); }
.kpi-tint.kpi-warning .kpi-value { color: var(--amber-700); }
.kpi-tint.kpi-danger  { background: var(--red-50);    border-color: var(--red-100); }
.kpi-tint.kpi-danger .kpi-ico { background: var(--red-100); color: var(--red-700); }
.kpi-tint.kpi-danger .kpi-value { color: var(--red-700); }
.kpi-tint.kpi-info    { background: var(--brand-50);  border-color: var(--brand-100); }
.kpi-tint.kpi-info .kpi-ico { background: var(--brand-100); color: var(--brand-700); }
.kpi-tint.kpi-info .kpi-value { color: var(--brand-700); }
.kpi-tint.kpi-neutral { background: var(--slate-100); border-color: var(--line); }
.kpi-tint.kpi-neutral .kpi-ico { background: #fff; color: var(--slate-600); }
.kpi-tint.kpi-neutral .kpi-value { color: var(--slate-600); }
.kpi-skeleton { height: 92px; border-radius: var(--r-md); background: linear-gradient(90deg, var(--canvas-2) 25%, var(--canvas) 37%, var(--canvas-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ============================ Dashboard ======================== */
.dash-hero {
  position: relative; overflow: hidden; color: #fff;
  border-radius: var(--r-xl); padding: 28px 30px; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  box-shadow: var(--sh-2);
  background:
    radial-gradient(820px 320px at 86% -50%, rgba(36,119,255,.34), transparent 60%),
    radial-gradient(720px 380px at 112% 140%, rgba(17,180,255,.28), transparent 55%),
    linear-gradient(150deg, var(--space-1) 0%, var(--brand-900) 55%, var(--brand-800) 100%);
}
.dash-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(130% 150% at 92% 0%, #000 28%, transparent 75%);
          mask-image: radial-gradient(130% 150% at 92% 0%, #000 28%, transparent 75%);
}
.dash-hero .hero-tile { position: absolute; border-radius: 14px; pointer-events: none; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); animation: floaty 15s ease-in-out infinite; }
.dash-hero .hero-tile.a { width: 92px; height: 92px; right: 6%;  top: -26px; }
.dash-hero .hero-tile.b { width: 56px; height: 56px; right: 19%; bottom: -22px; animation-delay: -4s; background: rgba(36,119,255,.18); border-color: rgba(43,180,255,.36); }
.dash-hero .hero-tile.c { width: 40px; height: 40px; right: 31%; top: 28%;  animation-delay: -8s; }
.dash-hero .hero-main { position: relative; z-index: 1; }
.dash-hero .hero-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: #cfe0ef; margin-bottom: 8px; }
.dash-hero .hero-eyebrow svg { width: 15px; height: 15px; }
.dash-hero h1 { color: #fff; font-family: 'Inter', sans-serif; font-size: 30px; letter-spacing: -.3px; margin: 0 0 4px; }
/* Gradient-text flourish on the greeting name — echoes the login's
   "Elevate projects." headline. */
.dash-hero .hero-accent { background: linear-gradient(100deg, var(--accent-soft), var(--focus)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.dash-hero .sub { color: #d4e4f2; margin: 0; font-size: 14px; }
.dash-hero .hero-meta { position: relative; z-index: 1; }
.dash-hero .hero-date { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); color: #fff; font-size: 13px; font-weight: 600; }
.dash-hero .hero-date svg { width: 16px; height: 16px; }

.dash-panel { border-radius: var(--r-lg); }
.dash-panel .card-head h3 { display: flex; align-items: center; gap: 10px; font-size: 15.5px; }
.dash-panel .card-head .head-ico { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-100); color: var(--brand-700); }
.dash-panel .card-head .head-ico svg { width: 17px; height: 17px; }

.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.quick-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-weight: 600; transition: var(--transition); }
.quick-link:hover { border-color: var(--focus); background: var(--brand-50); color: var(--brand-700); text-decoration: none; transform: translateY(-2px); box-shadow: var(--sh-1); }
.quick-link .arr { color: var(--ink-4); display: grid; place-items: center; transition: var(--transition); }
.quick-link .arr svg { width: 18px; height: 18px; }
.quick-link:hover .arr { color: var(--brand-600); transform: translateX(3px); }

.dash-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; text-align: center; color: var(--ink-3); }
.dash-empty svg { width: 30px; height: 30px; color: var(--ink-5); }
.dash-empty p { margin: 0; }

/* ----------------------------- Tables (legacy data tables) -------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--sh-1); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--brand-100); color: var(--brand-700); text-align: left;
  padding: 14px 18px; font-weight: 700; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap;
  border-bottom: 1px solid #CFE2F2;
}
table.data tbody td { padding: 15px 18px; border-top: 1px solid var(--line-2); vertical-align: middle; color: var(--ink-2); }
table.data tbody tr { transition: background var(--transition); }
table.data tbody tr:hover { background: var(--brand-50); }
table.data tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--brand-600); }
table.data.dense tbody td, table.data.dense thead th { padding: 9px 12px; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-empty { padding: 48px 24px; text-align: center; color: var(--ink-3); }

/* ---- User / entity cell with avatar (listing hierarchy) ---- */
.cell-user { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-avatar { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; letter-spacing: .3px; background: linear-gradient(145deg, var(--brand-500), var(--brand-800)); box-shadow: var(--sh-1), inset 0 1px 0 rgba(255,255,255,.25); }
.cell-user-name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-user-sub { font-size: 11.5px; color: var(--ink-4); font-weight: 500; margin-top: 1px; }

/* ---- Vibrant-but-soft chip palette (role / category coding) ---- */
.chip-c1 { background: var(--brand-100); color: var(--brand-700); border-color: #CFE1F6; }
.chip-c2 { background: #EBE9FE; color: #5925DC; border-color: #D9D4FB; }
.chip-c3 { background: #CFF7F1; color: #0E7C72; border-color: #AEEFE5; }
.chip-c4 { background: var(--green-100); color: var(--green-700); border-color: #BDF0D2; }
.chip-c5 { background: var(--amber-100); color: var(--amber-700); border-color: #F7E0A8; }
.chip-c6 { background: #FCE7F6; color: #C11574; border-color: #F7CFE9; }
.chip-strong { font-weight: 600; }

/* ---- Region pill — coloured dot + label (revised mock) ---- */
.region { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; color: var(--ink-2); background: var(--canvas); border: 1px solid var(--line); padding: 4px 11px; border-radius: 20px; white-space: nowrap; }
.region .rdot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-500); flex: none; }
.region.south .rdot   { background: #1FA07A; }
.region.north .rdot   { background: #E08A2B; }
.region.east  .rdot   { background: #D2607A; }
.region.west  .rdot   { background: #2E84C9; }
.region.central .rdot { background: #C0852F; }
.region.ho    .rdot   { background: #8A6FE0; }

/* ---- Region-coded avatar gradients (apply to .cell-avatar) ---- */
.cell-avatar.south   { background: linear-gradient(145deg,#27B58A,#0E6B50); }
.cell-avatar.north   { background: linear-gradient(145deg,#EE9B3A,#B5641A); }
.cell-avatar.west    { background: linear-gradient(145deg,#3B92D6,#114E81); }
.cell-avatar.east    { background: linear-gradient(145deg,#E0728C,#A23B57); }
.cell-avatar.central { background: linear-gradient(145deg,#D49A3C,#9A6A1E); }
.cell-avatar.ho      { background: linear-gradient(145deg,#9A80EC,#5A45B0); }
.cell-code { display: block; font-family: 'Roboto Mono', monospace; font-weight: 600; font-size: 11px; color: var(--brand-600); letter-spacing: .3px; margin-top: 2px; }

/* ---- "View"/"Edit" row action chip (revised mock) ---- */
.view-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 10px; background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-700); font-weight: 700; font-size: 12.5px; text-decoration: none; white-space: nowrap; transition: var(--transition); }
.view-link svg { width: 14px; height: 14px; transition: transform var(--transition); }
.view-link:hover { background: linear-gradient(160deg, var(--brand-500), var(--brand-800)); border-color: var(--brand-700); color: #fff; box-shadow: 0 8px 18px -7px rgba(23,92,149,.6); transform: translateY(-1px); text-decoration: none; }
.view-link:hover svg { transform: translateX(3px); }

/* ---- Table footer record-count pill (revised mock) ---- */
.table-foot { display: flex; justify-content: flex-end; padding: 14px 18px; background: var(--brand-50); border-top: 1px solid var(--line); }
.records { font-size: 12px; font-weight: 700; color: var(--brand-700); background: #fff; border: 1px solid var(--brand-100); padding: 7px 14px; border-radius: 20px; letter-spacing: .2px; }

/* ----------------------------- New design-mock tables (.tbl) ----- */
/* Wrap .tbl in <div class="tbl-scroll"> when it sits inside a card with
   rounded clipped corners, so narrow viewports can scroll horizontally. */
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl-scroll::-webkit-scrollbar { height: 6px; }
.tbl-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th { background: var(--canvas); font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-3); font-weight: 600; text-align: left; padding: 11px 20px; }
.tbl thead th:last-child { text-align: right; }
.tbl thead th.num { text-align: right; }   /* align amount headers over their right-aligned values */
.tbl tbody td { padding: 14px 20px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--brand-50); }
.tbl .cell-main { font-weight: 600; }
.tbl .cell-sub { font-size: 11px; color: var(--ink-4); margin-top: 3px; font-family: 'Roboto Mono', monospace; }
.tbl .amt, .amt { font-family: 'Roboto Mono', monospace; font-weight: 500; text-align: right; white-space: nowrap; font-feature-settings: var(--tnum); }
.tbl tfoot td { padding: 14px 20px; font-weight: 700; background: var(--brand-50); border-top: 1.5px solid var(--brand-200); }
.tbl tfoot .amt { color: var(--brand-800); font-size: 15px; font-weight: 600; }
.tag { display: inline-flex; align-items: center; font-family: 'Roboto Mono', monospace; font-size: 11px; font-weight: 500; background: var(--canvas); border: 1px solid var(--line); color: var(--ink-2); padding: 3px 8px; border-radius: 6px; }

/* Reconciliation strip */
.recon { display: flex; align-items: center; gap: 12px; padding: 13px 20px; background: var(--green-50); border-top: 1px solid var(--green-100); font-size: 12.5px; color: var(--green-700); font-weight: 600; }
.recon.warn { background: var(--amber-50); border-top-color: var(--amber-100); color: var(--amber-700); }
.recon svg { width: 18px; height: 18px; flex-shrink: 0; }
.recon .chain { margin-left: auto; display: flex; align-items: center; gap: 7px; font-family: 'Roboto Mono', monospace; font-size: 11.5px; font-weight: 500; }
.recon .eq { color: var(--green-600); }
.recon.warn .eq { color: var(--amber-600); }

/* Settlements (RER closure Step 3) — advance + tax-invoice lines */
.settle-modebar { display: flex; align-items: center; gap: 16px; margin: 0 0 14px; flex-wrap: wrap; }
.settle-modebar-end { margin-left: auto; }
.settle-mode { display: flex; align-items: center; gap: 10px; }
.settle-mode-label { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.settle-tbl td, .settle-tbl th { vertical-align: middle; }
.settle-tbl .settle-actions { white-space: nowrap; }
.settle-section { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px; }
/* Two rows: PO amount spans the left; advances on row 1, invoices on row 2. */
.settle-balance { display: grid; grid-template-columns: auto 1fr 1fr; gap: 12px 28px; align-items: center; margin-top: 16px; padding: 14px 18px; background: var(--canvas-2); border: 1px solid var(--line); border-radius: 10px; }
.settle-balance .sb-cell { display: flex; flex-direction: column; gap: 3px; }
.settle-balance .sb-po { grid-row: 1 / span 2; align-self: center; padding-right: 22px; border-right: 1px solid var(--line); }
@media (max-width: 640px) {
    .settle-balance { grid-template-columns: 1fr 1fr; }
    .settle-balance .sb-po { grid-row: auto; grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 10px; }
}
.settle-balance .sb-k { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; }
.settle-balance .sb-v { font-size: 15px; font-weight: 700; font-family: 'Roboto Mono', monospace; color: var(--ink); }
.settle-balance .sb-bal .sb-v { font-size: 17px; }
.settle-warn { display: flex; align-items: center; gap: 9px; margin-top: 10px; padding: 10px 14px; background: var(--amber-50); border: 1px solid var(--amber-100); border-radius: 9px; color: var(--amber-700); font-size: 12.5px; font-weight: 600; }
.settle-warn svg { width: 17px; height: 17px; flex-shrink: 0; }
/* A class-level display rule beats [hidden]'s UA display:none, so restore it. */
.settle-warn[hidden], .hint[hidden] { display: none; }

/* Definition list — legacy two-column (.dl) still used by other modules */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 14px; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; font-weight: 500; }
/* New mock-style .dl-row for hero details + verified blocks */
.dl-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.dl-row:last-child, .dl-row.nb { border-bottom: 0; }
.dl-key { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.dl-val { font-size: 13.5px; font-weight: 600; text-align: right; }
.dl-val.muted { color: var(--ink-4); font-weight: 500; }
.dl2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
@media (max-width: 540px) { .dl2 { grid-template-columns: 1fr; } }
.amt-strong { font-family: 'Roboto Mono', monospace; font-weight: 600; font-feature-settings: var(--tnum); }
.verified { background: var(--green-50); border: 1px solid var(--green-100); border-radius: var(--r-md); padding: 4px 16px; }
.verified .dl-row { border-color: rgba(15,157,106,.12); }

/* ----------------------------- Status pills (10 variants) --------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.6; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-success { background: var(--green-100); color: var(--green-700); }
.pill-warning { background: var(--amber-100); color: var(--amber-700); }
.pill-error   { background: var(--red-100);   color: var(--red-700); }
.pill-info    { background: var(--brand-100); color: var(--brand-700); }
.pill-neutral { background: var(--slate-100); color: var(--slate-600); }
.pill-primary { background: var(--brand-100); color: var(--brand-700); }
.pill-draft   { background: var(--slate-100); color: var(--slate-600); }
.pill-pending { background: var(--amber-100); color: var(--amber-700); }
.pill-active  { background: var(--green-100); color: var(--green-700); }
.pill-closed  { background: #ECECFD; color: #5925DC; }
.pill-rework  { background: var(--orange-100); color: var(--orange-700); }
.pill-po      { background: var(--green-100);  color: var(--green-700); }

/* Status badges (mock) */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; letter-spacing: .1px; }
.badge .bd { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-blue  { background: var(--brand-100); color: var(--brand-700); }
.b-green { background: var(--green-100); color: var(--green-700); }
.b-amber { background: var(--amber-100); color: var(--amber-700); }
.b-red   { background: var(--red-100);   color: var(--red-700); }
.b-slate { background: var(--slate-100); color: var(--slate-600); }
.b-purple{ background: var(--purple-100); color: var(--purple-700); }
.b-orange{ background: var(--orange-100); color: var(--orange-700); }

/* ----------------------------- Chips ------------------------------ */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--canvas); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.chip .x { cursor: pointer; color: var(--ink-3); }

/* ----------------------------- Toast / banner --------------------- */
.flash-stack { position: fixed; top: 16px; right: 16px; z-index: 1200; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); box-shadow: var(--sh-2); background: #fff; border-left: 4px solid var(--brand-500); animation: toastin 200ms ease; }
.toast.success { border-color: var(--green-600); }
.toast.warning { border-color: var(--amber-600); }
.toast.error   { border-color: var(--red-600); }
.toast.info    { border-color: var(--brand-500); }
.toast .toast-close { margin-left: auto; cursor: pointer; color: var(--ink-3); background: none; border: none; font-size: 16px; }
@keyframes toastin { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.banner { padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 16px; border: 1px solid var(--line); font-size: 13px; }
.banner.info    { background: var(--brand-50);  border-color: var(--brand-200); color: var(--brand-700); }
.banner.warning { background: var(--amber-50);  border-color: var(--amber-100); color: var(--amber-700); }
.banner.error   { background: #FEF3F2;          border-color: var(--red-100);   color: var(--red-700); }
.banner.success { background: var(--green-50);  border-color: var(--green-100); color: var(--green-700); }

/* ----------------------------- Drawer / slide-over ---------------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(16,32,47,.45); z-index: 1100; display: none; }
.drawer-backdrop.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 92vw); background: #fff; box-shadow: var(--shadow-lg); z-index: 1101; transform: translateX(100%); transition: transform 220ms ease; display: flex; flex-direction: column; }
.drawer.w50 { width: min(50vw, 720px); } .drawer.w80 { width: 80vw; }
.drawer.open { transform: none; }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.drawer-body { padding: 20px; overflow: auto; flex: 1; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* ----------------------------- Modal ------------------------------ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16,32,47,.45); z-index: 1100; display: none; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: min(520px, 92vw); overflow: hidden; }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--line-2); font-weight: 600; font-family: 'Inter', sans-serif; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; }

/* ----------------------------- Tabs ------------------------------- */
.tabs {
  display: flex; gap: 2px; padding: 0 14px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 13px 14px; cursor: pointer; border: 0; background: none;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-3);
  position: relative; white-space: nowrap; flex: 0 0 auto; transition: var(--transition);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand-700); border-bottom-color: var(--brand-600); }
.tab-num { width: 23px; height: 23px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: 11.5px; flex-shrink: 0; transition: var(--transition); }
.tab.done .tab-num { background: var(--green-100); color: var(--green-700); }
.tab.pending .tab-num { background: var(--amber-100); color: var(--amber-700); }
.tab.active.pending .tab-num { background: var(--amber-600); color: #fff; }
.tab.active.done .tab-num { background: var(--green-600); color: #fff; }
.tab.done .tab-num::after { content: "✓"; font-size: 11px; }
.tab.done .tab-num span { display: none; }
.tab-pane { display: none; animation: fade .28s ease; }
.tab-pane.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ----------------------------- Pagination ------------------------- */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 16px; }
.pagination a, .pagination span { padding: 6px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; color: var(--ink-2); background: #fff; }
.pagination .current { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.pagination .disabled { opacity: .5; pointer-events: none; }

/* ============================ Layout: shell ====================== */
.app { display: flex; min-height: 100vh; }

/* ---- Sidebar (dark navy gradient — revised mock) ---- */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(36,119,255,.32), transparent 60%),
    linear-gradient(190deg, var(--space-1) 0%, #04122B 100%);
  color: #C5D8E9;
  /* The global body sets line-height:1.5; the mock's sidebar inherits the
     browser default (~1.2). Without this, each nav-item's text line-box
     (13.5×1.5≈20px) exceeds the 17px icon and items render ~38px instead of
     ~35px, so the whole menu drifts down progressively. */
  line-height: 1.2;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  border-right: 0;
  box-shadow: 4px 0 28px -18px rgba(10,49,87,.7);
  overflow: hidden;
}
.sidebar > * { position: relative; z-index: 1; }
.sidebar nav { overflow-y: auto; }
/* faint square-grid texture echoing the block logo */
.sidebar::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%);
          mask-image: linear-gradient(180deg, #000, transparent 70%);
}
.sidebar .brand { display: flex; align-items: center; gap: 13px; padding: 22px 22px 20px; }
/* Full PACE lockup (mark + academy text) on a white plate so the blue artwork
   reads on the dark rail. */
.sidebar .brand-full { padding: 20px 18px 18px; }
.sidebar .brand-full .brand-plate { width: 100px; margin: 0 auto; padding: 8px 8px; border-radius: 14px; box-shadow: 0 6px 16px rgba(0,0,0,.28); }
.sidebar .brand-full .brand-plate img { width: 100%; max-width: 176px; height: auto; margin: 0 auto; }
.sidebar .brand-name { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 20px; line-height: 1; color: #fff; letter-spacing: .5px; }
.sidebar .brand-sub { font-size: 9.5px; color: #9FC4E2; letter-spacing: 2.4px; text-transform: uppercase; margin-top: 5px; font-weight: 600; }
.sidebar nav { flex: 1; padding: 6px 14px 24px; }
.sidebar nav::-webkit-scrollbar { width: 6px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 6px; }
.nav-group { padding: 0; margin-top: 18px; }
.nav-group:first-child { margin-top: 4px; }
.nav-label { font-size: 10px; letter-spacing: 1.6px; color: #6E97BC; text-transform: uppercase; padding: 0 12px 9px; font-weight: 700; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: var(--transition); }
.nav-item .ico { width: 17px; height: 17px; display: inline-grid; place-items: center; color: var(--ink-4); flex-shrink: 0; font-size: 14px; transition: var(--transition); }
.nav-item svg { width: 17px; height: 17px; color: var(--ink-4); flex-shrink: 0; }
/* Sidebar (dark) nav items */
.sidebar .nav-item { color: #C5D8E9; }
.sidebar .nav-item:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; transform: translateX(2px); }
.sidebar .nav-item.active { background: linear-gradient(90deg, rgba(36,119,255,.44), rgba(17,180,255,.10)); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(90,216,255,.22); }
.sidebar .nav-item.active::before { content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, var(--accent-soft), var(--accent-2)); }
.sidebar .nav-item .ico { color: #8FB3D4; }
.sidebar .nav-item:hover .ico, .sidebar .nav-item.active .ico { color: #fff; }
.sidebar .nav-item svg { color: inherit; opacity: .85; }
.sidebar .nav-item:hover svg, .sidebar .nav-item.active svg { color: inherit; opacity: 1; }
/* Light nav items reused elsewhere (e.g. the topbar profile dropdown) */
.profile-menu .nav-item:hover { background: var(--brand-50); color: var(--brand-700); transform: none; }
.sidebar-foot { margin-top: auto; padding: 16px 26px; font-size: 11px; color: #6E97BC; font-weight: 500; letter-spacing: .3px; border-top: 1px solid rgba(255,255,255,.08); }

/* ---- Main column ---- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.80); backdrop-filter: saturate(140%) blur(16px); -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(16,24,40,.02), 0 6px 20px -16px rgba(16,24,40,.30);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px; position: sticky; top: 0; z-index: 40;
}
.topbar .crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.topbar .crumbs a { color: inherit; }
.topbar .crumbs a:hover { color: var(--brand-700); text-decoration: none; }
.topbar .crumbs .sep { color: var(--ink-5); }
.topbar .crumbs .now { color: var(--ink); font-weight: 600; }
.topbar .search { margin-left: 6px; flex: 0 1 280px; display: flex; align-items: center; gap: 9px; background: var(--canvas-2); border: 1px solid transparent; border-radius: 10px; padding: 8px 12px; color: var(--ink-4); font-size: 13px; transition: var(--transition); }
.topbar .search:focus-within { background: #fff; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.topbar .search input { border: 0; background: none; outline: none; flex: 1; font-family: inherit; font-size: 13px; color: var(--ink); }
.topbar .search svg { width: 15px; height: 15px; flex-shrink: 0; }
.kbd { font-size: 10px; background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; color: var(--ink-4); font-family: 'Roboto Mono', monospace; }
.topbar .top-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.fy-switch { display: inline-flex; align-items: center; gap: 7px; background: var(--canvas-2, var(--canvas)); border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px; cursor: pointer; }
.fy-switch:hover { border-color: var(--brand-200); }
.fy-switch-cap { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-3); }
.fy-switch-sel { border: 0; background: none; outline: none; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; padding-right: 2px; }
.topbar .bell { position: relative; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.topbar .bell svg { width: 19px; height: 19px; }
.topbar .bell .dot { position: absolute; top: -1px; right: -1px; width: 7px; height: 7px; background: var(--red-600); border-radius: 50%; border: 2px solid #fff; }
.topbar .bell .bell-badge { position: absolute; top: -6px; right: -7px; min-width: 16px; height: 16px; padding: 0 4px; background: var(--red-600); color: #fff; border: 2px solid #fff; border-radius: 9px; font-size: 10px; font-weight: 800; line-height: 14px; text-align: center; }
.topbar .bell .bell-badge[hidden] { display: none; }

/* Notification drawer feed */
.notif-empty { padding: 40px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }
.notif-item { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background .12s; }
.notif-item:hover { background: var(--canvas); }
.notif-item .notif-dot { width: 8px; height: 8px; flex: none; margin-top: 5px; border-radius: 50%; background: transparent; }
.notif-item.unread { background: var(--brand-50); }
.notif-item.unread .notif-dot { background: var(--brand-600); }
.notif-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.notif-body-text { font-size: 12.5px; color: var(--ink-2, var(--ink)); }
.notif-time { font-size: 11px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.topbar .user { display: flex; align-items: center; gap: 10px; cursor: pointer; padding-left: 18px; border-left: 1px solid var(--line); }
.topbar .avatar { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--accent-1), var(--brand-900)); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.topbar .user-name { font-size: 13px; font-weight: 600; line-height: 1.15; }
.topbar .user-role { font-size: 10px; color: var(--ink-4); letter-spacing: .8px; font-weight: 600; }
.menu-toggle { display: none; background: none; border: 0; cursor: pointer; color: var(--ink-3); padding: 6px; border-radius: 8px; }
.menu-toggle:hover { background: var(--canvas-2); color: var(--ink); }

/* Legacy avatar / profile-chip used elsewhere */
.avatar { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--accent-1), var(--brand-900)); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.profile-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.profile-chip:hover { background: var(--canvas-2); }
.profile-chip .who { line-height: 1.1; }
.profile-chip .who .name { font-weight: 600; font-size: 13px; }
.profile-chip .who .role { font-size: 11px; color: var(--ink-4); }

/* Content well — full-width beside the sidebar, matching the analytics mock
   (padding 28/32/56, no centred max-width cap). */
.content { padding: 28px 32px 56px; width: 100%; }
/* Page column — spans the full content width; the RER wizard (.rer-wizard)
   keeps its own internal max-width where it needs one. */
.page-shell { width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-family: 'Inter', sans-serif; font-size: 29px; font-weight: 700; margin: 0 0 5px; letter-spacing: -.5px; }
.page-head .sub { color: var(--ink-3); margin: 0; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Toolbar above tables — frosted-glass filter surface */
.toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.toolbar .grow { flex: 1; min-width: 220px; }
/* Filter-card fields sit on the canvas tint and lift to white on focus. */
.toolbar .input, .toolbar .select { background: var(--canvas); padding-top: 11px; padding-bottom: 11px; }
.toolbar .input:focus, .toolbar .select:focus { background: #fff; box-shadow: 0 0 0 3px var(--brand-50); }
.toolbar .btn { padding-top: 11px; padding-bottom: 11px; }

/* ---------------- Calendar (FullCalendar v6 theme → app tokens) ---------------- */
/* The grid ships with a generic Bootstrap-ish look; these rules retheme it to
   match the app (brand buttons, soft borders, rounded events, app typography). */
#calendar {
  --fc-border-color: var(--line);
  --fc-page-bg-color: var(--surface);
  --fc-neutral-bg-color: var(--canvas);
  --fc-today-bg-color: var(--brand-50);
  --fc-now-indicator-color: var(--red-600);
  --fc-event-text-color: #fff;
  --fc-highlight-color: var(--brand-50);
  --fc-list-event-hover-bg-color: var(--brand-50);
  font-family: inherit;
}
/* Header toolbar + month title */
.fc .fc-toolbar.fc-header-toolbar { margin-bottom: 18px; gap: 10px; flex-wrap: wrap; }
.fc .fc-toolbar-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; color: var(--ink); }
/* Buttons — mirror the app .btn */
.fc .fc-button {
  font: inherit; font-weight: 600; font-size: 13px; text-transform: capitalize;
  padding: 8px 14px; border-radius: 10px; box-shadow: none;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2);
  transition: var(--transition);
}
.fc .fc-button:hover { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); }
.fc .fc-button:focus { outline: none; box-shadow: 0 0 0 3px var(--brand-50); }
.fc .fc-button-primary:not(:disabled):active,
.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--brand-600); border-color: var(--brand-600); color: #fff;
}
.fc .fc-button-primary:disabled { background: #fff; border-color: var(--line); color: var(--ink-4); opacity: .55; }
.fc .fc-button .fc-icon { font-size: 1.4em; vertical-align: -3px; }
.fc .fc-button-group > .fc-button { border-radius: 0; }
.fc .fc-button-group > .fc-button:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.fc .fc-button-group > .fc-button:last-child { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
/* Grid frame + column headers */
.fc .fc-scrollgrid { border-radius: var(--r-md); overflow: hidden; }
.fc .fc-col-header-cell-cushion {
  padding: 10px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--ink-3); text-decoration: none;
}
.fc .fc-daygrid-day-number { padding: 6px 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.fc .fc-day-today .fc-daygrid-day-number { color: var(--brand-700); font-weight: 800; }
.fc .fc-daygrid-day.fc-day-other { background: var(--canvas); }
.fc .fc-daygrid-day.fc-day-other .fc-daygrid-day-number { color: var(--ink-4); }
/* Events */
.fc .fc-daygrid-event, .fc .fc-timegrid-event {
  border: none; border-radius: 6px; padding: 2px 6px; font-size: 12px; font-weight: 600;
  box-shadow: var(--sh-1);
}
.fc .fc-event-time { font-weight: 700; opacity: .9; }
.fc .fc-daygrid-event:hover { filter: brightness(.94); }
.fc .fc-daygrid-more-link {
  font-size: 11.5px; font-weight: 700; color: var(--brand-700);
  background: var(--brand-50); border-radius: 6px; padding: 1px 7px; margin-top: 2px;
}
.fc .fc-daygrid-more-link:hover { background: var(--brand-100); }
/* List / Agenda view */
.fc .fc-list { border-radius: var(--r-md); overflow: hidden; }
.fc .fc-list-day-cushion { background: var(--canvas); font-weight: 700; color: var(--ink); }
.fc .fc-list-event-title a { color: var(--ink); font-weight: 600; text-decoration: none; }
.fc .fc-list-event:hover td { background: var(--brand-50); }
/* "More events" popover */
.fc .fc-popover { border-radius: var(--r-md); border: 1px solid var(--line); box-shadow: var(--sh-2); overflow: hidden; }
.fc .fc-popover-header { background: var(--canvas); padding: 9px 12px; font-weight: 700; color: var(--ink); }

/* ===================== RER page-specific chrome =================== */
/* Hero card */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-1); overflow: hidden; margin-bottom: 22px; }
.hero-top { display: flex; align-items: flex-start; gap: 20px; padding: 24px 26px 20px; }
.hero-id { font-family: 'Roboto Mono', monospace; font-size: 13px; color: var(--brand-600); font-weight: 500; letter-spacing: .5px; margin-bottom: 5px; }
.hero-title { font-family: 'Inter', sans-serif; font-size: 25px; font-weight: 600; letter-spacing: -.3px; display: flex; align-items: center; gap: 13px; line-height: 1.15; margin: 0; }
.hero-meta { display: flex; align-items: center; gap: 9px; margin-top: 11px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); font-weight: 500; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-5); }
.hero-amount { margin-left: auto; text-align: right; flex-shrink: 0; }
.hero-amount .lbl { font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-4); font-weight: 600; }
.hero-amount .val { font-family: 'Inter', sans-serif; font-size: 30px; font-weight: 600; letter-spacing: -.5px; margin-top: 2px; line-height: 1.1; }
.hero-amount .note { font-size: 11px; color: var(--ink-4); margin-top: 1px; }
.hero-recon { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: -.1px; cursor: default; }
.hero-recon svg { width: 15px; height: 15px; flex-shrink: 0; }
.hero-recon.ok   { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-100); }
.hero-recon.warn { background: var(--amber-50); color: var(--amber-700); border: 1px solid var(--amber-100); }
.hero-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: flex-start; }

/* Progress rail inside hero */
.rail { display: flex; align-items: center; padding: 16px 26px; background: linear-gradient(180deg, var(--brand-50), #fff); border-top: 1px solid var(--line-2); flex-wrap: wrap; gap: 4px 0; }
.rstep { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.rbub { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.rstep.done .rbub { background: var(--brand-600); color: #fff; }
.rstep.cur  .rbub { background: #fff; color: var(--brand-700); border: 2px solid var(--brand-500); box-shadow: 0 0 0 4px var(--brand-100); }
.rstep.todo .rbub { background: #fff; color: var(--ink-4); border: 1.5px solid var(--line); }
.rlab { font-size: 12.5px; font-weight: 600; }
.rstep.todo .rlab { color: var(--ink-4); font-weight: 500; }
.rline { flex: 1; height: 2px; min-width: 18px; margin: 0 12px; border-radius: 2px; background: var(--line); }
.rline.fill { background: var(--brand-500); }

/* RER two-column grid */
.rer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.rer-grid--noaside { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1080px) { .rer-grid { grid-template-columns: 1fr; } }

/* Action card with tabs (closure wizard) */
.action-card { background: var(--surface); border: 1px solid var(--brand-200); border-radius: var(--r-xl); box-shadow: var(--sh-2); overflow: hidden; margin-bottom: 22px; position: relative; }
.action-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--brand-500), var(--brand-700)); z-index: 1; }
.action-banner { display: flex; align-items: center; gap: 14px; padding: 18px 22px; background: linear-gradient(120deg, var(--brand-50), #fff); position: relative; z-index: 0; }
.action-pulse { width: 40px; height: 40px; border-radius: 12px; background: var(--amber-100); color: var(--amber-700); display: grid; place-items: center; flex-shrink: 0; position: relative; }
.action-pulse svg { width: 20px; height: 20px; }
.action-pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 15px; border: 2px solid var(--amber-600); opacity: 0; animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { opacity: .5; transform: scale(.92); } 70% { opacity: 0; transform: scale(1.12); } 100% { opacity: 0; } }
.action-banner .txt .ka { font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--amber-700); font-weight: 700; }
.action-banner .txt .kt { font-family: 'Inter', sans-serif; font-size: 17px; font-weight: 600; margin-top: 2px; }
.action-progress { margin-left: auto; text-align: right; flex-shrink: 0; }
.action-progress .pn { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pbar { width: 120px; height: 6px; border-radius: 6px; background: var(--canvas-2); margin-top: 6px; overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand-500), var(--brand-600)); }

/* Panes */
.pane-body { padding: 22px; }
.pane-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.pane-num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 15px; flex-shrink: 0; background: var(--canvas); color: var(--ink-3); }
.pane-num.done { background: var(--green-100); color: var(--green-700); }
.pane-num.pending { background: var(--amber-100); color: var(--amber-700); }
.pane-t { font-family: 'Inter', sans-serif; font-size: 16.5px; font-weight: 600; }
.pane-d { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; font-weight: 450; max-width: 56ch; }
.pane-status { margin-left: auto; flex-shrink: 0; }
.pane-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pane-actions .spacer { flex: 1; }

/* Attachments list */
.att { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 9px; transition: var(--transition); background: #fff; }
.att:last-of-type { margin-bottom: 0; }
.att:hover { border-color: var(--brand-200); background: var(--brand-50); }
.att-ic { width: 36px; height: 36px; border-radius: 9px; background: var(--red-100); color: var(--red-700); display: grid; place-items: center; flex-shrink: 0; font-size: 9px; font-weight: 700; font-family: 'Roboto Mono', monospace; letter-spacing: .5px; }
.att-ic.img { background: var(--brand-100); color: var(--brand-700); }
.att-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.att-meta { font-size: 11px; color: var(--ink-4); margin-top: 1px; }
.att-type { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .6px; padding: 3px 8px; border-radius: 6px; background: var(--brand-50); color: var(--brand-700); flex-shrink: 0; }
.att-foot { font-size: 11.5px; color: var(--ink-4); margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-style: italic; }

/* Colour-code attachment cards by document kind (PI / PO / TI / other) */
.att--pi    { border-left: 3px solid var(--purple-700); background: var(--purple-100); }
.att--pi:hover    { border-color: var(--purple-700); background: #e3def9; }
.att--pi    .att-ic { background: var(--purple-100); color: var(--purple-700); }
.att--pi    .att-type { background: #fff; color: var(--purple-700); }

.att--po    { border-left: 3px solid var(--brand-700); background: var(--brand-50); }
.att--po:hover    { border-color: var(--brand-700); background: var(--brand-100); }
.att--po    .att-ic { background: var(--brand-100); color: var(--brand-700); }
.att--po    .att-type { background: #fff; color: var(--brand-700); }

.att--ti    { border-left: 3px solid var(--green-700); background: var(--green-50); }
.att--ti:hover    { border-color: var(--green-700); background: var(--green-100); }
.att--ti    .att-ic { background: var(--green-100); color: var(--green-700); }
.att--ti    .att-type { background: #fff; color: var(--green-700); }

.att--other { border-left: 3px solid var(--amber-700); background: var(--amber-50); }
.att--other:hover { border-color: var(--amber-700); background: var(--amber-100); }
.att--other .att-ic { background: var(--amber-100); color: var(--amber-700); }
.att--other .att-type { background: #fff; color: var(--amber-700); }

/* Activity log (sticky right rail) */
.log-card { position: sticky; top: 80px; }
.log-scroll { max-height: 72vh; overflow-y: auto; padding: 6px 18px 16px; }
.log-scroll::-webkit-scrollbar { width: 5px; }
.log-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.log-day { font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-4); font-weight: 600; padding: 14px 2px 8px; }
.log-item { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.log-item:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 30px; bottom: 0; width: 2px; background: var(--line-2); }
.log-av { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 600; font-size: 11px; color: #fff; flex-shrink: 0; z-index: 1; }
.av-a { background: linear-gradient(135deg, #2E72C4, #134B8A); }
.av-p { background: linear-gradient(135deg, #12B76A, #027A48); }
.av-s { background: linear-gradient(135deg, #62718a, #46506a); }
.av-r { background: linear-gradient(135deg, #F04438, #B42318); }
.log-body { flex: 1; min-width: 0; padding-top: 1px; }
.log-top { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.log-act { font-size: 12.5px; font-weight: 600; }
.log-act.ev { color: var(--green-700); }
.log-act.sys { color: var(--ink-3); font-family: 'Roboto Mono', monospace; font-size: 11.5px; font-weight: 500; }
.log-who { font-size: 11px; color: var(--ink-4); font-weight: 500; }
.log-detail { font-size: 12px; color: var(--ink-2); font-weight: 450; margin-top: 2px; }
.log-detail .amt-i { font-family: 'Roboto Mono', monospace; font-weight: 600; font-size: 11.5px; }
.log-time { font-size: 10.5px; color: var(--ink-4); margin-top: 3px; font-family: 'Roboto Mono', monospace; }

/* --------------------------- Brand logo --------------------------- */
.logo-chip { background: #fff; display: grid; place-items: center; border-radius: var(--r-sm); }
.logo-chip img { width: 100%; height: 100%; object-fit: contain; display: block; }
.auth-aside .logo-chip { width: 76px; height: 76px; padding: 12px; margin-bottom: 28px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.public-logo { display: block; height: 86px; width: auto; max-width: 100%; margin: 0 auto 22px; }
/* Full PACE lockup on a white plate — keeps the blue artwork legible on the
   dark login aside / against any surface. */
.brand-plate { background: #fff; border-radius: 18px; padding: 22px 26px; width: 208px; max-width: 100%; box-sizing: border-box; }
.brand-plate img { display: block; width: 100%; height: auto; }

/* ============================ Layout: auth ===================== */
/* Full-screen earth/space hero with an overlaid glassmorphism sign-in card
   ("Earth Split" approved design). Reuses the existing .auth-* class names;
   form/input/button restyles are scoped under .auth-card so the global
   components remain untouched on every other screen. */
.auth-wrap {
  position: relative; min-height: 100vh; overflow: hidden;
  background: #02040C; color: #fff; font-family: 'Inter', sans-serif;
}
.auth-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: #02040C url('../images/auth-earth.jpg') center / cover no-repeat;
}
.auth-scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
/* left scrim — keeps the headline & feature list legible over the bright limb */
.auth-scrim-l {
  background: linear-gradient(100deg, rgba(2,5,14,.86) 0%, rgba(2,5,14,.58) 32%,
    rgba(2,5,14,.14) 52%, transparent 66%);
}
/* gentle bottom vignette for the trusted-by row */
.auth-scrim-b { background: linear-gradient(0deg, rgba(2,5,14,.66) 0%, transparent 28%); }

.auth-stage {
  position: relative; z-index: 3; min-height: 100vh;
  max-width: 1440px; margin-inline: auto;
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  padding: clamp(28px, 4vw, 54px) clamp(24px, 5vw, 72px);
}
.auth-top { display: flex; align-items: center; }
.auth-mid { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 48px; }

/* logo plate (top-left) */
.auth-top .brand-plate {
  width: auto; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 18px; padding: 16px 20px;
  box-shadow: 0 18px 40px -18px rgba(4,8,20,.7); box-sizing: border-box;
}
.auth-top .brand-plate img { height: 92px; width: auto; display: block; }

/* hero copy (left column) */
.auth-aside {
  position: relative; z-index: 3; max-width: 540px; color: #fff;
  display: block; padding: 0; background: none; overflow: visible;
}
.auth-aside h2 {
  font-family: 'Inter', sans-serif; font-weight: 800; letter-spacing: -.025em;
  line-height: 1.03; font-size: clamp(40px, 4.4vw, 60px); margin: 0; max-width: none; color: #fff;
}
.auth-aside h2 .grad {
  background: linear-gradient(120deg, #2BB4FF 0%, #11B4FF 45%, #5AD8FF 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #11B4FF;
}
.auth-aside p {
  margin: 22px 0 0; max-width: 430px; color: rgba(255,255,255,.78);
  font-size: 16.5px; font-weight: 400; line-height: 1.6;
}
.auth-points { list-style: none; margin: 34px 0 0; padding: 0; display: flex; flex-direction: column; gap: 15px; }
.auth-points li { display: flex; align-items: center; gap: 14px; color: rgba(255,255,255,.92); font-size: 15.5px; font-weight: 500; }
.auth-points .ic {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, #1769FF, #00B4FF); border: 0;
  box-shadow: 0 8px 18px -8px rgba(23,105,255,.75);
}
.auth-points .ic svg { width: 15px; height: 15px; color: #fff; }

/* right column / glass card */
.auth-main { position: static; flex: none; display: block; padding: 0; background: none; place-items: initial; }
.auth-card {
  width: min(438px, 100%); padding: 38px 38px 30px; border-radius: 32px;
  background: rgba(7,18,54,.55);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
          backdrop-filter: blur(30px) saturate(1.2);
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 60px 130px -40px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.20);
}
.auth-mobile-brand { display: none; }
.auth-card h1 { font-family: 'Inter', sans-serif; font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 0; color: #fff; }
.auth-card .lead { margin: 7px 0 0; font-size: 14.5px; font-weight: 400; color: rgba(255,255,255,.66); }
.auth-card form { margin-top: 26px; }
.auth-card .field label { color: rgba(255,255,255,.88); font-size: 13px; }

/* inputs on the glass card */
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > svg { position: absolute; left: 15px; width: 19px; height: 19px; color: var(--ink-3); pointer-events: none; transition: var(--transition); }
.input-icon .input { padding-left: 46px; }
.input-icon .input.has-toggle { padding-right: 46px; }
.input-toggle { position: absolute; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: var(--r-sm); transition: var(--transition); }
.input-toggle:hover { color: var(--ink-2); background: var(--canvas); }
.input-toggle svg { width: 18px; height: 18px; display: block; }
.input-toggle .eye-off { display: none; }
.input-toggle.is-on .eye { display: none; }
.input-toggle.is-on .eye-off { display: block; }
.auth-card .input {
  height: 52px; border: 1.5px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06);
  border-radius: 14px; font-size: 15px; font-weight: 500; color: #fff;
}
.auth-card .input::placeholder { color: rgba(255,255,255,.42); font-weight: 400; }
.auth-card .input:focus {
  border-color: #2BB4FF; background: rgba(255,255,255,.12);
  box-shadow: 0 0 0 4px rgba(43,180,255,.22);
}
.auth-card .input-icon > svg { color: rgba(255,255,255,.55); }
.auth-card .field:focus-within .input-icon > svg { color: #2BB4FF; }
.auth-card .input-toggle { color: rgba(255,255,255,.55); }
.auth-card .input-toggle:hover { color: #fff; background: rgba(255,255,255,.10); }

/* remember / forgot row */
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 22px; font-size: 13.5px; }
.auth-row a { font-weight: 600; }
.auth-card .checkbox { color: rgba(255,255,255,.78); font-weight: 500; }
.auth-card .checkbox input { accent-color: #1769FF; width: 18px; height: 18px; }
.auth-card .auth-row a { color: #5AD8FF; }

/* primary CTA — blue gradient */
.auth-card .btn-primary {
  height: 54px; padding: 0 18px; border-radius: 14px; font-size: 15.5px; font-weight: 700; letter-spacing: .01em;
  background: linear-gradient(100deg, #2477FF, #11B4FF); color: #fff; border: 0;
  box-shadow: 0 16px 34px -12px rgba(36,119,255,.75), inset 0 1px 0 rgba(255,255,255,.3);
}
.auth-card .btn-primary:hover,
.auth-card .btn-primary:not(:disabled):hover {
  background: linear-gradient(100deg, #2477FF, #11B4FF); filter: brightness(1.05);
  box-shadow: 0 20px 40px -12px rgba(36,119,255,.8), inset 0 1px 0 rgba(255,255,255,.3);
}
.auth-card .btn svg { width: 19px; height: 19px; }

/* secondary (SSO) button on glass */
.auth-card .btn-secondary { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.18); box-shadow: none; }
.auth-card .btn-secondary:hover { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }

.auth-sep { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.55); font-size: 11px; margin: 22px 0; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 600; }
.auth-sep::before, .auth-sep::after { content: ""; height: 1px; background: rgba(255,255,255,.16); flex: 1; }
.auth-foot-note { text-align: center; margin: 14px 0 0; color: rgba(255,255,255,.5); font-size: 12.5px; }

/* footer: trusted-by + brand wordmarks */
.auth-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.auth-trust { display: flex; flex-direction: column; gap: 13px; }
.auth-trust-label { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.auth-brands { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.auth-brands span { color: rgba(255,255,255,.7); font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.auth-brands span.it { font-style: italic; }
.auth-brands span.sc { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; }
.auth-copyr { color: rgba(255,255,255,.5); font-size: 12.5px; font-weight: 500; }

/* Public (verify) layout */
.public-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; background: var(--canvas); }

/* Error pages */
.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 40px; }
.error-page .code { font-family: 'Inter', sans-serif; font-size: 72px; font-weight: 600; color: var(--brand-600); line-height: 1; }

/* ----------------------------- Utilities -------------------------- */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.col { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack > * + * { margin-top: 16px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ===================== RER wizard (new / edit form) ================== */
/* Two-column requisition builder from the revised mock: numbered section
   cards on the left, a sticky rail (progress checklist + live balance meter +
   actions) on the right. Scoped under .rer-wizard so the new component names
   (.sec, .rail, .panel, .step, .meter, .control…) never collide with the
   global chrome that the rest of the app shares. */
.rer-wizard { max-width: 1200px; margin: 0 auto; }
.rer-hero { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.rer-hero .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--brand-600); margin-bottom: 7px; }
.rer-hero h1 { font-size: 28px; font-weight: 800; letter-spacing: -.5px; display: flex; align-items: center; gap: 13px; margin: 0; }
.rer-hero .legend { color: var(--ink-3); font-size: 13px; margin: 10px 0 0; font-weight: 500; }
.rer-hero .right { margin-left: auto; display: flex; gap: 11px; }
.badge-new { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-100); padding: 5px 12px; border-radius: 20px; }
.badge-new .pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-500); box-shadow: 0 0 0 3px rgba(46,132,201,.18); }

.rer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 28px; align-items: start; }

/* numbered section card */
.rer-wizard .sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-card); margin-bottom: 18px; overflow: hidden; scroll-margin-top: 88px; }
.rer-wizard .sec-head { display: flex; gap: 14px; padding: 20px 22px 0; }
.rer-wizard .sec-num { position: relative; width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--brand-100); border: 1px solid var(--brand-200); color: var(--brand-600); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
/* Completed step: the badge fills solid green and swaps the number for a
   check — same trick as the rail dots; the digit stays in the DOM but
   renders transparent under the overlaid ::after. */
.rer-wizard .sec.done .sec-num { background: var(--green-600); border-color: var(--green-600); color: transparent; }
.rer-wizard .sec.done .sec-num::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800; }
.rer-wizard .sec-head .eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; }
.rer-wizard .sec-head h3 { font-size: 17.5px; font-weight: 700; letter-spacing: -.2px; display: flex; align-items: center; gap: 7px; margin: 0; }
.rer-wizard .sec-head .desc { color: var(--ink-2); font-size: 13px; margin: 6px 0 0; font-weight: 450; max-width: 62ch; line-height: 1.55; }
/* The mock drops the head/body hairline — the divider stays in the markup
   but renders as pure spacing. */
.rer-wizard .sec-divider { height: 0; background: transparent; margin: 0; }
.rer-wizard .sec-body { padding: 18px 22px 22px; }

/* taller, filled controls inside the wizard */
.rer-wizard .input, .rer-wizard .select { height: 48px; background: var(--canvas); font-weight: 600; border-radius: 12px; }
.rer-wizard .input[type="file"] { height: auto; padding: 11px 12px; font-weight: 500; }
.rer-wizard .input:focus, .rer-wizard .select:focus { background: #fff; }
.rer-wizard .field > label { font-size: 13px; font-weight: 700; color: var(--ink); }

/* auto-derived program count */
.rer-wizard .derived { display: flex; align-items: center; gap: 13px; background: linear-gradient(180deg, #FBFDFF, #F5F9FD); border: 1px dashed var(--line); border-radius: 12px; padding: 0 16px; height: 48px; }
.rer-wizard .derived .num { font-size: 22px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.rer-wizard .derived .lbl { font-size: 11.5px; color: var(--ink-3); font-weight: 600; line-height: 1.3; }

/* GL code caption rendered by rer_form.js → render as a chip when populated */
.rer-wizard .gl-caption:not(:empty) { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 11.5px; font-weight: 600; color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-100); padding: 5px 10px; border-radius: 8px; font-family: 'Roboto Mono', monospace; }

/* ₹-prefixed amount inputs + leading-icon date inputs */
.rer-wizard .amt-wrap { position: relative; }
.rer-wizard .amt-wrap::before { content: "\20B9"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-4); font-weight: 600; font-size: 13px; pointer-events: none; z-index: 1; }
.rer-wizard .amt-wrap .input { padding-left: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.rer-wizard .with-icon { position: relative; }
.rer-wizard .with-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-4); pointer-events: none; }
.rer-wizard .with-icon .input { padding-left: 40px; }

/* trainings picker header: count pill + select-all toggle */
.rer-wizard .div-trainings-count { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-100); padding: 2px 9px; border-radius: 20px; }
.rer-wizard .div-trainings-all { font-size: 12px; font-weight: 700; color: var(--brand-600); cursor: pointer; user-select: none; }
.rer-wizard .div-trainings-all:hover { color: var(--brand-800); }
.rer-wizard .div-trainings-all[hidden] { display: none; }

/* distribution split rows (rer_form.js clones .div-row) */
.rer-wizard .div-row { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fff; transition: var(--transition); margin-bottom: 14px; }
.rer-wizard .div-row:hover { border-color: var(--brand-200); }
.rer-wizard .div-trainings-list { border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }

/* dashed add buttons */
.rer-wizard .add-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 11px; border: 1px dashed var(--brand-400); background: #fff; color: var(--brand-700); font-family: inherit; font-weight: 700; font-size: 13px; cursor: pointer; transition: var(--transition); }
.rer-wizard .add-btn:hover { background: var(--brand-50); border-style: solid; }
.rer-wizard .add-btn svg { width: 15px; height: 15px; }
.rer-wizard .sec-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; flex-wrap: wrap; gap: 12px; }
.rer-wizard .total-tag { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.rer-wizard .total-tag .amount { font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }

/* cost-line cards (card-per-line layout) */
.rer-wizard .lines { display: flex; flex-direction: column; gap: 14px; }
.rer-wizard .line { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fff; transition: var(--transition); }
.rer-wizard .line:hover { border-color: var(--brand-200); }
.rer-wizard .line-grid { display: grid; grid-template-columns: 1fr 1fr 200px auto; gap: 16px; align-items: start; }
.rer-wizard .line-grid .field { margin: 0; }
.rer-wizard .lg-label { display: none; }
.rer-wizard .x-btn { width: 42px; height: 48px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink-4); display: grid; place-items: center; cursor: pointer; transition: var(--transition); }
.rer-wizard .x-btn:hover { border-color: var(--red-600); color: var(--red-600); background: #FEF3F2; }
.rer-wizard .x-btn svg { width: 16px; height: 16px; }
@media (max-width: 720px) {
  .rer-wizard .line-grid { grid-template-columns: 1fr; }
  .rer-wizard .lg-label { display: block; font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
  .rer-wizard .x-btn { width: 100%; }
}

/* attachment dropzone */
.rer-wizard .dropzone { border: 1.5px dashed var(--brand-400); border-radius: 14px; background: var(--brand-50); padding: 30px; text-align: center; }
.rer-wizard .dropzone .dz-ic { width: 50px; height: 50px; border-radius: 14px; background: #fff; border: 1px solid var(--brand-100); display: grid; place-items: center; margin: 0 auto 14px; color: var(--brand-600); box-shadow: var(--sh-1); }
.rer-wizard .dropzone .dz-ic svg { width: 24px; height: 24px; }
.rer-wizard .dropzone h4 { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0; }
.rer-wizard .dropzone p { font-size: 12.5px; color: var(--ink-3); margin: 5px 0 0; font-weight: 500; }
.rer-wizard .dropzone .pill-req { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 11.5px; font-weight: 700; color: var(--amber-700); background: var(--amber-50); border: 1px solid var(--amber-100); padding: 5px 12px; border-radius: 20px; }
.rer-wizard .dropzone .pill-req svg { width: 13px; height: 13px; }

/* enhanced file picker (PI upload) — custom dropzone wrapping a hidden input */
.file-drop { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; min-height: 64px; padding: 14px 16px; border: 1.5px dashed var(--brand-400); border-radius: 12px; background: var(--brand-50); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.file-drop:hover { border-color: var(--brand-600); background: var(--brand-100); }
.file-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.file-drop.is-dragover { border-color: var(--brand-600); border-style: solid; background: var(--brand-100); box-shadow: 0 0 0 3px var(--brand-100); }
.file-drop.has-file { border-style: solid; border-color: var(--green-200, var(--brand-200)); background: var(--green-50); }
.file-drop.is-error { border-color: var(--red-300, var(--red-100)); background: #FEF3F2; }
.file-drop-empty, .file-drop-picked { display: flex; align-items: center; gap: 12px; width: 100%; }
.file-drop-ic { width: 38px; height: 38px; flex: none; border-radius: 10px; background: #fff; border: 1px solid var(--brand-100); display: grid; place-items: center; color: var(--brand-600); box-shadow: var(--sh-1); }
.file-drop-ic.ok { color: var(--green-700); border-color: var(--green-100); }
.file-drop-ic svg { width: 19px; height: 19px; }
.file-drop-text { font-size: 12.5px; color: var(--ink-2, var(--ink-3)); font-weight: 500; }
.file-drop-text strong { color: var(--brand-700); font-weight: 700; }
.file-drop-hint { font-size: 11.5px; color: var(--ink-3); font-weight: 500; margin-left: auto; }
.file-drop-meta { display: flex; flex-direction: column; min-width: 0; }
.file-drop-name { font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-drop-size { font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.file-drop-clear { margin-left: auto; flex: none; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--brand-100); background: #fff; color: var(--ink-3); font-size: 13px; line-height: 1; cursor: pointer; transition: color .15s, border-color .15s; }
.file-drop-clear:hover { color: var(--red-600); border-color: var(--red-100); }
.file-drop-error { display: block; margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--red-600); }

/* uploaded documents view — card list of existing attachments */
.rer-wizard .doc-empty { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border: 1px dashed var(--line, var(--brand-100)); border-radius: 12px; background: var(--surface-2, #fafafa); color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.rer-wizard .doc-empty-ic { width: 30px; height: 30px; flex: none; border-radius: 8px; background: #fff; border: 1px solid var(--brand-100); display: grid; place-items: center; color: var(--ink-3); }
.rer-wizard .doc-empty-ic svg { width: 16px; height: 16px; }
.rer-wizard .doc-count { display: block; }
.rer-wizard .doc-list { display: flex; flex-direction: column; gap: 8px; }
.rer-wizard .doc-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line, var(--brand-100)); border-radius: 12px; background: #fff; box-shadow: var(--sh-1); transition: border-color .15s, box-shadow .15s; }
.rer-wizard .doc-item:hover { border-color: var(--brand-300, var(--brand-200)); box-shadow: var(--sh-2, var(--sh-1)); }
.rer-wizard .doc-ic { width: 38px; height: 38px; flex: none; border-radius: 9px; display: grid; place-items: center; }
.rer-wizard .doc-ic svg { width: 19px; height: 19px; }
.rer-wizard .doc-ic.is-pdf { background: #FEF3F2; color: var(--red-600); border: 1px solid var(--red-100); }
.rer-wizard .doc-ic.is-img { background: var(--brand-50); color: var(--brand-600); border: 1px solid var(--brand-100); }
.rer-wizard .doc-meta { min-width: 0; flex: 1; }
.rer-wizard .doc-name { display: block; font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rer-wizard .doc-name:hover { color: var(--brand-700); text-decoration: underline; }
.rer-wizard .doc-sub { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 11.5px; color: var(--ink-3); font-weight: 500; flex-wrap: wrap; }
.rer-wizard .doc-dot { color: var(--line, var(--brand-200)); }
.rer-wizard .doc-kind { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; }
.rer-wizard .doc-kind.k-pi { background: #fff; color: var(--purple-700); border: 1px solid var(--purple-100); }
.rer-wizard .doc-kind.k-po { background: #fff; color: var(--brand-700); border: 1px solid var(--brand-100); }
.rer-wizard .doc-kind.k-ti { background: #fff; color: var(--green-700); border: 1px solid var(--green-100); }
.rer-wizard .doc-kind.k-other { background: #fff; color: var(--amber-700); border: 1px solid var(--amber-100); }

/* Colour-code attachment cards by document kind (matches rer/show) */
.rer-wizard .doc-item--pi    { border-left: 3px solid var(--purple-700); background: var(--purple-100); }
.rer-wizard .doc-item--pi:hover    { border-color: var(--purple-700); }
.rer-wizard .doc-item--pi    .doc-ic { background: var(--purple-100); color: var(--purple-700); border-color: var(--purple-100); }
.rer-wizard .doc-item--po    { border-left: 3px solid var(--brand-700); background: var(--brand-50); }
.rer-wizard .doc-item--po:hover    { border-color: var(--brand-700); }
.rer-wizard .doc-item--po    .doc-ic { background: var(--brand-100); color: var(--brand-700); border-color: var(--brand-100); }
.rer-wizard .doc-item--ti    { border-left: 3px solid var(--green-700); background: var(--green-50); }
.rer-wizard .doc-item--ti:hover    { border-color: var(--green-700); }
.rer-wizard .doc-item--ti    .doc-ic { background: var(--green-100); color: var(--green-700); border-color: var(--green-100); }
.rer-wizard .doc-item--other { border-left: 3px solid var(--amber-700); background: var(--amber-50); }
.rer-wizard .doc-item--other:hover { border-color: var(--amber-700); }
.rer-wizard .doc-item--other .doc-ic { background: var(--amber-100); color: var(--amber-700); border-color: var(--amber-100); }
.rer-wizard .doc-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.rer-wizard .doc-btn { width: 32px; height: 32px; flex: none; border-radius: 8px; border: 1px solid var(--brand-100); background: #fff; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; text-decoration: none; transition: color .15s, border-color .15s, background .15s; }
.rer-wizard .doc-btn svg { width: 16px; height: 16px; }
.rer-wizard .doc-btn:hover { color: var(--brand-700); border-color: var(--brand-300, var(--brand-200)); background: var(--brand-50); }
.rer-wizard .doc-btn.is-danger:hover { color: var(--red-600); border-color: var(--red-100); background: #FEF3F2; }

/* sticky rail */
.rer-rail { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 18px; }
.rer-rail .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-card); overflow: hidden; }
.rer-rail .panel-head { padding: 16px 18px 0; }
.rer-rail .panel-head .t { font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-3); }
.rer-rail .panel-body { padding: 16px 18px 18px; }
.rer-rail .steps { list-style: none; display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; }
.rer-rail .step { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; transition: var(--transition); text-decoration: none; }
.rer-rail .step:hover { background: var(--canvas); text-decoration: none; }
.rer-rail .step .dot { width: 24px; height: 24px; flex: none; border-radius: 8px; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--ink-4); background: #fff; transition: var(--transition); }
.rer-rail .step.done .dot { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.rer-rail .step.done .dot::after { content: "✓"; }
.rer-rail .step.done .dot .n { display: none; }
.rer-rail .step.todo .dot { border-style: dashed; }
.rer-rail .step .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rer-rail .step.done .lbl { color: var(--ink); }

.rer-rail .bal-rows { display: flex; flex-direction: column; gap: 1px; background: var(--line-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rer-rail .bal { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #fff; }
.rer-rail .bal .k { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.rer-rail .bal .v { font-size: 15px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.rer-rail .bal.is-rer { background: var(--brand-50); }
.rer-rail .bal.is-rer .v { color: var(--brand-800); }
.rer-rail .meter { height: 8px; border-radius: 6px; background: var(--line-2); margin-top: 14px; overflow: hidden; }
.rer-rail .meter span { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--brand-500), var(--brand-700)); transition: width .35s ease; }
.rer-rail .meter span.ok { background: linear-gradient(90deg, #1FA877, var(--green-600)); }
.rer-rail .meter span.over { background: linear-gradient(90deg, #EE7A5F, var(--red-600)); }
.rer-rail .rstatus { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding: 11px 13px; border-radius: 11px; font-size: 12.5px; font-weight: 700; }
.rer-rail .rstatus svg { width: 16px; height: 16px; flex: none; }
/* Any mismatch — under- OR over-allocated — reads as danger red; only a
   matched distribution reads green. */
.rer-rail .rstatus.bad { background: #FEF3F2; border: 1px solid var(--red-100); color: var(--red-700); }
.rer-rail .rstatus.over { background: #FEF3F2; border: 1px solid var(--red-100); color: var(--red-700); }
.rer-rail .rstatus.ok { background: var(--green-50); border: 1px solid var(--green-100); color: var(--green-700); }

/* Balance check — the signature dark reconciliation ledger from the
   pace-requisition mock. The whole panel goes deep navy; the boxed .bal-rows
   flatten into hairline-separated ledger lines (no card-within-card), the
   last line ("Remaining") reads as the big total, and the meter / status
   recolour for the dark surface. State colours on the total come from the
   .rstatus class rer_form.js already toggles, via :has() — on an older
   browser the total simply stays the neutral light ink. */
.rer-rail .panel-balance { background: linear-gradient(180deg, var(--brand-900), var(--brand-950)); border-color: rgba(127,166,204,.30); box-shadow: var(--shadow-lg); }
.rer-rail .panel-balance .panel-head .t { color: #7FA6CC; }
.rer-rail .panel-balance .bal-rows { background: none; border: 0; border-radius: 0; gap: 0; overflow: visible; }
.rer-rail .panel-balance .bal { background: none; padding: 11px 0; }
.rer-rail .panel-balance .bal + .bal { border-top: 1px solid rgba(255,255,255,.07); }
.rer-rail .panel-balance .bal .k { color: #B6CCE2; font-weight: 500; }
.rer-rail .panel-balance .bal .v { color: #EAF3FB; font-weight: 600; }
.rer-rail .panel-balance .bal.is-rer { background: none; }
.rer-rail .panel-balance .bal.is-rer .v { color: #EAF3FB; }
.rer-rail .panel-balance .bal:nth-child(2) .k,
.rer-rail .panel-balance .bal:nth-child(2) .v { color: #8FAAC6; }   /* Distributed — muted */
.rer-rail .panel-balance .bal:last-child .k { color: #fff; font-weight: 700; }
.rer-rail .panel-balance .bal:last-child .v { font-size: 21px; font-weight: 700; }
.rer-rail .panel-balance:has(.rstatus.ok)   .bal:last-child .v { color: #86E2AE; }
.rer-rail .panel-balance:has(.rstatus.bad)  .bal:last-child .v,
.rer-rail .panel-balance:has(.rstatus.over) .bal:last-child .v { color: #F7A8A0; }
.rer-rail .panel-balance .meter { height: 6px; background: rgba(255,255,255,.10); margin-top: 8px; }
/* The fill is red until the distribution matches (under or over), then green. */
.rer-rail .panel-balance .meter span { background: linear-gradient(90deg, #F09A90, #E2564C); }
.rer-rail .panel-balance .meter span.ok { background: linear-gradient(90deg, #34C98E, #12B76A); }
.rer-rail .panel-balance .meter span.over { background: linear-gradient(90deg, #F09A90, #E2564C); }
.rer-rail .panel-balance .rstatus { font-weight: 600; }
.rer-rail .panel-balance .rstatus.bad,
.rer-rail .panel-balance .rstatus.over { background: rgba(240,68,56,.15); border-color: rgba(240,68,56,.34); color: #F7A8A0; }
.rer-rail .panel-balance .rstatus.ok   { background: rgba(134,226,174,.13); border-color: rgba(134,226,174,.30); color: #A7EDC4; }
.rer-rail .rail-actions { display: flex; flex-direction: column; gap: 10px; }
.rer-rail .rail-actions .btn { width: 100%; justify-content: center; height: 44px; }
.rer-rail .rail-actions .btn-primary { height: 50px; border-radius: 13px; font-size: 14.5px; }
.rer-rail .note { font-size: 11.5px; color: var(--ink-3); font-weight: 500; line-height: 1.5; display: flex; gap: 8px; background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 11px; padding: 11px 13px; }
.rer-rail .note svg { width: 15px; height: 15px; flex: none; color: var(--brand-600); margin-top: 1px; }
.rer-rail .note b { color: var(--brand-800); font-weight: 700; }
/* Shared by the <a> ("Cancel and discard") and <button> ("Delete this draft")
   variants — the button needs an explicit chrome reset so it doesn't inherit
   the browser's default grey button styling. */
.rer-rail .rail-cancel { width: 100%; box-sizing: border-box; text-align: center; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 4px; text-decoration: none; display: block; background: none; border: 0; cursor: pointer; appearance: none; -webkit-appearance: none; }
.rer-rail .rail-cancel:hover { color: var(--red-600); text-decoration: none; }

@media (max-width: 1080px) {
  .rer-layout { grid-template-columns: 1fr; }
  .rer-rail { position: static; }
}

/* RER detail (show) page — same fashion as the wizard: bolder headings, brand
   eyebrows. Structure (hero progress rail, closure tabs, activity log) is kept
   intact; only the type treatment is aligned with the revised mock. */
.rer-detail .hero-title { font-weight: 800; letter-spacing: -.3px; }
.rer-detail .card-title { font-weight: 800; letter-spacing: -.2px; }
.rer-detail .card-eyebrow { color: var(--brand-600); font-weight: 700; }
.rer-detail .hero-id { font-weight: 700; letter-spacing: .4px; text-transform: uppercase; font-size: 11px; }

/* Weight hierarchy: keep only the MAIN values bold (money amounts, totals,
   balances). Descriptive values — names, codes, dates, reference numbers,
   filenames — read as regular weight, distinguished from their labels by
   colour, not boldness. Keeps the eye on the figures that matter. */
.rer-detail .dl-val { font-weight: 400; color: var(--ink); }
.rer-detail .dl-val.amt-strong { font-weight: 700; }        /* RER / PO amounts stay bold */
.rer-detail .tbl .cell-main { font-weight: 400; }           /* cost head / nature of work */
.rer-detail .att-name { font-weight: 400; }                 /* attachment filenames */
.rer-detail .settle-balance .sb-v { font-weight: 400; }     /* PO amount + running totals */
.rer-detail .settle-balance .sb-bal .sb-v { font-weight: 700; } /* the balances stand out */

/* ----------------------------- Responsive ------------------------- */
/* Backdrop overlay that appears with the mobile sidebar drawer. */
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(10,32,64,.45); z-index: 1280; display: none; }
.sidebar-backdrop.open { display: block; }

@media (max-width: 1280px) {
  .content { padding: 28px 28px 64px; }
}

@media (max-width: 980px) {
  .app { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 1300; transform: translateX(-100%); transition: transform 220ms ease; width: var(--sidebar-w); }
  .sidebar.open { transform: none; }
  .auth-top { justify-content: center; }
  .auth-mid { flex-direction: column; justify-content: center; gap: 0; }
  .auth-aside { display: none; }
  .auth-main { width: 100%; display: flex; justify-content: center; }
  .auth-card { margin: 0 auto; padding: 32px 26px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .menu-toggle { display: grid; align-items: center; }
  .topbar { padding: 0 16px; gap: 12px; }
  .content { padding: 18px 16px 48px; }
  .hero-top { flex-wrap: wrap; padding: 20px 20px 16px; }
  .hero-amount { margin-left: 0; text-align: left; }
  .hero-actions { width: 100%; flex-wrap: wrap; }
  .hero-title { font-size: 22px; }
  .hero-amount .val { font-size: 26px; }
  .rail { padding: 14px 18px; overflow-x: auto; flex-wrap: nowrap; }
  .rail .rstep, .rail .rline { flex-shrink: 0; }
  /* Stack the action-card banner on tablets so the progress bar drops below. */
  .action-banner { flex-wrap: wrap; padding: 16px 18px; }
  .action-progress { margin-left: 0; width: 100%; text-align: left; margin-top: 6px; }
  .action-progress .pbar { margin-left: 0; }
  /* Closure tab labels can wrap visually — let the bar scroll. */
  .tabs { padding: 0 8px; }
  .pane-body { padding: 18px; }
  .pane-head { flex-wrap: wrap; }
  .pane-status { margin-left: 0; }
  /* Hero ".rer-grid" already collapses at 1080; the activity log just stacks under. */
  .log-card { position: static; }
  /* Modal sized down for phone landscape. */
  .modal { width: min(560px, 96vw); }
}

@media (max-width: 720px) {
  /* Topbar collapses progressively — drop the search, keep crumbs + bell + avatar. */
  .topbar .search { display: none; }
  .topbar { padding: 0 12px; }
  /* Hide the user text labels; keep just the avatar tap target. */
  .topbar .user { padding-left: 12px; }
  .topbar .user-name, .topbar .user-role { display: none; }
  /* Hero — total moves to its own line and the action buttons sit in a row. */
  .hero-top { gap: 14px; }
  .hero-amount { text-align: left; }
  .hero-amount .val { font-size: 24px; }
  /* Cards / cost-line tables — let the rows scroll horizontally inside the card. */
  .card .tbl, .card > .tbl-scroll > .tbl { font-size: 12.5px; }
  .tbl thead th, .tbl tbody td, .tbl tfoot td { padding: 10px 14px; }
  /* Recon strip wraps its chain underneath on tiny screens. */
  .recon { flex-wrap: wrap; }
  .recon .chain { margin-left: 0; width: 100%; }
  /* Form rows: stack each field to full width. */
  .form-row .fg { min-width: 100%; }
  /* Sticky form footer drops its sticky behaviour so buttons don't cover content. */
  form .card[style*="sticky"] { position: static !important; }
  /* Inner card padding tightens. */
  .card-head { padding: 14px 16px; }
  .card-body { padding: 16px; }
}

@media (max-width: 480px) {
  /* Sidebar drawer takes most of the screen. */
  .sidebar { width: 86vw; }
  /* Hero step rail labels truncate but stay visible. */
  .rlab { font-size: 11px; }
  .rline { min-width: 14px; margin: 0 8px; }
  /* Stack hero action buttons full-width so they're easy to tap. */
  .hero-actions .btn { flex: 1; justify-content: center; }
  /* Drop the ⌘K hint chip from the (hidden) search. */
  .kbd { display: none; }
  /* Tighter dense table cells. */
  table.data.dense tbody td, table.data.dense thead th { padding: 6px 8px; }
  /* Page-head action row stacks. */
  .page-head { flex-direction: column; align-items: stretch; }
  .page-actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-deco .t, .dash-hero .hero-tile, .action-pulse::after, .tab-pane { animation: none; }
}

/* --------------------- Bulk import pages --------------------------- */
/* Shared layout for the Excel/CSV import screens (events, training modules,
   …): a two-column upload + guide grid, plus the post-import results panel. */
.import-page .imp-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.import-page .imp-upload, .import-page .imp-guide { margin: 0; }
.import-page .imp-steps { margin: 4px 0 0; padding-left: 20px; }
.import-page .imp-steps li { margin-bottom: 8px; color: var(--ink-2, var(--ink)); line-height: 1.5; }
.import-page .imp-subh { margin: 20px 0 8px; }
.import-page .imp-cols td:first-child { font-weight: 600; white-space: nowrap; }
.import-page .imp-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--brand-50); color: var(--ink-2, var(--ink)); font-size: 12.5px; line-height: 1.5; }
.import-page .imp-note svg { width: 18px; height: 18px; flex: none; color: var(--brand-600); margin-top: 1px; }

.import-page .imp-result { margin-bottom: 16px; border-left: 4px solid var(--green-600); }
.import-page .imp-result.is-warn { border-left-color: var(--amber-600); }
.import-page .imp-result-head { display: flex; align-items: center; gap: 14px; }
.import-page .imp-result-ic { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--green-50); color: var(--green-700); }
.import-page .imp-result.is-warn .imp-result-ic { background: var(--amber-50, #fffbeb); color: var(--amber-700, #b45309); }
.import-page .imp-result-ic svg { width: 24px; height: 24px; }
.import-page .imp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.import-page .imp-stat { padding: 14px 16px; border-radius: 12px; background: var(--surface-2, #f7f8fa); border: 1px solid var(--line); }
.import-page .imp-stat .n { font-size: 24px; font-weight: 800; line-height: 1; }
.import-page .imp-stat .l { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; }
.import-page .imp-stat.ok .n { color: var(--green-700); }
.import-page .imp-stat.amber .n { color: var(--amber-700, #b45309); }
.import-page .imp-stat.red .n { color: var(--red-600); }
.import-page .imp-errors { margin: 4px 0 0; }
.import-page .imp-errors summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--ink-2, var(--ink)); }
.import-page .imp-errors ul { margin: 10px 0 0; padding-left: 18px; max-height: 260px; overflow: auto; }
.import-page .imp-errors li { margin-bottom: 5px; font-size: 12.5px; color: var(--ink-2, var(--ink)); }
.import-page .imp-result-foot { display: flex; gap: 10px; margin-top: 18px; }

@media (max-width: 900px) {
  .import-page .imp-grid { grid-template-columns: 1fr; }
}

/* ----------------------------- Print ------------------------------ */
@media print {
  .sidebar, .topbar, .hero-actions, .pane-actions, .collapse-btn, .action-card .tabs, .log-card,
  form.stack, [data-confirm] { display: none !important; }
  .app { display: block; }
  .content, .page-shell { max-width: none; padding: 0; }
  .card, .hero, .action-card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .tab-pane { display: block !important; }
  body { background: #fff; }
}
