/* ============================================================
   LearnHub — Design System v2
   Paleta vibrante · Animaciones · Dark mode · Responsive
   ============================================================ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --primary:          #6366f1;
  --primary-dark:     #4f46e5;
  --primary-light:    #818cf8;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  --secondary:        #06b6d4;
  --accent:           #f59e0b;
  --success:          #10b981;
  --danger:           #ef4444;
  --warning:          #f59e0b;
  --info:             #3b82f6;

  --bg:               #f8fafc;
  --bg-card:          #ffffff;
  --bg-soft:          #f1f5f9;
  --surface:          #ffffff;
  --border:           #e2e8f0;
  --border-light:     #f1f5f9;
  --primary-bg:       #ede9fe;

  --text:             #0f172a;
  --text-secondary:   #475569;
  --text-muted:       #94a3b8;
  --text-inverse:     #ffffff;

  --nav-bg:           rgba(255,255,255,0.92);
  --nav-shadow:       0 1px 20px rgba(99,102,241,0.08);

  --shadow-sm:        0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:           0 4px 16px rgba(0,0,0,0.08);
  --shadow-md:        0 8px 32px rgba(0,0,0,0.10);
  --shadow-lg:        0 20px 60px rgba(0,0,0,0.12);
  --shadow-color:     0 8px 32px rgba(99,102,241,0.20);

  --radius-sm:        6px;
  --radius:           12px;
  --radius-lg:        20px;
  --radius-xl:        28px;
  --radius-full:      9999px;

  --font-body:        'Inter', system-ui, sans-serif;
  --font-heading:     'Poppins', system-ui, sans-serif;

  --transition:       all 0.2s ease;
  --transition-slow:  all 0.35s ease;

  --sidebar-width:    260px;
  --header-height:    68px;
  --container-max:    1240px;
}

/* ── Dark mode ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:               #0f172a;
  --bg-card:          #1e293b;
  --bg-soft:          #1e293b;
  --surface:          #1e293b;
  --border:           #334155;
  --border-light:     #1e293b;
  --primary-bg:       #1e1b4b;
  --text:             #f1f5f9;
  --text-secondary:   #cbd5e1;
  --text-muted:       #64748b;
  --nav-bg:           rgba(15,23,42,0.95);
  --nav-shadow:       0 1px 20px rgba(0,0,0,0.3);
  --shadow-sm:        0 1px 3px rgba(0,0,0,0.3);
  --shadow:           0 4px 16px rgba(0,0,0,0.3);
  --shadow-md:        0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg:        0 20px 60px rgba(0,0,0,0.5);
}

/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); font-weight: 600; line-height: 1.25; color: var(--text); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: var(--radius-full); }

.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 1.5rem; }

/* ════════════════════════════════════════════════════════════
   HEADER / NAVBAR
   ════════════════════════════════════════════════════════════ */
.header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--header-height);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--nav-shadow);
  transition: var(--transition-slow);
}
.header .container { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 1rem; }

.logo { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700; color: var(--primary); flex-shrink: 0; text-decoration: none; }
.logo img { width: 36px; height: 36px; }
.logo-badge { background: var(--primary-gradient); color: #fff; font-size: 0.62rem; font-weight: 700; padding: 2px 7px; border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.5px; }

.nav-menu { display: flex; align-items: center; gap: 0.25rem; flex: 1; justify-content: center; }
.nav-link { display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.85rem; border-radius: var(--radius); color: var(--text-secondary); font-size: 0.88rem; font-weight: 500; transition: var(--transition); white-space: nowrap; }
.nav-link:hover, .nav-link.active { color: var(--primary); background: rgba(99,102,241,0.08); text-decoration: none; }
.nav-link i { font-size: 0.9rem; }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.btn-icon {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: none; background: var(--bg-soft); border-radius: var(--radius);
  color: var(--text-secondary); font-size: 1rem;
  transition: var(--transition); cursor: pointer;
}
.btn-icon:hover { background: rgba(99,102,241,0.1); color: var(--primary); transform: translateY(-1px); }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: var(--radius-full);
}
.btn-icon .badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; font-size: 9px; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-primary { background: #ede9fe; color: #4c1d95; }

.user-dropdown { position: relative; }
.user-avatar-btn { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.75rem 0.35rem 0.35rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-full); cursor: pointer; transition: var(--transition); }
.user-avatar-btn:hover { border-color: var(--primary); box-shadow: var(--shadow-color); }
.user-avatar-btn img, .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-placeholder { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-gradient); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }

.dropdown-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 0.5rem; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: var(--transition); z-index: 200; }
.dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.75rem; border-radius: var(--radius); color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; transition: var(--transition); }
.dropdown-item:hover { background: var(--bg-soft); color: var(--primary); }
.dropdown-item i { width: 16px; text-align: center; }
.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 0.35rem 0; }

