/* =========================================
   SafetyChex — Stylesheet
   Brand family: Summit / Captive ecosystem
   Colors: Navy #0D1F3C | Green #1B8C4F | Gunmetal #2C2C2C | Light #F5F5F3
   ========================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #0D1F3C;
  --green: #1B8C4F;
  --green-dark: #157A42;
  --green-light: #E8F5EE;
  --orange: #E6862C;
  --orange-light: #FFF3E8;
  --red: #DC3545;
  --gunmetal: #2C2C2C;
  --light: #F5F5F3;
  --white: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #E2E2E2;
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1100px;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ---- PAGES ---- */
.page { display: none; min-height: 100vh; }
.page.active { display: block; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  font-family: inherit;
}
.btn-green { background: var(--green); color: var(--white); border-color: var(--green); }
.btn-green:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-navy { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-navy:hover { background: #162d54; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: 13px; min-height: 32px; }
.btn-lg { padding: 16px 36px; font-size: 17px; }
.full-width { width: 100%; text-align: center; }

/* ---- NAV ---- */
.nav { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 28px; }
.logo-text { font-size: 22px; font-weight: 800; color: var(--navy); }
.logo-accent { color: var(--green); }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav-links a:hover { color: var(--green); }
.hamburger { display: none; background: none; border: none; font-size: 24px; cursor: pointer; padding: 8px; }
.lang-toggle { background: var(--light); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--navy); }

.mobile-menu { display: none; flex-direction: column; gap: 12px; padding: 16px 20px; background: var(--white); border-bottom: 1px solid var(--border); }
.mobile-menu.open { display: flex; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
}

/* ---- HERO ---- */
.hero { padding: 80px 0 60px; text-align: center; background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 100%); color: var(--white); }
.hero-badge { display: inline-block; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); border-radius: 20px; padding: 6px 16px; font-size: 13px; font-weight: 500; margin-bottom: 24px; }
.hero h1 { font-size: 48px; font-weight: 800; line-height: 1.15; margin-bottom: 20px; }
.hero-sub { font-size: 18px; color: rgba(255,255,255,0.85); max-width: 600px; margin: 0 auto 32px; line-height: 1.6; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats { display: flex; justify-content: center; gap: 48px; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-num { font-size: 28px; font-weight: 800; }
.stat-label { font-size: 14px; color: rgba(255,255,255,0.7); }

@media (max-width: 768px) {
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 32px; }
  .hero-sub { font-size: 16px; }
  .hero-stats { gap: 24px; }
}

/* ---- FEATURES ---- */
.features { padding: 80px 0; background: var(--light); }
.section-title { text-align: center; font-size: 32px; font-weight: 800; color: var(--navy); margin-bottom: 48px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card { background: var(--white); border-radius: var(--radius-lg); padding: 32px 24px; text-align: center; border: 1px solid var(--border); }
.feature-icon { font-size: 40px; margin-bottom: 16px; }
.feature-card h3 { font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-muted); line-height: 1.5; }

@media (max-width: 768px) {
  .feature-grid { grid-template-columns: 1fr; gap: 16px; }
  .section-title { font-size: 24px; margin-bottom: 32px; }
}

/* ---- HOW IT WORKS ---- */
.how-it-works { padding: 80px 0; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step { text-align: center; }
.step-num { width: 48px; height: 48px; border-radius: 50%; background: var(--green); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; margin: 0 auto 16px; }
.step h3 { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--text-muted); }

@media (max-width: 768px) {
  .steps { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 480px) {
  .steps { grid-template-columns: 1fr; }
}

/* ---- FOOTER ---- */
.footer { background: var(--white); border-top: 1px solid var(--border); padding: 40px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-brand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-tagline { font-size: 14px; color: var(--text-muted); }
.footer-copy { font-size: 13px; color: var(--text-muted); text-align: right; }

/* ---- LOGIN ---- */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--light); padding: 20px; }
.login-card { background: var(--white); border-radius: var(--radius-lg); padding: 40px 32px; max-width: 420px; width: 100%; border: 1px solid var(--border); }
.login-logo { justify-content: center; margin-bottom: 24px; }
.login-card h2 { text-align: center; font-size: 24px; color: var(--navy); margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 14px; font-size: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; background: var(--white); min-height: 44px;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(27,140,79,0.1); }
.login-card .btn { margin-top: 8px; }
.login-alt { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }
.login-alt a { color: var(--green); font-weight: 600; text-decoration: none; }
.login-lang { margin-top: 16px; display: block; width: 100%; text-align: center; }
.back-link { display: block; text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); text-decoration: none; }
.back-link:hover { color: var(--green); }

