/* ==========================================================================
   EduSmart Enterprise - Modern Web Design System & Theme Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Color Palette - Vibrant Indigo Modern */
  --primary-h: 238;
  --primary-s: 82%;
  --primary-l: 59%;
  --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-hover: hsl(var(--primary-h), var(--primary-s), 50%);
  --primary-light: hsl(var(--primary-h), var(--primary-s), 95%);
  --primary-glow: hsla(var(--primary-h), var(--primary-s), 59%, 0.25);

  --secondary: #64748b;
  --accent: #f59e0b;

  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #3b82f6;
  --info-light: #eff6ff;

  /* Neutral Spectrum */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-header: rgba(255, 255, 255, 0.85);

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;

  --border-color: #e2e8f0;
  --border-focus: #818cf8;

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px var(--primary-glow);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-blur: blur(12px);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;

  --sidebar-width: 260px;
  --header-height: 70px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --bg-main: #0b0f19;
  --bg-card: #151c2c;
  --bg-sidebar: #070a12;
  --bg-header: rgba(21, 28, 44, 0.85);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --border-color: #1e293b;
  --glass-bg: rgba(21, 28, 44, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);

  --success-light: rgba(16, 185, 129, 0.15);
  --warning-light: rgba(245, 158, 11, 0.15);
  --danger-light: rgba(239, 68, 68, 0.15);
  --info-light: rgba(59, 130, 246, 0.15);
  --primary-light: rgba(99, 102, 241, 0.15);
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--text-main);
  background-color: var(--bg-main);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
}

/* ==========================================================================
   Layout Architecture
   ========================================================================== */

#app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.sidebar-brand-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.sidebar-brand-text span {
  color: #818cf8;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.menu-group-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: #64748b;
  padding: 0.75rem 0.75rem 0.35rem 0.75rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  color: #94a3b8;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.nav-item i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
}

.nav-item.active {
  background: linear-gradient(90deg, var(--primary), #6366f1);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  color: #f1f5f9;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 1px 6px;
  background-color: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-transform: uppercase;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-normal);
}

