/* ============================================================
   EDUPRIME SMS — MAIN STYLESHEET
   Theme: Deep Navy + Amber Accent, Editorial & Refined
   ============================================================ */

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

:root {
  /* Colors */
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #1c2430;
  --surface: #1f2937;
  --surface2: #263040;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);

  --accent: #f59e0b;
  --accent2: #fbbf24;
  --accent-dark: #d97706;
  --accent-glow: rgba(245,158,11,0.25);

  --primary: #3b82f6;
  --primary-glow: rgba(59,130,246,0.2);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;

  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #64748b;

  /* Sidebar */
  --sidebar-w: 260px;
  --sidebar-bg: #0d1117;

  /* Topbar */
  --topbar-h: 62px;

  /* Shadows */
  --shadow-sm: 0 1px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);

  /* Transitions */
  --trans: all 0.22s cubic-bezier(.4,0,.2,1);
  --trans-slow: all 0.4s cubic-bezier(.4,0,.2,1);

  /* Border Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;
}

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

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--trans-slow);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 18px; color: #000;
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--accent-glow);
}

.brand-text { flex: 1; min-width: 0; }
.brand-name { display: block; font-family: 'Syne', sans-serif; font-size: 13.5px; font-weight: 800; color: var(--text); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 10px; color: var(--text3); letter-spacing: 0.04em; text-transform: uppercase; }
.sidebar-close { display: none; color: var(--text3); font-size: 16px; padding: 4px; transition: var(--trans); }
.sidebar-close:hover { color: var(--text); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0; color: #fff;
}

.user-info { min-width: 0; }
.user-name { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-admin { background: rgba(245,158,11,.15); color: var(--accent); }
.badge-teacher { background: rgba(59,130,246,.15); color: var(--primary); }
.badge-student { background: rgba(16,185,129,.15); color: var(--success); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 20px;
}

.nav-section-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
  padding: 14px 10px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text2);
  transition: var(--trans);
  margin-bottom: 2px;
  position: relative;
}

.nav-item i { width: 18px; text-align: center; font-size: 14px; transition: var(--trans); }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(245,158,11,.15), rgba(245,158,11,.05));
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}
.nav-item.active i { color: var(--accent); }
.nav-logout { color: #ef4444; }
.nav-logout:hover { background: rgba(239,68,68,.1); color: #ef4444; }

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex: 1;
  transition: var(--trans-slow);
  min-width: 0;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0; z-index: 100;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }

.hamburger {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  color: var(--text2);
  font-size: 16px;
  display: grid; place-items: center;
  transition: var(--trans);
}
.hamburger:hover { background: var(--surface); color: var(--text); }

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.breadcrumb-school { color: var(--text3); }
.page-breadcrumb i { color: var(--text3); font-size: 9px; }
.breadcrumb-page { font-weight: 600; color: var(--text); }

.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 6px 14px;
  transition: var(--trans);
}
.topbar-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.topbar-search i { color: var(--text3); font-size: 13px; }
.topbar-search input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 13px; width: 160px;
}
.topbar-search input::placeholder { color: var(--text3); }

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  color: var(--text2);
  font-size: 15px;
  display: grid; place-items: center;
  transition: var(--trans);
  position: relative;
}
.topbar-btn:hover { background: var(--surface); color: var(--text); }
.badge-dot { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; position: absolute; top: 6px; right: 6px; box-shadow: 0 0 6px var(--accent-glow); }

.topbar-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
  background: var(--surface);
  padding: 6px 12px;
  border-radius: var(--r-lg);
  white-space: nowrap;
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
  flex: 1;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.page-header p { font-size: 13.5px; color: var(--text3); margin-top: 4px; }
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: var(--trans);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.card-header h2 { font-size: 15px; font-weight: 700; }
.card-body { padding: 22px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--trans);
  cursor: default;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent));
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-info { min-width: 0; }
.stat-label { font-size: 11.5px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat-value { font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 800; line-height: 1.1; margin-top: 3px; }
.stat-sub { font-size: 11px; color: var(--text3); margin-top: 3px; }
.stat-sub .up { color: var(--success); }
.stat-sub .down { color: var(--danger); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 600;
  transition: var(--trans);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent2); box-shadow: 0 4px 14px var(--accent-glow); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border2);
}
.btn-secondary:hover { background: var(--surface2); }

.btn-danger { background: rgba(239,68,68,.15); color: var(--danger); border-color: rgba(239,68,68,.3); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-success { background: rgba(16,185,129,.15); color: var(--success); border-color: rgba(16,185,129,.3); }
.btn-success:hover { background: var(--success); color: #fff; }

.btn-info { background: rgba(6,182,212,.15); color: var(--info); border-color: rgba(6,182,212,.3); }
.btn-info:hover { background: var(--info); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: var(--r-sm); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-green { background: rgba(16,185,129,.15); color: #10b981; }
.badge-red { background: rgba(239,68,68,.15); color: #ef4444; }
.badge-amber { background: rgba(245,158,11,.15); color: #f59e0b; }
.badge-blue { background: rgba(59,130,246,.15); color: #3b82f6; }
.badge-gray { background: rgba(100,116,139,.15); color: #94a3b8; }
.badge-cyan { background: rgba(6,182,212,.15); color: #06b6d4; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--r-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead th {
  background: var(--bg3);
  color: var(--text3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: rgba(255,255,255,0.03); }

.td-flex { display: flex; align-items: center; gap: 10px; }
.td-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.td-meta { font-size: 11.5px; color: var(--text3); margin-top: 1px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.form-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--text2); }
.form-group label span { color: var(--danger); margin-left: 2px; }

.form-control {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 13.5px;
  padding: 10px 14px;
  outline: none;
  transition: var(--trans);
  width: 100%;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text3); }
select.form-control { appearance: none; 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: 30px; }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint { font-size: 11.5px; color: var(--text3); }

.form-section-title {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  grid-column: 1 / -1;
}

/* ============================================================
   ALERT / FLASH MESSAGES
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  border-left: 4px solid;
}
.alert-success { background: rgba(16,185,129,.1); border-color: var(--success); color: #a7f3d0; }
.alert-danger { background: rgba(239,68,68,.1); border-color: var(--danger); color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,.1); border-color: var(--warning); color: #fde68a; }
.alert-info { background: rgba(6,182,212,.1); border-color: var(--info); color: #a5f3fc; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pagination-info { font-size: 12.5px; color: var(--text3); }
.pagination-btns { display: flex; gap: 6px; }
.page-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text2);
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: var(--trans);
}
.page-btn:hover { background: var(--surface2); color: var(--text); }
.page-btn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(.95) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg2);
  z-index: 1;
}
.modal-header h3 { font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 800; }
.modal-close { width: 32px; height: 32px; border-radius: var(--r-sm); color: var(--text3); font-size: 15px; display: grid; place-items: center; transition: var(--trans); }
.modal-close:hover { background: var(--surface); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.filter-bar .form-control { width: auto; flex: 1; min-width: 160px; max-width: 260px; }
.filter-label { font-size: 12px; font-weight: 600; color: var(--text3); white-space: nowrap; }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; gap: 4px; background: var(--bg3); padding: 5px; border-radius: var(--r-md); width: fit-content; flex-wrap: wrap; }
.tab-btn { padding: 7px 16px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: var(--text3); transition: var(--trans); }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--accent); color: #000; box-shadow: 0 2px 8px var(--accent-glow); }

.tab-content { display: none; }
.tab-content.active { display: block; }

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

.chart-placeholder {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  flex-direction: column;
  gap: 8px;
}

/* Mini chart bars */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 100%; padding: 10px 0; }
.bar-chart .bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-chart .bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 4px; transition: var(--trans-slow); opacity: 0.85; }
.bar-chart .bar:hover { opacity: 1; box-shadow: 0 0 10px var(--accent-glow); }
.bar-chart .bar-label { font-size: 10px; color: var(--text3); }

