/* ==========================================================================
   SIJAGA Realtime Monitor — Premium Design System & Stylesheet
   SMAN 1 LADONGI — Glassmorphism, Modern Dark Mode, Ultra-Clean Responsive UI
   ========================================================================== */

/* 1. CSS Custom Properties & Design Tokens */
:root {
  --primary-blue: #0284c7;
  --primary-hover: #0369a1;
  --primary-glow: rgba(2, 132, 199, 0.35);

  --bg-dark: #0f172a;
  --bg-dark-card: #1e293b;
  --bg-dark-glass: rgba(30, 41, 59, 0.75);
  --border-dark: rgba(255, 255, 255, 0.1);

  --bg-light: #f8fafc;
  --bg-light-card: #ffffff;
  --bg-light-glass: rgba(255, 255, 255, 0.85);
  --border-light: #e2e8f0;

  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --text-muted: #64748b;

  --color-hadir: #10b981;
  --bg-hadir-glass: rgba(16, 185, 129, 0.15);
  --border-hadir: rgba(16, 185, 129, 0.4);

  --color-tugas: #f59e0b;
  --bg-tugas-glass: rgba(245, 158, 11, 0.15);
  --border-tugas: rgba(245, 158, 11, 0.4);

  --color-kosong: #ef4444;
  --bg-kosong-glass: rgba(239, 68, 68, 0.15);
  --border-kosong: rgba(239, 68, 68, 0.4);

  --font-heading: 'Poppins', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

/* Multi-Theme CSS Variables */
body[data-theme="dark"] {
  --bg-dark: #0f172a;
  --bg-dark-card: #1e293b;
  --bg-dark-glass: rgba(30, 41, 59, 0.75);
  --border-dark: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --text-muted: #64748b;
  --primary-blue: #0284c7;
}

body[data-theme="light"] {
  --bg-dark: #f1f5f9;
  --bg-dark-card: #ffffff;
  --bg-dark-glass: rgba(255, 255, 255, 0.9);
  --border-dark: #cbd5e1;
  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;
  --primary-blue: #2563eb;
}

body[data-theme="navy"] {
  --bg-dark: #0a1128;
  --bg-dark-card: #1c2541;
  --bg-dark-glass: rgba(28, 37, 65, 0.85);
  --border-dark: rgba(255, 255, 255, 0.15);
  --text-main: #ffffff;
  --text-sub: #94a3b8;
  --text-muted: #5c677d;
  --primary-blue: #3a86ff;
}

body[data-theme="emerald"] {
  --bg-dark: #042f2e;
  --bg-dark-card: #064e3b;
  --bg-dark-glass: rgba(6, 78, 59, 0.85);
  --border-dark: rgba(255, 255, 255, 0.15);
  --text-main: #f0fdf4;
  --text-sub: #a7f3d0;
  --text-muted: #6ee7b7;
  --primary-blue: #10b981;
}

/* Theme Dropdown Menu UI */
.theme-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 8px;
  width: 230px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  z-index: 10000;
  display: none;
  flex-direction: column;
  gap: 4px;
  animation: fadeIn 0.2s ease;
}

.dark-theme .theme-dropdown-menu,
body[data-theme="dark"] .theme-dropdown-menu,
body[data-theme="navy"] .theme-dropdown-menu,
body[data-theme="emerald"] .theme-dropdown-menu {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.15);
}

.theme-dropdown-menu.open {
  display: flex !important;
}

.theme-option-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-option-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.dark-theme .theme-option-item:hover,
body[data-theme="dark"] .theme-option-item:hover,
body[data-theme="navy"] .theme-option-item:hover,
body[data-theme="emerald"] .theme-option-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.theme-option-item.active {
  background: var(--primary-blue) !important;
  color: #ffffff !important;
}

.theme-preview-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Light Theme Variables */
body.light-theme {
  --bg-dark: #f1f5f9;
  --bg-dark-card: #ffffff;
  --bg-dark-glass: rgba(255, 255, 255, 0.9);
  --border-dark: #cbd5e1;
  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;
  --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

/* 2. Global Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Animated Glowing Green LED Dot for Ongoing Classes */
.live-pulse-dot {
  width: 10px;
  height: 10px;
  background-color: var(--color-hadir);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--color-hadir);
  animation: live-dot-pulse 1.2s infinite ease-in-out;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes live-dot-pulse {
  0% {
    transform: scale(0.85);
    box-shadow: 0 0 4px var(--color-hadir), 0 0 8px rgba(16, 185, 129, 0.4);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.4);
    box-shadow: 0 0 14px var(--color-hadir), 0 0 24px rgba(16, 185, 129, 0.9);
    opacity: 1;
  }
  100% {
    transform: scale(0.85);
    box-shadow: 0 0 4px var(--color-hadir), 0 0 8px rgba(16, 185, 129, 0.4);
    opacity: 0.7;
  }
}

.live-ongoing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-hadir-glass);
  border: 1px solid var(--border-hadir);
  color: var(--color-hadir);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
  animation: badge-glow 2s infinite alternate;
}

@keyframes badge-glow {
  from { border-color: rgba(16, 185, 129, 0.3); }
  to { border-color: rgba(16, 185, 129, 0.8); }
}

/* Ongoing Class Card Highlight */
.class-card.is-ongoing-card {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2), var(--shadow-soft);
  border-left: 3px solid var(--color-hadir);
}

/* Featured Live Carousel Showcase Styles — High Contrast & Ultra-Clear Legibility */
.live-showcase-container {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(16, 185, 129, 0.1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.showcase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 5px;
}

.showcase-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.showcase-title h3 {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #34d399;
  text-shadow: 0 0 12px rgba(52, 211, 153, 0.4);
}

.showcase-counter {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 4px 14px;
  border-radius: 20px;
}

.showcase-card-wrapper {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  gap: 12px;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}

.showcase-card-wrapper:active {
  cursor: grabbing;
}

.showcase-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  will-change: transform, opacity;
}

/* Nav Buttons for Manual Control */
.showcase-nav-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  flex-shrink: 0;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  user-select: none;
}

