/* ============================================================
   KCA Umalusi Command Centre — Main Stylesheet (v2)
   Brand: Dark Blue #1F3864 | Med Blue #2E75B6 | Light Blue #D6E4F0
   Modern redesign — login + dashboard
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand */
  --dark-blue:   #1F3864;
  --med-blue:    #2E75B6;
  --light-blue:  #D6E4F0;
  --midnight:    #0F1B3C;       /* deeper navy for hero gradients */
  --midnight-2:  #142447;

  /* Neutrals */
  --white:       #ffffff;
  --grey-bg:     #f5f7fa;
  --grey-border: #e0e6ed;
  --grey-text:   #6b7280;
  --grey-soft:   #f1f5f9;

  /* Status */
  --green:       #16a34a;
  --green-bg:    #dcfce7;
  --amber:       #d97706;
  --amber-bg:    #fef3c7;
  --red:         #dc2626;

  /* Text */
  --text:        #1a2332;
  --text-soft:   #475569;

  /* Tokens */
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --shadow:      0 1px 3px rgba(15,27,60,.08), 0 1px 2px rgba(15,27,60,.04);
  --shadow-md:   0 4px 14px rgba(15,27,60,.08), 0 2px 4px rgba(15,27,60,.04);
  --shadow-lg:   0 20px 40px rgba(15,27,60,.18), 0 8px 18px rgba(15,27,60,.10);
  --shadow-glow: 0 0 0 4px rgba(46,117,182,.12);

  /* Gradients */
  --gradient-brand:  linear-gradient(135deg, #1F3864 0%, #2E75B6 100%);
  --gradient-stripe: linear-gradient(90deg, #1F3864 0%, #2E75B6 50%, #D6E4F0 100%);
  --gradient-hero:   radial-gradient(ellipse at top, #1F3864 0%, #0F1B3C 60%, #07112B 100%);

  /* Easings */
  --ease-out: cubic-bezier(.2,.8,.2,1);

  /* Fonts */
  --font-sans:  'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Source Serif 4', 'Georgia', serif;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--grey-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--med-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  background: var(--gradient-hero);
  color: var(--white);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 14px rgba(15,27,60,.20);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.header-brand { display: flex; align-items: center; gap: 14px; }
.header-logo {
  background: var(--gradient-brand); color: white;
  font-weight: 800; font-size: 13px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  letter-spacing: .04em;
  box-shadow: 0 4px 14px rgba(46,117,182,.45);
}
.header-title { font-size: 15px; font-weight: 600; color: var(--light-blue); letter-spacing: .01em; }
.header-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: rgba(255,255,255,.78); padding: 8px 14px;
  border-radius: 7px; font-size: 13px; font-weight: 500;
  transition: background .2s, color .2s;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.10); color: white;
  text-decoration: none;
}
.nav-logout { color: rgba(255,255,255,.55); }
.nav-logout:hover { color: white; background: rgba(255,255,255,.08); }

/* ============================================================
   Layout
   ============================================================ */
.main-content { max-width: 1200px; margin: 0 auto; padding: 32px 28px 56px; }

/* ============================================================
   Page header
   ============================================================ */
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 28px;
  gap: 16px; flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-serif);
  font-size: 30px; font-weight: 700;
  color: var(--dark-blue);
  letter-spacing: -.01em;
  line-height: 1.15;
}
.page-sub   { font-size: 14px; color: var(--grey-text); margin-top: 4px; }
.back-link  { font-size: 13px; color: var(--grey-text); display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.back-link:hover { color: var(--med-blue); text-decoration: none; }

/* ============================================================
   LOGIN PAGE — dot cloud + glass card
   ============================================================ */
body.body-login { overflow: hidden; background: var(--midnight); }

.login-wrap {
  position: fixed; inset: 0;
  display: flex;
  align-items: center; justify-content: center;
  background: var(--gradient-hero);
  padding: 24px;
  overflow: hidden;
}

/* Dot cloud canvas */
#dotCloud {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Subtle SVG line-art glyphs */
.edu-svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}
.edu-float {
  transform-box: fill-box;
  transform-origin: center;
  animation: glyph-drift 24s ease-in-out infinite;
}
@keyframes glyph-drift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(0, -14px); }
}

