/* ==========================================================================
   SISTEM PRESENSI QR CODE - NEO-BRUTALISM / PLAYFUL OUTLINE DESIGN SYSTEM
   Inspired by modern Gumroad, Duolingo & Playful Outline UI
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Outfit:wght@500;600;700;800;900&display=swap');

/* === LUCIDE ICONS === */
svg.lucide {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke-width: 2.2;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item svg.lucide    { width: 18px; height: 18px; stroke-width: 2.5; }
.stat-icon svg.lucide   { width: 24px; height: 24px; stroke-width: 2.5; }
.logo-icon svg.lucide   { width: 22px; height: 22px; stroke-width: 2.8; color: #1e1e1e; }
.btn svg.lucide         { width: 17px; height: 17px; flex-shrink: 0; stroke-width: 2.5; }
.btn-icon svg.lucide    { width: 18px; height: 18px; stroke-width: 2.5; }
.badge svg.lucide       { width: 14px; height: 14px; stroke-width: 2.8; flex-shrink: 0; }
.search-icon svg.lucide { width: 18px; height: 18px; color: #1e1e1e; stroke-width: 2.5; }
.modal-close svg.lucide { width: 18px; height: 18px; stroke-width: 2.5; }
.mobile-menu-btn svg.lucide { width: 22px; height: 22px; stroke-width: 2.5; }
td .btn svg.lucide      { width: 15px; height: 15px; stroke-width: 2.5; }

/* === CSS VARIABLES & DESIGN TOKENS (NEO-BRUTALISM STYLE) === */
:root {
  /* Backgrounds */
  --bg-primary: #F8F6F0;       /* Warm cream/off-white main background */
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FFFDF9;
  --bg-glass: #FFFBF5;
  --bg-glass-hover: #FEEFB3;
  --bg-sidebar: #FFFFFF;

  /* Crisp Neo-Brutalist Borders */
  --border-glass: #1E1E1E;
  --border-glass-hover: #000000;
  --border-input: #1E1E1E;
  --border-dark: #1E1E1E;

  /* Pastel Accent Palette with High-Contrast Appeal */
  --accent-green: #86EFAC;     /* Soft Mint Green */
  --accent-green-dark: #14532D;
  --accent-purple: #DDD6FE;    /* Soft Lavender Purple */
  --accent-purple-dark: #4C1D95;
  --accent-cyan: #99F6E4;      /* Soft Cyan */
  --accent-cyan-dark: #134E4A;
  --accent-blue: #BAE6FD;      /* Soft Sky Blue */
  --accent-blue-dark: #0C4A6E;
  --accent-yellow: #FDE047;    /* Warm Gold/Yellow */
  --accent-yellow-dark: #713F12;
  --accent-red: #FECDD3;       /* Soft Coral Pink */
  --accent-red-dark: #881337;
  --accent-orange: #FFEDD5;    /* Soft Peach Orange */
  --accent-orange-dark: #7C2D12;

  /* Gradients mapped to clean vibrant Neo-Brutalist solids or subtle gradients */
  --gradient-primary: linear-gradient(135deg, #86EFAC, #4ADE80);
  --gradient-success: linear-gradient(135deg, #86EFAC, #22C55E);
  --gradient-warning: linear-gradient(135deg, #FDE047, #FACC15);
  --gradient-danger: linear-gradient(135deg, #FECDD3, #F87171);

  /* Text Colors */
  --text-primary: #1E1E1E;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --text-on-accent: #1E1E1E;

  /* Neo-Brutalist Flat Offset Shadows */
  --shadow-xs: 2px 2px 0px #1E1E1E;
  --shadow-sm: 2.5px 2.5px 0px #1E1E1E;
  --shadow-md: 4px 4px 0px #1E1E1E;
  --shadow-lg: 6px 6px 0px #1E1E1E;
  --shadow-xl: 8px 8px 0px #1E1E1E;
  --shadow-glow-blue: 3px 3px 0px #1E1E1E;
  --shadow-glow-purple: 3px 3px 0px #1E1E1E;
  --shadow-glow-green: 3px 3px 0px #1E1E1E;

  /* Friendly Rounded Corners */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: all 0.12s ease;

  /* Layout */
  --sidebar-width: 260px;
}

/* === RESET & CORE STYLES === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: radial-gradient(#d1d5db 1px, transparent 1px);
  background-size: 24px 24px;
}

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

/* === BACKGROUND ORBS (Hide or style cleanly) === */
.bg-gradient-orbs {
  display: none;
}
.orb { display: none; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.02); }
}

/* === LAYOUT === */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.main-content {
  flex: 1;
  padding: 28px 40px 48px;
  min-height: calc(100vh - 84px);
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

/* === TOP NAVBAR === */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #FFFFFF;
  border-bottom: 2.5px solid var(--border-dark);
  padding: 14px 32px;
  box-shadow: 0 4px 0px rgba(30, 30, 30, 0.08);
  width: 100%;
}

.navbar-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
}

/* Brand Logo */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-yellow);
  border: 2.5px solid var(--border-dark);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-primary);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.navbar-brand:hover .logo-icon {
  transform: rotate(-6deg) scale(1.05);
  background: var(--accent-green);
  box-shadow: var(--shadow-sm);
}

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

.logo-title {
  font-size: 17px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.logo-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 700;
}

/* Navigation menu */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  padding: 0;
  border: none;
  margin-left: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  background: transparent;
  white-space: nowrap;
  min-height: 42px;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
  border: 2px solid var(--border-dark);
  box-shadow: var(--shadow-xs);
  transform: translate(-1px, -1px);
}

.nav-item.active {
  background: var(--accent-green);
  color: var(--text-primary);
  border: 2px solid var(--border-dark);
  box-shadow: var(--shadow-xs);
  font-weight: 800;
  transform: translate(-1px, -1px);
}

.nav-icon {
  font-size: 16px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* Actions & Profile */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: var(--transition);
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

.nav-action-btn:hover {
  background: var(--accent-yellow);
  color: var(--text-primary);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-md);
}

.navbar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  padding: 5px 16px 5px 6px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-dark);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.navbar-profile:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-sm);
  background: var(--bg-glass);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-purple);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-dark);
}