.showcase-nav-btn:hover {
  background: #10b981;
  border-color: #34d399;
  color: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.showcase-nav-btn:active {
  transform: scale(0.92);
}

body.light-theme .showcase-nav-btn {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
  color: #0f172a;
}

body.light-theme .showcase-nav-btn:hover {
  background: #10b981;
  border-color: #059669;
  color: #ffffff;
}

/* Ultra Smooth Slide Animations */
@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translate3d(40px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInLeft {
  0% {
    opacity: 0;
    transform: translate3d(-40px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.showcase-card-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.showcase-class-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  margin-bottom: 2px;
}

.showcase-subject {
  font-size: 1.25rem;
  font-weight: 700;
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.showcase-jp {
  color: #e2e8f0;
  font-size: 0.92rem;
  font-weight: 600;
  margin-left: 6px;
}

.showcase-teacher {
  font-size: 1.05rem;
  color: #f8fafc;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-showcase-container .live-ongoing-badge {
  background: rgba(16, 185, 129, 0.22);
  border: 1.5px solid #10b981;
  color: #34d399;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 5px 14px;
  border-radius: 20px;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}

/* Status Bar inside Showcase — High Contrast Colors */
.showcase-card .card-status-bar.status-belum {
  background: rgba(148, 163, 184, 0.22);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.showcase-card .card-status-bar.status-hadir {
  background: rgba(16, 185, 129, 0.28);
  border: 1.5px solid #10b981;
  color: #34d399;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
  font-size: 0.82rem;
}

.showcase-card .card-status-bar.status-tugas {
  background: rgba(245, 158, 11, 0.28);
  border: 1.5px solid #f59e0b;
  color: #fbbf24;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.showcase-card .card-status-bar.status-kosong {
  background: rgba(239, 68, 68, 0.28);
  border: 1.5px solid #ef4444;
  color: #f87171;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.showcase-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.showcase-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.showcase-progress-bar {
  height: 100%;
  width: 0%;
  background: #34d399;
  box-shadow: 0 0 12px #34d399;
  transition: width 0.1s linear;
}

.showcase-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: pointer;
}

.dot:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: scale(1.25);
}

.dot.active {
  background: #34d399;
  width: 24px;
  border-radius: 10px;
  box-shadow: 0 0 10px #34d399;
}

/* Light Theme Overrides for Live Showcase Component */
body.light-theme .live-showcase-container {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #10b981;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.15), 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.light-theme .showcase-header {
  border-bottom-color: #e2e8f0;
}

body.light-theme .showcase-title h3 {
  color: #047857;
  text-shadow: none;
}

body.light-theme .showcase-counter {
  color: #0f172a;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}

body.light-theme .showcase-class-title {
  color: #0f172a;
  text-shadow: none;
}

body.light-theme .showcase-subject {
  color: #0284c7;
  text-shadow: none;
}

body.light-theme .showcase-jp {
  color: #475569;
}

body.light-theme .showcase-teacher {
  color: #1e293b;
}

body.light-theme .live-showcase-container .live-ongoing-badge {
  background: #d1fae5;
  border-color: #10b981;
  color: #047857;
  box-shadow: none;
}

body.light-theme .showcase-card .card-status-bar.status-belum {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #334155;
}

body.light-theme .showcase-card .card-status-bar.status-hadir {
  background: #d1fae5;
  border-color: #10b981;
  color: #047857;
}

body.light-theme .showcase-card .card-status-bar.status-tugas {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

body.light-theme .showcase-card .card-status-bar.status-kosong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
}

body.light-theme .showcase-progress {
  background: #e2e8f0;
}

body.light-theme .showcase-progress-bar {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

body.light-theme .dot {
  background: #cbd5e1;
}

body.light-theme .dot.active {
  background: #059669;
  box-shadow: 0 0 8px rgba(5, 150, 105, 0.4);
}

/* ==========================================================================
   LEFT SIDEBAR LAYOUT SYSTEM (KONSEP 1)
   ========================================================================== */
body.app-layout-sidebar {
  display: flex !important;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.app-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-dark);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 16px;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
}

.light-theme .app-sidebar {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}

.dark-theme .app-sidebar {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.12);
}

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

.sidebar-header h1 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-blue);
  margin: 0;
  letter-spacing: 0.5px;
}

.sidebar-header p {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-sub);
  margin: 2px 0 0 0;
}

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

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
  padding: 4px 10px;
  margin-bottom: 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-sub);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.sidebar-nav-item:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--primary-blue);
}

.sidebar-nav-item.active {
  background: var(--primary-blue);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.sidebar-nav-item.active .nav-icon {
  transform: scale(1.1);
}

.sidebar-footer {
  border-top: 1px solid var(--border-dark);
  padding-top: 16px;
}

.main-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-dark);
}

.top-content-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-dark);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.light-theme .top-content-header {
  background: #ffffff;
}

.dark-theme .top-content-header {
  background: #1e293b;
}

.top-section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.mobile-sidebar-toggle {
  display: none;
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  color: var(--text-main);
  font-size: 1.2rem;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .mobile-sidebar-toggle {
    display: block;
  }
  .app-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    box-shadow: 10px 0 30px rgba(0,0,0,0.25);
  }
  .app-sidebar.open-mobile {
    left: 0;
  }
}

/* 3. Header Section */
.app-header {
  background: var(--bg-dark-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-dark);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.school-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.25);
  flex-shrink: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.app-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  transition: transform 0.25s ease;
}

.school-logo:hover .app-logo-img {
  transform: scale(1.08);
}

.school-title h1 {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-main);
  line-height: 1.2;
}

.school-title p {
  font-size: clamp(0.72rem, 1vw, 0.82rem);
  color: var(--text-sub);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Live Badge Header */
.status-badge.live {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-hadir-glass);
  border: 1px solid var(--border-hadir);
  color: var(--color-hadir);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-hadir);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-hadir);
  animation: pulse-glow 1.5s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.live-clock {
  text-align: right;
  white-space: nowrap;
}

.clock-time {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  font-weight: 700;
  color: var(--primary-blue);
  letter-spacing: 0.5px;
}

.clock-date {
  font-size: 0.75rem;
  color: var(--text-sub);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.btn-action {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-dark);
  background: var(--bg-dark-card);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 38px;
}

.btn-action:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  transform: translateY(-1px);
}

.btn-tv.active {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* 4. Main Content Layout */
.main-container {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 56px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Hero Stats Section */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card.total { border-left: 4px solid var(--primary-blue); }
.stat-card.hadir { border-left: 4px solid var(--color-hadir); }
.stat-card.tugas { border-left: 4px solid var(--color-tugas); }
.stat-card.kosong { border-left: 4px solid var(--color-kosong); }

/* Interactive Stat Cards Hover & Modal Popup */
.stat-card.clickable {
  cursor: pointer;
  position: relative;
}

.stat-card.clickable:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  border-color: var(--primary-blue);
}

.stat-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.stat-modal-overlay.open {
  display: flex !important;
}

.stat-modal-content {
  background: #ffffff;
  border-radius: 20px;
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: modalPop 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.dark-theme .stat-modal-content {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.12);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.stat-modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.02);
}

