/* ============================================
   GRANIT TRAINING — SAFETY PLATFORM STYLES
   Theme: Red #CC0000 / Black #111 / White #FFF
   ============================================ */

/* ---- ROOT VARIABLES ---- */
:root {
  --red: #CC0000;
  --red-dark: #990000;
  --red-light: #FF3333;
  --black: #111111;
  --dark: #1a1a1a;
  --gray-900: #222222;
  --gray-700: #444444;
  --gray-500: #777777;
  --gray-300: #CCCCCC;
  --gray-100: #F5F5F5;
  --white: #FFFFFF;
  --success: #1a7a1a;
  --success-bg: #e8f5e8;
  --error-bg: #fde8e8;
  --warning: #b35a00;
  --warning-bg: #fff3e0;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.18);
  --transition: 0.2s ease;
}

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--gray-100);
  color: var(--black);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
button { cursor: pointer; font-family: inherit; }
input, button, select, textarea { font-family: inherit; }

/* ---- UTILITY ---- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* ---- PAGES ---- */
.page { min-height: 100vh; }

/* ---- ALERTS ---- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.alert-error { background: var(--error-bg); color: var(--red-dark); border-left: 4px solid var(--red); }
.alert-success { background: var(--success-bg); color: var(--success); border-left: 4px solid #4CAF50; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-left: 4px solid #FF9800; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn i { font-size: 0.9em; }
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(204,0,0,0.35); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-danger { background: #8B0000; color: var(--white); }
.btn-danger:hover { background: #6a0000; }
.btn-warning { background: #e67e22; color: var(--white); }
.btn-warning:hover { background: #ca6f1e; }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #155715; }
.btn-outline { background: transparent; color: var(--red); border: 2px solid var(--red); }
.btn-outline:hover { background: var(--red); color: var(--white); }
.btn-full { width: 100%; justify-content: center; padding: 0.85rem; font-size: 1rem; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
}
.form-group label i { color: var(--red); margin-right: 4px; }
.form-group input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}
.form-group input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(204,0,0,0.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.input-pw-wrap { position: relative; }
.input-pw-wrap input { padding-right: 2.8rem; }
.toggle-pw {
  position: absolute; right: 0.7rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--gray-500); font-size: 1rem;
  cursor: pointer; padding: 4px;
}
.toggle-pw:hover { color: var(--red); }

/* ========================================
   AUTH PAGES (Login / Register)
   ======================================== */
.auth-bg {
  min-height: 100vh;
  background: var(--dark);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Safety pattern background */
.safety-pattern {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(204,0,0,0.06) 0px, rgba(204,0,0,0.06) 20px, transparent 20px, transparent 40px),
    repeating-linear-gradient(-45deg, rgba(204,0,0,0.04) 0px, rgba(204,0,0,0.04) 20px, transparent 20px, transparent 40px);
  pointer-events: none;
}
.auth-bg::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--red) 0px, var(--red) 40px, var(--black) 40px, var(--black) 80px);
}

.auth-container {
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
  z-index: 1;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--red);
}

.logo-area {
  text-align: center;
  margin-bottom: 1.5rem;
}
.granit-logo {
  width: 220px;
  height: auto;
  margin: 0 auto 0.75rem;
}
.header-logo { width: 160px; height: auto; }
.app-tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--dark);
  color: var(--white);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.app-tagline i { color: var(--red); }

.auth-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray-100);
}
.auth-switch {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.88rem;
  color: var(--gray-500);
}

/* ========================================
   APP HEADER
   ======================================== */
