/* ================================================================
   PATERSON JOB EVALUATION — app.css
   Design: Navy/Gold authority palette + DM Sans + DM Serif Display
   Layout: Fixed topbar → sidebar + scrollable canvas
   ================================================================ */

/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: #F4F6FA;
  color: #374151;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Design tokens ────────────────────────────────────────────── */
:root {
  --navy:      #0C1E3C;
  --navy-2:    #172F5C;
  --navy-3:    #1E4080;
  --gold:      #C9A84C;
  --gold-light:#FBF3DC;
  --gold-border:#E8D48A;
  --teal:      #0F7B6C;
  --ink:       #111827;
  --mid:       #4B5563;
  --muted:     #9CA3AF;
  --border:    #E5E7EB;
  --surface:   #FFFFFF;
  --bg:        #F4F6FA;
  --danger:    #DC2626;
  --success:   #16A34A;
  --warn:      #D97706;
  --topbar-h:  58px;
  --sidebar-w: 256px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.09);
}

/* ── Typography ────────────────────────────────────────────────── */
h1 { font-family: 'DM Serif Display', serif; font-size: 1.75rem; color: var(--ink); line-height: 1.2; font-weight: 400; }
h2 { font-family: 'DM Serif Display', serif; font-size: 1.35rem; color: var(--ink); font-weight: 400; }
h3 { font-size: 1rem; font-weight: 600; color: var(--ink); }
p  { color: var(--mid); }
a  { color: var(--navy-3); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: 'Courier New', monospace; font-size: .82rem; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.1rem; border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-size: .875rem; font-weight: 500;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-2); text-decoration: none; }
.btn-outline  { background: #fff; color: var(--navy); border-color: var(--border); }
.btn-outline:hover { border-color: var(--navy-3); color: var(--navy-3); text-decoration: none; }
.btn-gold     { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.btn-gold:hover { background: #b8943e; text-decoration: none; }
.btn-block    { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Form elements ──────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .3rem; }
.field.span-2 { grid-column: span 2; }
label { font-size: .8rem; font-weight: 600; color: var(--navy); letter-spacing: .01em; }
label abbr { color: var(--danger); text-decoration: none; }
.opt { font-weight: 400; color: var(--muted); }
.field-hint { font-size: .78rem; color: var(--muted); margin-bottom: .25rem; line-height: 1.4; }
.wordcount-hint { font-size: .75rem; color: var(--muted); text-align: right; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select, textarea {
  width: 100%;
  padding: .5rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: .875rem;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--navy-3);
  box-shadow: 0 0 0 3px rgba(30,64,128,.1);
}
textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--navy); cursor: pointer; }

.check-label {
  display: flex; align-items: center; gap: .5rem;
  font-size: .875rem; color: var(--mid); cursor: pointer; font-weight: 400;
}

/* ── Grid ────────────────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

/* ── Flash / alerts ─────────────────────────────────────────────── */
.flash { padding: .75rem 1rem; border-radius: var(--radius); font-size: .875rem; margin-bottom: 1rem; }
.flash-error   { background: #FEF2F2; border: 1px solid #FECACA; color: var(--danger); }
.flash-success { background: #F0FDF4; border: 1px solid #BBF7D0; color: var(--success); }

/* ── Status tags ────────────────────────────────────────────────── */
.status-tag {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem; border-radius: 100px;
  font-size: .73rem; font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase;
}
.status-draft          { background: #F3F4F6; color: var(--mid); }
.status-in_progress    { background: #EFF6FF; color: #1D4ED8; }
.status-pending_supervisor { background: #FEF3C7; color: #92400E; }
.status-pending_admin    { background: #E0E7FF; color: #3730A3; }
.status-pending_approval { background: #FFFBEB; color: var(--warn); }
.status-approved       { background: #F0FDF4; color: var(--success); }
.status-rejected       { background: #FEF2F2; color: var(--danger); }

/* ── Grade pills ────────────────────────────────────────────────── */
.grade-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 24px; border-radius: 4px;
  font-size: .78rem; font-weight: 700;
  font-family: 'DM Serif Display', serif;
}
.grade-a { background: #F3F4F6; color: #374151; }
.grade-b { background: #ECFDF5; color: #065F46; }
.grade-c { background: #EFF6FF; color: #1E40AF; }
.grade-d { background: #F5F3FF; color: #5B21B6; }
.grade-e { background: #FFF7ED; color: #92400E; }
.grade-f { background: var(--navy); color: var(--gold); }

/* ═══════════════════════════════════════════════════════════
   AUTH PAGE
═══════════════════════════════════════════════════════════ */
.auth-bg {
  min-height: 100vh;
  display: flex;
  background: var(--navy);
}
.auth-shell { display: flex; width: 100%; min-height: 100vh; }

.auth-left {
  width: 420px; flex-shrink: 0;
  background: var(--navy-2);
  padding: 3.5rem 3rem;
  display: flex; flex-direction: column; gap: 1.5rem;
  position: relative; overflow: hidden;
}
.auth-left::after {
  content: ''; position: absolute;
  right: -80px; bottom: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(201,168,76,.08);
}
.auth-brand-mark {
  width: 52px; height: 52px; border-radius: 12px;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Serif Display', serif; font-size: 1.3rem; font-weight: 400;
}
.auth-title {
  font-family: 'DM Serif Display', serif;
  font-size: 2.4rem; color: #fff;
  line-height: 1.15; font-weight: 400;
}
.auth-tagline { color: rgba(255,255,255,.5); font-size: .9rem; line-height: 1.6; }
.auth-features { list-style: none; display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.auth-features li {
  color: rgba(255,255,255,.7); font-size: .85rem;
  padding-left: 1.25rem; position: relative;
}
.auth-features li::before {
  content: '◆'; position: absolute; left: 0;
  color: var(--gold); font-size: .5rem; top: .35rem;
}

.auth-right {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: var(--radius-lg);
  padding: 2.25rem; box-shadow: var(--shadow-md);
}
.auth-card-head {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1.75rem; padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.auth-logo {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--navy); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Serif Display', serif; font-size: .95rem;
  flex-shrink: 0;
}
.auth-card-head strong { display: block; color: var(--ink); font-size: .95rem; }
.auth-card-head span  { font-size: .8rem; color: var(--muted); }
.auth-card .field { margin-bottom: 1rem; }
.auth-card .btn-block { margin-top: .5rem; padding: .65rem; }
.auth-note { font-size: .75rem; color: var(--muted); margin-top: 1rem; text-align: center; }

/* ═══════════════════════════════════════════════════════════
   TOP BAR
═══════════════════════════════════════════════════════════ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h); z-index: 200;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.topbar-inner {
  max-width: 1600px; margin: 0 auto;
  height: 100%; padding: 0 1.5rem;
  display: flex; align-items: center; gap: 2rem;
}
.topbar-brand {
  display: flex; align-items: center; gap: .65rem;
  text-decoration: none; white-space: nowrap;
}
.topbar-logo {
  width: 34px; height: 34px; border-radius: 7px;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Serif Display', serif; font-size: .85rem;
}
.topbar-name { color: #fff; font-size: .9rem; font-weight: 600; }
.topbar-nav { display: flex; gap: .15rem; }
.tnav {
  padding: .3rem .75rem; border-radius: 6px;
  color: rgba(255,255,255,.55); font-size: .875rem;
  text-decoration: none; transition: all .15s;
}
.tnav:hover, .tnav-active { color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }
.tnav-out { color: rgba(255,255,255,.35); font-size: .8rem; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 600; font-family: 'DM Serif Display', serif;
}
.user-display { color: rgba(255,255,255,.7); font-size: .85rem; }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════════════════════ */
.page-wrap {
  max-width: 1300px; margin: 0 auto;
  padding: calc(var(--topbar-h) + 2rem) 1.75rem 3rem;
}
.page-hdr {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1.75rem; gap: 1rem;
}
.page-sub { color: var(--muted); font-size: .875rem; margin-top: .25rem; }

.stat-row {
  display: flex; gap: .75rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: .9rem 1.25rem;
  display: flex; flex-direction: column; gap: .15rem;
  min-width: 110px;
}
.stat-val { font-family: 'DM Serif Display', serif; font-size: 2rem; color: var(--ink); line-height: 1; }
.stat-lbl { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-draft    .stat-val { color: var(--mid); }
.stat-progress .stat-val { color: #1D4ED8; }
.stat-pending  .stat-val { color: var(--warn); }
.stat-approved .stat-val { color: var(--success); }

.tbar { display: flex; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tbar-search { flex: 1; min-width: 220px; }
.tbar-select { min-width: 180px; width: auto; }

.tbl-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tbl thead tr { background: #F9FAFB; border-bottom: 1.5px solid var(--border); }
.tbl th { padding: .7rem 1rem; text-align: left; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.tbl td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #F9FAFB; }
.td-main { font-weight: 600; color: var(--ink); }
.td-dept { color: var(--mid); font-size: .85rem; }
.td-date { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.td-analyst { color: var(--mid); font-size: .82rem; }
.td-na { color: var(--muted); }
.ref-code { color: var(--navy-3); font-size: .78rem; background: #EFF6FF; padding: .15rem .4rem; border-radius: 4px; }

.prog-bar-wrap {
  height: 5px; background: var(--border); border-radius: 3px;
  width: 80px; display: inline-block; vertical-align: middle; margin-right: .4rem;
}
.prog-bar { height: 100%; background: var(--gold); border-radius: 3px; transition: width .3s; }
.prog-pct { font-size: .75rem; color: var(--muted); }

.icon-btn { display: inline-flex; color: var(--muted); padding: .3rem; border-radius: 4px; transition: color .15s; }
.icon-btn:hover { color: var(--navy-3); }

.empty-state {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); text-align: center;
  padding: 4.5rem 2rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  color: var(--muted);
}
.empty-state svg { opacity: .3; }
.empty-state p { font-size: .95rem; }

/* ═══════════════════════════════════════════════════════════
   FORM PAGE LAYOUT
═══════════════════════════════════════════════════════════ */
body.form-page { overflow: hidden; }
.form-shell {
  display: flex;
  height: 100vh;
  padding-top: var(--topbar-h);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); }

.sb-inner {
  padding: 1.25rem 1rem 2rem;
  display: flex; flex-direction: column; gap: 1rem;
}

.sb-meta {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: .85rem; border-bottom: 1px solid var(--border);
}
.sb-ref-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: block; }
.sb-ref-val { font-size: .8rem; color: var(--navy-3); }

/* Progress ring */
.sb-progress {
  position: relative; width: 64px; margin: 0 auto;
}
.prog-ring { width: 64px; height: 64px; }
.prog-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: var(--ink);
}
.prog-center small { font-size: .55rem; font-weight: 400; color: var(--muted); }
.sb-prog-label { text-align: center; font-size: .72rem; color: var(--muted); margin-top: -.25rem; }

/* Section nav */
.sec-nav { display: flex; flex-direction: column; gap: .1rem; }
.sn {
  display: flex; align-items: center; gap: .55rem;
  padding: .4rem .6rem; border-radius: 6px;
  font-size: .78rem; color: var(--mid);
  text-decoration: none; transition: background .12s, color .12s;
  line-height: 1.3;
}
.sn:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.sn.sn-active { background: #EFF6FF; color: var(--navy-3); font-weight: 600; }
.sn-n {
  font-size: .65rem; font-weight: 700;
  width: 22px; height: 18px; border-radius: 4px;
  background: var(--bg); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .12s, color .12s;
}
.sn.sn-active .sn-n { background: var(--navy-3); color: #fff; }
.sn-gold .sn-n { background: var(--gold); color: var(--navy); }
.sn-gold { color: var(--navy); font-weight: 500; }

/* Sidebar actions */
.sb-actions {
  padding-top: .85rem; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: .5rem;
}
.save-indicator {
  min-height: 1.1rem; font-size: .72rem; text-align: center;
  border-radius: 4px; padding: .1rem .4rem; transition: all .2s;
}
.save-indicator.saving { color: var(--muted); }
.save-indicator.saved  { color: var(--success); background: #F0FDF4; }
.save-indicator.error  { color: var(--danger);  background: #FEF2F2; }

/* ── Form canvas ──────────────────────────────────────────── */
.form-canvas {
  flex: 1; overflow-y: auto; height: 100%;
  display: flex; flex-direction: column;
}
.form-canvas::-webkit-scrollbar { width: 6px; }
.form-canvas::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Title strip */
.form-title-strip {
  display: flex; justify-content: space-between; align-items: center;
  padding: .85rem 2rem;
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  flex-shrink: 0;
}
.fts-left { display: flex; align-items: center; gap: 1rem; }
.back-link {
  display: inline-flex; align-items: center; gap: .3rem;
  color: var(--muted); font-size: .8rem; text-decoration: none;
}
.back-link:hover { color: var(--navy-3); }
.fts-left h2 { font-size: 1rem; color: var(--ink); font-family: 'DM Sans', sans-serif; font-weight: 600; }
.fts-right { display: flex; align-items: center; gap: 1rem; }
.fts-saved { font-size: .75rem; color: var(--muted); }

/* ── Form sections ────────────────────────────────────────── */
.fsec {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin: 1.25rem 2rem;
  box-shadow: var(--shadow);
  scroll-margin-top: 10px;
}
.fsec-head {
  display: flex; align-items: flex-start; gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.1rem;
  border-bottom: 1.5px solid var(--border);
}
.fsec-num {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem; color: var(--border);
  line-height: 1; flex-shrink: 0; margin-top: .05rem;
}
.fsec-title h3 { margin-bottom: .2rem; }
.fsec-title p  { font-size: .83rem; color: var(--muted); line-height: 1.5; }

/* Paterson section accent */
.fsec-paterson {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 1px var(--gold-border), var(--shadow);
}

/* ── KPA table ──────────────────────────────────────────────── */
.kpa-grid { border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kpa-hdr {
  display: grid; grid-template-columns: 36px 1fr 82px;
  background: var(--navy); padding: .5rem .75rem;
  font-size: .7rem; font-weight: 700; color: rgba(255,255,255,.6);
  text-transform: uppercase; letter-spacing: .05em;
}
.kpa-row {
  display: grid; grid-template-columns: 36px 1fr 82px;
  border-bottom: 1px solid var(--border); align-items: center;
}
.kpa-row:last-of-type { border-bottom: none; }
.kpa-row:nth-child(odd) { background: #FAFBFC; }
.kpa-i {
  font-size: .78rem; font-weight: 700; color: var(--navy-3);
  text-align: center; padding: .5rem .25rem;
}
.kpa-desc, .kpa-pct {
  border: none; border-left: 1px solid var(--border);
  border-radius: 0; padding: .55rem .75rem;
  font-size: .875rem;
}
.kpa-desc:focus, .kpa-pct:focus { box-shadow: inset 0 0 0 2px var(--navy-3); z-index: 1; background: #F0F7FF; }
.kpa-pct { text-align: center; }
.kpa-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: .5rem .75rem;
  background: #F3F4F6; border-top: 1.5px solid var(--border);
  font-size: .8rem; font-weight: 700; color: var(--mid);
}
.kpa-total-val        { color: var(--ink); font-size: .9rem; }
.kpa-total-val.exact  { color: var(--success); }
.kpa-total-val.over   { color: var(--danger); }

/* ── Relationships table ──────────────────────────────────── */
.rel-grid { border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rel-hdr {
  display: grid; grid-template-columns: 190px 1fr 1fr;
  background: var(--navy); padding: .5rem .75rem;
  font-size: .7rem; font-weight: 700; color: rgba(255,255,255,.6);
  text-transform: uppercase; letter-spacing: .05em;
}
.rel-row {
  display: grid; grid-template-columns: 190px 1fr 1fr;
  border-bottom: 1px solid var(--border); align-items: center;
}
.rel-row:last-child { border-bottom: none; }
.rel-row:nth-child(odd) { background: #FAFBFC; }
.rel-type {
  padding: .6rem .75rem; font-size: .78rem; font-weight: 600;
  color: var(--navy); border-right: 1px solid var(--border);
  line-height: 1.35;
}
.rel-inp {
  border: none; border-left: 1px solid var(--border);
  border-radius: 0; padding: .55rem .75rem; font-size: .84rem;
}
.rel-inp:focus { box-shadow: inset 0 0 0 2px var(--navy-3); background: #F0F7FF; }

/* ── Paterson band blocks ─────────────────────────────────── */
.band-ref {
  display: grid; grid-template-columns: repeat(6,1fr);
  gap: .5rem; margin-bottom: 1.5rem;
}
.bref-chip {
  border-radius: 8px; padding: .65rem .5rem;
  text-align: center; border: 1.5px solid var(--border);
}
.bref-chip strong { display: block; font-family: 'DM Serif Display', serif; font-size: 1.3rem; line-height: 1; margin-bottom: .15rem; }
.bref-lvl { display: block; font-size: .67rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.bref-grd { display: block; font-size: .65rem; opacity: .65; margin-top: .1rem; }

.bref-chip.band-a { background: #F9FAFB; } .bref-chip.band-a strong,.bref-chip.band-a .bref-lvl { color: #4B5563; }
.bref-chip.band-b { background: #F0FDF4; } .bref-chip.band-b strong,.bref-chip.band-b .bref-lvl { color: #065F46; }
.bref-chip.band-c { background: #EFF6FF; } .bref-chip.band-c strong,.bref-chip.band-c .bref-lvl { color: #1E40AF; }
.bref-chip.band-d { background: #F5F3FF; } .bref-chip.band-d strong,.bref-chip.band-d .bref-lvl { color: #5B21B6; }
.bref-chip.band-e { background: #FFF7ED; } .bref-chip.band-e strong,.bref-chip.band-e .bref-lvl { color: #92400E; }
.bref-chip.band-f { background: var(--navy); border-color: var(--gold); }
.bref-chip.band-f strong,.bref-chip.band-f .bref-lvl { color: var(--gold); }
.bref-chip.band-f .bref-grd { color: rgba(201,168,76,.6); }

.bblock {
  border: 1.5px solid var(--border); border-radius: 10px;
  overflow: hidden; margin-bottom: .85rem;
}
.bblock-hdr {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem;
}
.bblock-letter {
  width: 30px; height: 30px; border-radius: 6px;
  background: rgba(255,255,255,.18); color: inherit;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Serif Display', serif; font-size: 1rem;
  flex-shrink: 0;
}
.bblock-title { font-size: .85rem; font-weight: 600; }

.bblock.band-a .bblock-hdr { background: #4B5563; color: #fff; }
.bblock.band-b .bblock-hdr { background: #065F46; color: #fff; }
.bblock.band-c .bblock-hdr { background: #1E40AF; color: #fff; }
.bblock.band-d .bblock-hdr { background: #5B21B6; color: #fff; }
.bblock.band-e .bblock-hdr { background: #92400E; color: #fff; }
.bblock.band-f .bblock-hdr { background: var(--navy); color: var(--gold); }

.bq {
  display: flex; border-top: 1px solid var(--border);
}
.bq-grade {
  width: 52px; flex-shrink: 0;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: .9rem;
  border-right: 1px solid var(--border);
  background: #FAFBFC;
  font-family: 'DM Serif Display', serif; font-size: .9rem; color: var(--navy-3);
}
.bq-content { flex: 1; padding: .85rem 1rem; }
.bq-q { font-size: .85rem; color: var(--ink); margin-bottom: .6rem; line-height: 1.5; }

/* Yes/No/Partial radio row */
.bq-yesno { display: flex; gap: 1rem; margin-bottom: .6rem; flex-wrap: wrap; }
.yn-label {
  display: flex; align-items: center; gap: .35rem;
  font-size: .8rem; color: var(--mid); cursor: pointer;
  padding: .3rem .6rem; border-radius: 5px;
  border: 1.5px solid var(--border); transition: all .12s;
}
.yn-label:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }
.yn-label input[type="radio"] { display: none; }

.bq-content textarea { font-size: .83rem; }

/* Grade box */
.grade-box {
  background: var(--gold-light); border: 1.5px solid var(--gold-border);
  border-radius: 10px; padding: 1.35rem 1.5rem; margin-top: 1.25rem;
}
.grade-box-hdr {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 700; color: var(--navy); font-size: .95rem;
  margin-bottom: 1.1rem; padding-bottom: .75rem;
  border-bottom: 1px solid var(--gold-border);
}

/* ── Sign-off cards ───────────────────────────────────────── */
.signoff-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.so-card {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: .75rem;
}
.so-role { font-weight: 700; font-size: .85rem; color: var(--navy); }

/* ── Mobile sticky bar ────────────────────────────────────── */
.mob-bar {
  display: none;
  position: sticky; bottom: 0;
  padding: .85rem 1rem; gap: .75rem;
  background: #fff; border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .sidebar { display: none; }
  body.form-page { overflow: auto; }
  .form-shell { display: block; }
  .form-canvas { height: auto; overflow: visible; }
  .fsec { margin: 1rem; }
  .form-title-strip { padding: .75rem 1rem; position: static; }
  .mob-bar { display: flex; }
  .signoff-cards { grid-template-columns: 1fr; }
  .band-ref { grid-template-columns: repeat(3,1fr); }
  .rel-hdr, .rel-row { grid-template-columns: 140px 1fr; }
  .rel-row .rel-inp:last-child, .rel-hdr span:last-child { display: none; }
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .band-ref { grid-template-columns: repeat(2,1fr); }
  .page-hdr { flex-direction: column; }
  .stat-row { gap: .5rem; }
  .stat-card { min-width: 90px; }
  .auth-shell { flex-direction: column; }
  .auth-left { width: 100%; padding: 2rem; }
  .auth-right { padding: 1.5rem; }
}

@media (max-width: 500px) {
  .kpa-hdr, .kpa-row { grid-template-columns: 28px 1fr 65px; }
  .topbar-nav { display: none; }
}

.sup-input-box {
  display: none; /* Hidden by default */
  background: #FFFBEB;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px dashed #FCD34D;
  margin-top: 1rem;
}
.sup-input-box.is-visible {
  display: block;
}
.toggle-sup-btn {
  font-size: 0.75rem;
  color: #92400E;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 0.5rem;
  display: inline-block;
}

/* Ensure the entire document chain allows vertical growth */
html, body {
    height: auto !important;
    min-height: 100vh;
    overflow-y: auto !important;
}

.form-shell {
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
}

#formCanvas {
    height: auto !important;
    overflow: visible !important;
    padding-bottom: 100px; /* Ensures the last section isn't cut off by the mobile bar */
}
