/* ================================================================
   EduCore – Master Stylesheet
   Font: Sora (display) + Inter (body)
   Theme: Deep navy + amber accent, clean institutional
   ================================================================ */

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

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --bg:         #0b1120;
  --bg2:        #111827;
  --bg3:        #1a2232;
  --surface:    #1e2d40;
  --surface2:   #243447;
  --border:     rgba(255,255,255,.08);
  --border2:    rgba(255,255,255,.12);
  --text:       #e8edf4;
  --text2:      #8fa3b8;
  --text3:      #5a7090;
  --accent:     #f59e0b;
  --accent2:    #fbbf24;
  --accent-dim: rgba(245,158,11,.15);
  --blue:       #3b82f6;
  --blue-dim:   rgba(59,130,246,.15);
  --green:      #10b981;
  --green-dim:  rgba(16,185,129,.15);
  --red:        #ef4444;
  --red-dim:    rgba(239,68,68,.15);
  --purple:     #8b5cf6;
  --purple-dim: rgba(139,92,246,.15);
  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.5);
  --font:       'Inter', system-ui, sans-serif;
  --font-d:     'Sora', system-ui, sans-serif;
  --sidebar-w:  260px;
  --header-h:   64px;
  --transition: all .2s ease;
}

.light {
  --bg:         #f0f4f8;
  --bg2:        #e8edf4;
  --bg3:        #dde4ed;
  --surface:    #ffffff;
  --surface2:   #f8fafc;
  --border:     rgba(0,0,0,.08);
  --border2:    rgba(0,0,0,.12);
  --text:       #1a2232;
  --text2:      #4a6080;
  --text3:      #8fa3b8;
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:  0 4px 24px rgba(0,0,0,.12);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent2); }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ── Typography ─────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-d); font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p  { color: var(--text2); }

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

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform .3s ease;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.sidebar__logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem;
}
.sidebar__logo-icon {
  width: 38px; height: 38px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-d); font-weight: 800; font-size: .9rem;
  color: #000;
  flex-shrink: 0;
}
.sidebar__logo-text { font-family: var(--font-d); font-weight: 700; font-size: 1.1rem; }
.sidebar__logo-sub  { font-size: .7rem; color: var(--text3); }

.sidebar__school-badge {
  margin: 1rem;
  padding: .75rem;
  background: var(--accent-dim);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: var(--radius);
  font-size: .75rem;
}
.sidebar__school-badge strong { display: block; color: var(--accent); font-family: var(--font-d); }