/* The login card */
.login-card {
  position: relative;
  z-index: 10;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--radius-xl);
  padding: 44px 40px 36px;
  width: 100%; max-width: 420px;
  box-shadow:
    0 30px 60px rgba(7,17,43,.55),
    0 12px 28px rgba(7,17,43,.35),
    inset 0 1px 0 rgba(255,255,255,.6);
  overflow: hidden;
  animation: card-rise .8s var(--ease-out) both;
}
@keyframes card-rise {
  from { opacity: 0; transform: translateY(20px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Gradient stripe at top of card */
.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gradient-stripe);
  background-size: 200% 100%;
  animation: stripe-shift 8s ease-in-out infinite;
}
@keyframes stripe-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* KCA monogram badge */
.login-logo {
  background: var(--gradient-brand);
  color: white;
  font-weight: 800; font-size: 18px;
  letter-spacing: .04em;
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center; justify-content: center;
  margin: 0 auto 20px;
  box-shadow:
    0 10px 24px rgba(31,56,100,.35),
    inset 0 1px 0 rgba(255,255,255,.4);
  position: relative;
}
.login-logo::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(46,117,182,.25);
  animation: logo-pulse 3.5s ease-in-out infinite;
}
@keyframes logo-pulse {
  0%, 100% { transform: scale(1); opacity: .6; }
  50%      { transform: scale(1.06); opacity: 1; }
}

.login-heading {
  font-family: var(--font-serif);
  font-size: 24px; font-weight: 700;
  color: var(--dark-blue);
  text-align: center;
  letter-spacing: -.01em;
  margin-bottom: 4px;
}
.login-sub {
  font-size: 13px; color: var(--grey-text);
  text-align: center;
  margin-bottom: 4px;
}
.login-tagline {
  font-size: 11px; color: var(--med-blue);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .15em;
  font-weight: 600;
  margin-bottom: 28px;
}

/* Login form fields */
.login-card .form-group { margin-bottom: 18px; }
.login-card .form-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: 8px;
}
.login-card .form-input {
  background: rgba(245,247,250,.65);
  border: 1.5px solid var(--grey-border);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.login-card .form-input:focus {
  outline: none;
  background: white;
  border-color: var(--med-blue);
  box-shadow: var(--shadow-glow);
}

/* Sign-in button */
.login-card .btn-primary {
  background: var(--gradient-brand);
  background-size: 200% 100%;
  background-position: 0% 50%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(31,56,100,.30);
  transition: background-position .35s var(--ease-out), transform .15s, box-shadow .2s;
}
.login-card .btn-primary:hover {
  background-position: 100% 50%;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(31,56,100,.40);
}
.login-card .btn-primary:active {
  transform: translateY(0);
}

.login-foot {
  margin-top: 20px;
  text-align: center;
  font-size: 11px;
  color: var(--grey-text);
  letter-spacing: .04em;
}
.login-foot strong { color: var(--dark-blue); font-weight: 600; }

/* ============================================================
   Dashboard — overall card / hero
   ============================================================ */
.overall-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.overall-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gradient-stripe);
}
.overall-stats { display: flex; gap: 36px; margin-bottom: 18px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-number {
  font-family: var(--font-serif);
  font-size: 32px; font-weight: 700;
  color: var(--dark-blue);
  line-height: 1;
  letter-spacing: -.02em;
}
.stat-label {
  font-size: 11px; color: var(--grey-text);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 6px;
  font-weight: 600;
}
.stat-pct .stat-number { color: var(--med-blue); }

/* Progress bar */
.progress-bar-wrap {
  background: var(--grey-soft);
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
  position: relative;
}
.progress-bar-sm { height: 6px; margin-top: 6px; }
.progress-bar-fill {
  height: 100%;
  background: var(--gradient-brand);
  border-radius: 99px;
  transition: width .8s var(--ease-out);
  box-shadow: 0 0 8px rgba(46,117,182,.4);
}

/* ============================================================
   Section cards grid
   ============================================================ */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.section-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
  position: relative;
  transition: box-shadow .25s var(--ease-out), transform .25s var(--ease-out);
  color: var(--text);
  border: 1px solid var(--grey-border);
}
.section-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--section-colour, var(--dark-blue));
  border-radius: 0 4px 4px 0;
}
.section-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  text-decoration: none;
  border-color: transparent;
}
.section-card-header {
  padding: 20px 22px 12px 26px;
  display: flex; align-items: flex-start; gap: 12px;
}
.section-number {
  background: var(--section-colour, var(--dark-blue));
  color: white;
  font-weight: 700; font-size: 14px;
  min-width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(31,56,100,.18);
}
.section-title {
  font-size: 15px; font-weight: 600;
  color: var(--dark-blue);
  line-height: 1.35;
}
.section-card-body { padding: 0 22px 20px 26px; margin-top: auto; }
.section-progress-row {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--grey-text);
  margin-bottom: 6px;
}
.section-counts { font-weight: 500; }
.section-pct { font-weight: 700; color: var(--med-blue); }

