:root {
  --brand: #f3711b;
  --brand-dark: #d95e0e;
  --sidebar-w: 250px;
  --bg-body: #f5f6f8;
  --border: #e6e8eb;
}

body {
  background: var(--bg-body);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1f2937;
}

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

/* ---------- Sidebar ---------- */
.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  min-height: 100vh;
  padding: 20px 14px;
}
.sidebar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand);
  padding: 6px 8px 20px;
}
.sidebar-section-title {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9aa1ab;
  padding: 16px 10px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  font-size: .92rem;
  margin-bottom: 2px;
}
.sidebar-link i { width: 18px; text-align: center; color: #9aa1ab; }
.sidebar-link:hover { background: #f8f4f0; color: var(--brand-dark); }
.sidebar-link.active { background: #fdece0; color: var(--brand); font-weight: 600; }
.sidebar-link.active i { color: var(--brand); }

/* ---------- Topbar ---------- */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-topbar-actions { display: flex; align-items: center; gap: 14px; }
.avatar-circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.app-content { padding: 28px; }

/* ---------- Componentes reutilizables ---------- */
.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; display: flex; align-items: center; gap: 14px;
}
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.stat-card .stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { color: #6b7280; font-size: .82rem; }

.course-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; height: 100%; display: flex; flex-direction: column;
  transition: box-shadow .15s ease;
}
.course-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.course-card .course-cover {
  height: 140px; background: linear-gradient(135deg, #fde3cf, #f3711b33);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand); font-size: 2rem;
}
.course-card .course-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-card .progress { height: 6px; }

.badge-nivel { background: #eef2ff; color: #4338ca; }
.badge-categoria { background: #e0f2fe; color: #075985; }

.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.lesson-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 8px; text-decoration: none; color: inherit;
}
.lesson-row:hover { background: #f8f9fb; }
.lesson-row.active { background: #fdece0; }
.lesson-row .lesson-num {
  width: 26px; height: 26px; border-radius: 50%; background: #eee;
  display: flex; align-items: center; justify-content: center; font-size: .75rem; flex-shrink: 0;
}
.lesson-row.completed .lesson-num { background: #16a34a; color: #fff; }

.video-embed { position: relative; width: 100%; padding-top: 56.25%; background: #0b1220; border-radius: 10px; overflow: hidden; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-body); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 36px; border: 1px solid var(--border); }
