/* =========================
   HEADER
========================= */
.app-header {
  height: 58px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 18px;
}

.app-header-left,
.app-header-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.app-header-right {
  justify-content: flex-end;
}

.app-header-title {
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
}

/* =========================
   SHELL (INDEX / BIBLIOTECA BASE)
========================= */
.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 58px);
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 24px 18px;
}

.sidebar-title {
  margin: 0 0 18px 0;
  font-size: 1.5rem;
  font-weight: 800;
}

.main-area,
.content {
  padding: 18px 20px 28px 20px;
  min-width: 0;
}

.topbar {
  margin-bottom: 18px;
}

/* Overrides de Tema */
:root.dark .app-header {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}
:root.dark .app-header-title,
:root.dark .sidebar-title {
  color: var(--text);
}
:root.dark .sidebar {
  background: var(--panel);
  border-right-color: var(--line);
}

:root.crema .app-header {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}
:root.crema .sidebar {
  background: var(--panel);
  border-right-color: var(--line);
}

/* Responsive */
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}
