/* ============================================================
   Usha Armour — Onboarding & Training Manifest
   v4 design: modern SaaS dashboard, cool lavender palette, left sidebar nav
   ============================================================ */

:root {
  --ink:          #F3F4F6;
  --ink-soft:     #9FA6B2;
  --muted:        #5A606D;
  --paper:        #0A0A0D;
  --surface:      #13141A;
  --line:         rgba(255, 255, 255, 0.06);
  --line-strong:  rgba(255, 255, 255, 0.12);

  --red:          #920E18;
  --red-dark:     #B81D24;
  --red-tint:     rgba(146, 14, 24, 0.15);

  --green:        #10B981;
  --green-tint:   rgba(16, 185, 129, 0.15);

  --amber:        #F59E0B;
  --amber-tint:   rgba(245, 158, 11, 0.12);

  --blue:         #3B82F6;
  --blue-tint:    rgba(59, 130, 246, 0.12);

  --gray:         #9CA3AF;
  --gray-tint:    rgba(156, 163, 175, 0.12);

  --teal:         #14B8A6;
  --teal-tint:    rgba(20, 184, 166, 0.12);

  --plum:         #A855F7;
  --plum-tint:    rgba(168, 85, 247, 0.12);

  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'IBM Plex Mono', 'SF Mono', monospace;

  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    16px;
  --shadow-card:  0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-pop:   0 20px 60px rgba(0, 0, 0, 0.5);

  --header-h:     64px;
  --heading:      #fff;

  color-scheme: dark;
}

/* Night is the default look; day mode overrides the same variable set so
   every surface that already reads var(--ink)/var(--paper)/etc. adapts
   automatically instead of needing per-component light-mode rules. */
:root[data-theme="light"] {
  --ink:          #14161B;
  --ink-soft:     #5B6472;
  --muted:        #AEB4BF;
  --paper:        #EEF0F3;
  --surface:      #FFFFFF;
  --line:         rgba(10, 14, 25, 0.08);
  --line-strong:  rgba(10, 14, 25, 0.16);
  --heading:      #14161B;
  --shadow-card:  0 4px 20px rgba(15, 23, 42, 0.10);
  --shadow-pop:   0 20px 60px rgba(15, 23, 42, 0.18);

  color-scheme: light;
}

body, .topbar, .subnav, .app-body, .btn-ghost, .btn-header-icon {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  display: grid;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
  grid-template-rows: var(--header-h) 1fr;
  grid-template-columns: 240px 1fr;
  height: 100vh;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

a:focus-visible, button:focus-visible, select:focus-visible,
input:focus-visible, [tabindex]:focus-visible {
  outline: 2.5px solid var(--red);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  grid-area: topbar;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo { height: 36px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--font-display);
  color: var(--heading);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.brand-tagline {
  color: var(--red);
  font-size: 9.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 600;
}
.app-title {
  flex: 1;
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}
.app-title h1 {
  color: var(--heading);
  font-size: 17px;
  letter-spacing: .01em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-title p { margin: 2px 0 0; color: var(--ink-soft); font-size: 11px; }

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--line-strong);
  color: var(--ink-soft);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-ghost:hover { background: rgba(255,255,255,.05); border-color: var(--ink); color: var(--ink); }

.btn-header-icon {
  background: transparent;
  border: 1.5px solid var(--line-strong);
  color: var(--ink-soft);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.btn-header-icon:hover { background: rgba(255,255,255,.05); border-color: var(--ink); color: var(--ink); }
.btn-header-icon.is-loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#themeToggle .icon-moon { display: block; }
#themeToggle .icon-sun { display: none; }
:root[data-theme="light"] #themeToggle .icon-moon { display: none; }
:root[data-theme="light"] #themeToggle .icon-sun { display: block; }

/* ============================================================
   App body — sidebar + main
   ============================================================ */
.app-body {
  grid-area: main;
  display: flex;
  overflow: hidden;
  background: var(--paper);
}

/* ============================================================
   Sidebar (Left Vertical Navigation)
   ============================================================ */
.subnav {
  grid-area: sidebar;
  width: 240px;
  height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 24px 16px;
  gap: 8px;
  flex-shrink: 0;
  z-index: 40;
  overflow-y: auto;
}
.subnav-item[hidden] { display: none; }
.subnav-item {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0 16px;
  gap: 12px;
  transition: all 0.12s ease;
}
.subnav-item::before {
  content: '';
  width: 18px;
  height: 18px;
  background-color: currentColor;
  display: inline-block;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  flex-shrink: 0;
}
.subnav-item[data-tab="input"]::before {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>');
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>');
}
.subnav-item[data-tab="dashboard"]::before {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg>');
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg>');
}
.subnav-item[data-tab="vacancies"]::before {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="7" width="20" height="14" rx="2" ry="2"></rect><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"></path></svg>');
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="7" width="20" height="14" rx="2" ry="2"></rect><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"></path></svg>');
}
.subnav-item[data-tab="retraining"]::before {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"></polyline><polyline points="1 20 1 14 7 14"></polyline><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path></svg>');
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"></polyline><polyline points="1 20 1 14 7 14"></polyline><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path></svg>');
}
.subnav-item[data-tab="probation"]::before {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="3" width="16" height="18" rx="2"></rect><path d="M9 3v3h6V3"></path><path d="M8.5 13.5l2.5 2.5 4.5-4.5"></path></svg>');
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="3" width="16" height="18" rx="2"></rect><path d="M9 3v3h6V3"></path><path d="M8.5 13.5l2.5 2.5 4.5-4.5"></path></svg>');
}
.subnav-item[data-tab="settings"]::before {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>');
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>');
}
.subnav-item:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.subnav-item.active { border-left-color: var(--red); background: var(--red-tint); color: var(--heading); font-weight: 600; }

/* ============================================================
   Main content area
   ============================================================ */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 60px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   Input tab — new hire form
   ============================================================ */
.input-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  max-width: 800px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
  border-top: 5px solid var(--red);
  margin: 0 auto 24px;
}
.input-card-body { padding: 32px 36px 36px; }
.input-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 6px;
}
.input-card-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 24px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 24px; }
.form-field-wide { grid-column: 1 / -1; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field > span:first-child {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  display: inline-block;
  margin-bottom: 2px;
}
.form-field .req { color: var(--red); }
.form-field input, .form-field select {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  height: 44px;
  background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.form-field input:focus, .form-field select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200,16,46,.1);
}

