/* ============================================
   SCHOOL MANAGEMENT SYSTEM — BLUE & WHITE THEME
   ============================================ */

:root {
  --primary: #1E5EFF;
  --primary-dark: #0F3FCC;
  --primary-light: #E8F0FF;
  --accent: #00B8D9;
  --success: #12B76A;
  --warning: #F79009;
  --danger: #F04438;

  --white: #FFFFFF;
  --bg: #F5F8FF;
  --surface: #FFFFFF;
  --border: #E3EAF5;
  --text: #0F1B33;
  --muted: #6B7A99;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15,27,51,.06);
  --shadow: 0 4px 14px rgba(15,27,51,.08);
  --shadow-lg: 0 12px 32px rgba(30,94,255,.15);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- LAYOUT ---------- */
.sidebar {
  width: 240px; min-height: 100vh;
  background: linear-gradient(180deg, #0F3FCC 0%, #1E5EFF 100%);
  color: #fff;
  position: fixed; top: 0; left: 0;
  padding: 20px 14px;
  overflow-y: auto;
  z-index: 100;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 15px;
  padding: 8px 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,.15);
  margin-bottom: 14px;
}
.sidebar nav { display: flex; flex-direction: column; }
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.85);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: all .15s ease;
}
.sidebar a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.sidebar a.active { background: #fff; color: var(--primary); font-weight: 600; }
.sidebar a.active:hover { background: #fff; color: var(--primary); }

.main {
  margin-left: 240px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.topbar {
  height: 60px; background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 10;
}
.content { padding: 22px 24px; flex: 1; }

/* ---------- CARDS ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 600; margin: 0; }

/* ---------- STATS ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--primary);
}
.stat .label {
  color: var(--muted); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .5px;
  font-weight: 600;
}
.stat .value {
  font-size: 24px; font-weight: 700;
  margin-top: 6px; color: var(--text);
  line-height: 1.2;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  font-family: inherit;
  transition: all .15s ease;
  line-height: 1.4;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-lg); color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); color: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--primary-light); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #D92D20; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #039855; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ---------- FORMS ---------- */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: 12.5px; font-weight: 500;
  margin-bottom: 5px; color: var(--text);
}
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit;
  background: #fff; color: var(--text);
  transition: border .15s, box-shadow .15s;
  line-height: 1.4;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,94,255,.12);
}
textarea.form-control { resize: vertical; min-height: 70px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7A99' d='M6 9L1 4h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ---------- TABLES ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 10px 12px;
  background: var(--primary-light); color: var(--primary-dark);
  font-weight: 600; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid var(--border);
}
.table th:first-child { border-top-left-radius: var(--radius-sm); }
.table th:last-child { border-top-right-radius: var(--radius-sm); }
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:hover { background: #FAFCFF; }
.table tbody tr:last-child td { border-bottom: none; }

/* ---------- BADGES ---------- */
.badge {
  display: inline-block; padding: 3px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .3px;
}
.badge-pending { background: #FFF6E5; color: #B54708; }
.badge-enrolled { background: #E7F8EF; color: #027A48; }
.badge-paid { background: #E7F8EF; color: #027A48; }
.badge-unpaid { background: #FEECEB; color: #B42318; }

/* ---------- LOGIN PAGE ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1E5EFF 0%, #0F3FCC 100%);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 14px;
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-card h1 {
  margin: 0 0 4px;
  font-size: 22px;
  color: var(--primary-dark);
  font-weight: 700;
  letter-spacing: -.3px;
}
.login-card p.sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}
.login-card .form-control { padding: 10px 13px; font-size: 14px; }
.login-card .btn { font-size: 14px; font-weight: 600; }

/* ---------- MISC ---------- */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* ---------- PRINT ---------- */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
  .card { border: none; box-shadow: none; page-break-inside: avoid; }
  body { background: #fff; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .sidebar { width: 60px; padding: 14px 6px; }
  .sidebar .brand span,
  .sidebar a span { display: none; }
  .sidebar a { justify-content: center; padding: 10px 0; }
  .main { margin-left: 60px; }
  .content { padding: 14px; }
  .topbar { padding: 0 14px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 8px 6px; }
}