@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Fira+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --primary-navy: #1e3a8a;
  --bg-color: #f7f4ed;
  --panel-bg: #FCFBF7;
  --panel-bg-hover: #fbf9f5;
  --gold: #af9253;
  --gold-hover: #8f743c;
  --gold-glow: rgba(175, 146, 83, 0.15);
  --gold-gradient: linear-gradient(135deg, #c5a85c 0%, #af9253 50%, #8f743c 100%);
  --text-primary: #2d261b;
  --text-muted: #736b5e;
  --text-dark: #ffffff;
  --border-color: rgba(175, 146, 83, 0.25);
  --border-light: rgba(175, 146, 83, 0.12);
  --warning: #b83a38;
  --success: #3c7a52;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Fira Sans', sans-serif;
  --font-mono: 'Inter', sans-serif;
  --shadow-luxury: 0 12px 30px rgba(175, 146, 83, 0.08), 0 2px 8px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 16px 40px rgba(175, 146, 83, 0.16), 0 4px 12px rgba(175, 146, 83, 0.06);
  --neu-dark-shadow: #d5cda7;
  --neu-light-shadow: #ffffff;
  --neu-shadow-raised: 8px 8px 16px var(--neu-dark-shadow), -8px -8px 16px var(--neu-light-shadow);
  --neu-shadow-raised-hover: 12px 12px 24px var(--neu-dark-shadow), -12px -12px 24px var(--neu-light-shadow);
  --neu-shadow-inset: inset 4px 4px 8px var(--neu-dark-shadow), inset -4px -4px 8px var(--neu-light-shadow);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Floating Navbar -> Flush Header */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.95);
  /* Deep navy background */
  backdrop-filter: blur(16px);
  border-bottom: 1.33px solid transparent;
  border-image: var(--gold-gradient) 1;
  /* Shiny gold gradient edge on bottom only */
  border-radius: 0;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  max-width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #ffffff;
}

.brand-logo {
  color: #ffffff;
  /* White text for contrast */
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 1.5px;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo span {
  color: var(--gold);
  /* Gold color for the program number */
  text-shadow: 0 0 10px rgba(175, 146, 83, 0.4);
}

.bep-logo {
  height: 72px;
  width: auto;
  object-fit: contain;
  margin: -12px 0.5rem -12px -8px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-title {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.brand-subtitle {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.2;
}

.nav-toggle {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.7);
  /* Muted white for secondary items */
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: 6px;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  color: #ffffff;
  background: var(--gold-gradient);
  /* Premium gold gradient pill */
  box-shadow: 0 4px 12px rgba(175, 146, 83, 0.25);
  font-weight: 600;
}

.btn-admin {
  background: var(--primary-navy);
  color: #ffffff;
  border: 1px solid var(--primary-navy);
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-admin:hover {
  background: #1e40af;
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.4);
}

.btn-logout-header {
  margin-left: 10px;
  background-color: var(--warning) !important;
  border-color: var(--warning) !important;
  color: white !important;
}

.btn-logout-header:hover {
  background-color: #9c2e2c !important;
  border-color: #9c2e2c !important;
  box-shadow: 0 4px 15px rgba(184, 58, 56, 0.4) !important;
}

/* TH / EN Language Toggle Pill */
.lang-toggle {
  background: rgba(255, 255, 255, 0.05);
  /* Translucent background */
  border: 1px solid rgba(175, 146, 83, 0.3);
  border-radius: 20px;
  padding: 0.3rem 0.25rem;
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
  transition: var(--transition);
}

.lang-toggle:hover {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.1);
}

.lang-toggle .lang-opt {
  padding: 0.2rem 0.65rem;
  border-radius: 14px;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
}

.lang-toggle .lang-opt:hover {
  color: #ffffff;
}

.lang-toggle .lang-opt.active {
  background: var(--gold-gradient);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(175, 146, 83, 0.3);
}

.lang-toggle .lang-divider {
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
  user-select: none;
}

/* Layout Containers */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Dashboard Summary Header */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background-color: #FCFBF7;
  background-image: radial-gradient(circle at top right, rgba(175, 146, 83, 0.08) 0%, transparent 60%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: inset 4px 4px 10px rgba(0, 0, 0, 0.09), inset -4px -4px 10px rgba(255, 255, 255, 0.85), var(--shadow-luxury);
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Glassmorphism gradient backlights (auras) */
.kpi-card::before {
  content: '';
  position: absolute;
  top: -40px;
  left: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  z-index: -1;
  filter: blur(24px);
  opacity: 0.6;
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.kpi-card.kpi-total::before,
.kpi-card.kpi-attendance::before {
  background: radial-gradient(circle, rgba(30, 58, 138, 0.3) 0%, transparent 70%);
}

.kpi-card.kpi-flagged::before {
  background: radial-gradient(circle, rgba(184, 58, 56, 0.3) 0%, transparent 70%);
}

.kpi-card.kpi-scores-card::before {
  background: radial-gradient(circle, rgba(175, 146, 83, 0.35) 0%, transparent 70%);
}

.kpi-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold);
  box-shadow: var(--shadow-hover);
}

.kpi-card:hover::before {
  transform: scale(1.6);
  opacity: 0.95;
}

.kpi-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  z-index: 2;
}

.kpi-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 2;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.kpi-icon-wrapper.navy {
  background: rgba(30, 58, 138, 0.08);
  color: var(--primary-navy);
}

.kpi-icon-wrapper.gold {
  background: rgba(175, 146, 83, 0.1);
  color: var(--gold);
}

.kpi-icon-wrapper.red {
  background: rgba(184, 58, 56, 0.1);
  color: var(--warning);
}

.kpi-value .kpi-unit {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 0.3rem;
  vertical-align: baseline;
  letter-spacing: 0;
}

/* Custom Animated SVGs Styles */
.kpi-svg {
  width: 20px;
  height: 20px;
  transition: transform 0.4s ease;
}

/* Total Trainees Animations */
.svg-trainees .pulse-ring {
  animation: svg-pulse 2.5s infinite ease-in-out;
  transform-origin: center;
  opacity: 0.3;
}

.kpi-card:hover .kpi-icon-wrapper {
  transform: scale(1.08);
}

.kpi-card:hover .user-main {
  transform: translateY(-1.5px);
  transition: transform 0.3s ease;
}

.kpi-card:hover .user-left {
  transform: translate(-1px, 0.5px);
  transition: transform 0.3s ease;
}

.kpi-card:hover .user-right {
  transform: translate(1px, 0.5px);
  transition: transform 0.3s ease;
}