/* Product line checkbox pill group */
.pl-group {
  display: flex;
  gap: 8px;
  height: 46px;
}
.pl-group input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.pl-group > label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink-soft);
  background: var(--surface);
  user-select: none;
  position: relative;
  transition: border-color .12s, background .12s, color .12s, box-shadow .12s;
}
.pl-group > label:hover { border-color: var(--ink-soft); background: var(--paper); }
.pl-group input[type="checkbox"]:checked + label[data-line="EMS"]  { background: var(--blue);  border-color: var(--blue);  color: #fff; box-shadow: 0 2px 8px rgba(46,95,170,.25); }
.pl-group input[type="checkbox"]:checked + label[data-line="LSHR"] { background: var(--amber); border-color: var(--amber); color: #fff; box-shadow: 0 2px 8px rgba(156,102,3,.25); }
.pl-group input[type="checkbox"]:checked + label[data-line="FSS"]  { background: var(--teal);  border-color: var(--teal);  color: #fff; box-shadow: 0 2px 8px rgba(14,139,134,.25); }
.pl-group input[type="checkbox"]:checked + label[data-line="LOTO"] { background: var(--plum);  border-color: var(--plum);  color: #fff; box-shadow: 0 2px 8px rgba(123,63,158,.25); }
.pl-group input[type="checkbox"]:checked + label[data-line="ALL"]  { background: var(--red);   border-color: var(--red);   color: #fff; box-shadow: 0 2px 8px rgba(146,14,24,.25); }
.pl-group input[type="checkbox"]:focus-visible + label {
  outline: 2.5px solid var(--red);
  outline-offset: 2px;
}
.pl-group input[type="checkbox"]:checked + label::after {
  content: '✓';
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 8px;
  opacity: .75;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.btn-primary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--red);
  border: none;
  border-radius: var(--radius-md);
  padding: 0 30px;
  height: 46px;
  cursor: pointer;
  transition: background .12s, transform .08s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:active { transform: scale(.98); }
.form-hint { font-size: 12px; color: var(--muted); }

/* ============================================================
   Training legend
   ============================================================ */
.training-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.training-legend:empty { display: none; }
.legend-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  font-weight: 600;
  margin-right: 4px;
}
.legend-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-soft); }
.legend-code {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: var(--paper);
  border-radius: 4px;
  padding: 2px 5px;
}

/* ============================================================
   Department tabs
   ============================================================ */
.dept-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.dept-tab {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: background .12s, border-color .12s, color .12s;
}
.dept-tab:hover { border-color: var(--line-strong); color: var(--ink); }
.dept-tab.active { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.dept-tab .count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  border-radius: 20px;
  padding: 1px 7px;
}
.dept-tab:not(.active) .count { background: var(--paper); color: var(--muted); }

/* ============================================================
   Toolbar
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  flex: 1;
  min-width: 220px;
  max-width: 400px;
  color: var(--muted);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: border-color .12s;
}
.search-field:focus-within { border-color: var(--red); }
.search-field input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: transparent;
}
#statusFilter, #vacStatusFilter {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink-soft);
  background: var(--surface);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.toolbar-count {
  font-size: 12.5px;
  color: var(--muted);
  margin-left: auto;
  font-family: var(--font-mono);
}

/* ============================================================
   Tables
   ============================================================ */
.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 4px;
}
table.roster { width: 100%; border-collapse: collapse; min-width: 980px; }
table.roster th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 700;
  padding: 11px 14px;
  border-bottom: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}
