/* ============================================================
   SCHOOL MANAGEMENT SYSTEM — GLOBAL DESIGN SYSTEM
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS CUSTOM PROPERTIES ── */
:root {
  --primary:       #10B981;
  --primary-dark:  #059669;
  --primary-light: #34D399;
  --secondary:     #059669;
  --accent:        #34D399;
  --success:       #10B981;
  --warning:       #F59E0B;
  --danger:        #EF4444;
  --info:          #3B82F6;

  --bg:            #0F1117;
  --bg-card:       #1A1D27;
  --bg-sidebar:    #13151F;
  --bg-input:      #1E2130;
  --border:        rgba(255,255,255,0.08);
  --border-focus:  rgba(16,185,129,0.6);

  --text:          #E2E8F0;
  --text-muted:    #8892A4;
  --text-light:    #CBD5E1;

  --sidebar-w:     260px;
  --topbar-h:      64px;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-card:   0 2px 16px rgba(0,0,0,0.3);
  --transition:    0.2s ease;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-card); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

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

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}
.sidebar-brand img { width: 36px; height: 36px; border-radius: var(--radius-sm); object-fit: cover; }
.sidebar-brand .brand-name { font-weight: 700; font-size: 15px; color: var(--text); }
.sidebar-brand .brand-sub  { font-size: 11px; color: var(--text-muted); }

.sidebar-section { padding: 16px 12px 8px; }
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 8px 8px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(16,185,129,0.15);
  color: var(--primary-light);
}
.sidebar-nav a.active { color: var(--primary-light); font-weight: 600; }
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-nav .badge-count {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

/* TOPBAR */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.page-body { padding: 24px; flex: 1; }

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text); }
.card-body  { padding: 20px; }

/* STAT CARDS */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-color, var(--primary));
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  background: rgba(16,185,129,0.15);
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-change { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── TABLES ── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 12px 16px; font-size: 13.5px; color: var(--text-light); }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; letter-spacing: 0.5px; text-transform: uppercase; }
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text);
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary{ background: rgba(255,255,255,0.08); color: var(--text); }
.btn-secondary:hover{ background: rgba(255,255,255,0.14); }
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-warning  { background: var(--warning); color: #1a1a1a; }
.btn-info     { background: var(--info); color: #fff; }
.btn-outline  { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary-light); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-block { width: 100%; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-success { background: rgba(16,185,129,0.15); color: #10B981; }
.badge-danger  { background: rgba(239,68,68,0.15);  color: #EF4444; }
.badge-warning { background: rgba(245,158,11,0.15); color: #F59E0B; }
.badge-info    { background: rgba(59,130,246,0.15); color: #3B82F6; }
.badge-primary { background: rgba(16,185,129,0.15);  color: #34D399; }
.badge-muted   { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* ── ALERTS ── */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 10px; font-size: 13.5px; margin-bottom: 16px; }
.alert-success { background: rgba(16,185,129,0.12); border-left: 3px solid var(--success); color: #6EE7B7; }
.alert-error   { background: rgba(239,68,68,0.12);  border-left: 3px solid var(--danger);  color: #FCA5A5; }
.alert-warning { background: rgba(245,158,11,0.12); border-left: 3px solid var(--warning); color: #FCD34D; }
.alert-info    { background: rgba(59,130,246,0.12); border-left: 3px solid var(--info);    color: #93C5FD; }

/* ── MODALS ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--text); }
.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── AVATAR ── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }

/* ── BREADCRUMB ── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a:hover { color: var(--primary-light); }
.breadcrumb span { color: var(--text-muted); }

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header-title { font-size: 22px; font-weight: 800; }
.page-header-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── HAMBURGER ── */
.sidebar-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 4px; }
.sidebar-toggle svg { width: 24px; height: 24px; }

/* ── SEARCH BOX ── */
.search-box { position: relative; }
.search-box input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 8px 16px 8px 38px;
  color: var(--text);
  font-size: 13px;
  width: 220px;
  outline: none;
  transition: all var(--transition);
  font-family: inherit;
}
.search-box input:focus { border-color: var(--primary); width: 260px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--text-muted); }

/* ── DROPDOWN ── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 180px;
  box-shadow: var(--shadow);
  z-index: 200;
  display: none;
  overflow: hidden;
}
.dropdown-menu.open { display: block; animation: fadeDown 0.15s ease; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  font-size: 13px; color: var(--text-light);
  cursor: pointer;
  transition: background var(--transition);
}
.dropdown-item:hover { background: rgba(255,255,255,0.05); }
.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ── PAGINATION ── */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 20px; }
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.pagination a:hover { background: rgba(16,185,129,0.15); color: var(--primary-light); border-color: var(--primary); }
.pagination .active span { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── UTILITIES ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning{ color: var(--warning); }
.text-primary{ color: var(--primary-light); }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.rounded { border-radius: var(--radius); }
.hidden { display: none; }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(16,185,129,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(5,150,105,0.08) 0%, transparent 50%);
  padding: 20px;
}
.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { width: 56px; margin: 0 auto 12px; border-radius: var(--radius-sm); }
.login-logo h1 { font-size: 22px; font-weight: 800; }
.login-logo p  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .search-box input { width: 180px; }
  .search-box input:focus { width: 200px; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-body { padding: 16px; }
  .login-box { padding: 28px 20px; }
}