/* ---- ROLE SELECT ---- */
.roles-sub { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.role-buttons { display: flex; flex-direction: column; gap: 12px; }
.role-btn {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--light);
  border: 2px solid var(--border); border-radius: var(--radius-lg); cursor: pointer;
  text-align: left; font-family: inherit; transition: all var(--transition); min-height: 64px;
}
.role-btn:hover { border-color: var(--green); background: var(--green-light); }
.role-icon { font-size: 28px; flex-shrink: 0; }
.role-label { font-size: 16px; font-weight: 700; color: var(--navy); display: block; }
.role-desc { font-size: 13px; color: var(--text-muted); display: block; }

/* ---- APP SHELL ---- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; background: var(--light); }
.app-header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.app-header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 16px; max-width: var(--max-width); margin: 0 auto; }
.app-header-right { display: flex; align-items: center; gap: 8px; }
.logo-sm { font-size: 16px; font-weight: 700; color: var(--navy); }
.logo-sm .logo-accent { color: var(--green); }
.lang-toggle-sm { background: var(--light); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; font-size: 12px; font-weight: 600; cursor: pointer; }
.back-btn { background: none; border: none; font-size: 15px; font-weight: 600; cursor: pointer; color: var(--navy); font-family: inherit; padding: 8px; }
.reviewer-badge { background: var(--orange-light); color: var(--orange); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 4px; }

.app-main, .app-content { flex: 1; padding-bottom: 80px; overflow-y: auto; }
.app-container { max-width: 600px; margin: 0 auto; padding: 20px 16px; }

/* ---- GREETING ---- */
.greeting h1 { font-size: 24px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.greeting p { color: var(--text-muted); font-size: 15px; margin-bottom: 20px; }

/* ---- SECTION LABELS ---- */
.section-label { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 24px 0 12px; }

/* ---- TRAINING LIST ---- */
.training-list { display: flex; flex-direction: column; gap: 10px; }
.training-card {
  background: var(--white); border-radius: var(--radius); padding: 16px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer;
  transition: all var(--transition); min-height: 64px;
}
.training-card:hover { border-color: var(--green); }
.training-info { flex: 1; }
.training-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.training-meta { font-size: 13px; color: var(--text-muted); }
.training-status { font-size: 14px; font-weight: 600; white-space: nowrap; }
.status-pending { color: var(--green); }
.status-done { color: var(--text-muted); }
.training-done { opacity: 0.7; }

/* ---- BOTTOM NAV ---- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--white);
  border-top: 1px solid var(--border); display: flex; justify-content: space-around;
  padding: 8px 0 env(safe-area-inset-bottom, 8px); z-index: 100;
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 11px; color: var(--text-muted); padding: 4px 0; flex: 1;
}
.bottom-nav-item.active { color: var(--green); }
.nav-icon { font-size: 20px; }

/* ---- DASH STATS ---- */
.dash-stats { display: flex; gap: 12px; margin-bottom: 24px; }
.dash-stat {
  flex: 1; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center;
}
.dash-stat-num { font-size: 28px; font-weight: 800; color: var(--navy); }
.dash-stat-num.green { color: var(--green); }
.dash-stat-num.orange { color: var(--orange); }
.dash-stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ---- PROJECT LIST ---- */
.project-list { display: flex; flex-direction: column; gap: 10px; }
.project-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: all var(--transition); position: relative;
}
.project-card:hover { border-color: var(--green); }
.project-name { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 2px; }
.project-gc { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.project-completed { opacity: 0.6; }
.project-arrow { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--text-muted); }
.gc-project { padding-right: 40px; }

/* ---- PROGRESS BAR ---- */
.progress-bar { height: 8px; background: var(--light); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.progress-fill { height: 100%; background: var(--green); border-radius: 4px; transition: width 0.5s ease; }
.progress-label { font-size: 13px; color: var(--text-muted); }

/* ---- EMPLOYEE LIST ---- */
.employee-list { display: flex; flex-direction: column; gap: 6px; }
.emp-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; min-height: 44px;
}
.emp-name { font-size: 15px; font-weight: 500; }
.emp-status { font-size: 18px; }

/* ---- SUB LIST (GC view) ---- */
.sub-list { display: flex; flex-direction: column; gap: 10px; }
.sub-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.sub-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sub-name { font-size: 16px; font-weight: 700; color: var(--navy); }
.sub-score { font-size: 20px; font-weight: 800; }
.sub-score.green { color: var(--green); }
.sub-score.orange { color: var(--orange); }
.sub-detail { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }

