/* ============================================
   Science Intuition Management System
   Design System - v1.0
   ============================================ */

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

/* --- CSS Variables --- */
:root {
  --primary: #0f4c81;
  --primary-light: #1a6bb5;
  --primary-dark: #0a3259;
  --accent: #00c6a2;
  --accent-light: #00e6be;
  --accent-dark: #009e82;
  --secondary: #f97316;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --info: #3b82f6;

  --bg-base: #f0f4f8;
  --bg-card: #ffffff;
  --bg-sidebar: #0a1628;
  --bg-sidebar-hover: #162340;
  --bg-header: #ffffff;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-white: #ffffff;
  --text-sidebar: #94a3b8;
  --text-sidebar-active: #ffffff;

  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-card: 0 2px 12px rgba(15,76,129,0.08);

  --sidebar-width: 260px;
  --header-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  --font-main: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: var(--text-primary); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

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

p { margin-bottom: 0.75rem; color: var(--text-secondary); }

/* --- Layout: Dashboard Shell --- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,198,162,0.3);
}

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

.sidebar-logo .logo-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.sidebar-logo .logo-tagline {
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-section-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(148,163,184,0.5);
  padding: 14px 20px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px;
  color: var(--text-sidebar);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
  text-decoration: none;
}

.sidebar-link:hover {
  background: var(--bg-sidebar-hover);
  color: #ffffff;
}

.sidebar-link.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(0,198,162,0.15), transparent);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.sidebar-link .nav-icon {
  width: 20px;
  font-size: 1rem;
  opacity: 0.85;
  flex-shrink: 0;
  text-align: center;
}

.sidebar-link .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--bg-sidebar);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
}

.sidebar-user .user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: white;
  flex-shrink: 0;
}

.sidebar-user .user-info .user-name {
  font-size: 0.8rem; font-weight: 600; color: #fff; line-height: 1.2;
}
.sidebar-user .user-info .user-role {
  font-size: 0.65rem; color: var(--text-sidebar); text-transform: capitalize;
}

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

/* --- Header --- */
.app-header {
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

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

.header-search {
  position: relative;
}

.header-search input {
  background: var(--bg-base);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 7px 16px 7px 38px;
  font-size: 0.82rem;
  width: 220px;
  color: var(--text-primary);
  font-family: var(--font-main);
  transition: var(--transition);
}

.header-search input:focus {
  outline: none;
  border-color: var(--primary);
  width: 270px;
  background: white;
  box-shadow: 0 0 0 3px rgba(15,76,129,0.1);
}

.header-search .search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.header-icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg-base);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  text-decoration: none;
}

.header-icon-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.header-icon-btn .notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid white;
}

/* --- Page Content --- */
.page-content {
  padding: 28px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header-left h1 {
  font-size: 1.5rem;
  margin-bottom: 2px;
}

.page-header-left .breadcrumb {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.page-header-left .breadcrumb a { color: var(--text-muted); }
.page-header-left .breadcrumb a:hover { color: var(--primary); }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}

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

.card-body { padding: 22px; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-base);
}

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

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.04;
  transform: translate(20px, -20px);
}

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

.stat-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.blue { background: rgba(15,76,129,0.1); color: var(--primary); }
.stat-icon.green { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-icon.orange { background: rgba(249,115,22,0.1); color: var(--secondary); }
.stat-icon.teal { background: rgba(0,198,162,0.1); color: var(--accent); }
.stat-icon.red { background: rgba(239,68,68,0.1); color: var(--danger); }
.stat-icon.yellow { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-icon.indigo { background: rgba(99,102,241,0.1); color: #6366f1; }

.stat-info { flex: 1; }
.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}
.stat-change {
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 4px;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font-main);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

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

.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-light); border-color: var(--primary-light); color: white; box-shadow: 0 4px 12px rgba(15,76,129,0.35); }

.btn-accent { background: var(--accent); color: white; border-color: var(--accent); }
.btn-accent:hover:not(:disabled) { background: var(--accent-light); color: white; box-shadow: 0 4px 12px rgba(0,198,162,0.35); }

.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover:not(:disabled) { background: #0da572; color: white; }

.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #dc2626; color: white; }

.btn-warning { background: var(--warning); color: white; border-color: var(--warning); }
.btn-warning:hover:not(:disabled) { background: #d97706; color: white; }

.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary); color: white; }

.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-base); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 8px; }

/* --- Tables --- */
.table-responsive { overflow-x: auto; border-radius: var(--radius); }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.table thead th {
  background: var(--bg-base);
  padding: 11px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(15,76,129,0.025); }

.table-actions { display: flex; gap: 5px; align-items: center; }