.menu-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; background: none; border: none; padding: 8px; cursor: pointer; }
.menu-toggle span { display: block; height: 2px; background: var(--text-secondary); border-radius: var(--radius-full); transition: var(--transition); }

/* ════════════════════════════════════════════════════════════
   BOTONES
   ════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.6rem 1.35rem;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
  border-radius: var(--radius); border: 2px solid transparent;
  cursor: pointer; transition: var(--transition); text-decoration: none;
  white-space: nowrap; user-select: none; line-height: 1.4;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary-gradient); color: #fff; border-color: transparent; box-shadow: 0 4px 15px rgba(99,102,241,0.35); }
.btn-primary:hover { box-shadow: 0 8px 25px rgba(99,102,241,0.45); color: #fff; }
.btn-secondary { background: linear-gradient(135deg,#06b6d4,#0284c7); color: #fff; box-shadow: 0 4px 15px rgba(6,182,212,0.3); }
.btn-secondary:hover { color: #fff; }
.btn-success { background: linear-gradient(135deg,#10b981,#059669); color: #fff; box-shadow: 0 4px 15px rgba(16,185,129,0.3); }
.btn-success:hover { color: #fff; }
.btn-danger { background: linear-gradient(135deg,#ef4444,#dc2626); color: #fff; box-shadow: 0 4px 15px rgba(239,68,68,0.3); }
.btn-danger:hover { color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: var(--bg-soft); color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--border); color: var(--text); }

.btn-sm   { padding: 0.38rem 0.85rem; font-size: 0.8rem; }
.btn-lg   { padding: 0.8rem 1.75rem; font-size: 1rem; }
.btn-xl   { padding: 1rem 2.2rem; font-size: 1.05rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }
.btn-large { padding: 0.8rem 1.75rem; font-size: 1rem; }

/* ════════════════════════════════════════════════════════════
   HERO / SLIDER
   ════════════════════════════════════════════════════════════ */
.hero-slider { position: relative; overflow: hidden; height: 500px; background: #0f172a; }
.slider-container { display: flex; height: 100%; transition: transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94); }
.slide { position: relative; min-width: 100%; height: 100%; overflow: hidden; }
.slide img { width: 100%; height: 100%; object-fit: cover; opacity: 0.4; transition: transform 8s ease; }
.slide:hover img { transform: scale(1.04); }
.slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, rgba(79,70,229,0.88) 0%, rgba(15,23,42,0.75) 50%, transparent 100%); }

.slide-content { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: center; padding: 3rem 8%; max-width: 640px; }
.slide-tag { display: inline-flex; align-items: center; gap: 0.4rem; background: rgba(255,255,255,0.15); backdrop-filter: blur(8px); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 0.3rem 0.85rem; border-radius: var(--radius-full); margin-bottom: 1rem; width: fit-content; text-transform: uppercase; letter-spacing: 0.5px; }
.slide-content h1 { font-size: clamp(1.8rem,4vw,2.8rem); font-weight: 800; color: #fff; line-height: 1.15; margin-bottom: 1rem; text-shadow: 0 2px 20px rgba(0,0,0,0.3); }
.slide-content p { font-size: 1.05rem; color: rgba(255,255,255,0.88); margin-bottom: 1.75rem; line-height: 1.6; max-width: 520px; }
.slide-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.slider-controls { position: absolute; bottom: 1.5rem; right: 2rem; z-index: 2; display: flex; gap: 0.5rem; }
.slider-controls .btn-icon { background: rgba(255,255,255,0.15); backdrop-filter: blur(8px); color: #fff; border: 1px solid rgba(255,255,255,0.2); width: 44px; height: 44px; }
.slider-controls .btn-icon:hover { background: rgba(255,255,255,0.28); transform: none; }

.slider-dots { position: absolute; bottom: 1.8rem; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; gap: 6px; }
.slider-dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: rgba(255,255,255,0.4); border: none; cursor: pointer; transition: var(--transition); padding: 0; }
.slider-dot.active { background: #fff; width: 24px; }

.hero-alt { background: var(--primary-gradient); padding: 5rem 1.5rem; text-align: center; position: relative; overflow: hidden; }
.hero-alt::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/svg%3E"); }
.hero-alt h1 { font-size: clamp(2rem,5vw,3.5rem); color: #fff; margin-bottom: 1rem; position: relative; }
.hero-alt p  { font-size: 1.15rem; color: rgba(255,255,255,0.85); margin-bottom: 2rem; position: relative; }

/* ════════════════════════════════════════════════════════════
   SECCIONES
   ════════════════════════════════════════════════════════════ */
.section { padding: 4rem 0; }
.section-sm { padding: 2.5rem 0; }

.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 2rem; gap: 1rem; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; gap: 0.6rem; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.section-title i { width: 38px; height: 38px; background: var(--primary-gradient); color: #fff; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.section-subtitle { font-size: 1rem; color: var(--text-muted); margin-top: 0.25rem; }
.section-gradient { background: linear-gradient(135deg, rgba(99,102,241,0.04) 0%, rgba(6,182,212,0.04) 100%); }

.divider { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ════════════════════════════════════════════════════════════
   TARJETAS DE CURSO
   ════════════════════════════════════════════════════════════ */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px,1fr)); gap: 1.5rem; }

.course-card {
  background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: var(--transition-slow); display: flex;
  flex-direction: column; text-decoration: none; border: 1px solid var(--border); position: relative;
}
.course-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); text-decoration: none; }