.profile-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.1px;
}

/* Hide legacy sidebar elements */
.sidebar, .sidebar-overlay, .mobile-menu-btn {
  display: none !important;
}

.sidebar-footer {
  padding: 14px 10px;
  border-top: 2px solid var(--border-dark);
}

.school-info {
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 2px solid var(--border-dark);
  box-shadow: var(--shadow-xs);
}

.school-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.4;
}

.school-year {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 2px;
}

/* === PAGE HEADER === */
.page-header {
  margin-bottom: 26px;
  width: 100%;
}

.page-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.25;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 4px;
  line-height: 1.5;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* === CARDS (Neo-Brutalist Outline style) === */
.card {
  background: #FFFFFF;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-xl);
  padding: 26px;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  position: relative;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-dark);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

.card-glass {
  background: #FFFBF5;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.card-glass:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

/* === STAT CARDS === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.stat-card {
  background: #FFFFFF;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  min-height: 94px;
}

.stat-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-lg);
  background: #FFFBF5;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  border: 2px solid var(--border-dark);
  box-shadow: var(--shadow-xs);
}

.stat-icon.blue   { background: var(--accent-blue); color: var(--text-primary); }
.stat-icon.green  { background: var(--accent-green); color: var(--text-primary); }
.stat-icon.yellow { background: var(--accent-yellow); color: var(--text-primary); }
.stat-icon.red    { background: var(--accent-red); color: var(--text-primary); }
.stat-icon.purple { background: var(--accent-purple); color: var(--text-primary); }
.stat-icon.cyan   { background: var(--accent-cyan); color: var(--text-primary); }

.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-change {
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}

.stat-change.up   { color: var(--accent-green-dark); }
.stat-change.down { color: var(--accent-red-dark); }

/* === BUTTONS (Pill Outline & Playful Shadow) === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  min-height: 46px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid var(--border-dark) !important;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  user-select: none;
  background: #FFFFFF;
  color: var(--text-primary);
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-md);
  filter: brightness(1.02);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: var(--shadow-active);
}

/* Primary */
.btn-primary {
  background: var(--accent-green) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: #6EE7B7 !important;
  box-shadow: var(--shadow-md);
}

/* Success */
.btn-success {
  background: var(--accent-green) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-sm);
}

.btn-success:hover {
  background: #6EE7B7 !important;
  box-shadow: var(--shadow-md);
}

