/* Anka LMS v3 — Dark Design System
   Syne (display) + DM Sans (body)
   https://anka.inno-take.com */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ── Design Tokens ────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-base:      #0a0a0f;
  --bg-surface:   #111118;
  --bg-elevated:  #1a1a24;
  --bg-hover:     #22222e;

  /* Aliases for backward compat */
  --bg:           #0a0a0f;
  --bg-alt:       #111118;
  --fill:         #1a1a24;
  --fill-dark:    #22222e;
  --panel:        #111118;
  --sidebar:      #08080d;

  /* Text */
  --text-primary:  #f0f0f5;
  --text-secondary:#9090a8;
  --text-muted:    #55556a;
  --ink:           #f0f0f5;
  --ink-muted:     #9090a8;
  --ink-light:     #55556a;

  /* Borders */
  --border:        rgba(255,255,255,0.07);
  --border-accent: rgba(255,31,142,0.3);

  /* Brand accent */
  --accent:      #FF1F8E;
  --accent-dim:  rgba(255,31,142,0.15);
  --accent-hover:#ff4da6;
  --accent-dk:   #cc1870;
  --accent-lt:   rgba(255,31,142,0.12);
  --accent2:     #FF6BB0;

  /* Semantic feedback */
  --success: #10B981;
  --warning: #F59E0B;
  --danger:  #EF4444;
  --info:    #3B82F6;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.55);
  --shadow-md: 0 4px 18px rgb(0 0 0 / 0.65);
  --shadow-lg: 0 12px 40px rgb(0 0 0 / 0.75);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Layout */
  --sidebar-w:     220px;
  --sidebar-width: 220px;
  --topbar-h:      60px;

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font:         'DM Sans', sans-serif;

  /* Motion */
  --transition:    140ms ease;
  --transition-md: 220ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Gradients */
  --gradient-cta:       linear-gradient(135deg, #FF1F8E 0%, #cc1870 100%);
  --gradient-cta-hover: linear-gradient(135deg, #ff3898 0%, #e01f7c 100%);
  --gradient-thumb:     linear-gradient(135deg, #FF1F8E 0%, #b03068 100%);
}

/* ── Reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { font-size: 16px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body  { font-family: var(--font); background: var(--bg-base); color: var(--ink); line-height: 1.55; min-height: 100vh; }
a     { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font); }
img   { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ── Typography scale ─────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.t-xs   { font-size: 11px; line-height: 1.4; }
.t-sm   { font-size: 13px; line-height: 1.45; }
.t-base { font-size: 15px; line-height: 1.55; }
.t-lg   { font-size: 18px; line-height: 1.4; }
.t-xl   { font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; }
.t-2xl  { font-size: 28px; line-height: 1.15; letter-spacing: -0.025em; }
.t-3xl  { font-size: 36px; line-height: 1.1;  letter-spacing: -0.03em; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.muted  { color: var(--ink-muted); }
.accent { color: var(--accent); }

/* ── Utilities ────────────────────────────────────── */
.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.w-full  { width: 100%; }
.mt-4    { margin-top: 4px; }
.mt-8    { margin-top: 8px; }
.mt-16   { margin-top: 16px; }
.mt-24   { margin-top: 24px; }
.mt-32   { margin-top: 32px; }
.mb-8    { margin-bottom: 8px; }
.mb-16   { margin-bottom: 16px; }
.mb-24   { margin-bottom: 24px; }
.p-16    { padding: 16px; }
.p-24    { padding: 24px; }
.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--font);
}
.btn-primary {
  background: var(--gradient-cta);
  color: #fff;
  border: none;
  box-shadow: 0 2px 10px rgb(255 31 142 / 0.25);
}
.btn-primary:hover {
  background: var(--gradient-cta-hover);
  box-shadow: 0 0 22px rgb(255 31 142 / 0.4), 0 4px 16px rgb(255 31 142 / 0.2);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-lt); }
