@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

/* ==========================================================================
   CSS Reset & Variables (School Attendance & Grading Design System)
   ========================================================================== */

:root {
  /* Colors - Modern Sky Blue & White Palette */
  --primary: #0284c7;
  /* Vibrant Sky Blue */
  --primary-dark: #0369a1;
  /* Darker Sky Blue */
  --primary-light: #f0f9ff;
  /* Very Light Sky Blue Tint */

  --teal-blue: #0284c7;
  /* Sky Blue */
  --teal-blue-dark: #075985;
  /* Deep Sky Blue */
  --teal-blue-light: #e0f2fe;
  /* Soft Sky Blue Tint */

  --success: #10b981;
  /* Emerald Green */
  --success-dark: #047857;
  /* Dark Green */
  --success-light: #d1fae5;
  /* Soft Green Tint */

  --info: #0284c7;
  /* Sky Blue */
  --info-dark: #0369a1;
  /* Dark Sky Blue */
  --info-light: #e0f2fe;
  /* Soft Sky Blue Tint */

  --warning: #f59e0b;
  /* Amber Yellow */
  --warning-dark: #b45309;
  /* Dark Amber */
  --warning-light: #fef3c7;
  /* Soft Amber Tint */

  --danger: #ef4444;
  /* Rose Red */
  --danger-dark: #b91c1c;
  /* Dark Red */
  --danger-light: #fee2e2;
  /* Soft Red Tint */

  --indigo: #6366f1;
  /* Indigo */
  --indigo-dark: #4338ca;
  /* Dark Indigo */
  --indigo-light: #e0e7ff;
  /* Soft Indigo Tint */

  --bg-body: #f4faff;
  /* Clean Soft Sky Blue tint background */
  --bg-card: #ffffff;
  /* Clean White */
  --text-main: #0f172a;
  /* Slate 900 */
  --text-muted: #475569;
  /* Slate 600 */
  --border-color: #e0f2fe;
  /* Soft Sky Blue border */

  /* Fonts */
  --font-family: 'Prompt', 'Kanit', 'IBM Plex Sans Thai', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Shadows - Modern Soft Blur Shadows */
  --shadow-sm: 0 1px 3px 0 rgba(2, 132, 199, 0.04), 0 1px 2px 0 rgba(2, 132, 199, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(2, 132, 199, 0.05), 0 2px 4px -2px rgba(2, 132, 199, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(2, 132, 199, 0.08), 0 4px 6px -4px rgba(2, 132, 199, 0.08);
  --shadow-premium: 0 20px 25px -5px rgba(2, 132, 199, 0.05), 0 10px 10px -5px rgba(2, 132, 199, 0.03);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

.hidden {
  display: none !important;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ==========================================================================
   Login Screen CSS (Matches Image 1 & 5)
   ========================================================================== */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, #e0f2fe 0%, #f4faff 60%, #ffffff 100%);
  padding: 20px;
}

.login-card {
  display: flex;
  width: 1000px;
  max-width: 100%;
  background-color: var(--bg-card);
  border-radius: 20px;
  box-shadow: var(--shadow-premium);
  overflow: hidden;
  min-height: 600px;
}

/* Left Pane (Branding) */
.login-left {
  flex: 1.1;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  padding: 60px 40px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
}

.login-left::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -10%;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  filter: blur(15px);
}

.login-left::after {
  content: '';
  position: absolute;
  bottom: -5%;
  right: -5%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  filter: blur(25px);
}

.login-logo-circle {
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
  color: #ffffff;
  backdrop-filter: blur(5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0px);
  }
}

.login-left h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.login-left p {
  font-size: 1.1rem;
  opacity: 0.85;
}

.login-footer-credits {
  position: absolute;
  bottom: 25px;
  font-size: 0.75rem;
  opacity: 0.65;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 80%;
  padding-top: 15px;
}

/* Right Pane (Form inputs) */
.login-right {
  flex: 0.9;
  padding: 50px 45px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-right h2 {
  font-size: 1.85rem;
  font-weight: 700;
  color: #0f1e36;
  margin-bottom: 8px;
}

.login-instruction {
  font-size: 0.98rem;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.login-tabs {
  display: flex;
  background-color: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 30px;
}

.login-tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.login-tab.active {
  background-color: #ffffff;
  color: var(--teal-blue);
  box-shadow: var(--shadow-sm);
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f1e36;
  margin-bottom: 6px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forgot-pwd {
  font-size: 0.8rem;
  font-weight: 500;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background-color: #f8fafc;
}

.input-with-icon input:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.register-hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 30px;
}

@media (max-width: 768px) {
  .login-card {
    flex-direction: column;
    width: 100%;
    max-width: 480px;
    min-height: auto;
    border-radius: 16px;
    margin: 10px auto;
  }

  .login-left {
    padding: 40px 20px;
    flex: none;
    width: 100%;
    min-height: auto;
  }

  .login-left::before,
  .login-left::after {
    display: none;
  }

  .login-logo-circle {
    width: 100px;
    height: 100px;
    margin-bottom: 15px;
  }

  .login-logo-circle svg {
    width: 50px;
    height: 50px;
  }

  .login-left h1 {
    font-size: 1.4rem;
  }

  .login-left p {
    font-size: 0.95rem;
  }

  .login-right {
    padding: 30px 20px;
    flex: none;
    width: 100%;
  }

  .login-right h2 {
    font-size: 1.4rem;
    text-align: center;
  }

  .login-instruction {
    font-size: 0.88rem;
    text-align: center;
    margin-bottom: 20px;
  }

  .login-tabs {
    margin-bottom: 20px;
  }

  .login-tab {
    font-size: 0.88rem;
    padding: 10px 6px;
  }
}


/* ==========================================================================
   Dashboard Sidebar & Layout (Matches Image 2 & 3)
   ========================================================================== */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  background: linear-gradient(180deg, #0284c7 0%, #0284c7 35%, #0369a1 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 4px 0 15px rgba(2, 132, 199, 0.15);
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.school-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.school-info-text h3 {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  white-space: nowrap;
}

.school-info-text span {
  font-size: 0.85rem;
  opacity: 0.75;
  display: block;
  margin-top: 2px;
  color: #e2e8f0;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 15px 10px;
}

.menu-group-title {
  font-family: 'Prompt', 'Kanit', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #ffffff; /* เปลี่ยนเป็นสีขาวบริสุทธิ์ */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
  opacity: 1;
  margin: 22px 0 8px 12px;
  border-left: 3px solid #ffffff; /* ขีดขอบสีขาวด้านซ้ายเพื่อเพิ่มมิติ */
  padding-left: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  margin-bottom: 5px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: left;
}

.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: scale(1.04);
  padding-left: 18px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.menu-item.active {
  background-color: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.menu-icon {
  opacity: 0.8;
}

.sidebar-profile {
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-details {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.profile-text {
  display: flex;
  flex-direction: column;
}

.profile-text span {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

.profile-text small {
  font-size: 0.7rem;
  opacity: 0.6;
  text-transform: uppercase;
}

.btn-logout {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ef4444;
}

/* Main Content Area */
.main-content {
  margin-left: 270px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: linear-gradient(90deg, #0284c7 0%, #0369a1 100%);
  padding: 15px 30px;
  border-bottom: 1px solid #0369a1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
}

.breadcrumb-app {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.breadcrumb-separator {
  color: rgba(255, 255, 255, 0.5);
}

.breadcrumb-current {
  color: #ffffff;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.school-badge-pill {
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
}

.user-pill-dropdown {
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
}

.topbar .btn-burger {
  color: #ffffff;
}

.topbar .btn-burger:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.topbar .offline-badge {
  background-color: #ffedd5;
  border: 1px solid #fed7aa;
  color: #ea580c;
}


.view-container {
  padding: 30px;
  flex: 1;
}

/* ==========================================================================
   Content Views Layout
   ========================================================================== */

.content-view {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Summary Cards (Image 2) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background-color: var(--bg-card);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-card::after {
  content: '';
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.05;
  pointer-events: none;
}

.stat-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.stat-icon-wrapper svg {
  width: 20px !important;
  height: 20px !important;
}

.stat-card:hover .stat-icon-wrapper {
  transform: scale(1.08);
}

.stat-numbers {
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main);
}

.stat-lbl {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}


/* Modern Colors for Cards (Blue-White & Curated Accents) */
.stat-card.blue {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid #0284c7;
  color: #ffffff;
}

.stat-card.blue:hover {
  box-shadow: 0 8px 16px rgba(2, 132, 199, 0.4);
}

.stat-card.blue .stat-icon-wrapper {
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.stat-card.blue .stat-val {
  color: #ffffff;
}

.stat-card.blue .stat-lbl {
  color: #e0f2fe;
}

.stat-card.purple {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: 1px solid #6366f1;
  color: #ffffff;
}

.stat-card.purple:hover {
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.4);
}

.stat-card.purple .stat-icon-wrapper {
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.stat-card.purple .stat-val {
  color: #ffffff;
}

.stat-card.purple .stat-lbl {
  color: #e0e7ff;
}

.stat-card.orange {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border: 1px solid #f97316;
  color: #ffffff;
}

.stat-card.orange:hover {
  box-shadow: 0 8px 16px rgba(234, 88, 12, 0.4);
}

.stat-card.orange .stat-icon-wrapper {
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.stat-card.orange .stat-val {
  color: #ffffff;
}

.stat-card.orange .stat-lbl {
  color: #ffedd5;
}

.stat-card.yellow {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  border: 1px solid #eab308;
  color: #ffffff;
}

.stat-card.yellow:hover {
  box-shadow: 0 8px 16px rgba(202, 138, 4, 0.4);
}

.stat-card.yellow .stat-icon-wrapper {
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.stat-card.yellow .stat-val {
  color: #ffffff;
}

.stat-card.yellow .stat-lbl {
  color: #fef9c3;
}


/* Special Check-in Action Card on Dashboard */
.stat-card.checkin-action {
  cursor: pointer;
  border-left: 5px solid var(--success);
  background: linear-gradient(135deg, var(--success-light) 0%, var(--bg-card) 100%);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card.checkin-action:hover {
  border-left-color: var(--success-dark);
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-card.checkin-action .stat-icon-wrapper {
  background-color: var(--success-light);
  color: var(--success-dark);
}

.stat-card.checkin-action .stat-val {
  font-size: 1.2rem;
  color: var(--success-dark);
  font-family: 'Prompt', 'Sarabun', sans-serif;
  font-weight: 800;
  display: block;
  margin-bottom: 2px;
}

.stat-card.checkin-action .stat-lbl {
  font-size: 0.82rem;
  color: var(--success-dark);
  opacity: 0.85;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Special Student Management Action Card on Dashboard */
.stat-card.students-action {
  cursor: pointer;
  border-left: 5px solid var(--primary);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-card) 100%);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card.students-action:hover {
  border-left-color: var(--primary-dark);
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-card.students-action .stat-icon-wrapper {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.stat-card.students-action .stat-val {
  font-size: 1.2rem;
  color: var(--primary-dark);
  font-family: 'Prompt', 'Sarabun', sans-serif;
  font-weight: 800;
  display: block;
  margin-bottom: 2px;
}

.stat-card.students-action .stat-lbl {
  font-size: 0.82rem;
  color: var(--primary-dark);
  opacity: 0.85;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Special Teacher Management Action Card on Dashboard */
.stat-card.teachers-action {
  cursor: pointer;
  border-left: 5px solid var(--indigo);
  background: linear-gradient(135deg, var(--indigo-light) 0%, var(--bg-card) 100%);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card.teachers-action:hover {
  border-left-color: var(--indigo-dark);
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-card.teachers-action .stat-icon-wrapper {
  background-color: var(--indigo-light);
  color: var(--indigo-dark);
}

.stat-card.teachers-action .stat-val {
  font-size: 1.2rem;
  color: var(--indigo-dark);
  font-family: 'Prompt', 'Sarabun', sans-serif;
  font-weight: 800;
  display: block;
  margin-bottom: 2px;
}

.stat-card.teachers-action .stat-lbl {
  font-size: 0.82rem;
  color: var(--indigo-dark);
  opacity: 0.85;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Special Subject Management Action Card on Dashboard */
.stat-card.subjects-action {
  cursor: pointer;
  border-left: 5px solid var(--warning);
  background: linear-gradient(135deg, var(--warning-light) 0%, var(--bg-card) 100%);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card.subjects-action:hover {
  border-left-color: var(--warning-dark);
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-card.subjects-action .stat-icon-wrapper {
  background-color: var(--warning-light);
  color: var(--warning-dark);
}

.stat-card.subjects-action .stat-val {
  font-size: 1.2rem;
  color: var(--warning-dark);
  font-family: 'Prompt', 'Sarabun', sans-serif;
  font-weight: 800;
  display: block;
  margin-bottom: 2px;
}

.stat-card.subjects-action .stat-lbl {
  font-size: 0.82rem;
  color: var(--warning-dark);
  opacity: 0.85;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}





/* Dashboard layout sections */
.dashboard-details-row {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 20px;
}

.panel-card {
  background-color: var(--bg-card);
  border-radius: 16px;
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid var(--border-color);
}

.panel-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.header-action select {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border-color);
  background-color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 600;
}

.panel-body {
  padding: 24px;
}

/* Interactive custom bar chart */
.chart-container-inner {
  padding: 30px 24px;
  flex: 1;
  display: flex;
  align-items: flex-end;
  min-height: 280px;
}

.custom-bar-chart {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  width: 100%;
  height: 200px;
  position: relative;
  border-bottom: 1.5px solid #cbd5e1;
  padding-bottom: 5px;
}

.chart-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 60px;
}

.chart-bar {
  width: 32px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(to top, #3b82f6, #60a5fa);
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-height: 5px;
}

.chart-bar:hover {
  filter: brightness(0.95);
}

.chart-bar-tooltip {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #0f172a;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.chart-bar:hover .chart-bar-tooltip {
  opacity: 1;
}

.chart-bar-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px;
  white-space: nowrap;
}

.today-summary-content {
  padding: 20px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 15px;
}

.summary-row-stat {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-radius: 12px;
  background-color: #f8fafc;
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.summary-row-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.summary-row-stat span {
  font-size: 0.85rem;
  font-weight: 600;
}

.summary-val-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.summary-val-badge.present {
  background-color: var(--success-light);
  color: var(--success-dark);
  border-color: rgba(16, 185, 129, 0.25);
}

.summary-val-badge.sick {
  background-color: var(--info-light);
  color: var(--info-dark);
  border-color: rgba(2, 132, 199, 0.25);
}

.summary-val-badge.leave {
  background-color: var(--warning-light);
  color: var(--warning-dark);
  border-color: rgba(245, 158, 11, 0.25);
}

.summary-val-badge.absent {
  background-color: var(--danger-light);
  color: var(--danger-dark);
  border-color: rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   Table & Grid components
   ========================================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  background-color: var(--primary-light);
  padding: 12px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--teal-blue);
  text-transform: uppercase;
  border-bottom: 1.5px solid var(--border-color);
  letter-spacing: 0.5px;
}

.table td {
  padding: 14px 18px;
  font-size: 0.98rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.03);
}

.table.middle-align td {
  vertical-align: middle;
}

.table.center-align th,
.table.center-align td {
  text-align: center;
}

.table.center-align td:first-child,
.table.center-align td:nth-child(2) {
  text-align: left;
}

/* ==========================================================================
   Badges & Interactive Status toggles (Matches Image 4)
   ========================================================================== */

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid transparent;
}

.status-badge.present {
  background-color: var(--success-light);
  color: var(--success-dark);
  border-color: rgba(16, 185, 129, 0.25);
}

.status-badge.sick {
  background-color: #fef08a; /* Yellow-light */
  color: #a16207; /* Yellow-dark */
  border-color: rgba(234, 179, 8, 0.25);
}

.status-badge.leave {
  background-color: #dbeafe; /* Blue-light */
  color: #1d4ed8; /* Blue-dark */
  border-color: rgba(59, 130, 246, 0.25);
}

.status-badge.absent {
  background-color: var(--danger-light);
  color: var(--danger-dark);
  border-color: rgba(239, 68, 68, 0.25);
}

.status-badge.late {
  background-color: #ffedd5; /* Orange-light */
  color: #c2410c; /* Orange-dark */
  border-color: rgba(249, 115, 22, 0.25);
}

/* Double-toggle Status buttons */
.status-btn-group {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.status-pill-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-muted);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-pill-btn:hover {
  background-color: #f1f5f9;
}

/* Present Active */
.status-pill-btn.btn-present.active {
  background-color: var(--success);
  border-color: var(--success);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

/* Sick Active */
.status-pill-btn.btn-sick.active {
  background-color: var(--info);
  border-color: var(--info);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

/* Leave Active */
.status-pill-btn.btn-leave.active {
  background-color: var(--warning);
  border-color: var(--warning);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

/* Absent Active */
.status-pill-btn.btn-absent.active {
  background-color: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

/* Attendance panel controls bar */
.attendance-top-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 24px;
  background-color: #ffffff;
  border-radius: 16px;
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 992px) {
  .attendance-top-panel {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
  }
}

.attendance-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.control-item {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 160px;
}

.control-item label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.control-item.align-bottom {
  flex: none;
  min-width: auto;
}

/* Redesign classroom summary badge card */
.classroom-summary-badge {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
  border: 1.5px solid var(--border-color);
  padding: 16px 20px;
  border-radius: 14px;
  min-width: auto;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.05);
}

.classroom-summary-badge.bg-indigo {
  background: linear-gradient(135deg, var(--indigo-light) 0%, #ffffff 100%);
  border-color: var(--indigo-light);
}

.classroom-summary-badge .room-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.classroom-summary-badge.bg-indigo .room-name {
  color: var(--indigo-dark);
}

.classroom-summary-badge .student-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Save footer bar */
.panel-footer-actions {
  padding: 20px 24px;
  background-color: #f8fafc;
  border-top: 1.5px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.line-notify-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
}

/* Form Filters */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 15px;
  padding: 18px 24px;
}

.filter-item {
  display: flex;
  flex-direction: column;
  width: 200px;
}

.filter-item label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */

.form-select,
.form-select-sm,
.form-input {
  width: 100%;
  height: 42px;
  padding: 8px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  background-color: #f8fafc;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-select-sm {
  height: 34px;
  padding: 4px 10px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  padding-right: 40px; /* Space for the arrow */
}

.form-select:focus,
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

.btn-primary,
.btn-success,
.btn-danger,
.btn-secondary,
.btn-indigo,
.btn-success-outline,
.btn-secondary-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  padding: 8px 16px;
  font-size: 0.95rem;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-indigo {
  background-color: var(--indigo);
  color: #ffffff;
  padding: 8px 16px;
  font-size: 0.95rem;
}

.btn-indigo:hover {
  background-color: var(--indigo-dark);
}

.btn-success {
  background-color: var(--success);
  color: #ffffff;
  padding: 8px 16px;
  font-size: 0.95rem;
}

.btn-success:hover {
  background-color: var(--success-dark);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
  padding: 6px 12px;
  font-size: 0.9rem;
}

.btn-danger:hover {
  background-color: var(--danger-dark);
}

.btn-secondary {
  background-color: #f1f5f9;
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  font-size: 0.95rem;
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-success-outline {
  background-color: transparent;
  border: 1.5px solid var(--success);
  color: var(--success-dark);
  padding: 8px 16px;
  font-size: 0.95rem;
}

.btn-success-outline:hover {
  background-color: var(--success-light);
}

.btn-secondary-outline {
  background-color: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  font-size: 0.95rem;
}

.btn-secondary-outline:hover {
  background-color: #f8fafc;
  color: var(--text-main);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.88rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1.05rem;
  border-radius: 10px;
}

/* Score Inputs */
.score-input {
  width: 75px;
  padding: 6px;
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  text-align: center;
  font-weight: 700;
  font-size: 0.88rem;
}

.score-input:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.bold-score {
  font-weight: 700;
  font-size: 0.95rem;
}

.grade-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  background-color: #f1f5f9;
  color: var(--text-main);
}

.grade-badge.excellent {
  background-color: var(--success-light);
  color: var(--success-dark);
}

.grade-badge.failed {
  background-color: var(--danger-light);
  color: var(--danger-dark);
}

/* Switch slider styling */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .2s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .2s;
}

input:checked+.slider {
  background-color: #06C755;
}

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

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* ==========================================================================
   Settings Card sizing
   ========================================================================== */

.card-half {
  max-width: 600px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 6px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.form-actions-inline {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.border-bottom {
  border-bottom: 1.5px solid var(--border-color);
}

/* ==========================================================================
   Modals (Backdrop blur + Cards)
   ========================================================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background-color: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 500px;
  max-width: 90%;
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.close-modal:hover {
  color: var(--text-main);
}

#form-classroom,
#form-student,
#form-subject {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}

/* ==========================================================================
   Official Report & Document Styles
   ========================================================================== */
.official-doc-header {
  text-align: center;
  margin-bottom: 30px;
}

.garuda-logo-wrapper {
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
}

.doc-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  font-family: 'Prompt', 'Kanit', 'IBM Plex Sans Thai', sans-serif;
}

.doc-subtitle {
  font-size: 1.15rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.doc-meta {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 20px;
}

.doc-section {
  margin-bottom: 30px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 6px;
  text-align: left;
}

.cell-bordered th,
.cell-bordered td {
  border: 1px solid #cbd5e1 !important;
}

.official-signature-area {
  margin-top: 50px;
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.sig-block {
  text-align: center;
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.8;
  color: #0f172a;
}

.sig-name {
  margin-top: 15px;
  font-weight: 600;
}

.sig-position {
  font-weight: 500;
}

/* ==========================================================================
   Responsive & Drawer Navigation Styles
   ========================================================================== */
.btn-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  padding: 5px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.btn-burger:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(2px);
  z-index: 95;
  animation: fadeIn 0.2s ease;
}

@media (max-width: 992px) {
  .btn-burger {
    display: inline-flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0 !important;
  }

  .dashboard-details-row {
    grid-template-columns: 1fr !important;
  }

  .attendance-top-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .classroom-summary-badge {
    align-items: flex-start;
  }

  .attendance-controls {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 10px 15px;
  }

  .topbar-actions {
    display: none;
  }

  .view-container {
    padding: 15px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .official-signature-area {
    flex-direction: column;
    gap: 20px;
  }

  .card-half {
    max-width: 100%;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-item {
    width: 100% !important;
  }
}

/* ==========================================================================
   Report Print styles
   ========================================================================== */

@media print {
  @page {
    size: A4;
    margin: 1.5cm;
  }

  @page landscape-print {
    size: A4 landscape;
    margin: 1.2cm;
  }

  .print-landscape {
    page: landscape-print;
  }

  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-family: 'Sarabun', 'TH Sarabun New', 'Prompt', sans-serif !important;
  }

  .sidebar,
  .topbar,
  .filter-bar,
  .no-print,
  .panel-header button,
  .panel-footer-actions,
  .topbar-actions,
  .btn-primary,
  .btn-secondary,
  .btn-success,
  .btn-danger {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .panel-card {
    border: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
  }

  #attendance-overall-report {
    margin-top: 0 !important;
    padding: 0 !important;
    border: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
  }

  .doc-section {
    page-break-inside: avoid;
  }

  .official-signature-area {
    page-break-inside: avoid;
    margin-top: 60px;
  }

  .table th {
    background-color: #f1f5f9 !important;
    border: 1px solid #000000 !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .table td {
    border: 1px solid #000000 !important;
    color: #000000 !important;
  }
}

/* Classroom management modal responsive helpers */
.classroom-modal-flex {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 15px;
  flex-wrap: wrap;
}

.classroom-modal-col-left {
  flex: 1;
  min-width: 300px;
  border-right: 1.5px solid var(--border-color);
  padding-right: 20px;
}

.classroom-modal-col-right {
  flex: 1;
  min-width: 300px;
}

@media (max-width: 768px) {
  .classroom-modal-col-left {
    border-right: none;
    border-bottom: 1.5px solid var(--border-color);
    padding-right: 0;
    padding-bottom: 20px;
    margin-bottom: 10px;
  }
}

/* Official Report Document Style (A4 sheet styling on screen) */
.official-report-document {
  max-width: 800px;
  margin: 0 auto;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  border-radius: 8px;
  color: #000000 !important;
}

/* Ensure all text inside the print area is deep black for print legibility */
.official-report-document,
.official-report-document *,
.official-report-document span,
.official-report-document strong,
.official-report-document th,
.official-report-document td {
  color: #000000 !important;
}

.official-report-document .cell-bordered th,
.official-report-document .cell-bordered td {
  border: 1px solid #000000 !important;
}

@media print {
  .official-report-document {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }
}

/* ==========================================================================
   Modern Attendance Check-in UI & Mobile Bottom Dock
   ========================================================================== */

/* Active Student Highlighting */
.attendance-active-row {
  background-color: var(--primary-light) !important;
  border-left: 4px solid var(--primary);
  box-shadow: inset 2px 0 0 var(--primary) !important;
}

#attendance-check-table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

#attendance-check-table tbody tr:hover {
  background-color: rgba(2, 132, 199, 0.03);
}

/* Attendance Live Stats Bubble Customization */
/* Attendance Horizontal Stats Bar */
.classroom-summary-horizontal {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
  border: 1.5px solid var(--border-color);
  padding: 20px 24px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.05);
  margin-top: 15px;
}

.room-summary-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 12px;
}

.room-summary-title .room-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.room-summary-title .student-count {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  background-color: #ffffff;
  border: 1.5px solid var(--border-color);
  padding: 4px 14px;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.attendance-live-stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}

@media (min-width: 768px) {
  .attendance-live-stats-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

.live-stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.live-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(2, 132, 199, 0.08);
}

.live-stat-card .stat-icon {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.live-stat-card .stat-info {
  display: flex;
  flex-direction: column;
}

.live-stat-card .stat-lbl {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.live-stat-card .stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
}

/* Present Card Styles */
.live-stat-card.present {
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
  border-color: rgba(16, 185, 129, 0.2);
}
.live-stat-card.present .stat-icon {
  color: var(--success);
}
.live-stat-card.present .stat-val {
  color: var(--success-dark);
}

/* Sick Card Styles */
.live-stat-card.sick {
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
  border-color: rgba(2, 132, 199, 0.2);
}
.live-stat-card.sick .stat-icon {
  color: var(--info);
}
.live-stat-card.sick .stat-val {
  color: var(--info-dark);
}

/* Leave Card Styles */
.live-stat-card.leave {
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
  border-color: rgba(245, 158, 11, 0.2);
}
.live-stat-card.leave .stat-icon {
  color: var(--warning);
}
.live-stat-card.leave .stat-val {
  color: var(--warning-dark);
}

/* Absent Card Styles */
.live-stat-card.absent {
  background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
  border-color: rgba(239, 68, 68, 0.2);
}
.live-stat-card.absent .stat-icon {
  color: var(--danger);
}
.live-stat-card.absent .stat-val {
  color: var(--danger-dark);
}

/* Pinned Mobile Attendance Dock */
.mobile-attendance-dock {
  display: none; /* Hidden on desktop */
}

@media (max-width: 768px) {
  body {
    padding-bottom: 220px; /* Make space for docked bottom bar on mobile screens */
  }
  
  .mobile-attendance-dock {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-top: 2px solid var(--border-color);
    box-shadow: 0 -8px 30px rgba(2, 132, 199, 0.15);
    z-index: 1000;
    padding: 12px 16px 24px 16px;
    gap: 12px;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  @keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  
  .dock-active-student {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 8px;
  }
  
  .dock-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .dock-student-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
  }
  
  .dock-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  
  .dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background-color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 4px;
  }
  
  .dock-btn:hover {
    background-color: #f8fafc;
  }
  
  .dock-btn-icon {
    font-size: 1.2rem;
  }
  
  /* Dock Buttons active states */
  .dock-btn.btn-present.active {
    background-color: var(--success);
    border-color: var(--success);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  }
  
  .dock-btn.btn-sick.active {
    background-color: var(--info);
    border-color: var(--info);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  }
  
  .dock-btn.btn-leave.active {
    background-color: var(--warning);
    border-color: var(--warning);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  }
  
  .dock-btn.btn-absent.active {
    background-color: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  }
  
  .dock-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .dock-nav-btn {
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .dock-nav-btn:active {
    background-color: #cbd5e1;
  }
  
  .dock-student-index {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
  }

  /* Responsive Table styling inside check-in view */
  #attendance-check-table th:nth-child(4),
  #attendance-check-table td:nth-child(4) {
    display: none !important;
  }
  
  #attendance-check-table th:nth-child(3),
  #attendance-check-table td:nth-child(3) {
    width: 80px !important;
    text-align: center !important;
  }
}

/* ==========================================================================
   Live Grade Attendance Summary Horizontal Stacked Chart
   ========================================================================== */

/* Live status pill glow */
.live-status-pill {
  background-color: #ecfdf5;
  color: #059669;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
  animation: pulseLive 2s infinite;
}

.live-status-pill::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #059669;
  border-radius: 50%;
}

@keyframes pulseLive {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.2); }
  100% { transform: scale(1); }
}

.live-status-pill.history {
  background-color: #f1f5f9;
  color: #64748b;
  box-shadow: none;
  animation: none;
}
.live-status-pill.history::before {
  background-color: #64748b;
}

.grade-chart-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.grade-chart-grid-footer {
  display: flex;
  align-items: center;
  width: 100%;
  border-top: 1.5px solid #cbd5e1; /* Gray line above numbers */
  padding-top: 10px;
  margin-top: 5px;
}

.grid-footer-label {
  width: 160px;
  flex-shrink: 0;
}

.grid-footer-lines {
  flex: 1;
  position: relative;
  height: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
}

.grid-footer-lines span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

.grade-attendance-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  padding-top: 5px;
}

.grade-row {
  display: flex;
  align-items: center;
  width: 100%;
  transition: transform 0.2s ease-in-out;
}

.grade-row:hover {
  transform: scale(1.005) translateX(6px);
}

.grade-label {
  width: 160px;
  flex-shrink: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  text-align: right;
  padding-right: 18px;
}

.grade-bar-wrapper {
  flex: 1;
  height: 22px;
  background-color: transparent;
  border: none;
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
  position: relative;
}

.grade-bar-segment {
  height: 100%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  user-select: none;
}

/* Colors for segments matching the requested image layout */
.grade-bar-segment.present {
  background-color: #0d9488; /* Teal / Green */
}
.grade-bar-segment.late {
  background-color: #f97316; /* Orange */
}
.grade-bar-segment.sick {
  background-color: #eab308; /* Yellow */
}
.grade-bar-segment.leave {
  background-color: #3b82f6; /* Blue */
}
.grade-bar-segment.absent {
  background-color: #ef4444; /* Red */
}

/* Grid lines behind bars, relative to wrapper width */
.grade-attendance-bars::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 160px;
  right: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, #cbd5e1 1px, transparent 1px);
  background-size: 10% 100%; /* Draw 10 grid vertical lines representing 0.1 increments */
  opacity: 0.35;
  z-index: 0;
}

.grade-row * {
  z-index: 1;
}

.grade-chart-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
  flex-wrap: wrap;
  border-top: 1.5px solid var(--border-color);
  padding-top: 18px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.present { background-color: #0d9488; }
.legend-dot.late { background-color: #eab308; }
.legend-dot.sick { background-color: #f97316; }
.legend-dot.leave { background-color: #3b82f6; }
.legend-dot.absent { background-color: #ef4444; }

@media (max-width: 768px) {
  .grid-header-label,
  .grid-footer-label,
  .grade-label {
    width: 110px;
    font-size: 0.78rem;
    padding-right: 10px;
  }
  
  .grade-attendance-bars::before {
    left: 110px;
  }
}

/* ==========================================================================
   Offline Resilience Styling
   ========================================================================== */
.offline-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 6px 12px;
  background-color: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: #d97706;
  font-size: 0.8rem;
  font-weight: 600;
  animation: pulseOffline 2.5s infinite ease-in-out;
}

.offline-badge.hidden {
  display: none !important;
}

@keyframes pulseOffline {
  0% {
    opacity: 0.95;
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.2);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 0 6px rgba(217, 119, 6, 0);
  }
  100% {
    opacity: 0.95;
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0);
  }
}

@keyframes toast-spinner {
  to { transform: rotate(360deg); }
}

.toast-loader {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: toast-spinner 0.6s linear infinite;
  margin-right: 10px;
  flex-shrink: 0;
}

.offline-toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  color: #ffffff;
  padding: 14px 22px;
  border-radius: 14px;
  box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.25), 0 4px 8px -4px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  transform: translateY(150%) scale(0.9);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  border: none;
  opacity: 0;
  backdrop-filter: blur(10px);
}

.offline-toast-notification.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Color Status Types */
.offline-toast-notification.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 10px 20px -6px rgba(16, 185, 129, 0.4);
}

.offline-toast-notification.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 10px 20px -6px rgba(239, 68, 68, 0.4);
}

.offline-toast-notification.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 10px 20px -6px rgba(245, 158, 11, 0.4);
}

.offline-toast-notification.info,
.offline-toast-notification.loading {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 10px 20px -6px rgba(59, 130, 246, 0.4);
}

.offline-toast-notification svg {
  color: #ffffff;
  margin-right: 10px;
  flex-shrink: 0;
}


/* ==================== [TEACHER VIEW CUSTOM STYLES] ==================== */
.role-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.2px;
}
.role-badge.admin {
  background-color: var(--indigo-light);
  color: var(--indigo-dark);
}
.role-badge.teacher {
  background-color: var(--success-light);
  color: var(--success-dark);
}

.password-text {
  font-family: monospace;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

/* Vertical Chart Styles */
.vertical-chart-container {
  position: relative;
  height: 380px;
  margin: 30px 0 20px 0;
  display: flex;
  flex-direction: row;
}

.vertical-chart-y-axis {
  width: 45px;
  height: 320px;
  position: relative;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  border-right: 1.5px solid #cbd5e1;
}

.vertical-chart-y-axis span {
  position: absolute;
  right: 12px;
  transform: translateY(50%);
  white-space: nowrap;
}

.vertical-chart-plot-area {
  flex: 1;
  position: relative;
  height: 320px;
}

.vertical-chart-grid-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.vertical-chart-grid-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: #f1f5f9;
}

.vertical-chart-bars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: flex-end;
  padding: 0 10px;
  z-index: 2;
}

.vertical-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 10%;
  height: 100%;
  justify-content: flex-end;
}

.vertical-chart-bar-wrapper {
  width: 24px;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column-reverse;
  background-color: #f1f5f9;
  border-radius: 4px; /* Matches vertical column style */
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vertical-chart-bar-wrapper:hover {
  transform: scaleY(1.03);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.vertical-chart-bar-segment {
  width: 100%;
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

/* Specific segment background colors matching legend */
.vertical-chart-bar-segment.present { background-color: #0d9488; }
.vertical-chart-bar-segment.late { background-color: #f97316; }
.vertical-chart-bar-segment.leave { background-color: #3b82f6; }
.vertical-chart-bar-segment.sick { background-color: #eab308; }
.vertical-chart-bar-segment.absent { background-color: #ef4444; }

.vertical-chart-col-label {
  margin-top: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vertical-chart-legend {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 20px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.vertical-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.vertical-chart-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.vertical-chart-legend-dot.present { background-color: #0d9488; }
.vertical-chart-legend-dot.late { background-color: #f97316; }
.vertical-chart-legend-dot.leave { background-color: #3b82f6; }
.vertical-chart-legend-dot.sick { background-color: #eab308; }
.vertical-chart-legend-dot.absent { background-color: #ef4444; }

/* Helper/Utility classes */
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }

/* Print utility classes */
.print-only,
.print-only-flex {
  display: none !important;
}
@media print {
  .print-only {
    display: block !important;
  }
  .print-only-flex {
    display: flex !important;
  }
}

/* ==========================================================================
   Attendance Custom Themed Print/Screen Layout Styles
   ========================================================================== */
.attendance-themed-header {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.themed-logo-wrapper svg {
  display: block;
}

/* Custom Table Column Colors & Text Fit Tuning */
#attendance-summary-table th,
#attendance-summary-table td {
  border: 1px solid #000000 !important;
  color: #000000 !important;
  vertical-align: middle !important;
  text-align: center !important;
  padding: 3px 2px !important;
  font-size: 8.5pt !important;
  font-family: 'Sarabun', 'TH Sarabun New', sans-serif !important;
  white-space: nowrap !important;
}

#attendance-summary-table td:nth-child(2) {
  text-align: left !important;
  padding-left: 8px !important;
}

#attendance-summary-table th.no-col { background-color: #ffedd5 !important; }
#attendance-summary-table th.month-col { background-color: #fef3c7 !important; }
#attendance-summary-table th.sum-col { background-color: #c084fc !important; }
#attendance-summary-table th.present-col { background-color: #bbf7d0 !important; }
#attendance-summary-table th.sick-col { background-color: #fef08a !important; }
#attendance-summary-table th.leave-col { background-color: #fbcfe8 !important; }

#attendance-summary-table td.present-cell { background-color: #bbf7d0 !important; }
#attendance-summary-table td.sick-cell { background-color: #fef08a !important; }
#attendance-summary-table td.leave-cell { background-color: #fbcfe8 !important; }
#attendance-summary-table td.weekend-cell { background-color: #e2e8f0 !important; }

/* Dynamic scroll layout */
#view-attendance-summary .table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  margin-top: 10px;
}

@media print {
  /* Hide the top panel-header during printing as we have the themed header */
  #view-attendance-summary .panel-header.no-print {
    display: none !important;
  }
  
  #view-attendance-summary .table-responsive {
    border: none !important;
    overflow-x: visible !important;
  }
  
  #attendance-summary-table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  #attendance-summary-table th.no-col { background-color: #ffedd5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #attendance-summary-table th.month-col { background-color: #fef3c7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #attendance-summary-table th.sum-col { background-color: #c084fc !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #attendance-summary-table th.present-col { background-color: #bbf7d0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #attendance-summary-table th.sick-col { background-color: #fef08a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #attendance-summary-table th.leave-col { background-color: #fbcfe8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  #attendance-summary-table td.present-cell { background-color: #bbf7d0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #attendance-summary-table td.sick-cell { background-color: #fef08a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #attendance-summary-table td.leave-cell { background-color: #fbcfe8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #attendance-summary-table td.weekend-cell { background-color: #e2e8f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #attendance-summary-table th.holiday-cell { background-color: #fee2e2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #attendance-summary-table td.holiday-cell { background-color: #fee2e2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

#attendance-summary-table th.holiday-cell,
#attendance-summary-table td.holiday-cell {
  background-color: #fee2e2 !important;
  color: #b91c1c !important;
}

.holiday-vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: 0.65rem;
  font-weight: 800;
  color: #b91c1c;
  display: inline-block;
  letter-spacing: 1.5px;
  line-height: 1;
  text-align: center;
}

/* Split Layout for wider modals */
.modal-split-container {
  display: flex;
  gap: 24px;
  padding: 20px;
  flex-wrap: wrap;
}

.modal-split-left {
  flex: 1;
  min-width: 300px;
  border-right: 1px solid var(--border-color);
  padding-right: 24px;
}

.modal-split-right {
  flex: 1;
  min-width: 300px;
}

@media (max-width: 768px) {
  .modal-split-left {
    border-right: none !important;
    border-bottom: 1px solid var(--border-color);
    padding-right: 0 !important;
    padding-bottom: 20px;
    margin-bottom: 10px;
  }
}

/* Dashboard Large Attendance & Statistics Action Card */
.attendance-summary-action-card {
  cursor: pointer;
  margin-bottom: 25px;
  border-radius: 16px;
  padding: 24px 30px;
  background: linear-gradient(135deg, #4f46e5 0%, #0284c7 50%, #0d9488 100%);
  color: white;
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.35), 0 8px 10px -6px rgba(2, 132, 199, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.attendance-summary-action-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 35px -5px rgba(79, 70, 229, 0.45), 0 12px 18px -6px rgba(2, 132, 199, 0.45);
  border-color: rgba(255, 255, 255, 0.3);
}

.attendance-summary-action-card:hover .action-btn-circle {
  background-color: #f8fafc !important;
  transform: scale(1.1) translateX(3px);
  color: #0284c7 !important;
}

.attendance-summary-action-card:hover .card-icon-container {
  background: rgba(255, 255, 255, 0.3) !important;
  transform: scale(1.05);
}

@media (max-width: 600px) {
  .attendance-summary-action-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 16px;
  }
  .attendance-summary-action-card .action-btn-circle {
    align-self: flex-end;
  }
}