.sidebar__nav { padding: .5rem; flex: 1; }
.sidebar__section-title {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  padding: .75rem .75rem .25rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .75rem;
  border-radius: 8px;
  color: var(--text2);
  font-size: .85rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
}
.nav-item:hover    { background: var(--surface); color: var(--text); }
.nav-item.active   { background: var(--accent-dim); color: var(--accent); }
.nav-item__icon    { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.nav-item.active .nav-item__icon { opacity: 1; }
.nav-item__badge   {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  padding: .1rem .35rem;
  border-radius: 10px;
}

.sidebar__footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
}
.sidebar__user {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem;
  border-radius: var(--radius);
  transition: var(--transition);
}
.sidebar__user:hover { background: var(--surface); }
.sidebar__avatar {
  width: 34px; height: 34px;
  background: var(--blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-role { font-size: .68rem; color: var(--text3); }

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

.topbar {
  height: var(--header-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 50;
}
.topbar__left { display: flex; align-items: center; gap: 1rem; }
.topbar__title { font-family: var(--font-d); font-size: 1rem; font-weight: 600; }
.topbar__breadcrumb { font-size: .8rem; color: var(--text3); }
.topbar__right { display: flex; align-items: center; gap: .75rem; }

.topbar__notif {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer;
  transition: var(--transition);
}
.topbar__notif:hover { background: var(--surface2); }
.topbar__notif-dot {
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  position: absolute; top: 6px; right: 6px;
  border: 2px solid var(--bg2);
}

.page { padding: 1.75rem; flex: 1; }
.page__header { margin-bottom: 1.75rem; }
.page__title { font-size: 1.4rem; }
.page__subtitle { color: var(--text2); font-size: .85rem; margin-top: .25rem; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card__header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card__title { font-family: var(--font-d); font-size: .95rem; font-weight: 600; }
.card__body  { padding: 1.25rem; }

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.stat-card__icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .75rem;
  font-size: 1.1rem;
}
.stat-card__value { font-family: var(--font-d); font-size: 1.75rem; font-weight: 800; }
.stat-card__label { font-size: .75rem; color: var(--text2); margin-top: .2rem; }
.stat-card__change { font-size: .72rem; margin-top: .4rem; }
.stat-card__change.up   { color: var(--green); }
.stat-card__change.down { color: var(--red); }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; }
.table th {
  font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text3);
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface2); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  font-size: .68rem; font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 20px;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge--active, .badge--success, .badge--present  { background: var(--green-dim);  color: var(--green); }
.badge--pending, .badge--warning, .badge--late     { background: var(--accent-dim); color: var(--accent); }
.badge--rejected,.badge--danger,  .badge--absent   { background: var(--red-dim);    color: var(--red); }
.badge--suspended,.badge--info                     { background: var(--blue-dim);   color: var(--blue); }
.badge--expired                                    { background: var(--purple-dim); color: var(--purple); }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group       { margin-bottom: 1rem; }
.form-label       { display: block; font-size: .8rem; font-weight: 500; margin-bottom: .35rem; color: var(--text2); }
.form-control     {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: .6rem .85rem;
  color: var(--text);
  font-size: .875rem;
  transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.form-control::placeholder { color: var(--text3); }
textarea.form-control { min-height: 90px; resize: vertical; }
select.form-control { cursor: pointer; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  font-size: .85rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary   { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent2); color: #000; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--surface); }
.btn-danger    { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,.25); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-success   { background: var(--green-dim); color: var(--green); border: 1px solid rgba(16,185,129,.25); }
.btn-success:hover { background: var(--green); color: #fff; }
.btn-sm { padding: .35rem .75rem; font-size: .77rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: .95rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .875rem;
  font-weight: 500;
}
.alert__icon { font-size: 1rem; flex-shrink: 0; }
.alert--success { background: var(--green-dim);  border: 1px solid rgba(16,185,129,.2);  color: #34d399; }
.alert--error   { background: var(--red-dim);    border: 1px solid rgba(239,68,68,.2);   color: #f87171; }
.alert--warning { background: var(--accent-dim); border: 1px solid rgba(245,158,11,.2);  color: var(--accent); }
.alert--info    { background: var(--blue-dim);   border: 1px solid rgba(59,130,246,.2);  color: #60a5fa; }

/* ── Progress bars ───────────────────────────────────────────── */
.progress       { background: var(--bg); border-radius: 20px; height: 6px; overflow: hidden; }
.progress__bar  { height: 100%; border-radius: 20px; transition: width .6s ease; }
.progress--green .progress__bar { background: var(--green); }
.progress--amber .progress__bar { background: var(--accent); }
.progress--red   .progress__bar { background: var(--red); }
.progress--blue  .progress__bar { background: var(--blue); }

/* ── Subscription status bar ─────────────────────────────────── */
.sub-status-bar {
  padding: .5rem 1.5rem;
  font-size: .78rem;
  display: flex; align-items: center; gap: .5rem;
  font-weight: 500;
}
.sub-status-bar.warning { background: rgba(245,158,11,.12); color: var(--accent); border-bottom: 1px solid rgba(245,158,11,.2); }
.sub-status-bar.danger  { background: var(--red-dim);        color: var(--red);    border-bottom: 1px solid rgba(239,68,68,.2); }

/* ── Charts placeholder ──────────────────────────────────────── */
.chart-wrap { position: relative; min-height: 220px; }

/* ── Misc ────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap     { display: flex; align-items: center; gap: .75rem; }
.text-muted   { color: var(--text2); font-size: .82rem; }
.text-small   { font-size: .78rem; }
.text-center  { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: .5rem; }
.w-full { width: 100%; }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--blue);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.avatar.lg { width: 60px; height: 60px; font-size: 1.2rem; }
.avatar.xl { width: 80px; height: 80px; font-size: 1.5rem; }

.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ── Auth pages ──────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}
.auth-left {
  flex: 1;
  background: linear-gradient(135deg, #0f2447 0%, #1a3a6b 50%, #0d1f3c 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.auth-left__logo {
  font-family: var(--font-d);
  font-size: 2.5rem; font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
  z-index: 1;
}
.auth-left__logo span { color: var(--accent); }
.auth-left__tagline { color: rgba(255,255,255,.6); font-size: 1rem; z-index: 1; text-align: center; max-width: 280px; }
.auth-left__features { margin-top: 2.5rem; z-index: 1; width: 100%; max-width: 320px; }
.auth-feature {
  display: flex; align-items: flex-start; gap: .75rem;
  margin-bottom: 1.25rem; color: rgba(255,255,255,.8); font-size: .875rem;
}
.auth-feature__icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(245,158,11,.2);
  border: 1px solid rgba(245,158,11,.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: .9rem; flex-shrink: 0;
}

.auth-right {
  width: 480px;
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem;
}
.auth-box {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}
.auth-box__title { font-size: 1.3rem; margin-bottom: .35rem; }
.auth-box__sub   { color: var(--text2); font-size: .85rem; margin-bottom: 1.75rem; }

/* ── Install wizard ──────────────────────────────────────────── */
.install-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.install-box  { width: 100%; max-width: 600px; }
.install-step { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.5rem; }
.install-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
}
.install-step-num.active { background: var(--accent); border-color: var(--accent); color: #000; }
.install-step-num.done   { background: var(--green);  border-color: var(--green);  color: #fff; }
.install-divider { flex: 1; height: 1px; background: var(--border); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
