/* ─────────────────────────────────────────────────
   APP SHELL (después del login)
───────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none !important; }
}

/* ── SIDEBAR ── */
.sidebar {
  background: var(--bg1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 24px 20px 20px;
  font-family: var(--font-h);
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--p2), var(--c));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo span {
  font-size: 11px;
  font-weight: 400;
  display: block;
  color: var(--t3);
  -webkit-text-fill-color: var(--t3);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}
.sidebar-section {
  padding: 16px 12px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--t3);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 2px 8px;
  border-radius: var(--r2);
  cursor: pointer;
  font-size: 14px;
  color: var(--t2);
  transition: background .15s, color .15s;
  user-select: none;
}
.nav-item:hover { background: var(--bg3); color: var(--t1); }
.nav-item.active {
  background: var(--p3);
  color: var(--p2);
  font-weight: 500;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 16px;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r2);
  cursor: pointer;
  transition: background .15s;
}
.user-pill:hover { background: var(--bg3); }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--p), var(--c));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-h);
  font-size: 13px; font-weight: 700;
  color: #fff; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--t3); }

/* ── TOPBAR (mobile) ── */
.topbar {
  display: none;
  background: var(--bg1);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: 52px;
  align-items: center;
  justify-content: space-between;
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  flex-shrink: 0;
}
@media (max-width: 900px) { .topbar { display: flex; } }
@media (max-width: 900px) { .main { padding-top: 68px !important; } }
.topbar-logo {
  font-family: var(--font-h); font-size: 20px; font-weight: 700;
  background: linear-gradient(135deg, var(--p2), var(--c));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hamburger {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px; padding: 7px;
  color: var(--t2); display: flex; flex-direction: column;
  justify-content: space-between; gap: 0; flex-shrink: 0;
}
.hamburger span {
  display: block; width: 100%; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform .25s, opacity .2s;
  transform-origin: center;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 298;
}
.drawer-overlay.is-open { display: block; }
.sidebar-drawer {
  position: fixed; top: 52px; left: 0; width: 280px;
  height: calc(100% - 52px);
  z-index: 299; background: var(--bg1);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(-110%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; overflow-x: hidden;
}
.sidebar-drawer.is-open { transform: translateX(0); }
.drawer-overlay { top: 52px; }


/* ── WRAPPER MOBILE ── */
.mobile-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.mobile-shell .app-shell {
  flex: 1;
}

/* ── MAIN CONTENT ── */
.main {
  background: var(--bg0);
  overflow-y: auto;
  padding: 32px;
}
@media (max-width: 600px) { .main { padding: 16px; } }

.page-header { margin-bottom: 28px; }
.page-title {
  font-family: var(--font-h);
  font-size: 26px; font-weight: 700;
  line-height: 1.1; margin-bottom: 4px;
}
.page-sub { color: var(--t2); font-size: 14px; }