.app-header {
  background: var(--white);
  border-bottom: 3px solid var(--red);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-link:hover { background: var(--gray-100); color: var(--red); }
.nav-user { color: var(--black); font-weight: 700; pointer-events: none; }
.nav-user i { color: var(--red); }
.nav-logout { color: var(--red); }
.nav-logout:hover { background: var(--error-bg); }

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  font-size: 0.9rem;
}
.back-btn:hover { color: var(--red); background: var(--gray-100); }
.page-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--black);
}
.quiz-header { background: var(--dark); border-bottom-color: var(--red); }
.quiz-header .header-inner { color: var(--white); }
.quiz-header-title { font-weight: 700; color: var(--white); font-size: 0.95rem; }
.quiz-progress-text { color: var(--gray-300); font-size: 0.88rem; font-weight: 600; }
.admin-header { background: var(--dark); border-bottom-color: var(--red); }
.admin-header .header-inner { color: var(--white); }
.admin-header .back-btn { color: var(--gray-300); }
.admin-header .back-btn:hover { color: var(--white); background: rgba(255,255,255,0.1); }
.admin-header .page-title { color: var(--white); }
.admin-header .nav-logout { color: #ff6666; }

/* ========================================
   DASHBOARD
   ======================================== */
.dashboard-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.dashboard-hero {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 2.5rem 1rem;
  background: linear-gradient(135deg, var(--dark) 0%, var(--gray-900) 100%);
  border-radius: var(--radius-lg);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.dashboard-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(204,0,0,0.05) 0, rgba(204,0,0,0.05) 1px, transparent 0, transparent 50%);
  background-size: 20px 20px;
}
.dashboard-hero > * { position: relative; z-index: 1; }
.hero-icon {
  font-size: 3.5rem;
  color: var(--red);
  margin-bottom: 0.75rem;
  text-shadow: 0 0 30px rgba(204,0,0,0.5);
}
.dashboard-hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.dashboard-hero p { color: var(--gray-300); font-size: 1rem; }
.dashboard-hero strong { color: var(--white); }

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.course-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--red);
}
.course-card-header {
  background: linear-gradient(135deg, var(--dark), var(--gray-900));
  padding: 1.75rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.course-card-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
}
.course-icon {
  width: 60px; height: 60px;
  background: rgba(204,0,0,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--red);
  margin-bottom: 1rem;
  border: 2px solid rgba(204,0,0,0.3);
}
.course-card-header h3 { color: var(--white); font-size: 1.05rem; font-weight: 700; }
.course-card-header p { color: var(--gray-300); font-size: 0.82rem; margin-top: 0.35rem; }
.course-card-body { padding: 1.25rem 1.5rem; }
.course-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--gray-500);
}
.course-meta span { display: flex; align-items: center; gap: 0.3rem; }
.course-meta i { color: var(--red); }
.course-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-not-started { background: var(--gray-100); color: var(--gray-500); }
.status-passed { background: var(--success-bg); color: var(--success); }
.status-failed { background: var(--error-bg); color: var(--red-dark); }

.dashboard-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.info-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  border-top: 3px solid var(--red);
  box-shadow: var(--shadow);
}
.info-card i { font-size: 2rem; color: var(--red); margin-bottom: 0.75rem; }
.info-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.info-card p { font-size: 0.85rem; color: var(--gray-500); line-height: 1.5; }

/* ========================================
   COURSE PAGE
   ======================================== */
.course-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.course-hero {
  background: linear-gradient(135deg, var(--dark), var(--gray-900));
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  color: var(--white);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.course-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(204,0,0,0.04) 0, rgba(204,0,0,0.04) 1px, transparent 0, transparent 50%);
  background-size: 20px 20px;
}
.course-hero > * { position: relative; z-index: 1; }
.course-hero-icon {
  font-size: 3rem; color: var(--red);
  margin-bottom: 1rem;
}
.course-hero h2 { font-size: 1.7rem; font-weight: 800; margin-bottom: 0.5rem; }
.course-hero p { color: var(--gray-300); font-size: 0.95rem; line-height: 1.6; }
.course-hero-meta {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--gray-300);
}
.course-hero-meta span { display: flex; align-items: center; gap: 0.4rem; }
.course-hero-meta i { color: var(--red); }

