/* ============================================================
   main.css — Plataforma de Credenciales Estudiantiles
   Estilo: Corporativo Minimalista Moderno
   Fuentes: Sora (headings) + DM Sans (body) + DM Mono (codes)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;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;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ─── Variables ──────────────────────────────────────────── */
:root {
  --brand:        #2563EB;
  --brand-dark:   #1d4ed8;
  --brand-light:  #eff6ff;
  --brand-rgb:    37, 99, 235;

  --navy:         #0A0F1E;
  --navy-2:       #111827;
  --navy-3:       #1F2937;

  --surface:      #FFFFFF;
  --surface-2:    #F8FAFC;
  --surface-3:    #F1F5F9;
  --border:       #E2E8F0;
  --border-2:     #CBD5E1;

  --text:         #0F172A;
  --text-2:       #334155;
  --text-muted:   #64748B;
  --text-placeholder: #94A3B8;

  --success:      #10B981;
  --success-bg:   #ECFDF5;
  --warning:      #F59E0B;
  --warning-bg:   #FFFBEB;
  --danger:       #EF4444;
  --danger-bg:    #FEF2F2;
  --info:         #3B82F6;
  --info-bg:      #EFF6FF;

  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    16px;
  --radius-xl:    24px;
  --radius-full:  9999px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:       0 4px 16px rgba(0,0,0,.07), 0 2px 6px rgba(0,0,0,.04);
  --shadow-md:    0 8px 32px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.05);
  --shadow-lg:    0 20px 60px rgba(0,0,0,.14), 0 4px 16px rgba(0,0,0,.06);
  --shadow-brand: 0 8px 24px rgba(var(--brand-rgb), .28);

  --transition:   all .2s cubic-bezier(.4,0,.2,1);
  --transition-slow: all .4s cubic-bezier(.4,0,.2,1);

  --sidebar-w:    260px;
  --topbar-h:     64px;
}

/* ─── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--text);
  background: var(--surface-2);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6 {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

a { color: var(--brand); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--brand-dark); }

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

code, pre {
  font-family: 'DM Mono', monospace;
  font-size: .875rem;
}

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   AUTH LAYOUT (login)
   ═══════════════════════════════════════════════════════════ */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--navy);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 4rem;
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

.auth-brand::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(var(--brand-rgb), .18) 0%, transparent 70%);
  top: -100px; left: -100px;
  pointer-events: none;
}

.auth-brand::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(var(--brand-rgb), .10) 0%, transparent 70%);
  bottom: 80px; right: -80px;
  pointer-events: none;
}

.auth-brand-logo {
  width: 160px;
  margin-bottom: 3rem;
  position: relative;
  z-index: 1;
}

.auth-brand-logo img { width: 100%; }

.auth-brand-logo-placeholder {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.auth-brand-logo-icon {
  width: 44px; height: 44px;
  background: var(--brand);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
}

.auth-brand-logo-name {
  font-family: 'Sora', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
}

.auth-brand-headline {
  position: relative;
  z-index: 1;
}

.auth-brand-headline h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.auth-brand-headline h1 span {
  color: var(--brand);
}

.auth-brand-headline p {
  color: rgba(255,255,255,.55);
  font-size: 1.05rem;
  max-width: 360px;
  line-height: 1.7;
}

.auth-brand-dots {
  position: absolute;
  bottom: 2rem; left: 4rem;
  display: flex; gap: .5rem;
  z-index: 1;
}

.auth-brand-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
}
.auth-brand-dots span.active { background: var(--brand); }

.auth-form-side {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 4rem;
}

.auth-form-wrap {
  width: 100%;
  max-width: 400px;
}

.auth-form-header {
  margin-bottom: 2.5rem;
}

.auth-form-header h2 {
  font-size: 1.75rem;
  margin-bottom: .5rem;
}

.auth-form-header p {
  color: var(--text-muted);
  font-size: .95rem;
}

