/* ═══════════════════════════════════════════
   MUSE SCHOOL DASHBOARD — Premium CSS
   Yellow theme: #f8cc2a · Navy: #1a2640 · Teal: #11b9c9
   ═══════════════════════════════════════════ */

:root {
  --gold: #f8cc2a;
  --gold-light: #ffe166;
  --gold-dark: #e0b400;
  --navy: #1a2640;
  --navy-soft: #253555;
  --teal: #11b9c9;
  --teal-light: #6dd9e5;
  --white: #ffffff;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #1a2640;
  --text-soft: #4a5870;
  --border: rgba(26,38,64,0.08);
  --shadow: 0 2px 16px rgba(26,38,64,0.07);
  --shadow-lg: 0 8px 40px rgba(26,38,64,0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-w: 248px;
  --topbar-h: 58px;
  --ease: cubic-bezier(0.4,0,0.2,1);
  --font: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin:0; font-family:var(--font); font-size:0.9875rem; color:var(--text); background:var(--bg); overflow-x:hidden; }
img { max-width:100%; }
a { color:inherit; text-decoration:none; }
h1,h2,h3 { margin:0; line-height:1.2; }
p { margin:0; }
input,select,button { font-family:var(--font); }

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:rgba(26,38,64,0.15); border-radius:99px; }
::-webkit-scrollbar-thumb:hover { background:var(--gold); }

/* ═══ LOGIN ═══ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a2640 0%, #253555 40%, #0f1d30 100%);
  position: relative;
  overflow: hidden;
}

.login-screen::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(248,204,42,0.12) 0%, transparent 70%);
  top: -100px; right: -100px;
  pointer-events: none;
}

.login-screen::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(17,185,201,0.08) 0%, transparent 70%);
  bottom: -50px; left: -50px;
  pointer-events: none;
}

.login-card {
  background: var(--white);
  border-radius: 28px;
  padding: 2.5rem 2.25rem;
  width: min(420px, calc(100vw - 2rem));
  box-shadow: 0 32px 80px rgba(0,0,0,0.35);
  position: relative;
  z-index: 1;
  animation: slideUp 0.5s var(--ease) both;
}

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

.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo img {
  height: 70px;
  margin: 0 auto 0.75rem;
  display: block;
}

.login-school-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.login-tagline {
  font-size: 0.82rem;
  color: var(--text-soft);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

.role-toggle {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.role-btn {
  flex: 1;
  padding: 0.65rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-soft);
  transition: all 0.2s var(--ease);
}

.role-btn.active {
  border-color: var(--gold);
  background: rgba(248,204,42,0.1);
  color: var(--navy);
}

.login-card .form-group {
  margin-bottom: 1rem;
}

.login-card .form-group label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.login-card input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: #fafbfc;
  transition: border-color 0.2s;
}

.login-card input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(248,204,42,0.15);
}

.btn-login {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.25s var(--ease);
  box-shadow: 0 4px 20px rgba(248,204,42,0.4);
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(248,204,42,0.5);
}

.login-hint {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #f5f7fa;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-soft);
  text-align: center;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* ═══ APP LAYOUT ═══ */
.app {
  display: flex;
  min-height: 100vh;
}

/* ═══ SIDEBAR ═══ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--navy);
  position: fixed;
  top: 0; left: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease);
}

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

.sidebar-logo img {
  height: 40px;
  width: auto;
}

.sidebar-logo span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.95);
}

.nav-item.active {
  background: rgba(248,204,42,0.15);
  color: var(--gold);
  font-weight: 600;
}

.nav-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-badge {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.btn-logout {
  width: 100%;
  padding: 0.6rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}

/* ═══ TOPBAR ═══ */
.topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--navy);
  z-index: 800;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
}

.topbar-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

.topbar-title {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
}

.topbar-user {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
}

