:root {
  --bg: #0b1220;
  --bg2: #121c2f;
  --card: #16233a;
  --line: #2a3b5a;
  --text: #e8eef8;
  --muted: #9bb0d0;
  --blue: #1aa7ff;
  --blue2: #0077cc;
  --green: #2ecc71;
  --amber: #f0b429;
  --red: #ff5c5c;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: radial-gradient(1200px 600px at 10% -10%, #16325a 0%, var(--bg) 55%); color: var(--text); min-height: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; background: rgba(8, 14, 26, 0.92); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-logo { width: 56px; height: 56px; object-fit: contain; }
.brand-text { font-weight: 700; letter-spacing: 0.02em; font-size: 1.05rem; }
.nav { display: flex; flex-wrap: wrap; gap: 8px; }
.nav a {
  color: var(--muted); padding: 8px 12px; border-radius: 999px; border: 1px solid transparent;
}
.nav a.active, .nav a:hover {
  color: var(--text); background: var(--card); border-color: var(--line); text-decoration: none;
}

.wrap { width: min(1100px, calc(100% - 24px)); margin: 18px auto 40px; }
.footer { text-align: center; color: var(--muted); padding: 24px 12px 40px; font-size: 0.9rem; }

.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.flash-success { background: rgba(46, 204, 113, 0.12); border-color: rgba(46, 204, 113, 0.4); }
.flash-error { background: rgba(255, 92, 92, 0.12); border-color: rgba(255, 92, 92, 0.4); }
.flash-info { background: rgba(26, 167, 255, 0.12); border-color: rgba(26, 167, 255, 0.4); }

.hero {
  display: grid; gap: 8px; margin-bottom: 18px;
}
.hero h1 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); }
.hero p { margin: 0; color: var(--muted); }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px;
}
.toolbar .spacer { flex: 1; }
.search {
  flex: 1 1 220px; min-width: 180px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 11px 12px; font-size: 1rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 11px 14px; font-weight: 650; cursor: pointer;
  background: linear-gradient(180deg, var(--blue), var(--blue2)); color: white; text-decoration: none;
  font-size: 0.95rem;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn-secondary { background: var(--card); border: 1px solid var(--line); color: var(--text); }
.btn-danger { background: linear-gradient(180deg, #ff7070, #d93838); }
.btn-amber { background: linear-gradient(180deg, #f6c65b, #d89a12); color: #1a1200; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 10px; font-size: 0.85rem; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent), var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px;
}
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 800px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .brand-logo { width: 48px; height: 48px; }
}

.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (max-width: 700px) { .stat-row { grid-template-columns: 1fr; } }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat .label { color: var(--muted); font-size: 0.85rem; }
.stat .value { font-size: 1.25rem; font-weight: 700; margin-top: 4px; }

.student-list { display: grid; gap: 10px; }
.student-row {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
  padding: 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line);
}
.student-row:hover { border-color: var(--blue); }
.student-row h2 { margin: 0 0 4px; font-size: 1.05rem; }
.meta { color: var(--muted); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 8px 12px; }
.money-good { color: var(--green); }
.money-warn { color: var(--amber); }
.money-bad { color: var(--red); }

.badge {
  display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
  border: 1px solid;
}
.badge-active { color: #9dffc0; border-color: rgba(46,204,113,.45); background: rgba(46,204,113,.12); }
.badge-suspended { color: #ffe09a; border-color: rgba(240,180,41,.45); background: rgba(240,180,41,.12); }
.badge-completed { color: #9fd6ff; border-color: rgba(26,167,255,.45); background: rgba(26,167,255,.12); }
.badge-inactive { color: #c9d3e4; border-color: rgba(155,176,208,.35); background: rgba(155,176,208,.1); }

label { display: block; margin: 0 0 6px; color: var(--muted); font-size: 0.88rem; }
input, select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 11px 12px; font-size: 1rem; margin-bottom: 12px;
}
textarea { min-height: 110px; resize: vertical; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.section-title { margin: 22px 0 10px; font-size: 1.1rem; }
.help { color: var(--muted); font-size: 0.88rem; margin: -4px 0 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 0.82rem; font-weight: 650; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); }
.login-card .brand { justify-content: center; margin-bottom: 18px; }
.login-card .brand-logo { width: 96px; height: 96px; }
.muted { color: var(--muted); }
.danger-box {
  border: 1px solid rgba(240,180,41,.4); background: rgba(240,180,41,.08);
  border-radius: 12px; padding: 12px; margin-top: 8px;
}
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline-form > div { flex: 1 1 120px; }
.inline-form input, .inline-form select { margin-bottom: 0; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