/* Progress bars */
.progress-list { display: flex; flex-direction: column; gap: 14px; }
.progress-item { display: flex; flex-direction: column; gap: 6px; }
.progress-header { display: flex; justify-content: space-between; font-size: 13px; }
.progress-label { font-weight: 500; }
.progress-value { color: var(--text3); font-size: 12px; }
.progress-bar-bg { height: 6px; background: var(--surface); border-radius: 10px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 10px; transition: width 0.8s ease; }

/* Recent activity list */
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 13.5px; line-height: 1.4; }
.activity-time { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* ============================================================
   TIMETABLE
   ============================================================ */
.timetable-grid {
  display: grid;
  grid-template-columns: 80px repeat(6, 1fr);
  gap: 3px;
}
.tt-header {
  background: var(--bg3);
  padding: 10px 8px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text3);
  border-radius: var(--r-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tt-time {
  background: var(--bg3);
  padding: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--text3);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tt-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px;
  font-size: 11.5px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: var(--trans);
}
.tt-cell:hover { border-color: var(--border2); }
.tt-cell.empty { background: var(--bg3); border-color: transparent; }
.tt-subject { font-weight: 700; font-size: 12px; }
.tt-teacher { color: var(--text3); font-size: 10.5px; margin-top: 2px; }
.tt-room { color: var(--accent); font-size: 10px; margin-top: 1px; }

/* ============================================================
   ATTENDANCE
   ============================================================ */
.attendance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.att-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--trans);
}
.att-card:hover { border-color: var(--border2); }
.att-card .att-name { font-size: 13px; font-weight: 600; flex: 1; }
.att-radio-group { display: flex; gap: 4px; }
.att-radio {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 700;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  color: var(--text3);
  cursor: pointer;
  transition: var(--trans);
}
.att-radio:hover { border-color: var(--border2); }
.att-radio.P.selected { background: rgba(16,185,129,.2); border-color: var(--success); color: var(--success); }
.att-radio.A.selected { background: rgba(239,68,68,.2); border-color: var(--danger); color: var(--danger); }
.att-radio.L.selected { background: rgba(245,158,11,.2); border-color: var(--warning); color: var(--warning); }

