/* Premium CSS stylesheet for Makham Sanseon School Audio-Visual Room Booking System */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  /* Colors */
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-rgb: 30, 58, 138;
  --secondary: #10b981;
  --secondary-light: #34d399;
  --secondary-rgb: 16, 185, 129;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --success: #10b981;
  --success-light: #d1fae5;
  
  /* Theme-specific background & text */
  --bg-body: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-sidebar: #0f172a;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-on-sidebar: #f8fafc;
  --border-color: #e2e8f0;
  
  /* Shadows & Radius */
  --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 -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-primary: 0 4px 14px 0 rgba(30, 58, 138, 0.3);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  /* Fonts */
  --font-header: 'Kanit', sans-serif;
  --font-sans: 'Sarabun', sans-serif;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
  --bg-body: #0b0f19;
  --bg-card: rgba(20, 26, 44, 0.8);
  --bg-sidebar: #070a12;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

/* Base resets & styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-header);
  font-weight: 600;
}

/* App Layout */
.app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  color: var(--text-on-sidebar);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
  transition: all var(--transition-normal);
}

.school-logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2.5rem;
}

.school-logo {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--secondary-light), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.school-logo::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: rotate(30deg);
  animation: shine 4s infinite linear;
}

@keyframes shine {
  0% { transform: translate(-100%, -100%) rotate(30deg); }
  100% { transform: translate(100%, 100%) rotate(30deg); }
}

.school-name-text h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.school-name-text p {
  font-size: 0.75rem;
  color: var(--secondary-light);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 16px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-family: var(--font-header);
  font-weight: 400;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.menu-item i {
  font-size: 1.2rem;
  width: 20px;
  text-align: center;
}

.menu-item:hover, .menu-item.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.menu-item.active {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.7), rgba(16, 185, 129, 0.4));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  color: #fff;
  cursor: pointer;
  font-family: var(--font-header);
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 2.5rem;
  min-height: 100vh;
  transition: margin-left var(--transition-normal);
}

/* Top Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.mobile-menu-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
}

.page-title h1 {
  font-size: 2rem;
  color: var(--text-main);
  position: relative;
  display: inline-block;
}

.page-title h1::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 50px;
  height: 4px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  border-radius: 2px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-card);
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  backdrop-filter: var(--glass-blur);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}

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

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* App Sections */
.app-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.app-section.active {
  display: block;
}

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

/* Glass Card common styles */
.glass-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: var(--glass-blur);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-normal), border-color var(--transition-normal);
}

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

.stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon.primary { background-color: rgba(30, 58, 138, 0.1); color: var(--primary); }
.stat-icon.secondary { background-color: rgba(16, 185, 129, 0.1); color: var(--secondary); }
.stat-icon.warning { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-icon.danger { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); }

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-family: var(--font-header);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}

/* Dashboard Layout Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dashboard-main-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.card-title {
  font-size: 1.25rem;
  color: var(--text-main);
  font-family: var(--font-header);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Schedule Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: -20px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--text-muted);
  border: 2px solid var(--bg-card);
  transition: background-color var(--transition-fast);
}

.timeline-item.approved::after { background-color: var(--secondary); }
.timeline-item.pending::after { background-color: var(--warning); }

.timeline-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-light);
}

.timeline-details {
  background-color: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background-color var(--transition-fast);
}

[data-theme="dark"] .timeline-details {
  background-color: rgba(255, 255, 255, 0.02);
}

.timeline-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.timeline-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

/* Charts (SVG) */
.chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 250px;
  position: relative;
}

.chart-svg {
  transform: rotate(-90deg);
  width: 180px;
  height: 180px;
}

.chart-slice {
  fill: none;
  stroke-width: 25;
  transition: stroke-width 0.3s ease;
}

.chart-slice:hover {
  stroke-width: 28;
  cursor: pointer;
}

.chart-labels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 18px;
  margin-top: 1rem;
}