/* ---- GC ACTIONS ---- */
.gc-actions { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }

/* ---- VIDEO PLAYER ---- */
.player-main { background: var(--white); }
.video-wrapper { margin: 0 -16px; }
.video-placeholder { background: #111; aspect-ratio: 16/9; position: relative; overflow: hidden; }
.video-fake { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; background: linear-gradient(135deg, #0D1F3C 0%, #1a3a5c 50%, #0D1F3C 100%); }
.video-play-overlay { display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; }
.play-btn-big { width: 72px; height: 72px; border-radius: 50%; background: var(--green); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 28px; transition: transform var(--transition); }
.play-btn-big:hover { transform: scale(1.1); }
.video-title-overlay { color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 500; }
.video-progress-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: rgba(255,255,255,0.2); }
.video-progress-fill { height: 100%; background: var(--green); width: 0; transition: width 0.3s linear; }

/* ---- CHECKPOINT ---- */
.checkpoint-question { padding: 0 16px; margin-top: 16px; }
.checkpoint-card { background: var(--green-light); border: 2px solid var(--green); border-radius: var(--radius-lg); padding: 20px; text-align: center; }
.checkpoint-card h3 { font-size: 16px; color: var(--green-dark); margin-bottom: 8px; }
.checkpoint-card p { font-size: 15px; color: var(--text); margin-bottom: 16px; }
.checkpoint-options { display: flex; flex-direction: column; gap: 8px; }
.checkpoint-opt {
  padding: 14px; border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--white); font-size: 15px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: all var(--transition); min-height: 48px;
}
.checkpoint-opt:hover { border-color: var(--green); }
.checkpoint-opt.correct { background: var(--green); color: var(--white); border-color: var(--green); }
.checkpoint-opt.wrong { background: var(--red); color: var(--white); border-color: var(--red); }

/* ---- QUIZ ---- */
.quiz-section { margin-top: 24px; }
.quiz-section h2 { font-size: 20px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.quiz-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.quiz-q { margin-bottom: 20px; }
.quiz-q-text { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.quiz-q-num { color: var(--text-muted); }
.quiz-opts { display: flex; flex-direction: column; gap: 6px; }
.quiz-opt {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 2px solid var(--border);
  border-radius: var(--radius); cursor: pointer; font-size: 15px; transition: all var(--transition);
  min-height: 48px; background: var(--white);
}
.quiz-opt:hover { border-color: var(--green); }
.quiz-opt.selected { border-color: var(--green); background: var(--green-light); }
.quiz-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.quiz-opt.selected .quiz-radio { border-color: var(--green); background: var(--green); }
.quiz-opt.selected .quiz-radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--white); }

/* ---- RESULTS ---- */
.results-section { margin-top: 24px; }
.results-card { text-align: center; padding: 40px 24px; border-radius: var(--radius-lg); }
.results-card.passed { background: var(--green-light); border: 2px solid var(--green); }
.results-card.failed { background: #FEE2E2; border: 2px solid var(--red); }
.results-icon { font-size: 56px; margin-bottom: 12px; }
.results-title { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.results-score { font-size: 18px; color: var(--text-muted); margin-bottom: 24px; }
.results-card .btn { margin-top: 12px; }

/* ---- INSPECTION ---- */
.inspection-header { margin-bottom: 20px; }
.inspection-header h2 { font-size: 20px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.inspection-header p { font-size: 14px; color: var(--text-muted); }
.inspection-items { display: flex; flex-direction: column; gap: 10px; }
.inspection-item {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.inspection-label { font-size: 15px; font-weight: 500; color: var(--text); }
.inspection-actions { display: flex; gap: 10px; }
.inspect-btn {
  flex: 1; padding: 12px; border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--white); font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all var(--transition); min-height: 48px;
}
.inspect-btn:hover { border-color: var(--green); }
.inspect-btn.active-pass { background: var(--green-light); border-color: var(--green); color: var(--green-dark); }
.inspect-btn.active-fail { background: #FEE2E2; border-color: var(--red); color: var(--red); }

.issue-note { margin-top: 16px; background: #FFF8E1; border: 2px solid var(--orange); border-radius: var(--radius-lg); padding: 20px; }
.issue-note h3 { font-size: 16px; margin-bottom: 12px; }
.issue-note textarea { width: 100%; min-height: 80px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; font-size: 15px; margin-bottom: 10px; resize: vertical; }
.issue-note .btn { margin-bottom: 8px; }
.inspection-submit { margin-top: 24px; }

/* ---- INSPECTION SUMMARY ---- */
.inspection-summary-list { display: flex; flex-direction: column; gap: 8px; }
.inspection-summary { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.inspection-flagged { border-color: var(--orange); background: var(--orange-light); }
.insp-s-title { font-size: 14px; font-weight: 600; }
.insp-s-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.insp-pass { color: var(--green); font-weight: 600; }
.insp-fail { color: var(--orange); font-weight: 600; }
.insp-issue { font-size: 13px; color: var(--orange); margin-top: 6px; font-style: italic; }

/* ---- OSHA SOURCE LINK ---- */
.osha-link { display: inline-block; font-size: 12px; color: var(--green); text-decoration: none; font-weight: 600; margin-top: 4px; }
.osha-link:hover { text-decoration: underline; }

/* ---- UTILITIES ---- */
.green { color: var(--green); }
.orange { color: var(--orange); }

/* ---- SDS TABS ---- */
.sds-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--light);
  padding: 4px;
  border-radius: 999px;
}
.sds-tab {
  flex: 1;
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s ease;
}
.sds-tab.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(13,31,60,0.12);
}
.sds-tab:hover:not(.active) { color: var(--navy); }

/* ---- SDS CARD ENHANCEMENTS ---- */
.sds-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sds-source-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e8f5ee;
  color: #1B8C4F;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #b3ddc4;
}
.sds-revision-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f0f4fa;
  color: #013369;
  font-size: 11px;
  font-weight: 600;
}
.sds-project-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--orange-light);
  color: var(--orange);
  font-size: 11px;
  font-weight: 600;
}