/* Warning */
.btn-warning {
  background: var(--accent-yellow) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-sm);
}

.btn-warning:hover {
  background: #FCE036 !important;
  box-shadow: var(--shadow-md);
}

/* Danger */
.btn-danger {
  background: var(--accent-red) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
  background: #FDA4AF !important;
  box-shadow: var(--shadow-md);
}

/* Ghost / Outlined */
.btn-ghost {
  background: #FFFFFF !important;
  color: var(--text-primary) !important;
  border: 2px solid var(--border-dark) !important;
  box-shadow: var(--shadow-xs);
}

.btn-ghost:hover {
  background: var(--bg-glass) !important;
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
}

.btn-lg {
  min-height: 52px;
  padding: 14px 32px;
  font-size: 15.5px;
  border-radius: var(--radius-full);
}

.btn-icon {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.4;
  border: 2px solid var(--border-dark) !important;
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}

.badge-hadir {
  background: var(--accent-green);
  color: var(--accent-green-dark);
}

.badge-sakit {
  background: var(--accent-yellow);
  color: var(--accent-yellow-dark);
}

.badge-izin {
  background: var(--accent-blue);
  color: var(--accent-blue-dark);
}

.badge-alpha {
  background: var(--accent-red);
  color: var(--accent-red-dark);
}

.badge-terlambat {
  background: var(--accent-orange);
  color: var(--accent-orange-dark);
}

.badge-lainnya {
  background: var(--accent-purple);
  color: var(--accent-purple-dark);
}

.scan-count-badge {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-green);
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-full);
  padding: 6px 18px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
  box-sizing: border-box;
  white-space: nowrap;
}

/* === TABLE & RESPONSIVE SCROLLING === */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-xl);
  border: 2px solid var(--border-dark);
  box-shadow: var(--shadow-md);
  background: #FFFFFF;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: #FFFBF5;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 16px 18px;
  text-align: left;
  border-bottom: 2px solid var(--border-dark);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1.5px solid #E2E8F0;
  transition: var(--transition-fast);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover {
  background: #FFFDF9;
}

tbody td {
  padding: 15px 18px;
  color: var(--text-primary);
  vertical-align: middle;
  font-weight: 600;
}

/* === FORMS & INPUTS === */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}

.form-control {
  width: 100%;
  background: #FFFFFF;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 600;
  min-height: 46px;
  padding: 10px 16px;
  transition: var(--transition);
  font-family: inherit;
  outline: none;
  box-shadow: var(--shadow-xs);
}

.form-control:focus {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-md);
  transform: translate(-1px, -1px);
  background: #FFFDF9;
}

.form-control::placeholder { color: var(--text-muted); font-weight: 500; }

select.form-control option {
  background: #FFFFFF;
  color: var(--text-primary);
  font-weight: 600;
}

.form-row {
  display: grid;
  gap: 18px;
}

.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 20px;
}

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

.modal {
  background: #FFFFFF;
  border: 2.5px solid var(--border-dark);
  border-radius: var(--radius-xl);
  padding: 30px;
  width: 90%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: scale(0.95) translateY(16px);
  transition: var(--transition);
  position: relative;
  box-shadow: var(--shadow-xl);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-dark);
}

.modal-title {
  font-size: 19px;
  font-weight: 900;
  color: var(--text-primary);
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--border-dark);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--transition);
  line-height: 1;
  box-shadow: var(--shadow-xs);
}

.modal-close:hover {
  background: var(--accent-red);
  color: var(--text-primary);
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-md);
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  width: calc(100% - 48px);
}

