/* ==========================================================================
   DOUSEA SYSTEMS — CONTROLS TECH QUIZ & STANDALONE TECH REVIEW DASHBOARD
   ========================================================================== */

body.quiz-page,
body.review-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 900px 500px at 12% 0%, rgba(14, 165, 233, 0.14), transparent 65%),
    radial-gradient(ellipse 800px 460px at 90% 8%, rgba(168, 85, 247, 0.12), transparent 65%),
    #070b15;
  color: var(--text);
}

.quiz-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(7, 11, 21, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.quiz-topbar-inner {
  max-width: 1460px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.quiz-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.quiz-nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quiz-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 20px 60px;
}

.review-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px 20px 64px;
}

/* Auth Gate Card */
.auth-gate-wrap {
  max-width: 480px;
  margin: 48px auto;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  background: rgba(7, 11, 21, 0.65);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.auth-tab-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.auth-tab-btn.active {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
}

/* KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px 17px;
}

.kpi-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 6px;
}

.kpi-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
}

.kpi-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Resume Banner */
.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  margin-bottom: 20px;
}

/* Tier Cards Grid */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.tier-card {
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: border-color 0.2s, transform 0.15s;
}

.tier-card:hover:not(.locked) {
  border-color: rgba(56, 189, 248, 0.5);
}

.tier-card.certified {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.07), rgba(15, 23, 42, 0.9));
}

.tier-card.tier-scada {
  border-color: rgba(168, 85, 247, 0.45);
}

.tier-card.locked {
  opacity: 0.65;
  filter: saturate(0.6);
}

.tier-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tier-title {
  font-size: 1.04rem;
  font-weight: 800;
  color: #fff;
  margin: 4px 0 3px;
}

.tier-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.tier-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tier-chip {
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.24);
  color: #bae6fd;
}

.tier-actions {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tier-practice-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tier-practice-row select {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.74rem;
}

/* Active Exam / Practice Runner */
.runner-card {
  max-width: 880px;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 18px;
  padding: 24px 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.runner-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.runner-progress-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 18px;
}

.runner-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #10b981);
  transition: width 0.25s ease;
}

.quiz-prompt-text {
  font-size: 1.06rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.55;
  margin-bottom: 16px;
}

.quiz-prompt-text p {
  margin: 0 0 10px;
  white-space: pre-wrap;
}

.quiz-prompt-text p:last-child {
  margin-bottom: 0;
}

.quiz-code-block {
  margin: 10px 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #050a14;
  border: 1px solid rgba(56, 189, 248, 0.32);
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.52;
  color: #e2e8f0;
  overflow-x: auto;
  white-space: pre;
}

.quiz-inline-code {
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 0.9em;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #bae6fd;
  padding: 1px 5px;
  border-radius: 5px;
}

.quiz-diagram-box {
  margin-bottom: 18px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(7, 11, 21, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.25);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.quiz-diagram-box.zoomable {
  cursor: zoom-in;
}

.quiz-diagram-box.zoomable:hover {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.16);
}

.quiz-diagram-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.quiz-zoom-hint {
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: #cbd5e1;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.quiz-svg {
  width: 100%;
  height: auto;
  display: block;
}

.quiz-media-img {
  max-width: 100%;
  max-height: 360px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
}

/* Full-Screen Zoom Lightbox (for Code Screenshots & Electrical Schematics) */
.zoom-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(8px);
  padding: 24px;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.zoom-lightbox.open {
  display: flex;
}

.zoom-lightbox-card {
  position: relative;
  max-width: 95vw;
  max-height: 92vh;
  background: #0b1120;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 14px;
  padding: 14px 16px 16px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: default;
}

.zoom-lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.zoom-lightbox-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #e2e8f0;
}

.zoom-lightbox-close {
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f8fafc;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.zoom-lightbox-close:hover {
  background: rgba(239, 68, 68, 0.24);
  border-color: rgba(239, 68, 68, 0.55);
}

.zoom-lightbox-body {
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 92vw;
  max-height: 82vh;
}

.zoom-lightbox-body img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.zoom-lightbox-body svg {
  width: min(1100px, 88vw);
  height: auto;
  max-height: 80vh;
  display: block;
}

/* Question Editor Diagram / Screenshot Uploader & Preview */
.media-drop-zone {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px dashed rgba(56, 189, 248, 0.42);
  background: rgba(15, 23, 42, 0.65);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.media-drop-zone:hover,
.media-drop-zone.dragover {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.14);
}

.media-drop-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #e2e8f0;
}

