/* ============================================================
   SaaS SMS — Dark Theme (PakEducate-inspired)
   No external CDN. CSP compliant.
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
  /* Brand */
  --gold:             #d4a832;
  --gold-dark:        #b9890d;
  --gold-dim:         rgba(212,168,50,.12);
  --gold-dim-hover:   rgba(212,168,50,.20);
  --navy:             #0f1b3d;

  /* Semantic colours */
  --color-primary:       #d4a832;
  --color-primary-dark:  #b9890d;
  --color-success:       #22c55e;
  --color-warning:       #f59e0b;
  --color-danger:        #ef4444;
  --color-info:          #06b6d4;

  /* Backgrounds */
  --color-bg:            #0d1117;
  --color-surface:       #161b22;
  --color-surface-2:     #21262d;
  --color-border:        #30363d;
  --color-border-light:  #21262d;

  /* Text */
  --color-text:          #e6edf3;
  --color-text-muted:    #8b949e;
  --color-text-light:    #484f58;

  /* Sidebar */
  --sidebar-width:       256px;
  --topbar-height:       56px;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.4);
  --shadow-md:  0 4px 12px rgba(0,0,0,.5);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.6);
  --shadow-xl:  0 20px 50px rgba(0,0,0,.7);

  --transition: 200ms ease;
  --font-stack: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-stack);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
img { max-width: 100%; height: auto; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}
button { cursor: pointer; }
h1,h2,h3,h4,h5 { font-weight: 600; line-height: 1.3; }

/* ---- App Layout ---- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.brand-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}
.brand-icon {
  width: 38px; height: 38px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700;
}
.brand-name  { display: block; font-weight: 700; font-size: .95rem; color: var(--color-text); }
.brand-sub   { display: block; font-size: .72rem; color: var(--color-text-muted); }
.sidebar-toggle-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: .4rem;
}
.sidebar-toggle-btn span {
  display: block; width: 20px; height: 2px;
  background: var(--color-text-muted);
  border-radius: 2px;
}

.sidebar-nav { flex: 1; padding: .75rem 0; overflow-y: auto; }
.nav-group   { margin-bottom: .5rem; }
.nav-group-label {
  display: block;
  padding: .35rem 1.25rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--color-text-light);
}
.nav-list    { padding: 0 .75rem; }
.nav-item    { border-radius: var(--radius-sm); }
.nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: .875rem;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--color-surface-2); color: var(--color-text); text-decoration: none; }
.nav-item.active .nav-link {
  background: var(--gold-dim);
  color: var(--gold);
  font-weight: 600;
}
.nav-icon {
  width: 18px; height: 18px;
  background: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  flex-shrink: 0;
}
.sidebar-footer {
  padding: .75rem;
  border-top: 1px solid var(--color-border);
}
.sidebar-logout {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: .875rem;
  transition: background var(--transition), color var(--transition);
}
.sidebar-logout:hover { background: rgba(239,68,68,.12); color: #f87171; text-decoration: none; }

/* ---- Main Area ---- */
.main-area {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 1rem;
}
.topbar-left  { display: flex; align-items: center; gap: 1rem; }
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.breadcrumb   { font-size: .9rem; color: var(--color-text-muted); }
.sidebar-overlay-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none; border: none;
  padding: .4rem;
}
.sidebar-overlay-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--color-text-muted); border-radius: 2px;
}

.lang-form  { display: flex; }
.lang-select {
  padding: .35rem .6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-size: .8rem;
  cursor: pointer;
}

.topbar-btn {
  position: relative;
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem .7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.topbar-btn:hover { background: var(--color-bg); }

.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--color-danger);
  color: #fff; font-size: .65rem; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  min-width: 260px;
  z-index: 200;
  display: none;
}
.topbar-btn:focus .dropdown-panel,
.topbar-btn.open   .dropdown-panel { display: block; }