/* Header Styles */
.top-header {
  height: var(--header-height);
  background-color: var(--bg-header);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-sidebar-toggle {
  display: none;
  font-size: 1.25rem;
  color: var(--text-main);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
}

.page-title-box h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.page-title-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Role Status Notification Badge */
.role-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.role-status-badge.role-admin {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.role-status-badge.role-guru {
  background-color: var(--info-light);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.theme-toggle-btn, .btn-icon-head {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  position: relative;
}

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

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  background-color: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.shortcut-item:hover {
  border-color: var(--primary) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Main Content Container */
.content-body {
  padding: 2rem;
  flex: 1;
}

/* Footer */
.main-footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  background-color: var(--bg-card);
}

/* ==========================================================================
   UI Components & Modern Widgets
   ========================================================================== */

/* Cards & Containers */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title i {
  color: var(--primary);
}

/* Stats Overview Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--primary);
}

.stat-card.stat-success::before { background-color: var(--success); }
.stat-card.stat-warning::before { background-color: var(--warning); }
.stat-card.stat-danger::before { background-color: var(--danger); }
.stat-card.stat-info::before { background-color: var(--info); }

.stat-info-box .stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.stat-info-box .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.stat-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background-color: var(--primary-light);
  color: var(--primary);
}

.stat-card.stat-success .stat-icon-wrapper { background-color: var(--success-light); color: var(--success); }
.stat-card.stat-warning .stat-icon-wrapper { background-color: var(--warning-light); color: var(--warning); }
.stat-card.stat-danger .stat-icon-wrapper { background-color: var(--danger-light); color: var(--danger); }
.stat-card.stat-info .stat-icon-wrapper { background-color: var(--info-light); color: var(--info); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

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

.btn-secondary {
  background-color: var(--bg-main);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-success { background-color: var(--success); color: #fff; }
.btn-success:hover { background-color: #059669; }

.btn-danger { background-color: var(--danger); color: #fff; }
.btn-danger:hover { background-color: #dc2626; }

.btn-warning { background-color: var(--warning); color: #fff; }
.btn-warning:hover { background-color: #d97706; }

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

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

.data-table th {
  background-color: var(--bg-main);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.9rem;
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.03);
}

/* Badges & Status Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.badge-success { background-color: var(--success-light); color: var(--success); }
.badge-warning { background-color: var(--warning-light); color: var(--warning); }
.badge-danger { background-color: var(--danger-light); color: var(--danger); }
.badge-info { background-color: var(--info-light); color: var(--info); }
.badge-primary { background-color: var(--primary-light); color: var(--primary); }
.badge-secondary { background-color: rgba(100, 116, 139, 0.15); color: #64748b; }
.badge-gray { background-color: rgba(148, 163, 184, 0.18); color: #64748b; }

/* Submenu Navigation Styles */
.nav-sub-item {
  margin-left: 0.85rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.nav-sub-item:hover {
  border-left-color: var(--primary);
}

.nav-sub-item.active {
  border-left-color: #ffffff;
}

/* Pagination Styling */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pagination-btn-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.page-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.page-btn.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

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

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Search Bar Component */
.search-box {
  position: relative;
  min-width: 250px;
}

.search-box input {
  padding-left: 2.3rem;
}

.search-box i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition-fast);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: var(--bg-main);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  min-width: 280px;
  padding: 0.85rem 1.25rem;
  background-color: var(--bg-card);
  color: var(--text-main);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s ease;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Tab Control */
.tabs-header {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Schedule Grid */
.schedule-grid {
  display: grid;
  grid-template-columns: 80px repeat(5, 1fr);
  gap: 8px;
  margin-top: 1rem;
}

.schedule-header {
  background-color: var(--bg-main);
  padding: 0.75rem;
  text-align: center;
  font-weight: 700;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.time-col {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-main);
  border-radius: var(--radius-sm);
}

.schedule-cell {
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  min-height: 80px;
  padding: 0.5rem;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
}

.schedule-cell.filled {
  background: var(--primary-light);
  border: 1px solid var(--border-focus);
}

.schedule-cell .cell-title {
  font-weight: 700;
  color: var(--primary);
}

.schedule-cell .cell-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Report Card & Print Layout Styles (@media print)
   ========================================================================== */

.rapor-container {
  background: #fff;
  color: #000;
  padding: 2.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-width: 800px;
  margin: 0 auto;
}

.rapor-header {
  text-align: center;
  border-bottom: 2px solid #000;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.rapor-header h2 { font-size: 1.5rem; text-transform: uppercase; letter-spacing: 1px; }
.rapor-header p { font-size: 0.9rem; margin-top: 2px; }

.rapor-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.rapor-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.rapor-table th, .rapor-table td {
  border: 1px solid #000;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  text-align: left;
}

.rapor-table th { background-color: #f1f5f9; text-align: center; }

.signature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.9rem;
}

.sig-space { height: 60px; }

@media print {
  body * {
    visibility: hidden;
  }
  #print-area, #print-area * {
    visibility: visible;
  }
  #print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  .sidebar, .top-header, .main-footer, .btn, .role-switcher-card {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
  }
}

/* Class Grid & Card View Styles */
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.class-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all var(--transition-normal);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.class-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-focus);
}

.class-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.class-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.class-teacher-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.class-teacher-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.class-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}

/* Login Screen Overlay */
#login-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 460px;
  padding: 2rem 1.75rem;
}

.login-tabs {
  display: flex;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.25rem;
}

