@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg: #f0f2f7;
  --bg2: #e8eaf2;
  --surface: #ffffff;
  --surface2: #f7f8fc;
  --border: #e2e5ef;
  --text: #1a1d2e;
  --text2: #6b7280;
  --text3: #9ca3af;
  --primary: #4f46e5;
  --primary-light: #eef2ff;
  --primary-dark: #3730a3;
  --accent: #06b6d4;
  --accent-light: #ecfeff;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --sidebar-w: 260px;
  --topbar-h: 68px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.09);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg2: #161923;
  --surface: #1c2030;
  --surface2: #232840;
  --border: #2d3348;
  --text: #f1f3f9;
  --text2: #9ba3bf;
  --text3: #5c6480;
  --primary-light: #1e1b4b;
  --accent-light: #0c2a33;
  --success-light: #052e1e;
  --warning-light: #2d1f04;
  --danger-light: #2d0a0a;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
}

/* ─── LAYOUT ─── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition), background var(--transition);
  overflow: hidden;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

.brand-text {
  display: flex; flex-direction: column;
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text3);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text3);
  padding: 8px 10px 6px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
  cursor: pointer;
}

.nav-item .nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.nav-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item:hover .nav-icon {
  transform: scale(1.1);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

.nav-item.active .nav-icon { filter: brightness(10); }

.nav-item.logout {
  color: var(--danger);
  margin-top: 4px;
}

.nav-item.logout:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.teacher-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
}

.teacher-mini .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.teacher-mini-info .name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.teacher-mini-info .class-badge {
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
}

/* ─── TOPBAR ─── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 90;
  gap: 16px;
  transition: background var(--transition);
}

.topbar-left {
  display: flex;
  flex-direction: column;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.topbar-sub {
  font-size: 12px;
  color: var(--text3);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dark-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition);
  color: var(--text2);
}

.dark-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.topbar-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}

.hamburger {
  display: none;
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: var(--text2);
}

/* ─── MAIN CONTENT ─── */
.main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  width: calc(100% - var(--sidebar-w));
}

.page-content {
  padding: 28px;
}

/* ─── STAT CARDS ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.07;
  transform: translate(20px, -20px);
}

.stat-card.blue::before { background: var(--primary); }
.stat-card.cyan::before { background: var(--accent); }
.stat-card.green::before { background: var(--success); }
.stat-card.amber::before { background: var(--warning); }

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.stat-card.blue .stat-icon { background: var(--primary-light); }
.stat-card.cyan .stat-icon { background: var(--accent-light); }
.stat-card.green .stat-icon { background: var(--success-light); }
.stat-card.amber .stat-icon { background: var(--warning-light); }

.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 4px;
  font-family: 'DM Mono', monospace;
}

.stat-label {
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
}

.stat-change {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.neutral { color: var(--text3); }

/* ─── CARDS ─── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: background var(--transition);
}

.card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.card-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.card-body {
  padding: 20px 24px 24px;
}

/* ─── GRID LAYOUTS ─── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ─── PROGRESS BARS ─── */
.progress-bar {
  height: 8px;
  background: var(--bg2);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

.progress-item {
  margin-bottom: 18px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.progress-name { font-size: 13px; font-weight: 500; color: var(--text); }
.progress-pct { font-size: 12px; font-weight: 600; color: var(--text2); font-family: 'DM Mono', monospace; }

/* ─── TABLE ─── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  background: var(--surface2);
}

th {
  padding: 13px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text3);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  transition: background var(--transition);
}

tbody tr:hover td { background: var(--surface2); }

.roll-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
  font-family: 'DM Mono', monospace;
}

.student-name { font-weight: 500; }

/* ─── STATUS BADGE ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge.present { background: var(--success-light); color: var(--success); }
.badge.absent { background: var(--danger-light); color: var(--danger); }
.badge.late { background: var(--warning-light); color: var(--warning); }

/* ─── SELECT DROPDOWN ─── */
.status-select {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.status-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

.status-select.present { border-color: var(--success); color: var(--success); }
.status-select.absent { border-color: var(--danger); color: var(--danger); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: white;
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79,70,229,0.4);
}

.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text2);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1.5px solid transparent;
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }

