/* ────────────────────────────────────────────────────────────────────────────
   DSRI Labs — Dark Theme
   Inspired by: shadcn/ui dark, Linear, Vercel dashboard
   Palette: Zinc / neutral · Teal-400 accent · System font stack
   ──────────────────────────────────────────────────────────────────────────── */

:root {
  /* ── Surface layers (darkest → lightest) */
  --bg:        #0b0b0d;   /* page background              */
  --bg-alt:    #111114;   /* inset / nested backgrounds   */
  --card-bg:   #17171a;   /* card surface                 */
  --surface:   #17171a;   /* alias used by auth-card      */
  --hover-bg:  rgba(255,255,255,0.04);

  /* ── Borders */
  --border:   #252528;    /* default border               */
  --border-2: #38383c;    /* stronger / focus border      */

  /* ── Text */
  --ink:      #f0f0f2;    /* primary text                 */
  --muted:    #78788a;    /* secondary / placeholder text */
  --text:     #f0f0f2;    /* alias                        */

  /* ── Accent — teal, adapted for dark surfaces */
  --teal:       #2dd4bf;
  --teal-dark:  #14b8a6;
  --teal-light: rgba(45,212,191,0.10);
  --teal-border: rgba(45,212,191,0.25);

  /* ── Heading colour — change ONE value here to switch between all 3 options:
     Option A  Facebook Blue   #1877F2   vivid, high-contrast, corporate
     Option B  Sky Blue        #60a5fa   soft, blends naturally with dark theme
     Option C  Indigo          #818cf8   violet-blue, premium / SaaS feel       */
  --heading-color: #1877F2;

  /* ── Semantic status colours (vivid, for dark bg) */
  --amber:    #fbbf24;
  --amber-bg: rgba(251,191,36,0.10);
  --green:    #4ade80;
  --green-bg: rgba(74,222,128,0.10);
  --red:      #f87171;
  --red-bg:   rgba(248,113,113,0.10);
  --blue:     #60a5fa;
  --blue-bg:  rgba(96,165,250,0.10);

  /* ── Legacy / fallback aliases kept for inline-style references in templates */
  --primary: #2dd4bf;
}

/* ── Reset & base ─────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
  /* Subtle noise texture gives the flat black some depth */
  background-image: radial-gradient(ellipse at 60% 0%, rgba(45,212,191,.04) 0%, transparent 60%);
  background-attachment: fixed;
}

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

/* ── Custom scrollbar (Webkit) ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a3a3e; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #525258; }

/* ── Selection ─────────────────────────────────────────────────────────────── */
::selection { background: rgba(45,212,191,0.20); color: var(--ink); }

/* ── Topbar — frosted glass ─────────────────────────────────────────────────── */
.topbar {
  background: rgba(11,11,13,0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10%;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 30px; width: auto; display: block; }
/* Dark mode: show white logo, hide original */
.brand-logo-dark  { display: block; }
.brand-logo-light { display: none; }
html[data-theme="light"] .brand-logo-dark  { display: none; }
html[data-theme="light"] .brand-logo-light { display: block; }
.brand-sub { color: var(--muted); font-size: 14px; padding-left: 10px; border-left: 1px solid var(--border-2); }

.topnav a {
  margin-left: 20px; color: #a0a0b0; font-weight: 500; font-size: 14px;
  padding-bottom: 4px; transition: color .15s;
}
.topnav a:hover { color: var(--ink); text-decoration: none; }
.topnav a.active { color: var(--ink); border-bottom: 2px solid var(--teal); }

.nav-quotations-link { display: inline-flex; align-items: center; gap: 5px; }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
}

/* ── Page shell ─────────────────────────────────────────────────────────────── */
.page { max-width: none; margin: 0; padding: 12px 10% 32px; }
.page.page-wide { max-width: none; }

.page-head h1 { margin: 0 0 4px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.page-head { margin-bottom: 20px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Typography helpers ─────────────────────────────────────────────────────── */
.muted  { color: var(--muted); }
.small  { font-size: 13px; }
.mono   { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.mt     { margin-top: 22px; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35), 0 0 0 0 transparent;
  transition: border-color .2s;
}
.card-title { margin-top: 0; font-size: 16px; font-weight: 600; color: var(--heading-color); }
.section-heading { color: var(--heading-color); }

/* ── Form sections ──────────────────────────────────────────────────────────── */
.form-section { padding: 14px 0; border-top: 1px solid var(--border); }
.form-section:first-child { border-top: none; padding-top: 0; }
.form-section h2 { font-size: 16px; margin: 0 0 4px; color: var(--heading-color); }

/* ── Grid helpers ───────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 14px; margin-top: 12px; }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }

/* ── Form controls ──────────────────────────────────────────────────────────── */
label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 600; color: #9090a0;
}

input[type="text"], input[type="number"], input[type="tel"],
input[type="date"], textarea, select {
  font: inherit; font-weight: 400;
  padding: 9px 11px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: #0d0d10;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-light);
}
textarea { resize: vertical; font-family: inherit; }

/* Dark select option background */
select option { background: #1a1a1e; color: var(--ink); }

input[type="file"] {
  font: inherit; font-weight: 400;
  padding: 8px 10px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: #0d0d10;
  color: var(--ink);
}
input[type="file"]::file-selector-button {
  margin-right: 10px; padding: 6px 12px;
  border: 1px solid var(--border-2); border-radius: 6px;
  background: #252528; color: var(--ink);
  font-weight: 600; cursor: pointer; transition: background .15s;
}
input[type="file"]::file-selector-button:hover { background: var(--border-2); }

.test-group {
  margin-top: 16px; padding: 14px 16px;
  background: #111114; border: 1px solid var(--border); border-radius: 10px;
}
.test-group h3 { margin: 0 0 10px; font-size: 14px; color: var(--ink); }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; }
@media (max-width: 640px) { .checkbox-grid { grid-template-columns: 1fr; } }

.test-rows { display: flex; flex-direction: column; gap: 8px; }
.test-row {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.test-row:last-child { border-bottom: none; }
.test-row .chk { flex: 1; min-width: 0; }
.test-spec-input { width: 220px; flex-shrink: 1; min-width: 120px; }
@media (max-width: 640px) {
  .test-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .test-spec-input { width: 100%; }
}
.test-spec-input {
  font: inherit; font-weight: 400; font-size: 13px;
  padding: 7px 10px; border: 1px solid var(--border-2);
  border-radius: 6px; background: #0d0d10; color: var(--ink);
}
.test-spec-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-light); }

/* NABL-scope test picker */
.test-picker-row { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.test-picker-select {
  flex: 1; min-width: 0; font: inherit; font-size: 13px;
  padding: 7px 10px; border: 1px solid var(--border-2);
  border-radius: 6px; background: #0d0d10; color: var(--ink);
}
.test-picker-select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-light); }
.added-test-label { font-weight: 600; }
.js-empty-hint { margin: 4px 0 0; }
@media (max-width: 640px) { .test-picker-row { flex-direction: column; align-items: stretch; } }

.tests-requested-list { display: flex; flex-direction: column; gap: 0; margin-top: 8px; }