.btn-secondary {
  background: var(--fill);
  color: var(--ink-muted);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--fill-dark); color: var(--ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
}
.btn-ghost:hover { color: var(--ink); background: var(--fill); }
.btn-danger {
  background: rgb(239 68 68 / 0.12);
  color: var(--danger);
  border: 1px solid rgb(239 68 68 / 0.25);
}
.btn-danger:hover { background: rgb(239 68 68 / 0.2); }
.btn-sm   { padding: 5px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg   { padding: 12px 28px; font-size: 15px; }
.btn-wide { width: 100%; }
.btn-icon {
  width: 34px; height: 34px; padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-muted);
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--fill); color: var(--ink); }

/* ── Form elements ────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.field-hint  { font-size: 12px; color: var(--ink-light); margin-top: 2px; }

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--fill);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(255 31 142 / 0.15);
  background: var(--fill-dark);
}
.input::placeholder { color: var(--ink-light); }

.textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--fill);
  color: var(--ink);
  font-size: 14px;
  resize: vertical;
  min-height: 90px;
  outline: none;
  transition: border-color var(--transition);
}
.textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(255 31 142 / 0.15); }
.textarea::placeholder { color: var(--ink-light); }

.select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--fill);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239090a8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.select:focus { border-color: var(--accent); }
.select option { background: var(--bg-alt); color: var(--ink); }

.checkbox-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-muted); cursor: pointer;
}
.checkbox-row input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* ── Card ─────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition-md), transform var(--transition-md);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body   { padding: 16px; }
.card-footer { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--fill); }

/* ── Badge ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .4px; text-transform: uppercase;
}
.badge-accent  { background: var(--accent-lt); color: var(--accent); }
.badge-fill    { background: var(--fill-dark); color: var(--ink-muted); }
.badge-green, .badge-success   { background: rgb(16 185 129 / 0.15); color: #34D399; }
.badge-blue, .badge-info       { background: rgb(59 130 246 / 0.15); color: #60A5FA; }
.badge-yellow, .badge-warning  { background: rgb(245 158 11 / 0.15); color: #FCD34D; }
.badge-red, .badge-danger      { background: rgb(239 68 68 / 0.15);  color: #FCA5A5; }

/* ── Progress bar ─────────────────────────────────── */
.progress-track, .progress-bar {
  width: 100%; height: 5px;
  background: var(--fill-dark);
  border-radius: 99px; overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gradient-cta);
  border-radius: 99px;
  transition: width .5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Avatar ───────────────────────────────────────── */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--fill-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--ink-muted);
  flex-shrink: 0;
  overflow: hidden;
  font-family: var(--font-display);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg  { width: 44px; height: 44px; font-size: 16px; }
.avatar-xl  { width: 60px; height: 60px; font-size: 22px; }
.avatar-accent { background: var(--accent-lt); color: var(--accent); }

/* ── Dividers ─────────────────────────────────────── */
.divider   { height: 1px; background: var(--border); width: 100%; }
.divider-v { width: 1px; background: var(--border); height: 100%; }

