
/* ═══════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  z-index: 20;
  transition: width .25s cubic-bezier(.4,0,.2,1), transform .25s cubic-bezier(.4,0,.2,1) !important;
}

/* Overlay para cerrar sidebar en móvil */
#sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 19;
  backdrop-filter: blur(2px);
}

/* Fondo sutil con patrón de puntos */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--sb-brand);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--primary-mid), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -.5px;
  box-shadow: 0 4px 12px rgba(27,79,216,.4);
}

.brand-text { flex: 1; min-width: 0; }
.brand-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub { font-size: 11px; color: var(--g400); margin-top: 2px; }

.nav-section { padding: 10px 0 4px; }
.nav-label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--sb-txt);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 8px 18px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--sb-txt);
  transition: all var(--t);
  user-select: none;
  text-decoration: none;
  margin: 1px 10px;
  border-radius: var(--r);
  position: relative;
}
.nav-item:hover {
  background: var(--sb-hover);
  color: #fff;
}
.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(27,79,216,.4);
}
.nav-item.active i { opacity: 1; }
.nav-item i { font-size: 17px; opacity: .7; transition: opacity var(--t); }
.nav-item:hover i { opacity: 1; }

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  background: var(--bad);
  color: #fff;
  padding: 2px 6px;
  border-radius: 10px;
  line-height: 1.4;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid var(--sb-brand);
}
.sidebar-footer-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,.05);
  border-radius: var(--r);
  border: 1px solid rgba(255,255,255,.06);
}
.sf-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sf-name { font-size: 11.5px; font-weight: 600; color: #fff; line-height: 1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sf-role { font-size: 10.5px; color: var(--g400); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-footer-inner:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.12); }

/* ═══ Mi cuenta — pestañas ═══ */
.acc-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--g150);
  margin-bottom: 18px;
  overflow-x: auto;
}
.acc-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  font-size: 12.5px; font-weight: 600;
  color: var(--g400);
  background: none; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.acc-tab:hover { color: var(--g700); }
.acc-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.acc-panel { display: none; }
.acc-panel.active { display: block; }

/* ═══ Toggle / switch ═══ */
.acc-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--g100);
}
.acc-toggle-row:last-of-type { border-bottom: none; }
.acc-toggle-label { font-size: 13px; font-weight: 600; color: var(--g800); }
.acc-toggle-desc { font-size: 11.5px; color: var(--g400); margin-top: 2px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--g200); transition: .2s; border-radius: 999px;
}
.switch .slider::before {
  content: ""; position: absolute; width: 16px; height: 16px;
  left: 3px; bottom: 3px; background: #fff; transition: .2s; border-radius: 50%;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.acc-theme-btn.acc-active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* ═══════════════════════════════════
   MAIN
   ═══════════════════════════════════ */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--g0);
  border-bottom: 1px solid var(--g150);
  display: flex;
  align-items: center;
  padding: 0 26px;
  gap: 14px;
  flex-shrink: 0;
  box-shadow: var(--sh-xs);
}

.topbar-left { display: flex; align-items: center; gap: 10px; flex: 1; }
.topbar-breadcrumb {
  font-size: 11px;
  color: var(--g400);
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-breadcrumb span:last-child { color: var(--g700); font-weight: 600; }
.topbar-sep { color: var(--g300); }
.topbar-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--g800);
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid;
}
.chip-blue  { background: var(--primary-light); color: var(--primary-dark); border-color: var(--primary-mid); }
.chip-green { background: var(--accent-light);  color: var(--accent-dark);  border-color: var(--accent); }
.chip-gray  { background: var(--g100); color: var(--g500); border-color: var(--g200); }
.chip i { font-size: 13px; }

.topbar-icon-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--g150);
  border-radius: var(--r);
  background: var(--g0);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--g500);
  font-size: 17px;
  transition: all var(--t);
  position: relative;
}
.topbar-icon-btn:hover { background: var(--g50); color: var(--g700); border-color: var(--g200); }
.notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bad); border: 1.5px solid #fff;
}

/* ═══════════════════════════════════
   PANEL DE NOTIFICACIONES
   ═══════════════════════════════════ */
.notif-panel {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 340px; max-width: 90vw; max-height: 420px;
  background: var(--g0); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg); border: 1px solid var(--g100);
  z-index: 1100; overflow: hidden;
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(-6px) scale(.97);
  pointer-events: none; transition: opacity .15s, transform .15s;
}
.notif-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--g100);
  font-size: 13px; font-weight: 700; color: var(--g800);
}
.notif-mark-all {
  background: none; border: none; cursor: pointer;
  font-size: 11.5px; font-weight: 600; color: var(--primary);
  padding: 0;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-panel-list { overflow-y: auto; max-height: 360px; }
.notif-empty { padding: 28px 14px; text-align: center; color: var(--g400); font-size: 13px; }
.notif-item {
  display: flex; gap: 10px; padding: 11px 14px;
  border-bottom: 1px solid var(--g100); cursor: pointer;
  transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--g50); }
.notif-item.unread { background: rgba(27,79,216,.04); }
.notif-icon {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.notif-icon.warn { background: var(--warn-bg); color: var(--warn-txt); }
.notif-icon.info { background: rgba(27,79,216,.12); color: var(--primary); }
.notif-icon.ok   { background: var(--ok-bg); color: var(--ok-txt); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 12.5px; font-weight: 600; color: var(--g700); line-height: 1.35; }
.notif-time { font-size: 10.5px; color: var(--g400); margin-top: 2px; }
.notif-unread-mark { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 4px; }

/* ═══════════════════════════════════
   CONTENT AREA
   ═══════════════════════════════════ */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px;
  scroll-behavior: smooth;
}

/* ═══════════════════════════════════
   PAGES
   ═══════════════════════════════════ */
.page { display: none; animation: fadeIn .18s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