/* ---- MODAL OVERLAY ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
@media (min-width: 480px) {
  .modal-overlay { align-items: center; padding: 24px 16px; }
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13,31,60,0.65);
}
.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(13,31,60,0.18);
  max-height: 92vh;
  overflow-y: auto;
  z-index: 1;
}
@media (min-width: 480px) {
  .modal-dialog { border-radius: 20px; }
}
.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 2;
}
.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
}
.modal-close-btn {
  background: var(--light);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.modal-close-btn:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 16px 20px 28px; }

/* ---- SDS MODAL SPECIFICS ---- */
.sds-hazard-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.sds-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  background: var(--white);
  transition: all 0.15s;
  user-select: none;
}
.sds-check-label:hover { border-color: var(--green); background: var(--green-light); }
.sds-check-label input[type=checkbox] { accent-color: var(--green); width: 15px; height: 15px; }
.sds-file-drop {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: border-color 0.2s;
  background: var(--light);
  margin-top: 4px;
}
.sds-file-drop:hover { border-color: var(--green); color: var(--green); }
.sds-dedup-notice {
  background: var(--orange-light);
  border: 1.5px solid var(--orange);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--gunmetal);
}


.toolbox-talk-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toolbox-talk-item .osha-link {
  margin-left: 16px;
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.certificate-open {
  overflow: hidden;
}

.certificate-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.certificate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 31, 60, 0.72);
}

.certificate-dialog {
  position: relative;
  width: 100%;
  max-width: 900px;
  z-index: 1;
}

.certificate-sheet {
  background: #fffdf8;
  border: 10px solid var(--navy);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(13, 31, 60, 0.25);
  padding: 32px;
  text-align: center;
}

.certificate-header {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.certificate-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.certificate-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.certificate-sheet h2 {
  font-size: 38px;
  line-height: 1.15;
  color: var(--navy);
  margin-bottom: 14px;
}

.certificate-name {
  font-size: 34px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 16px;
}

.certificate-description {
  max-width: 620px;
  margin: 0 auto 28px;
  font-size: 16px;
  color: var(--gunmetal);
}

.certificate-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  text-align: left;
}

.certificate-detail {
  padding: 16px 18px;
  background: rgba(13, 31, 60, 0.04);
  border: 1px solid rgba(13, 31, 60, 0.08);
  border-radius: 12px;
}

.certificate-detail span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.certificate-detail strong {
  font-size: 18px;
  color: var(--navy);
}

.certificate-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .certificate-sheet {
    padding: 24px 18px;
  }

  .certificate-sheet h2 {
    font-size: 28px;
  }

  .certificate-name {
    font-size: 28px;
  }

  .certificate-details {
    grid-template-columns: 1fr;
  }
}