/* ── Pill ─────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  background: var(--fill); border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 12px; font-weight: 600; color: var(--ink-muted);
}
.pill-accent {
  background: var(--accent-lt);
  border-color: rgb(255 31 142 / 0.25);
  color: var(--accent);
}

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

/* ── Sidebar ──────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgb(0 0 0 / 0.7);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition-md);
  border-right: 1px solid var(--border);
}

.sidebar-logo {
  padding: 22px 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.sidebar-logo .logo-mark {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1;
}
.sidebar-logo .logo-mark img {
  height: 50px !important;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.sidebar-logo .logo-sub {
  font-size: 9px; font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 3px;
}

.sidebar-nav {
  padding: 12px 10px;
  display: flex; flex-direction: column; gap: 2px;
  flex: 1;
}

.nav-section-label {
  font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--ink-light);
  padding: 8px 8px 4px;
  margin-top: 8px;
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-size: 13.5px; font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  position: relative;
}
.nav-item:hover { background: var(--fill); color: var(--ink); }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
.nav-item .nav-icon {
  width: 16px; height: 16px;
  opacity: .7; flex-shrink: 0;
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: var(--gradient-cta);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}

.sidebar-user {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 9px;
}
.sidebar-user .user-name  { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.sidebar-user .user-role  { font-size: 11px; color: var(--ink-muted); }
.sidebar-user .logout-btn {
  margin-left: auto;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--ink-light);
  transition: all var(--transition);
  flex-shrink: 0;
  cursor: pointer;
}
.sidebar-user .logout-btn:hover { background: var(--fill); color: var(--danger); }

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

/* ── Topbar ───────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky; top: 0; z-index: 90;
}

.menu-toggle {
  display: none;
  color: var(--ink-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.menu-toggle:hover { background: var(--fill); color: var(--ink); }

.topbar-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.topbar-search .search-icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-light); width: 14px; height: 14px;
}
.topbar-search .input {
  height: 34px; padding-left: 32px;
  background: var(--fill); border-color: transparent;
  font-size: 13px;
}
.topbar-search .input:focus { background: var(--fill-dark); border-color: var(--accent); }

.topbar-actions {
  display: flex; align-items: center; gap: 6px;
  margin-left: auto;
}

.notif-btn {
  position: relative;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  transition: all var(--transition);
  cursor: pointer;
}
.notif-btn:hover { background: var(--fill); color: var(--ink); }
.notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--sidebar);
}

/* ── Page ─────────────────────────────────────────── */
.page { padding: 28px 28px 48px; flex: 1; }

.page-header {
  margin-bottom: 24px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.03em;
}
.page-subtitle { font-size: 14px; color: var(--ink-muted); margin-top: 2px; }

/* ── Login ────────────────────────────────────────── */
.login-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.login-brand {
  width: 44%;
  background: var(--bg-base);
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border);
}
.login-brand .brand-orb-1 {
  position: absolute;
  width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgb(255 31 142 / 0.14) 0%, transparent 65%);
  bottom: -160px; right: -160px;
  pointer-events: none;
}
.login-brand .brand-orb-2 {
  position: absolute;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgb(255 107 176 / 0.08) 0%, transparent 65%);
  top: -60px; left: 40px;
  pointer-events: none;
}
.login-brand .brand-logo {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 10px;
}
.login-brand .brand-logo img {
  height: 68px;
  filter: brightness(0) invert(1);
}
.login-brand .brand-headline {
  position: relative; z-index: 1;
}
.login-brand .brand-headline h1 {
  font-family: var(--font-display);
  font-size: 40px; font-weight: 800;
  color: var(--ink); line-height: 1.1;
  letter-spacing: -0.04em;
}
.login-brand .brand-headline h1 em {
  font-style: normal;
  color: var(--accent);
}
.login-brand .brand-headline p {
  font-size: 15px; color: var(--ink-muted);
  margin-top: 12px; line-height: 1.6;
  max-width: 56ch;
}
.login-brand .brand-stats {
  display: flex; gap: 0;
  position: relative; z-index: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.brand-stat {
  flex: 1;
  padding: 14px 16px;
  border-right: 1px solid var(--border);
}
.brand-stat:last-child { border-right: none; }
.brand-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  color: var(--ink);
}
.brand-stat span {
  font-size: 11px; color: var(--ink-muted);
  font-weight: 400; margin-top: 2px; display: block;
}

.login-form-wrap {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  background: var(--bg-base);
  overflow-y: auto;
}
.login-form-box {
  width: 100%; max-width: 380px;
}
.login-form-box .form-title {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
  color: var(--ink);
}
.login-form-box .form-sub {
  font-size: 14px; color: var(--ink-muted);
  margin-bottom: 28px;
}
.or-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0;
  font-size: 12px; color: var(--ink-light);
}
.or-divider::before, .or-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--fill);
  font-size: 13px; font-weight: 500; color: var(--ink);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 6px;
}
.sso-btn:hover { border-color: var(--ink-muted); background: var(--fill-dark); }

/* ── Hero Banner ──────────────────────────────────── */
.hero-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  display: flex; align-items: center;
  justify-content: space-between; gap: 20px;
  margin-bottom: 24px;
  position: relative; overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute; right: -40px; top: -40px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgb(255 31 142 / 0.1) 0%, transparent 65%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; flex: 1; }