table.roster td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  vertical-align: middle;
}
table.roster tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
table.roster tbody tr:last-child td { border-bottom: none; }

td.col-sl { font-family: var(--font-mono); color: var(--muted); font-size: 11.5px; width: 36px; }
td.col-name { font-weight: 600; min-width: 140px; }
td.col-date { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); white-space: nowrap; }

.editable {
  border-radius: 5px;
  padding: 3px 6px;
  margin: -3px -6px;
  cursor: text;
  min-width: 24px;
  display: inline-block;
  transition: background .1s;
}
.editable:hover { background: var(--paper); }
.editable:focus { background: var(--surface); outline: 1.5px solid var(--red); box-shadow: 0 0 0 3px rgba(200,16,46,.08); }
.editable:empty::before { content: attr(data-placeholder); color: var(--muted); font-style: italic; }

input.date-input {
  border: 1px solid transparent;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  padding: 3px 5px;
  background: transparent;
  width: 112px;
  transition: background .1s, border-color .1s;
}
input.date-input:hover { background: var(--paper); }
input.date-input:focus { background: var(--surface); border-color: var(--red); outline: none; }

td select {
  border: 1px solid transparent;
  border-radius: 5px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 4px 6px;
  background: transparent;
  cursor: pointer;
}
td select:hover { background: var(--paper); }
td select:focus { background: var(--surface); border-color: var(--red); outline: none; }

.no-training { color: var(--muted); font-size: 12.5px; }