.course-sections { margin-bottom: 2rem; }
.course-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--gray-100);
  border-left: 4px solid var(--red);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--black);
}
.section-header i { color: var(--red); font-size: 1.1rem; }
.section-body {
  padding: 1.25rem 1.5rem;
  font-size: 0.93rem;
  line-height: 1.75;
  color: var(--gray-700);
}
.section-body p { margin-bottom: 0.75rem; }
.section-body p:last-child { margin-bottom: 0; }
.section-body ul, .section-body ol { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.section-body li { margin-bottom: 0.4rem; }
.section-body strong { color: var(--black); }
.highlight-box {
  background: var(--error-bg);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  margin: 0.75rem 0;
}
.highlight-box i { color: var(--red); margin-right: 0.4rem; }
.tip-box {
  background: #fff8e1;
  border-left: 4px solid #FFA000;
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  margin: 0.75rem 0;
}
.tip-box i { color: #FFA000; margin-right: 0.4rem; }

.start-quiz-area {
  text-align: center;
  padding: 2rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 2px dashed var(--red);
}
.start-quiz-area h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.start-quiz-area p { color: var(--gray-500); font-size: 0.9rem; margin-bottom: 1.25rem; }
.quiz-rules {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.quiz-rule {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}
.quiz-rule i { color: var(--red); }

/* ========================================
   QUIZ PAGE
   ======================================== */
.quiz-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.quiz-container { /* wrapper */ }
.progress-bar-wrap {
  background: var(--gray-300);
  border-radius: 10px;
  height: 8px;
  margin-bottom: 2rem;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--red-light));
  border-radius: 10px;
  transition: width 0.4s ease;
  width: 0%;
}
.question-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
  border-top: 4px solid var(--red);
}
.question-num {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--red);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.question-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--black);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.options-list { display: flex; flex-direction: column; gap: 0.75rem; }
.option-btn {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.2rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  text-align: left;
  font-size: 0.93rem;
  transition: all var(--transition);
  width: 100%;
}
.option-btn:hover:not(:disabled) {
  border-color: var(--red);
  background: var(--error-bg);
  color: var(--red-dark);
}
.option-btn.selected {
  border-color: var(--red);
  background: var(--error-bg);
  color: var(--red-dark);
  font-weight: 600;
}
.option-btn.correct {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
}
.option-btn.incorrect {
  border-color: var(--red);
  background: var(--error-bg);
  color: var(--red-dark);
}
.option-btn:disabled { cursor: default; }
.option-letter {
  min-width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gray-100);
  border: 2px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
  transition: all var(--transition);
}
.option-btn.selected .option-letter { background: var(--red); border-color: var(--red); color: var(--white); }
.option-btn.correct .option-letter { background: var(--success); border-color: var(--success); color: var(--white); }
.option-btn.incorrect .option-letter { background: var(--red); border-color: var(--red); color: var(--white); }
.answer-feedback {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  display: none;
}
.feedback-correct { background: var(--success-bg); color: var(--success); display: flex; align-items: center; gap: 0.4rem; }
.feedback-incorrect { background: var(--error-bg); color: var(--red-dark); display: flex; align-items: center; gap: 0.4rem; }
.quiz-nav { display: flex; justify-content: flex-end; }

/* ========================================
   QUIZ RESULTS
   ======================================== */
.results-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.results-container { text-align: center; }
.results-badge {
  width: 120px; height: 120px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  margin: 0 auto 1.5rem;
  border: 6px solid;
}
.badge-pass { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.badge-fail { background: var(--error-bg); color: var(--red); border-color: var(--red); }
.results-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.5rem; }
.results-title.pass { color: var(--success); }
.results-title.fail { color: var(--red); }
.results-score {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  margin: 1rem 0 0.25rem;
}
.results-score.pass { color: var(--success); }
.results-score.fail { color: var(--red); }
.results-score-label { font-size: 0.9rem; color: var(--gray-500); margin-bottom: 1rem; }
.results-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
  border-top: 4px solid;
}
.results-card.pass { border-top-color: var(--success); }
.results-card.fail { border-top-color: var(--red); }
.results-msg { color: var(--gray-700); font-size: 0.95rem; line-height: 1.6; margin-bottom: 1.5rem; }
.results-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ========================================
   MY RESULTS PAGE
   ======================================== */