.course-img-wrap { position: relative; overflow: hidden; aspect-ratio: 16/9; background: var(--bg-soft); }
.course-img-wrap img, .course-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.course-card:hover .course-img { transform: scale(1.07); }

.course-img-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,23,42,0.7) 0%, transparent 50%); opacity: 0; transition: var(--transition-slow); display: flex; align-items: flex-end; padding: 1rem; }
.course-card:hover .course-img-overlay { opacity: 1; }

.course-img-badge { position: absolute; top: 0.75rem; left: 0.75rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }

.pill { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.7rem; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.3px; }
.pill-primary { background: rgba(99,102,241,0.9);  color: #fff; backdrop-filter: blur(4px); }
.pill-success { background: rgba(16,185,129,0.9);  color: #fff; backdrop-filter: blur(4px); }
.pill-warning { background: rgba(245,158,11,0.9);  color: #fff; backdrop-filter: blur(4px); }
.pill-danger  { background: rgba(239,68,68,0.9);   color: #fff; backdrop-filter: blur(4px); }
.pill-info    { background: rgba(6,182,212,0.9);   color: #fff; backdrop-filter: blur(4px); }
.pill-dark    { background: rgba(15,23,42,0.85);   color: #fff; backdrop-filter: blur(4px); }

.course-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: 0.6rem; }
.course-category { font-size: 0.72rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; }
.course-title { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.instructor { font-size: 0.82rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.3rem; }
.instructor img { width: 20px; height: 20px; border-radius: 50%; }
.course-meta { display: flex; align-items: center; gap: 0.85rem; font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap; }
.course-meta i { color: var(--primary-light); }

.rating { display: flex; align-items: center; gap: 0.25rem; font-size: 0.8rem; }
.rating .fa-star   { color: var(--accent); }
.rating .fa-star-o { color: var(--border); }
.rating-value { font-weight: 700; color: var(--text); margin-left: 2px; }
.rating-count { color: var(--text-muted); }

.course-footer { margin-top: auto; padding-top: 0.75rem; border-top: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.price { font-size: 1.15rem; font-weight: 800; color: var(--text); }
.price-free { font-size: 1rem; font-weight: 700; color: var(--success); }
.price-old { font-size: 0.8rem; color: var(--text-muted); text-decoration: line-through; }

/* ════════════════════════════════════════════════════════════
   PROGRESO
   ════════════════════════════════════════════════════════════ */
.progress-wrap { display: flex; flex-direction: column; gap: 0.25rem; }
.progress-bar-container { height: 8px; background: var(--bg-soft); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar-container.small { height: 5px; }
.progress-bar-container.lg { height: 12px; }
.progress-fill { height: 100%; border-radius: var(--radius-full); background: var(--primary-gradient); transition: width 0.8s cubic-bezier(0.34,1.56,0.64,1); min-width: 4px; }
.progress-fill.success { background: linear-gradient(90deg,#10b981,#059669); }
.progress-fill.warning { background: linear-gradient(90deg,#f59e0b,#d97706); }
.progress-text { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }

/* ════════════════════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════════════════════ */
.card { background: var(--bg-card); 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; flex-wrap: wrap; }
.card-title { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.card-body { padding: 1.5rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: var(--bg-soft); }

.stat-card { background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 1.5rem; display: flex; align-items: center; gap: 1.25rem; box-shadow: var(--shadow-sm); transition: var(--transition-slow); position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--primary-gradient); opacity: 0; transition: var(--transition); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card:hover::before { opacity: 1; }

.stat-icon { width: 56px; height: 56px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-icon.primary { background: rgba(99,102,241,0.1); color: var(--primary); }
.stat-icon.success { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-icon.warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-icon.info    { background: rgba(6,182,212,0.1);  color: var(--secondary); }
.stat-icon.danger  { background: rgba(239,68,68,0.1);  color: var(--danger); }

.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1.1; font-family: var(--font-heading); }
.stat-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.1rem; }
.stat-change { font-size: 0.78rem; font-weight: 600; margin-top: 0.2rem; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ════════════════════════════════════════════════════════════
   FORMULARIOS
   ════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.4rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.7rem 1rem; font-family: inherit; font-size: 0.9rem; color: var(--text); background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius); transition: var(--transition); appearance: none; -webkit-appearance: none; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,0.1); }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-group textarea { resize: vertical; min-height: 110px; }
.form-group select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 2.5rem; }

.input-icon-wrap { position: relative; }
.input-icon-wrap input { padding-left: 2.75rem; }
.input-icon-wrap .input-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.9rem; }

.checkbox-group label { display: flex; align-items: flex-start; gap: 0.6rem; cursor: pointer; font-weight: 400; color: var(--text-secondary); }
.checkbox-group input[type="checkbox"] { width: 18px; height: 18px; border-radius: 5px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; margin-top: 2px; }
.form-hint  { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 0.3rem; }

.input-group { display: flex; }
.input-group input { border-radius: var(--radius) 0 0 var(--radius); flex: 1; }
.input-group .btn  { border-radius: 0 var(--radius) var(--radius) 0; flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════
   ALERTAS
   ════════════════════════════════════════════════════════════ */
.alert { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.9rem 1.1rem; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; margin-bottom: 1rem; border: 1px solid transparent; line-height: 1.45; }
.alert i { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.alert-danger  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.alert-success { background: #dcfce7; color: #166534; border-color: #86efac; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.alert-info    { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
[data-theme="dark"] .alert-danger  { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }
[data-theme="dark"] .alert-success { background: #052e16; color: #86efac; border-color: #14532d; }
[data-theme="dark"] .alert-warning { background: #431407; color: #fcd34d; border-color: #78350f; }
[data-theme="dark"] .alert-info    { background: #0c1a6b; color: #93c5fd; border-color: #1e3a8a; }

/* ════════════════════════════════════════════════════════════
   AUTH PAGES
   ════════════════════════════════════════════════════════════ */
.auth-container { min-height: calc(100vh - var(--header-height)); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(6,182,212,0.06) 100%); }
.auth-card { width: 100%; max-width: 460px; background: var(--bg-card); border-radius: var(--radius-xl); border: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 2.5rem; }
.auth-card h1 { font-size: 1.65rem; margin: 0.75rem 0 0.35rem; }
.auth-card .text-center p { color: var(--text-muted); margin-bottom: 1.75rem; }
.text-link { color: var(--primary); font-size: 0.875rem; font-weight: 500; }
.text-link:hover { text-decoration: underline; }
.auth-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.25rem 0; color: var(--text-muted); font-size: 0.8rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ════════════════════════════════════════════════════════════ */
.main-content { min-height: calc(100vh - var(--header-height)); }
.dashboard-layout { display: grid; grid-template-columns: var(--sidebar-width) 1fr; min-height: calc(100vh - var(--header-height)); }

.sidebar { background: var(--bg-card); border-right: 1px solid var(--border); padding: 1.5rem 1rem; position: sticky; top: var(--header-height); height: calc(100vh - var(--header-height)); overflow-y: auto; }
.sidebar-section { margin-bottom: 1.75rem; }
.sidebar-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); padding: 0 0.6rem; margin-bottom: 0.5rem; }
.sidebar-link { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.75rem; border-radius: var(--radius); color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; transition: var(--transition); text-decoration: none; margin-bottom: 2px; }
.sidebar-link:hover, .sidebar-link.active { background: rgba(99,102,241,0.08); color: var(--primary); text-decoration: none; }
.sidebar-link.active { font-weight: 600; }
.sidebar-link i { width: 18px; text-align: center; font-size: 0.95rem; }
.page-content { padding: 2rem 2.5rem; }

/* ════════════════════════════════════════════════════════════
   TABLA
   ════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th { background: var(--bg-soft); padding: 0.85rem 1rem; text-align: left; font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border-light); transition: var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(99,102,241,0.03); }
tbody td { padding: 0.9rem 1rem; color: var(--text-secondary); vertical-align: middle; }

/* ════════════════════════════════════════════════════════════
   PAGINACIÓN
   ════════════════════════════════════════════════════════════ */
.pagination { display: flex; align-items: center; justify-content: center; gap: 0.35rem; padding: 1.5rem 0; flex-wrap: wrap; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 0.6rem; border-radius: var(--radius); font-size: 0.875rem; font-weight: 600; color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border); transition: var(--transition); text-decoration: none; }
.page-link:hover { color: var(--primary); border-color: var(--primary); background: rgba(99,102,241,0.06); }
.page-link.active { background: var(--primary-gradient); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(99,102,241,0.3); }
.page-link.disabled { opacity: 0.4; pointer-events: none; }

/* ════════════════════════════════════════════════════════════
   FORO
   ════════════════════════════════════════════════════════════ */
.topic-list { display: flex; flex-direction: column; gap: 0.6rem; }
.topic-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; display: flex; align-items: center; gap: 1rem; transition: var(--transition-slow); text-decoration: none; }
.topic-item:hover { border-color: var(--primary-light); box-shadow: var(--shadow); transform: translateX(4px); text-decoration: none; }
.topic-item.unread { border-left: 3px solid var(--primary); }
.topic-avatar img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.topic-main { flex: 1; min-width: 0; }
.topic-title { font-size: 0.95rem; font-weight: 600; color: var(--text); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 0.2rem; }
.topic-meta { display: flex; gap: 0.75rem; font-size: 0.78rem; color: var(--text-muted); flex-wrap: wrap; }
.topic-meta i { margin-right: 2px; }
.topic-stats { display: flex; gap: 1.25rem; text-align: center; flex-shrink: 0; }
.topic-stat-val { font-size: 0.95rem; font-weight: 700; color: var(--text); display: block; }
.topic-stat-lbl { font-size: 0.7rem; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   NOTIFICACIONES
   ════════════════════════════════════════════════════════════ */
.notification-list { display: flex; flex-direction: column; }
.notification-item { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: var(--transition); }
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: var(--bg-soft); }
.notification-item.unread { background: rgba(99,102,241,0.04); }
.notification-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.notification-body { flex: 1; min-width: 0; }
.notification-title { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.notification-msg { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; }
.notification-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.3rem; }
.notification-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 6px; }

/* ════════════════════════════════════════════════════════════
   GAMIFICACIÓN
   ════════════════════════════════════════════════════════════ */
.level-card { background: var(--primary-gradient); border-radius: var(--radius-xl); padding: 2rem; color: #fff; position: relative; overflow: hidden; }
.level-card::before { content: ''; position: absolute; top: -40px; right: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,0.08); }
.level-number { font-size: 3.5rem; font-weight: 900; line-height: 1; font-family: var(--font-heading); opacity: 0.9; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 1rem; }
.badge-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem 1rem; text-align: center; transition: var(--transition); }
.badge-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.badge-card.locked { opacity: 0.4; filter: grayscale(1); }
.badge-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin: 0 auto 0.6rem; }
.badge-name { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.badge-desc { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ════════════════════════════════════════════════════════════
   CERTIFICADO
   ════════════════════════════════════════════════════════════ */
@media print {
  header, footer, .btn, .sidebar { display: none !important; }
  .certificate-wrap { box-shadow: none; }
}
.certificate-wrap { max-width: 820px; margin: 2rem auto; background: #fff; border-radius: var(--radius-xl); border: 8px solid var(--primary); box-shadow: var(--shadow-lg); overflow: hidden; }
.certificate-header { background: var(--primary-gradient); padding: 2.5rem; text-align: center; color: #fff; }
.certificate-body { padding: 3rem; text-align: center; }
.certificate-title { font-size: 2.2rem; font-weight: 800; color: var(--primary); margin-bottom: 0.5rem; }
.certificate-student { font-size: 2.5rem; font-weight: 800; color: var(--text); font-family: var(--font-heading); border-bottom: 2px solid var(--primary-light); padding-bottom: 0.5rem; margin: 1rem 0; }
.certificate-code { display: inline-block; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 1.25rem; font-family: monospace; font-size: 0.9rem; color: var(--text-muted); margin-top: 1.5rem; }

/* ════════════════════════════════════════════════════════════
   LEARNING PATH
   ════════════════════════════════════════════════════════════ */
.path-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 1.5rem; }
.path-card { background: var(--bg-card); border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: var(--transition-slow); text-decoration: none; display: flex; flex-direction: column; }
.path-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); text-decoration: none; }
.path-card-banner { height: 8px; }
.path-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }
.path-tag { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.path-title { font-size: 1.1rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.path-desc  { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.path-stats { display: flex; gap: 1.25rem; font-size: 0.82rem; color: var(--text-muted); margin-top: auto; padding-top: 0.75rem; border-top: 1px solid var(--border-light); }

/* ════════════════════════════════════════════════════════════
   ADMIN PANEL
   ════════════════════════════════════════════════════════════ */
.admin-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

/* ── Sidebar ── */
.admin-sidebar {
  background: #0f172a;
  border-right: none;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.3) transparent;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 2px; }

.admin-sidebar-logo {
  padding: 1.4rem 1.35rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.admin-sidebar-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg,#6366f1,#8b5cf6);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
  flex-shrink: 0;
}
.admin-sidebar-logo-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  background: linear-gradient(135deg,#a5b4fc,#c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.admin-sidebar-logo-badge {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: rgba(148,163,184,0.5);
  line-height: 1;
  margin-top: 2px;
}

.admin-nav-body { padding: 0.75rem 0; flex: 1; }

.admin-nav-group { margin-bottom: 0.25rem; }
.admin-nav-label {
  padding: 0.8rem 1.35rem 0.3rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(148,163,184,0.45);
  display: block;
}
.admin-nav-label:not(:first-child) { border-top: 1px solid rgba(255,255,255,0.04); }

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.52rem 1.35rem;
  color: #94a3b8;
  font-size: 0.865rem;
  font-weight: 500;
  transition: all 0.18s ease;
  text-decoration: none;
  border-left: 3px solid transparent;
  position: relative;
}
.admin-nav-link:hover {
  background: rgba(99,102,241,0.07);
  color: #cbd5e1;
  border-left-color: rgba(99,102,241,0.35);
  text-decoration: none;
}
.admin-nav-link.active {
  background: rgba(99,102,241,0.14);
  color: #a5b4fc;
  border-left-color: #6366f1;
  font-weight: 600;
}
.admin-nav-link i {
  width: 17px;
  text-align: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  opacity: 0.75;
}
.admin-nav-link.active i { opacity: 1; color: #818cf8; }
.admin-nav-link.danger { color: #f87171; }
.admin-nav-link.danger:hover { background: rgba(239,68,68,0.08); color: #fca5a5; border-left-color: #ef4444; }
.admin-nav-link .nav-badge {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 0.6rem; font-weight: 700; padding: 1px 6px;
  border-radius: 50px; line-height: 1.5;
}
.nav-badge-warn { background: #f59e0b; color: #fff; }
.nav-badge-danger { background: #ef4444; color: #fff; }

/* Sidebar footer (user strip) */
.admin-sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 0.9rem 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.admin-sidebar-footer-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg,#6366f1,#8b5cf6);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; color: #fff; font-weight: 700;
  flex-shrink: 0;
}
.admin-sidebar-footer-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-sidebar-footer-role {
  font-size: 0.65rem;
  color: rgba(148,163,184,0.55);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ── Main content area ── */
.admin-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.admin-topbar h2 { font-size: 1.1rem; font-weight: 700; margin: 0; }
.admin-content { padding: 2rem 2.5rem; flex: 1; }

.admin-nav-section { margin-bottom: 1.5rem; }

/* ── Admin Modal ── */
.adm-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.52);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  opacity: 0; visibility: hidden;
  transition: opacity .22s, visibility .22s;
  padding: 1rem;
}
.adm-modal-overlay.show { opacity: 1; visibility: visible; }
.adm-modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
  width: 100%; max-width: 480px;
  max-height: 92vh; overflow-y: auto;
  transform: translateY(20px) scale(.97);
  transition: transform .22s;
}
.adm-modal-overlay.show .adm-modal { transform: none; }
.adm-modal-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.adm-modal-header h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.adm-modal-close {
  width: 30px; height: 30px;
  background: var(--bg-soft); border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); font-size: .9rem;
  transition: background .18s, color .18s;
}
.adm-modal-close:hover { background: #fef2f2; color: #ef4444; }
.adm-modal-body { padding: 1.5rem; }
.adm-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; gap: .5rem; justify-content: flex-end;
}

/* ════════════════════════════════════════════════════════════
   FEATURE SECTION
   ════════════════════════════════════════════════════════════ */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 1.5rem; }
.feature-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 2rem 1.5rem; text-align: center; transition: var(--transition-slow); }
.feature-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.feature-icon { width: 68px; height: 68px; background: var(--primary-gradient); color: #fff; border-radius: var(--radius-xl); display: flex; align-items: center; justify-content: center; font-size: 1.75rem; margin: 0 auto 1.25rem; box-shadow: 0 8px 20px rgba(99,102,241,0.3); }
.feature-item:nth-child(2) .feature-icon { background: linear-gradient(135deg,#06b6d4,#0284c7); box-shadow: 0 8px 20px rgba(6,182,212,0.3); }
.feature-item:nth-child(3) .feature-icon { background: linear-gradient(135deg,#10b981,#059669); box-shadow: 0 8px 20px rgba(16,185,129,0.3); }
.feature-item:nth-child(4) .feature-icon { background: linear-gradient(135deg,#f59e0b,#d97706); box-shadow: 0 8px 20px rgba(245,158,11,0.3); }
.feature-item h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.feature-item p  { font-size: 0.875rem; color: var(--text-muted); line-height: 1.55; }

/* ════════════════════════════════════════════════════════════
   CHAT
   ════════════════════════════════════════════════════════════ */
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
.message-bubble { max-width: 68%; padding: 0.7rem 1rem; border-radius: 18px; font-size: 0.9rem; line-height: 1.45; }
.message-bubble.sent { background: var(--primary-gradient); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.message-bubble.received { background: var(--bg-soft); color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-input-bar { display: flex; gap: 0.75rem; padding: 1rem 1.25rem; background: var(--bg-card); border-top: 1px solid var(--border); align-items: center; }
.chat-input-bar input { flex: 1; padding: 0.65rem 1rem; border: 2px solid var(--border); border-radius: var(--radius-full); font-family: inherit; font-size: 0.9rem; background: var(--bg-soft); color: var(--text); }
.chat-input-bar input:focus { outline: none; border-color: var(--primary); }

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
.footer { background: #0f172a; color: #cbd5e1; padding: 3.5rem 0 0; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3,1fr); gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-brand .logo { color: #fff; margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.875rem; color: #94a3b8; line-height: 1.6; max-width: 260px; }
.footer-social { display: flex; gap: 0.5rem; margin-top: 1rem; }
.social-btn { width: 36px; height: 36px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; background: #1e293b; color: #94a3b8; font-size: 0.9rem; transition: var(--transition); text-decoration: none; }
.social-btn:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.footer-col h4 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: #f1f5f9; margin-bottom: 1rem; }
.footer-link { display: block; font-size: 0.875rem; color: #94a3b8; padding: 0.2rem 0; transition: var(--transition); text-decoration: none; }
.footer-link:hover { color: var(--primary-light); padding-left: 4px; }
.footer-bottom { border-top: 1px solid #1e293b; padding: 1.25rem 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; font-size: 0.8rem; color: #64748b; }
.footer-bottom-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-bottom a { color: #64748b; text-decoration: none; }
.footer-bottom a:hover { color: var(--primary-light); }

/* ════════════════════════════════════════════════════════════
   GRIDS & UTILIDADES
   ════════════════════════════════════════════════════════════ */
.grid   { display: grid; }
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }
.gap-16 { gap: 1rem; } .gap-20 { gap: 1.25rem; } .gap-24 { gap: 1.5rem; } .gap-32 { gap: 2rem; }

.text-center { text-align: center; } .text-right { text-align: right; }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; } .fw-800 { font-weight: 800; }
.fs-sm  { font-size: 0.82rem; } .fs-lg  { font-size: 1.1rem; }

.mt-0{margin-top:0} .mt-4{margin-top:.25rem} .mt-8{margin-top:.5rem} .mt-12{margin-top:.75rem}
.mt-16{margin-top:1rem} .mt-24{margin-top:1.5rem} .mt-32{margin-top:2rem}
.mb-4{margin-bottom:.25rem} .mb-8{margin-bottom:.5rem} .mb-16{margin-bottom:1rem}
.mb-24{margin-bottom:1.5rem} .mb-2{margin-bottom:.5rem}
.me-8{margin-right:.5rem}

.d-flex{display:flex} .align-center{align-items:center} .justify-between{justify-content:space-between}
.gap-8{gap:.5rem} .gap-12{gap:.75rem} .flex-wrap{flex-wrap:wrap}

.rounded{border-radius:var(--radius)} .rounded-lg{border-radius:var(--radius-lg)}
.rounded-xl{border-radius:var(--radius-xl)} .rounded-full{border-radius:var(--radius-full)}

.bg-light{background:var(--bg-soft)} .bg-card{background:var(--bg-card)}
.p-16{padding:1rem} .p-24{padding:1.5rem} .p-32{padding:2rem}

.separator { width: 48px; height: 4px; background: var(--primary-gradient); border-radius: var(--radius-full); margin: 0.75rem 0; }
.separator.center { margin: 0.75rem auto; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border) 50%, var(--bg-soft) 75%); background-size: 200% 100%; animation: skeleton-load 1.4s ease infinite; border-radius: var(--radius); }
@keyframes skeleton-load { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.fade-in { animation: fadeIn 0.4s ease both; }

/* WhatsApp */
.whatsapp-float { position: fixed; bottom: 1.5rem; right: 1.5rem; width: 52px; height: 52px; background: #25d366; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.5rem; box-shadow: 0 4px 20px rgba(37,211,102,0.4); z-index: 500; transition: var(--transition); text-decoration: none; }
.whatsapp-float:hover { transform: scale(1.1); color: #fff; }

/* Learning path detail */
.learning-path-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; background: var(--bg-card); border-radius: var(--radius-xl); padding: 2rem; margin-bottom: 2rem; border: 1px solid var(--border); box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.path-info { flex: 1; min-width: 0; }
.path-cover { width: 200px; height: 130px; object-fit: cover; border-radius: var(--radius-lg); flex-shrink: 0; }

.course-list { display: flex; flex-direction: column; gap: 1rem; }
.course-item { display: flex; align-items: center; gap: 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; transition: var(--transition); }
.course-item:hover { box-shadow: var(--shadow); border-color: var(--primary-light); }
.course-number { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-soft); color: var(--primary); font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; flex-direction: column; gap: 1px; }
.course-thumbnail img { width: 80px; height: 52px; object-fit: cover; border-radius: var(--radius); flex-shrink: 0; }
.course-info { flex: 1; min-width: 0; }
.course-info h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.25rem; }
.course-actions { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; min-width: 120px; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */

/* ── Overlay sidebar admin (móvil) ── */
.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 899;
  backdrop-filter: blur(2px);
}
.admin-sidebar-overlay.show { display: block; }

/* ── Botón hamburguesa admin topbar ── */
.admin-topbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: none;
  background: var(--bg-soft, #f1f5f9);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted, #64748b);
  flex-shrink: 0;
  transition: background .15s;
}
.admin-topbar-toggle:hover { background: var(--border); }

/* ── Tablas responsivas ── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Auto-scroll en tablas del admin en pantallas pequeñas */
@media (max-width: 768px) {
  .admin-content .card { overflow-x: auto; }
  .admin-content table { min-width: 600px; }
}

/* ── Botón filtros móvil (cursos) ── */
.filter-toggle-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--surface, #fff);
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text, #374151);
  cursor: pointer;
  margin-bottom: 16px;
  width: 100%;
  justify-content: center;
}
.filter-toggle-btn:hover { border-color: var(--primary, #6366f1); color: var(--primary, #6366f1); }

@media (max-width: 1024px) {
  :root { --sidebar-width: 220px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 1.5rem 1.75rem; }
  .admin-topbar { padding: 0.75rem 1.5rem; }
}

@media (max-width: 768px) {
  /* ── Navbar principal ── */
  .menu-toggle { display: flex; }
  .nav-menu { display: none; position: fixed; top: var(--header-height); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg-card); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md); padding: 0.75rem; z-index: 999; }
  .nav-menu.show { display: flex; }
  .nav-link { padding: 0.7rem 1rem; }
  .user-name { display: none; }

  /* ── Dashboard / Admin layouts ── */
  .dashboard-layout { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    z-index: 900;
    height: 100vh;
    width: 260px;
    transition: left 0.28s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
  }
  .admin-sidebar.open { left: 0; }
  .admin-topbar-toggle { display: flex; }
  .admin-topbar { padding: 0.65rem 1rem; gap: .5rem; }
  .admin-topbar h2 { font-size: .95rem; }
  .admin-content { padding: 1rem 1rem 2rem; }

  /* ── Sidebar cursos (dashboard usuario) ── */
  .sidebar { position: fixed; top: var(--header-height); left: -100%; z-index: 900; width: 260px; transition: left 0.3s ease; box-shadow: var(--shadow-md); }
  .sidebar.open { left: 0; }
  .page-content { padding: 1.25rem; }

  /* ── Botón filtros cursos.php ── */
  .filter-toggle-btn { display: flex; }
  .filter-sidebar { display: none; }
  .filter-sidebar.open { display: block; }

  /* ── Hero ── */
  .hero-slider { height: 380px; }
  .slide-content { padding: 2rem 1.5rem; }
  .slide-content h1 { font-size: 1.65rem; }

  /* ── Grids ── */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .courses-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .badge-grid { grid-template-columns: repeat(3,1fr); }

  /* ── Footer ── */
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; text-align: center; }

  /* ── Auth / misc ── */
  .auth-card { padding: 1.75rem 1.25rem; }
  .learning-path-header { flex-direction: column; }
  .path-cover { width: 100%; height: 160px; }

  /* ── Modales admin full-screen en móvil ── */
  .adm-modal-overlay { align-items: flex-end; padding: 0; }
  .adm-modal {
    max-width: 100% !important;
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    overflow-y: auto;
    transform: translateY(40px);
  }
  .adm-modal-overlay.show .adm-modal { transform: translateY(0); }

  /* ── Stat cards en admin ── */
  .stat-card { padding: 1rem; gap: .85rem; }
  .stat-icon  { width: 40px; height: 40px; font-size: 1rem; }
  .stat-value { font-size: 1.4rem; }

  /* ── Course item (rutas) ── */
  .course-item { flex-wrap: wrap; }
  .course-actions { min-width: unset; flex-direction: row; align-items: center; }
}

@media (max-width: 480px) {
  .hero-slider { height: 260px; }
  .slide-content { padding: 1.25rem; }
  .slide-content p { display: none; }
  .slide-content h1 { font-size: 1.3rem; }
  .features-grid { grid-template-columns: 1fr; }
  .badge-grid { grid-template-columns: repeat(2,1fr); }
  .courses-grid { gap: 1rem; }
  .section { padding: 2.5rem 0; }

  /* ── Admin ── */
  .admin-content { padding: .75rem .75rem 2rem; }
  .admin-topbar  { padding: .5rem .75rem; }

  /* ── Botones en modales ── */
  .adm-modal-footer { flex-direction: column; gap: .5rem; }
  .adm-modal-footer .btn { width: 100%; justify-content: center; }

  /* ── Stat grid 2 columnas en 480 ── */
  .stat-card { padding: .85rem; }
}
