/* ==========================================================================
   THAI ACADEMIC PROJECT E-REPORT: CS SHOWCASE 2026
   Modern Academic Executive Dashboard Theme (Light & Slate Palette)
   ========================================================================== */

:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-dark: #0f172a;
  
  --primary: #6367FF;
  --primary-hover: #5053e6;
  --primary-light: #f3f2ff;
  --primary-border: #C9BEFF;
  
  --accent-cyan: #8494FF;
  --accent-cyan-light: #fff5fd;
  --accent-cyan-dark: #6367FF;
  
  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-text: #065f46;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  
  --sidebar-w: 240px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.6;
  font-size: 15px;
  display: flex;
  min-height: 100vh;
}

/* ==========================================================================
   APP LAYOUT: SIDEBAR & MAIN WRAPPER
   ========================================================================== */

.app-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding: 24px 16px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #6367FF, #8494FF);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(99, 103, 255, 0.3);
}

.logo-text h1 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.logo-text p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-card-subtle);
  color: var(--text-muted);
}

.nav-item.active .nav-badge {
  background: #FFDBFD; color: #553e60; font-weight: 700;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-light);
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 40px 80px 40px;
  max-width: 1400px;
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  z-index: 99;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   HERO BANNER & METRIC CARDS
   ========================================================================== */

.hero-banner {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(255, 219, 253, 0.45), transparent 70%);
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}

.hero-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  max-width: 650px;
  line-height: 1.65;
  margin-bottom: 24px;
}

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-body);
  background: var(--bg-card-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 103, 255, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5053e6, #7383f0);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 103, 255, 0.4);
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-outline:hover {
  background: var(--bg-card-subtle);
  border-color: var(--text-muted);
}

/* Hero Widgets Column */
.hero-widgets {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.widget-dark {
  background: var(--bg-dark);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.widget-dark-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.widget-dark-num {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.widget-dark-num span {
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
}

.widget-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.widget-card-cyan {
  background: linear-gradient(135deg, #f5f3ff 0%, #fff2fd 100%);
  border: 1px solid #FFDBFD;
  border-radius: var(--radius-md);
  padding: 16px;
}

.widget-card-cyan .label {
  font-size: 11.5px;
  color: var(--accent-cyan-dark);
  font-weight: 600;
}

.widget-card-cyan .value {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent-cyan-dark);
}

.widget-card-white {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.widget-card-white .label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.widget-card-white .value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
}

/* Mini Bar Graphic in Dark Card */
.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 40px;
  margin-top: 14px;
}

.mini-bar {
  flex: 1;
  background: #8494FF;
  border-radius: 3px;
  transition: height 0.3s ease;
}

/* ==========================================================================
   SECTION HEADERS
   ========================================================================== */

.section {
  margin-bottom: 44px;
}

.section-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 4px;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.section-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ==========================================================================
   EVENT AT A GLANCE (STATISTICS & DONUT)
   ========================================================================== */

.stats-grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.stat-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

/* Horizontal Bar Visualizer */
.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}

.bar-label {
  width: 90px;
  font-weight: 500;
  color: var(--text-body);
}

.bar-track {
  flex: 1;
  height: 18px;
  background: var(--bg-card-subtle);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6367FF, #8494FF);
  border-radius: 4px;
}

.bar-fill.faculty {
  background: #8494FF;
}

.bar-val {
  width: 40px;
  text-align: right;
  font-weight: 700;
  color: var(--text-main);
}

/* Circular Donut Visualizer */
.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.donut-circle {
  width: 140px;
  height: 140px;
  position: relative;
}

.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-score {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.donut-max {
  font-size: 11px;
  color: var(--text-muted);
}

.donut-subtext {
  text-align: center;
  margin-top: 14px;
}

.donut-level {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.donut-pct {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* 4 Dimension Progress Bars */
.dim-bars {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dim-item {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 2px;
}

/* Info Strip */
.info-strip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.info-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.info-text .label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.info-text .val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

/* Timeline Chips */
.timeline-chips-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.timeline-chips-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.time-chip {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
}

.time-chip-shift {
  border-left: 3px solid #f59e0b;
}

.time-chip-badge {
  background: #FFDBFD; color: #553e60; font-weight: 700;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
}

.time-chip-badge.badge-warning {
  background: #fef3c7;
  color: #b45309;
}

.time-chip-text strong {
  display: block;
  color: var(--text-main);
  margin-bottom: 2px;
}

.time-chip-text p {
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

/* ==========================================================================
   STUDENT PROJECT SHOWCASE (7 CARDS)
   ========================================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-border);
}

.project-header-img {
  height: 170px;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-header-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-header-img img {
  transform: scale(1.04);
}

.project-num-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.project-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.badge-group-type {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}

.badge-group {
  background: #FFDBFD;
  color: #553e60;
  font-weight: 700;
}

.badge-single {
  background: rgba(201, 190, 255, 0.35);
  color: #4347bd;
  font-weight: 700;
}

.project-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 4px;
}

.project-eng-title {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  font-style: italic;
}

.project-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.project-author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* ==========================================================================
   ORGANIZING TEAM
   ========================================================================== */

.team-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.team-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px 8px 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.team-chip:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.team-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6367FF, #8494FF);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.team-chip-info strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.2;
}

.team-chip-info span {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.team-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.team-table thead tr {
  background: var(--bg-card-subtle);
  border-bottom: 2px solid var(--border);
}

.team-table th {
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text-main) !important;
  background: var(--bg-card-subtle) !important;
  font-size: 13px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  letter-spacing: 0.3px;
}

.team-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
  vertical-align: middle;
}

.team-table tr:hover td {
  background: var(--bg-card-subtle);
}

/* ==========================================================================
   BENTO GALLERY (MATCHING E-REPORT1.PNG)
   ========================================================================== */

.bento-gallery {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  grid-template-rows: 240px 240px 220px;
  gap: 16px;
  margin-bottom: 32px;
}

.bento-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.bento-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.bento-item:hover img {
  transform: scale(1.05);
}

.bento-item-large-left {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}

.bento-item-bottom-wide {
  grid-column: 1 / 4;
  grid-row: 3 / 4;
}

.bento-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.2) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  color: #fff;
}

.bento-tag {
  font-size: 10.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: #C9BEFF;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.bento-caption {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

/* ==========================================================================
   VIDEO PLAYER & CONTROLS
   ========================================================================== */

.video-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

.video-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.video-tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card-subtle);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-body);
  transition: all 0.15s ease;
}

.video-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.video-player-wrap {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-md);
}

