/* ===========================================
   SAT MANAGER - LAYOUT (Sidebar, Topbar, Main)
   =========================================== */

/* SIDEBAR FLOTANTE CON CRISTAL */
.sidebar {
  position: fixed;
  top: 16px;
  left: 16px;
  width: var(--sidebar);
  height: calc(100vh - 32px);
  background: rgba(17, 21, 33, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease;
}
:root.claro .sidebar { background: rgba(255, 255, 255, 0.8); }

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.logo-icon { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; text-decoration: none; }
.logo-frame { background: #fff; border-radius: 12px; padding: 10px 14px; display: inline-flex; line-height: 0; box-shadow: var(--shadow-sm); }
.logo-img { height: 40px; width: auto; display: block; }
.logo-text { font-size: var(--text-lg); font-weight: 800; color: var(--text-primary); letter-spacing: -.03em; background: var(--brand-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo-sub { font-size: var(--text-xs); color: var(--text-secondary); letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }

/* MENÚ ACORDEÓN */
.nav-section { padding: 16px 12px 4px; }
.nav-label { cursor: pointer; display: flex; justify-content: flex-start; align-items: center; user-select: none; font-size: var(--text-xs); font-weight: 700; color: var(--text-tertiary); letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 12px; margin-bottom: 4px; border-radius: var(--radius-md); transition: all 0.2s ease; gap: 10px; }
.nav-label:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-label::before { content: ''; width: 3px; height: 14px; background: var(--brand-gradient); border-radius: 2px; opacity: 0.7; flex-shrink: 0; }
.nav-label .chevron { transition: transform 0.2s ease; width: 14px; height: 14px; opacity: 0.5; margin-left: auto; }
.nav-items-wrap { overflow: hidden; transition: max-height 0.3s ease-in-out; max-height: 1000px; padding-left: 12px; }
.nav-section.collapsed .nav-items-wrap { max-height: 0 !important; }
.nav-section.collapsed .nav-label .chevron { transform: rotate(-90deg); }

.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-md); color: var(--text-secondary); text-decoration: none; font-size: var(--text-md); font-weight: 500; transition: all 0.2s ease; margin-bottom: 2px; position: relative; }
.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item.active { background: var(--info-bg); color: var(--info); font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 25%; bottom: 25%; width: 3px; background: var(--brand-primary); border-radius: 0 4px 4px 0; }
.nav-item .icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: var(--text-2xs); font-weight: 700; padding: 2px 7px; border-radius: 20px; }

.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid var(--border-subtle); }
.user-info { display: flex; align-items: center; gap: 10px; background: var(--bg-elevated); padding: 10px; border-radius: var(--radius-md); }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-gradient); display: grid; place-items: center; font-size: var(--text-md); font-weight: 800; color: #fff; flex-shrink: 0; }
.user-name { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.user-role { font-size: var(--text-2xs); color: var(--text-secondary); text-transform: capitalize; }
.logout-btn { margin-left: auto; color: var(--text-tertiary); text-decoration: none; font-size: var(--text-lg); padding: 6px; border-radius: var(--radius-sm); transition: all 0.2s; }
.logout-btn:hover { color: var(--danger); background: var(--danger-bg); }

/* CONTENIDO PRINCIPAL */
.main { margin-left: calc(var(--sidebar) + 32px); padding: 32px 40px; min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.page-title { font-size: var(--text-xl); font-weight: 800; color: var(--text-primary); letter-spacing: -.04em; }

/* HAMBURGER MENU (OCULTO EN DESKTOP) */
.hamburger-btn { display: none; background: var(--bg-elevated); border: 1px solid var(--border-default); color: var(--text-primary); padding: 8px; border-radius: var(--radius-md); cursor: pointer; align-items: center; justify-content: center; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 99; }

/* RESPONSIVE TABLET */
@media (max-width: 1024px) {
  :root { --sidebar: 220px; }
  .main { margin-left: 240px; padding: 24px 20px; }
  .page-title { font-size: 22px; }
}

/* RESPONSIVE MOVIL */
@media (max-width: 768px) {
  .hamburger-btn { display: flex; }
  .sidebar { transform: translateX(-100%); z-index: 1001; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }
  
  .main { margin-left: 0; padding: 16px 12px; }
  .page-title { font-size: 20px; }
}