.schedule-prompt-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-tint);
  border: 1.3px dashed rgba(245, 158, 11, 0.4);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .1s, border-color .1s;
}
.schedule-prompt-btn:hover { background: #ffe9bf; border-color: var(--amber); }

/* Training stamps */
.training-cell { min-width: 260px; }
.stamp-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.stamp {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: .02em;
  width: 40px;
  height: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  border-radius: 5px;
  border: 1.3px dashed var(--line-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: transform .1s, background .12s, border-color .12s;
}
.stamp:hover { transform: translateY(-1px); border-color: var(--ink-soft); }
.stamp-code  { font-size: 9.5px; }
.stamp-score { font-size: 9.5px; opacity: .85; }
.stamp.not-started { border-style: dashed; color: var(--muted); }
.stamp.poor  { border-style: solid; border-color: var(--red);   background: var(--red-tint);   color: var(--red-dark); }
.stamp.fair  { border-style: solid; border-color: var(--amber); background: var(--amber-tint); color: var(--amber); }
.stamp.good  { border-style: solid; border-color: var(--blue);  background: var(--blue-tint);  color: var(--blue); }
.stamp.great { border-style: solid; border-color: var(--green); background: var(--green-tint); color: var(--green); }
.stamp-retraining { box-shadow: 0 0 0 1.5px var(--red); }

/* ============================================================
   Avg score badge
   ============================================================ */
.avg-score-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  min-width: 34px;
  text-align: center;
}
.avg-score-badge.not-started { background: var(--gray-tint); color: var(--muted); }
.avg-score-badge.poor  { background: var(--red-tint);   color: var(--red-dark); }
.avg-score-badge.fair  { background: var(--amber-tint); color: var(--amber); }
.avg-score-badge.good  { background: var(--blue-tint);  color: var(--blue); }
.avg-score-badge.great { background: var(--green-tint); color: var(--green); }

/* ============================================================
   Vacancy KPI tiles
   ============================================================ */
.vac-kpi-row {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.vac-kpi-tile {
  flex: 1 1 160px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vac-kpi-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}
.vac-kpi-label {
  font-size: 12.5px;
  color: var(--ink-soft);
}
.vac-kpi-tile-alert {
  border-color: rgba(146, 14, 24, 0.35);
}
.vac-kpi-tile-alert .vac-kpi-value {
  color: var(--red-dark);
}

/* ============================================================
   Status chip
   ============================================================ */
.status-chip select {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  border: 1.5px solid transparent;
  border-radius: 20px;
  padding: 5px 26px 5px 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 9px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'><path d='M0 0l5 6 5-6z' fill='%237B7A92'/></svg>");
  min-width: 128px;
}
.status-chip[data-status="Completed"] select    { background-color: var(--green-tint); color: var(--green); border-color: rgba(16, 185, 129, 0.25); }
.status-chip[data-status="Hired"] select         { background-color: var(--green-tint); color: var(--green); border-color: rgba(16, 185, 129, 0.25); }
.status-chip[data-status="In Progress"] select   { background-color: var(--blue-tint);  color: var(--blue);  border-color: rgba(59, 130, 246, 0.25); }
.status-chip[data-status="Shortlisted"] select   { background-color: var(--blue-tint);  color: var(--blue);  border-color: rgba(59, 130, 246, 0.25); }
.status-chip[data-status="Needs Attention"] select { background-color: var(--amber-tint); color: var(--amber); border-color: rgba(245, 158, 11, 0.25); }
.status-chip[data-status="On Hold"] select        { background-color: var(--gray-tint);  color: var(--gray);  border-color: var(--line); }
.status-chip[data-status="Left Organisation"] select { background-color: var(--red-tint); color: var(--red); border-color: rgba(146, 14, 24, 0.25); }
.status-chip[data-status="Absconded"] select      { background-color: var(--red-tint); color: var(--red-dark); border-color: rgba(146, 14, 24, 0.25); font-weight: 700; }
.status-chip[data-status="Closed"] select         { background-color: var(--gray-tint);  color: var(--gray);  border-color: var(--line); }

/* ============================================================
   Product line chips — in table cells
   ============================================================ */
.pl-chips-cell {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 110px;
}
.pl-table-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 8px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.pl-table-chip[data-line="EMS"]  { background: var(--blue-tint);  color: var(--blue);  }
.pl-table-chip[data-line="LSHR"] { background: var(--amber-tint); color: var(--amber); }
.pl-table-chip[data-line="FSS"]  { background: var(--teal-tint);  color: var(--teal);  }
.pl-table-chip[data-line="LOTO"] { background: var(--plum-tint);  color: var(--plum);  }
.pl-remove-btn {
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  opacity: .55;
  transition: opacity .1s;
}
.pl-remove-btn:hover { opacity: 1; }
.pl-add-wrapper { position: relative; display: inline-block; }
.pl-add-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px dashed var(--line-strong);
  background: none;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: border-color .1s, color .1s;
}
.pl-add-btn:hover { border-style: solid; border-color: var(--red); color: var(--red); }
.pl-dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 5px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  z-index: 40;
  min-width: 78px;
  overflow: hidden;
}
.pl-dropdown[hidden] { display: none; }
.pl-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  transition: background .1s;
}
.pl-dropdown-item:hover { background: var(--paper); }

td.col-remarks { min-width: 160px; max-width: 220px; }

.row-actions { width: 36px; text-align: right; }
.btn-icon {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .1s, color .1s;
}
.btn-icon:hover { background: var(--red-tint); color: var(--red-dark); }

.panel-footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-bottom: 24px;
}
.btn-add {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--red-dark);
  background: var(--surface);
  border: 1.5px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  cursor: pointer;
  transition: background .12s;
}
.btn-add:hover { background: var(--red-tint); }

/* ============================================================
   Sl No gaps indicator
   ============================================================ */
.sl-gaps-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  background: var(--amber-tint);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: 12px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-weight: 600;
  margin-bottom: 4px;
}
.sl-gap-badge {
  background: #fff;
  border: 1.5px solid var(--amber);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 11.5px;
  color: var(--amber);
}

