:root {
  --c1: #0f2fa8;
  --c2: #4338ca;
  --c3: #7c3aed;
  --c4: #a855f7;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --text: #f5f5ff;
  --text-dim: #c9c6f0;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
}

body {
  background: linear-gradient(-45deg, var(--c1), var(--c2), var(--c3), var(--c4));
  background-size: 400% 400%;
  animation: gradientFlow 16s ease infinite;
  min-height: 100vh;
}

@keyframes gradientFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* subtle floating orbs behind content */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}
body::before {
  width: 420px; height: 420px;
  background: #a855f7;
  top: -100px; left: -100px;
  animation: floatA 12s ease-in-out infinite;
}
body::after {
  width: 500px; height: 500px;
  background: #4338ca;
  bottom: -150px; right: -100px;
  animation: floatB 14s ease-in-out infinite;
}
@keyframes floatA {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(60px, 40px); }
}
@keyframes floatB {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-50px, -30px); }
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

/* ---------- Navbar ---------- */
.navbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}
.navbar .brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.3px;
}
.navbar .brand span { color: #d8b4fe; }
.navbar .nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 22px;
  font-size: 0.92rem;
  transition: color 0.2s;
}
.navbar .nav-links a:hover { color: #fff; }
.navbar .role-pill {
  background: rgba(255,255,255,0.12);
  border: 1px solid var(--glass-border);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  margin-left: 18px;
}

/* ---------- Glass card ---------- */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  animation: fadeUp 0.5s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.card + .card { margin-top: 20px; }

.grid {
  display: grid;
  gap: 20px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Stat tiles ---------- */
.stat-tile {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.2s, background 0.2s;
}
.stat-tile:hover { transform: translateY(-4px); background: rgba(255,255,255,0.12); }
.stat-tile .num { font-size: 2rem; font-weight: 700; }
.stat-tile .label { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }

/* ---------- Forms ---------- */
label { display: block; margin: 14px 0 6px; font-size: 0.88rem; color: var(--text-dim); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=tel], input[type=date], input[type=file], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border 0.2s, background 0.2s;
}
input:focus, select:focus, textarea:focus {
  border-color: #d8b4fe;
  background: rgba(255,255,255,0.14);
}
input::placeholder, textarea::placeholder { color: rgba(245,245,255,0.5); }
textarea { resize: vertical; min-height: 80px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; color: var(--text); }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, #7c3aed, #4338ca); color: #fff; box-shadow: 0 4px 18px rgba(124,58,237,0.45); }
.btn-ok { background: #16a34a; color: #fff; }
.btn-bad { background: #dc2626; color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--glass-border); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--glass-border); white-space: nowrap; }
th { color: var(--text-dim); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.5px; }
tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(255,255,255,0.06); }

.badge { padding: 4px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-pending { background: rgba(251,191,36,0.2); color: var(--warn); }
.badge-approved { background: rgba(52,211,153,0.2); color: var(--ok); }
.badge-rejected { background: rgba(248,113,113,0.2); color: var(--bad); }

.avatar-sm { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--glass-border); }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: rgba(248,113,113,0.15); border: 1px solid rgba(248,113,113,0.4); color: #fecaca; }
.alert-success { background: rgba(52,211,153,0.15); border: 1px solid rgba(52,211,153,0.4); color: #bbf7d0; }

/* ---------- Auth page ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.4rem; margin-bottom: 4px; }
.auth-card p.sub { color: var(--text-dim); margin-top: 0; margin-bottom: 20px; font-size: 0.88rem; }

/* ---------- Notification list ---------- */
.notif-item {
  border-left: 3px solid #a855f7;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  margin-bottom: 10px;
}
.notif-item.unread { border-left-color: #fbbf24; background: rgba(251,191,36,0.08); }
.notif-item .t { font-weight: 600; font-size: 0.9rem; }
.notif-item .m { color: var(--text-dim); font-size: 0.85rem; margin-top: 3px; }
.notif-item .d { color: rgba(255,255,255,0.4); font-size: 0.72rem; margin-top: 6px; }

h1, h2, h3 { margin-top: 0; }
.muted { color: var(--text-dim); }
.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* ---------- v2 course/registration UI ---------- */
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1000px) { .grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .grid-5 { grid-template-columns: 1fr 1fr; } }
.course-banner {
  margin: 16px 0 20px; padding: 15px 18px; border-radius: 12px;
  background: rgba(255,255,255,.08); border: 1px solid var(--glass-border); line-height: 1.7;
}
.schedule-card { margin-top: 24px; padding: 20px; border-radius: 14px; background: rgba(0,0,0,.12); border: 1px solid var(--glass-border); }
.schedule-table th, .schedule-table td { white-space: normal; }
.schedule-table td:first-child { font-weight: 700; width: 25%; }
.schedule-note { margin: 14px 0 0; line-height: 1.6; }
.next-course-card { border-color: rgba(52,211,153,.45); background: rgba(52,211,153,.08); margin-bottom: 20px; }
.inner-card { background: rgba(255,255,255,.06); padding: 20px; box-shadow: none; animation: none; }
.badge-cancelled { background: rgba(148,163,184,.2); color: #cbd5e1; }
.nav-links { flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 760px) { .navbar { padding: 14px 18px; align-items: flex-start; gap: 12px; flex-direction: column; } .navbar .nav-links { justify-content: flex-start; } .navbar .nav-links a { margin-left: 0; margin-right: 14px; } }