.toast {
  background: #FFFFFF;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-lg);
  transform: translateX(115%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show { transform: translateX(0); }

.toast-icon  { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.toast-content { flex: 1; min-width: 0; }
.toast-title   { font-size: 14px; font-weight: 800; color: var(--text-primary); }
.toast-message { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; font-weight: 600; line-height: 1.4; }

.toast.success { background: #ECFDF5; border-left: 6px solid #22C55E; }
.toast.success .toast-icon { color: #16A34A; }
.toast.error   { background: #FEF2F2; border-left: 6px solid #EF4444; }
.toast.error   .toast-icon { color: #DC2626; }
.toast.warning { background: #FFFBEB; border-left: 6px solid #F59E0B; }
.toast.warning .toast-icon { color: #D97706; }
.toast.info    { background: #EFF6FF; border-left: 6px solid #3B82F6; }
.toast.info    .toast-icon { color: #2563EB; }

/* === SEARCH BAR === */
.search-bar {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  min-height: 46px;
  gap: 12px;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.search-bar:focus-within {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-md);
  transform: translate(-1px, -1px);
  background: #FFFDF9;
}

.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  flex: 1;
  min-width: 0;
}

.search-bar input::placeholder { color: var(--text-muted); font-weight: 500; }
.search-bar .search-icon { color: var(--text-primary); font-size: 18px; flex-shrink: 0; }

/* === FILTER BAR === */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* === LOADING === */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #E2E8F0;
  border-top-color: var(--border-dark);
  border-right-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border-radius: inherit;
  z-index: 10;
}

/* === EMPTY STATE === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon  { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.empty-state-title { font-size: 17px; font-weight: 800; color: var(--text-primary); margin-bottom: 6px; }
.empty-state-text  { font-size: 14px; color: var(--text-secondary); max-width: 320px; font-weight: 600; }

/* === PROGRESS BAR === */
.progress-bar {
  height: 12px;
  background: #FFFFFF;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  padding: 2px;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-green);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === AVATAR === */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-yellow);
  border: 2px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

/* === DIVIDER === */
.divider {
  height: 2px;
  background: var(--border-dark);
  margin: 20px 0;
}

/* === DATE BADGE === */
.date-display {
  min-height: 42px;
  font-size: 13.5px;
  color: var(--text-primary);
  background: #FFFFFF;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-full);
  padding: 6px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-xs);
  font-weight: 800;
  box-sizing: border-box;
  white-space: nowrap;
}

.date-display svg, .header-date-pill svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke-width: 2.5;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #CBD5E1; border: 2px solid var(--bg-primary); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* === CHIP / TAG === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  min-height: 40px;
  background: #FFFFFF;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}

.chip:hover,
.chip.active {
  background: var(--accent-green);
  color: var(--text-primary);
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-sm);
}

/* === PAGINATION === */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: #FFFFFF;
  border: 2px solid var(--border-dark);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
  font-weight: 800;
  box-shadow: var(--shadow-xs);
}

.page-btn:hover {
  background: var(--accent-yellow);
  color: var(--text-primary);
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-sm);
}

.page-btn.active {
  background: var(--accent-green);
  border-color: var(--border-dark);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* === UTILITIES === */
.grid   { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 18px; }

.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }

.text-right    { text-align: right; }
.text-center   { text-align: center; }
.font-bold     { font-weight: 800; }
.text-sm       { font-size: 13.5px; font-weight: 600; }
.text-xs       { font-size: 12px; font-weight: 600; }
.text-secondary { color: var(--text-secondary); }
.text-muted    { color: var(--text-muted); }
.text-green    { color: var(--accent-green-dark); }
.text-red      { color: var(--accent-red-dark); }
.text-blue     { color: var(--accent-blue-dark); }
.text-yellow   { color: var(--accent-yellow-dark); }

.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.mb-2  { margin-bottom: 8px; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 16px; }
.w-full { width: 100%; }

/* === TOOLTIP === */
[data-tooltip] { position: relative; }

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--border-dark);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

[data-tooltip]:hover::before { opacity: 1; }

/* === SUMMARY PILL === */
.summary-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 13px;
  box-shadow: var(--shadow-xs);
  font-weight: 800;
  color: var(--text-primary);
}

/* =======================================================
   RESPONSIVE SYSTEM — Clean, Layered, Mobile-First Support
   Breakpoints: 1200px (large), 1024px (tablet/laptop), 768px (small tablet), 600px (mobile), 480px (small mobile)
   ======================================================= */

/* --- BASE Desktop Layout structure --- */
.welcome-header,
.page-header > .flex,
.page-header > .students-header,
.page-header > div[style*="display: flex"] {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
}

.welcome-left,
.page-header > .flex > div:first-child,
.page-header > .students-header > div:first-child,
.page-header > div[style*="display: flex"] > div:first-child {
  flex: 1 1 0;
  min-width: 220px;
}

.welcome-right,
.page-actions,
.page-header > .flex > div:last-child:not(:first-child),
.page-header > .students-header > div:last-child:not(:first-child),
.page-header > div[style*="display: flex"] > div:last-child:not(:first-child) {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin-left: auto;
}

.page-actions {
  margin-top: 0;
}

.page-title,
.welcome-title {
  text-align: left;
}

.page-subtitle,
.welcome-greeting {
  text-align: left;
  margin: 0;
}

.calendar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hamburger-btn {
  display: none !important;
}

/* === TABLET / LAPTOP (≤ 1024px) === */
@media (max-width: 1024px) {
  .hamburger-btn {
    display: inline-flex !important;
  }

  .top-navbar {
    position: sticky;
    top: 0;
    z-index: 500;
    padding: 12px 24px;
  }

  .navbar-container {
    position: relative;
    flex-wrap: nowrap;
  }

  .main-content {
    padding: 24px 24px 40px;
  }

  .navbar-nav {
    display: none !important;
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    right: 0;
    width: 100%;
    z-index: 999;
    background: #FFFFFF;
    border: 2.5px solid var(--border-dark);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    margin: 0;
  }

  .navbar-nav.mobile-active {
    display: flex !important;
    animation: fadeInDown 0.25s ease forwards;
  }

  .navbar-nav .nav-item {
    width: 100%;
    padding: 12px 18px;
    font-size: 15px;
    justify-content: flex-start;
    border-radius: var(--radius-md);
    min-height: 48px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === MEDIUM / TABLET (≤ 900px) === */
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
  
  .welcome-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

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

/* === SMALL TABLET & MOBILE (≤ 768px) === */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .main-content {
    padding: 20px 16px 36px;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    box-shadow: var(--shadow-xl);
  }

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

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

  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .page-title, .welcome-title {
    font-size: 24px;
  }

  .modal {
    padding: 24px;
    width: 95%;
  }

  /* Prevent iOS input auto-zoom by enforcing 16px on mobile */
  .form-control,
  select.form-control,
  input.form-control,
  textarea.form-control {
    font-size: 16px !important;
    min-height: 48px;
  }

  /* Enhance touch targets for buttons and chips on mobile */
  .btn, .btn-sm, .chip, .status-chip {
    min-height: 44px;
  }

  .table-wrapper {
    margin: 0;
    border-radius: var(--radius-lg);
  }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* === MOBILE ONLY (≤ 600px) === */
@media (max-width: 600px) {
  .top-navbar {
    padding: 12px 16px;
  }

  .main-content {
    padding: 16px 14px 32px;
  }

  .welcome-header,
  .page-header > .flex,
  .page-header > .students-header,
  .page-header > div[style*="display: flex"] {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .welcome-right,
  .page-actions,
  .page-header > .flex > div:last-child:not(:first-child),
  .page-header > .students-header > div:last-child:not(:first-child),
  .page-header > div[style*="display: flex"] > div:last-child:not(:first-child),
  .calendar-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .page-actions .btn,
  .welcome-right .btn,
  .calendar-actions .btn {
    width: auto;
    flex: 1 1 auto;
    min-height: 46px;
  }

  .page-title, .welcome-title {
    font-size: 22px;
  }

  .logo-title { font-size: 16px; }
  .logo-icon { width: 40px; height: 40px; }

  .toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }

  .modal {
    padding: 22px 18px;
    width: calc(100% - 24px);
    max-height: 88vh;
    border-radius: 20px;
  }
}

/* === SMALL MOBILE (≤ 480px) === */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .status-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .status-tabs::-webkit-scrollbar {
    display: none;
  }

  .btn-sm {
    padding: 0 16px;
  }
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

@keyframes scanLine {
  0%   { top: 0; }
  50%  { top: calc(100% - 2px); }
  100% { top: 0; }
}

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

.animate-fade-in-up { animation: fadeInUp 0.4s ease forwards; }
.animate-fade-in    { animation: fadeIn 0.3s ease forwards; }

.animate-stagger > * {
  opacity: 0;
  animation: fadeInUp 0.35s ease forwards;
}
.animate-stagger > *:nth-child(1) { animation-delay: 0.04s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.08s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.12s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.16s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.20s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.24s; }

/* === APP FOOTER === */
.app-footer {
  text-align: center;
  padding: 28px 20px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  border: none;
  margin-top: auto;
  background: transparent;
  width: 100%;
}