/* ─── Form elements ──────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: .5rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  color: var(--text);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12);
}

.form-control::placeholder {
  color: var(--text-placeholder);
}

.form-control.is-error {
  border-color: var(--danger);
}

.form-error {
  display: block;
  font-size: .8rem;
  color: var(--danger);
  margin-top: .375rem;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .form-control {
  padding-left: 2.75rem;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-icon-right {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  border: 1.5px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.btn-sm { padding: .5rem 1rem; font-size: .85rem; }
.btn-lg { padding: .9rem 2rem; font-size: 1rem; }

.btn-primary {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  transform: translateY(-1px);
  color: white;
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--surface-3);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: #dc2626;
  color: white;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}
.btn-outline:hover {
  background: var(--brand);
  color: white;
}

.btn-block { width: 100%; }
.btn-icon { padding: .6rem; border-radius: var(--radius); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .875rem 1.125rem;
  border-radius: var(--radius);
  font-size: .9rem;
  border: 1px solid transparent;
  margin-bottom: 1.25rem;
}

.alert-success { background: var(--success-bg); color: #065f46; border-color: #a7f3d0; }
.alert-danger   { background: var(--danger-bg);  color: #991b1b; border-color: #fecaca; }
.alert-warning  { background: var(--warning-bg); color: #92400e; border-color: #fde68a; }
.alert-info     { background: var(--info-bg);    color: #1e40af; border-color: #bfdbfe; }

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .25rem .625rem;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .03em;
}

.badge-success  { background: var(--success-bg); color: #065f46; }
.badge-danger   { background: var(--danger-bg);  color: #991b1b; }
.badge-warning  { background: var(--warning-bg); color: #92400e; }
.badge-info     { background: var(--info-bg);    color: #1e40af; }
.badge-neutral  { background: var(--surface-3);  color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   APP LAYOUT (dashboard)
   ═══════════════════════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: var(--transition-slow);
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: var(--brand);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  color: white;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.sidebar-logo-text {
  overflow: hidden;
}

.sidebar-logo-name {
  font-family: 'Sora', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logo-sub {
  font-size: .72rem;
  color: rgba(255,255,255,.4);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: 1rem 1.25rem .4rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.25rem;
  color: rgba(255,255,255,.55);
  font-size: .9rem;
  font-weight: 400;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
  margin: 1px 0;
}

.sidebar-link:hover {
  color: white;
  background: rgba(255,255,255,.06);
}

.sidebar-link.active {
  color: white;
  background: rgba(var(--brand-rgb), .18);
  font-weight: 500;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand);
  border-radius: 0 2px 2px 0;
}

.sidebar-link svg {
  width: 18px; height: 18px;
  opacity: .8;
  flex-shrink: 0;
}

.sidebar-link.active svg,
.sidebar-link:hover svg { opacity: 1; }

.sidebar-footer {
  padding: 1rem 1.25rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.sidebar-user-avatar {
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.15);
}

.sidebar-user-info { overflow: hidden; flex: 1; }
.sidebar-user-name {
  font-size: .875rem;
  font-weight: 500;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: .72rem;
  color: rgba(255,255,255,.4);
}

.sidebar-logout {
  width: 30px; height: 30px;
  background: rgba(255,255,255,.06);
  border: none;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-logout:hover { background: rgba(var(--brand-rgb),.25); color: var(--brand); }

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

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left h1 {
  font-size: 1.15rem;
  font-weight: 600;
}

.topbar-left p {
  font-size: .8rem;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.page-content {
  flex: 1;
  padding: 2rem;
}

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.card-body { padding: 1.5rem; }
.card-body-sm { padding: 1rem 1.25rem; }
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ─── Stats cards ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.stat-icon-brand { background: var(--brand-light); color: var(--brand); }
.stat-icon-success { background: var(--success-bg); color: var(--success); }
.stat-icon-warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon-danger  { background: var(--danger-bg);  color: var(--danger); }

.stat-content { flex: 1; }
.stat-label {
  font-size: .78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  margin-bottom: .25rem;
}
.stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

/* ─── Table ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.table th {
  text-align: left;
  padding: .75rem 1rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-2);
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }

.table-user {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.table-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.table-name { font-weight: 500; color: var(--text); }
.table-sub  { font-size: .78rem; color: var(--text-muted); }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,15,30,.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  transform: scale(.96) translateY(8px);
  transition: var(--transition);
  overflow: hidden;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1.1rem; }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}

/* ─── Empty state ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: .4;
}
.empty-state h3 { font-size: 1.1rem; color: var(--text-2); margin-bottom: .5rem; }
.empty-state p  { font-size: .9rem; max-width: 300px; margin: 0 auto 1.5rem; }

/* ─── Search + filter bar ────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.filter-bar .form-control { max-width: 300px; }
.filter-bar select.form-control { max-width: 180px; }

/* ─── Avatar ─────────────────────────────────────────────── */
.avatar {
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-sm  { width: 32px;  height: 32px; }
.avatar-md  { width: 48px;  height: 48px; }
.avatar-lg  { width: 72px;  height: 72px; }
.avatar-xl  { width: 100px; height: 100px; }
.avatar-2xl { width: 128px; height: 128px; }

/* ─── Divider ────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ─── Loading spinner ────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(var(--brand-rgb), .2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toggle switch ──────────────────────────────────────── */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.toggle {
  position: relative;
  width: 44px; height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-2);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.toggle input:checked + .toggle-slider { background: var(--brand); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ─── Color picker ───────────────────────────────────────── */
.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.color-picker-swatch {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  cursor: pointer;
  overflow: hidden;
}
input[type="color"] {
  width: 100%; height: 100%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
}

/* ─── Logo upload ────────────────────────────────────────── */
.logo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface-2);
}
.logo-upload-area:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}
.logo-upload-area.dragover {
  border-color: var(--brand);
  background: var(--brand-light);
}