.stat-modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
  color: #0f172a;
}

.dark-theme .stat-modal-header h3 {
  color: #f8fafc;
}

.stat-modal-close {
  background: rgba(0, 0, 0, 0.06);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-modal-close:hover {
  background: #ef4444;
  color: #ffffff;
}

.stat-modal-body {
  padding: 16px 22px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 16px;
  gap: 14px;
}

.dark-theme .stat-modal-item {
  background: #0f172a;
  border-color: #334155;
}

.stat-modal-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-modal-item-teacher {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.dark-theme .stat-modal-item-teacher {
  color: #f8fafc;
}

.stat-modal-item-sub {
  font-size: 0.82rem;
  color: #475569;
  font-weight: 600;
}

.dark-theme .stat-modal-item-sub {
  color: #cbd5e1;
}

.stat-modal-item-time {
  font-size: 0.76rem;
  color: var(--text-sub);
  margin-top: 2px;
  font-weight: 600;
}

.stat-modal-verifier {
  font-size: 0.74rem;
  color: #059669;
  font-weight: 700;
  margin-top: 4px;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
  padding-top: 4px;
}

.dark-theme .stat-modal-verifier {
  color: #34d399;
  border-top-color: rgba(255, 255, 255, 0.1);
}

.stat-modal-unverified {
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 4px;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
  padding-top: 4px;
}

.dark-theme .stat-modal-unverified {
  color: #94a3b8;
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* Predikat Kinerja KPI Badges */
.pred-kpi-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.pred-sangat-baik {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #22c55e;
}

.dark-theme .pred-sangat-baik {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border-color: #22c55e;
}

.pred-baik {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #0284c7;
}

.dark-theme .pred-baik {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
  border-color: #0284c7;
}

.pred-cukup {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #f59e0b;
}

.dark-theme .pred-cukup {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: #f59e0b;
}

.pred-pembinaan {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #ef4444;
}

.dark-theme .pred-pembinaan {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: #ef4444;
}

.stat-icon {
  font-size: 1.45rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-label {
  font-size: 0.74rem;
  color: var(--text-sub);
  font-weight: 600;
  line-height: 1.2;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.15;
  margin: 1px 0;
}

.stat-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.2;
}

/* Leaderboard Top 3 Cards */
.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}

.leaderboard-card {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.leaderboard-card:hover {
  transform: translateY(-2px);
}

.leaderboard-card.rank-1 {
  border-color: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), var(--bg-dark-card));
}

.leaderboard-card.rank-2 {
  border-color: #94a3b8;
  box-shadow: 0 0 15px rgba(148, 163, 184, 0.15);
}

.leaderboard-card.rank-3 {
  border-color: #b45309;
  box-shadow: 0 0 15px rgba(180, 83, 9, 0.15);
}

.rank-badge {
  font-size: 2.2rem;
  line-height: 1;
}

.rank-info {
  display: flex;
  flex-direction: column;
}

.rank-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
}

.rank-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.rank-stat {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-hadir);
}

/* 5. Navigation Tabs */
.tab-navigation {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border-dark);
  padding-bottom: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-tab {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 42px;
}

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

.nav-tab.active {
  background: var(--primary-blue);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Tab Contents */
.tab-content {
  display: none;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 6. Filter Card */
.filter-card {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-soft);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
}

/* Custom Select Dropdown Styling */
.select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrapper::after {
  content: '▾';
  font-size: 0.85rem;
  color: var(--primary-blue);
  position: absolute;
  right: 12px;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.select-wrapper select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  padding: 8px 32px 8px 12px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  min-height: 36px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.light-theme .select-wrapper select {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #1e293b;
}

.dark-theme .select-wrapper select {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.15);
  color: #f8fafc;
}

.select-wrapper select:hover {
  border-color: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.select-wrapper select:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.select-wrapper select option {
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  background: #ffffff;
  color: #1e293b;
}

.dark-theme .select-wrapper select option {
  background: #1e293b;
  color: #f8fafc;
}

/* ==========================================================================
   CUSTOM SEARCHABLE COMBOBOX COMPONENT
   ========================================================================== */
.combobox-wrapper {
  position: relative;
  display: inline-block;
  max-width: 320px;
}

.combobox-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  padding: 6px 12px;
  cursor: text;
  transition: all 0.2s ease;
  min-height: 38px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.light-theme .combobox-input-wrapper {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
}

.dark-theme .combobox-input-wrapper {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.15);
}

.combobox-wrapper.open .combobox-input-wrapper,
.combobox-input-wrapper:focus-within {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.combobox-icon {
  font-size: 1rem;
}

.combobox-input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  width: 100%;
}

.light-theme .combobox-input-wrapper input {
  color: #1e293b;
}

.dark-theme .combobox-input-wrapper input {
  color: #f8fafc;
}

.combobox-arrow {
  font-size: 0.75rem;
  color: var(--primary-blue);
  transition: transform 0.2s ease;
}

.combobox-wrapper.open .combobox-arrow {
  transform: rotate(180deg);
}

.combobox-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  font-weight: bold;
  padding: 0 4px;
}

/* Combobox Suggestions Popup */
.combobox-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 420px;
  z-index: 999999 !important;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
}

.dark-theme .combobox-suggestions {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
}

.combobox-wrapper.open .combobox-suggestions,
.custom-combobox.open .combobox-suggestions {
  display: block !important;
}

.suggestion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
  gap: 12px;
  white-space: nowrap;
}

.dark-theme .suggestion-item {
  color: #f8fafc;
}

.suggestion-item:hover,
.suggestion-item.selected {
  background: #0284c7 !important;
  color: #ffffff !important;
}

.suggestion-item:hover span,
.suggestion-item.selected span {
  color: #ffffff !important;
}

.teacher-session-count {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.12);
  color: #0284c7;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.dark-theme .teacher-session-count {
  background: rgba(59, 130, 246, 0.25);
  color: #38bdf8;
}