.media-drop-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.media-drop-status {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 5px;
  display: none;
}

.qe-diagram-preview {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(7, 11, 21, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.qe-diagram-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.qe-diagram-preview-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #34d399;
}

.qe-diagram-preview-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.qe-diagram-preview-body img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.qe-diagram-preview-body svg {
  width: 100%;
  max-height: 220px;
  height: auto;
  display: block;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.quiz-opt-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.quiz-opt-btn:hover:not(:disabled) {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.08);
}

.quiz-opt-btn.selected {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.18);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.quiz-opt-btn.correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.18);
}

.quiz-opt-btn.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.18);
}

.quiz-opt-letter {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
  color: #e2e8f0;
}

.quiz-opt-btn.selected .quiz-opt-letter {
  background: #0ea5e9;
  border-color: #38bdf8;
  color: #fff;
}

.practice-feedback-box {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 0.84rem;
  line-height: 1.55;
}

.practice-feedback-box.ok {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #d1fae5;
}

.practice-feedback-box.bad {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fee2e2;
}

.floor-tip-line {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.18);
  color: #fde68a;
  font-size: 0.8rem;
}

.runner-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Pause Overlay (Tab Blur / 90s Idle) */
.pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(4, 7, 15, 0.92);
  backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pause-card {
  max-width: 440px;
  width: 100%;
  background: #0f172a;
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 18px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* Results Card */
.result-hero {
  text-align: center;
  padding: 22px;
  border-radius: 14px;
  margin-bottom: 18px;
}

.result-hero.pass {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.result-hero.fail {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.45);
}

/* ==========================================================================
   STANDALONE TECH REVIEW & SKILLS MATRIX DASHBOARD
   ========================================================================== */

.review-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.review-tab-btn {
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
}

.review-tab-btn:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #fff;
}

.review-tab-btn.active {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border-color: #38bdf8;
  color: #fff;
}

.review-view {
  display: none;
}

.review-view.active {
  display: block;
}

/* Heatmap Skills Matrix Table */
.matrix-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.matrix-table th,
.matrix-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  border-right: 1px solid rgba(148, 163, 184, 0.08);
  text-align: center;
  white-space: nowrap;
}

.matrix-table th {
  background: rgba(15, 23, 42, 0.96);
  color: #cbd5e1;
  font-weight: 700;
  font-size: 0.7rem;
  position: sticky;
  top: 0;
  z-index: 3;
}

.matrix-table td:first-child,
.matrix-table th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 2;
  background: #0c1426;
  min-width: 180px;
}

.matrix-table th:first-child {
  z-index: 4;
}

.heat-cell {
  display: inline-block;
  min-width: 48px;
  padding: 3px 7px;
  border-radius: 6px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
}

.heat-green { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.45); }
.heat-amber { background: rgba(245, 158, 11, 0.22); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.45); }
.heat-red   { background: rgba(239, 68, 68, 0.22);  color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.45); }
.heat-none  { background: rgba(100, 116, 139, 0.14); color: #64748b; border: 1px solid rgba(100, 116, 139, 0.2); }

.flag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  margin: 2px;
}

.flag-chip.ok {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.deepdive-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}

@media (max-width: 960px) {
  .deepdive-grid { grid-template-columns: 1fr; }
}

.tech-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 680px;
  overflow-y: auto;
}

.tech-picker-btn {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  cursor: pointer;
}

.tech-picker-btn.active {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.18);
}

/* Dedicated Clean White Print / PDF Layout */
#print-report-root {
  display: none;
}