.login-tab {
  flex: 1;
  padding: 0.65rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.login-tab:hover {
  color: var(--text-main);
}

.login-tab.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-logout-sidebar {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout-sidebar:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .btn-sidebar-toggle {
    display: block;
  }
  .search-box {
    display: none;
  }
}

/* ==========================================================================
   Student Attendance Module (Absensi Siswa) Custom Components & Badges
   ========================================================================== */
.badge-purple {
  background-color: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

[data-theme="dark"] .badge-purple {
  background-color: rgba(139, 92, 246, 0.25);
  color: #a78bfa;
}

.att-student-card {
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  transition: all var(--transition-fast);
}

.att-student-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-sm);
}

.att-student-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 220px;
}

.att-student-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  border: 2px solid var(--border-color);
}

.att-status-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.att-btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  user-select: none;
}

.att-btn:hover {
  transform: translateY(-1px);
}

/* Hadir (Green) */
.att-btn-hadir:hover { border-color: #10b981; color: #10b981; background: var(--success-light); }
.att-btn.active-hadir {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

/* Sakit (Yellow/Orange) */
.att-btn-sakit:hover { border-color: #f59e0b; color: #f59e0b; background: var(--warning-light); }
.att-btn.active-sakit {
  background: #f59e0b !important;
  color: #ffffff !important;
  border-color: #f59e0b !important;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

/* Izin (Blue) */
.att-btn-izin:hover { border-color: #3b82f6; color: #3b82f6; background: var(--info-light); }
.att-btn.active-izin {
  background: #3b82f6 !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

/* Alpha (Red) */
.att-btn-alpa:hover { border-color: #ef4444; color: #ef4444; background: var(--danger-light); }
.att-btn.active-alpa {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

/* Bolos (Purple) */
.att-btn-bolos:hover { border-color: #8b5cf6; color: #8b5cf6; background: rgba(139, 92, 246, 0.12); }
.att-btn.active-bolos {
  background: #8b5cf6 !important;
  color: #ffffff !important;
  border-color: #8b5cf6 !important;
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.35);
}

.att-note-input {
  min-width: 180px;
  max-width: 240px;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Rekap Absensi Bulanan Matrix Table & Legend Styles
   ========================================================================== */
.rekap-matrix-wrapper {
  overflow-x: auto;
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.rekap-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}

.rekap-table th, .rekap-table td {
  padding: 0.5rem 0.35rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  white-space: nowrap;
}

.rekap-table th {
  background: var(--bg-main);
  font-weight: 700;
  color: var(--text-main);
}

.rekap-table td.col-sticky-name, .rekap-table th.col-sticky-name {
  position: sticky;
  left: 0;
  z-index: 15;
  background: var(--bg-card);
  text-align: left;
  min-width: 180px;
  max-width: 220px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

[data-theme="dark"] .rekap-table td.col-sticky-name, 
[data-theme="dark"] .rekap-table th.col-sticky-name {
  background: var(--bg-card);
}

.code-cell {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.72rem;
}

.code-cell.code-h { background: #10b981; color: #ffffff; } /* Hadir */
.code-cell.code-s { background: #f59e0b; color: #ffffff; } /* Sakit */
.code-cell.code-i { background: #3b82f6; color: #ffffff; } /* Izin */
.code-cell.code-a { background: #ef4444; color: #ffffff; } /* Alpha */
.code-cell.code-b { background: #8b5cf6; color: #ffffff; } /* Bolos */
.code-cell.code-empty { background: transparent; color: var(--text-light); opacity: 0.4; }

/* Submenu Navigation Styles */
.nav-sub-item {
  padding-left: 1.75rem !important;
  font-size: 0.85rem !important;
}

/* Firebase Cloud Sync Badge & Controls */
.cloud-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.8rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.cloud-sync-badge.local-mode {
  background: var(--bg-main);
  color: var(--text-muted);
  border-color: var(--border-color);
}
.cloud-sync-badge.local-mode:hover {
  background: var(--border-color);
  color: var(--text-main);
}

.cloud-sync-badge.online {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}
.cloud-sync-badge.online:hover {
  background: #d1fae5;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.cloud-sync-badge.syncing {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.cloud-sync-badge.error {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}