/* ============================================================
   Doc tree
   ============================================================ */
.doc-tree { display: flex; flex-direction: column; gap: 14px; }

.subfolder {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--grey-border);
}
.subfolder-top { border-left: 3px solid var(--med-blue); }
.subfolder-header {
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(90deg, var(--light-blue) 0%, #eaf2fa 100%);
  font-weight: 600; font-size: 13px;
}
.subfolder-icon { font-size: 16px; }
.subfolder-name { flex: 1; color: var(--dark-blue); }
.subfolder-badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 99px;
}
.badge-complete { background: var(--green-bg); color: var(--green); }
.badge-partial  { background: var(--amber-bg); color: var(--amber); }
.badge-none     { background: var(--grey-soft); color: var(--grey-text); }

.subfolder-children { padding: 4px 0; }

/* ---- Doc row ---- */
.doc-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 12px 18px; gap: 12px;
  border-bottom: 1px solid var(--grey-border);
  transition: background .15s;
}
.doc-row:last-child { border-bottom: none; }
.doc-row:hover { background: #fafbfc; }
.doc-reviewed { background: #f0fdf4; }
.doc-reviewed:hover { background: #ecfdf5; }

.doc-info { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; }
.doc-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.doc-details { min-width: 0; }
.doc-name {
  font-size: 13px; font-weight: 500; color: var(--dark-blue);
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-name:hover { color: var(--med-blue); }
.doc-meta-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.doc-reviewer  { font-size: 11px; color: var(--green); font-weight: 600; }

/* ---- Document tags ---- */
.doc-tag {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
  white-space: nowrap; letter-spacing: .02em;
}
.tag-checklist { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.tag-template  { background: #fff9c4; color: #7b6000; border: 1px solid #f9c94e; }
.tag-excel     { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.tag-fill      { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.tag-kca       { background: #fce4ec; color: #b71c1c; border: 1px solid #ffcdd2; }

.doc-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.badge-reviewed {
  font-size: 11px; font-weight: 600;
  color: var(--green); background: var(--green-bg);
  padding: 3px 8px; border-radius: 99px;
  white-space: nowrap;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: 8px; font-size: 13px;
  font-weight: 600; cursor: pointer; border: none;
  transition: background .15s, opacity .15s, transform .12s, box-shadow .2s;
  font-family: inherit; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--med-blue); color: white; }
.btn-primary:hover { background: var(--dark-blue); }
.btn-secondary { background: var(--grey-soft); color: var(--text); border: 1px solid var(--grey-border); }
.btn-secondary:hover { background: #e6ebf2; }
.btn-outline   { background: white; color: var(--med-blue); border: 1.5px solid var(--med-blue); padding: 6px 14px; }
.btn-outline:hover { background: var(--light-blue); }
.btn-ghost     { background: transparent; color: var(--grey-text); padding: 4px 8px; font-size: 12px; }
.btn-ghost:hover { color: var(--red); background: #fff1f1; }
.btn-block     { width: 100%; }
.btn-sm  { padding: 7px 14px; font-size: 12px; }
.btn-xs  { padding: 3px 7px; font-size: 11px; border-radius: 4px; }

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600;
              color: var(--dark-blue); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--grey-border);
  border-radius: 6px; font-size: 14px; font-family: inherit;
  color: var(--text); background: white;
  transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--med-blue); }

/* ============================================================
   Alerts
   ============================================================ */
.alert { padding: 12px 16px; border-radius: 10px;
         font-size: 13px; margin-bottom: 18px;
         font-weight: 500; }
.alert-error {
  background: #fef2f2; color: var(--red);
  border: 1px solid #fecaca;
}
.login-card .alert-error {
  background: rgba(254,242,242,.85);
  backdrop-filter: blur(10px);
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,27,60,.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 16px;
}
.modal {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px;
  padding: 24px 28px;
}
.modal h3 {
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 12px;
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 20px;
}

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

/* ============================================================
   DASHBOARD v2 — hero ring, readiness, panels, search
   ============================================================ */

.page-header-actions { display: flex; gap: 8px; align-items: center; }

/* ---- Search ---- */
.search-wrap { position: relative; margin-bottom: 24px; }
.search-input-wrap {
  position: relative;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--grey-border);
  box-shadow: var(--shadow);
  display: flex; align-items: center;
  padding: 10px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.search-input-wrap:focus-within {
  border-color: var(--med-blue);
  box-shadow: var(--shadow-glow);
}
.search-icon { color: var(--grey-text); flex-shrink: 0; }
.search-input {
  flex: 1; border: none; outline: none;
  font-family: var(--font-sans);
  font-size: 14px; padding: 4px 12px;
  background: transparent; color: var(--text);
}
.search-input::placeholder { color: var(--grey-text); }
.search-kbd {
  background: var(--grey-soft); color: var(--grey-text);
  border: 1px solid var(--grey-border);
  font-family: var(--font-sans);
  font-size: 11px; padding: 2px 7px; border-radius: 4px;
  font-weight: 600;
}
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: white;
  border: 1px solid var(--grey-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: 360px; overflow-y: auto;
  z-index: 50;
}
.search-result {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--grey-border);
  transition: background .15s;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--grey-soft); text-decoration: none; }
.search-result-name { flex: 1; }
.search-result-name mark { background: #fff7c2; color: var(--dark-blue); font-weight: 600; padding: 0 2px; border-radius: 3px; }
.search-result-arrow { color: var(--grey-text); font-size: 14px; opacity: .5; }
.search-empty { padding: 16px; color: var(--grey-text); font-size: 13px; text-align: center; }

/* ---- Hero card ---- */
.hero-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 40px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--gradient-stripe);
}

/* ---- Progress ring ---- */
.hero-ring-wrap { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.hero-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--grey-soft); stroke-width: 14; }
.ring-fill {
  fill: none; stroke: url(#ringGrad); stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s var(--ease-out);
}
.ring-centre {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
}
.ring-pct {
  font-family: var(--font-serif);
  font-size: 44px; font-weight: 700;
  color: var(--dark-blue);
  line-height: 1;
  letter-spacing: -.02em;
}
.ring-label {
  font-size: 11px; color: var(--grey-text);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: 6px;
  font-weight: 600;
}
.ring-fraction {
  font-size: 13px; color: var(--text-soft);
  margin-top: 6px; font-weight: 500;
}

/* ---- Readiness ---- */
.hero-readiness { display: flex; flex-direction: column; gap: 18px; }
.readiness-headline {
  display: flex; align-items: center; gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--grey-border);
}
.readiness-score-wrap {
  display: flex; align-items: baseline;
  font-family: var(--font-serif);
  color: var(--med-blue);
  line-height: 1;
}
.readiness-score { font-size: 56px; font-weight: 700; letter-spacing: -.02em; }
.readiness-score-suffix { font-size: 28px; font-weight: 600; margin-left: 2px; }
.readiness-headline-text { display: flex; flex-direction: column; }
.readiness-title {
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 700;
  color: var(--dark-blue);
}
.readiness-sub { font-size: 12px; color: var(--grey-text); margin-top: 2px; }

.readiness-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
.readiness-row { display: flex; flex-direction: column; gap: 4px; }
.readiness-row-top {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-soft); font-weight: 500;
}
.readiness-row-top strong { color: var(--dark-blue); font-weight: 700; }
.readiness-bar { background: var(--grey-soft); height: 6px; border-radius: 99px; overflow: hidden; }
.readiness-bar-fill { height: 100%; border-radius: 99px; transition: width 1s var(--ease-out); }
.readiness-weight { font-size: 10px; color: var(--grey-text); text-transform: uppercase; letter-spacing: .06em; }

/* ---- Panel grid ---- */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.panel {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-border);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.panel-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--grey-border);
}
.panel-icon { font-size: 16px; }
.panel-title {
  font-family: var(--font-serif);
  font-size: 15px; font-weight: 700;
  color: var(--dark-blue);
  flex: 1;
}
.panel-count {
  font-size: 11px; font-weight: 700;
  color: var(--amber);
  background: var(--amber-bg);
  padding: 2px 8px; border-radius: 99px;
}
.panel-tabs {
  display: flex; gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--grey-border);
  background: var(--grey-soft);
}
.panel-tab {
  background: transparent; border: none;
  padding: 4px 10px; border-radius: 6px;
  font-family: inherit; font-size: 11px; font-weight: 600;
  color: var(--grey-text); cursor: pointer;
  transition: background .15s, color .15s;
}
.panel-tab:hover { color: var(--dark-blue); }
.panel-tab.active { background: white; color: var(--dark-blue); box-shadow: var(--shadow); }