.suggestion-item:hover .teacher-session-count,
.suggestion-item.selected .teacher-session-count {
  background: #ffffff !important;
  color: #0284c7 !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.chip-container {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ==========================================================================
   HIGH-CONTRAST COMPACT LIVE SHOWCASE CAROUSEL
   ========================================================================== */
.live-showcase-container {
  background: var(--bg-card);
  border: 1px solid var(--border-dark);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: var(--shadow-soft);
  max-width: 820px;
  width: 100%;
  margin: 0 auto 10px auto;
}

.light-theme .live-showcase-container {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.dark-theme .live-showcase-container {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.showcase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-dark);
  padding-bottom: 5px;
}

.showcase-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.showcase-title h3 {
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 800;
  color: #047857; /* High contrast solid green */
  letter-spacing: 0.3px;
  margin: 0;
}

.dark-theme .showcase-title h3 {
  color: #34d399;
}

.showcase-counter {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1e293b;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 2px 10px;
  border-radius: 16px;
}

.dark-theme .showcase-counter {
  color: #f8fafc;
  background: #334155;
  border-color: #475569;
}

.showcase-card-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0;
}

.showcase-nav-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
  flex-shrink: 0;
  z-index: 10;
}

.dark-theme .showcase-nav-btn {
  background: #334155;
  border-color: #475569;
  color: #f8fafc;
}

.showcase-nav-btn:hover {
  background: var(--primary-blue);
  color: #ffffff;
  border-color: var(--primary-blue);
  transform: scale(1.08);
}

.showcase-card {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 8px 14px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
  transition: all 0.2s ease;
}

.dark-theme .showcase-card {
  background: #0f172a;
  border-color: #334155;
}

.showcase-card-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.showcase-class-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 2px;
}

.dark-theme .showcase-class-title {
  color: #f8fafc;
}

.showcase-subject {
  font-size: 0.84rem;
  font-weight: 700;
  color: #1d4ed8; /* High contrast royal blue */
  margin-bottom: 2px;
}

.dark-theme .showcase-subject {
  color: #38bdf8;
}

.showcase-jp {
  font-size: 0.76rem;
  color: #475569;
  font-weight: 600;
}

.dark-theme .showcase-jp {
  color: #94a3b8;
}

.showcase-teacher {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}

.dark-theme .showcase-teacher {
  color: #cbd5e1;
}

.showcase-footer {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.showcase-progress {
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.dark-theme .showcase-progress {
  background: #334155;
}

.showcase-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  width: 0%;
  border-radius: 4px;
}

.showcase-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.filter-card {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  padding: 8px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 20px;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
  transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1), transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), max-height 0.35s cubic-bezier(0.25, 1, 0.5, 1), margin 0.35s ease, padding 0.35s ease;
}

/* Fullscreen & TV Mode Clean Display Rules */
body.is-fullscreen:not(.is-tv-mode) .filter-card,
body.is-fullscreen:not(.is-tv-mode) .class-grid {
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  overflow: hidden;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  transform: translateY(-16px);
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1), margin 0.4s ease, padding 0.4s ease;
  pointer-events: none;
}

body.is-fullscreen:not(.is-tv-mode).filter-card-scrolled .filter-card {
  opacity: 1;
  visibility: visible;
  max-height: 300px;
  margin-bottom: 12px;
  padding: 8px 14px;
  border-width: 1px;
  transform: translateY(0);
  pointer-events: auto;
}

body.is-fullscreen:not(.is-tv-mode).filter-card-scrolled .class-grid {
  opacity: 1;
  visibility: visible;
  max-height: 5000px;
  margin-bottom: 16px;
  transform: translateY(0);
  pointer-events: auto;
}

/* TV Mode Display: Always Fully Expanded & Visible */
body.is-tv-mode .filter-card,
body.is-tv-mode .class-grid {
  opacity: 1 !important;
  visibility: visible !important;
  max-height: 10000px !important;
  overflow: visible !important;
  transform: none !important;
  pointer-events: auto !important;
}

/* Floating Hint Button in Fullscreen Mode */
.fullscreen-scroll-hint {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 10px auto 14px auto;
  padding: 6px 16px;
  background: var(--primary-blue);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  animation: bounceHint 1.8s infinite;
  width: fit-content;
  user-select: none;
  transition: all 0.2s ease;
}

.fullscreen-scroll-hint:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.5);
}

body.is-fullscreen:not(.filter-card-scrolled) .fullscreen-scroll-hint,
body.is-tv-mode:not(.filter-card-scrolled) .fullscreen-scroll-hint {
  display: flex !important;
}

@keyframes bounceHint {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

@media (max-width: 1024px) {
  .filter-card {
    display: flex;
    flex-wrap: wrap;
  }
  .filter-label {
    min-width: auto !important;
    text-align: left !important;
  }
}

.light-theme .filter-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-family: var(--font-heading);
  font-size: 0.73rem;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  min-width: 112px;
  text-align: right;
  flex-shrink: 0;
}

.light-theme .filter-label {
  color: #475569;
}