/* ─── FORM ELEMENTS ─── */
.form-group { margin-bottom: 18px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

.input:disabled {
  background: var(--bg2);
  color: var(--text3);
  cursor: not-allowed;
}

.input-icon-wrap { position: relative; }
.input-icon-wrap .input { padding-left: 40px; }
.input-icon-wrap .icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 16px;
}

/* ─── PAGE HEADER ─── */
.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header-left .page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.page-header-left .page-desc {
  font-size: 14px;
  color: var(--text2);
  margin-top: 3px;
}

/* ─── TOAST ─── */
.toast-container {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 380px;
  animation: slideUp 0.3s cubic-bezier(0.4,0,0.2,1) forwards;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--primary); }

.toast.hiding { animation: slideDown 0.3s cubic-bezier(0.4,0,0.2,1) forwards; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(20px); }
}

/* ─── LOADER ─── */
.loader-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s;
}

.loader-overlay.hidden { opacity: 0; pointer-events: none; }

.loader {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}

.spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
}

/* ─── EMPTY STATE ─── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-icon { font-size: 52px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-desc { font-size: 14px; color: var(--text2); max-width: 320px; }

/* ─── DATE BADGE ─── */
.date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
}

.class-badge2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* ─── PROFILE ─── */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius);
  color: white;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.profile-hero::after {
  content: '';
  position: absolute;
  bottom: -40px; right: 80px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}

.profile-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  font-weight: 700;
  border: 3px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
  position: relative; z-index: 1;
}

.profile-hero-info { position: relative; z-index: 1; }
.profile-hero-info h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.profile-hero-info p { font-size: 14px; opacity: 0.85; }
.profile-hero-info .hero-badges { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.hero-chip {
  background: rgba(255,255,255,0.18);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* ─── INFO ROWS ─── */
.info-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child { border-bottom: none; }

.info-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.info-label { font-size: 11px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.info-value { font-size: 14px; font-weight: 600; color: var(--text); }

/* ─── CHART BARS ─── */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-top: 10px;
}

.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--primary), #6366f1);
  opacity: 0.8;
  transition: opacity var(--transition), transform var(--transition);
  cursor: pointer;
  min-height: 4px;
}

.chart-bar:hover { opacity: 1; transform: scaleY(1.03); transform-origin: bottom; }
.chart-bar.accent { background: linear-gradient(180deg, var(--accent), #0891b2); }

.chart-label { font-size: 11px; color: var(--text3); font-weight: 500; }
.chart-val { font-size: 11px; color: var(--text2); font-weight: 600; font-family: 'DM Mono', monospace; }

/* ─── SIDEBAR OVERLAY (mobile) ─── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ─── FILTER BAR ─── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: all var(--transition);
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

/* ─── ATTENDANCE INFO BAR ─── */
.att-info-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.att-info-bar .divider {
  width: 1px; height: 20px;
  background: var(--border);
}

/* ─── ANIMATIONS ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.4s cubic-bezier(0.4,0,0.2,1) forwards; }

.stagger > * { opacity: 0; animation: fadeIn 0.4s cubic-bezier(0.4,0,0.2,1) forwards; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }

/* ─── MARK ALL BAR ─── */
.mark-all-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface2);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
}

.mark-all-bar label { font-size: 13px; color: var(--text2); font-weight: 500; }

/* ─── RECORDS SUMMARY ─── */
.records-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.summary-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-chip.present { background: var(--success-light); color: var(--success); }
.summary-chip.absent { background: var(--danger-light); color: var(--danger); }
.summary-chip.total { background: var(--primary-light); color: var(--primary); }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity var(--transition); }
  .sidebar-overlay.active { opacity: 1; pointer-events: auto; }

  .main { margin-left: 0; width: 100%; }
  .topbar { left: 0; }

  .hamburger { display: flex; }

  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .profile-hero { flex-direction: column; text-align: center; }
}