.panel-body { padding: 8px 0; }
.panel-body-scroll { max-height: 420px; overflow-y: auto; }
.panel-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--grey-text);
  font-size: 13px;
}
.empty-icon { font-size: 28px; margin-bottom: 10px; }
.empty-hint { font-size: 11px; color: var(--grey-text); margin-top: 6px; }

.panel-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text);
  transition: background .15s;
}
.panel-item:hover { background: var(--grey-soft); text-decoration: none; }
.panel-item-name {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--dark-blue); font-weight: 500;
}
.panel-item-meta {
  font-size: 11px; color: var(--grey-text);
  flex-shrink: 0; white-space: nowrap;
}

.activity-item { align-items: flex-start; padding: 12px 20px; }
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--med-blue);
  box-shadow: 0 0 0 3px rgba(46,117,182,.15);
  margin-top: 5px; flex-shrink: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-line { font-size: 13px; color: var(--text); line-height: 1.4; }
.activity-line strong { color: var(--dark-blue); font-weight: 600; }
.activity-line span { color: var(--text-soft); }
.activity-when { font-size: 11px; color: var(--grey-text); margin-top: 2px; }

/* ---- Evidence panel ---- */
.evidence-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--grey-border);
}
.evidence-item:last-child { border-bottom: none; }
.evidence-meta { display: flex; align-items: center; gap: 8px; }
.evidence-ref {
  font-size: 11px; font-weight: 700;
  color: var(--med-blue);
  background: var(--light-blue);
  padding: 2px 7px; border-radius: 4px;
  letter-spacing: .03em;
}
.evidence-title {
  font-size: 13px; font-weight: 600;
  color: var(--dark-blue);
  margin-top: 4px; line-height: 1.4;
}
.evidence-desc {
  font-size: 12px; color: var(--text-soft);
  margin-top: 2px; line-height: 1.4;
}
.evidence-status-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
}
.evidence-status {
  font-family: inherit; font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--grey-border);
  background: white; color: var(--text);
  cursor: pointer;
}
.evidence-status:focus { outline: 2px solid var(--med-blue); outline-offset: 2px; }
.evidence-status-badge {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 99px;
  letter-spacing: .02em;
}
.evidence-badge-not_started { background: var(--grey-soft);   color: var(--grey-text); }
.evidence-badge-in_progress { background: var(--amber-bg);    color: var(--amber); }
.evidence-badge-done        { background: var(--green-bg);    color: var(--green); }
.evidence-badge-na          { background: #f1f5f9;            color: #475569; }
.evidence-done .evidence-title  { color: var(--green); }
.evidence-na .evidence-title    { color: var(--grey-text); text-decoration: line-through; opacity: .7; }

/* ---- Section grid heading ---- */
.section-grid-heading {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 18px;
  margin-top: 8px;
  letter-spacing: -.01em;
}

/* ---- Rich section card additions ---- */
.section-card-rich .section-gap-hint {
  font-size: 11px;
  color: var(--amber);
  margin-top: 10px;
  font-weight: 500;
  line-height: 1.4;
  padding: 4px 8px;
  background: var(--amber-bg);
  border-radius: 6px;
  display: inline-block;
}
.section-card-rich .section-chips {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 10px;
}
.chip {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.chip-checklist { background: #e3f2fd; color: #1565c0; }
.chip-template  { background: #fff9c4; color: #7b6000; }
.chip-fill      { background: #fff3e0; color: #e65100; }
.chip-kca       { background: #fce4ec; color: #b71c1c; }
.chip-excel     { background: #e8f5e9; color: #2e7d32; }

/* ---- Stagger fade-in ---- */
.section-card { animation: fade-up .5s var(--ease-out) both; }
.section-card:nth-child(1) { animation-delay: .05s; }
.section-card:nth-child(2) { animation-delay: .10s; }
.section-card:nth-child(3) { animation-delay: .15s; }
.section-card:nth-child(4) { animation-delay: .20s; }
.section-card:nth-child(5) { animation-delay: .25s; }
.section-card:nth-child(6) { animation-delay: .30s; }
.section-card:nth-child(7) { animation-delay: .35s; }
.section-card:nth-child(8) { animation-delay: .40s; }
.panel { animation: fade-up .5s var(--ease-out) both; }
.panel:nth-child(1) { animation-delay: .05s; }
.panel:nth-child(2) { animation-delay: .12s; }
.panel:nth-child(3) { animation-delay: .19s; }
.hero-card { animation: fade-up .6s var(--ease-out) both; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero-card { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
  .readiness-rows { grid-template-columns: 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .page-title { font-size: 24px; }
  .ring-pct { font-size: 36px; }
  .readiness-score { font-size: 44px; }
  .hero-card { padding: 18px; }
  .main-content { padding: 18px 14px 32px; }
}

/* ---- Spacing fix: panel grid below sections ---- */
.section-grid + .panel-grid,
.section-grid ~ .panel-grid {
  margin-top: 40px;
}

.panels-heading {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 22px;
  margin-top: 40px;
  letter-spacing: -.01em;
}

/* ---- Fix bottom spacing under Sections grid ---- */
.section-grid { margin-bottom: 48px; }

/* ---- Panel grid: 3 equal columns desktop, graceful collapse ---- */
.panel-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px !important;
  margin-bottom: 48px;
}
@media (max-width: 1000px) {
  .panel-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 700px) {
  .panel-grid { grid-template-columns: 1fr !important; }
}
.panel { min-width: 0; }

/* ============================================================
   NOTICE BOARD
   ============================================================ */
.board-composer {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-border);
  box-shadow: var(--shadow);
  padding: 16px 20px 20px;
  margin-bottom: 24px;
}
.board-composer-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.board-author-badge { display: flex; align-items: center; gap: 10px; }
.board-author-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient-brand); color: white;
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(31,56,100,.18);
}
.board-author-name { font-size: 13px; font-weight: 600; color: var(--dark-blue); }
.board-author-sub  { font-size: 11px; color: var(--grey-text); }
.board-composer-body {
  width: 100%;
  border: 1.5px solid var(--grey-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.board-composer-body:focus {
  outline: none;
  border-color: var(--med-blue);
  box-shadow: var(--shadow-glow);
}
.board-composer-row {
  display: flex; gap: 10px;
  margin-top: 12px; align-items: center;
}
.board-composer-cat { flex: 0 0 140px; }
.board-composer-ref { flex: 1; }

.board-list { display: flex; flex-direction: column; gap: 14px; }
.board-empty {
  background: white;
  border: 1px dashed var(--grey-border);
  border-radius: var(--radius-lg);
  padding: 48px 20px;
  text-align: center;
  color: var(--grey-text);
}

.board-card {
  background: white;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  transition: box-shadow .2s, transform .2s;
}
.board-card:hover { box-shadow: var(--shadow-md); }

.board-card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.board-card-meta { flex: 1; }
.board-card-author {
  font-size: 13px; font-weight: 700;
  color: var(--dark-blue);
}
.board-card-when {
  font-size: 11px; color: var(--grey-text);
  margin-top: 1px;
}

.board-cat-pill {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
  letter-spacing: .02em; text-transform: uppercase;
}
.cat-general    { background: #eff6ff; color: #2563eb; }
.cat-question   { background: #fef3c7; color: #d97706; }
.cat-done       { background: #dcfce7; color: #16a34a; }
.cat-section-1  { background: #e0e7ff; color: #4338ca; }
.cat-section-2  { background: #dbeafe; color: #1d4ed8; }
.cat-section-3  { background: #ccfbf1; color: #0f766e; }
.cat-section-4  { background: #fae8ff; color: #9333ea; }
.cat-section-5  { background: #f1f5f9; color: #475569; }

.doc-ref-pill {
  font-size: 11px; font-weight: 700;
  background: var(--light-blue);
  color: var(--med-blue);
  padding: 3px 8px; border-radius: 6px;
  letter-spacing: .02em;
}

.btn-ghost-x {
  background: transparent; border: none;
  color: var(--grey-text);
  font-size: 18px; line-height: 1;
  width: 24px; height: 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-ghost-x:hover { background: #fff1f1; color: var(--red); }

.board-card-body {
  font-size: 14px; line-height: 1.6;
  color: var(--text);
  padding: 4px 0 12px 46px;
  white-space: pre-wrap;
}
.doc-code-pill {
  background: var(--light-blue);
  color: var(--med-blue);
  padding: 1px 6px; border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  font-family: var(--font-sans);
  letter-spacing: .02em;
}

.reactions-row {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding-left: 46px;
}
.reaction-btn {
  background: var(--grey-soft);
  border: 1px solid var(--grey-border);
  border-radius: 20px;
  padding: 4px 10px;
  font-family: inherit; font-size: 13px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background .15s, border-color .15s, transform .12s;
}
.reaction-btn.no-count { opacity: .5; }
.reaction-btn:hover    { opacity: 1; transform: translateY(-1px); }
.reaction-btn.reacted {
  background: var(--light-blue);
  border-color: var(--med-blue);
  opacity: 1;
}
.reaction-emoji { font-size: 14px; }
.reaction-count {
  font-size: 11px; font-weight: 700;
  color: var(--dark-blue);
}

/* ---- Header nav icons + unread badge ---- */
.nav-link {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
}
.nav-icon {
  flex-shrink: 0;
  opacity: .85;
  transition: opacity .2s;
}
.nav-link:hover .nav-icon,
.nav-link.active .nav-icon { opacity: 1; }

.nav-board { position: relative; }
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 99px;
  margin-left: 4px;
  letter-spacing: .02em;
  box-shadow: 0 0 0 2px rgba(15,27,60,.6);
  position: relative;
}
.nav-badge::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 99px;
  border: 2px solid #ef4444;
  opacity: .65;
  animation: badge-pulse 1.6s ease-out infinite;
}
@keyframes badge-pulse {
  0%   { transform: scale(1);   opacity: .65; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Hide badge fully when there is nothing to notify — overrides earlier inline-flex */
.nav-badge[hidden] { display: none !important; }


/* ---- Latest-notice card on dashboard ---- */
.latest-notice-card {
  display: flex;
  align-items: stretch;
  gap: 16px;
  background: white;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 18px 14px 0;
  margin-bottom: 24px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.latest-notice-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--gradient-brand);
}
.latest-notice-card:hover {
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--med-blue);
}
.latest-notice-flag {
  align-self: stretch;
  display: flex; align-items: center;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--med-blue);
  padding: 0 6px 0 18px;
  white-space: nowrap;
}
.latest-notice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 2px 0; }
.latest-notice-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.latest-notice-head .board-author-avatar {
  width: 26px; height: 26px; font-size: 11px;
}
.latest-notice-meta {
  display: flex; flex-direction: column; line-height: 1.2;
  margin-right: 4px;
}
.latest-notice-meta strong {
  font-size: 13px; font-weight: 700; color: var(--dark-blue);
}
.latest-notice-when {
  font-size: 11px; color: var(--grey-text);
}
.latest-notice-text {
  font-size: 13px; line-height: 1.5;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-word;
}
.latest-notice-cta {
  align-self: center;
  font-size: 12px; font-weight: 700;
  color: var(--med-blue);
  white-space: nowrap;
  padding-left: 4px;
}
.latest-notice-card:hover .latest-notice-cta { color: var(--dark-blue); }

@media (max-width: 700px) {
  .latest-notice-card { flex-direction: column; padding: 14px 14px 14px 18px; }
  .latest-notice-flag { padding: 0; margin-bottom: 4px; }
  .latest-notice-cta { align-self: flex-start; }
}

/* ============================================================
   Accessibility size bump — applies everywhere EXCEPT login
   (login keeps its tighter sizing for the glass-card aesthetic)
   ============================================================ */

body:not(.body-login) {
  font-size: 15.5px;
}

/* Header */
body:not(.body-login) .header-title { font-size: 16.5px; }
body:not(.body-login) .nav-link     { font-size: 14.5px; }

/* Page header */
body:not(.body-login) .page-title { font-size: 32px; }
body:not(.body-login) .page-sub   { font-size: 15px; }

/* Hero card stats */
body:not(.body-login) .stat-number      { font-size: 36px; }
body:not(.body-login) .stat-label       { font-size: 12px; }
body:not(.body-login) .ring-pct         { font-size: 48px; }
body:not(.body-login) .ring-label       { font-size: 12px; }
body:not(.body-login) .ring-fraction    { font-size: 14px; }
body:not(.body-login) .readiness-score  { font-size: 60px; }
body:not(.body-login) .readiness-title  { font-size: 20px; }
body:not(.body-login) .readiness-sub    { font-size: 13px; }
body:not(.body-login) .readiness-row-top { font-size: 13px; }
body:not(.body-login) .readiness-weight  { font-size: 11px; }

/* Search */
body:not(.body-login) .search-input    { font-size: 15px; padding: 6px 12px; }
body:not(.body-login) .search-result   { font-size: 14px; }

/* Section grid */
body:not(.body-login) .section-grid-heading { font-size: 24px; }
body:not(.body-login) .section-title        { font-size: 16.5px; }
body:not(.body-login) .section-counts       { font-size: 13.5px; }
body:not(.body-login) .section-pct          { font-size: 13.5px; }
body:not(.body-login) .section-gap-hint     { font-size: 12.5px; }
body:not(.body-login) .chip                 { font-size: 11px; }

/* Panels — Activity, Recent, Evidence */
body:not(.body-login) .panels-heading       { font-size: 24px; }
body:not(.body-login) .panel-title          { font-size: 16px; }
body:not(.body-login) .panel-item           { font-size: 14.5px; padding: 11px 20px; }
body:not(.body-login) .panel-item-meta      { font-size: 12px; }
body:not(.body-login) .panel-tab            { font-size: 12px; padding: 5px 11px; }
body:not(.body-login) .panel-empty          { font-size: 14px; }

/* Activity feed */
body:not(.body-login) .activity-line        { font-size: 14.5px; }
body:not(.body-login) .activity-when        { font-size: 12px; }

/* Evidence items */
body:not(.body-login) .evidence-title       { font-size: 14.5px; }
body:not(.body-login) .evidence-desc        { font-size: 13px; }
body:not(.body-login) .evidence-ref         { font-size: 12px; }
body:not(.body-login) .evidence-status      { font-size: 13px; padding: 5px 9px; }
body:not(.body-login) .evidence-status-badge{ font-size: 11.5px; }

/* Subfolders + doc rows on section pages */
body:not(.body-login) .subfolder-header     { font-size: 14.5px; }
body:not(.body-login) .subfolder-badge      { font-size: 11.5px; }
body:not(.body-login) .doc-name             { font-size: 14.5px; }
body:not(.body-login) .doc-reviewer         { font-size: 12px; }
body:not(.body-login) .doc-tag              { font-size: 11px; }
body:not(.body-login) .badge-reviewed       { font-size: 12px; }

/* Latest notice card */
body:not(.body-login) .latest-notice-flag   { font-size: 11px; }
body:not(.body-login) .latest-notice-meta strong { font-size: 14.5px; }
body:not(.body-login) .latest-notice-when   { font-size: 12px; }
body:not(.body-login) .latest-notice-text   { font-size: 14.5px; }
body:not(.body-login) .latest-notice-cta    { font-size: 13px; }

/* Notice board */
body:not(.body-login) .board-author-name    { font-size: 14.5px; }
body:not(.body-login) .board-author-sub     { font-size: 12px; }
body:not(.body-login) .board-composer-body  { font-size: 15.5px; }
body:not(.body-login) .board-card-author    { font-size: 14.5px; }
body:not(.body-login) .board-card-when      { font-size: 12px; }
body:not(.body-login) .board-card-body      { font-size: 15.5px; line-height: 1.65; }
body:not(.body-login) .board-cat-pill       { font-size: 12px; }
body:not(.body-login) .doc-ref-pill         { font-size: 12px; }
body:not(.body-login) .reaction-btn         { font-size: 14px; padding: 5px 12px; }
body:not(.body-login) .reaction-emoji       { font-size: 16px; }
body:not(.body-login) .reaction-count       { font-size: 12px; }
body:not(.body-login) .doc-code-pill        { font-size: 13px; }

/* Buttons + forms (all non-login) */
body:not(.body-login) .btn         { font-size: 14.5px; padding: 10px 18px; }
body:not(.body-login) .btn-sm      { font-size: 13px;   padding: 8px 14px; }
body:not(.body-login) .btn-xs      { font-size: 12px;   padding: 4px 8px; }
body:not(.body-login) .form-input  { font-size: 15px; }
body:not(.body-login) .form-label  { font-size: 13.5px; }

/* Alerts */
body:not(.body-login) .alert       { font-size: 14px; }

/* Modals */
body:not(.body-login) .modal h3    { font-size: 20px; }