/* Ratio ID Badge Animations */
.svg-ratio {
  transform-origin: top center;
}

.kpi-card:hover .svg-ratio {
  animation: badge-sway 1.5s ease-in-out infinite;
}

/* Attendance Calendar Animations */
.svg-attendance .calendar-check {
  stroke-dasharray: 15;
  stroke-dashoffset: 0;
  transform-origin: center;
}

.kpi-card:hover .calendar-check {
  animation: draw-check 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Scores Graduation Cap Animations */
.svg-scores .cap-mortarboard {
  transform-origin: center;
}

.kpi-card:hover .cap-mortarboard {
  animation: cap-float 1.8s infinite ease-in-out;
}

.svg-scores .score-sparkle {
  transform-origin: center;
  opacity: 0.5;
}

.kpi-card:hover .score-sparkle-1 {
  animation: sparkle-glow 1.2s infinite ease-in-out;
}

.kpi-card:hover .score-sparkle-2 {
  animation: sparkle-glow 1.2s infinite ease-in-out 0.6s;
}

/* Animations Keyframes */
@keyframes svg-pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.15;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.55;
  }

  100% {
    transform: scale(0.8);
    opacity: 0.15;
  }
}

@keyframes draw-check {
  0% {
    stroke-dashoffset: 15;
  }

  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes cap-float {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px) rotate(1deg);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes sparkle-glow {
  0% {
    transform: scale(0.5);
    opacity: 0.3;
  }

  50% {
    transform: scale(1.3) rotate(45deg);
    opacity: 1;
    fill: var(--gold);
  }

  100% {
    transform: scale(0.5);
    opacity: 0.3;
  }
}

@keyframes badge-sway {
  0% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(4deg);
  }

  75% {
    transform: rotate(-4deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

.kpi-title {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 600;
  margin-bottom: 0;
}

.kpi-value {
  color: var(--primary-navy);
  font-size: 2.3rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-grow: 1;
}

/* For the Pre-test/Post-test stats */
.kpi-scores {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.6rem;
  flex-grow: 1;
}

.kpi-subtext {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Dynamically injected container for ratio */
#kpi-trainee-type {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.kpi-ratio-container {
  display: flex;
  justify-content: space-around;
  width: 100%;
}

.kpi-ratio-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.kpi-ratio-num {
  font-size: 2.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary-navy);
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-ratio-label {
  font-size: 1rem;
  color: var(--text-muted);
}

.kpi-ratio-pct {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
}

/* Combined Total + Ratio Card – horizontal compact layout */
.kpi-combined-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  flex: 1;
}

.kpi-combined-content .kpi-value {
  flex-shrink: 0;
  flex-grow: 0;
  font-size: 2.8rem;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  justify-content: flex-start;
  white-space: nowrap;
}

.kpi-ratio-mini {
  flex: 1;
  min-width: 0;
  border-left: 1px solid var(--border-light);
  padding-left: 0.75rem;
}

.kpi-ratio-mini .kpi-ratio-container {
  justify-content: center;
  gap: 1rem;
}

.kpi-ratio-mini .kpi-ratio-col {
  align-items: center;
}

.kpi-ratio-mini .kpi-ratio-num {
  font-size: 1.5rem;
  color: var(--primary-navy);
}

.kpi-ratio-mini .kpi-ratio-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.kpi-ratio-mini .kpi-ratio-pct {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
}

/* Main Area Layout - Reverted to Flex Column Layout */
.main-layout {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.directory-section {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* Horizontal Filters Panel (Small Tab Style) */
/* Horizontal Filters Panel (Single Line Layout) */
.filter-panel {
  background: #FCFBF7;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  box-shadow: var(--shadow-luxury);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  position: relative;
  z-index: 50;
  overflow: visible;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-evenly;
}

.filter-panel::-webkit-scrollbar {
  display: none;
}

.filter-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  justify-content: center;
}

.relative {
  position: relative;
}

.filter-section.search-section {
  flex: 2 1 240px;
  max-width: 400px;
  justify-content: flex-start;
}

/* Portrait / narrow viewport: break into 2 rows */
@media (max-width: 768px) and (orientation: portrait),
(max-width: 600px) {
  .filter-panel {
    padding: 0.6rem 0.75rem;
    gap: 0.5rem 0.75rem;
    justify-content: flex-start;
  }

  .filter-section {
    flex: 1 1 calc(50% - 0.75rem);
    justify-content: flex-start;
  }

  .filter-section.search-section {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

.filter-label-inline {
  font-weight: 700;
  color: var(--gold);
  font-size: 0.85rem;
  white-space: nowrap;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 0.75rem;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: #faf8f5;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.55rem 1rem 0.55rem 2.25rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: var(--transition);
  font-size: 0.85rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px var(--gold-glow);
}

.filter-select {
  background: #faf8f5;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.55rem 1.5rem 0.55rem 0.65rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition);
  cursor: pointer;
  font-size: 0.85rem;
  min-width: 140px;
}

.filter-select:focus {
  border-color: var(--gold);
}

/* Custom Popup Filter Trigger Button */
.filter-popup-btn {
  background: #faf8f5;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.filter-popup-btn:hover {
  border-color: var(--gold);
  background: #ffffff;
}

.filter-popup-btn .btn-icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
  color: var(--gold);
  transition: transform 0.2s ease;
}

.filter-popup-btn:active {
  transform: scale(0.96);
}

/* Dropdown Popup Card */
.filter-popup {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  padding: 0.75rem;
  z-index: 99;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#filter-organization-popup {
  min-width: 320px;
}

.filter-popup.hidden {
  display: none !important;
}

.filter-popup-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.25rem;
  margin-bottom: 0.15rem;
}

.filter-popup-grid {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.filter-popup-grid::-webkit-scrollbar {
  width: 4px;
}

.filter-popup-grid::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 2px;
}

/* Option Buttons Inside Popup */
.filter-popup-opt {
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-popup-opt:hover {
  background: rgba(175, 146, 83, 0.08);
  color: var(--gold-hover);
}

.filter-popup-opt.active {
  background: var(--gold-gradient);
  color: var(--text-dark);
  font-weight: 600;
}

.section-header {
  border-bottom: 1px solid var(--border-color);
  margin: 0.375rem 0;
  padding-bottom: 0;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title span {
  font-family: var(--font-mono);
  font-size: 1rem;
  background: rgba(212, 175, 55, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.trainee-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* Trainee Card - Horizontal Premium Style (2-Column Compact) */
.trainee-card {
  background: #FCFBF7;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  align-items: center;
  box-shadow: var(--shadow-luxury);
  min-height: 145px;
  z-index: 1;
}

.trainee-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  box-shadow: var(--shadow-hover);
  border-color: var(--gold);
}

/* Group color dot – inline swatch used in filter labels and popup options */
.group-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 8px;
}

.group-color-dot--default {
  background-color: var(--text-muted);
}

.card-left-strip {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: var(--transition);
  z-index: 3;
}

/* Subtle group-colored background glow (Top-Left) */
.trainee-card::after {
  content: '';
  position: absolute;
  top: -45px;
  left: -45px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--group-color, rgba(175, 146, 83, 0.15)) 0%, transparent 70%);
  filter: blur(20px);
  opacity: 0.08;
  /* 8% default Group glow */
  z-index: -1;
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

/* Subtle organization-colored background glow (Bottom-Right) */
.trainee-card::before {
  content: '';
  position: absolute;
  bottom: -45px;
  right: -45px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--org-color, rgba(175, 146, 83, 0.15)) 0%, transparent 70%);
  filter: blur(20px);
  opacity: 0.08;
  /* 8% default Org Type glow */
  z-index: -1;
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.trainee-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.trainee-card:hover .card-left-strip {
  background: var(--gold-gradient);
}

.trainee-card:hover::after,
.trainee-card:hover::before {
  opacity: 0.20;
  /* 20% glow on hover for both auras */
  transform: scale(1.5);
}

/* Compact Rectangular Photo */
.trainee-card .profile-pic-container {
  width: 90px;
  height: 115px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: rgba(175, 146, 83, 0.05);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.trainee-card:hover .profile-pic-container {
  border-color: var(--gold);
  box-shadow: 0 0 8px var(--gold-glow);
}

.trainee-card .profile-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
  outline: 1px solid rgba(0, 0, 0, 0.08);
  outline-offset: -1px;
}

.trainee-card .profile-pic-placeholder {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
}

/* Tactile feedback for interactive controls */
.filter-btn:active,
.btn-admin:active,
.lang-toggle:active {
  transform: scale(0.96);
}

/* Metadata Text Left Column */
.trainee-card .trainee-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 215px;
  flex-shrink: 0;
  min-width: 0;
}

.trainee-meta-box {
  align-self: stretch;
  justify-content: center;
  width: 215px;
  flex-shrink: 0;
}

.trainee-card .trainee-id {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.trainee-card .trainee-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trainee-card .trainee-nickname {
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 500;
}

.trainee-card .trainee-org,
.trainee-card .trainee-group {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

/* Stats and Mini Charts Row (Right Section) */
.trainee-card-stats-row {
  display: flex;
  flex-grow: 1;
  gap: 0.5rem;
  align-items: stretch;
  min-width: 0;
}

.card-stats-left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1.2;
  min-width: 0;
  justify-content: space-between;
}

.card-stats-right {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

/* Box Panels */
.card-stat-box {
  background: rgba(175, 146, 83, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.08), inset -4px -4px 8px rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 0.3rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  min-height: auto;
  justify-content: center;
}

.card-stat-box.full-height {
  height: 100%;
}

.card-stat-box-title {
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.15rem;
  margin-bottom: 0.15rem;
}

/* Progress bar inside card */
.card-stat-progress-bar {
  height: 16px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.card-stat-progress-fill {
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  border-radius: 4px;
}

.card-stat-progress-fill.orange {
  background: linear-gradient(90deg, #ca8a04 0%, #e28743 100%);
}

.card-stat-progress-fill.green {
  background: linear-gradient(90deg, #3c7a52 0%, #4b8b60 100%);
}

.card-stat-progress-text {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-left: 0.3rem;
  position: relative;
  z-index: 2;
}

/* Scrollable mini bar chart under "การเข้าอบรม" */
.card-mini-chart-box {
  background: rgba(175, 146, 83, 0.04);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.2rem;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  align-items: flex-end;
  height: 60px;
  width: 100%;
  flex-shrink: 0;
}

.card-mini-chart-box::-webkit-scrollbar {
  height: 4px;
}

.card-mini-chart-box::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 2px;
}

.card-mini-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
  width: 28px;
}

.card-mini-bars-container {
  height: 38px;
  display: flex;
  align-items: flex-end;
  gap: 0.05rem;
  width: 100%;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
  padding-top: 10px;
  /* Spacing for bar text labels */
}

.card-mini-bar {
  flex: 1;
  border-top-left-radius: 2px;
  border-top-right-radius: 2px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 2px;
}

.card-mini-bar.pre {
  background: #e28743;
}

.card-mini-bar.post {
  background: #3c7a52;
}

.card-mini-bar span {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  position: absolute;
  top: -8px;
}

.card-mini-col-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

/* Red Flag Warning */
.warning-flag {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--warning);
  color: #ffffff;
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-bottom-left-radius: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  z-index: 5;
}

/* KPI Card Progress Bar styling (Dashboard) */
.kpi-progress-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.kpi-progress-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.kpi-progress-label {
  width: 70px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-progress-bar-outer {
  flex-grow: 1;
  height: 10px;
  background: var(--panel-bg);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--neu-shadow-inset);
  border: 1px solid rgba(175, 146, 83, 0.08);
}

.kpi-progress-bar-inner {
  height: 100%;
  border-radius: 6px;
}

.kpi-progress-bar-inner.pre {
  background: linear-gradient(90deg, #ca8a04 0%, #e28743 100%);
}

.kpi-progress-bar-inner.post {
  background: linear-gradient(90deg, #3c7a52 0%, #4b8b60 100%);
}

.kpi-progress-value {
  font-family: var(--font-mono);
  font-weight: 700;
  width: 45px;
  text-align: right;
}

/* Responsiveness media query for collapsing horizontal layouts */
@media (max-width: 1200px) {
  .trainee-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 850px) {
  .trainee-card {
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
  }

  .trainee-card .profile-pic-container {
    align-self: center;
    width: 90px;
    height: 110px;
  }

  .trainee-card .trainee-meta {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding-right: 0;
    padding-bottom: 0.75rem;
    text-align: center;
  }

  .trainee-meta-box {
    width: 100%;
    flex-shrink: 1;
    align-self: stretch;
  }

  .trainee-card-stats-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Detail Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(45, 38, 27, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 90%;
  max-width: 850px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(175, 146, 83, 0.2);
  transform: translateY(30px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close-btn:hover {
  color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
}

.modal-body {
  padding: 2.5rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (max-width: 768px) {
  .detail-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

.detail-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  background: var(--panel-bg);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--neu-shadow-raised);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.4);
  width: 100%;
}

.detail-left:hover {
  transform: translateY(-2px);
  box-shadow: var(--neu-shadow-raised-hover);
}

.large-pic-container {
  width: 130px;
  height: 170px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel-bg);
  box-shadow: var(--neu-shadow-inset);
  border: 1px solid rgba(175, 146, 83, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  transition: var(--transition);
}

.large-pic {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--gold);
}

.detail-right {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-width: 0;
}

.detail-full-width {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
  width: 100%;
}

.detail-block {
  background: var(--panel-bg);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--neu-shadow-raised);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.detail-block:hover {
  transform: translateY(-2px);
  box-shadow: var(--neu-shadow-raised-hover);
}

.detail-title {
  font-size: 1.6rem;
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.detail-subtitle {
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.info-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* History Lists (Attendance & Quiz Scores) */
.history-section-title {
  color: var(--gold);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  padding-bottom: 0.4rem;
}

.quiz-table,
.attendance-timeline {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.quiz-table th {
  text-align: left;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.quiz-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.quiz-score-badge {
  font-family: var(--font-mono);
  font-weight: 600;
  background: var(--panel-bg);
  color: var(--gold);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  box-shadow: var(--neu-shadow-inset);
  border: 1px solid rgba(175, 146, 83, 0.08);
}

.progress-bar-container {
  width: 100%;
  height: 10px;
  background: var(--panel-bg);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 0.25rem;
  box-shadow: var(--neu-shadow-inset);
  border: 1px solid rgba(175, 146, 83, 0.08);
}

.progress-bar-fill {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: 6px;
}

/* Admin Panel Table */
.admin-table-container {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  margin-bottom: 2rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: rgba(3, 7, 18, 0.4);
  color: var(--gold);
  font-weight: 600;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.admin-table tr:hover {
  background: var(--panel-bg-hover);
}

.action-btn-group {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

.btn-icon.btn-delete:hover {
  color: var(--warning);
  border-color: var(--warning);
  background: rgba(239, 68, 68, 0.08);
}

/* Primary buttons */
.btn-primary {
  background: var(--gold-gradient);
  color: var(--text-dark);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.btn-primary:hover {
  box-shadow: 0 0 15px var(--gold-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-muted);
}

.btn-danger {
  background: linear-gradient(135deg, #b91c1c 0%, #ef4444 50%, #f87171 100%);
  color: var(--text-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.btn-danger:hover {
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.form-control {
  background: rgba(11, 15, 25, 0.5);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.75rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 8px var(--gold-glow);
}

/* Import Excel Dropzones */
.import-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dropzone-card {
  background: var(--panel-bg);
  border: 2px dashed rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.dropzone-card:hover {
  border-color: var(--gold);
  background: var(--panel-bg-hover);
  box-shadow: 0 5px 20px rgba(212, 175, 55, 0.05);
}

.dropzone-icon {
  color: var(--gold);
  font-size: 2.25rem;
}

.dropzone-text h4 {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.dropzone-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Attendance Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.calendar-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.calendar-card:hover {
  border-color: var(--gold);
  background: var(--panel-bg-hover);
}

.calendar-date {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold);
  font-family: var(--font-mono);
}

.calendar-topic {
  font-size: 0.8rem;
  color: var(--text-primary);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
}

/* Attendance Timeline Viewer */
.timeline-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.timeline-item {
  background: var(--panel-bg);
  border: 1px solid rgba(175, 146, 83, 0.08);
  box-shadow: var(--neu-shadow-inset);
  border-radius: 8px;
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.timeline-item:hover {
  border-color: var(--gold);
  background: rgba(175, 146, 83, 0.04);
}

.timeline-squares {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 0.35rem;
}

.timeline-square {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.timeline-square.present {
  background-color: var(--success);
}

.timeline-square.absent {
  background-color: var(--warning);
}

.timeline-name {
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.timeline-status {
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Alert Boxes */
.alert-popup {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.alert-item {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--gold);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-weight: 500;
}

.alert-item.success {
  border-left-color: var(--success);
}

.alert-item.danger {
  border-left-color: var(--warning);
}

/* Login Panel Styling */
.login-wrapper {
  max-width: 400px;
  margin: 10vh auto;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 10px 40px rgba(212, 175, 55, 0.15);
}

.login-title {
  text-align: center;
  color: var(--gold);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

@keyframes slideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* KPI Ratio Layout (Gov vs Private columns) */
.kpi-ratio-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  margin-top: 0.5rem;
}

.kpi-ratio-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.kpi-ratio-num {
  font-size: 2.3rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.1;
}

.kpi-ratio-label {
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 500;
  margin-top: 0.25rem;
}

.kpi-ratio-pct {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Polished Typography Enhancements */
.section-title,
.kpi-title,
.modal-content h2,
.modal-content h3 {
  text-wrap: balance;
}

.trainee-id,
.kpi-value,
.card-stat-progress-text,
.card-mini-bar span,
.kpi-progress-value,
.kpi-ratio-num,
.kpi-ratio-pct {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Student Login & Student Bento Dashboard Styles
   ========================================================================== */

/* Login Gate Container */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 2rem;
  background-color: var(--bg-color);
}

.login-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-luxury);
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
  transition: var(--transition);
  animation: cardFadeIn 0.5s ease-out;
}

.login-card:hover {
  box-shadow: var(--shadow-hover);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  max-height: 120px;
  object-fit: contain;
  margin-bottom: 1.25rem;
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-group label i,
.form-group label svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--panel-bg-hover);
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  background-color: var(--panel-bg);
  box-shadow: 0 0 0 4px var(--gold-glow);
}

.btn-login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem;
  background: var(--gold-gradient);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(175, 146, 83, 0.2);
  transition: var(--transition);
}

.btn-login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(175, 146, 83, 0.3);
}

.btn-login-submit:active {
  transform: translateY(0);
}

.login-error-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: rgba(184, 58, 56, 0.08);
  border: 1px solid rgba(184, 58, 56, 0.25);
  border-radius: 8px;
  color: var(--warning);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.login-error-message svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Student Dashboard View */
.student-dashboard {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.student-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.student-welcome h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.student-welcome-sub {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.student-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-pdf {
  background: var(--gold-gradient);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 10px rgba(175, 146, 83, 0.15);
}

.btn-pdf:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(175, 146, 83, 0.25);
}

.btn-password {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  color: var(--gold);
}

.btn-password:hover {
  background: var(--panel-bg-hover);
  border-color: var(--gold-hover);
  color: var(--gold-hover);
}

.btn-logout-student {
  background: rgba(184, 58, 56, 0.08);
  border: 1px solid rgba(184, 58, 56, 0.25);
  color: var(--warning);
}

.btn-logout-student:hover {
  background: rgba(184, 58, 56, 0.15);
  border-color: var(--warning);
}

/* Bento Grid */
.student-bento-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 1.5rem;
  align-items: start;
}

.bento-card {
  background: var(--panel-bg);
  border: 1px solid rgba(175, 146, 83, 0.12);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 
    6px 6px 16px rgba(45, 38, 27, 0.06), 
    2px 2px 6px rgba(175, 146, 83, 0.08), 
    -6px -6px 16px rgba(255, 255, 255, 0.95);
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    8px 12px 24px rgba(45, 38, 27, 0.09),
    3px 3px 10px rgba(175, 146, 83, 0.12),
    -8px -12px 24px rgba(255, 255, 255, 0.98);
}

.bento-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.6) 50%,
      rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg);
  z-index: 1;
  transition: none;
  pointer-events: none;
}

/* .bento-card:hover::after animation disabled */

.bento-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Profile Card */
.profile-card-student {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-image-container {
  position: relative;
  width: 120px;
  height: 155px;
  border-radius: 12px;
  overflow: hidden;
  border: 6px solid var(--bg-color);
  box-shadow: 12px 12px 24px rgba(0, 0, 0, 0.15),
    -12px -12px 24px rgba(255, 255, 255, 0.8);
  margin-bottom: 1.5rem;
  background-color: var(--bg-color);
}

.profile-image-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  box-shadow: inset 4px 4px 8px rgba(255, 255, 255, 0.7), inset -4px -4px 8px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.student-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-details {
  width: 100%;
  text-align: left;
}

.profile-details h3 {
  justify-content: center;
  text-align: center;
}

.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
  box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.06), inset -4px -4px 8px rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: var(--text-muted);
}

.detail-val {
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

/* Attendance Card */
.attendance-card-student {
  display: flex;
  flex-direction: column;
}

.attendance-kpi-summary {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.kpi-circle-container {
  flex-shrink: 0;
}

.donut-chart-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-color);
  box-shadow: 12px 12px 24px rgba(0, 0, 0, 0.15),
    -12px -12px 24px rgba(255, 255, 255, 0.8);
  border: 6px solid var(--bg-color);
}

.donut-chart-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  box-shadow: inset 4px 4px 8px rgba(255, 255, 255, 0.7), inset -4px -4px 8px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.donut-center-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.donut-center-text #std-attendance-rate {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.2;
}

.donut-center-text .kpi-circle-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

.kpi-stats {
  display: flex;
  gap: 1rem;
  flex-grow: 1;
}

.stat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: 12px;
  background-color: var(--panel-bg-hover);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 5px 5px 10px rgba(0, 0, 0, 0.08), inset -5px -5px 10px rgba(255, 255, 255, 0.9);
  min-width: 90px;
}

.stat-num {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

.stat-box.present .stat-num {
  color: var(--success);
}

.stat-box.absent .stat-num {
  color: var(--warning);
}

.attendance-timeline-container {
  margin-top: 1rem;
}

.attendance-timeline-container h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.attendance-timeline {
  margin-bottom: 1rem;
}

.attendance-timeline.timeline-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

.timeline-item {
  flex: 1 1 75px;
  max-width: 150px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.08), inset -4px -4px 8px rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 0.5rem 0.4rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  cursor: pointer;
}

.timeline-item:hover {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.06);
}

.timeline-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  white-space: nowrap;
}

.timeline-squares {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.timeline-square {
  width: 16px;
  height: 16px;
  display: inline-block;
  transition: var(--transition);
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* .timeline-squares .timeline-square+.timeline-square {
  removed border-left
} */

.timeline-square.present {
  background-color: var(--success);
}

.timeline-square.absent {
  background-color: var(--warning);
}

.timeline-square.future {
  background-color: var(--border-light);
  border: 1px dashed var(--text-muted);
}

.timeline-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.timeline-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
}

.timeline-legend .dot.present {
  background-color: var(--success);
}

.timeline-legend .dot.absent {
  background-color: var(--warning);
}

/* Scores Chart Card & KPI Summary */
.scores-chart-card-student {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.scores-kpi-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.score-kpi-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: var(--transition);
  box-shadow: inset 5px 5px 12px rgba(0, 0, 0, 0.08), inset -5px -5px 12px rgba(255, 255, 255, 0.9);
}

.score-kpi-box:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--gold);
}

.score-kpi-box .kpi-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-kpi-box .kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.score-kpi-box.pre .kpi-value {
  color: #d4af37;
  /* Gold color for pre-test */
}

.score-kpi-box.post .kpi-value {
  color: var(--success);
  /* Green color for post-test */
}

.score-kpi-box.improvement.positive .kpi-value {
  color: var(--success);
}

.score-kpi-box.improvement.negative .kpi-value {
  color: var(--warning);
}

.score-chart-container {
  position: relative;
  width: 100%;
  height: 320px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  min-width: 0;
  overflow: hidden;
}

/* Scores Card Table */
.scores-card-student {
  grid-column: 1 / -1;
}

.scores-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.scores-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.scores-table th,
.scores-table td {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
}

.scores-table th {
  background-color: var(--panel-bg-hover);
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 2px solid var(--border-light);
}

.scores-table td {
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  font-weight: 500;
}

.scores-table tr:last-child td {
  border-bottom: none;
}

.scores-table .text-center {
  text-align: center;
}

.scores-table .diff-positive {
  color: var(--success);
  font-weight: 700;
}

.scores-table .diff-negative {
  color: var(--warning);
  font-weight: 700;
}

.scores-table .diff-neutral {
  color: var(--text-muted);
}

/* Change Password Modal */
.change-password-content {
  max-width: 480px !important;
}

.change-password-content .modal-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.change-password-content .modal-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.change-password-content .modal-header h3 svg {
  color: var(--gold);
}

.change-password-content .modal-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.password-error-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: rgba(184, 58, 56, 0.08);
  border: 1px solid rgba(184, 58, 56, 0.25);
  border-radius: 8px;
  color: var(--warning);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.change-password-content .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.change-password-content .btn-cancel {
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.change-password-content .btn-cancel:hover {
  background-color: var(--panel-bg-hover);
  color: var(--text-primary);
}

.change-password-content .btn-save {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--gold-gradient);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.change-password-content .btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(175, 146, 83, 0.2);
}

/* Animations */
@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsiveness for Bento Grid */
@media (max-width: 900px) {
  .student-bento-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Print Styles for High Quality PDF Export
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide navigation, actions, side controls and modals */
  nav.navbar,
  .student-actions,
  .modal-overlay,
  #detail-modal,
  .lang-toggle,
  .btn-logout,
  .btn-admin,
  #btn-lang-toggle,
  #btn-logout {
    display: none !important;
  }

  /* Isolate Student Dashboard */
  #admin-dashboard-container,
  #login-container {
    display: none !important;
  }

  #student-dashboard-container {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .student-header {
    border-bottom: 2px solid #000000 !important;
    margin-bottom: 20px !important;
    padding-bottom: 10px !important;
  }

  .student-welcome h1 {
    font-size: 24pt !important;
    color: #000000 !important;
  }

  /* Expand Bento Grid to stack layout and fit full width */
  .student-bento-grid,
  .student-layout-with-sidebar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
  }

  .student-sidebar,
  .student-main-content {
    width: 100% !important;
    max-width: 100% !important;
  }

  .bento-card {
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
    transform: none !important;
    margin-bottom: 20px !important;
    page-break-inside: avoid !important;
    background: #ffffff !important;
    padding: 15px !important;
    border-radius: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .bento-card h3 {
    font-size: 14pt !important;
    color: #000000 !important;
    border-bottom: 1px solid #000000 !important;
    margin-bottom: 10px !important;
  }

  /* Profile layout inside print - using Grid to prevent squishing and position warning badge correctly */
  .profile-card-student {
    display: grid !important;
    grid-template-columns: 120px 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 15px 20px !important;
    align-items: start !important;
    text-align: left !important;
  }

  .profile-image-container {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 120px !important;
    height: auto !important;
    margin-bottom: 0 !important;
    border: 2px solid #000000 !important;
    flex-shrink: 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    display: block !important;
  }

  .profile-image-container img.student-avatar {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
  }

  .profile-details {
    grid-column: 2 !important;
    grid-row: 1 !important;
    flex-grow: 1 !important;
  }

  .profile-details h3 {
    text-align: left !important;
    justify-content: flex-start !important;
  }

  #student-flagged-badge.attendance-warning-badge {
    grid-column: 1 / span 2 !important;
    grid-row: 2 !important;
    width: 100% !important;
    margin-bottom: 0 !important;
    box-sizing: border-box !important;
    background: rgba(184, 58, 56, 0.08) !important;
    border: 1px solid #b83a38 !important;
    color: #b83a38 !important;
  }

  .detail-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px 15px !important;
  }

  .detail-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.15rem !important;
    border-bottom: 1px dashed #dddddd !important;
    padding-bottom: 4px !important;
  }

  .detail-label {
    color: #555555 !important;
    font-size: 8.5pt !important;
  }

  .detail-val {
    color: #000000 !important;
    text-align: left !important;
    word-break: break-word !important;
    white-space: normal !important;
    width: 100% !important;
    font-size: 9.5pt !important;
  }

  /* Attendance styling in print - horizontal compact layout */
  .attendance-kpi-summary {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 30px !important;
    width: 100% !important;
  }

  .kpi-stats {
    display: flex !important;
    flex-direction: row !important;
    gap: 15px !important;
    flex-grow: 1 !important;
    width: auto !important;
  }

  .scores-kpi-summary {
    display: flex !important;
    flex-direction: column !important;
  }

  .donut-chart-wrapper {
    width: 120px !important;
    height: 120px !important;
    flex-shrink: 0 !important;
  }

  .donut-chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
  }

  .donut-center-text #std-attendance-rate {
    font-size: 18pt !important;
  }

  .stat-box {
    flex: 1 !important;
    border: 1px solid #dddddd !important;
    padding: 8px !important;
    background: #ffffff !important;
  }

  .stat-num {
    font-size: 14pt !important;
  }

  /* Prevent timeline from wrapping badly */
  .attendance-timeline {
    gap: 5px !important;
  }

  .timeline-item {
    border: 1px solid #cccccc !important;
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: none !important;
  }

  .timeline-square.present {
    background-color: #3c7a52 !important;
  }

  .timeline-square.absent {
    background-color: #b83a38 !important;
  }

  .timeline-square.leave {
    background-color: #af9253 !important;
  }

  /* Score table styled for print */
  .scores-table-wrapper {
    border: 1px solid #000000 !important;
    width: 100% !important;
    overflow: visible !important;
  }

  .scores-table {
    width: 100% !important;
    table-layout: auto !important;
  }

  .scores-table th {
    background-color: #f3f4f6 !important;
    color: #000000 !important;
    border-bottom: 1px solid #000000 !important;
  }

  .scores-table td {
    border-bottom: 1px solid #dddddd !important;
    color: #000000 !important;
  }

  /* Score chart styled for print to prevent overflow */
  .score-chart-container {
    max-width: 100% !important;
    width: 100% !important;
    height: 250px !important;
    overflow: hidden !important;
    background: #ffffff !important;
    border: 1px solid #cccccc !important;
  }

  .score-chart-container canvas {
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
  }
}

/* ==========================================================================
   STUDENT DASHBOARD V2 (Light Theme)
   ========================================================================== */
.student-bento-grid-v2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

@media (min-width: 1024px) {
  .student-bento-grid-v2 {
    grid-template-columns: 350px 1fr;
  }
}

.glass-card-v2 {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
}

/* Profile Card */
.profile-card-v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-image-wrapper {
  margin-bottom: 1rem;
}

.profile-image-border {
  padding: 4px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d4af37 0%, #f1d592 100%);
}

.student-avatar-v2 {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  border: 4px solid white;
}

.profile-name-v2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  text-align: center;
}

.profile-role-v2 {
  font-size: 0.875rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.profile-details-v2 {
  width: 100%;
}

.detail-row-v2 {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.875rem;
}

.detail-row-v2.no-border {
  border-bottom: none;
}

.detail-row-v2.vertical {
  flex-direction: column;
  gap: 0.25rem;
}

.detail-label-v2 {
  color: var(--text-muted);
  font-weight: 500;
}

.detail-val-v2 {
  color: var(--text-primary);
  font-weight: 600;
}

.detail-val-v2.text-right {
  text-align: right;
}

.highlight-gold {
  color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
}

/* Stats Section */
.stats-section-v2 {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-title-v2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title-v2.space-between {
  justify-content: space-between;
}

.flex-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.title-indicator {
  width: 4px;
  height: 18px;
  background: var(--gold);
  border-radius: 2px;
}

/* Attendance Stats */
.stats-grid-v2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .stats-grid-v2 {
    grid-template-columns: 140px repeat(2, 1fr);
  }
}

.progress-circle-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.circular-progress-v2 {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.circular-progress-inner {
  width: 84px;
  height: 84px;
  background-color: white;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.progress-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kpi-box-v2 {
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.kpi-box-v2.present-box {
  background: rgba(16, 185, 129, 0.05);
}

.kpi-box-v2.absent-box {
  background: rgba(239, 68, 68, 0.05);
}

.kpi-box-v2 .kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.present-text {
  color: #10b981;
}

.absent-text {
  color: #ef4444;
}

.kpi-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Timeline */
.timeline-container-v2 {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.timeline-title-v2 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.timeline-dots-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.timeline-legend-v2 {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legend-item-v2 {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.present {
  background-color: #10b981;
}

.legend-dot.absent {
  background-color: #ef4444;
}

/* Scores Table */
.scores-table-wrapper-v2 {
  overflow-x: auto;
}

.scores-table-v2 {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.scores-table-v2 th {
  text-align: left;
  padding: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.scores-table-v2 th.text-center {
  text-align: center;
}

.scores-table-v2 td {
  padding: 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  vertical-align: middle;
}

.scores-table-v2 tr:last-child td {
  border-bottom: none;
}

.scores-table-v2 td.text-center {
  text-align: center;
}

/* Score Bars */
.score-bar-container {
  width: 100%;
  background-color: #f3f4f6;
  border-radius: 4px;
  height: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 0.5rem;
  color: white;
  font-weight: 600;
  font-size: 0.75rem;
  position: absolute;
  left: 0;
  top: 0;
  transition: width 0.5s ease;
}

.score-bar-fill.poor {
  background-color: #ef4444;
}

.score-bar-fill.average {
  background-color: #f59e0b;
}

.score-bar-fill.good {
  background-color: #10b981;
}

.score-bar-fill.excellent {
  background-color: #3b82f6;
}

.score-value-text {
  position: relative;
  z-index: 10;
  font-weight: 600;
  font-size: 0.85rem;
  color: #374151;
  padding-left: 0.5rem;
}

.score-value-text.white-text {
  color: white;
}

.score-improvement-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-positive {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.badge-negative {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.badge-neutral {
  background-color: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.student-main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 2. Glassmorphism Group Badges */
.group-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}




.timeline-dots-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.timeline-legend-v2 {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legend-item-v2 {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.present {
  background-color: #10b981;
}

.legend-dot.absent {
  background-color: #ef4444;
}

/* Scores Table */
.scores-table-wrapper-v2 {
  overflow-x: auto;
}

.scores-table-v2 {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.scores-table-v2 th {
  text-align: left;
  padding: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.scores-table-v2 th.text-center {
  text-align: center;
}

.scores-table-v2 td {
  padding: 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  vertical-align: middle;
}

.scores-table-v2 tr:last-child td {
  border-bottom: none;
}

.scores-table-v2 td.text-center {
  text-align: center;
}

/* Score Bars */
.score-bar-container {
  width: 100%;
  background-color: #f3f4f6;
  border-radius: 4px;
  height: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 0.5rem;
  color: white;
  font-weight: 600;
  font-size: 0.75rem;
  position: absolute;
  left: 0;
  top: 0;
  transition: width 0.5s ease;
}

.score-bar-fill.poor {
  background-color: #ef4444;
}

.score-bar-fill.average {
  background-color: #f59e0b;
}

.score-bar-fill.good {
  background-color: #10b981;
}

.score-bar-fill.excellent {
  background-color: #3b82f6;
}

.score-value-text {
  position: relative;
  z-index: 10;
  font-weight: 600;
  font-size: 0.85rem;
  color: #374151;
  padding-left: 0.5rem;
}

.score-value-text.white-text {
  color: white;
}

.score-improvement-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-positive {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.badge-negative {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.badge-neutral {
  background-color: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

/* =========================================================
   STUDENT DASHBOARD LAYOUT UPDATES
   ========================================================= */

/* 1. Sidebar Layout */
.student-layout-with-sidebar {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {

  .student-layout-with-sidebar,
  .student-bento-grid,
  .student-bento-grid-v2 {
    grid-template-columns: 1fr !important;
  }

  .student-sidebar {
    position: static !important;
    height: auto !important;
    overflow-y: visible !important;
    padding-right: 0 !important;
  }

  .student-dashboard {
    padding: 0 1rem !important;
    margin: 1rem auto !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .bento-card {
    padding: 1.5rem 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .attendance-kpi-summary {
    flex-direction: column !important;
    align-items: center !important;
    gap: 1.5rem !important;
  }

  .kpi-stats {
    width: 100% !important;
  }

  .scores-kpi-summary {
    grid-template-columns: 1fr !important;
  }

  .profile-image-container {
    margin: 0 auto 1.5rem auto !important;
    display: block !important;
  }

  body,
  html {
    overflow-x: hidden !important;
    width: 100% !important;
  }
}

.student-sidebar {
  position: sticky;
  top: 90px;
  height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Custom scrollbar for sidebar */
.student-sidebar::-webkit-scrollbar {
  width: 4px;
}

.student-main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

/* 2. Glassmorphism Group Badges */
.group-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.group-glass-red {
  background: rgba(220, 38, 38, 0.15);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.3);
}

.group-glass-green {
  background: rgba(5, 150, 105, 0.15);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.3);
}

.group-glass-blue {
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.3);
}

.group-glass-yellow {
  background: rgba(217, 119, 6, 0.15);
  color: #a16207;
  border-color: rgba(217, 119, 6, 0.3);
}

.group-glass-purple {
  background: rgba(124, 58, 237, 0.15);
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.3);
}

.group-glass-default {
  background: rgba(107, 114, 128, 0.15);
  color: #4b5563;
  border-color: rgba(107, 114, 128, 0.3);
}

/* 3. Admin Style Card (Pre vs Post Test) */
.admin-style-card {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
}

.admin-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.admin-card-icon {
  color: var(--gold);
  width: 24px;
  height: 24px;
}

.admin-style-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  border: none;
}

/* 4. Chart Container Visibility */
.score-chart-container {
  background-color: #ffffff;
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem;
  margin-top: 1rem;
}

/* 5. Scores Trend Section (matching Admin Console look) */
.student-scores-trends-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.trend-item {
  background-color: #f8fafc;
  /* light slate */
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trend-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary, #1e293b);
}

.trend-row-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.trend-bars-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.trend-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.trend-bar-label {
  width: 70px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  flex-shrink: 0;
}

.trend-bar-bg {
  flex: 1;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.trend-bar-fill {
  height: 100%;
  border-radius: 9999px;
}

.trend-bar-fill.pre {
  background: linear-gradient(to right, #d97706, #ea580c);
  /* orange/amber gradient */
}

.trend-bar-fill.post {
  background: linear-gradient(to right, #059669, #0d9488);
  /* emerald/teal gradient */
}

.trend-bar-fill.general {
  background: linear-gradient(to right, #eab308, #d97706);
  /* yellow/amber gradient */
}

.trend-bar-value {
  width: 80px;
  text-align: right;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

/* Improvement badge styles */
.trend-diff-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.375rem;
  flex-shrink: 0;
  min-width: 60px;
}

.trend-diff-badge.positive {
  color: #15803d;
  /* green-700 */
  background-color: #f0fdf4;
  /* green-50 */
}

.trend-diff-badge.negative {
  color: #b91c1c;
  /* red-700 */
  background-color: #fef2f2;
  /* red-50 */
}

.trend-diff-badge.neutral {
  color: #475569;
  /* slate-600 */
  background-color: #f1f5f9;
  /* slate-100 */
}

.trend-general-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.trend-general-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  padding-left: 1rem;
  border-left: 2px solid #e2e8f0;
}

.attendance-warning-badge {
  background: rgba(184, 58, 56, 0.08);
  border: 1px solid var(--warning);
  color: var(--warning);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  width: 100%;
  box-shadow: 0 4px 10px rgba(184, 58, 56, 0.1);
  box-sizing: border-box;
}

.attendance-warning-badge svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
  color: var(--warning);
  flex-shrink: 0;
}

/* =========================================================
   PORTRAIT / MOBILE RESPONSIVE NAVBAR OVERRIDES
   ========================================================= */

@media (max-width: 768px),
(orientation: portrait) {
  .navbar {
    position: relative !important;
    top: auto !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 0.75rem 1rem !important;
    gap: 0.75rem !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .brand {
    justify-content: center !important;
  }

  .bep-logo {
    height: 56px !important;
    margin: -6px 0.5rem -6px -4px !important;
  }

  .brand-title {
    font-size: 1.05rem !important;
  }

  .brand-subtitle {
    font-size: 0.7rem !important;
  }

  /* index.html nav-menu styles */
  .nav-menu {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    gap: 0.5rem !important;
    padding: 0.25rem 0 !important;
    justify-content: flex-start !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .nav-menu::-webkit-scrollbar {
    display: none !important;
    /* Hide scrollbar for clean UI */
  }

  .nav-menu .nav-link {
    white-space: nowrap !important;
    padding: 0.4rem 0.75rem !important;
    font-size: 0.85rem !important;
  }

  /* overall_dashboard.html nav-links styling */
  .nav-links {
    display: flex !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    flex-wrap: wrap !important;
  }

  .lang-toggle {
    padding: 0.25rem 0.5rem !important;
  }

  .btn-admin {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.8rem !important;
    gap: 0.35rem !important;
  }

  .student-header {
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: center !important;
    gap: 1rem !important;
  }

  .student-welcome {
    text-align: center !important;
  }

  .student-actions {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: auto !important;
    gap: 0.75rem !important;
    justify-content: center !important;
  }

  .btn-action {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
  }

  .detail-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.25rem !important;
  }

  .detail-val {
    text-align: left !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    width: 100% !important;
  }
}

/* Accessibility Focus Indicators */
.search-input:focus,
.filter-select:focus,
.filter-popup-btn:focus,
.btn-admin:focus,
.nav-link:focus,
.lang-toggle:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px var(--panel-bg), 0 0 0 4px var(--primary-navy) !important;
}

/* =========================================================
   STUDENT WELCOME CARD (Neumorphism + Shine Hover)
   ========================================================= */

.student-header.neumorphic-card {
  background: var(--bg-color);
  /* Match background for neumorphic feel */
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 
    8px 8px 20px rgba(45, 38, 27, 0.12), 
    3px 3px 8px rgba(175, 146, 83, 0.15), 
    -8px -8px 20px rgba(255, 255, 255, 0.98);
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(175, 146, 83, 0.18);
}

.student-header.neumorphic-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    12px 16px 28px rgba(45, 38, 27, 0.16),
    4px 4px 12px rgba(175, 146, 83, 0.2),
    -12px -16px 28px rgba(255, 255, 255, 1.0);
}

.student-welcome {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  z-index: 2;
}

.welcome-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(175, 146, 83, 0.3);
  color: #fff;
  transition: transform 0.4s ease;
}

.student-header.neumorphic-card:hover .welcome-icon-wrapper {
  transform: scale(1.05) rotate(5deg);
}

.welcome-icon {
  width: 28px;
  height: 28px;
}

.welcome-text-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#student-welcome-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-navy);
  font-family: var(--font-sans);
  letter-spacing: -0.5px;
  margin: 0;
  line-height: 1.2;
}

.student-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(30, 58, 138, 0.06);
  border: 1px solid rgba(30, 58, 138, 0.15);
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  width: fit-content;
}

.badge-icon {
  width: 14px;
  height: 14px;
  color: var(--primary-navy);
}

.badge-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

#student-id-display {
  color: var(--primary-navy);
  font-weight: 700;
}

/* Shine Hover Effect */
.shine-hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.6) 50%,
      rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg);
  z-index: 1;
  transition: none;
  pointer-events: none;
}

/* .student-header.neumorphic-card:hover .shine-hover::after animation disabled */

@keyframes shine-sweep {
  0% {
    left: -150%;
  }

  100% {
    left: 200%;
  }
}

/* Student Actions Icon Only */
.student-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.student-actions .btn-action {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(175, 146, 83, 0.2);
  background: var(--panel-bg);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  font-size: 0;
  /* Hide any lingering text */
  padding: 0;
}

.student-actions .btn-action i {
  width: 20px;
  height: 20px;
  color: var(--primary-navy);
  transition: transform 0.2s ease;
}

.student-actions .btn-action:hover {
  background: var(--gold-gradient);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(175, 146, 83, 0.3);
  transform: translateY(-2px);
}

.student-actions .btn-action:hover i {
  color: #fff;
  transform: scale(1.1);
}

/* Tooltip */
.tooltip-wrapper::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  z-index: 10;
  font-family: var(--font-sans);
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tooltip-wrapper::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  border-width: 0 6px 6px 6px;
  border-style: solid;
  border-color: transparent transparent rgba(15, 23, 42, 0.9) transparent;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  z-index: 10;
}

.tooltip-wrapper:hover::before,
.tooltip-wrapper:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}