/* ═══ MAIN CONTENT ═══ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2rem;
  min-height: 100vh;
  background: var(--bg);
}

/* ═══ PAGE ═══ */
.page { animation: fadeIn 0.35s var(--ease) both; }

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

.page-header {
  margin-bottom: 1.75rem;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}

.page-sub {
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* ═══ CARDS ═══ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

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

.card-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
}

.mb-2 { margin-bottom: 1.25rem; }
.mt-1 { margin-top: 0.75rem; }
.mt-2 { margin-top: 1.25rem; }

/* ═══ STATS GRID ═══ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .stats-grid, .stats-grid.four-col { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .stats-grid, .stats-grid.four-col { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-icon { font-size: 2rem; margin-bottom: 0.5rem; line-height: 1; }
.stat-value { font-family: var(--font-display); font-size: 1.85rem; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-label { font-size: 0.82rem; color: var(--text-soft); margin-top: 0.35rem; font-weight: 500; }

.stat-blue::before { background: #3b82f6; }
.stat-green::before { background: #22c55e; }
.stat-red::before { background: #ef4444; }
.stat-yellow::before { background: var(--gold); }
.stat-purple::before { background: #a855f7; }
.stat-teal::before { background: var(--teal); }

/* ═══ TWO COL ═══ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ═══ TOOLBAR ═══ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.toolbar-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
}

/* ═══ INPUTS ═══ */
.input-sm {
  padding: 0.5rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
}

.input-sm:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(248,204,42,0.12);
}

/* ═══ BUTTONS ═══ */
.btn-primary {
  padding: 0.55rem 1.2rem;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--navy);
  border: none;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  box-shadow: 0 3px 14px rgba(248,204,42,0.35);
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(248,204,42,0.45);
}

.btn-outline {
  padding: 0.55rem 1.2rem;
  background: transparent;
  color: var(--navy);
  border: 1.5px solid rgba(26,38,64,0.2);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-outline:hover {
  border-color: var(--navy);
  background: rgba(26,38,64,0.05);
}

.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.82rem; }

/* ═══ DATA TABLE ═══ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  background: #f8fafc;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfd; }

.table-scroll { overflow-x: auto; }

/* ═══ BADGES ═══ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-gold { background: rgba(248,204,42,0.15); color: #a07800; }
.badge-green { background: rgba(34,197,94,0.1); color: #16a34a; }
.badge-red { background: rgba(239,68,68,0.1); color: #dc2626; }
.badge-yellow { background: rgba(234,179,8,0.1); color: #a16207; }
.badge-blue { background: rgba(59,130,246,0.1); color: #1d4ed8; }
.badge-gray { background: rgba(100,116,139,0.1); color: #475569; }

/* ═══ QUICK ATTENDANCE ═══ */
.quick-attendance-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 320px;
  overflow-y: auto;
}

.qa-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  gap: 0.75rem;
}

.qa-name { font-size: 0.875rem; font-weight: 600; color: var(--navy); flex: 1; }
.qa-class { font-size: 0.78rem; color: var(--text-soft); flex-shrink: 0; }
.qa-toggle {
  display: flex;
  border-radius: 50px;
  overflow: hidden;
  border: 1.5px solid var(--border);
}

.qa-toggle button {
  padding: 0.3rem 0.7rem;
  border: none;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-soft);
}