/* ── Selected-Tests summary panel ─────────────────────────────────────────── */
.tests-summary-panel {
  margin-top: 18px; padding: 14px 16px;
  background: var(--teal-light);
  border: 1px solid var(--teal-border);
  border-radius: 10px;
}
.tests-summary-header {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 14px; color: var(--teal); margin-bottom: 12px;
}
.tests-summary-group { margin-bottom: 10px; }
.tests-summary-group:last-child { margin-bottom: 0; }
.tests-summary-cat {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--teal); margin-bottom: 5px; opacity: 0.75;
}
.tests-summary-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tests-summary-chip {
  background: #252528; border: 1px solid var(--teal-border);
  border-radius: 6px; padding: 3px 10px; font-size: 12px; color: #a0a0b0;
}
.test-requested-row {
  display: grid; grid-template-columns: 120px 1fr 1fr;
  gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.test-requested-row:last-child { border-bottom: none; }
.test-requested-cat { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; align-self: center; }
.test-requested-name { font-weight: 600; align-self: center; }
.test-requested-spec { color: var(--ink); }
@media (max-width: 640px) { .test-requested-row { grid-template-columns: 1fr; gap: 2px; } }

.chk, .radio { flex-direction: row; align-items: center; font-weight: 400; font-size: 14px; gap: 8px; }
.chk input, .radio input { width: 16px; height: 16px; accent-color: var(--teal); margin: 0; }

fieldset.radio-field { border: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
fieldset.radio-field legend { font-size: 13px; font-weight: 600; color: #9090a0; padding: 0; margin-bottom: 4px; }

.other-field { margin-top: 10px; padding: 12px 14px; background: var(--teal-light); border-radius: 8px; }
.info-box { margin-top: 12px; padding: 12px 14px; background: var(--bg-alt); border-radius: 8px; font-size: 13px; color: #9090a0; }

.form-actions { margin-top: 24px; display: flex; justify-content: flex-end; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--border-2);
  background: #1e1e22; color: var(--ink);
  font-size: 14px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: #2a2a30; border-color: #4a4a52; text-decoration: none; }
/* Primary: white on dark — works like a "light" button in the dark theme */
.btn-primary { background: #f0f0f2; border-color: #f0f0f2; color: #0b0b0d; font-weight: 600; }
.btn-primary:hover { background: #d8d8de; border-color: #d8d8de; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--hover-bg); border-color: transparent; color: var(--ink); }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ── Search / filter bar ────────────────────────────────────────────────────── */
.searchbar { display: flex; gap: 8px; margin-bottom: 16px; }
.searchbar input[type="search"] {
  flex: 1; padding: 9px 12px; border: 1px solid var(--border-2);
  border-radius: 8px; font: inherit; background: #0d0d10; color: var(--ink);
}
.filter-select {
  padding: 8px 12px; border: 1px solid var(--border-2); border-radius: 8px;
  font: inherit; font-size: 14px; background: #0d0d10; color: var(--ink); cursor: pointer;
}

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.table-card { padding: 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td {
  text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.data-table th {
  color: var(--muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.05em; background: #111114;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: var(--hover-bg); }
.row-actions { display: flex; gap: 6px; white-space: nowrap; }

.empty-state { padding: 48px 24px; text-align: center; }
.empty-state p { margin-bottom: 16px; }

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-submitted    { background: var(--blue-bg);  color: var(--blue); }
.badge-domain       { background: rgba(139,92,246,0.12); color: #a78bfa; border: 1px solid rgba(139,92,246,0.2); }
.badge-cal          { background: var(--green-bg); color: var(--green); border: 1px solid rgba(74,222,128,0.2); }
.badge-accepted     { background: var(--amber-bg); color: var(--amber); }
.badge-in-progress  { background: var(--amber-bg); color: var(--amber); }
.badge-completed    { background: var(--green-bg); color: var(--green); }
.badge-rejected     { background: var(--red-bg);   color: var(--red); }
.badge-admin        { background: var(--teal-light); color: var(--teal); }
.badge-staff        { background: rgba(255,255,255,0.06); color: var(--muted); }
.badge-uut-dispatched       { background: rgba(139,92,246,0.12); color: #a78bfa; }
.badge-uut-in-lab           { background: var(--blue-bg);  color: var(--blue); }
.badge-testing              { background: var(--amber-bg); color: var(--amber); }
.badge-awaiting-data-review { background: var(--amber-bg); color: var(--amber); }
.badge-with-ph              { background: var(--green-bg); color: var(--green); }
.badge-report-review        { background: rgba(244,114,182,0.12); color: #f472b6; }
.badge-closed               { background: var(--green-bg); color: var(--green); }
.badge-approved             { background: var(--green-bg); color: var(--green); }
.badge-pending              { background: var(--amber-bg); color: var(--amber); }
.badge-draft                { background: rgba(255,255,255,0.06); color: var(--muted); }
.badge-pass                 { background: var(--green-bg); color: var(--green); }
.badge-fail                 { background: var(--red-bg);   color: var(--red); }

/* ── Notification bell / unread ─────────────────────────────────────────────── */
.notif-bell { font-size: 17px; position: relative; padding: 4px 6px; text-decoration: none; }
.nav-badge-notif { background: var(--red); color: #fff; position: relative; top: -2px; }
.notif-unread { background: rgba(251,191,36,0.05); font-weight: 600; }

/* ── TE data approval panel ─────────────────────────────────────────────────── */
.te-data-panel { border: 1px solid var(--border); border-radius: 8px; padding: 16px 20px; margin-top: 16px; }
.te-data-panel.submitted { border-color: var(--amber); background: var(--amber-bg); }
.te-data-panel.approved  { border-color: var(--green); background: var(--green-bg); }
.te-data-panel.revision  { border-color: var(--red);   background: var(--red-bg); }
.te-data-panel h4 { margin: 0 0 10px; font-size: 14px; }

/* ── QR card ─────────────────────────────────────────────────────────────────── */
.qr-card { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.qr-image { width: 150px; height: 150px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: #f8f8f8; flex-shrink: 0; }
.qr-unavailable { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; color: var(--muted); background: var(--bg-alt); }
.qr-meta { flex: 1; min-width: 220px; }
.qr-link { word-break: break-all; font-size: 13px; }

.progress-table .pricing-input { min-width: 110px; }

/* ── Customer portal: TRF status timeline ───────────────────────────────────── */
.trf-timeline {
  display: flex; align-items: center;
  padding: 18px 24px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 20px; overflow-x: auto; gap: 0;
}
.tl-step { display: flex; flex-direction: column; align-items: center; min-width: 72px; }
.tl-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: #252528; border: 2px solid #38383c;
  margin-bottom: 7px; flex-shrink: 0; transition: background .2s, border-color .2s;
}
.tl-step.tl-done .tl-dot    { background: var(--teal); border-color: var(--teal); }
.tl-step.tl-current .tl-dot { background: var(--bg); border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-light); }
.tl-label { font-size: 11px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.tl-step.tl-done .tl-label    { color: var(--teal); font-weight: 700; }
.tl-step.tl-current .tl-label { color: var(--teal); font-weight: 700; }
.tl-line { flex: 1; height: 2px; background: #252528; margin-bottom: 25px; min-width: 20px; }
.tl-line.tl-done { background: var(--teal); }

/* ── Nav dropdown ─────────────────────────────────────────────────────────────── */
.nav-dropdown { position: relative; display: inline-block; margin-left: 20px; }
.nav-dropdown-toggle {
  color: #a0a0b0; font-weight: 500; font-size: 14px; padding-bottom: 4px;
  cursor: pointer; background: none; border: none; font-family: inherit;
  display: flex; align-items: center; gap: 4px; transition: color .15s;
}
.nav-dropdown-toggle:hover { color: var(--ink); }
.nav-dropdown-toggle.active { color: var(--ink); border-bottom: 2px solid var(--teal); }
.nav-dropdown-menu {
  display: none; position: absolute; top: 100%; right: 0;
  background: #1e1e22; border: 1px solid var(--border-2); border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,0.04);
  min-width: 160px; z-index: 200; padding: 6px;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block; padding: 8px 12px; border-radius: 6px;
  color: #a0a0b0; font-size: 14px; font-weight: 500;
  text-decoration: none; margin: 0; transition: background .1s, color .1s;
}
.nav-dropdown-menu a:hover { background: var(--hover-bg); color: var(--ink); }
.nav-dropdown-menu a.active { color: var(--teal); font-weight: 700; }

/* ── Timeline items ──────────────────────────────────────────────────────────── */
.timeline { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.timeline-item { padding: 12px 14px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px; }
.timeline-time { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.timeline-media { margin-top: 8px; }
.timeline-media img { max-width: 240px; border-radius: 8px; display: block; }
.timeline-media video { max-width: 240px; border-radius: 8px; display: block; }

/* ── Banners ─────────────────────────────────────────────────────────────────── */
.banner { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 14px; }
.banner-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(74,222,128,0.25); }
.banner-error   { background: var(--red-bg);   color: var(--red);   border: 1px solid rgba(248,113,113,0.25); }
.banner-pending-approval { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(251,191,36,0.25); }
.banner-warn    { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(251,191,36,0.25); }
.banner-info    { background: var(--blue-bg);  color: var(--blue);  border: 1px solid rgba(96,165,250,0.25); }

.radio-group-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.radio-domain { font-size: 15px; }
.field-required { color: var(--red); font-size: 13px; }

/* ── Dashboard table row highlights ─────────────────────────────────────────── */
tr.row-te-review { background: rgba(251,191,36,0.05); }
tr.row-te-review td:first-child { border-left: 3px solid #f59e0b; }
tr.row-new-trf { background: rgba(251,191,36,0.04); }
tr.row-new-trf td:first-child { border-left: 3px solid var(--amber); }
tr.row-approved-quote { background: rgba(74,222,128,0.04); }
tr.row-approved-quote td:first-child { border-left: 3px solid var(--green); }

/* ── TE review badge & card ──────────────────────────────────────────────────── */
.badge-review-needed { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.te-review-card { border-left: 3px solid #f59e0b; }
.toc-review { color: var(--heading-color) !important; font-weight: 600; }

/* ── Role task panel row highlights ─────────────────────────────────────────── */
.task-panel-title { display: flex; align-items: center; gap: 10px; }
.task-panel-title .badge { vertical-align: middle; }
tr.row-in-progress td:first-child { border-left: 3px solid var(--amber); }
tr.row-not-started td:first-child { border-left: 3px solid #4a4a52; }
tr.row-overdue     td:first-child { border-left: 3px solid var(--red); }
tr.row-due-soon    td:first-child { border-left: 3px solid var(--amber); }
tr.row-checkout    td:first-child { border-left: 3px solid var(--green); }

/* ── Upcoming (collapsed) task panel ────────────────────────────────────────── */
.upcoming-panel { border-top: 1px solid var(--border); padding-top: 4px; }
.upcoming-summary {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  user-select: none; padding: 8px 4px; font-size: 13px; font-weight: 600;
  color: var(--muted); list-style: none;
}
.upcoming-summary::-webkit-details-marker { display: none; }
.upcoming-summary::before { content: "▶"; font-size: 10px; transition: transform 0.15s ease; display: inline-block; }
details[open] > .upcoming-summary::before { transform: rotate(90deg); }
.upcoming-summary:hover { color: var(--ink); }

/* ── Code hint block ─────────────────────────────────────────────────────────── */
pre.code-hint {
  font-family: ui-monospace, "Cascadia Code", monospace; font-size: 12.5px;
  background: #0d0d10; border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 14px; margin: 8px 0; color: #9090a0; white-space: pre; overflow-x: auto;
}

/* ── Role selector ───────────────────────────────────────────────────────────── */
.inline-role-form { display: inline-flex; }
.role-select {
  font: inherit; font-size: 13px; padding: 5px 8px;
  border: 1px solid var(--border-2); border-radius: 6px;
  background: #0d0d10; color: var(--ink); cursor: pointer;
}

/* ── Assignment row ──────────────────────────────────────────────────────────── */
.assignment-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 4px; }
.inline-assign-form { display: flex; gap: 6px; align-items: center; }
.assign-select {
  font: inherit; font-size: 14px; padding: 7px 10px;
  border: 1px solid var(--border-2); border-radius: 8px;
  background: #0d0d10; color: var(--ink);
}

/* ── Quotation approval box ──────────────────────────────────────────────────── */
.quotation-pricing-warning {
  font-size: 13px; color: var(--amber);
  background: var(--amber-bg); border: 1px solid rgba(251,191,36,0.25);
  border-radius: 6px; padding: 8px 12px; margin-bottom: 10px;
}
.quotation-approval-box {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 16px; margin: 12px 0 4px;
}
.quotation-approval-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.quotation-approval-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ── Inline email form ───────────────────────────────────────────────────────── */
.inline-email-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-email-input {
  font: inherit; font-size: 13px; padding: 5px 9px;
  border: 1px solid var(--border-2); border-radius: 6px;
  min-width: 180px; flex: 1;
  background: #0d0d10; color: var(--ink);
}

/* ── Auth card base (overridden by customer portal rules below) ──────────────── */
.auth-card { max-width: 380px; margin: 60px auto; }
.userpill { color: var(--muted); font-size: 14px; margin-left: 20px; }

/* ── Read-only grid ──────────────────────────────────────────────────────────── */
.readonly-grid div { display: flex; flex-direction: column; gap: 2px; }
.ro-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.ro-value { font-size: 14px; color: var(--ink); }

.sitefoot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }

/* ── TE read-only notice ─────────────────────────────────────────────────────── */
.te-readonly-notice {
  font-size: 13px; color: var(--amber);
  background: var(--amber-bg); border: 1px solid rgba(251,191,36,0.25);
  border-radius: 8px; padding: 8px 14px; margin-bottom: 16px;
}
fieldset.te-frozen { border: none; padding: 0; margin: 0; opacity: 0.4; cursor: not-allowed; }
fieldset.te-frozen * { cursor: not-allowed; pointer-events: none; }

/* ── Consolidated tests summary table ───────────────────────────────────────── */
.tests-summary-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 10px 0 16px; }
.tests-summary-table th {
  text-align: left; padding: 6px 10px; background: #111114;
  border-bottom: 2px solid var(--border); color: var(--muted);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.tests-summary-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tests-summary-table tr:last-child td { border-bottom: none; }
.tests-summary-table .tst-cat { font-size: 11px; font-weight: 700; color: var(--teal); white-space: nowrap; }

/* ── Tabs ────────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn {
  padding: 9px 16px; border: none; background: transparent;
  color: var(--muted); font-size: 14px; font-weight: 500;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color .15s;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--teal); }
.tab-panel { padding-top: 4px; }

/* ── Pricing table ───────────────────────────────────────────────────────────── */
.pricing-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.pricing-table th, .pricing-table td {
  text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.pricing-table th {
  color: var(--muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em; background: #111114;
}
.pricing-table tr:last-child td { border-bottom: none; }
.pricing-input {
  font: inherit; font-weight: 400; font-size: 13px; width: 100%; min-width: 70px;
  padding: 6px 8px; border: 1px solid var(--border-2); border-radius: 6px;
  background: #0d0d10; color: var(--ink);
}
.pricing-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-light); }
.pricing-num { width: 90px; }
.pricing-subtotal { font-weight: 600; white-space: nowrap; }
.pricing-total-label { text-align: right; font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: 0.04em; }
.pricing-total-value { font-weight: 700; white-space: nowrap; color: var(--teal); }

/* ── Gantt chart ─────────────────────────────────────────────────────────────── */
.gantt-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gantt-wrap { margin-top: 14px; }
.gantt-kpis { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.gantt-kpi {
  flex: 1 1 120px; min-width: 110px;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; text-align: center;
}
.gantt-kpi-value { font-size: 20px; font-weight: 600; color: var(--ink); }
.gantt-kpi-label { font-size: 11px; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.03em; }
.gantt-axis-row, .gantt-row { display: flex; align-items: center; }
.gantt-label {
  flex: 0 0 220px; max-width: 220px; padding-right: 12px;
  font-size: 13px; color: var(--ink); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.gantt-axis-row { margin-bottom: 6px; }
.gantt-axis { position: relative; flex: 1; height: 18px; border-bottom: 1px solid var(--border); }
.gantt-tick { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.gantt-chart { display: flex; flex-direction: column; gap: 8px; }
.gantt-row { min-height: 26px; }
.gantt-track {
  position: relative; flex: 1; height: 20px;
  background: #111114; border: 1px solid var(--border); border-radius: 4px;
}
.gantt-bar { position: absolute; top: 2px; height: 14px; border-radius: 4px; min-width: 6px; }
.gantt-bar.gantt-in-progress { opacity: 0.55; border: 1px dashed rgba(255,255,255,0.3); }
.gantt-bar.gantt-completed { opacity: 1; }
.gantt-not-scheduled { display: inline-block; margin-left: 10px; font-size: 12px; color: var(--muted); font-style: italic; }
.gantt-legend { display: flex; gap: 18px; margin-top: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.gantt-legend-categories { margin-top: 6px; }
.gantt-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.gantt-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.gantt-swatch.gantt-in-progress { background: var(--ink); opacity: 0.55; border: 1px dashed rgba(255,255,255,0.3); }
.gantt-swatch.gantt-completed { background: var(--ink); opacity: 1; }
.gantt-swatch.gantt-not-scheduled-swatch { background: var(--border); }
@media (max-width: 640px) { .gantt-label { flex-basis: 130px; max-width: 130px; font-size: 12px; } .gantt-kpi { flex-basis: 45%; } }

/* ── Customer portal ─────────────────────────────────────────────────────────── */
.auth-wrap { display: flex; justify-content: center; padding: 40px 16px; }
.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 36px 32px;
  width: 100%; max-width: 420px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,0.04);
}
.auth-logo { height: 38px; display: block; margin: 0 auto 20px; }
.auth-title { text-align: center; font-size: 22px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.02em; }
.auth-sub { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.auth-error {
  background: var(--red-bg); color: var(--red);
  border: 1px solid rgba(248,113,113,0.25); border-radius: 8px;
  padding: 10px 14px; font-size: 14px; margin-bottom: 18px;
}
.field-label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 14px; }
.field-input {
  padding: 9px 12px; border: 1px solid var(--border-2); border-radius: 8px;
  font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
  background: #0d0d10; color: var(--ink);
}
.field-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-light); }
.field-hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.btn-full { width: 100%; justify-content: center; margin-top: 4px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--muted); margin-top: 20px; }
.auth-switch a { color: var(--teal); text-decoration: none; font-weight: 500; }
.auth-hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.5; }
.req-star { color: var(--teal); }
.page-actions { margin-bottom: 20px; }
.badge-lg { font-size: 14px; padding: 5px 14px; }
.banner-success {
  background: var(--green-bg); color: var(--green);
  border: 1px solid rgba(74,222,128,0.25); border-radius: 8px;
  padding: 12px 18px; margin-bottom: 20px; font-size: 14px;
}
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.kv-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.kv-row:nth-child(odd) { padding-right: 24px; }
.kv-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.kv-value { font-size: 14px; }
.updates-list { display: flex; flex-direction: column; gap: 18px; }
.update-item { border-left: 3px solid var(--teal); padding-left: 14px; }
.update-meta { display: block; margin-bottom: 4px; }
.update-text { margin: 0; font-size: 14px; }
.update-media { max-width: 100%; max-height: 340px; border-radius: 8px; margin-top: 8px; display: block; }
.auth-section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 700; color: var(--muted); margin: 0 0 10px;
}
.auth-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.customer-prefill-banner {
  background: var(--teal-light);
  border: 1px solid var(--teal-border);
  border-radius: 8px; padding: 10px 16px;
  font-size: 14px; color: var(--ink); margin-bottom: 8px;
}
.customer-prefill-banner a { color: var(--teal); text-decoration: none; }

/* ── Detail page — sticky horizontal TOC ─────────────────────────────────────── */
.detail-layout { display: block; }
.detail-toc {
  position: sticky; top: 56px; z-index: 8;
  background: rgba(11,11,13,0.80);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px; margin-bottom: 18px; padding: 8px 14px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.toc-label {
  font-size: 10px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
  padding-right: 10px; border-right: 1px solid var(--border-2);
  white-space: nowrap; margin-right: 2px;
}
.toc-link {
  display: inline-flex; align-items: center; padding: 4px 12px;
  font-size: 12px; color: var(--heading-color); text-decoration: none;
  border-radius: 99px; border: 1px solid var(--border); background: transparent;
  white-space: nowrap; transition: background .12s, color .12s, border-color .12s;
}
.toc-link:hover { background: var(--hover-bg); color: var(--ink); border-color: var(--border-2); text-decoration: none; }
.toc-link.toc-active { color: var(--teal); border-color: var(--teal); font-weight: 600; background: var(--teal-light); }
.detail-main { font-size: 13px; }
.detail-main .card { padding: 10px 12px; overflow-x: auto; }
.detail-main .card-title { font-size: 14px; }
.detail-main h3 { font-size: 13px; }
.detail-main .banner { font-size: 13px; padding: 10px 14px; }
.detail-main .grid { gap: 10px; margin-top: 10px; }

/* ── Collapsible <details> cards (HR pages) ──────────────────────────────────── */
details.card { padding: 0; }
details.card > summary.card-summary {
  padding: 14px 20px; cursor: pointer; user-select: none;
  list-style: none; font-weight: 600; font-size: 15px;
  display: flex; align-items: center; gap: 8px; border-radius: 12px;
}
details.card[open] > summary.card-summary { border-radius: 12px 12px 0 0; border-bottom: 1px solid var(--border); }
details.card > summary.card-summary::marker,
details.card > summary.card-summary::-webkit-details-marker { display: none; }
details.card > summary.card-summary::before { content: "▸"; color: var(--muted); font-size: 11px; flex-shrink: 0; transition: transform .15s; }
details.card[open] > summary.card-summary::before { transform: rotate(90deg); }
details.card > :not(summary) { padding: 0 20px 16px; }
details.card > table:not(summary) { padding: 0; }
details.card > .data-table { width: 100%; }

/* ── Collapsible cards (data-collapsible) ────────────────────────────────────── */
.card[data-collapsible] h2.card-title {
  cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; user-select: none; margin-bottom: 0;
}
.card-section-header { cursor: pointer; }
.card-toggle {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 14px; padding: 2px 4px; line-height: 1; flex-shrink: 0;
  transition: transform .2s, color .15s;
}
.card-toggle:hover { color: var(--teal); }
.card[data-collapsible][data-collapsed="true"] .card-toggle { transform: rotate(-90deg); }
.card[data-collapsible][data-collapsed="true"] > *:not(.card-section-header) { display: none !important; }
.card[data-collapsible][data-collapsed="true"] > h2.card-title ~ * { display: none !important; }

@media (max-width: 480px) { .detail-toc { display: none; } }

/* ── TRF Pipeline status bar ─────────────────────────────────────────────────── */
.trf-pipeline {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 16px 10px; margin-bottom: 14px; overflow-x: auto;
}
.trf-pipeline-track { display: flex; align-items: flex-start; min-width: 540px; }
.trf-step { flex: 0 0 auto; width: 78px; display: flex; flex-direction: column; align-items: center; }
.trf-step-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  border: 2px solid var(--border-2); background: #1a1a1e; color: var(--muted);
  margin-bottom: 7px; flex-shrink: 0; transition: background .2s, border-color .2s;
}
.trf-step.step-done  .trf-step-dot { background: var(--teal);  border-color: var(--teal);  color: #0b0b0d; }
.trf-step.step-active .trf-step-dot { background: var(--amber); border-color: var(--amber); color: #0b0b0d; box-shadow: 0 0 0 3px var(--amber-bg); }
.trf-step-label { font-size: 10px; text-align: center; color: var(--muted); line-height: 1.3; max-width: 70px; word-break: break-word; }
.trf-step.step-done  .trf-step-label { color: var(--teal);  font-weight: 600; }
.trf-step.step-active .trf-step-label { color: var(--amber); font-weight: 700; }
.trf-conn { flex: 1; height: 2px; margin-top: 15px; align-self: flex-start; min-width: 14px; }
.trf-conn.line-done    { background: var(--teal); }
.trf-conn.line-pending { background: var(--border); }
.trf-rejected-banner {
  background: var(--red-bg); color: var(--red);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 10px; padding: 12px 18px; font-size: 14px; font-weight: 600; margin-bottom: 20px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   THEME TOGGLE BUTTON
   ──────────────────────────────────────────────────────────────────────────── */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--border-2); border-radius: 8px;
  background: transparent; color: var(--muted);
  cursor: pointer; margin-left: 10px; padding: 0;
  transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
  vertical-align: middle;
}
.theme-toggle:hover { background: var(--hover-bg); border-color: var(--teal); color: var(--ink); }
.theme-toggle svg { width: 15px; height: 15px; fill: currentColor; display: block; }

/* ─────────────────────────────────────────────────────────────────────────────
   LIGHT THEME OVERRIDES  (html[data-theme="light"])
   These override every hardcoded dark value. CSS variables are redefined in
   the :root block, so all var() usages automatically pick up the new values.
   ──────────────────────────────────────────────────────────────────────────── */
html[data-theme="light"] {
  --bg:         #f7f8f9;
  --bg-alt:     #f3f4f6;
  --card-bg:    #ffffff;
  --surface:    #ffffff;
  --hover-bg:   rgba(0,0,0,0.03);
  --border:     #e5e7eb;
  --border-2:   #d1d5db;
  --ink:        #1f2937;
  --muted:      #6b7280;
  --text:       #1f2937;
  --teal:       #0f766e;
  --teal-dark:  #0b5b54;
  --teal-light: #e6f4f2;
  --teal-border:#a7d4ce;
  --amber:      #b45309;
  --amber-bg:   #fef3c7;
  --green:      #166534;
  --green-bg:   #dcfce7;
  --red:        #991b1b;
  --red-bg:     #fee2e2;
  --blue:       #1d4ed8;
  --blue-bg:    #dbeafe;
  --primary:    #0f766e;
}

/* Body */
html[data-theme="light"] body { background-image: none; }

/* Topbar */
html[data-theme="light"] .topbar {
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--border);
}
html[data-theme="light"] .topnav a { color: var(--ink); }
html[data-theme="light"] .topnav a.active { color: var(--teal); border-bottom-color: var(--teal); }
html[data-theme="light"] .brand-sub { border-left-color: var(--border); }

/* Nav dropdown */
html[data-theme="light"] .nav-dropdown-toggle { color: var(--ink); }
html[data-theme="light"] .nav-dropdown-toggle:hover { color: var(--teal); }
html[data-theme="light"] .nav-dropdown-toggle.active { color: var(--teal); border-bottom-color: var(--teal); }
html[data-theme="light"] .nav-dropdown-menu {
  background: #fff;
  border-color: var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,.10);
}
html[data-theme="light"] .nav-dropdown-menu a { color: var(--ink); }
html[data-theme="light"] .nav-dropdown-menu a:hover { background: var(--teal-light); color: var(--teal-dark); }
html[data-theme="light"] .nav-dropdown-menu a.active { color: var(--teal); }

/* Cards */
html[data-theme="light"] .card {
  box-shadow: 0 1px 2px rgba(16,24,40,0.04);
}

/* Form inputs — batch all dark-bg inputs together */
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="tel"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] textarea,
html[data-theme="light"] select,
html[data-theme="light"] input[type="file"],
html[data-theme="light"] .test-spec-input,
html[data-theme="light"] .test-picker-select,
html[data-theme="light"] .pricing-input,
html[data-theme="light"] .role-select,
html[data-theme="light"] .assign-select,
html[data-theme="light"] .inline-email-input,
html[data-theme="light"] .field-input,
html[data-theme="light"] .filter-select,
html[data-theme="light"] .searchbar input[type="search"] {
  background: #fff;
  border-color: var(--border);
  color: var(--ink);
}
html[data-theme="light"] select option { background: #fff; color: var(--ink); }
html[data-theme="light"] input[type="file"]::file-selector-button {
  background: var(--teal-light);
  color: var(--teal-dark);
  border-color: var(--border);
}
html[data-theme="light"] input[type="file"]::file-selector-button:hover {
  background: #ccece8;
}

/* Test group + form helpers */
html[data-theme="light"] .test-group { background: #fafbfb; }
html[data-theme="light"] .info-box { background: #f3f4f6; color: #374151; }
html[data-theme="light"] pre.code-hint { background: #f1f5f9; color: #1e293b; }

/* Buttons */
html[data-theme="light"] .btn {
  background: #fff;
  border-color: var(--border);
  color: var(--ink);
}
html[data-theme="light"] .btn:hover {
  background: #f3f4f6;
  border-color: var(--border-2);
}
html[data-theme="light"] .btn-primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
html[data-theme="light"] .btn-primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}
html[data-theme="light"] .btn-ghost:hover {
  background: var(--teal-light);
  color: var(--teal-dark);
}

/* Tables */
html[data-theme="light"] .data-table th { background: #fafbfb; }
html[data-theme="light"] .data-table tbody tr:hover { background: rgba(0,0,0,0.015); }
html[data-theme="light"] .pricing-table th,
html[data-theme="light"] .tests-summary-table th { background: #fafbfb; }

/* Tabs */
html[data-theme="light"] .tab-btn.active { color: var(--teal); border-bottom-color: var(--teal); }

/* TOC links (detail page) */
html[data-theme="light"] .detail-toc {
  background: rgba(255,255,255,0.92);
  border-color: var(--border);
}
html[data-theme="light"] .toc-link:hover { background: var(--teal-light); color: var(--teal); border-color: var(--teal); }
html[data-theme="light"] .toc-link.toc-active { color: var(--teal); border-color: var(--teal); background: var(--teal-light); }

/* Timeline / customer TRF */
html[data-theme="light"] .tl-dot { background: #e2e8f0; border-color: #cbd5e1; }
html[data-theme="light"] .tl-step.tl-current .tl-dot { background: #fff; }
html[data-theme="light"] .tl-line { background: #e2e8f0; }

/* TRF pipeline */
html[data-theme="light"] .trf-pipeline { background: #fff; }
html[data-theme="light"] .trf-step-dot { background: #fff; border-color: var(--border); color: var(--muted); }

/* Quotation approval box */
html[data-theme="light"] .quotation-approval-box { background: #f8fafc; }

/* Gantt */
html[data-theme="light"] .gantt-track { background: #fafbfb; border-color: var(--border); }
html[data-theme="light"] .gantt-swatch.gantt-in-progress {
  background: var(--ink);
  border-color: rgba(0,0,0,.35);
}

/* Auth card */
html[data-theme="light"] .auth-card {
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* Scrollbar */
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #d1d5db; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Morning Agenda (manager dashboard) ─────────────────────────────────── */
.agenda-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.agenda-member-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agenda-member-card.agenda-set   { border-left: 3px solid #2dd4bf; }
.agenda-member-card.agenda-unset { border-left: 3px solid #38383c; opacity: 0.85; }

.agenda-member-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.agenda-member-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  display: block;
}
.agenda-member-role {
  font-size: 11px;
  display: block;
  margin-top: 1px;
}

.agenda-acked       { font-size: 11px; color: #4ade80; white-space: nowrap; }
.agenda-pending-ack { font-size: 11px; color: #fbbf24; white-space: nowrap; }

.agenda-note-display { background: var(--bg-alt); border-radius: 6px; padding: 10px 12px; }
.agenda-note-text    { font-size: 13px; color: var(--ink); margin: 0 0 4px; line-height: 1.5; }
.agenda-note-meta    { font-size: 11px; margin: 0; }
.agenda-carried      { color: #fbbf24; }

.agenda-trf-list      { margin-top: 8px; }
.agenda-trf-heading   { font-size: 11px; margin: 0 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.agenda-ordered-trfs  { margin: 0; padding-left: 20px; }
.agenda-ordered-trfs li { font-size: 12px; margin-bottom: 3px; }
.agenda-trf-link { color: var(--teal); text-decoration: none; }
.agenda-trf-link:hover { text-decoration: underline; }

.agenda-form-toggle > summary { list-style: none; cursor: pointer; }
.agenda-form-toggle > summary::-webkit-details-marker { display: none; }
.agenda-set-btn {
  font-size: 12px;
  color: var(--teal);
  padding: 4px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
}
.agenda-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.agenda-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-alt);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  color: var(--ink);
  padding: 8px 10px;
  font-size: 13px;
  resize: vertical;
  font-family: inherit;
}
.agenda-sortable { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.agenda-sort-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: grab;
  user-select: none;
}
.agenda-sort-item:active { cursor: grabbing; }
.drag-handle { color: var(--muted); font-size: 14px; }

/* ── TE / DW Dashboard ───────────────────────────────────────────────────── */
.te-dashboard {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 60px;
}

/* Hero band */
.te-hero-band {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0 24px;
  flex-wrap: wrap;
}
.te-role-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--teal);
  background: rgba(45,212,191,.1);
  border: 1px solid rgba(45,212,191,.2);
  border-radius: 20px;
  padding: 2px 10px;
  margin: 0 0 6px;
}
.te-greeting {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
  line-height: 1.2;
}
.te-greeting-sub { font-size: 13px; margin: 0; }

.te-quick-stats { display: flex; gap: 20px; flex-shrink: 0; }
.te-qstat { text-align: center; }
.te-qstat-num { display: block; font-size: 28px; font-weight: 700; line-height: 1; }
.te-qstat-lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 2px; }

/* Today's Focus hero */
.te-focus-hero {
  background: linear-gradient(135deg, rgba(45,212,191,.06) 0%, rgba(124,58,237,.05) 100%);
  border: 1px solid rgba(45,212,191,.2);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  position: relative;
}
.te-focus-hero.te-focus-unacked { border-color: rgba(251,191,36,.3); background: linear-gradient(135deg, rgba(251,191,36,.05) 0%, rgba(45,212,191,.04) 100%); }
.te-focus-hero.te-focus-empty   { border-style: dashed; opacity: 0.6; }

.te-focus-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--teal);
  margin-bottom: 10px;
}
.te-focus-note {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 12px;
  line-height: 1.5;
}
.te-focus-trfs { margin-bottom: 12px; }
.te-focus-trfs-heading { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; }
.te-focus-trf-list { margin: 0; padding-left: 20px; }
.te-focus-trf-list li { font-size: 13px; margin-bottom: 4px; }
.te-focus-trf-link { color: var(--teal); text-decoration: none; font-weight: 500; }
.te-focus-trf-link:hover { text-decoration: underline; }
.te-focus-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.te-carried-badge { font-size: 11px; color: #fbbf24; background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.2); border-radius: 10px; padding: 1px 7px; }

.te-ack-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.te-ack-btn { font-size: 13px; padding: 6px 18px; }

.te-acked-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #4ade80;
  background: rgba(74,222,128,.08);
  border: 1px solid rgba(74,222,128,.2);
  border-radius: 20px;
  padding: 4px 14px;
}

/* Pending actions strip */
.te-actions-strip {
  margin-bottom: 28px;
}
.te-actions-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin: 0 0 10px;
}
.te-action-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.te-action-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid;
  text-decoration: none;
  min-width: 160px;
  cursor: pointer;
  transition: transform .1s;
}
.te-action-chip:hover { transform: translateY(-1px); }
.te-chip-urgent {
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.3);
}
.te-chip-normal {
  background: rgba(45,212,191,.06);
  border-color: rgba(45,212,191,.2);
}
.te-chip-label { font-size: 12px; font-weight: 600; color: var(--ink); }
.te-chip-urgent .te-chip-label { color: #f87171; }
.te-chip-ref   { font-size: 11px; font-family: monospace; color: var(--teal); }
.te-chip-uut   { font-size: 11px; }

/* Section headings */
.te-section-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--heading-color);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.te-sub-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin: 16px 0 10px;
}

/* Task grid */
.te-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.te-task-grid-sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }

.te-task-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  display: block;
  transition: border-color .15s, transform .1s;
}
.te-task-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.te-task-urgent   { border-left: 3px solid #ef4444; }
.te-task-submitted{ border-left: 3px solid #7c3aed; }
.te-task-active   { border-left: 3px solid #2dd4bf; }
.te-task-upcoming { border-left: 3px solid #38383c; opacity: 0.8; }
.te-task-done     { border-left: 3px solid #16a34a; opacity: 0.7; }

.te-task-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.te-task-ctrl { font-size: 11px; color: var(--muted); }
.te-task-pill {
  font-size: 10px;
  font-weight: 600;
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
}
.te-pill-urgent    { background: rgba(239,68,68,.12); color: #f87171; }
.te-pill-submitted { background: rgba(124,58,237,.12); color: #a78bfa; }
.te-pill-progress  { background: rgba(45,212,191,.1);  color: #2dd4bf; }
.te-pill-assigned  { background: rgba(255,255,255,.06); color: var(--muted); }

.te-task-name { font-size: 13px; font-weight: 600; color: var(--ink); margin: 0 0 3px; line-height: 1.3; }
.te-task-sub  { font-size: 11px; margin: 0; line-height: 1.4; }
.te-task-date { font-size: 10px; }
.te-task-feedback-badge { font-size: 11px; color: #fbbf24; margin: 6px 0 0; }

/* Collapsed more-section */
.te-collapsed-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}
.te-section-toggle {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
.te-section-toggle::-webkit-details-marker { display: none; }
.te-collapsed-section[open] .te-section-toggle { border-bottom: 1px solid var(--border); }
.te-collapsed-section > *:not(summary) { padding: 12px 16px; }

.te-toggle-badge {
  font-size: 11px;
  font-weight: 500;
  background: rgba(255,255,255,.06);
  border-radius: 20px;
  padding: 2px 8px;
  color: var(--muted);
}
.te-badge-done { background: rgba(22,163,74,.1); color: #4ade80; }

/* Empty state */
.te-empty-state {
  text-align: center;
  padding: 60px 20px;
}
.te-empty-icon  { font-size: 48px; margin: 0 0 12px; }
.te-empty-title { font-size: 18px; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.te-empty-sub   { font-size: 13px; max-width: 380px; margin: 0 auto; }

/* Light mode overrides for agenda + TE dashboard */
html[data-theme="light"] .agenda-member-card    { background: #fff; }
html[data-theme="light"] .agenda-note-display   { background: #f8fafc; }
html[data-theme="light"] .agenda-textarea       { background: #f8fafc; border-color: #d1d5db; color: #0f172a; }
html[data-theme="light"] .agenda-sort-item      { background: #f8fafc; }
html[data-theme="light"] .te-focus-hero         { background: linear-gradient(135deg, rgba(13,148,136,.05) 0%, rgba(109,40,217,.03) 100%); }
html[data-theme="light"] .te-task-card          { background: #fff; }
html[data-theme="light"] .te-collapsed-section  { background: #fff; }
html[data-theme="light"] .te-section-toggle     { background: #f8fafc; }
html[data-theme="light"] .te-chip-urgent        { background: rgba(239,68,68,.06); }
html[data-theme="light"] .te-chip-normal        { background: rgba(13,148,136,.05); }

/* ── Priority tiles — shared manager + TE dashboard ─────────────────────── */
.priority-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.ptile {
  border-radius: 12px;
  border: 0.5px solid;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(24,119,242,0.06);
}
.ptile-header { display: flex; align-items: center; justify-content: space-between; }
.ptile-emoji  { font-size: 22px; line-height: 1; }
.ptile-badge  { font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 99px; letter-spacing: .04em; }
.ptile-text   { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--ink); }
.ptile-link   { font-size: 12.5px; font-weight: 600; text-decoration: none; }
.ptile-link:hover { text-decoration: underline; }

.ptile-critical { border-color: rgba(239,68,68,0.35); }
.ptile-critical .ptile-badge { background: rgba(239,68,68,0.12); color: #ef4444; }
.ptile-critical .ptile-link  { color: #ef4444; }

.ptile-warning { border-color: rgba(249,115,22,0.35); }
.ptile-warning .ptile-badge { background: rgba(249,115,22,0.12); color: #f97316; }
.ptile-warning .ptile-link  { color: #f97316; }

.ptile-info { border-color: rgba(24,119,242,0.35); }
.ptile-info .ptile-badge { background: rgba(24,119,242,0.12); color: #1877F2; }
.ptile-info .ptile-link  { color: #1877F2; }

html[data-theme="light"] .ptile                        { background: #eff6ff; }
html[data-theme="light"] .ptile-text                   { color: #111827; }
html[data-theme="light"] .ptile-critical               { border-color: rgba(239,68,68,0.4); }
html[data-theme="light"] .ptile-critical .ptile-badge  { background: #fef2f2; color: #dc2626; }
html[data-theme="light"] .ptile-critical .ptile-link   { color: #dc2626; }
html[data-theme="light"] .ptile-warning                { border-color: rgba(249,115,22,0.4); }
html[data-theme="light"] .ptile-warning .ptile-badge   { background: #fff7ed; color: #ea580c; }
html[data-theme="light"] .ptile-warning .ptile-link    { color: #ea580c; }
html[data-theme="light"] .ptile-info                   { border-color: rgba(24,119,242,0.4); }
html[data-theme="light"] .ptile-info .ptile-badge      { background: #eff6ff; color: #1d4ed8; }
html[data-theme="light"] .ptile-info .ptile-link       { color: #1d4ed8; }

/* ── TE dashboard: stat chips ────────────────────────────────────────────── */
.te-stat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.te-sc {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  min-width: 70px;
  text-align: center;
  text-decoration: none;
  background: rgba(99,102,241,.2);
  color: #a5b4fc;
  transition: opacity .15s, transform .12s;
}
.te-sc:hover { opacity: .85; transform: translateY(-1px); }
.te-sc-num { font-size: 22px; font-weight: 800; line-height: 1; }
.te-sc-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-top: 3px; opacity: .85; }
.te-sc-urgent    { background: rgba(239,68,68,.22);  color: #fca5a5; }
.te-sc-submitted { background: rgba(124,58,237,.2);  color: #c4b5fd; }
.te-sc-dim       { background: rgba(99,102,241,.12); color: #818cf8; opacity: .8; }

html[data-theme="light"] .te-sc            { background: rgba(67,56,202,.12); color: #3730a3; }
html[data-theme="light"] .te-sc-urgent     { background: rgba(239,68,68,.1);  color: #991b1b; }
html[data-theme="light"] .te-sc-submitted  { background: rgba(91,33,182,.12); color: #5b21b6; }
html[data-theme="light"] .te-sc-dim        { background: rgba(67,56,202,.08); color: #6366f1; opacity: .8; }

/* ── TE active tasks table ────────────────────────────────────────────────── */
.te-task-table-wrap {
  overflow-x: auto;
  margin-bottom: 24px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.te-task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.te-task-table thead tr { border-bottom: 1px solid var(--border); }
.te-task-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  white-space: nowrap;
  background: var(--card-bg);
}
.te-task-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
  background: var(--card-bg);
}
.te-task-table tbody tr:hover td { background: var(--hover-bg, rgba(255,255,255,.03)); }
.te-tr-revision  td:first-child { border-left: 3px solid #ef4444; padding-left: 11px; }
.te-tr-submitted td:first-child { border-left: 3px solid #7c3aed; padding-left: 11px; }
.te-ctrl-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; font-weight: 600;
  color: var(--ink); text-decoration: none;
}
.te-ctrl-link:hover { color: var(--heading-color); }
.te-uut-name { font-weight: 500; color: var(--ink); }
.te-company-cell { font-size: 12px; color: var(--muted); }
.btn-tbl {
  font-size: 12px; font-weight: 600;
  color: var(--heading-color);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid rgba(24,119,242,.3);
  border-radius: 6px;
  white-space: nowrap;
}
.btn-tbl:hover { background: rgba(24,119,242,.08); }
.te-days-badge {
  display: inline-block;
  font-size: 10px; font-weight: 600;
  background: rgba(45,212,191,.12); color: #2dd4bf;
  border-radius: 4px; padding: 1px 5px; margin-left: 4px;
}
.te-days-warn { background: rgba(249,115,22,.14); color: #f97316; }
.te-days-crit { background: rgba(239,68,68,.14);  color: #ef4444; }

html[data-theme="light"] .te-task-table th   { background: #f8fafc; }
html[data-theme="light"] .te-task-table td   { background: #fff; }
html[data-theme="light"] .te-task-table tbody tr:hover td { background: #f8fafc; }

/* ── Customer portal dashboard (Option B) ─────────────────────────────────── */
.cust-dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.cust-greeting {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}
.cust-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.cust-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.cust-stat {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.cust-stat.cust-stat-teal  { border-color: var(--accent); }
.cust-stat.cust-stat-amber { border-color: #f59e0b; }
.cust-stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.cust-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.cust-stat.cust-stat-teal  .cust-stat-value { color: #2dd4bf; }
.cust-stat.cust-stat-amber .cust-stat-value { color: #fbbf24; }
.cust-stat-sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.cust-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.cust-action-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  transition: border-color .15s;
  cursor: pointer;
}
.cust-action-card:hover { border-color: var(--accent); }
.cust-action-card.card-urgent { border-color: #f59e0b; }
.cust-action-card.card-urgent:hover { border-color: #f59e0b; }
.cust-action-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.cust-action-icon.icon-green  { background: rgba(22,163,74,.12); color: #4ade80; }
.cust-action-icon.icon-amber  { background: rgba(245,158,11,.12); color: #fbbf24; }
.cust-action-icon.icon-blue   { background: rgba(59,130,246,.12); color: #60a5fa; }
.cust-action-icon.icon-muted  { background: rgba(100,116,139,.1); color: var(--muted); }
.cust-action-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.cust-action-desc {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.cust-action-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
}
.cust-action-card.card-urgent .cust-action-link { color: #f59e0b; }

/* light-mode tweaks for customer dashboard */
html[data-theme="light"] .cust-action-icon.icon-green { background: rgba(22,163,74,.08); }
html[data-theme="light"] .cust-action-icon.icon-amber { background: rgba(245,158,11,.08); }
html[data-theme="light"] .cust-action-icon.icon-blue  { background: rgba(59,130,246,.08); }
html[data-theme="light"] .cust-stat.cust-stat-teal  .cust-stat-value { color: #0d9488; }
html[data-theme="light"] .cust-stat.cust-stat-amber .cust-stat-value { color: #b45309; }

/* ═══════════════════════════════════════════════════════════════════════════
   BOLD REDESIGN — 2026
   Appended override layer (wins by source order). A refined, premium lab-ops
   design system: deep slate surfaces, cohesive teal→cyan accent, larger radii,
   layered shadows, roomier tables, responsive nav. Dark-first + refined light.
   Also defines --ink-muted / --surface-raised (previously undefined).
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg:        #0a0d13;
  --bg-alt:    #0e131b;
  --card-bg:   #141a23;
  --surface:   #141a23;
  --surface-raised: #1b222d;
  --hover-bg:  rgba(255,255,255,0.05);

  --border:    rgba(255,255,255,0.08);
  --border-2:  rgba(255,255,255,0.16);

  --ink:       #eef2f7;
  --muted:     #99a4b4;
  --ink-muted: #99a4b4;
  --text:      #eef2f7;

  --teal:        #2dd4bf;
  --teal-dark:   #14b8a6;
  --accent:      #2dd4bf;
  --accent-2:    #22d3ee;
  --accent-grad: linear-gradient(135deg, #2dd4bf 0%, #22d3ee 100%);
  --teal-light:  rgba(45,212,191,0.13);
  --teal-border: rgba(45,212,191,0.32);

  --primary: #2dd4bf;
  --heading-color:  #eef2f7;
  --heading-accent: #5eead4;

  --amber: #fbbf24; --amber-bg: rgba(251,191,36,0.12);
  --green: #34d399; --green-bg: rgba(52,211,153,0.12);
  --red:   #f87171; --red-bg:   rgba(248,113,113,0.12);
  --blue:  #60a5fa; --blue-bg:  rgba(96,165,250,0.12);

  --radius:      16px;
  --radius-sm:   11px;
  --radius-lg:   22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.40);
  --shadow-md: 0 8px 24px -8px rgba(0,0,0,.55), 0 2px 6px -3px rgba(0,0,0,.45);
  --shadow-lg: 0 22px 55px -16px rgba(0,0,0,.68);
  --ring: 0 0 0 3px rgba(45,212,191,.32);
}

html[data-theme="light"] {
  --bg:        #f3f6fa;
  --bg-alt:    #ecf0f6;
  --card-bg:   #ffffff;
  --surface:   #ffffff;
  --surface-raised: #f6f8fc;
  --hover-bg:  rgba(15,23,42,0.04);
  --border:    #e4e8ef;
  --border-2:  #cbd3df;
  --ink:       #0f172a;
  --muted:     #57637a;
  --ink-muted: #57637a;
  --text:      #0f172a;
  --teal:      #0d9488;
  --teal-dark: #0f766e;
  --accent:    #0d9488;
  --accent-2:  #0891b2;
  --accent-grad: linear-gradient(135deg, #0d9488 0%, #0891b2 100%);
  --teal-light: #e6f6f4;
  --teal-border:#a3d8d1;
  --primary: #0d9488;
  --heading-color:  #0f172a;
  --heading-accent: #0d9488;
  --amber: #b45309; --amber-bg: #fef3c7;
  --green: #15803d; --green-bg: #dcfce7;
  --red:   #b91c1c; --red-bg:   #fee2e2;
  --blue:  #1d4ed8; --blue-bg:  #dbeafe;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow-md: 0 10px 28px -10px rgba(16,24,40,.16), 0 2px 6px -3px rgba(16,24,40,.08);
  --shadow-lg: 0 24px 55px -16px rgba(16,24,40,.22);
  --ring: 0 0 0 3px rgba(13,148,136,.22);
}

/* ── Ambient page glow ─────────────────────────────────────────────────────── */
body {
  background-image:
    radial-gradient(1100px 620px at 80% -10%, rgba(34,211,238,.10), transparent 60%),
    radial-gradient(880px 500px at 6% -2%, rgba(45,212,191,.08), transparent 55%);
}
html[data-theme="light"] body {
  background-image:
    radial-gradient(1000px 560px at 84% -12%, rgba(8,145,178,.09), transparent 60%),
    radial-gradient(800px 460px at 2% -6%, rgba(13,148,136,.07), transparent 55%);
}
h1, h2, h3 { letter-spacing: -0.01em; }

/* ── Topbar & navigation ───────────────────────────────────────────────────── */
.topbar { background: rgba(10,13,19,0.80); border-bottom: 1px solid var(--border); }
html[data-theme="light"] .topbar { background: rgba(255,255,255,0.82); }
.topbar-inner { position: relative; padding: 10px clamp(16px, 6vw, 84px); gap: 12px; }
.brand-logo { height: 26px; }
.brand-sub {
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding-left: 10px;
}
.topnav { display: flex; align-items: center; gap: 2px; }
.topnav a {
  margin-left: 2px; padding: 7px 13px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 500; color: var(--muted);
  border-bottom: none !important; transition: background .15s, color .15s;
}
.topnav a:hover { color: var(--ink); background: var(--hover-bg); }
.topnav a.active {
  color: var(--ink); background: var(--teal-light);
  box-shadow: inset 0 0 0 1px var(--teal-border);
}
.userpill {
  background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--border);
  font-weight: 600; color: var(--ink) !important;
}
.userpill:hover { background: var(--hover-bg); }
.notif-bell { font-size: 15px; }
.nav-dropdown-toggle {
  padding: 7px 13px; border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 500;
  color: var(--muted); background: transparent; border: none; cursor: pointer;
}
.nav-dropdown-toggle:hover, .nav-dropdown-toggle.active {
  color: var(--ink); background: var(--hover-bg);
}
.nav-dropdown-menu {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px;
}
.nav-dropdown-menu a { border-radius: 8px; padding: 8px 12px; }
.nav-badge { background: var(--accent-grad); color: #06231f; }
.nav-badge-notif { background: #ef4444; color: #fff; }
.theme-toggle {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-raised); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--border-2); }
.theme-toggle svg { width: 16px; height: 16px; }

/* Hamburger (mobile) */
.nav-burger { display: none; }
.nav-toggle-cb { display: none; }
@media (max-width: 1040px) {
  .nav-burger {
    display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
    width: 42px; height: 42px; border-radius: 12px; cursor: pointer; font-size: 20px;
    border: 1px solid var(--border-2); background: var(--surface-raised); color: var(--ink);
  }
  .topnav {
    position: absolute; top: calc(100% + 8px); right: clamp(16px, 6vw, 84px);
    left: clamp(16px, 6vw, 84px); flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 10px;
    display: none; z-index: 40; max-height: 76vh; overflow-y: auto;
  }
  .nav-toggle-cb:checked ~ .topnav { display: flex; }
  .topnav a, .nav-dropdown, .nav-dropdown-toggle { width: 100%; }
  .topnav a { padding: 11px 14px; font-size: 15px; }
  .nav-dropdown-menu {
    position: static; box-shadow: none; border: none; padding: 2px 0 2px 12px; margin-top: 2px;
    background: transparent;
  }
  .theme-toggle { align-self: flex-start; margin-top: 4px; }
}

/* ── Page shell ────────────────────────────────────────────────────────────── */
.page { padding: 22px clamp(16px, 6vw, 84px) 56px; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm); transition: border-color .2s, box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title, .section-heading, .form-section h2 {
  color: var(--heading-color); font-weight: 650; letter-spacing: -0.01em;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--surface-raised); color: var(--ink);
  font-weight: 550; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--hover-bg); border-color: var(--border-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--accent-grad); border: none; color: #06231f; font-weight: 700;
  box-shadow: 0 6px 18px -6px rgba(45,212,191,.5);
}
.btn-primary:hover { filter: brightness(1.05); color: #06231f; }
html[data-theme="light"] .btn-primary { color: #ffffff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: var(--hover-bg); color: var(--ink); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-tbl {
  border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface-raised);
  color: var(--ink); font-weight: 550;
}
.btn-tbl:hover { background: var(--teal-light); border-color: var(--teal-border); color: var(--ink); }

/* ── Inputs / focus ────────────────────────────────────────────────────────── */
input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="tel"], select, textarea {
  border-radius: var(--radius-sm); border: 1px solid var(--border-2);
  background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: var(--ring);
}
.searchbar input[type="search"] { border-radius: var(--radius-pill); padding-left: 16px; }

/* ── Tables — roomier, sticky header ───────────────────────────────────────── */
.table-card { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.table-card > .data-table { display: block; overflow-x: auto; }
.data-table { font-size: 13.5px; }
.data-table th, .data-table td { padding: 13px 16px; vertical-align: middle; }
.data-table th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-raised); color: var(--muted);
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr { border-bottom: 1px solid var(--border); }
.data-table tbody tr:hover { background: var(--hover-bg); }
.data-table td { color: var(--ink); }

/* ── Badges / status pills ─────────────────────────────────────────────────── */
.badge { padding: 4px 11px; font-weight: 650; font-size: 11.5px; letter-spacing: .01em; }
.badge-domain { background: rgba(129,140,248,0.14); color: #a5b4fc; border: 1px solid rgba(129,140,248,0.28); }

/* ── Banners ───────────────────────────────────────────────────────────────── */
.banner { border-radius: var(--radius-sm); padding: 14px 18px; font-weight: 500; }

/* ── Priority tiles (dashboard) ────────────────────────────────────────────── */
.priority-tiles { gap: 14px; }

/* Wide multi-column tables (e.g. All Requisitions): give columns room and let
   the row scroll horizontally on narrow viewports instead of crushing text. */
.data-table--wide { min-width: 1000px; }
.data-table--wide td { vertical-align: middle; }
.data-table--wide td:first-child, .data-table--wide th:first-child { padding-left: 18px; }
.data-table .mono { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Print stylesheet ──────────────────────────────────────────────────────────
   Printing (e.g. an accession/QR label, or a requisition detail page) should be
   clean black-on-white with the app chrome removed and collapsible cards forced
   open so nothing is hidden on paper. */
@media print {
  :root, html[data-theme="light"] {
    --bg: #fff; --bg-alt: #fff; --card-bg: #fff; --surface: #fff;
    --surface-raised: #fff; --ink: #000; --text: #000; --muted: #444;
    --border: #bbb; --border-2: #999;
  }
  body { background: #fff !important; background-image: none !important; color: #000; }
  .topbar, .sitefoot, .nav-burger, .theme-toggle, .searchbar, .trf-filters,
  .trf-pager, .dash-aside, .toc, .page-head-actions, .btn { display: none !important; }
  .page { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #bbb; break-inside: avoid; }
  /* Force any collapsible cards open for print */
  [data-collapsed] { max-height: none !important; overflow: visible !important; }
  a { color: #000; text-decoration: none; }
}

/* ── TE / RC dashboard kanban board ────────────────────────────────────────── */
.te-kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 8px 0 20px; align-items: start; }
@media (max-width: 1100px) { .te-kanban { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .te-kanban { grid-template-columns: 1fr; } }
.te-col { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.te-col-head { display: flex; align-items: center; justify-content: space-between;
               padding: 10px 14px; border-bottom: 1px solid var(--border);
               font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.te-col-title { color: var(--ink); }
.te-col-count { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px;
                display: inline-flex; align-items: center; justify-content: center;
                font-size: 12px; font-weight: 800; background: var(--surface-raised); color: var(--muted); }
/* Column accents (left edge + count colour) */
.te-col-sent       { border-top: 3px solid var(--red); }
.te-col-sent .te-col-count       { background: var(--red-bg); color: var(--red); }
.te-col-notstarted { border-top: 3px solid var(--border-2); }
.te-col-progress   { border-top: 3px solid var(--amber); }
.te-col-progress .te-col-count   { background: var(--amber-bg); color: var(--amber); }
.te-col-awaiting   { border-top: 3px solid var(--blue); }
.te-col-awaiting .te-col-count   { background: var(--blue-bg); color: var(--blue); }
.te-col-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.te-card { display: block; background: var(--card-bg); border: 1px solid var(--border);
           border-radius: var(--radius-sm); padding: 11px 12px; text-decoration: none;
           box-shadow: var(--shadow-sm); transition: transform .1s, border-color .15s, box-shadow .15s; }
.te-card:hover { transform: translateY(-2px); border-color: var(--border-2);
                 box-shadow: var(--shadow-md); text-decoration: none; }
.te-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.te-card-ctrl { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
                font-size: 12.5px; font-weight: 700; color: var(--ink); }
.te-card-prog { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.te-card-uut { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.te-card-co  { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.te-progbar { margin-top: 8px; height: 6px; border-radius: 999px; background: var(--surface-raised); overflow: hidden; }
.te-progbar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent-grad); }
.te-card-days { margin-top: 7px; font-size: 11px; color: var(--muted); }
.te-col-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 10px 0; margin: 0; opacity: .7; }