/* ============================================================
   CALENDAR WIDGET
   ============================================================ */
.calendar-mini { padding: 0; }
.calendar-nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.calendar-nav button { color: var(--text3); font-size: 15px; transition: var(--trans); padding: 4px 8px; border-radius: var(--r-sm); }
.calendar-nav button:hover { background: var(--surface); color: var(--text); }
.calendar-month { font-weight: 700; font-size: 14px; }
.calendar-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; padding: 12px; }
.cal-day-label { text-align: center; font-size: 10px; font-weight: 700; color: var(--text3); padding: 4px 0; text-transform: uppercase; }
.cal-day {
  aspect-ratio: 1;
  display: grid; place-items: center;
  font-size: 12.5px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: var(--trans);
  position: relative;
}
.cal-day:hover { background: var(--surface); }
.cal-day.today { background: var(--accent); color: #000; font-weight: 800; box-shadow: 0 0 10px var(--accent-glow); }
.cal-day.event::after { content: ''; width: 4px; height: 4px; background: var(--primary); border-radius: 50%; position: absolute; bottom: 3px; }
.cal-day.other-month { color: var(--text3); opacity: 0.4; }

/* ============================================================
   PROFILE CARD
   ============================================================ */
.profile-card { text-align: center; padding: 28px 24px; }
.profile-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: grid; place-items: center;
  font-size: 28px; font-weight: 700;
  margin: 0 auto 14px;
  border: 3px solid var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}
.profile-name { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800; }
.profile-sub { font-size: 12.5px; color: var(--text3); margin-top: 4px; }
.profile-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin-top: 20px; background: var(--border); border-radius: var(--r-md); overflow: hidden; }
.profile-stat { background: var(--bg2); padding: 14px 8px; text-align: center; }
.profile-stat-val { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800; }
.profile-stat-lbl { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text3);
  gap: 10px;
  text-align: center;
}
.empty-state i { font-size: 40px; opacity: 0.3; }
.empty-state h3 { font-size: 16px; color: var(--text2); font-weight: 600; }
.empty-state p { font-size: 13px; max-width: 280px; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-bg-pattern {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(245,158,11,.06) 1px, transparent 1px);
  background-size: 30px 30px;
}
.login-bg-glow {
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(245,158,11,.12) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.login-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r-xl);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.login-logo-icon {
  width: 50px; height: 50px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: var(--r-lg);
  display: grid; place-items: center;
  font-size: 22px; color: #000;
  box-shadow: 0 0 24px var(--accent-glow);
}
.login-logo h1 { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; }
.login-logo p { font-size: 11px; color: var(--text3); }
.login-title { font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.login-subtitle { font-size: 13.5px; color: var(--text3); margin-bottom: 28px; }
.login-demo { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; font-size: 12px; color: var(--text3); margin-top: 20px; }
.login-demo strong { color: var(--accent); }

/* ============================================================
   REPORT CARDS
   ============================================================ */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--trans);
  display: flex;
  align-items: center;
  gap: 14px;
}
.report-card:hover { border-color: var(--accent); box-shadow: 0 0 20px var(--accent-glow); transform: translateY(-2px); }
.report-icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.report-info h4 { font-size: 14px; font-weight: 700; }
.report-info p { font-size: 12px; color: var(--text3); margin-top: 3px; }

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .sidebar-close { display: grid !important; }
  .main-wrapper { margin-left: 0 !important; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .page-content { padding: 18px 14px; gap: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar-search { display: none; }
  .topbar-date { display: none; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .dashboard-grid-3 { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-control { max-width: 100%; }
  .modal { border-radius: var(--r-lg); }
  .login-card { padding: 30px 22px; }
  .timetable-grid { grid-template-columns: 60px repeat(6,1fr); font-size: 10px; }
  .page-header { flex-direction: column; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header-actions { flex-direction: column; width: 100%; }
  .btn { justify-content: center; }
  thead { display: none; }
  tbody tr { display: block; border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 10px; padding: 8px; }
  tbody td { display: flex; justify-content: space-between; padding: 6px 10px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
  tbody td::before { content: attr(data-label); font-weight: 600; color: var(--text3); font-size: 11px; text-transform: uppercase; }
  tbody tr:hover { background: var(--surface); }
}