.qa-toggle button.present.active { background: #22c55e; color: white; }
.qa-toggle button.absent.active { background: #ef4444; color: white; }

/* ═══ ATTENDANCE STATUS ═══ */
.status-present { color: #16a34a; font-weight: 700; }
.status-absent { color: #dc2626; font-weight: 700; }
.status-late { color: #d97706; font-weight: 700; }
.status-holiday { color: #6366f1; font-weight: 700; }

/* ═══ ACTIVITY LIST ═══ */
.activity-list { display: flex; flex-direction: column; gap: 0.75rem; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.activity-dot.green { background: #22c55e; }
.activity-dot.red { background: #ef4444; }
.activity-dot.blue { background: #3b82f6; }
.activity-info { flex: 1; }
.activity-name { font-size: 0.875rem; font-weight: 600; color: var(--navy); }
.activity-meta { font-size: 0.78rem; color: var(--text-soft); }
.activity-amount { font-size: 0.875rem; font-weight: 700; color: var(--navy); }

/* ═══ UPLOAD CARDS ═══ */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 1000px) { .upload-grid { grid-template-columns: 1fr; } }

.upload-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.upload-icon { font-size: 2.5rem; }
.upload-card h2 { font-size: 1.1rem; color: var(--navy); }
.upload-card p { font-size: 0.875rem; color: var(--text-soft); line-height: 1.6; }

.upload-zone {
  width: 100%;
  border: 2px dashed rgba(26,38,64,0.2);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafbfc;
  position: relative;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--gold);
  background: rgba(248,204,42,0.05);
}

.upload-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--text-soft);
  pointer-events: none;
}

.upload-zone-icon { font-size: 2rem; }
.upload-zone-hint { font-size: 0.78rem; color: rgba(74,88,112,0.6); }

.upload-status {
  width: 100%;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  padding: 0;
  transition: all 0.3s;
}

.upload-status.success {
  background: rgba(34,197,94,0.1);
  color: #16a34a;
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(34,197,94,0.2);
}

.upload-status.error {
  background: rgba(239,68,68,0.1);
  color: #dc2626;
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(239,68,68,0.2);
}

.template-link {
  font-size: 0.82rem;
  color: var(--teal);
  font-weight: 600;
  cursor: pointer;
}

.template-link:hover { text-decoration: underline; }

/* ═══ CHARTS ═══ */
.bar-chart-wrap, .donut-wrap, .line-chart-wrap {
  min-height: 180px;
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
}

.donut-wrap { align-items: center; justify-content: center; flex-direction: column; gap: 1rem; }

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.bar {
  width: 100%;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: height 0.6s var(--ease);
  position: relative;
}

.bar:hover::after {
  content: attr(data-label);
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.bar-label { font-size: 0.72rem; color: var(--text-soft); font-weight: 600; }
.bar-value { font-size: 0.75rem; color: var(--navy); font-weight: 700; }

/* Donut chart */
.donut-svg { filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1)); }
.donut-legend { display: flex; flex-direction: column; gap: 0.5rem; }
.donut-legend-item {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; color: var(--text-soft);
}
.donut-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-item strong { color: var(--navy); margin-left: auto; }

/* Line chart */
.line-chart-wrap { 
  min-height: 200px; 
  width: 100%; 
  overflow-x: auto;
  display: block;
  padding: 0;
}

.line-chart-svg { width: 100%; min-width: 400px; }

/* ═══ STUDENT PROFILE ═══ */
.student-profile-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.student-profile-card::after {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(248,204,42,0.12), transparent 70%);
  pointer-events: none;
}

.student-avatar {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}

.student-profile-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.student-profile-meta {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  margin-top: 0.25rem;
}

/* ═══ ATTENDANCE LIST (parent) ═══ */
.attendance-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 300px; overflow-y: auto; }
.att-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 0.75rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}
.att-date { color: var(--text-soft); font-size: 0.82rem; }
.att-day { font-weight: 600; color: var(--navy); }

/* ═══ CALENDAR VIEW ═══ */
.calendar-view {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.cal-header {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  padding: 0.35rem 0;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: default;
  transition: transform 0.15s;
}

.cal-day.present { background: rgba(34,197,94,0.15); color: #16a34a; font-weight: 700; }
.cal-day.absent { background: rgba(239,68,68,0.12); color: #dc2626; font-weight: 700; }
.cal-day.holiday { background: rgba(99,102,241,0.1); color: #4f46e5; }
.cal-day.today { box-shadow: 0 0 0 2px var(--gold); }
.cal-day.empty { opacity: 0; }

/* ═══ FEE DETAIL CARD ═══ */
.fee-detail-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.fee-row:last-of-type { border-bottom: none; }
.fee-row-pending { margin-top: 0.25rem; }
.fee-row strong { font-size: 1.05rem; }
.text-green { color: #16a34a; }
.text-red { color: #dc2626; }

.fee-progress-wrap {
  height: 8px;
  background: rgba(26,38,64,0.08);
  border-radius: 99px;
  margin-top: 1rem;
  overflow: hidden;
}

.fee-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-light), var(--gold));
  border-radius: 99px;
  transition: width 0.8s var(--ease);
}

.fee-progress-label {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-top: 0.4rem;
  text-align: right;
}

/* ═══ PAY SECTION ═══ */
.pay-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.pay-amount-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) { .pay-amount-row { grid-template-columns: 1fr; } }

#razorpay-section .form-group label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
}

#razorpay-section input.input-sm { width: 100%; }

.razorpay-methods {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.razorpay-methods span {
  padding: 0.45rem 0.9rem;
  background: #f5f7fa;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.82rem;
  color: var(--text-soft);
  font-weight: 500;
}

.btn-pay {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 2rem;
  background: #2d64f2;
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  box-shadow: 0 4px 20px rgba(45,100,242,0.35);
}

.btn-pay:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(45,100,242,0.45);
  background: #1a52e0;
}

.razorpay-note {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* ═══ MODAL ═══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,38,64,0.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  animation: slideUp 0.25s var(--ease);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card-bg);
}

.modal-header h2 { font-size: 1.1rem; color: var(--navy); }

.modal-close {
  width: 32px; height: 32px;
  border: none; background: #f1f5f9;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-soft);
  transition: all 0.15s;
}

.modal-close:hover { background: #e2e8f0; color: var(--navy); }

.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.modal-body .form-group {
  margin-bottom: 1rem;
}

.modal-body .form-group label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 0.35rem;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text);
  font-family: var(--font);
  transition: border-color 0.2s;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(248,204,42,0.12);
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ═══ TOAST ═══ */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.85rem 1.25rem;
  background: var(--navy);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s var(--ease);
  max-width: 320px;
}

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

.toast.toast-success { background: #16a34a; }
.toast.toast-error { background: #dc2626; }
.toast.toast-info { background: var(--navy); }

/* ═══ ATTENDANCE TABLE CONTROLS ═══ */
.status-select {
  padding: 0.35rem 0.6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
}

.remark-input {
  padding: 0.35rem 0.6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  width: 120px;
  font-family: var(--font);
}

/* ═══ ACTIONS ═══ */
.action-btn {
  padding: 0.3rem 0.65rem;
  border: none;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.action-btn-edit { background: rgba(59,130,246,0.1); color: #1d4ed8; }
.action-btn-edit:hover { background: rgba(59,130,246,0.2); }
.action-btn-delete { background: rgba(239,68,68,0.1); color: #dc2626; }
.action-btn-delete:hover { background: rgba(239,68,68,0.2); }
.action-btn-pay { background: rgba(34,197,94,0.1); color: #16a34a; }
.action-btn-pay:hover { background: rgba(34,197,94,0.2); }

.actions-cell { display: flex; gap: 0.35rem; flex-wrap: wrap; }

/* ═══ PARENT FEE SUMMARY ═══ */
.fee-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.fee-summary-row:last-child { border-bottom: none; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,0.2);
  }

  .topbar { display: flex; }

  .main-content {
    margin-left: 0;
    padding: 1.25rem;
    padding-top: calc(var(--topbar-h) + 1.25rem);
  }
}

@media (max-width: 600px) {
  .main-content { padding: 1rem; padding-top: calc(var(--topbar-h) + 1rem); }
  .card { padding: 1.1rem; }
  .stat-value { font-size: 1.5rem; }
}

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 850;
}

.sidebar-overlay.visible { display: block; }