/* --- Badges --- */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-active { background: rgba(16,185,129,0.12); color: #059669; }
.badge-pending { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-archived { background: rgba(100,116,139,0.12); color: #475569; }
.badge-deregistered { background: rgba(239,68,68,0.1); color: #dc2626; }
.badge-paid { background: rgba(16,185,129,0.12); color: #059669; }
.badge-unpaid { background: rgba(239,68,68,0.1); color: #dc2626; }
.badge-partial { background: rgba(249,115,22,0.12); color: #ea580c; }
.badge-present { background: rgba(16,185,129,0.12); color: #059669; }
.badge-absent { background: rgba(239,68,68,0.1); color: #dc2626; }
.badge-online { background: rgba(59,130,246,0.1); color: #2563eb; }
.badge-onsite { background: rgba(99,102,241,0.1); color: #4f46e5; }
.badge-grade { background: rgba(15,76,129,0.1); color: var(--primary); }

/* --- Forms --- */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 9px 13px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-primary);
  font-family: var(--font-main);
  transition: var(--transition);
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,76,129,0.1);
}

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

.form-control-sm { padding: 7px 11px; font-size: 0.82rem; }

select.form-control { cursor: pointer; 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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.72rem; color: var(--danger); margin-top: 4px; }

.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type="checkbox"],
.form-check input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.form-check label { font-size: 0.84rem; cursor: pointer; color: var(--text-primary); }

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

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--border); border-radius: 24px; transition: var(--transition); }
.toggle-slider:before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-switch input:checked + .toggle-slider { background: var(--success); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* --- Alerts --- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid transparent;
}

.alert-success { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.2); color: #065f46; }
.alert-danger  { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); color: #991b1b; }
.alert-warning { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.2); color: #92400e; }
.alert-info    { background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.2); color: #1e3a5f; }

/* --- Modal --- */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,22,40,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.modal-backdrop.active { display: flex; animation: fadeIn 0.2s ease; }

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

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }
.modal-sm { max-width: 440px; }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}

.modal-title { font-size: 1rem; font-weight: 700; }

.modal-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: none; background: var(--bg-base);
  cursor: pointer; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.modal-close:hover { background: var(--danger); color: white; }

.modal-body { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* --- Tabs --- */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 22px; gap: 2px; }

.tab-btn {
  padding: 10px 18px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -2px;
  transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}

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

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.2s ease; }

/* --- Pagination --- */
.pagination {
  display: flex; align-items: center; gap: 4px;
  justify-content: center; margin-top: 20px; flex-wrap: wrap;
}

.page-btn {
  display: flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: white;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Progress Bar --- */
.progress {
  background: var(--border);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 100px;
  background: var(--primary);
  transition: width 0.5s ease;
}

.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

/* --- Loading States --- */
.loading-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.skeleton {
  background: linear-gradient(90deg, var(--bg-base) 25%, var(--border-light) 50%, var(--bg-base) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

/* --- Profile Card --- */
.profile-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius);
  color: white; margin-bottom: 22px;
}

.profile-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700; color: white;
  border: 3px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
}

.profile-info .name { font-size: 1.1rem; font-weight: 700; color: white; }
.profile-info .admission { font-size: 0.75rem; color: rgba(255,255,255,0.7); font-family: var(--font-mono); margin-top: 2px; }
.profile-info .meta { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.profile-info .meta-tag { background: rgba(255,255,255,0.15); padding: 2px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; }

/* --- Fee Summary --- */
.fee-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.fee-box {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.fee-box.outstanding { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); }
.fee-box.paid { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); }
.fee-box.credit { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); }

.fee-box .fee-amount { font-size: 1.3rem; font-weight: 800; }
.fee-box .fee-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

.fee-box.outstanding .fee-amount { color: var(--danger); }
.fee-box.paid .fee-amount { color: var(--success); }
.fee-box.credit .fee-amount { color: var(--info); }

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 0.95rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 0.82rem; }

/* --- Quick Filter Bar --- */
.filter-bar {
  display: flex; gap: 10px; align-items: center;
  padding: 14px 0; flex-wrap: wrap;
}

.filter-bar .filter-select { width: auto; min-width: 130px; }

/* --- Notification Item --- */
.notif-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.notif-item:last-child { border-bottom: none; }

.notif-dot-indicator {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 5px;
  flex-shrink: 0;
}

.notif-dot-indicator.read { background: var(--border); }

.notif-content .notif-title { font-size: 0.84rem; font-weight: 600; }
.notif-content .notif-msg { font-size: 0.78rem; color: var(--text-secondary); }
.notif-content .notif-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; }

/* --- Charts placeholder area --- */
.chart-container { position: relative; height: 250px; }

/* --- Attendance Grid --- */
.attendance-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.att-day {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 600; cursor: pointer;
}
.att-day.present { background: rgba(16,185,129,0.15); color: #059669; }
.att-day.absent { background: rgba(239,68,68,0.1); color: #dc2626; }
.att-day.none { background: var(--border-light); color: var(--text-muted); }

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #0e3d6e 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 80%, rgba(0,198,162,0.15) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 50%);
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  position: relative; z-index: 1;
  animation: slideUp 0.4s ease;
}

.login-logo {
  text-align: center; margin-bottom: 30px;
}

.login-logo .logo-circle {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: white;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(15,76,129,0.35);
}

.login-logo h1 { font-size: 1.3rem; color: var(--text-primary); }
.login-logo p { font-size: 0.78rem; color: var(--text-muted); }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* --- Utility --- */
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary-color { color: var(--primary); }
.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fs-sm { font-size: 0.78rem; }
.fs-xs { font-size: 0.68rem; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.w-100 { width: 100%; }

/* --- Toast Notifications --- */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}

.toast {
  background: white;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 300px; max-width: 400px;
  animation: slideIn 0.3s ease;
  border-left: 4px solid var(--primary);
}

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

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-content .toast-title { font-size: 0.84rem; font-weight: 700; }
.toast-content .toast-msg { font-size: 0.78rem; color: var(--text-secondary); }
.toast-close { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: 0; }

@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .fee-summary { grid-template-columns: 1fr; }
  .modal { max-width: 100%; border-radius: var(--radius); }
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Sidebar submenu --- */
.sidebar-submenu {
  display: none;
  padding-left: 20px;
  background: rgba(0,0,0,0.1);
}
.sidebar-submenu.open { display: block; }
.sidebar-submenu .sidebar-link { font-size: 0.82rem; padding: 8px 20px; }
.sidebar-link .chevron { margin-left: auto; transition: var(--transition); font-size: 0.75rem; }
.sidebar-link.has-sub.open .chevron { transform: rotate(90deg); }