/* ─── Credential status tag ──────────────────────────────── */
.cred-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  font-weight: 600;
}
.cred-status::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
}
.cred-status.active::before  { background: var(--success); }
.cred-status.suspended::before { background: var(--warning); }
.cred-status.revoked::before { background: var(--danger); }

/* ─── Dropdown menu ──────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  right: 0; top: calc(100% + .5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  z-index: 200;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: var(--transition);
}
.dropdown.open .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .625rem 1rem;
  font-size: .875rem;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.dropdown-item.danger:hover { background: var(--danger-bg); color: var(--danger); }
.dropdown-divider { border-top: 1px solid var(--border); margin: .25rem 0; }

/* ─── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  padding: 1rem;
}
.page-btn {
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: .875rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
}
.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: white; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─── Course pill ────────────────────────────────────────── */
.course-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  border-radius: var(--radius-full);
  font-size: .78rem;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.course-pill.completed { background: var(--success-bg); color: #065f46; border-color: #a7f3d0; }
.course-pill.active    { background: var(--brand-light); color: var(--brand); border-color: #bfdbfe; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-side { padding: 2rem; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    transform: translateX(-260px);
    width: 260px;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); --sidebar-w: 260px; }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 1rem; }
  .page-content { padding: 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn .35s ease both; }
.fade-in-1 { animation-delay: .05s; }
.fade-in-2 { animation-delay: .10s; }
.fade-in-3 { animation-delay: .15s; }
.fade-in-4 { animation-delay: .20s; }

/* ─── Utility ────────────────────────────────────────────── */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem;  }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem;   }
.mb-1  { margin-bottom: .25rem; }
.mb-2  { margin-bottom: .5rem;  }
.mb-3  { margin-bottom: .75rem; }
.mb-4  { margin-bottom: 1rem;   }
.mb-6  { margin-bottom: 1.5rem; }
.mt-4  { margin-top: 1rem; }
.text-sm    { font-size: .875rem; }
.text-xs    { font-size: .75rem;  }
.text-muted { color: var(--text-muted); }
.font-mono  { font-family: 'DM Mono', monospace; }
.text-right { text-align: right; }
.text-center{ text-align: center; }
.w-full     { width: 100%; }
.truncate   { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
