/* =================================================
   VARIABLES DE TEMA (AZUL / MODO CLARO)
================================================= */
:root {
  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-soft: #e5e7eb;
  --bg-app: #f4f6f9;
}

/* =================================================
   SHELL / LAYOUT GENERAL
================================================= */
.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  background: var(--bg-app);
}

/* =================================================
   SIDEBAR
================================================= */
.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border-soft);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
}

/* =================================================
   BRANDING (LOGO + TEXTO)
================================================= */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 20px;
}

.brand__logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
}

.brand__text strong {
  font-size: 14px;
  color: var(--text-main);
}

.brand__text span {
  font-size: 12px;
  color: var(--text-muted);
}

/* =================================================
   NAVEGACIÓN PRINCIPAL
================================================= */
.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-main);
  transition: background .15s ease, color .15s ease;
}

.nav__link:hover {
  background: var(--blue-50);
  color: var(--blue-700);
}

.nav__link.is-active {
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 600;
}

/* =================================================
   FOOTER SIDEBAR
================================================= */
.sidebar__footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

/* =================================================
   MAIN
================================================= */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* =================================================
   TOPBAR
================================================= */
.topbar {
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.pageTitle {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* =================================================
   CONTENT
================================================= */
.content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

/* =================================================
   TABLET (<=1024px)
================================================= */
@media (max-width: 1024px) {
  .shell {
    grid-template-columns: 220px 1fr;
  }

  .brand__text span {
    display: none;
  }
}

/* =================================================
   MÓVIL (<=768px)
================================================= */
@media (max-width: 768px) {

  /* Layout pasa a una columna */
  .shell {
    grid-template-columns: 1fr;
  }

  /* Sidebar como overlay */
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 1200;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  /* Topbar más compacta */
  .topbar {
    padding: 0 16px;
  }

  .pageTitle {
    font-size: 16px;
  }

  /* Ocultar badges grandes */
  #companyBadge {
    display: none;
  }
}

/* =================================================
   OVERLAY SIDEBAR (MÓVIL)
================================================= */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 1100;
  display: none;
}

.sidebar-overlay.is-visible {
  display: block;
}

/* =================================================
   BOTÓN MENÚ
================================================= */
.menu-btn {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.shell:not(.is-collapsed) .menu-btn {
  opacity: .6;
}



/* =================================================
   SIDEBAR COLAPSADO (DESKTOP)
================================================= */
.shell.is-collapsed {
  grid-template-columns: 72px 1fr;
}

/* Sidebar colapsado */
.shell.is-collapsed .sidebar {
  padding: 16px 8px;
}

/* Ocultar textos */
.shell.is-collapsed .brand__text,
.shell.is-collapsed .nav__link span {
  display: none;
}

/* Centrar logo */
.shell.is-collapsed .brand {
  justify-content: center;
}

/* Links centrados */
.shell.is-collapsed .nav__link {
  justify-content: center;
  padding: 10px;
}