.hero-eyebrow {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--accent); margin-bottom: 6px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 800;
  color: var(--ink); letter-spacing: -0.025em;
  line-height: 1.2; margin-bottom: 4px;
}
.hero-sub { font-size: 14px; color: var(--ink-muted); }
.hero-progress-track {
  width: 100%; max-width: 280px;
  height: 5px; background: var(--fill-dark);
  border-radius: 99px; overflow: hidden;
  margin-top: 14px;
}
.hero-progress-fill {
  height: 100%; background: var(--gradient-cta);
  border-radius: 99px;
  transition: width .6s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-progress-label { font-size: 12px; color: var(--ink-muted); margin-top: 6px; }
.hero-actions { position: relative; z-index: 1; flex-shrink: 0; }

/* ── Stats Row ────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: box-shadow var(--transition-md);
}
.stat-card:hover { box-shadow: var(--shadow-sm); }
.stat-label {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--ink-muted); margin-bottom: 8px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.04em;
  line-height: 1;
}
.stat-sub { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }
.stat-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--fill);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  color: var(--ink-muted);
}
.stat-icon.accent-bg { background: var(--accent-lt); color: var(--accent); }

/* ── Course Cards ─────────────────────────────────── */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.course-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition-md), transform var(--transition-md);
  cursor: pointer;
}
.course-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.course-thumb {
  height: 140px;
  background: var(--gradient-thumb);
  position: relative;
  overflow: hidden;
  display: flex; align-items: flex-end;
  padding: 12px;
}
.course-thumb-badge {
  position: absolute; top: 10px; right: 10px;
}
.course-body { padding: 14px 16px 16px; }
.course-category { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--accent); margin-bottom: 5px; }
.course-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; line-height: 1.35; margin-bottom: 6px; }
.course-instructor { font-size: 12px; color: var(--ink-muted); margin-bottom: 12px; }
.course-progress-label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-muted); margin-bottom: 5px; }
.course-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

/* ── Table ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead tr { background: var(--fill); }
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-top: 1px solid var(--border); font-size: 14px; color: var(--ink); }
.data-table tbody tr:hover { background: var(--fill); }
.data-table .actions { display: flex; gap: 6px; }

/* ── Section header ───────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.02em;
}

/* ── Empty state ──────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-muted);
}
.empty-icon {
  width: 52px; height: 52px;
  background: var(--fill);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  color: var(--ink-light);
}
.empty-state h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.empty-state p  { font-size: 14px; max-width: 32ch; line-height: 1.6; }

/* ── Modal ────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgb(0 0 0 / 0.7);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition-md);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  padding: 24px;
  transform: translateY(10px) scale(0.97);
  transition: transform var(--transition-md);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title  { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.modal-box {
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
} 
/* ── Toasts ───────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500; color: var(--ink);
  box-shadow: var(--shadow-md);
  transform: translateX(8px);
  opacity: 0;
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 220px; max-width: 340px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.success { background: rgb(16 185 129 / 0.12); border-color: rgb(16 185 129 / 0.25); color: #34D399; }
.toast.error   { background: rgb(239 68 68 / 0.12);  border-color: rgb(239 68 68 / 0.25);  color: #FCA5A5; }
.toast.warning { background: rgb(245 158 11 / 0.12); border-color: rgb(245 158 11 / 0.25); color: #FCD34D; }

/* ── Accordion ────────────────────────────────────── */
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item:last-child { border-bottom: none; }
.accordion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink);
  transition: color var(--transition);
}
.accordion-header:hover { color: var(--accent); }
.accordion-header .chevron {
  width: 16px; height: 16px; color: var(--ink-muted);
  transition: transform var(--transition-md);
  flex-shrink: 0;
}
.accordion-header.open .chevron { transform: rotate(180deg); }
.accordion-body { display: none; padding-bottom: 14px; }
.accordion-body.open { display: block; }

/* ── Tabs ─────────────────────────────────────────── */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab-item {
  padding: 10px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}
