/* =============================================================
   style.css — WCSH SBFR Self-Assessment Tool
   Part A: Base, Reset, Header, Hero, Login Page, Info Cards
   ============================================================= */

/* ---- Google Font ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary:      #2563eb;
  --primary-dark: #1d4ed8;
  --success:      #16a34a;
  --warning:      #ca8a04;
  --danger:       #dc2626;
  --purple:       #9333ea;
  --cyan:         #0891b2;
  --orange:       #ea580c;
  --indigo:       #4f46e5;

  --bg:           #f8fafc;
  --surface:      #ffffff;
  --border:       #e2e8f0;
  --border-light: #f1f5f9;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-light:   #94a3b8;

  --header-h:     64px;
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    16px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg:    0 8px 30px rgba(0,0,0,.12);

  --font:         'Inter', system-ui, sans-serif;
  --transition:   0.18s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: var(--font);
  background:  var(--bg);
  color:       var(--text);
  line-height: 1.6;
  min-height:  100vh;
}
a    { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img  { max-width: 100%; display: block; }
mark { background: #fef08a; padding: 0 2px; border-radius: 2px; }

/* ---- Typography ---- */
h1 { font-size: 2rem;   font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem;  font-weight: 600; }
p  { color: var(--text-muted); }

/* ---- Utility ---- */
.hidden { display: none !important; }

/* =============================================================
   HEADER
   ============================================================= */