.chip-container {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.chip {
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 7px;
  border: 1px solid var(--border-dark);
  background: var(--bg-dark);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.light-theme .chip {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

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

.chip.active {
  background: var(--primary-blue);
  color: #ffffff !important;
  border-color: var(--primary-blue);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* 7. Realtime Class Cards Grid */
.class-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.class-card {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.class-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.class-card.status-hadir { border-top: 3px solid var(--color-hadir); }
.class-card.status-tugas { border-top: 3px solid var(--color-tugas); }
.class-card.status-kosong { border-top: 3px solid var(--color-kosong); }
.class-card.status-belum { border-top: 3px solid var(--text-muted); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.class-badge {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-dark);
  white-space: nowrap !important;
  flex-shrink: 0;
}

.dark-theme .class-badge {
  background: rgba(255, 255, 255, 0.08);
}

.time-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap !important;
  flex-shrink: 0;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0;
}

.subject-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teacher-name {
  font-size: 0.8rem;
  color: var(--primary-blue);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-status-bar {
  margin-top: 2px;
  padding: 5px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 700;
}

.card-status-bar.status-hadir {
  background: var(--bg-hadir-glass);
  color: var(--color-hadir);
  border: 1px solid var(--border-hadir);
}

.card-status-bar.status-tugas {
  background: var(--bg-tugas-glass);
  color: var(--color-tugas);
  border: 1px solid var(--border-tugas);
}

.card-status-bar.status-kosong {
  background: var(--bg-kosong-glass);
  color: var(--color-kosong);
  border: 1px solid var(--border-kosong);
}

.card-status-bar.status-belum {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-sub);
  border: 1px solid var(--border-dark);
}

.dark-theme .card-status-bar.status-belum {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.card-footer {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--border-dark);
  padding-top: 6px;
  margin-top: 2px;
}

.notes-text {
  font-style: italic;
  color: var(--text-sub);
  background: rgba(0,0,0,0.05);
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 0.7rem;
  margin-top: 2px;
}

/* Loading & Empty State */
.loading-state, .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  color: var(--text-sub);
  font-size: 0.9rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 8. Schedule Search Tab & Compact Combobox */
.schedule-search-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.compact-search-row {
  width: 100%;
  max-width: 480px;
}

.custom-combobox {
  position: relative;
  width: 100%;
}

.combobox-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  gap: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.combobox-input-wrapper:focus-within {
  border-color: var(--primary-blue);
  box-shadow: 0 0 12px var(--primary-glow);
}

.combobox-icon {
  font-size: 1rem;
}

.combobox-input-wrapper input {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-main);
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
}

.combobox-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  transition: background 0.2s ease, color 0.2s ease;
}

.combobox-clear-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.combobox-arrow {
  font-size: 0.65rem;
  color: var(--text-sub);
  pointer-events: none;
  transition: transform 0.2s ease;
}

.custom-combobox.open .combobox-arrow {
  transform: rotate(180deg);
}

/* Suggestions Popup Menu Animation */
.custom-combobox.open .combobox-suggestions,
.combobox-wrapper.open .combobox-suggestions {
  display: block !important;
  animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.suggestion-item {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover, .suggestion-item.selected {
  background: var(--primary-blue);
  color: #ffffff;
}

.suggestion-item .teacher-session-count {
  font-size: 0.72rem;
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

.schedule-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.teacher-schedule-card {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.teacher-title h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-blue);
}

.teacher-title p {
  font-size: 0.78rem;
  color: var(--text-sub);
}

.btn-print {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-print:hover { opacity: 0.9; }

.timetable-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.time-slot-item {
  background: var(--bg-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.time-slot-item.is-ongoing-slot {
  border-color: var(--color-hadir);
  background: var(--bg-hadir-glass);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

/* Hide Print Header & Signature Footer on Screen Display */
.print-official-header,
.print-signature-footer,
.print-table-container {
  display: none;
}

/* 9. Ticker Footer — Ultra-High Contrast & Crisp Legibility */
.app-footer {
  background: linear-gradient(90deg, #0f172a, #1e293b);
  border-top: 2px solid var(--primary-blue);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  bottom: 0;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.ticker-label {
  background: linear-gradient(135deg, var(--primary-blue), #0369a1);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  box-shadow: 0 0 12px var(--primary-glow);
}

.ticker-content {
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
}

.ticker-scroll {
  display: inline-block;
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.3px;
  animation: ticker 35s linear infinite;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

@keyframes ticker {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Clean Official Print Signature Underlines */
.sig-name-clean {
  font-weight: bold;
  border-bottom: 1.5px solid #000000;
  display: inline-block;
  padding-bottom: 2px;
  color: #000000 !important;
}

.sig-line {
  border-bottom: 1.5px solid #000000;
  width: 80%;
  margin: 0 auto;
}

/* ==========================================================================
   10. PRINT STYLESHEET (@media print) — Official Tabular Format (Fits Exactly 1 Page)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 15mm;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: 'Inter', Arial, sans-serif !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Completely hide all non-printable elements */
  .app-header,
  .hero-stats,
  .tab-navigation,
  .filter-card,
  .app-footer,
  .btn-print,
  .btn-action,
  .header-actions,
  .live-showcase-container,
  .timetable-list,
  .day-schedule-section,
  .leaderboard-grid {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    visibility: hidden !important;
  }

  .tab-content:not(.active),
  #tabRealtime {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.print-single-teacher #tabSchedule {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .main-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }

  body.print-single-teacher .teacher-schedule-card:not(.target-print-card) {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .print-official-header {
    display: block !important;
    text-align: center;
    border-bottom: 2px solid #000000;
    padding-bottom: 6px;
    margin-bottom: 12px;
  }

  .print-official-header h2 {
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #000000 !important;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .print-official-header p {
    font-size: 0.9rem;
    font-weight: 700;
    color: #000000 !important;
    margin: 4px 0 0 0;
  }

  .teacher-schedule-card.target-print-card {
    display: block !important;
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    page-break-inside: avoid;
  }

  .teacher-header {
    display: none !important;
  }

  .print-table-container {
    display: block !important;
    margin-top: 10px;
  }

  .print-teacher-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    margin-bottom: 10px;
    border-bottom: 1px solid #666;
    padding-bottom: 6px;
    color: #000000 !important;
  }

  .official-print-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 0.85rem !important;
    margin-bottom: 20px !important;
  }

  .official-print-table th,
  .official-print-table td {
    border: 1px solid #000000 !important;
    padding: 6px 10px !important;
    color: #000000 !important;
  }

  .official-print-table th {
    background-color: #f0f0f0 !important;
    font-weight: bold !important;
    text-align: center !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-signature-footer {
    display: flex !important;
    justify-content: space-between;
    margin-top: 25px;
    padding-top: 10px;
    page-break-inside: avoid;
  }

  .sig-box {
    text-align: center;
    width: 220px;
    font-size: 0.85rem;
    color: #000000 !important;
  }

  .sig-space {
    height: 45px;
  }
}

/* ==========================================================================
   11. ULTRA-RESPONSIVE SYSTEM (HP, TABLET, PAPAN INTERAKTIF DIGITAL & TV 4K)
   ========================================================================== */

/* A. Giant Interactive Digital Whiteboard & Smart TV (>= 1400px & 4K IFP Panels) */
@media (min-width: 1400px) {
  .main-container {
    max-width: 1800px;
    padding: 30px;
  }
  .hero-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  .stat-card {
    padding: 22px 24px;
  }
  .stat-value {
    font-size: 2.2rem;
  }
  .class-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 22px;
  }
  .class-card {
    padding: 20px 22px;
  }
  .subject-title {
    font-size: 1.15rem;
  }
}

@media (min-width: 1920px) {
  /* 4K IFP Interactive Board (ViewSonic / Samsung Flip / Smart TV 55-85") */
  .main-container {
    max-width: 2400px;
    padding: 36px 48px;
    gap: 32px;
  }
  .school-logo {
    width: 58px;
    height: 58px;
  }
  .logo-icon {
    font-size: 30px;
  }
  .school-title h1 {
    font-size: 1.6rem;
  }
  .school-title p {
    font-size: 0.95rem;
  }
  .clock-time {
    font-size: 1.5rem;
  }
  .clock-date {
    font-size: 0.9rem;
  }
  .btn-action {
    padding: 10px 18px;
    font-size: 0.9rem;
    min-height: 44px;
  }
  .hero-stats {
    gap: 24px;
  }
  .stat-card {
    padding: 24px 28px;
    border-radius: 18px;
  }
  .stat-icon {
    font-size: 2.6rem;
  }
  .stat-value {
    font-size: 2.5rem;
  }
  .stat-label {
    font-size: 0.9rem;
  }
  .nav-tab {
    font-size: 1.05rem;
    padding: 14px 28px;
  }
  .chip {
    font-size: 0.9rem;
    padding: 10px 20px;
    min-height: 42px;
  }
  .class-grid {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 26px;
  }
  .class-card {
    padding: 24px;
    border-radius: 18px;
  }
  .class-badge {
    font-size: 1.1rem;
    padding: 6px 14px;
  }
  .subject-title {
    font-size: 1.3rem;
  }
  .teacher-name {
    font-size: 1rem;
  }
  .card-status-bar {
    font-size: 0.95rem;
    padding: 12px 16px;
  }
  .card-footer {
    font-size: 0.85rem;
  }
}

/* B. Tablet Landscape & Medium Displays (769px - 1280px) */
@media (max-width: 1024px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .class-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

/* C. Mobile Phone (HP) Responsive Layout (<= 768px & <= 480px) */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 16px;
  }

  .header-left {
    justify-content: flex-start;
  }

  .school-title h1 {
    font-size: 1.05rem;
  }

  .header-right {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .btn-action {
    padding: 8px 4px;
    font-size: 0.72rem;
    text-align: center;
    white-space: nowrap;
    justify-content: center;
  }

  .main-container {
    padding: 14px;
    gap: 16px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 12px 14px;
    gap: 10px;
  }

  .stat-icon {
    font-size: 1.5rem;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .stat-label {
    font-size: 0.72rem;
  }

  .tab-navigation {
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tab {
    font-size: 0.8rem;
    padding: 8px 14px;
  }

  .filter-card {
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .filter-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .chip-container {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .class-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .compact-search-row {
    max-width: 100%;
    width: 100%;
  }

  .filter-card,
  .filter-group,
  .compact-search-row,
  .schedule-search-card {
    overflow: visible !important;
  }

  .custom-combobox,
  .combobox-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
  }

  .combobox-suggestions {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    max-height: 260px !important;
    z-index: 999999 !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .suggestion-item {
    padding: 12px 14px !important;
    font-size: 0.88rem !important;
  }
}

@media (max-width: 480px) {
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .school-logo {
    width: 40px;
    height: 40px;
  }

  .logo-icon {
    font-size: 20px;
  }

  .live-clock {
    text-align: left;
  }

  .clock-time {
    font-size: 0.95rem;
  }
}

/* Live Countdown Pill Styles */
.countdown-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.countdown-pill.ongoing {
  color: var(--color-hadir);
  background: var(--bg-hadir-glass);
  border: 1px solid var(--border-hadir);
}

.countdown-pill.upcoming {
  color: var(--color-tugas);
  background: var(--bg-tugas-glass);
  border: 1px solid var(--border-tugas);
}

.sync-status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Live Showcase Carousel Premium Styles */
.live-showcase-container {
  background: var(--bg-card);
  border: 1px solid var(--border-dark);
  border-radius: 20px;
  padding: 18px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.light-theme .live-showcase-container {
  background: #ffffff;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.08);
}

.showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-dark);
}

.showcase-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.showcase-title h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.showcase-counter {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary-blue);
  background: var(--bg-tugas-glass);
  border: 1px solid var(--border-tugas);
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

.showcase-card-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 90px;
}

.showcase-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-dark);
  color: var(--text-main);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.showcase-nav-btn:hover {
  background: var(--primary-blue);
  color: #ffffff;
  border-color: var(--primary-blue);
  transform: scale(1.08);
}

.showcase-card {
  flex: 1;
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 16px 22px;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.dark-theme .showcase-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

.showcase-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Format 1: Structured Row Layout Showcase Card */
.showcase-card-layout-v2 {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.showcase-card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 10px;
}

.dark-theme .showcase-card-header-bar {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.showcase-time-badge-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.showcase-class-title-v2 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
  line-height: 1.2;
  margin: 2px 0;
}

.dark-theme .showcase-class-title-v2 {
  color: #f8fafc;
}

.showcase-meta-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

.showcase-subject-v2 {
  font-weight: 700;
  color: #1d4ed8;
  background: rgba(29, 78, 216, 0.08);
  border: 1px solid rgba(29, 78, 216, 0.2);
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dark-theme .showcase-subject-v2 {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.showcase-jp-v2 {
  color: #475569;
  font-weight: 700;
}

.dark-theme .showcase-jp-v2 {
  color: #cbd5e1;
}

.showcase-meta-divider {
  color: #cbd5e1;
  font-weight: 900;
}

.dark-theme .showcase-meta-divider {
  color: rgba(255, 255, 255, 0.2);
}
  color: #475569;
}

.showcase-teacher-v2 {
  font-weight: 700;
  color: #334155;
}

.dark-theme .showcase-teacher-v2 {
  color: #e2e8f0;
}

.showcase-class-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}

.showcase-subject {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-blue);
  margin-bottom: 2px;
}

.showcase-jp {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-sub);
}

.showcase-teacher {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-sub);
}

.showcase-footer {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.showcase-progress {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.showcase-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  width: 0%;
  border-radius: 4px;
}

.showcase-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.showcase-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
}

.showcase-dots .dot.active {
  width: 22px;
  background: var(--primary-blue);
}

/* ==========================================================================
   LIVE REALTIME TOAST NOTIFICATION SYSTEM
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-card {
  pointer-events: auto;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-left: 5px solid var(--primary-blue);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  animation: toastSlideIn 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  transition: all 0.3s ease;
}

.dark-theme .toast-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-card.status-hadir { border-left-color: #10b981; }
.toast-card.status-tugas { border-left-color: #f59e0b; }
.toast-card.status-kosong { border-left-color: #ef4444; }

.toast-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}

.light-theme .toast-title { color: #0f172a; }
.dark-theme .toast-title { color: #f8fafc; }

.toast-sub {
  font-size: 0.78rem;
  color: var(--text-sub);
  font-weight: 600;
}

.light-theme .toast-sub { color: #475569; }
.dark-theme .toast-sub { color: #cbd5e1; }

.toast-inspector {
  font-size: 0.73rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 3px;
  border-top: 1px dashed rgba(0,0,0,0.08);
  padding-top: 3px;
}

.dark-theme .toast-inspector {
  color: #94a3b8;
  border-top-color: rgba(255,255,255,0.1);
}

/* ==========================================================================
   OFFLINE DISCONNECTION ALERT BANNER & SYSTEM
   ========================================================================== */
.status-badge.offline {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: #f59e0b !important;
}

.status-badge.offline .pulse-dot {
  background-color: #ef4444 !important;
  box-shadow: 0 0 10px #ef4444 !important;
  animation: pulse-offline 1s infinite alternate !important;
}

@keyframes pulse-offline {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

.offline-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  opacity: 0;
  visibility: hidden;
  background: rgba(185, 28, 28, 0.94);
  backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 99999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease;
  pointer-events: none;
}

.offline-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.offline-banner.reconnected {
  background: rgba(16, 185, 129, 0.94) !important;
}

.offline-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.offline-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: offlineSpin 0.8s linear infinite;
}

@keyframes offlineSpin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   SLEEK COMPACT ANNOUNCEMENT TICKER FOOTER
   ========================================================================== */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38px;
  background: #0f172a;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 999;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
}

.light-theme .app-footer {
  background: #ffffff;
  border-top-color: #cbd5e1;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
}

.ticker-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.ticker-content {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-scroll {
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 500;
  color: #f1f5f9;
  letter-spacing: 0.25px;
  display: inline-block;
  padding-left: 100%;
  animation: tickerSlide 35s linear infinite;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-shadow: none !important;
}

.light-theme .ticker-scroll {
  color: #0f172a;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
  text-shadow: none !important;
}

@keyframes tickerSlide {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* ==========================================================================
   VIEW MODE TOGGLE & EXECUTIVE MONITOR DATA TABLE
   ========================================================================== */
.view-mode-group {
  margin-left: auto;
}

.view-mode-toggle {
  display: inline-flex;
  background: var(--bg-dark);
  border: 1px solid var(--border-dark);
  padding: 2px;
  border-radius: 8px;
  gap: 3px;
}

.light-theme .view-mode-toggle {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.view-mode-btn {
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.light-theme .view-mode-btn {
  color: #475569;
}

.view-mode-btn:hover {
  color: var(--text-main);
}

.view-mode-btn.active {
  background: var(--primary-blue);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.view-mode-btn.show-all-toggle.active {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25) !important;
}

/* Executive Data Table Styles */
.class-grid.table-mode-active {
  display: block !important;
}

.executive-table-wrapper {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  border-radius: 14px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.light-theme .executive-table-wrapper {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
}

.exec-monitor-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.exec-monitor-table th {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-sub);
  background: rgba(0, 0, 0, 0.03);
  padding: 12px 14px;
  border-bottom: 2px solid var(--border-dark);
  white-space: nowrap;
}

.light-theme .exec-monitor-table th {
  background: #f8fafc;
  color: #475569;
  border-bottom-color: #cbd5e1;
}

.dark-theme .exec-monitor-table th {
  background: #0f172a;
  color: #94a3b8;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.exec-monitor-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-dark);
  vertical-align: middle !important;
  line-height: 1.4;
  white-space: nowrap;
}

.light-theme .exec-monitor-table td {
  border-bottom-color: #f1f5f9;
}

.exec-monitor-table tbody tr {
  transition: background-color 0.15s ease;
}

.exec-monitor-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}

.exec-monitor-table tbody tr.exec-ongoing-row {
  background: rgba(16, 185, 129, 0.05);
}

.exec-class-name {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-dark);
  display: inline-block;
  white-space: nowrap !important;
}

.light-theme .exec-class-name {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.exec-time-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

.exec-time-text {
  font-weight: 600;
  color: var(--text-sub);
  font-size: 0.8rem;
  white-space: nowrap !important;
}

.exec-jp-pill {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-blue);
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap !important;
}

.exec-ongoing-tag {
  font-size: 0.65rem;
  font-weight: 800;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #22c55e;
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap !important;
}

.exec-subject-name {
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.88rem;
  white-space: nowrap !important;
}

.exec-teacher-name {
  font-weight: 600;
  color: var(--primary-blue);
  font-size: 0.84rem;
  white-space: nowrap !important;
}

.exec-badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  white-space: nowrap !important;
}

.exec-badge.status-hadir {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #22c55e;
}

.exec-badge.status-tugas {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #f97316;
}

.exec-badge.status-kosong {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #ef4444;
}

.exec-badge.status-belum {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.dark-theme .exec-badge.status-belum {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.15);
}

.exec-inspector-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(29, 78, 216, 0.08);
  border: 1px solid rgba(29, 78, 216, 0.2);
  padding: 3px 10px 4px 10px;
  border-radius: 10px;
  line-height: 1.25;
  transition: all 0.2s ease;
}

.exec-inspector-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1d4ed8;
  white-space: nowrap !important;
}

.dark-theme .exec-inspector-name {
  color: #60a5fa;
}

.exec-inspector-sub {
  font-size: 0.58rem;
  font-weight: 700;
  color: #2563eb;
  opacity: 0.8;
  letter-spacing: 0.2px;
  margin-top: 1px;
}

.dark-theme .exec-inspector-sub {
  color: #93c5fd;
}

.exec-unverified-pill {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap !important;
  display: inline-block;
}

.inspector-name-tag {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  font-size: 0.74rem;
}

/* Executive Table Pagination Bar */
.exec-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--border-dark);
  background: rgba(0, 0, 0, 0.02);
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
}

.light-theme .exec-pagination-bar {
  background: #f8fafc;
  border-top-color: #cbd5e1;
}

.dark-theme .exec-pagination-bar {
  background: #0f172a;
  border-top-color: rgba(255, 255, 255, 0.12);
}

.exec-pagination-info {
  color: var(--text-sub);
  font-weight: 500;
}

.exec-pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exec-page-btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-dark);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.light-theme .exec-page-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

.exec-page-btn:hover:not(:disabled) {
  background: var(--primary-blue);
  color: #ffffff !important;
  border-color: var(--primary-blue);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.exec-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.exec-page-indicator {
  font-size: 0.78rem;
  color: var(--text-sub);
  padding: 0 4px;
}

/* Grid Cards 4-Item Wrapper & Touch Swipe System */
.grid-cards-wrapper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
  will-change: transform;
}

/* Full-Screen Crossing Slide Animations (Slide Exit & Slide Enter) */
@keyframes slideExitLeft {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  100% {
    opacity: 0.1;
    transform: translate3d(-100vw, 0, 0);
  }
}

@keyframes slideEnterRight {
  0% {
    opacity: 0.1;
    transform: translate3d(100vw, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideExitRight {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  100% {
    opacity: 0.1;
    transform: translate3d(100vw, 0, 0);
  }
}

@keyframes slideEnterLeft {
  0% {
    opacity: 0.1;
    transform: translate3d(-100vw, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.grid-cards-wrapper.anim-exit-left {
  animation: slideExitLeft 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

.grid-cards-wrapper.anim-enter-right {
  animation: slideEnterRight 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.grid-cards-wrapper.anim-exit-right {
  animation: slideExitRight 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

.grid-cards-wrapper.anim-enter-left {
  animation: slideEnterLeft 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.grid-cards-wrapper.anim-enter-right .class-card,
.grid-cards-wrapper.anim-enter-left .class-card {
  animation: none !important;
}

@media (max-width: 1100px) {
  .grid-cards-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid-cards-wrapper {
    grid-template-columns: 1fr;
  }
}

/* Grid Cards Pagination Bar */
.grid-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border: 1px solid var(--border-dark);
  border-radius: 14px;
  background: var(--bg-dark-card);
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.light-theme .grid-pagination-bar {
  background: #ffffff;
  border-color: #cbd5e1;
}

.dark-theme .grid-pagination-bar {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.12);
}

.grid-pagination-info {
  font-size: 0.8rem;
  color: var(--text-sub);
  font-weight: 500;
}

.grid-pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.grid-page-btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-dark);
  background: var(--bg-dark);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.light-theme .grid-page-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.grid-page-btn:hover:not(:disabled) {
  background: var(--primary-blue);
  color: #ffffff !important;
  border-color: var(--primary-blue);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.grid-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.grid-page-indicator {
  font-size: 0.78rem;
  color: var(--text-sub);
  padding: 0 4px;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM (iOS & ANDROID OPTIMIZED)
   ========================================================================== */

/* Tablet & Medium Screens (<= 1024px) */
@media (max-width: 1024px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .grid-cards-wrapper {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .filter-card {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px 14px !important;
  }

  .filter-label {
    min-width: auto !important;
    text-align: left !important;
  }
}

/* Smartphone Screens (<= 768px) */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 10px 14px !important;
  }

  .header-left {
    width: 100% !important;
    justify-content: flex-start !important;
  }

  .school-title h1 {
    font-size: 1.05rem !important;
  }

  .school-title p {
    font-size: 0.7rem !important;
  }

  .header-right {
    width: 100% !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .live-clock {
    text-align: left !important;
  }

  .header-actions {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .btn-action {
    padding: 4px 10px !important;
    font-size: 0.72rem !important;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .stat-card {
    padding: 8px 10px !important;
  }

  .stat-value {
    font-size: 1.2rem !important;
  }

  .tab-navigation {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 6px !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 6px !important;
  }

  .nav-tab {
    white-space: nowrap !important;
    font-size: 0.74rem !important;
    padding: 6px 12px !important;
    flex-shrink: 0 !important;
  }

  .live-showcase-container {
    padding: 8px 10px !important;
    border-radius: 12px !important;
  }

  .showcase-card-main {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }

  .showcase-class-title {
    font-size: 0.98rem !important;
  }

  .showcase-subject {
    font-size: 0.8rem !important;
  }

  .filter-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 8px 10px !important;
  }

  .filter-group {
    width: 100% !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }

  .chip-container {
    width: 100% !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 4px !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 4px !important;
  }

  .chip {
    flex-shrink: 0 !important;
  }

  .view-mode-toggle {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .view-mode-btn {
    flex: 1 !important;
    text-align: center !important;
    padding: 4px 6px !important;
    font-size: 0.7rem !important;
  }

  .grid-cards-wrapper {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .executive-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
  }

  .exec-monitor-table {
    min-width: 750px !important;
  }

  .stat-modal-content {
    width: 95% !important;
    max-height: 90vh !important;
    padding: 12px !important;
  }

  .toast-container {
    bottom: 10px !important;
    right: 10px !important;
    left: 10px !important;
    max-width: calc(100% - 20px) !important;
  }
}

/* Extra Small Phones (<= 480px) */
@media (max-width: 480px) {
  .hero-stats {
    grid-template-columns: 1fr !important;
  }

  .school-title h1 {
    font-size: 0.95rem !important;
  }
}

/* ==========================================================================
   OFFICIAL A4 PRINT STYLESHEET (TABEL 8 KOLOM LANDSCAPE)
   ========================================================================== */
@media print {
  @page {
    size: A4 landscape;
    margin: 10mm 12mm;
  }

  /* Hide non-printable web UI elements */
  .app-header,
  .filter-card,
  .tab-navigation,
  .hero-stats,
  .live-showcase-container,
  .analytics-charts-grid,
  .app-footer,
  .btn-action,
  .showcase-header,
  .showcase-footer,
  .web-table-header,
  .toast-container {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: 'Inter', Arial, sans-serif !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .main-container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .tab-content {
    display: none !important;
  }

  .tab-content.active {
    display: block !important;
  }

  .print-official-header {
    display: block !important;
    text-align: center;
    margin-bottom: 14px;
    border-bottom: 2px solid #000000;
    padding-bottom: 8px;
  }

  .print-signature-footer {
    display: flex !important;
    margin-top: 24px;
  }

  .teacher-schedule-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
  }

  table.recap-presensi-table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    margin-top: 10px !important;
    font-size: 8.5pt !important;
    line-height: 1.35 !important;
  }

  table.recap-presensi-table th, 
  table.recap-presensi-table td {
    border: 1px solid #000000 !important;
    padding: 6px 8px !important;
    color: #000000 !important;
    vertical-align: middle !important;
  }

  table.recap-presensi-table th {
    background-color: #f1f5f9 !important;
    font-weight: 700 !important;
    text-align: center !important;
    font-size: 8.5pt !important;
  }

  .pred-kpi-badge {
    border: none !important;
    background: transparent !important;
    color: #000000 !important;
    font-weight: 600 !important;
    padding: 0 !important;
    font-size: 8.5pt !important;
    border-radius: 0 !important;
  }

  tr {
    page-break-inside: avoid !important;
  }
}
