/* ============================================
   Admin Panel Design System
   Coaching Institute LMS — indigo/violet identity
   ============================================ */

:root {
  --ink-900: #1E1B2E;
  --ink-600: #524C6B;
  --ink-400: #8B85A3;

  --indigo-900: #241653;
  --indigo-700: #3D2B8C;
  --indigo-600: #4F3AB8;
  --violet-500: #7C5CFC;
  --violet-100: #EFE9FF;

  --amber-500: #F5A623;
  --amber-100: #FFF4E0;

  --emerald-500: #16A87C;
  --emerald-100: #E1F7EE;

  --rose-500: #E24C6E;
  --rose-100: #FDEAF0;

  --sky-500: #2B9CE0;
  --sky-100: #E7F5FE;

  --bg: #F6F5FB;
  --surface: #FFFFFF;
  --border: #E7E4F3;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-card: 0 1px 2px rgba(36, 22, 83, 0.04), 0 6px 20px rgba(36, 22, 83, 0.06);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink-900);
  font-size: 14.5px;
  min-height: 100vh;
}

h1, h2, h3, h4, .brand-font {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}

a { text-decoration: none; }

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

.sidebar {
  width: 252px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--indigo-900) 0%, var(--indigo-700) 100%);
  color: #EDE9FA;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
}

.sidebar-brand {
  padding: 22px 22px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--amber-500);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800; color: var(--indigo-900); font-size: 16px;
}
.sidebar-brand .brand-text { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 16px; color: #fff; line-height: 1.1; }
.sidebar-brand .brand-sub { font-size: 11px; color: #B7ADE0; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.sidebar-section-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #8F80C7; margin: 16px 10px 6px;
}
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: #D9D3F2; font-size: 13.6px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav .nav-link i { width: 18px; text-align: center; font-size: 15px; opacity: 0.85; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--violet-500); color: #fff; box-shadow: 0 4px 14px rgba(124,92,252,0.35); }
.sidebar-nav .nav-badge {
  margin-left: auto; background: var(--amber-500); color: var(--indigo-900);
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
}

.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-foot .logout-link { color: #C9BFF0; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.sidebar-foot .logout-link:hover { color: #fff; }

.main {
  margin-left: 252px;
  flex: 1;
  min-width: 0;
}

.topbar {
  height: 66px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 18px; font-weight: 700; margin: 0; }
.topbar .role-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--violet-100); color: var(--indigo-700);
  padding: 5px 12px 5px 5px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
}
.topbar .role-pill .avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--violet-500);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}

.content { padding: 24px 26px 60px; }

/* ---------- Live pulse (signature element) ---------- */
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--rose-500);
  display: inline-block; position: relative; margin-right: 6px;
}
.live-dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--rose-500); opacity: 0.55;
  animation: livePulse 1.6s ease-out infinite;
}
@keyframes livePulse {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ---------- Cards & stats ---------- */
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-card); height: 100%;
}
.stat-card .stat-icon {
  width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 12px;
}
.stat-card .stat-value { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 26px; font-weight: 800; line-height: 1; }
.stat-card .stat-label { color: var(--ink-400); font-size: 12.5px; margin-top: 4px; }

.card-surface {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.card-surface .card-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-surface .card-head h3 { font-size: 15px; font-weight: 700; margin: 0; }
.card-surface .card-body-pad { padding: 18px 20px; }

/* ---------- Buttons ---------- */
.btn-brand { background: var(--indigo-700); border-color: var(--indigo-700); color: #fff; font-weight: 600; font-size: 13.5px; }
.btn-brand:hover { background: var(--indigo-900); border-color: var(--indigo-900); color: #fff; }
.btn-outline-brand { border-color: var(--indigo-700); color: var(--indigo-700); font-weight: 600; font-size: 13.5px; }
.btn-outline-brand:hover { background: var(--indigo-700); color: #fff; }
.btn-amber { background: var(--amber-500); border-color: var(--amber-500); color: #402A00; font-weight: 700; }
.btn-amber:hover { background: #E09410; color: #402A00; }

/* ---------- Tables ---------- */
.table-clean thead th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-400);
  border-bottom: 1px solid var(--border); font-weight: 700; padding: 10px 14px;
}
.table-clean tbody td { padding: 12px 14px; vertical-align: middle; border-bottom: 1px solid var(--border); font-size: 13.6px; }
.table-clean tbody tr:last-child td { border-bottom: none; }
.table-clean tbody tr:hover { background: #FBFAFF; }

/* ---------- Badges ---------- */
.badge-soft { font-weight: 600; font-size: 11.5px; padding: 4px 10px; border-radius: 999px; }
.badge-amber { background: var(--amber-100); color: #8A5A00; }
.badge-emerald { background: var(--emerald-100); color: #0C7A57; }
.badge-rose { background: var(--rose-100); color: #B8264A; }
.badge-sky { background: var(--sky-100); color: #1A6DA3; }
.badge-violet { background: var(--violet-100); color: var(--indigo-700); }
.badge-gray { background: #EFEEF7; color: var(--ink-600); }

/* ---------- Forms ---------- */
.form-label { font-size: 13px; font-weight: 600; color: var(--ink-600); margin-bottom: 5px; }
.form-control, .form-select {
  border-radius: var(--radius-sm); border-color: var(--border); font-size: 13.8px; padding: 8px 12px;
}
.form-control:focus, .form-select:focus { border-color: var(--violet-500); box-shadow: 0 0 0 3px var(--violet-100); }

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, #4F3AB8 0%, #241653 55%, #180F3A 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border-radius: 18px;
  padding: 34px 30px; box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.login-logo { width: 46px; height: 46px; border-radius: 13px; background: var(--amber-500);
  display: flex; align-items: center; justify-content: center; font-family: 'Plus Jakarta Sans'; font-weight: 800; color: var(--indigo-900); font-size: 19px; margin-bottom: 14px; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 46px 20px; color: var(--ink-400); }
.empty-state i { font-size: 30px; margin-bottom: 10px; opacity: 0.5; }

/* ---------- Toast ---------- */
#toastHost { position: fixed; top: 18px; right: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast-chip {
  min-width: 240px; background: var(--ink-900); color: #fff; padding: 11px 16px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.25); display: flex; align-items: center; gap: 8px;
}
.toast-chip.success { background: #0C7A57; }
.toast-chip.error { background: #B8264A; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
}

.spinner-brand { width: 1.1rem; height: 1.1rem; border-width: 2px; color: var(--violet-500); }