.my-results-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.section-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.section-container h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-container h2 i { color: var(--red); }
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.results-table th {
  background: var(--dark);
  color: var(--white);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.results-table th:first-child { border-radius: 6px 0 0 6px; }
.results-table th:last-child { border-radius: 0 6px 6px 0; }
.results-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.results-table tr:last-child td { border-bottom: none; }
.results-table tr:hover td { background: var(--gray-100); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-pass-sm { background: var(--success-bg); color: var(--success); }
.badge-fail-sm { background: var(--error-bg); color: var(--red-dark); }
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}
.no-results i { font-size: 3rem; margin-bottom: 1rem; color: var(--gray-300); }
.no-results p { font-size: 0.95rem; }

/* ========================================
   ADMIN PANEL
   ======================================== */
.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--gray-300);
  padding-bottom: 0;
}
.tab-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.tab-btn:hover { color: var(--red); }
.tab-btn.active { color: var(--red); border-bottom-color: var(--red); }
.admin-tab-content { /* visible by default unless hidden */ }
.admin-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.admin-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-section h3 i { color: var(--red); }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-stat {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  border-top: 3px solid var(--red);
}
.admin-stat .stat-num { font-size: 2rem; font-weight: 900; color: var(--red); }
.admin-stat .stat-label { font-size: 0.8rem; color: var(--gray-500); font-weight: 600; text-transform: uppercase; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.admin-table th {
  background: var(--dark);
  color: var(--white);
  padding: 0.7rem 0.9rem;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-table th:first-child { border-radius: 6px 0 0 6px; }
.admin-table th:last-child { border-radius: 0 6px 6px 0; }
.admin-table td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-100); }
.actions-cell { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--red);
}
.modal-box h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.modal-box p { color: var(--gray-700); font-size: 0.9rem; margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ========================================
   TOAST NOTIFICATION
   ======================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: var(--white);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 2000;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--red);
  animation: slideUp 0.3s ease;
  white-space: nowrap;
}
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ========================================
   FOOTER
   ======================================== */
.app-footer {
  background: var(--dark);
  color: var(--gray-500);
  text-align: center;
  padding: 1.25rem;
  font-size: 0.8rem;
  border-top: 3px solid var(--red);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 600px) {
  .auth-card { padding: 2rem 1.25rem; }
  .form-row { grid-template-columns: 1fr; }
  .dashboard-hero h1 { font-size: 1.5rem; }
  .courses-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 0.6rem 1rem; }
  .nav-link span { display: none; }
  .results-score { font-size: 2.5rem; }
  .admin-table, .results-table { font-size: 0.8rem; }
  .admin-table td, .results-table td { padding: 0.6rem 0.5rem; }
  .course-hero { padding: 1.75rem 1.25rem; }
  .quiz-main, .course-main, .dashboard-main, .my-results-main, .admin-main { padding: 1rem; }
  .question-card { padding: 1.5rem 1rem; }
  .actions-cell { flex-direction: column; }
}

/* ========================================
   PRINT / CERTIFICATE
   ======================================== */
@media print {
  body { background: white; }
  .app-header, .app-footer, .back-btn, .btn { display: none !important; }
}

/* ========================================
   HOME PAGE
   ======================================== */