@media print {
  body * {
    visibility: hidden !important;
  }

  #certificate-modal,
  #certificate-modal * {
    visibility: visible !important;
  }

  #certificate-modal {
    position: absolute;
    inset: 0;
    display: block !important;
    padding: 0;
    background: #fff;
  }

  .certificate-backdrop,
  .certificate-actions {
    display: none !important;
  }

  .certificate-dialog {
    max-width: none;
  }

  .certificate-sheet {
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
  }
}

/* =========================================
   TWO-FACTOR AUTHENTICATION STYLES
   ========================================= */

/* --- Digit input grid --- */
.tfa-code-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 24px 0;
}

.tfa-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid #d6deeb;
  border-radius: 12px;
  color: #013369;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tfa-digit:focus {
  border-color: #013369;
  outline: none;
  box-shadow: 0 0 0 3px rgba(1,51,105,0.12);
}

/* --- Status card --- */
.tfa-status-card {
  background: #fff;
  border: 1.5px solid #e5eaf4;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(1,51,105,0.06);
}

.tfa-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tfa-status-label {
  font-weight: 700;
  color: #013369;
  font-size: 15px;
}

.tfa-status-sub {
  font-size: 13px;
  color: #6b7a99;
  margin-top: 3px;
}

.tfa-status-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.tfa-badge-enabled {
  background: #e6f9f0;
  color: #1a7c4a;
}

.tfa-badge-disabled {
  background: #f3f5fa;
  color: #6b7a99;
}

/* --- Method cards --- */
.tfa-method-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.tfa-method-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1.5px solid #e5eaf4;
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tfa-method-card:hover {
  border-color: #013369;
  box-shadow: 0 2px 12px rgba(1,51,105,0.10);
}

.tfa-method-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.tfa-method-info {
  flex: 1;
}

.tfa-method-name {
  font-weight: 700;
  color: #013369;
  font-size: 15px;
}

.tfa-method-desc {
  font-size: 13px;
  color: #6b7a99;
  margin-top: 3px;
}

.tfa-setup-btn {
  background: #013369;
  color: #fff;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  flex-shrink: 0;
}

/* --- Setup flow box --- */
.tfa-setup-flow {
  background: #f6f8fc;
  border: 1.5px solid #e5eaf4;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}

.tfa-flow-title {
  font-weight: 700;
  color: #013369;
  margin-bottom: 14px;
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #d6deeb;
  border-radius: 10px;
  font-size: 15px;
  color: #013369;
  background: #fff;
  box-sizing: border-box;
  margin-bottom: 12px;
}

.form-input:focus {
  border-color: #013369;
  outline: none;
  box-shadow: 0 0 0 3px rgba(1,51,105,0.10);
}

/* --- QR code placeholder --- */
.tfa-qr-placeholder {
  background: #fff;
  border: 2px solid #e5eaf4;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
}

.tfa-qr-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  width: 112px;
  margin: 0 auto 12px;
}

.tfa-qr-block {
  width: 16px;
  height: 16px;
  background: #013369;
  border-radius: 2px;
}

.tfa-qr-w {
  background: #fff;
  border: 1px solid #d6deeb;
}

.tfa-qr-label {
  font-size: 13px;
  color: #6b7a99;
  margin: 0;
}

/* --- Management card --- */
.tfa-management-card {
  background: #fff;
  border: 1.5px solid #e5eaf4;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}

.tfa-management-method {
  font-size: 13px;
  color: #6b7a99;
  margin-bottom: 4px;
}

/* --- Admin enforcement toggle --- */
.tfa-enforce-card {
  background: #fff;
  border: 1.5px solid #e5eaf4;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.tfa-enforce-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  justify-content: space-between;
}

.tfa-enforce-info {
  flex: 1;
}

.tfa-enforce-label {
  font-weight: 700;
  color: #013369;
  font-size: 14px;
  margin-bottom: 4px;
}

.tfa-enforce-desc {
  font-size: 12px;
  color: #6b7a99;
  line-height: 1.5;
}

/* --- Toggle switch --- */
.tfa-toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  margin-top: 2px;
}

.tfa-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.tfa-toggle-slider {
  position: absolute;
  inset: 0;
  background: #d6deeb;
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.2s;
}

.tfa-toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.tfa-toggle-switch input:checked + .tfa-toggle-slider {
  background: #22c55e;
}

.tfa-toggle-switch input:checked + .tfa-toggle-slider::before {
  transform: translateX(20px);
}