@media print {
  @page {
    size: letter landscape;
    margin: 0.38in;
  }

  body.review-page {
    background: #ffffff !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #dousea-site-nav,
  .quiz-topbar,
  .review-shell,
  .login-overlay,
  .toast-wrap {
    display: none !important;
  }

  #print-report-root {
    display: block !important;
    width: 100%;
    max-width: 100%;
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  }

  .pr-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 8px;
    margin-bottom: 10px;
  }

  .pr-title { font-size: 16pt; font-weight: 800; color: #0f172a; margin: 0; }
  .pr-sub { font-size: 8.5pt; color: #475569; margin-top: 2px; }
  .pr-meta { text-align: right; font-size: 8pt; color: #334155; }

  .pr-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
  }

  .pr-kpi {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 9px;
    background: #f8fafc;
  }

  .pr-kpi-lbl { font-size: 7pt; text-transform: uppercase; color: #64748b; font-weight: 700; }
  .pr-kpi-val { font-size: 12pt; font-weight: 800; color: #0f172a; margin-top: 2px; }

  .pr-legend {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 7.5pt;
    color: #334155;
    margin: 4px 0 8px;
  }

  .pr-legend-chip {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid #cbd5e1;
    font-weight: 700;
  }

  .pr-section-title {
    font-size: 10pt;
    font-weight: 800;
    color: #0f172a;
    margin: 10px 0 5px;
    border-left: 4px solid #0284c7;
    padding-left: 8px;
  }

  .pr-tier-block {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 10px;
  }

  .pr-page-break {
    break-before: page;
    page-break-before: always;
  }

  .pr-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 7.6pt;
    margin-bottom: 10px;
  }

  .pr-table thead {
    display: table-header-group;
  }

  .pr-table tbody tr {
    background: #ffffff !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .pr-table tbody tr:nth-child(even) {
    background: #f8fafc !important;
  }

  .pr-table thead th,
  .pr-table th {
    position: static !important;
    background: #0f172a !important;
    color: #ffffff !important;
    padding: 4.5px 5px !important;
    text-align: center !important;
    border: 1px solid #0f172a !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  .pr-table td {
    padding: 4px 5px !important;
    border: 1px solid #cbd5e1 !important;
    text-align: center !important;
    color: #0f172a !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  .pr-table td:first-child,
  .pr-table th:first-child { text-align: left !important; }

  .pr-table td.pr-green, .pr-green { background: #d1fae5 !important; color: #065f46 !important; font-weight: 700 !important; }
  .pr-table td.pr-amber, .pr-amber { background: #fef3c7 !important; color: #92400e !important; font-weight: 700 !important; }
  .pr-table td.pr-red,   .pr-red   { background: #fee2e2 !important; color: #991b1b !important; font-weight: 700 !important; }
  .pr-table td.pr-muted, .pr-muted { background: #f1f5f9 !important; color: #64748b !important; }

  .pr-signoff {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    font-size: 8.5pt;
    color: #334155;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .pr-sign-line {
    border-top: 1px solid #475569;
    padding-top: 4px;
    margin-top: 22px;
  }
}

/* ==========================================================================
   ADMIN PLC LEVEL MANAGER & MODAL EDITOR
   ========================================================================== */

.plc-lvl-modal-card {
  max-width: 960px !important;
  width: 96% !important;
  max-height: calc(100vh - 30px);
  overflow-y: auto;
}

.plm-pub-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  font-weight: 700;
  color: #cbd5e1;
  cursor: pointer;
}
.plm-pub-toggle input { width: 15px; height: 15px; accent-color: #10b981; cursor: pointer; }

.plm-subtabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.plm-subtab {
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}
.plm-subtab:hover { color: #fff; border-color: rgba(56, 189, 248, 0.5); }
.plm-subtab.active {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border-color: #38bdf8;
  color: #fff;
}

.plm-pane { display: none; }
.plm-pane.active { display: block; }

.plm-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plm-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.plm-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 780px) {
  .plm-grid-2, .plm-grid-3, .plm-grid-4 { grid-template-columns: 1fr; }
}

.plm-section-box {
  background: rgba(10, 17, 34, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.plm-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: #e2e8f0;
}
.plm-dyn-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plm-row-card {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 9px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.plm-inline-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}
.plm-inline-row .form-input {
  padding: 6px 8px;
  font-size: 0.75rem;
}

.plm-visual-studio-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.32), rgba(14, 165, 233, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.plm-test-card {
  background: rgba(10, 17, 34, 0.86);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 11px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plm-step-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.16);
}
.plm-step-row .form-input {
  padding: 5px 7px;
  font-size: 0.73rem;
}

.plm-live-test-result {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 11px;
  background: rgba(9, 15, 30, 0.92);
  border: 1px solid var(--border);
  font-size: 0.78rem;
}
.plm-live-test-result.pass { border-color: rgba(16, 185, 129, 0.55); }
.plm-live-test-result.fail { border-color: rgba(239, 68, 68, 0.5); }

.plm-order-btns {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.plm-order-btn {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 0.68rem;
  cursor: pointer;
}
.plm-order-btn:hover:not(:disabled) { border-color: #38bdf8; color: #fff; }
.plm-order-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.rs-day-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  font-size: 0.74rem;
  font-weight: 700;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}
.rs-day-pill:has(input:checked) {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(14, 165, 233, 0.18);
  color: #fff;
}