.chart-label-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.chart-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Interactive Calendar Grid */
.calendar-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.month-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.month-nav-btn:hover {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.current-month-year {
  font-family: var(--font-header);
  font-size: 1.25rem;
  font-weight: 700;
  min-width: 180px;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.weekday-header {
  text-align: center;
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 0;
  border-bottom: 2px solid var(--border-color);
}

.calendar-day {
  aspect-ratio: 1.15;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: rgba(255, 255, 255, 0.02);
  min-height: 70px;
}

.calendar-day:hover:not(.empty-day) {
  background-color: rgba(30, 58, 138, 0.05);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.calendar-day.today {
  border: 2px solid var(--primary-light);
  background-color: rgba(59, 130, 246, 0.05);
}

.calendar-day.selected {
  background-color: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary);
}

.calendar-day.selected .day-number { color: #fff; }
.calendar-day.selected .day-booking-indicator { border-color: #fff; }

.calendar-day.empty-day {
  cursor: default;
  opacity: 0.15;
  border: none;
}

.day-number {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.day-bookings-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.day-booking-indicator {
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-booking-indicator.approved {
  background-color: var(--success-light);
  color: #065f46;
}

.day-booking-indicator.pending {
  background-color: var(--warning-light);
  color: #92400e;
}

[data-theme="dark"] .day-booking-indicator.approved {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

[data-theme="dark"] .day-booking-indicator.pending {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

/* Day Detail Drawer/View */
.calendar-view-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 1.5rem;
}

.day-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.day-detail-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 5px;
}

.day-detail-date {
  font-size: 1.1rem;
  color: var(--primary-light);
  font-weight: 600;
}

.booking-item-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.01);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: all var(--transition-fast);
}

.booking-item-card:hover {
  background-color: rgba(0, 0, 0, 0.02);
  border-color: var(--primary-light);
}

[data-theme="dark"] .booking-item-card {
  background-color: rgba(255, 255, 255, 0.01);
}

[data-theme="dark"] .booking-item-card:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.booking-status-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-approved { background-color: var(--success-light); color: #065f46; }
.badge-pending { background-color: var(--warning-light); color: #92400e; }
.badge-rejected { background-color: var(--danger-light); color: #991b1b; }

[data-theme="dark"] .badge-approved { background-color: rgba(16, 185, 129, 0.2); color: #34d399; }
[data-theme="dark"] .badge-pending { background-color: rgba(245, 158, 11, 0.2); color: #fbbf24; }
[data-theme="dark"] .badge-rejected { background-color: rgba(239, 68, 68, 0.2); color: #fca5a5; }

.booking-item-title {
  font-size: 1rem;
  font-weight: 600;
  max-width: 75%;
}

.booking-item-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 15px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.booking-item-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.booking-item-equipments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.eq-tag {
  background-color: var(--bg-body);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.day-detail-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

/* Premium Form Styling */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1.25rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-header);
}

.form-control {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-body);
  color: var(--text-main);
  transition: all var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background-color: var(--bg-card);
}

select.form-control {
  cursor: pointer;
}

.equipment-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.equipment-checkbox-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  background-color: var(--bg-body);
  transition: all var(--transition-fast);
}

.equipment-checkbox-card:hover {
  border-color: var(--primary-light);
  background-color: rgba(59, 130, 246, 0.02);
}

.equipment-checkbox-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  accent-color: var(--primary);
  cursor: pointer;
}

.equipment-card-label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  cursor: pointer;
}

.eq-card-title {
  font-weight: 600;
  color: var(--text-main);
}

.eq-card-icon {
  margin-right: 4px;
}

/* Conflict Alert Banner */
.alert-banner {
  display: none;
  background-color: var(--danger-light);
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  align-items: center;
  gap: 10px;
  animation: shake 0.3s ease;
}

[data-theme="dark"] .alert-banner {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-header);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(30, 58, 138, 0.4);
}

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

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

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

.btn-success:hover {
  background-color: #0d9488;
  transform: translateY(-2px);
}

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

.btn-danger:hover {
  background-color: #dc2626;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Admin Dashboard Styling */
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.admin-filters {
  display: flex;
  gap: 10px;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Admin Table */
.admin-table-container {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.admin-table th {
  font-family: var(--font-header);
  color: var(--text-muted);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.admin-table tr:hover {
  background-color: rgba(0, 0, 0, 0.01);
}

[data-theme="dark"] .admin-table tr:hover {
  background-color: rgba(255, 255, 255, 0.01);
}

.admin-action-group {
  display: flex;
  gap: 6px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeInModal 0.3s ease;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  width: 90%;
  max-width: 600px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: scaleInModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleInModal {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-body);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition-fast);
}

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

.modal-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-field {
  display: grid;
  grid-template-columns: 140px 1fr;
  font-size: 0.9rem;
}

.modal-field-label {
  font-weight: 600;
  color: var(--text-muted);
}

.modal-field-value {
  color: var(--text-main);
}

.modal-footer {
  margin-top: 2rem;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
}

/* Custom Alert Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 300;
}

.toast {
  background-color: var(--bg-sidebar);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-header);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-left: 4px solid var(--secondary); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary-light); }

/* Responsive adjustments */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .calendar-view-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }
  
  .sidebar-footer {
    display: none; /* Hide bottom panel in mobile sidebar, can show in top bar if needed */
  }
  
  .school-logo-container {
    margin-bottom: 1rem;
  }
  
  .main-content {
    margin-left: 0;
    padding: 1.5rem;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group.full-width {
    grid-column: span 1;
  }
  
  .modal-field {
    grid-template-columns: 1fr;
    gap: 4px;
    margin-bottom: 8px;
  }
  
  .modal-field-label {
    font-size: 0.8rem;
  }
  
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .user-profile {
    align-self: flex-end;
  }
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.pulse-animation {
  animation: pulse 2s infinite ease-in-out;
}