.tab-item:hover { color: var(--ink); }
.tab-item.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { }

/* ── Video wrapper ────────────────────────────────── */
.video-wrapper {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--fill);
}
.video-wrapper iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; border: none;
}
.video-placeholder {
  aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
  background: var(--fill);
  border-radius: var(--radius-lg);
  color: var(--ink-muted); font-size: 14px;
}

/* ── Course detail ────────────────────────────────── */
.course-detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.enrollment-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: sticky; top: 80px;
}
.enrollment-price {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 800;
  color: var(--ink); letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.enrollment-free {
  background: var(--accent-lt);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px; font-weight: 700;
  display: inline-block;
  text-transform: uppercase; letter-spacing: .6px;
}

/* ── Lesson viewer ────────────────────────────────── */
.lesson-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.lesson-outline { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; position: sticky; top: 80px; max-height: calc(100vh - 120px); overflow-y: auto; }
.lesson-outline-header { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--ink); }
.outline-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  font-size: 13px; color: var(--ink-muted);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.outline-item:hover { background: var(--fill); color: var(--ink); }
.outline-item.active { background: var(--accent-lt); color: var(--accent); }
.outline-item.completed .check { color: var(--success); }

/* ── Alert / Info box ─────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px; line-height: 1.5;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-warning { background: rgb(245 158 11 / 0.1); border: 1px solid rgb(245 158 11 / 0.25); color: #FCD34D; }
.alert-danger   { background: rgb(239 68 68 / 0.1);  border: 1px solid rgb(239 68 68 / 0.25);  color: #FCA5A5; }
.alert-success  { background: rgb(16 185 129 / 0.1); border: 1px solid rgb(16 185 129 / 0.25); color: #34D399; }
.alert-info     { background: rgb(59 130 246 / 0.1); border: 1px solid rgb(59 130 246 / 0.25); color: #60A5FA; }

/* ── Skeleton loader ──────────────────────────────── */
@keyframes shimmer {
  from { background-position: -400px 0; }
  to   { background-position:  400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--fill) 25%, var(--fill-dark) 50%, var(--fill) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

/* ── Page fade-in animation ───────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-fade { animation: fadeUp 300ms cubic-bezier(0.16, 1, 0.3, 1) both; }

/* ── Attendance toggle ────────────────────────────── */
.att-table { width: 100%; border-collapse: collapse; }
.att-table th, .att-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.att-table th { background: var(--fill); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-muted); }
.att-toggle { width: 42px; height: 22px; border-radius: 11px; cursor: pointer; transition: background var(--transition); border: none; position: relative; }
.att-toggle.present { background: var(--success); }
.att-toggle.absent  { background: var(--fill-dark); }
.att-toggle::after { content: ''; position: absolute; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; transition: left var(--transition); }
.att-toggle.present::after { left: 22px; }
.att-toggle.absent::after  { left: 3px; }

/* ── Course catalog ───────────────────────────────── */
.catalog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.filter-panel { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; position: sticky; top: 80px; }
.filter-section { margin-bottom: 18px; }
.filter-section:last-child { margin-bottom: 0; }
.filter-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-muted); margin-bottom: 10px; }
.filter-check { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; }
.filter-check label { font-size: 13px; color: var(--ink-muted); cursor: pointer; }
.filter-check input { accent-color: var(--accent); }

/* ── Search box standalone ────────────────────────── */
.search-standalone {
  position: relative; margin-bottom: 20px;
}
.search-standalone .search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-light); width: 15px; height: 15px;
  pointer-events: none;
}
.search-standalone .input { padding-left: 36px; height: 40px; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 1100px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .course-detail-layout { grid-template-columns: 1fr; }
  .lesson-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .page { padding: 16px; }
  .topbar { padding: 0 16px; }
  .login-shell { flex-direction: column; }
  .login-brand { width: 100%; padding: 24px; min-height: 200px; flex: none; }
  .login-brand .brand-headline h1 { font-size: 28px; }
  .login-brand .brand-stats { display: none; }
  .hero-banner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .course-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
}