/* ============================================================
   Empty state
   ============================================================ */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.empty-state strong { display: block; color: var(--ink-soft); margin-bottom: 6px; font-size: 14px; }

/* ============================================================
   Modals
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10,8,30,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 28px 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-pop);
  position: relative;
  text-align: center;
  border-top: 4px solid var(--red);
}
.modal-logo { width: 60px; height: 60px; margin: 0 auto 12px; }
.modal h2 { font-size: 20px; margin-bottom: 12px; }
.modal p { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 10px; line-height: 1.65; }
.modal-tagline {
  font-family: var(--font-display);
  color: var(--red-dark);
  font-weight: 600;
  letter-spacing: .02em;
  margin-top: 14px !important;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  font-size: 22px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  width: 30px;
  height: 30px;
  transition: color .1s;
}
.modal-close:hover { color: var(--ink); }

.retraining-rescore-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--blue);
  background: var(--blue-tint);
  border: 1.3px dashed rgba(59, 130, 246, 0.35);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  transition: background .1s, border-color .1s;
}
.retraining-rescore-btn:hover { background: #cfe1fb; border-color: var(--blue); }

/* Cert badge */
.cert-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--green);
  background: var(--green-tint);
  border: 1.5px solid #8fd5b0;
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.cert-badge:hover { background: #c2edd7; border-color: var(--green); }
.cert-badge.pending {
  color: var(--amber);
  background: var(--amber-tint);
  border-color: #ffd699;
}
.cert-badge.pending:hover {
  background: #fdf0d5;
  border-color: var(--amber);
}

/* Certification modal */
.modal-cert { max-width: 480px; }
.cert-seal { margin: 0 auto 14px; width: 48px; height: 48px; }
.cert-title {
  font-family: var(--font-display);
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink);
  margin-bottom: 4px;
}
.cert-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 14px;
}
.cert-statement {
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  margin: 0 0 20px;
  line-height: 1.6;
}
.cert-signatories {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.cert-signatory {
  text-align: center;
  flex: 1;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cert-sig-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 8px;
  user-select: none;
}
.cert-sig-toggle input {
  cursor: pointer;
}
.cert-sig-area {
  height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  margin-bottom: 6px;
  width: 100%;
}
.cert-sig-approved {
  font-family: var(--font-display);
  font-size: 16px;
  font-style: italic;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transform: rotate(-3deg);
  margin-bottom: -2px;
}
.cert-sig-pending {
  font-size: 12px;
  color: var(--line-strong);
  font-style: italic;
  margin-bottom: 4px;
}
.cert-sig-line {
  height: 1px;
  background: var(--ink);
  width: 100%;
}
.cert-sig-name { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.cert-sig-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}
.cert-footer {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0 !important;
}

/* Rating modal */
.modal-rating { max-width: 480px; text-align: left; }
.modal-rating h2 { text-align: left; text-transform: uppercase; letter-spacing: .02em; font-size: 18px; }
.rating-sub { text-align: left; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Schedule-training wizard — one sub-point per screen, Typeform-style */
.modal-schedule-wizard { max-width: 480px; text-align: left; }
.modal-schedule-wizard h2 { text-align: left; text-transform: uppercase; letter-spacing: .02em; font-size: 18px; }
.schedule-progress-bar {
  margin-top: 16px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.schedule-progress-fill {
  height: 100%;
  background: var(--red);
  transition: width .2s ease;
}
.schedule-progress-text {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--muted);
}
.schedule-step { margin-top: 28px; min-height: 96px; }
.schedule-step-module {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.schedule-step-label {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
}
.schedule-step-input {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink);
  padding: 12px 14px;
  background: var(--surface);
  transition: border-color .1s;
}
.schedule-step-input:hover { border-color: var(--ink-soft); }
.schedule-step-input:focus { border-color: var(--red); outline: none; }
.schedule-wizard-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.schedule-wizard-actions .btn-primary { padding: 0 22px; height: 40px; font-size: 12.5px; }
.schedule-wizard-actions .btn-ghost { padding: 0 18px; height: 40px; font-size: 12.5px; }
.schedule-wizard-actions .btn-ghost:disabled { opacity: .4; cursor: not-allowed; }
.schedule-wizard-actions #scheduleNextBtn,
.schedule-wizard-actions #scheduleFinishBtn { margin-left: auto; }

.schedule-review {
  margin-top: 24px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.schedule-review-group { margin-top: 18px; }
.schedule-review-group:first-child { margin-top: 0; }
.schedule-review-module {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.schedule-review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  font-size: 13px;
}
.schedule-review-row span:first-child { color: var(--ink-soft); }
.schedule-review-row span:last-child { font-family: var(--font-mono); color: var(--ink); }
.schedule-review-row.schedule-review-missing span:last-child { color: var(--amber); }
.rating-criteria-list { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.rating-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.rating-row-label { font-size: 13.5px; color: var(--ink-soft); flex: 1; min-width: 140px; }
.score-buttons { display: flex; gap: 4px; flex-shrink: 0; }
.score-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .1s, border-color .1s, color .1s;
}
.score-btn:hover { border-color: var(--ink-soft); }
.score-btn.selected { background: var(--red); border-color: var(--red); color: #fff; }

/* Rating modal: per-module mentor */
.rating-mentor-section {
  margin-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.mentor-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.mentor-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mentor-input {
  flex: 1;
  min-width: 140px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  padding: 7px 10px;
  transition: border-color .1s;
}
.mentor-input:hover { border-color: var(--ink-soft); }
.mentor-input:focus { border-color: var(--red); outline: none; box-shadow: 0 0 0 3px rgba(200,16,46,.08); }
.mentor-assigned-toggle { display: flex; gap: 4px; flex-shrink: 0; }
.mentor-toggle-btn {
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink-soft);
  padding: 6px 10px;
  cursor: pointer;
  transition: background .1s, border-color .1s, color .1s;
}
.mentor-toggle-btn:hover { border-color: var(--ink-soft); }
.mentor-toggle-btn.selected { background: var(--green); border-color: var(--green); color: #fff; }
.mentor-toggle-btn.selected[data-assigned="false"] { background: var(--gray); border-color: var(--gray); }

/* Settings panel (admin only) */
.settings-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.settings-row-label { font-size: 13.5px; color: var(--ink-soft); flex: 1; min-width: 140px; }
.settings-row-unit { font-size: 12px; color: var(--muted); }
.settings-row input[type="number"] { flex: none; width: 100px; }

/* Retraining suggestion / flag badge */
.retraining-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
  margin-left: 6px;
}
.retraining-badge.suggested {
  color: var(--amber);
  background: var(--amber-tint);
  border: 1.5px solid #ffd699;
}
.retraining-badge.suggested:hover { background: #fdf0d5; border-color: var(--amber); }
.retraining-badge.flagged {
  color: var(--plum);
  background: var(--plum-tint);
  border: 1.5px solid #d9b3fb;
}
.retraining-badge.flagged:hover { background: #ecdcfd; border-color: var(--plum); }

.rating-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.rating-actions .btn-primary { padding: 0 22px; height: 40px; font-size: 12.5px; }

.rating-scale-hint {
  text-align: left !important;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 18px !important;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 30px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   Footer
   ============================================================ */
.app-footer {
  text-align: center;
  padding: 18px;
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 20px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .app-title { display: none; }
  #aboutToggle { display: none; }
  .main { padding: 16px; }
}
@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  /* Sidebar becomes a bottom tab bar — a fixed 240px side column leaves
     almost no room for content on a phone screen. */
  body {
    grid-template-areas:
      "topbar"
      "main"
      "sidebar";
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-h) 1fr auto;
  }
  .subnav {
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
    border-right: none;
    border-top: 1px solid var(--line);
    overflow-x: auto;
  }
  .subnav-item {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    height: auto;
    min-height: 52px;
    padding: 6px 4px;
    font-size: 10px;
    gap: 3px;
    border-left: none;
    border-radius: 8px;
    text-align: center;
    white-space: nowrap;
  }
  .subnav-item.active { border-left-color: transparent; }

  .topbar { padding: 0 12px; gap: 10px; }
  .brand-name { font-size: 12.5px; }
  .user-email { display: none; }
}
@media (max-width: 560px) {
  .brand-tagline { display: none; }
}

/* ============================================================
   Authentication & Session Transitions
   ============================================================ */

/* Hiding main app structure when not logged in or loading */
body.auth-loading .topbar,
body.auth-loading .subnav,
body.auth-loading .app-body,
body.auth-loading .modal-backdrop,
body.auth-loading #loginScreen {
  display: none !important;
}

body.not-logged-in, body.auth-loading {
  display: block !important;
}

body.not-logged-in .topbar,
body.not-logged-in .subnav,
body.not-logged-in .app-body,
body.not-logged-in .modal-backdrop {
  display: none !important;
}

body:not(.not-logged-in) #loginScreen {
  display: none !important;
}

body:not(.auth-loading) #authLoadingScreen {
  opacity: 0;
  pointer-events: none;
}

/* loading screen styling */
#authLoadingScreen {
  position: fixed;
  inset: 0;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--line-strong);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

.loading-text {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 500;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Login Screen Layout
   ============================================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, #16161d 0%, #0a0a0d 100%);
  padding: 24px;
  overflow-y: auto;
}
:root[data-theme="light"] .login-screen {
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, #dfe3ea 100%);
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
  border: 1px solid var(--line);
  border-top: 5px solid var(--red);
  animation: login-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes login-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  height: 52px;
  width: auto;
  margin: 0 auto 12px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-bottom: 2px;
}

.login-tagline {
  color: var(--red);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 12px 0;
}

.login-portal-title {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.03em;
}

/* Forms */
.login-form-container form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.btn-full-width {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.password-input-wrapper {
  position: relative;
  display: flex;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 44px;
}

.btn-toggle-password {
  position: absolute;
  right: 2px;
  top: 2px;
  bottom: 2px;
  width: 40px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.btn-toggle-password:hover {
  color: var(--ink);
}

.btn-toggle-password.visible {
  color: var(--red);
}

.login-error-msg {
  background: var(--red-tint);
  border: 1px solid rgba(200, 16, 46, 0.15);
  color: var(--red-dark);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-top: 20px;
  text-align: center;
  animation: shake 0.25s linear;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.mock-warning-banner {
  background: var(--amber-tint);
  border: 1px solid rgba(156, 102, 3, 0.15);
  color: var(--amber);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 24px;
}

.mock-warning-banner code {
  font-family: var(--font-mono);
  background: rgba(156, 102, 3, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
}

/* User profile inside topbar header */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 8px;
}

.user-email {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-family: var(--font-mono);
  font-weight: 500;
}

.btn-logout {
  border-color: var(--red) !important;
  color: var(--red-dark) !important;
  font-weight: 600;
}

.btn-logout:hover {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: #fff !important;
}

/* Responsive auth overrides */
@media (max-width: 900px) {
  body.not-logged-in .btn-ghost {
    display: none !important;
  }
  .user-profile {
    margin-right: 0;
  }
}

/* Binary rating buttons styling */
.score-buttons.binary-buttons {
  display: flex;
  gap: 12px;
}

.score-buttons.binary-buttons .score-btn {
  width: auto;
  padding: 0 16px;
  height: 34px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
}

.score-buttons.binary-buttons .score-btn.binary-not-done.selected {
  background: var(--red-tint);
  border-color: var(--red);
  color: var(--red-dark);
}

.score-buttons.binary-buttons .score-btn.binary-done.selected {
  background: var(--green-tint);
  border-color: var(--green);
  color: var(--green);
}

/* ============================================================
   Probation Review Tracker
   ============================================================ */
.probation-due { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft); }
.probation-due.overdue { color: var(--red-dark); font-weight: 700; }

.probation-feedback-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 140px;
  padding: 4px 0;
}
.probation-feedback-cell.missing { background: var(--red-tint); border-radius: var(--radius-sm); padding: 6px 8px; }
.probation-feedback-toggle { display: flex; gap: 5px; }
.pf-btn {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.pf-btn:hover { border-color: var(--ink-soft); color: var(--ink); }
.pf-btn.pf-good.active { background: var(--green-tint); border-color: var(--green); color: var(--green); }
.pf-btn.pf-poor.active { background: var(--red-tint); border-color: var(--red); color: var(--red-dark); }
.probation-notes {
  font-size: 12px;
  min-height: 18px;
  border-radius: 4px;
  padding: 2px 4px;
}
.probation-missing-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--red-dark);
  text-transform: uppercase;
}

.probation-letter-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.probation-letter-btn:hover { border-color: var(--ink-soft); color: var(--ink); }
.probation-letter-btn.issued { background: var(--green-tint); border-color: var(--green); color: var(--green); }
.probation-letter-btn.missing { background: var(--red-tint); border-color: var(--red); color: var(--red-dark); }

.probation-team-change-cell { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.probation-team-change-select {
  font-family: var(--font-body);
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}

.probation-ok { color: var(--muted); font-size: 12px; }