.panel-header {
  padding: .75rem 1rem;
  font-weight: 600;
  font-size: .85rem;
  border-bottom: 1px solid var(--color-border);
}
.notif-list { padding: .5rem 0; }
.notif-empty, .notif-list li {
  padding: .6rem 1rem; font-size: .85rem; color: var(--color-text-muted);
}
.panel-user-info {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
.panel-user-info strong { display: block; font-size: .9rem; }
.panel-user-info small  { color: var(--color-text-muted); font-size: .8rem; }
.user-panel ul li a {
  display: block; padding: .6rem 1rem; font-size: .875rem;
  color: var(--color-text);
  transition: background var(--transition);
}
.user-panel ul li a:hover { background: var(--color-bg); text-decoration: none; }

.avatar-circle {
  width: 34px; height: 34px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem; font-weight: 700;
}
.user-name { font-size: .875rem; font-weight: 500; }

/* ---- Page Content ---- */
.page-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  width: 100%;
}

/* ---- Page Footer ---- */
.page-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: .75rem 1.5rem;
  font-size: .8rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* ---- Alerts ---- */
.alert {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: .875rem;
  border-left: 4px solid transparent;
}
.alert-success { background: rgba(34,197,94,.1);  border-color: var(--color-success); color: #4ade80; }
.alert-error   { background: rgba(239,68,68,.1);  border-color: var(--color-danger);  color: #f87171; }
.alert-warning { background: rgba(245,158,11,.1); border-color: var(--color-warning); color: #fbbf24; }
.alert-info    { background: rgba(6,182,212,.1);  border-color: var(--color-info);    color: #22d3ee; }
.alert-close {
  margin-left: auto;
  background: none; border: none;
  font-size: 1.1rem; cursor: pointer; opacity: .6;
}
.alert-close:hover { opacity: 1; }

/* ---- Page Header ---- */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.page-title { font-size: 1.4rem; font-weight: 700; }
.page-date  { font-size: .85rem; color: var(--color-text-muted); }

/* ---- Cards ---- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
  gap: .5rem;
}
.card-header h3 { font-size: 1rem; font-weight: 600; }
.form-card { padding: 1.5rem; }

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-blue::before   { background: #3b82f6; }
.stat-green::before  { background: #22c55e; }
.stat-indigo::before { background: var(--color-primary); }
.stat-emerald::before{ background: #10b981; }
.stat-amber::before  { background: var(--color-warning); }
.stat-purple::before { background: #a855f7; }
.stat-red::before    { background: var(--color-danger); }

.stat-body  { display: flex; flex-direction: column; gap: .2rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--color-text-muted); }
.stat-link  { font-size: .8rem; color: var(--color-primary); margin-top: auto; }
.stat-link:hover { text-decoration: underline; }

/* ---- Charts ---- */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.chart-card  { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.chart-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--color-border); }
.chart-header h3 { font-size: 1rem; font-weight: 600; }
.chart-body  { padding: 1rem; display: flex; align-items: center; justify-content: center; }
canvas { display: block; max-width: 100%; }

/* ---- Quick Actions ---- */
.section-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.quick-actions-section { margin-bottom: 1.5rem; }
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}
.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-text);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.quick-action-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
  text-decoration: none;
}
.qa-icon { font-size: 1.5rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary   { background: var(--gold); color: #0f1b3d; border-color: var(--gold); font-weight: 600; }
.btn-primary:hover { background: var(--gold-dark); border-color: var(--gold-dark); text-decoration: none; color: #0f1b3d; }
.btn-outline   { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-outline:hover { background: var(--gold-dim); text-decoration: none; color: var(--gold); }
.btn-ghost     { background: transparent; color: var(--color-text-muted); border-color: var(--color-border); }
.btn-ghost:hover { background: var(--color-surface-2); text-decoration: none; }
.btn-block     { width: 100%; }
.btn-sm  { padding: .4rem .8rem; font-size: .8rem; }
.btn-xs  { padding: .25rem .6rem; font-size: .75rem; }

/* ---- Forms ---- */
.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .25rem;
}
.form-group { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; flex: 1; }
.col-3  { flex: 0 0 calc(25% - .75rem); min-width: 120px; }
.col-4  { flex: 0 0 calc(33.33% - .75rem); min-width: 140px; }
.col-6  { flex: 0 0 calc(50% - .5rem); min-width: 180px; }
.form-label { font-size: .85rem; font-weight: 500; color: var(--color-text); }
.form-control {
  padding: .55rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,168,50,.15);
}
.form-control-sm { padding: .35rem .55rem; font-size: .8rem; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-section-title {
  font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 1.25rem 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--color-border);
}
.form-actions {
  display: flex; gap: .75rem; align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}
.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-suffix {
  padding: 0 .75rem;
  border: 1px solid var(--color-border); border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--color-bg);
  cursor: pointer;
  color: var(--color-text-muted);
}
.input-suffix:hover { background: var(--color-border); }

/* ---- Tables ---- */
.table-responsive { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: .875rem;
}
.data-table th {
  background: var(--color-surface-2);
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: .8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.data-table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--color-surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.empty-state { text-align: center; color: var(--color-text-muted); padding: 2.5rem 1rem !important; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-green  { background: rgba(34,197,94,.15);   color: #4ade80; }
.badge-red    { background: rgba(239,68,68,.15);   color: #f87171; }
.badge-amber  { background: rgba(245,158,11,.15);  color: #fbbf24; }
.badge-orange { background: rgba(249,115,22,.15);  color: #fb923c; }
.badge-blue   { background: rgba(59,130,246,.15);  color: #60a5fa; }
.badge-indigo { background: rgba(212,168,50,.15);  color: var(--gold); }
.badge-gray   { background: rgba(139,148,158,.15); color: var(--color-text-muted); }
.badge-purple { background: rgba(168,85,247,.15);  color: #c084fc; }

/* ---- Flex Cell ---- */
.flex-cell {
  display: flex; align-items: center; gap: .65rem;
}
.flex-cell strong { display: block; font-size: .875rem; }
.flex-cell small  { display: block; font-size: .78rem; color: var(--color-text-muted); }
.avatar-sm {
  width: 32px; height: 32px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.actions-cell { white-space: nowrap; }

/* ---- Filter Bar ---- */
.filter-bar { padding: .75rem; margin-bottom: 1rem; }
.filter-form { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.filter-form .form-control { flex: 1; min-width: 140px; }
.inline-filter { display: flex; gap: .5rem; }

/* ---- Pagination ---- */
.pagination {
  display: flex; gap: .3rem;
  padding: 1rem 1.25rem;
  justify-content: center;
  border-top: 1px solid var(--color-border);
}
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  font-size: .8rem; font-weight: 500;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: var(--color-surface);
  text-decoration: none;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--gold); color: var(--gold); text-decoration: none; }
.page-btn.active { background: var(--gold); color: #0f1b3d; border-color: var(--gold); font-weight: 600; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.modal-header h3 { font-size: 1.05rem; font-weight: 600; }
.modal-close {
  background: none; border: none; font-size: 1.3rem;
  cursor: pointer; color: var(--color-text-muted);
  line-height: 1;
}
.modal-close:hover { color: var(--color-danger); }
.modal-body { padding: 1.5rem; }

/* ---- Two Column Layout ---- */
.two-col-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }
.col-main { min-width: 0; }
.col-side  { min-width: 0; }

/* ---- Info List ---- */
.info-list {
  display: grid; grid-template-columns: auto 1fr;
  gap: .5rem 1rem;
  padding: 1rem;
  font-size: .875rem;
}
.info-list dt { color: var(--color-text-muted); font-weight: 500; }
.info-list dd { color: var(--color-text); }

/* ---- Modules Grid ---- */
.modules-grid { display: flex; flex-direction: column; gap: 0; }
.module-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
}
.module-card:last-child { border-bottom: none; }
.module-card.enabled { background: rgba(34,197,94,.06); }
.module-info { display: flex; align-items: center; gap: .75rem; }
.module-info strong { display: block; font-size: .875rem; font-weight: 600; }
.module-info small  { display: block; font-size: .78rem; color: var(--color-text-muted); }

/* ---- Toggle Switch ---- */
.toggle-switch {
  position: relative; display: inline-flex; width: 44px; height: 24px;
  cursor: pointer; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--color-border);
  border-radius: 999px;
  transition: background var(--transition);
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}
input:checked + .toggle-slider { background: var(--color-success); }
input:checked + .toggle-slider::after { transform: translateX(20px); }

/* ---- Attendance ---- */
.att-stats-row {
  display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.att-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: .75rem 1.25rem;
  font-size: .875rem; font-weight: 500;
  display: flex; align-items: center; gap: .5rem;
}
.att-stat span { font-size: 1.4rem; font-weight: 700; }
.att-present  { border-left: 4px solid var(--color-success); }
.att-absent   { border-left: 4px solid var(--color-danger); }
.att-late     { border-left: 4px solid var(--color-warning); }

.attendance-table td { text-align: center; }
.attendance-table td:first-child,
.attendance-table td:nth-child(2),
.attendance-table td:nth-child(3),
.attendance-table td:last-child { text-align: left; }
.att-radio {
  width: 18px; height: 18px; cursor: pointer; accent-color: var(--color-primary);
}

.bulk-actions { display: flex; gap: .5rem; }

/* ---- Progress Bar ---- */
.progress-bar-wrap {
  display: flex; align-items: center; gap: .5rem;
  background: #f1f5f9;
  border-radius: 999px;
  height: 8px;
  position: relative;
  min-width: 100px;
}
.progress-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  transition: width .4s ease;
}
.progress-bar-wrap span { font-size: .75rem; color: var(--color-text-muted); min-width: 30px; }

/* ---- Invoice ---- */
.invoice-container { max-width: 700px; margin: 0 auto; padding: 2rem; }
.invoice-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.invoice-brand h2 { font-size: 1.3rem; color: var(--color-primary); }
.invoice-brand p  { color: var(--color-text-muted); font-size: .85rem; }
.invoice-meta p   { font-size: .85rem; color: var(--color-text-muted); margin-bottom: .25rem; }
.invoice-student  { background: var(--color-bg); padding: .75rem 1rem; border-radius: var(--radius-md); margin-bottom: 1.5rem; }
.invoice-student p{ font-size: .875rem; }
.invoice-table {
  width: 100%; border-collapse: collapse; font-size: .875rem; margin-bottom: 1rem;
}
.invoice-table th { background: #f8fafc; padding: .6rem .8rem; text-align: left; font-weight: 600; border-bottom: 2px solid var(--color-border); }
.invoice-table td { padding: .6rem .8rem; border-bottom: 1px solid var(--color-border); }
.invoice-table tfoot td { border-top: 2px solid var(--color-border); border-bottom: none; }
.total-row td   { font-size: 1rem; }
.balance-row td { font-size: 1.1rem; color: var(--color-primary); }
.text-right { text-align: right !important; }
.text-green { color: var(--color-success) !important; }
.text-red   { color: var(--color-danger)  !important; }
.text-amber { color: var(--color-warning) !important; }
.invoice-status { margin: 1rem 0; font-size: .9rem; }
.payment-history { margin-top: 1.5rem; }
.payment-history h4 { margin-bottom: .75rem; font-size: .95rem; }

/* ---- Fee Item Row ---- */
.fee-item-row {
  display: flex; gap: .5rem; align-items: center;
  margin-bottom: .5rem; flex-wrap: wrap;
}
.fee-item-row .form-control { flex: 1; min-width: 120px; }

/* ---- Autocomplete ---- */
.autocomplete-results {
  position: absolute; z-index: 300;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 200px; overflow-y: auto;
  width: 100%;
}
.form-group { position: relative; }
.ac-item {
  padding: .6rem 1rem; font-size: .875rem; cursor: pointer;
  transition: background var(--transition);
}
.ac-item:hover { background: var(--color-bg); }
.ac-empty { color: var(--color-text-muted); cursor: default; }

/* ---- Auth Pages — Split Layout ---- */
.auth-body {
  min-height: 100vh;
  display: flex;
  background: #fff;
}
.auth-left {
  display: none;
  flex: 1;
  background: var(--navy);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(212,168,50,.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(212,168,50,.08) 0%, transparent 50%),
    linear-gradient(135deg, #0f1b3d 0%, #1a2d5a 100%);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
@media(min-width:768px){ .auth-left { display: flex; } }
.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='%23d4a832' fill-opacity='0.04'%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");
  opacity: .5;
}
.auth-left-content { position: relative; z-index: 1; }
.auth-brand-mark {
  display: inline-flex; align-items: baseline; gap: 0;
  font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em;
  margin-bottom: 2.5rem;
}
.auth-brand-mark .part1 { color: #fff; }
.auth-brand-mark .part2 { color: var(--gold); }
.auth-left h2 {
  font-size: 2rem; font-weight: 800; color: #fff;
  line-height: 1.25; margin-bottom: 1rem;
}
.auth-left h2 em { color: var(--gold); font-style: normal; }
.auth-left p { color: rgba(255,255,255,.6); font-size: .95rem; margin-bottom: 2rem; line-height: 1.7; }
.auth-features { display: flex; flex-direction: column; gap: .75rem; }
.auth-feature {
  display: flex; align-items: center; gap: .75rem;
  color: rgba(255,255,255,.75); font-size: .875rem;
}
.auth-feature::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}
.auth-right {
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.5rem;
  background: #fff;
}
@media(min-width:768px){ .auth-right { width: 460px; flex-shrink: 0; } }
.auth-card {
  width: 100%; max-width: 380px;
}
.auth-card-title    { font-size: 1.5rem; font-weight: 700; color: #0f172a; margin-bottom: .35rem; }
.auth-card-subtitle { color: #64748b; font-size: .9rem; margin-bottom: 2rem; }
.auth-form     { display: flex; flex-direction: column; gap: 1rem; }
.auth-form .form-label { color: #374151; }
.auth-form .form-control {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #111827;
  border-radius: var(--radius-md);
  padding: .65rem .9rem;
}
.auth-form .form-control:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,168,50,.15); background: #fff; }
.auth-form .input-suffix { background: #f3f4f6; border-color: #e5e7eb; border-left: none; color: #6b7280; }
.auth-form .btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 600; padding: .75rem; font-size: .95rem; border-radius: var(--radius-md); }
.auth-form .btn-primary:hover { background: #162447; border-color: #162447; color: #fff; }
.auth-footer   { text-align: center; margin-top: 1.5rem; font-size: .8rem; color: #94a3b8; }
/* legacy aliases */
.auth-bg { display: contents; }
.auth-logo { display: none; }
.auth-title { font-size: 1.5rem; font-weight: 700; color: #0f172a; }
.auth-subtitle { color: #64748b; font-size: .9rem; }

/* ---- Error Pages ---- */
.error-body { background: var(--color-bg); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.error-page { text-align: center; }
.error-code { font-size: 6rem; font-weight: 900; color: var(--gold); opacity: .2; }
.error-msg  { font-size: 1.2rem; margin-bottom: 1.5rem; color: var(--color-text-muted); }

/* Super admin — same dark sidebar, just a different accent badge */

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .charts-row      { grid-template-columns: 1fr; }
  .two-col-layout  { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .main-area    { margin-left: 0; }
  .sidebar-overlay-toggle { display: flex; }
  .stats-grid   { grid-template-columns: repeat(2, 1fr); }
  .form-row     { flex-direction: column; }
  .col-3, .col-4, .col-6 { flex: 1 1 100%; }
  .page-content { padding: 1rem; }
  .two-col-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar     { padding: 0 1rem; }
  .user-name  { display: none; }
}

/* ---- Brand Avatar ---- */
.brand-icon {
  width: 34px; height: 34px;
  background: var(--gold);
  color: var(--navy);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 800;
  flex-shrink: 0;
}
.brand-name  { display: block; font-weight: 800; font-size: .9rem; color: var(--color-text); letter-spacing: -.01em; }
.brand-sub   { display: block; font-size: .72rem; color: var(--color-text-muted); }
.brand-plan  {
  display: inline-block;
  font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); margin-top: 3px;
}

/* ---- Avatar ---- */
.avatar-circle {
  width: 32px; height: 32px;
  background: var(--navy);
  color: var(--gold);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800;
  flex-shrink: 0;
}

/* ---- Stat accent bars ---- */
.stat-card::before { background: var(--gold); }
.stat-blue::before   { background: #3b82f6; }
.stat-green::before  { background: #22c55e; }
.stat-indigo::before { background: var(--gold); }
.stat-emerald::before{ background: #10b981; }
.stat-amber::before  { background: var(--gold); }
.stat-purple::before { background: #a855f7; }
.stat-red::before    { background: var(--color-danger); }

/* ---- Print ---- */
@media print {
  .sidebar, .topbar, .page-footer,
  .btn, .filter-bar, .pagination,
  .modal-overlay { display: none !important; }
  .main-area { margin-left: 0; }
  .invoice-container { box-shadow: none; border: none; padding: 0; max-width: 100%; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ═══════════════════════════════════════════════════════════
   DARK SIDEBAR OVERRIDES
   ═══════════════════════════════════════════════════════════ */
.sidebar {
  background: var(--navy);
  border-right-color: rgba(255,255,255,.06);
}
.sidebar-brand {
  border-bottom-color: rgba(255,255,255,.06);
  padding: 1rem 1rem;
}
.nav-group-label {
  color: rgba(255,255,255,.3);
  font-size: .67rem;
}
.nav-link {
  color: rgba(255,255,255,.55);
  border-radius: 10px;
  gap: .65rem;
  padding: .55rem .7rem;
  font-size: .84rem;
}
.nav-link:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);
}
.nav-item.active .nav-link {
  background: var(--gold-dim);
  color: var(--gold);
  font-weight: 600;
}
.nav-icon {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex-shrink: 0;
}
.nav-icon svg { display: block; }
.sidebar-footer {
  border-top-color: rgba(255,255,255,.06);
  padding: .75rem .75rem .9rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.sidebar-user-card {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .65rem;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
}
.sidebar-user-avatar {
  width: 30px; height: 30px;
  background: var(--gold);
  color: var(--navy);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800; flex-shrink: 0;
}
.sidebar-user-info strong {
  display: block; font-size: .8rem; font-weight: 600;
  color: rgba(255,255,255,.9); line-height: 1.3;
}
.sidebar-user-info small {
  display: block; font-size: .7rem;
  color: rgba(255,255,255,.35); text-transform: capitalize;
}
.sidebar-logout {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .65rem;
  border-radius: 10px;
  color: rgba(255,255,255,.4);
  font-size: .84rem;
}

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ═══════════════════════════════════════════════════════════
   DARK TOPBAR OVERRIDES
   ═══════════════════════════════════════════════════════════ */
.topbar {
  background: var(--color-surface);
  border-bottom-color: var(--color-border);
}
.topbar-hamburger {
  display: none;
  background: none; border: none;
  color: var(--color-text-muted);
  padding: .4rem; cursor: pointer;
  border-radius: 6px;
}
.topbar-hamburger:hover { background: var(--color-surface-2); color: var(--color-text); }
.topbar-school { display: flex; align-items: baseline; gap: .6rem; }
.topbar-school-name {
  font-weight: 600; font-size: .9rem; color: var(--color-text);
}
.topbar-role-badge {
  font-size: .7rem; font-weight: 600; padding: .15rem .5rem;
  border-radius: 999px;
  background: var(--gold-dim); color: var(--gold);
  text-transform: capitalize; letter-spacing: .02em;
}
.topbar-icon-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: background var(--transition), color var(--transition);
}
.topbar-icon-btn:hover { background: var(--color-surface-2); color: var(--color-text); }
.topbar-icon-btn.open .dropdown-panel { display: block; }
.lang-select {
  background: var(--color-surface-2);
  border-color: var(--color-border);
  color: var(--color-text);
  font-size: .78rem;
  border-radius: 6px;
  padding: .3rem .5rem;
}
.user-panel ul li a:hover { background: var(--color-surface-2); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0 !important; }
  .topbar-hamburger { display: flex; }
  .charts-row { grid-template-columns: 1fr; }
  .two-col-layout { grid-template-columns: 1fr; }
  .stats-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .auth-left { display: none !important; }
  .auth-right { width: 100% !important; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   DASHBOARD v2 — announcement, stat cards, quick actions, charts
   ───────────────────────────────────────────────────────────────────────────── */

/* Announcement Bar */
.announcement-bar {
  display: flex; align-items: center; gap: .5rem;
  background: linear-gradient(90deg, #0d1117 0%, #161b22 100%);
  border: 1px solid #30363d; border-radius: var(--radius-md);
  padding: .5rem 1rem; font-size: .8rem; color: var(--color-text-secondary);
  margin-bottom: 1.25rem;
}
.ann-label { font-weight: 700; color: var(--color-primary); text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; }
.ann-sep { color: #30363d; }
.ann-text { flex: 1; }
.ann-close { margin-left: auto; background: none; border: none; color: var(--color-text-secondary); cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 0 .25rem; }
.ann-close:hover { color: var(--color-text); }

/* Dash Header */
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.dash-greeting { display: flex; align-items: center; gap: 1rem; }
.dash-avatar { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, #06b6d4, #2563eb); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; color: #fff; flex-shrink: 0; }
.dash-greeting-title { font-size: 1.25rem; font-weight: 700; color: var(--color-text); margin: 0 0 .15rem; }
.dash-greeting-sub { font-size: .8rem; color: var(--color-text-secondary); margin: 0; }
.period-badge { display: inline-flex; align-items: center; gap: .35rem; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: .35rem .75rem; font-size: .8rem; color: var(--color-text-secondary); }
.dash-header-actions { display: flex; gap: .75rem; align-items: center; }

/* Stat Cards Grid */
.dash-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 1100px) { .dash-stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .dash-stats-grid { grid-template-columns: 1fr; } }

.dash-stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; }
.dash-stat-top { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: .6rem; }
.dash-stat-icon { width: 42px; height: 42px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ds-blue  { background: rgba(6,182,212,.12); color: #06b6d4; }
.ds-teal  { background: rgba(20,184,166,.12); color: #14b8a6; }
.ds-green { background: rgba(34,197,94,.12);  color: #22c55e; }
.ds-gold  { background: rgba(212,168,50,.12); color: #d4a832; }
.dash-stat-info { flex: 1; min-width: 0; }
.dash-stat-label { display: flex; align-items: center; gap: .25rem; font-size: .75rem; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem; }
.ds-hint { color: var(--color-text-secondary); opacity: .5; font-size: .7rem; }
.dash-stat-value { display: block; font-size: 1.6rem; font-weight: 700; color: var(--color-text); line-height: 1.15; }
.ds-pct { font-size: 1rem; font-weight: 500; color: var(--color-text-secondary); }
.dash-stat-sub { display: block; font-size: .72rem; color: var(--color-text-secondary); margin-top: .2rem; }
.dash-stat-trend { margin-top: .5rem; overflow: hidden; }

/* Section Label */
.dash-section-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-secondary); margin: 0 0 .75rem; }

/* Quick Actions */
.quick-actions-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.75rem; }
@media (max-width: 900px)  { .quick-actions-row { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px)  { .quick-actions-row { grid-template-columns: 1fr; } }

.qa-card { display: flex; align-items: center; gap: 1rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1rem 1.1rem; text-decoration: none; color: var(--color-text); transition: border-color .15s, background .15s; }
.qa-card:hover { border-color: var(--color-primary); background: var(--color-surface-2); color: var(--color-text); }
.qa-card strong { display: block; font-size: .88rem; font-weight: 600; }
.qa-card small { display: block; font-size: .75rem; color: var(--color-text-secondary); }
.qa-icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qa-cal   { background: rgba(6,182,212,.12); color: #06b6d4; }
.qa-doc   { background: rgba(168,85,247,.12); color: #a855f7; }
.qa-plus  { background: rgba(34,197,94,.12);  color: #22c55e; }
.qa-chart { background: rgba(212,168,50,.12); color: #d4a832; }
.qa-arrow { margin-left: auto; font-size: 1.2rem; color: var(--color-text-secondary); }

/* Charts Row */
.dash-charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.75rem; }
@media (max-width: 900px) { .dash-charts-row { grid-template-columns: 1fr; } }

.dash-chart-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; flex-direction: column; }
.dash-chart-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: .75rem; }
.dash-chart-header h3 { font-size: .9rem; font-weight: 600; color: var(--color-text); margin: 0 0 .2rem; }
.dash-chart-header small { font-size: .75rem; color: var(--color-text-secondary); }
.dash-chart-body { position: relative; flex: 1; min-height: 160px; }
.chart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 160px; color: var(--color-text-secondary); gap: .5rem; font-size: .85rem; }

.fee-total-badge { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: .2rem 0; }
.this-month { font-size: .72rem; color: var(--color-text-secondary); }
.fee-pct-badge { font-size: .7rem; font-weight: 700; padding: .15rem .45rem; border-radius: 999px; }
.fee-pct-badge.good { background: rgba(34,197,94,.15); color: #22c55e; }
.fee-pct-badge.warn { background: rgba(212,168,50,.15); color: #d4a832; }
.fee-pct-badge.bad  { background: rgba(239,68,68,.15);  color: #ef4444; }
.chart-legend { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; font-size: .75rem; color: var(--color-text-secondary); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.view-all-link { font-size: .78rem; color: var(--color-primary); text-decoration: none; white-space: nowrap; }
.view-all-link:hover { text-decoration: underline; }

/* Bottom Row */
.dash-bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .dash-bottom-row { grid-template-columns: 1fr; } }

.dash-panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.25rem; }
.dash-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.dash-panel-header h3 { font-size: .9rem; font-weight: 600; margin: 0; }

/* Activity list */
.activity-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; }
.activity-item { display: flex; align-items: flex-start; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--color-border); }
.activity-item:last-child { border-bottom: none; }
.activity-item.unread { background: rgba(6,182,212,.04); border-radius: var(--radius-sm); padding: .5rem; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); flex-shrink: 0; margin-top: .35rem; }
.activity-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.activity-desc { font-size: .82rem; color: var(--color-text); display: block; }
.activity-time { font-size: .72rem; color: var(--color-text-secondary); }
.activity-empty { font-size: .85rem; color: var(--color-text-secondary); padding: 1.5rem 0; text-align: center; list-style: none; }

/* Top Students */
.top-students-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .65rem; }
.top-student-item { display: flex; align-items: center; gap: .75rem; padding: .45rem 0; border-bottom: 1px solid var(--color-border); }
.top-student-item:last-child { border-bottom: none; }
.ts-rank { width: 22px; height: 22px; border-radius: 50%; background: var(--color-surface-2); display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; color: var(--color-text-secondary); flex-shrink: 0; }
.ts-rank-1 { background: #d4a832; color: #0d1117; }
.ts-rank-2 { background: #9ca3af; color: #0d1117; }
.ts-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #06b6d4, #2563eb); display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.ts-info { flex: 1; min-width: 0; }
.ts-info strong { display: block; font-size: .82rem; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-info small  { font-size: .72rem; color: var(--color-text-secondary); }
.ts-pct { font-size: .82rem; font-weight: 700; color: #22c55e; }

/* Sidebar upgrades */
.brand-plan { background: var(--color-primary); color: #fff; font-size: .6rem; font-weight: 700; padding: .1rem .4rem; border-radius: 999px; margin-left: .4rem; text-transform: uppercase; letter-spacing: .04em; }
.sidebar-footer { padding: .75rem 1rem 1rem; margin-top: auto; border-top: 1px solid var(--color-border); }
.sidebar-logout { display: flex; align-items: center; gap: .6rem; color: var(--color-text-secondary); text-decoration: none; font-size: .82rem; padding: .5rem .75rem; border-radius: var(--radius-sm); transition: background .15s, color .15s; }
.sidebar-logout:hover { background: rgba(239,68,68,.1); color: #ef4444; }

/* Form utilities */
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.form-actions { display: flex; gap: .75rem; align-items: center; padding-top: .75rem; margin-top: .75rem; border-top: 1px solid var(--color-border); }
.btn-xs { font-size: .72rem; padding: .2rem .6rem; }
.btn-success { background: #22c55e; color: #fff; border-color: #22c55e; }
.btn-success:hover { background: #16a34a; border-color: #16a34a; }
.btn-danger  { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-danger:hover  { background: #dc2626; border-color: #dc2626; }
.badge-secondary { background: rgba(156,163,175,.15); color: #9ca3af; }
.text-muted { color: var(--color-text-secondary) !important; }

