/* ==========================================================================
   LH Enterprise OS — Layout del shell (sidebar, header, breadcrumb, contenido)
   ========================================================================== */

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 1000;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
}
.skip-link:focus { left: 12px; }

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-gradient);
}

/* --------------------------------------------------------------------------
   SIDEBAR
   -------------------------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  transition: width 0.22s ease;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
  padding: 18px 16px 16px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 12px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.brand-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand-company { font-size: 1.05rem; font-weight: 800; letter-spacing: 0.02em; }
.brand-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; color: var(--sidebar-muted);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.25);
}

.sidebar-platform {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
}
.plat-name { font-size: 0.82rem; font-weight: 700; color: #fff; }
.plat-sub { font-size: 0.7rem; color: var(--sidebar-muted); letter-spacing: 0.04em; text-transform: uppercase; }

.sidebar-nav { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-group-title {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--sidebar-muted); padding: 6px 12px 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  border: 0; background: transparent; color: var(--sidebar-text);
  padding: 10px 12px; border-radius: 10px;
  text-align: left; cursor: pointer; font-size: 0.9rem; width: 100%;
  position: relative; transition: background 0.15s ease, color 0.15s ease;
}
.nav-item .nav-ico { display: inline-flex; opacity: 0.85; flex-shrink: 0; }
.nav-item:hover { background: rgba(255, 255, 255, 0.08); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(255, 87, 34, 0.28), rgba(255, 87, 34, 0.08));
  color: #fff;
}
.nav-item.active .nav-ico { opacity: 1; color: var(--orange); }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--orange);
}

.sidebar-foot { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.collapse-btn {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04);
  color: var(--sidebar-text); padding: 9px 12px; border-radius: 10px;
  cursor: pointer; font-size: 0.82rem;
}
.collapse-btn:hover { background: rgba(255, 255, 255, 0.1); }
.sidebar-signature { font-size: 0.68rem; color: var(--sidebar-muted); text-align: center; }

/* Estado colapsado (rail de iconos) */
.app-shell.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.app-shell.sidebar-collapsed .brand-text,
.app-shell.sidebar-collapsed .sidebar-platform,
.app-shell.sidebar-collapsed .nav-group-title,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .collapse-label,
.app-shell.sidebar-collapsed .sidebar-signature { display: none; }
.app-shell.sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 0; }
.app-shell.sidebar-collapsed .nav-item { justify-content: center; padding-inline: 0; }
.app-shell.sidebar-collapsed .collapse-btn { justify-content: center; }

/* --------------------------------------------------------------------------
   MAIN PANEL + TOPBAR
   -------------------------------------------------------------------------- */
.main-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }

.topbar {
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.topbar-inner {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 22px; min-height: var(--header-h);
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-mobile { display: none; }
.topbar-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; flex-shrink: 0; }
.topbar-identity { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.topbar-title { font-size: 1rem; font-weight: 800; color: var(--text); white-space: nowrap; }
.topbar-subtitle { font-size: 0.76rem; color: var(--text-muted); white-space: nowrap; }
.topbar-signature { font-size: 0.68rem; color: var(--orange); font-weight: 700; white-space: nowrap; }

.topbar-center { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: 8px; min-width: 0; flex-shrink: 1; }
.topbar-sep { width: 1px; height: 30px; background: var(--border); margin: 0 4px; }

/* --------------------------------------------------------------------------
   CONTENIDO + BREADCRUMB + PAGE HEADER
   -------------------------------------------------------------------------- */
.content { flex: 1; overflow-y: auto; padding: 20px 22px 40px; outline: none; }

.subbar { margin-bottom: 6px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.crumb { font-size: 0.82rem; color: var(--text-muted); }
.crumb--current { color: var(--text); font-weight: 700; }
.crumb-sep { display: inline-flex; color: var(--text-soft); }

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin: 6px 0 18px;
}
.page-heading h1 { font-size: 1.5rem; letter-spacing: -0.01em; }
.page-heading p { margin-top: 4px; color: var(--text-muted); font-size: 0.92rem; }
.page-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.data-mode-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 999px;
}
.data-mode-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--green); box-shadow: 0 0 0 3px var(--green-soft);
}
.data-mode-separator { color: var(--text-soft); }

.page-body { min-height: 40vh; }
.stack { display: flex; flex-direction: column; gap: 18px; }
