/* =========================================================
   🎓 LMS PERÚ PRO - DESIGN SYSTEM
========================================================= */

/* =========================
   🌐 RESET + BASE
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Inter, system-ui, Arial, sans-serif;
}

body {
  background: linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%);
  color: #1f1f1f;
  overflow-x: hidden;
  font-size: 14px;
}

/* =========================
   🎨 VARIABLES
========================= */
:root {
  --primary: #d32f2f;
  --primary-dark: #b71c1c;
  --bg-soft: #f7f7f7;
  --card: #ffffff;
  --text: #1f1f1f;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* =========================
   🧭 HEADER
========================= */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;

  background: linear-gradient(
    90deg,
    #60A5FA,
    #A78BFA,
    #10B981
  );

  color: #fff;
  border-bottom: 3px solid #b71c1c;

  z-index: 2500; /* 🔥 encima de todo */
}


.user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-auth {
  background: transparent;white;
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: 0.2s;
}

.btn-auth:hover {
  background: #f3f3f3;
}


.topbar-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
}

/* BOTONES */
.hamburger {
  position: absolute;
  left: 5px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  width: 100px;
}

#rightToggle {
  position: absolute;
  right: 15px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/* =========================
   📦 SIDEBAR (FIX CRÍTICO)
========================= */
.sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  width: 250px;
  height: calc(100% - 60px);

  background: #ffffff;
  border-right: 1px solid var(--border);

  transform: translateX(-100%);
  transition: 0.25s ease;

  z-index: 2000; /* 🔥 clave */
  box-shadow: var(--shadow);

  visibility: hidden;
  opacity: 0;
}

.sidebar.active {
  transform: translateX(0);
  visibility: visible;
  opacity: 1;
}

.sidebar-header {
  padding: 15px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--primary);
}

.menu {
  display: flex;
  flex-direction: column;
}

.menu a {
  padding: 12px 15px;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: 0.2s;
}

.menu a:hover {
  background: #fff5f5;
  border-left: 3px solid var(--primary);
  color: var(--primary);
}

/* =========================
   🌫 OVERLAY (FIX)
========================= */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);

  display: none;

  z-index: 1999;
}

#overlay.active {
  display: block;
}

/* =========================
   📄 APP CONTENT
========================= */
#app {
  margin-top: 60px;
  padding: 20px;
  margin-left: 0;
  transition: 0.25s;
}

.menu-open #app {
  margin-left: 250px;
}

/* =========================
   🧭 RIGHT PANEL (IMPORTANTE)
========================= */
#rightPanel {
  position: fixed;
  right: 0;
  top: 60px;
  width: 280px;
  height: calc(100% - 60px);

  z-index: 1500; /* 🔥 debajo del sidebar */
}

/* =========================
   📦 CARDS
========================= */
.card {
  background: var(--card);
  padding: 16px;
  border-radius: 10px;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
  margin-bottom: 15px;
}

/* =========================
   📱 RESPONSIVE
========================= */
@media (max-width: 768px) {
  .sidebar {
    width: 220px;
  }

  .menu-open #app {
    margin-left: 0;
  }
}