.video-player-wrap video {
  width: 100%;
  max-height: 520px;
  display: block;
}

/* ==========================================================================
   CHALLENGES & LESSONS LEARNED
   ========================================================================== */

.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.lessons-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.lessons-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-border);
}

.lessons-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.lessons-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.lessons-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.lessons-footer {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
}

/* ==========================================================================
   EVIDENCE VERIFICATION TABLE (4 COLUMNS - COMPLETELY FIXED)
   ========================================================================== */

.fact-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  margin-top: 16px;
  -webkit-overflow-scrolling: touch;
}

.fact-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.fact-table th, .fact-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.55;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.fact-table th {
  background: var(--bg-card-subtle);
  font-weight: 700;
  color: var(--text-main);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fact-table tr:last-child td {
  border-bottom: none;
}

.fact-table tr:hover {
  background: #f8fafc;
}

.fact-table tr.fact-card.is-hidden {
  display: none !important;
}

.fact-col-topic {
  width: 22%;
  min-width: 180px;
}

.fact-col-info {
  width: 40%;
  min-width: 320px;
}

.fact-col-source {
  width: 24%;
  min-width: 220px;
  color: var(--text-muted);
  font-size: 13px;
}

.fact-col-status {
  width: 14%;
  min-width: 130px;
  text-align: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-verified {
  background: var(--success-light);
  color: var(--success-text);
  border: 1px solid #a7f3d0;
}

/* Lightbox Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  max-width: 90%;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-caption {
  color: #fff;
  text-align: center;
  margin-top: 14px;
  font-size: 15px;
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 32px;
  color: #fff;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
}

/* Footer */
footer {
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Responsive */
@media (max-width: 1024px) {
  .app-sidebar {
    display: none;
  }
  .main-content {
    margin-left: 0;
    padding: 20px;
  }
  .mobile-header {
    display: flex;
  }
  .hero-banner {
    grid-template-columns: 1fr;
    padding: 24px;
  }
  .stats-grid-2 {
    grid-template-columns: 1fr;
  }
  .info-strip {
    grid-template-columns: 1fr 1fr;
  }
  .bento-gallery {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .bento-item-large-left, .bento-item-bottom-wide {
    grid-column: 1 / 2;
    grid-row: auto;
    height: 260px;
  }
  .bento-item {
    height: 220px;
  }
}

/* ==========================================================================
   THEME TOGGLE BUTTONS & DARK MODE STYLING
   ========================================================================== */

/* Smooth Transition */
body, .app-sidebar, .main-content, .hero-banner, .stat-card, .project-card,
.lessons-card, .meta-chip, .btn-outline, table, th, td, .timeline-step,
.info-strip, .timeline-chips-wrap, .time-chip, .team-chip, .team-table-card,
.video-box, .fact-table-wrap, .theme-toggle-btn, .theme-toggle-floating {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* Theme Toggle Button (Sidebar) */
.theme-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

/* Floating Theme Toggle (Always visible) */
.theme-toggle-floating {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle-floating:hover {
  transform: scale(1.1);
  border-color: var(--primary);
}

/* ==========================================================================
   DARK THEME VARIABLES & OVERRIDES
   ========================================================================== */

[data-theme="dark"] {
  --bg-page: #0a0c1a;
  --bg-card: #121429;
  --bg-card-subtle: #191b36;
  --bg-dark: #070815;
  
  --primary: #8494FF;
  --primary-hover: #6367FF;
  --primary-light: rgba(99, 103, 255, 0.18);
  --primary-border: rgba(201, 190, 255, 0.3);
  
  --accent-cyan: #22d3ee;
  --accent-cyan-light: #083344;
  --accent-cyan-dark: #38bdf8;
  
  --text-main: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  
  --border: #1e293b;
  --border-light: #334155;
  
  --success: #10b981;
  --success-light: #064e3b;
  --success-text: #6ee7b7;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .app-sidebar {
  background: #0f172a;
  border-right-color: #1e293b;
}

[data-theme="dark"] .sidebar-nav .nav-item {
  color: #94a3b8;
}

[data-theme="dark"] .sidebar-nav .nav-item:hover,
[data-theme="dark"] .sidebar-nav .nav-item.active {
  background: #1e293b;
  color: #C9BEFF;
}

[data-theme="dark"] .hero-banner {
  background: #111827;
  border-color: #1e293b;
}

[data-theme="dark"] .hero-widget-metric {
  background: #030712;
  border: 1px solid #1e293b;
}

[data-theme="dark"] .widget-card-cyan {
  background: rgba(99, 103, 255, 0.15);
  border-color: rgba(201, 190, 255, 0.3);
}

[data-theme="dark"] .widget-card-cyan .label {
  color: #7dd3fc;
}

[data-theme="dark"] .widget-card-cyan .value {
  color: #C9BEFF;
}

[data-theme="dark"] .widget-card-cyan p {
  color: #a5f3fc !important;
}

[data-theme="dark"] .meta-chip {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .project-card,
[data-theme="dark"] .bento-item,
[data-theme="dark"] .lessons-card,
[data-theme="dark"] .video-box,
[data-theme="dark"] .info-strip,
[data-theme="dark"] .timeline-chips-wrap,
[data-theme="dark"] .team-table-card,
[data-theme="dark"] .fact-table-wrap {
  background: #111827;
  border-color: #1e293b;
}

[data-theme="dark"] .info-icon {
  background: #1e293b;
  color: #C9BEFF;
}

[data-theme="dark"] .timeline-chips-title {
  color: #f8fafc;
}

[data-theme="dark"] .time-chip {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .time-chip-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

[data-theme="dark"] .time-chip-badge.badge-warning {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #fbbf24 !important;
}

[data-theme="dark"] .team-chip {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .team-chip:hover {
  border-color: #C9BEFF;
  background: #273549;
}

[data-theme="dark"] .project-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .timeline-step {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .btn-outline {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .btn-outline:hover {
  background: #334155;
}

[data-theme="dark"] .table-filter-input,
[data-theme="dark"] .table-filter-select {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] table {
  background: #111827;
}

[data-theme="dark"] table th,
[data-theme="dark"] .team-table th {
  background: #1e293b !important;
  color: #f8fafc !important;
}

[data-theme="dark"] table td,
[data-theme="dark"] .team-table td {
  border-bottom-color: #1e293b !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] table tr:hover,
[data-theme="dark"] .team-table tr:hover td {
  background: #1e293b !important;
}

[data-theme="dark"] .fact-table {
  background: #111827;
}

[data-theme="dark"] .fact-table tr:hover {
  background: #1e293b !important;
}

[data-theme="dark"] .fact-table td strong {
  color: #f8fafc;
}

[data-theme="dark"] .status-badge.badge-verified {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .nav-badge-success {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
}

[data-theme="dark"] #videoTitleDesc {
  color: #f8fafc;
}

[data-theme="dark"] .video-tab-btn {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .video-tab-btn.active {
  background: #6367FF;
  border-color: #6367FF;
  color: #ffffff;
}

[data-theme="dark"] .lessons-card h4 {
  color: #f8fafc;
}

[data-theme="dark"] .lessons-card p {
  color: #cbd5e1;
}

[data-theme="dark"] .lessons-tag {
  color: #C9BEFF;
}

[data-theme="dark"] .lessons-footer {
  color: #34d399;
}

[data-theme="dark"] .donut-circle svg path:first-child {
  stroke: #1e293b;
}

[data-theme="dark"] .donut-score {
  color: #f8fafc;
}

[data-theme="dark"] .donut-level {
  color: #C9BEFF;
}

[data-theme="dark"] .mobile-header {
  background: #0f172a;
  border-bottom-color: #1e293b;
}

[data-theme="dark"] footer {
  border-top-color: #1e293b;
}

[data-theme="dark"] .theme-toggle-floating {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}