.site-header {
  position:   sticky;
  top:        0;
  z-index:    100;
  height:     var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.header-inner {
  max-width:      1400px;
  margin:         0 auto;
  padding:        0 1.5rem;
  height:         100%;
  display:        flex;
  align-items:    center;
  justify-content: space-between;
  gap:            1rem;
}
.header-logo {
  display:     flex;
  align-items: center;
  gap:         .75rem;
}
.logo-mark {
  background:    var(--primary);
  color:         #fff;
  font-weight:   700;
  font-size:     .85rem;
  letter-spacing: .05em;
  padding:       .35rem .6rem;
  border-radius: var(--radius-sm);
  white-space:   nowrap;
}
.header-titles {
  display:        flex;
  flex-direction: column;
  line-height:    1.2;
}
.header-main {
  font-weight: 600;
  font-size:   .95rem;
  color:       var(--text);
}
.header-sub {
  font-size:  .75rem;
  color:      var(--text-muted);
}
.header-nav {
  display:     flex;
  align-items: center;
  gap:         .5rem;
  flex-wrap:   wrap;
}
.nav-link {
  padding:       .4rem .8rem;
  border-radius: var(--radius-sm);
  font-size:     .85rem;
  font-weight:   500;
  color:         var(--text-muted);
  transition:    background var(--transition), color var(--transition);
  border:        none;
  background:    none;
  cursor:        pointer;
  white-space:   nowrap;
}
.nav-link:hover { background: var(--bg); color: var(--primary); text-decoration: none; }
.btn-logout     { color: var(--danger); }
.btn-logout:hover { background: #fee2e2; color: var(--danger); }

/* =============================================================
   BUTTONS
   ============================================================= */
.btn {
  display:       inline-flex;
  align-items:   center;
  gap:           .4rem;
  padding:       .55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size:     .875rem;
  font-weight:   500;
  cursor:        pointer;
  border:        1px solid transparent;
  transition:    all var(--transition);
  white-space:   nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success  { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-outline  { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.btn-full     { width: 100%; justify-content: center; }
.btn-sm       { padding: .35rem .8rem; font-size: .8rem; }

/* =============================================================
   FORM ELEMENTS
   ============================================================= */
.input-field {
  width:         100%;
  padding:       .6rem .9rem;
  border:        1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size:     .9rem;
  font-family:   var(--font);
  color:         var(--text);
  background:    #fff;
  transition:    border-color var(--transition), box-shadow var(--transition);
  outline:       none;
}
.input-field:focus {
  border-color: var(--primary);
  box-shadow:   0 0 0 3px rgba(37,99,235,.12);
}
.input-label {
  display:     block;
  font-size:   .85rem;
  font-weight: 500;
  color:       var(--text);
  margin-bottom: .4rem;
}
.select-field {
  padding:       .55rem .9rem;
  border:        1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size:     .875rem;
  font-family:   var(--font);
  color:         var(--text);
  background:    #fff;
  cursor:        pointer;
  outline:       none;
  transition:    border-color var(--transition);
}
.select-field:focus { border-color: var(--primary); }

/* =============================================================
   TAGS & BADGES
   ============================================================= */
.tag {
  display:       inline-flex;
  padding:       .2rem .6rem;
  border-radius: 99px;
  font-size:     .75rem;
  font-weight:   500;
}
.tag-sm {
  display:       inline-flex;
  padding:       .15rem .5rem;
  border-radius: 99px;
  font-size:     .7rem;
  font-weight:   500;
}
.score-pill {
  display:       inline-flex;
  padding:       .25rem .7rem;
  border-radius: 99px;
  font-size:     .85rem;
  font-weight:   700;
}
.section-badge {
  color:         #fff;
  font-size:     .7rem;
  font-weight:   600;
  padding:       .2rem .55rem;
  border-radius: 4px;
  white-space:   nowrap;
}
.status-tag {
  font-size:     .75rem;
  font-weight:   500;
  padding:       .2rem .6rem;
  border-radius: 99px;
  white-space:   nowrap;
}
.status-final { background: #dcfce7; color: #15803d; }
.status-draft { background: #fef9c3; color: #854d0e; }
.status-none  { background: #f1f5f9; color: #64748b; }

/* =============================================================
   FILTER BUTTONS
   ============================================================= */
.filter-btn {
  padding:       .4rem .9rem;
  border:        1.5px solid var(--border);
  border-radius: 99px;
  font-size:     .8rem;
  font-weight:   500;
  cursor:        pointer;
  background:    #fff;
  color:         var(--text-muted);
  transition:    all var(--transition);
  white-space:   nowrap;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
  background:   var(--primary);
  border-color: var(--primary);
  color:        #fff;
}
.filter-label { font-size: .85rem; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.filter-wrap  { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.filter-btn-group { display: flex; flex-wrap: wrap; gap: .4rem; }

/* =============================================================
   MESSAGES
   ============================================================= */
.loading-msg {
  text-align: center;
  padding:    3rem 1rem;
  color:      var(--text-muted);
  font-size:  .95rem;
}
.error-msg {
  background:    #fee2e2;
  color:         var(--danger);
  border:        1px solid #fecaca;
  border-radius: var(--radius);
  padding:       .75rem 1rem;
  font-size:     .875rem;
}
.empty-state {
  text-align: center;
  padding:    4rem 1rem;
}
.empty-icon  { font-size: 3rem; margin-bottom: .75rem; }
.empty-title { font-size: 1.1rem; font-weight: 600; margin-bottom: .4rem; }
.empty-desc  { color: var(--text-muted); margin-bottom: 1.5rem; font-size: .9rem; }
.empty-msg   { text-align: center; padding: 1.5rem; color: var(--text-muted); font-size: .875rem; }

/* =============================================================
   HERO (shared across pages)
   ============================================================= */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #0891b2 100%);
  color:      #fff;
  padding:    3.5rem 1.5rem 4rem;
}
.hero-inner     { max-width: 900px; margin: 0 auto; text-align: center; }
.hero-title     { font-size: 2.5rem; font-weight: 800; color: #fff; margin-bottom: .75rem; }
.hero-desc      { font-size: 1.05rem; color: rgba(255,255,255,.85); margin-bottom: 2rem; }
.hero-stats     { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.stat-box       { background: rgba(255,255,255,.15); backdrop-filter: blur(8px);
                  border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius);
                  padding: 1rem 1.75rem; text-align: center; }
.stat-num       { display: block; font-size: 2rem; font-weight: 700; color: #fff; }
.stat-label     { font-size: .8rem; color: rgba(255,255,255,.8); text-transform: uppercase; letter-spacing: .06em; }

/* Page hero (requirements, dashboard) */
.page-hero      { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
                  color: #fff; padding: 2.5rem 1.5rem; }
.page-hero-inner { max-width: 1200px; margin: 0 auto; }
.page-hero-title { font-size: 1.75rem; color: #fff; margin-bottom: .5rem; }
.page-hero-desc  { font-size: .95rem; color: rgba(255,255,255,.85); max-width: 700px; }

/* =============================================================
   LOGIN PAGE
   ============================================================= */
.login-main {
  max-width: 860px;
  margin:    0 auto;
  padding:   2rem 1.5rem 4rem;
}
.login-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow:    var(--shadow-lg);
  padding:       2rem;
  margin-bottom: 2rem;
}
.step-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 1.25rem; color: var(--text); }

/* Department search */
.search-wrap { margin-bottom: .75rem; }

/* Department list */
.dept-list {
  max-height:     400px;
  overflow-y:     auto;
  border:         1px solid var(--border);
  border-radius:  var(--radius);
  background:     #fff;
}
.dept-group-label {
  padding:       .5rem 1rem;
  font-size:     .72rem;
  font-weight:   600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color:         var(--text-muted);
  background:    var(--bg);
  border-bottom: 1px solid var(--border-light);
  position:      sticky;
  top:           0;
}
.dept-item {
  display:       flex;
  align-items:   center;
  gap:           .75rem;
  padding:       .7rem 1rem;
  cursor:        pointer;
  border-bottom: 1px solid var(--border-light);
  transition:    background var(--transition);
}
.dept-item:last-child { border-bottom: none; }
.dept-item:hover { background: #eff6ff; }
.dept-type-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dept-item-name { flex: 1; font-size: .9rem; font-weight: 500; }
.dept-item-type { font-size: .75rem; color: var(--text-muted); }
.dept-arrow { color: var(--text-light); font-size: .85rem; }

/* Step 2 PIN */
.back-btn {
  background: none; border: none; cursor: pointer;
  color: var(--primary); font-size: .85rem; font-weight: 500;
  padding: 0; margin-bottom: 1rem; display: inline-flex; align-items: center; gap: .3rem;
}
.back-btn:hover { text-decoration: underline; }
.selected-dept-card { margin-bottom: 1.25rem; }
.sel-dept-inner {
  padding:       1rem 1.25rem;
  border-radius: var(--radius);
  background:    var(--bg);
  border:        1px solid var(--border);
}
.sel-dept-name { font-size: 1.05rem; font-weight: 600; margin-bottom: .3rem; }
.sel-dept-meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.sel-dept-section { font-size: .8rem; color: var(--text-muted); }
.pin-wrap { margin-bottom: 1rem; }
.pin-field { font-size: 1.2rem; letter-spacing: .2em; text-align: center; }
.pin-hint  { font-size: .78rem; color: var(--text-light); margin-top: .4rem; }

/* Info cards below login */
.info-cards {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap:                   1.25rem;
}
.info-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.5rem;
  text-align:    center;
  box-shadow:    var(--shadow);
}
.info-icon  { font-size: 2rem; margin-bottom: .75rem; }
.info-card h3 { margin-bottom: .5rem; font-size: 1rem; }
.info-card p  { font-size: .85rem; margin-bottom: 1rem; }

/* =============================================================
   FOOTER
   ============================================================= */
.site-footer {
  background:  var(--surface);
  border-top:  1px solid var(--border);
  text-align:  center;
  padding:     1.25rem;
  font-size:   .8rem;
  color:       var(--text-muted);
  margin-top:  auto;
}

/* =============================================================
   TOAST
   ============================================================= */
.toast {
  position:      fixed;
  bottom:        5.5rem;
  left:          50%;
  transform:     translateX(-50%);
  padding:       .75rem 1.5rem;
  border-radius: 99px;
  font-size:     .875rem;
  font-weight:   500;
  z-index:       999;
  box-shadow:    var(--shadow-lg);
  white-space:   nowrap;
  animation:     fadeIn .2s ease;
}
.toast-success { background: #166534; color: #fff; }
.toast-warn    { background: #854d0e; color: #fff; }
.toast-error   { background: var(--danger); color: #fff; }
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* =============================================================
   MODAL
   ============================================================= */
.modal-overlay {
  position:       fixed;
  inset:          0;
  background:     rgba(0,0,0,.45);
  z-index:        200;
  display:        flex;
  align-items:    center;
  justify-content: center;
  padding:        1rem;
}
.modal-box {
  background:    var(--surface);
  border-radius: var(--radius-lg);
  box-shadow:    var(--shadow-lg);
  padding:       2rem;
  max-width:     520px;
  width:         100%;
  max-height:    90vh;
  overflow-y:    auto;
}
.modal-title   { font-size: 1.2rem; margin-bottom: .5rem; }
.modal-desc    { font-size: .9rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; }
.modal-score-summary { background: var(--bg); border-radius: var(--radius); padding: 1rem; }
.modal-overall { text-align: center; margin-bottom: 1rem; }
.modal-overall-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.modal-overall-score { font-size: 3rem; font-weight: 800; line-height: 1.1; }
.modal-overall-sub   { font-size: .85rem; color: var(--text-muted); }
.modal-breakdown { border-top: 1px solid var(--border); padding-top: .75rem; }
.modal-breakdown-row {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  padding:         .35rem 0;
  font-size:       .83rem;
  border-bottom:   1px solid var(--border-light);
}
.modal-breakdown-row:last-child { border-bottom: none; }
.modal-breakdown-score {
  padding:       .15rem .5rem;
  border-radius: 99px;
  font-weight:   600;
  font-size:     .8rem;
}

/* END OF PART A — continue in Part B */
/* =============================================================
   style.css — Part B
   Assessment Page, Requirements Page, Dashboard Page,
   Progress Bar, Print Styles, Responsive
   ============================================================= */

/* =============================================================
   DEPT BANNER (assessment page)
   ============================================================= */
.dept-banner {
  background:  var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow:  0 1px 4px rgba(0,0,0,.05);
}
.banner-inner {
  max-width:       1400px;
  margin:          0 auto;
  padding:         .85rem 1.5rem;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             1rem;
  flex-wrap:       wrap;
}
.banner-left     { display: flex; align-items: center; gap: .85rem; }
.banner-dot      { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.banner-dept     { font-size: 1.05rem; font-weight: 700; }
.banner-meta     { font-size: .8rem; color: var(--text-muted); margin-top: .1rem; }
.banner-right    { text-align: right; }
.banner-score-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.banner-score-val   { font-size: 1.6rem; font-weight: 800; line-height: 1; }

/* =============================================================
   PROGRESS BAR
   ============================================================= */
.progress-bar-wrap  { background: var(--surface); border-bottom: 1px solid var(--border); }
.progress-bar-inner {
  max-width: 1400px;
  margin:    0 auto;
  padding:   .6rem 1.5rem;
}
.progress-info {
  display:         flex;
  justify-content: space-between;
  font-size:       .78rem;
  color:           var(--text-muted);
  margin-bottom:   .35rem;
}
.progress-track {
  height:        8px;
  background:    var(--border);
  border-radius: 99px;
  overflow:      hidden;
}
.progress-fill {
  height:        100%;
  background:    var(--primary);
  border-radius: 99px;
  transition:    width .4s ease;
}

/* =============================================================
   ASSESSMENT LAYOUT
   ============================================================= */
.assessment-layout {
  display:    flex;
  max-width:  1400px;
  margin:     0 auto;
  padding:    1.5rem 1.5rem 8rem;
  gap:        1.5rem;
  align-items: flex-start;
}

/* ---- Section Nav Sidebar ---- */
.section-nav {
  position:   sticky;
  top:        calc(var(--header-h) + 80px);
  width:      220px;
  flex-shrink: 0;
  background: var(--surface);
  border:     1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:    .75rem 0;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}
.section-nav-title {
  font-size:     .72rem;
  font-weight:   600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color:         var(--text-muted);
  padding:       0 .9rem .6rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: .4rem;
}
.sec-nav-item {
  display:    flex;
  flex-direction: column;
  padding:    .5rem .9rem;
  font-size:  .78rem;
  color:      var(--text-muted);
  border-left: 3px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}
.sec-nav-item:hover { background: var(--bg); color: var(--primary); text-decoration: none; }
.sec-nav-item.active {
  border-left-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
}
.sec-nav-num   { font-weight: 600; font-size: .72rem; }
.sec-nav-title { font-size: .75rem; line-height: 1.3; margin-top: .1rem; }
.sec-nav-badge {
  font-size:     .68rem;
  font-weight:   700;
  padding:       .1rem .4rem;
  border-radius: 99px;
  margin-top:    .2rem;
  width:         fit-content;
  background:    var(--bg);
  color:         var(--text-muted);
}

/* ---- Assessment Main ---- */
.assessment-main { flex: 1; min-width: 0; }

/* ---- SBFR Section ---- */
.sbfr-section {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow:      hidden;
  box-shadow:    var(--shadow);
}
.section-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         1rem 1.25rem;
  background:      var(--bg);
  border-bottom:   1px solid var(--border);
  gap:             1rem;
}
.section-header-left { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.section-title       { font-size: 1rem; font-weight: 600; }
.section-score {
  font-size:     1rem;
  font-weight:   700;
  padding:       .25rem .75rem;
  border-radius: 99px;
  background:    var(--bg);
  flex-shrink:   0;
}

/* ---- Column Labels ---- */
.criteria-col-labels {
  display:       grid;
  grid-template-columns: 1fr 120px 120px 160px;
  gap:           .5rem;
  padding:       .5rem 1.25rem;
  background:    #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size:     .72rem;
  font-weight:   600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color:         var(--text-muted);
}
.col-label-doc, .col-label-prac { text-align: center; }

/* ---- Change Intervention Block ---- */
.ci-block       { border-bottom: 2px solid var(--border-light); }
.ci-block:last-child { border-bottom: none; }
.ci-label {
  padding:     .6rem 1.25rem;
  font-size:   .78rem;
  font-weight: 600;
  color:       var(--primary);
  background:  #eff6ff;
  border-bottom: 1px solid var(--border-light);
}

/* ---- Criterion Row ---- */
.criterion-row {
  display:       grid;
  grid-template-columns: 1fr 120px 120px 160px;
  gap:           .5rem;
  padding:       .75rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  align-items:   start;
  transition:    background var(--transition);
}
.criterion-row:last-child { border-bottom: none; }
.criterion-row:hover { background: #fafbff; }
.criterion-req {
  display:    flex;
  gap:        .6rem;
  align-items: flex-start;
}
.criterion-idx {
  font-size:    .68rem;
  font-weight:  600;
  color:        var(--text-light);
  white-space:  nowrap;
  margin-top:   .15rem;
  flex-shrink:  0;
}
.criterion-text { font-size: .875rem; line-height: 1.5; }

/* ---- MET/UNMET Toggle ---- */
.criterion-toggle-cell { display: flex; justify-content: center; }
.toggle-group {
  display:        flex;
  flex-direction: column;
  gap:            .3rem;
  width:          100%;
}
.toggle-btn {
  padding:       .35rem .5rem;
  border-radius: var(--radius-sm);
  font-size:     .75rem;
  font-weight:   600;
  cursor:        pointer;
  border:        1.5px solid var(--border);
  background:    #fff;
  transition:    all var(--transition);
  text-align:    center;
  width:         100%;
}
.toggle-btn:hover   { opacity: .85; }
.met-btn:hover      { border-color: var(--success); color: var(--success); }
.unmet-btn:hover    { border-color: var(--danger);  color: var(--danger);  }
.active-met {
  background:   var(--success);
  border-color: var(--success);
  color:        #fff;
}
.active-unmet {
  background:   #fee2e2;
  border-color: var(--danger);
  color:        var(--danger);
}

/* ---- Remark ---- */
.remark-input {
  width:         100%;
  border:        1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding:       .4rem .6rem;
  font-size:     .8rem;
  font-family:   var(--font);
  color:         var(--text);
  resize:        vertical;
  outline:       none;
  transition:    border-color var(--transition);
}
.remark-input:focus { border-color: var(--primary); }

/* ---- Action Footer ---- */
.action-footer {
  position:    fixed;
  bottom:      0;
  left:        0;
  right:       0;
  background:  var(--surface);
  border-top:  1px solid var(--border);
  box-shadow:  0 -4px 16px rgba(0,0,0,.08);
  z-index:     90;
  padding:     .85rem 1.5rem;
}
.action-footer-inner {
  max-width:       1400px;
  margin:          0 auto;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             1rem;
  flex-wrap:       wrap;
}
.action-status { font-size: .83rem; color: var(--text-muted); }
.action-btns   { display: flex; gap: .75rem; }

/* =============================================================
   REQUIREMENTS PAGE
   ============================================================= */
.req-controls {
  background:  var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow:  0 1px 4px rgba(0,0,0,.05);
  position:    sticky;
  top:         var(--header-h);
  z-index:     80;
}
.req-controls-inner {
  max-width:   1400px;
  margin:      0 auto;
  padding:     .85rem 1.5rem;
  display:     flex;
  align-items: center;
  gap:         1rem;
  flex-wrap:   wrap;
}
.req-search-wrap { flex: 1; min-width: 200px; max-width: 320px; }
.req-filter-group { display: flex; align-items: center; gap: .5rem; }
.req-count { font-size: .8rem; color: var(--text-muted); white-space: nowrap; margin-left: auto; }
.req-main {
  max-width: 1400px;
  margin:    0 auto;
  padding:   1.5rem;
}
.req-section {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  overflow:      hidden;
  box-shadow:    var(--shadow);
}
.req-section-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         1rem 1.25rem;
  background:      var(--bg);
  cursor:          pointer;
  user-select:     none;
  gap:             1rem;
  transition:      background var(--transition);
}
.req-section-header:hover { background: #f1f5f9; }
.req-section-header-left  { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.req-section-title  { font-size: 1rem; font-weight: 600; }
.req-section-count  { font-size: .78rem; color: var(--text-muted); }
.req-collapse-icon  { font-size: .85rem; color: var(--text-muted); transition: transform var(--transition); }
.req-section-body   { padding: 0 1.25rem 1.25rem; }
.req-section-body.collapsed { display: none; }
.req-ci-block {
  margin-top:    1rem;
  border:        1px solid var(--border);
  border-radius: var(--radius);
  overflow:      hidden;
}
.req-ci-label {
  padding:     .6rem 1rem;
  font-size:   .78rem;
  font-weight: 600;
  color:       var(--primary);
  background:  #eff6ff;
  border-bottom: 1px solid var(--border-light);
}
.req-ci-applicable { padding: .4rem 1rem; display: flex; gap: .4rem; flex-wrap: wrap; background: #fafbff; border-bottom: 1px solid var(--border-light); }
.req-table  { width: 100%; border-collapse: collapse; }
.req-table th {
  text-align:    left;
  padding:       .5rem 1rem;
  font-size:     .72rem;
  font-weight:   600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color:         var(--text-muted);
  background:    var(--bg);
  border-bottom: 1px solid var(--border);
}
.req-row { border-bottom: 1px solid var(--border-light); transition: background var(--transition); }
.req-row:last-child { border-bottom: none; }
.req-row:hover { background: #fafbff; }
.req-table td { padding: .65rem 1rem; vertical-align: top; }
.td-id     { width: 90px; }
.td-applies { width: 160px; }
.req-id {
  font-size:     .72rem;
  background:    var(--bg);
  border:        1px solid var(--border);
  border-radius: 4px;
  padding:       .15rem .4rem;
  color:         var(--text-muted);
}
.td-req { font-size: .875rem; line-height: 1.5; }

/* =============================================================
   DASHBOARD PAGE
   ============================================================= */
.dash-last-updated { font-size: .8rem; color: rgba(255,255,255,.7); margin-top: .75rem; }

/* Summary cards */
.summary-cards {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap:                   1rem;
  max-width:             1400px;
  margin:                0 auto;
  padding:               1.5rem 1.5rem .5rem;
}
.summary-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.25rem;
  text-align:    center;
  box-shadow:    var(--shadow);
}
.summary-icon  { font-size: 1.5rem; margin-bottom: .4rem; }
.summary-val   { font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.summary-label { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }

/* Filters */
.dash-filters { background: var(--surface); border-bottom: 1px solid var(--border); padding: .75rem 1.5rem; }
.dash-filters-inner {
  max-width:   1400px;
  margin:      0 auto;
  display:     flex;
  align-items: center;
  gap:         .75rem;
  flex-wrap:   wrap;
}

/* Main layout */
.dash-main {
  display:    flex;
  gap:        1.5rem;
  max-width:  1400px;
  margin:     0 auto;
  padding:    1.5rem;
  align-items: flex-start;
}
.dash-leaderboard { flex: 1; min-width: 0; }
.dash-right { width: 340px; flex-shrink: 0; display: flex; flex-direction: column; gap: 1.25rem; }

/* Leaderboard table */
.leaderboard-table {
  width:          100%;
  border-collapse: separate;
  border-spacing: 0;
  background:     var(--surface);
  border:         1px solid var(--border);
  border-radius:  var(--radius-lg);
  overflow:       hidden;
  box-shadow:     var(--shadow);
}
.leaderboard-table th {
  text-align:    left;
  padding:       .7rem 1rem;
  font-size:     .72rem;
  font-weight:   600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color:         var(--text-muted);
  background:    var(--bg);
  border-bottom: 1px solid var(--border);
}
.lb-row { border-bottom: 1px solid var(--border-light); transition: background var(--transition); }
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: #fafbff; }
.leaderboard-table td { padding: .7rem 1rem; vertical-align: middle; }
.td-rank { width: 60px; text-align: center; }
.rank-medal { font-size: 1.4rem; }
.rank-num   { font-size: .9rem; font-weight: 700; color: var(--text-muted); }
.lb-dept-name { font-size: .9rem; font-weight: 600; }
.lb-dept-type { margin-top: .2rem; }
.td-score  { width: 80px; text-align: center; }
.td-bar    { width: 160px; }
.td-met    { width: 100px; font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.td-status { width: 120px; }
.lb-bar-track { background: var(--border); border-radius: 99px; height: 8px; overflow: hidden; }
.lb-bar-fill  { height: 100%; border-radius: 99px; transition: width .5s ease; }

/* Podium */
.podium-wrap {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.25rem;
  box-shadow:    var(--shadow);
}
.podium-title  { font-size: .85rem; font-weight: 600; text-align: center; margin-bottom: 1rem; color: var(--text-muted); }
.podium-stage  { display: flex; align-items: flex-end; justify-content: center; gap: .5rem; }
.podium-slot   { display: flex; flex-direction: column; align-items: center; flex: 1; }
.podium-dept-name { font-size: .72rem; font-weight: 600; text-align: center; margin-bottom: .3rem; line-height: 1.3; }
.podium-score  { font-size: .85rem; font-weight: 700; margin-bottom: .2rem; }
.podium-medal  { font-size: 1.4rem; margin-bottom: .2rem; }
.podium-block  { width: 100%; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
                 display: flex; align-items: center; justify-content: center; }
.podium-rank   { font-size: .75rem; font-weight: 700; color: var(--text-muted); }
.podium-empty  { text-align: center; color: var(--text-muted); font-size: .85rem; padding: 1rem; }

/* Chart */
.chart-wrap {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       1.25rem;
  box-shadow:    var(--shadow);
}
.chart-title     { font-size: .85rem; font-weight: 600; color: var(--text-muted); margin-bottom: .75rem; }
.chart-container { position: relative; height: 320px; }

/* =============================================================
   PRINT STYLES
   ============================================================= */
@media print {
  .site-header, .req-controls, .action-footer, .btn,
  .header-nav, .site-footer, .section-nav { display: none !important; }
  body     { background: #fff; font-size: 11pt; }
  .req-main, .assessment-layout { padding: 0; max-width: 100%; }
  .sbfr-section, .req-section { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .toggle-btn { border: 1px solid #999; }
  .active-met   { background: #d1fae5 !important; color: #065f46 !important; print-color-adjust: exact; }
  .active-unmet { background: #fee2e2 !important; color: #991b1b !important; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 1100px) {
  .dash-right       { width: 280px; }
  .assessment-layout { padding: 1rem; }
}

@media (max-width: 900px) {
  .dash-main        { flex-direction: column; }
  .dash-right       { width: 100%; }
  .assessment-layout { flex-direction: column; }
  .section-nav      { position: static; width: 100%; max-height: none;
                       display: flex; flex-wrap: wrap; gap: .3rem; padding: .5rem; }
  .sec-nav-item     { flex-direction: row; gap: .5rem; border-left: none;
                       border-bottom: 2px solid transparent; padding: .4rem .75rem;
                       border-radius: var(--radius-sm); }
  .sec-nav-item.active { border-bottom-color: var(--primary); border-left: none; }
  .criteria-col-labels,
  .criterion-row    { grid-template-columns: 1fr 100px 100px 120px; }
}

@media (max-width: 700px) {
  .hero-title       { font-size: 1.75rem; }
  .header-inner     { padding: 0 1rem; }
  .header-sub       { display: none; }
  .criteria-col-labels { display: none; }
  .criterion-row    { grid-template-columns: 1fr; gap: .75rem; }
  .criterion-toggle-cell { justify-content: flex-start; }
  .toggle-group     { flex-direction: row; }
  .toggle-btn       { flex: 1; }
  .leaderboard-table .td-bar,
  .leaderboard-table .td-met  { display: none; }
  .req-controls-inner { flex-direction: column; align-items: stretch; }
  .req-search-wrap  { max-width: 100%; }
  .action-footer-inner { flex-direction: column; align-items: stretch; }
  .action-btns      { flex-direction: column; }
  .summary-cards    { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .login-card       { padding: 1.25rem; }
  .modal-box        { padding: 1.25rem; }
  .hero-stats       { flex-direction: column; align-items: center; }
  .stat-box         { width: 100%; }
}

/* =============================================================
   MOBILE ASSESSMENT FORM
   Card-style layout for phones (under 700px)
   ============================================================= */

/* Hide/show helpers */
.mobile-only  { display: none; }
.desktop-only { display: flex; }

@media (max-width: 700px) {
  .mobile-only  { display: block; }
  .desktop-only { display: none !important; }

  /* ---- Criterion row becomes a card ---- */
  .criterion-row {
    display:       block;
    padding:       1rem;
    border-bottom: 2px solid var(--border-light);
    border-radius: 0;
    background:    #fff;
  }
  .criterion-row:last-child { border-bottom: none; }

  /* Requirement text */
  .criterion-req {
    margin-bottom: .85rem;
    align-items:   flex-start;
  }
  .criterion-idx {
    font-size:    .7rem;
    background:   var(--bg);
    border:       1px solid var(--border);
    border-radius: 4px;
    padding:      .1rem .35rem;
    margin-top:   .1rem;
  }
  .criterion-text {
    font-size:   .9rem;
    line-height: 1.55;
    font-weight: 500;
  }

  /* ---- Mobile toggle block ---- */
  .mobile-toggle-block {
    background:    var(--bg);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    padding:       .75rem;
    display:       flex;
    flex-direction: column;
    gap:           .65rem;
  }

  /* Each label + button pair row */
  .mobile-toggle-row {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             .75rem;
  }
  .mobile-toggle-label {
    font-size:   .8rem;
    font-weight: 600;
    color:       var(--text-muted);
    white-space: nowrap;
    min-width:   90px;
  }

  /* MET / UNMET button pair */
  .mobile-toggle-pair {
    display: flex;
    gap:     .4rem;
    flex:    1;
  }
  .mobile-btn {
    flex:          1;
    padding:       .6rem .5rem;
    border-radius: var(--radius-sm);
    font-size:     .82rem;
    font-weight:   600;
    cursor:        pointer;
    border:        1.5px solid var(--border);
    background:    #fff;
    transition:    all var(--transition);
    text-align:    center;
    min-height:    44px; /* iOS tap target */
  }
  .mobile-btn:active { transform: scale(.97); }

  /* Reuse existing active states */
  .mobile-btn.active-met {
    background:   var(--success);
    border-color: var(--success);
    color:        #fff;
  }
  .mobile-btn.active-unmet {
    background:   #fee2e2;
    border-color: var(--danger);
    color:        var(--danger);
  }
  .mobile-btn.met-btn:not(.active-met):hover {
    border-color: var(--success);
    color:        var(--success);
  }
  .mobile-btn.unmet-btn:not(.active-unmet):hover {
    border-color: var(--danger);
    color:        var(--danger);
  }

  /* Remark inside mobile block */
  .mobile-toggle-block .remark-input {
    margin-top: .1rem;
    font-size:  .82rem;
    min-height: 44px;
  }

  /* ---- Section header on mobile ---- */
  .section-header {
    flex-direction: column;
    align-items:    flex-start;
    gap:            .5rem;
    padding:        .85rem 1rem;
  }
  .section-score {
    font-size: .9rem;
    align-self: flex-end;
  }

  /* ---- CI label on mobile ---- */
  .ci-label {
    font-size: .75rem;
    padding:   .5rem 1rem;
  }

  /* ---- Assessment layout on mobile ---- */
  .assessment-layout { padding: .75rem .75rem 8rem; gap: 1rem; }

  /* ---- Section nav on mobile: horizontal scrollable strip ---- */
  .section-nav {
    width:          100%;
    display:        flex;
    flex-direction: row;
    flex-wrap:      nowrap;
    overflow-x:     auto;
    gap:            .3rem;
    padding:        .5rem .75rem;
    border-radius:  var(--radius);
    max-height:     none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .section-nav::-webkit-scrollbar { display: none; }
  .section-nav-title { display: none; }
  .sec-nav-item {
    flex-direction: row;
    gap:            .4rem;
    padding:        .4rem .75rem;
    border-radius:  99px;
    border:         1.5px solid var(--border);
    white-space:    nowrap;
    flex-shrink:    0;
    font-size:      .75rem;
  }
  .sec-nav-item.active {
    background:   var(--primary);
    border-color: var(--primary);
    color:        #fff;
  }
  .sec-nav-title { font-size: .75rem; }
  .sec-nav-badge { display: none; }

  /* ---- Action footer on mobile ---- */
  .action-footer { padding: .65rem 1rem; }
  .action-footer-inner { flex-direction: row; flex-wrap: wrap; gap: .5rem; }
  .action-status { font-size: .75rem; width: 100%; }
  .action-btns   { flex-direction: row; flex: 1; }
  .action-btns .btn { flex: 1; justify-content: center; padding: .6rem .5rem; font-size: .82rem; }

  /* ---- Progress bar on mobile ---- */
  .progress-bar-inner { padding: .5rem .75rem; }

  /* ---- Banner on mobile ---- */
  .banner-inner   { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .75rem 1rem; }
  .banner-right   { align-self: flex-end; }
  .banner-score-val { font-size: 1.25rem; }
}

/* ---- Tablet tweaks (701px–900px) ---- */
@media (min-width: 701px) and (max-width: 900px) {
  .criterion-row {
    grid-template-columns: 1fr 110px 110px 130px;
  }
  .criteria-col-labels {
    grid-template-columns: 1fr 110px 110px 130px;
  }
}

.verification-hint {
  display:     flex;
  gap:         .4rem;
  margin-top:  .5rem;
  padding:     .5rem .65rem;
  background:  #f0f9ff;
  border-left: 3px solid #0891b2;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  align-items: flex-start;
}
.verification-icon { font-size: .8rem; flex-shrink: 0; margin-top: .05rem; }
.verification-text { font-size: .78rem; color: #0c4a6e; line-height: 1.5; }