.home-main {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #fafafa 0%, #f4f4f4 100%);
}
.home-center { max-width: 820px; width: 100%; }
.home-hero { text-align: center; margin-bottom: 2.5rem; }
.home-hero .hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff0f0; color: var(--red); padding: 0.3rem 0.9rem;
  border-radius: 20px; font-size: 0.82rem; font-weight: 600; margin-bottom: 1rem;
}
.home-hero h1 { font-size: 2rem; font-weight: 800; color: #111; margin-bottom: 0.4rem; }
.home-hero p  { color: #888; font-size: 1rem; }
.home-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.home-card {
  background: #fff; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  padding: 2.25rem 1.75rem; text-align: center; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid #f0f0f0; position: relative; overflow: hidden;
}
.home-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.home-card.red-card::before    { background: var(--red); }
.home-card.purple-card::before { background: #7B2D8B; }
.home-card:hover { transform: translateY(-5px); box-shadow: 0 12px 36px rgba(0,0,0,0.14); }
.home-card-icon {
  width: 68px; height: 68px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem; font-size: 1.75rem;
}
.home-card-icon.red    { background: #fff0f0; color: var(--red); }
.home-card-icon.purple { background: #f3e8ff; color: #7B2D8B; }
.home-card h2 { font-size: 1.25rem; font-weight: 700; color: #111; margin-bottom: 0.6rem; }
.home-card p  { color: #888; font-size: 0.88rem; line-height: 1.55; margin-bottom: 1.5rem; }
.card-arrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: 0.9rem; padding: 0.5rem 1.25rem;
  border-radius: 8px; transition: opacity 0.2s;
}
.red-card    .card-arrow { background: #fff0f0; color: var(--red); }
.purple-card .card-arrow { background: #f3e8ff; color: #7B2D8B; }
.home-card:hover .card-arrow { opacity: 0.8; }

/* ========================================
   DOCUMENTATION PAGE
   ======================================== */
.doc-main { max-width: 900px; margin: 0 auto; padding: 2rem 1rem 5rem; }
.doc-tabs {
  display: flex; background: #f2f2f2; border-radius: 12px;
  padding: 5px; margin-bottom: 2rem; overflow-x: auto; gap: 4px;
}
.doc-tab-btn {
  flex: 1; padding: 0.7rem 1rem; border: none; background: transparent;
  border-radius: 8px; font-size: 0.86rem; font-weight: 600; color: #777;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
  display: flex; align-items: center; gap: 7px; justify-content: center;
}
.doc-tab-btn:hover { background: rgba(255,255,255,0.8); }
.doc-tab-btn.active { background: #fff; color: #111; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.doc-tab-btn.active.purple { color: #7B2D8B; }
.doc-tab-btn.active.orange { color: #d35400; }
.doc-tab-btn.active.teal   { color: #00838f; }
.doc-tab-content { display: none; }
.doc-tab-content.active { display: block; animation: fadeIn 0.25s ease; }

/* ---- Infographic blocks ---- */
.infographic { display: flex; flex-direction: column; gap: 1.5rem; }
.info-block { background: #fff; border-radius: 14px; box-shadow: 0 2px 16px rgba(0,0,0,0.07); overflow: hidden; }
.info-block-header {
  display: flex; align-items: center; gap: 11px;
  padding: 1rem 1.25rem; color: #fff;
}
.info-block-header i  { font-size: 1.2rem; opacity: 0.9; }
.info-block-header h3 { font-size: 0.97rem; font-weight: 700; margin: 0; }
.info-block-body { padding: 1.25rem; }

/* Stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.75rem; }
.stat-card  { background: #f8f8f8; border-radius: 10px; padding: 1rem 0.75rem; text-align: center; }
.stat-number { font-size: 1.9rem; font-weight: 800; line-height: 1; margin-bottom: 5px; }
.stat-label  { font-size: 0.76rem; color: #666; line-height: 1.35; }

/* Info grid */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.info-tile {
  display: flex; gap: 10px; align-items: flex-start;
  background: #f9f9f9; border-radius: 9px; padding: 0.85rem;
}
.tile-icon {
  width: 36px; height: 36px; min-width: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.info-tile h4 { font-size: 0.86rem; font-weight: 700; color: #222; margin: 0 0 3px; }
.info-tile p  { font-size: 0.8rem; color: #555; line-height: 1.4; margin: 0; }

/* Alert infographic rows */
.alert-infographic {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 0.9rem 1rem; border-radius: 9px; margin-bottom: 0.75rem;
  border-left-width: 4px; border-left-style: solid;
}
.alert-infographic:last-child { margin-bottom: 0; }
.alert-infographic > i { font-size: 1.1rem; margin-top: 3px; flex-shrink: 0; }
.alert-infographic .alert-text h4 { font-size: 0.87rem; font-weight: 700; margin: 0 0 3px; }
.alert-infographic .alert-text p  { font-size: 0.8rem; margin: 0; line-height: 1.4; color: #444; }

/* Timeline */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 14px; position: relative; }
.timeline-item:not(:last-child)::after {
  content: ''; position: absolute; left: 17px; top: 40px;
  width: 2px; height: calc(100% - 14px); background: #e5e5e5; z-index: 0;
}
.timeline-dot {
  width: 36px; height: 36px; min-width: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.88rem; font-weight: 700; color: #fff; z-index: 1; position: relative;
}
.timeline-body { padding-bottom: 1.2rem; flex: 1; }
.timeline-body h4 { font-size: 0.91rem; font-weight: 700; color: #222; margin: 0 0 4px; padding-top: 7px; }
.timeline-body p  { font-size: 0.81rem; color: #555; margin: 0; line-height: 1.45; }

/* Two-column list */
.two-col-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; padding: 0; margin: 0; list-style: none; }
.two-col-list li {
  display: flex; align-items: flex-start; gap: 7px; font-size: 0.82rem;
  color: #444; background: #f9f9f9; border-radius: 7px; padding: 0.55rem 0.75rem; line-height: 1.4;
}
.two-col-list li i { margin-top: 2px; font-size: 0.8rem; flex-shrink: 0; }

/* DO / DON'T */
.do-dont-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.do-col h4, .dont-col h4 { font-size: 0.88rem; font-weight: 700; margin: 0 0 0.5rem; display: flex; align-items: center; gap: 6px; }
.phrase-item { font-size: 0.8rem; padding: 0.5rem 0.75rem; border-radius: 7px; margin-bottom: 0.4rem; line-height: 1.4; }
.phrase-do   { background: #f0fdf4; color: #166534; border-left: 3px solid #22c55e; }
.phrase-dont { background: #fef2f2; color: #991b1b; border-left: 3px solid #ef4444; }

/* Profile cards */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.profile-card { border-radius: 10px; padding: 0.9rem; border-left: 4px solid; }
.profile-card h4 { font-size: 0.88rem; font-weight: 700; margin: 0 0 5px; display: flex; align-items: center; gap: 7px; }
.profile-card p  { font-size: 0.79rem; color: #555; margin: 0; line-height: 1.4; }

/* Symptom columns */
.symptom-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.symptom-col  { background: #f9f9f9; border-radius: 9px; padding: 0.9rem; }
.symptom-col h4 { font-size: 0.86rem; font-weight: 700; margin: 0 0 0.6rem; display: flex; align-items: center; gap: 6px; }
.symptom-col ul { list-style: none; padding: 0; margin: 0; }
.symptom-col ul li { font-size: 0.79rem; color: #555; padding: 0.2rem 0; display: flex; align-items: flex-start; gap: 5px; }
.symptom-col ul li::before { content: '•'; font-weight: 700; flex-shrink: 0; }

/* ========================================
   ADMIN — DOC TRACKING
   ======================================== */
.doc-visit-sparkbar { display: flex; align-items: center; gap: 8px; }
.sparkbar { flex: 1; height: 6px; background: #eee; border-radius: 3px; overflow: hidden; max-width: 80px; }
.sparkbar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }

/* ========================================
   RESPONSIVE ADDITIONS
   ======================================== */
@media (max-width: 640px) {
  .home-cards    { grid-template-columns: 1fr; }
  .info-grid     { grid-template-columns: 1fr; }
  .two-col-list  { grid-template-columns: 1fr; }
  .do-dont-grid  { grid-template-columns: 1fr; }
  .profile-grid  { grid-template-columns: 1fr; }
  .symptom-cols  { grid-template-columns: 1fr; }
  .doc-tab-btn   { padding: 0.6rem 0.5rem; font-size: 0.78rem; gap: 4px; }
  .home-hero h1  { font-size: 1.5rem; }
}
