/* ============================================================
   layout.css — App shell, sidebar, topbar, content wrapper
   ============================================================ */

/* ── APP SHELL ── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR (alineado a la maqueta: 240px, tile de marca, tarjeta de usuario) ── */
.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 22px;
}

.brand-tile {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--g);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-tile .brand-icon {
  font-size: 22px;
  color: #fff;
}

.brand-text { min-width: 0; }

.brand-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  letter-spacing: 0;
  text-transform: none;
}

.brand-sub {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.50);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 3px;
}

#nav-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
  padding: 0 12px;
  margin: 12px 0 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0;
  color: var(--sidebar-text);
  transition: background 0.14s, color 0.14s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.92);
}

.nav-item.active {
  background: var(--g);
  color: #fff;
}

.nav-icon {
  font-size: 21px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.10);
  margin: 12px 0;
}

/* Botón "Mapa de roles" */
.sidebar-rolesmap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 12.5px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.66);
  margin: 6px 0 10px;
  transition: background 0.14s, color 0.14s;
}

.sidebar-rolesmap:hover {
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.92);
}

.sidebar-rolesmap .msym { font-size: 19px; }

/* Tarjeta de usuario (footer) */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.su-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--avatar, #2F5A41);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.su-text { min-width: 0; flex: 1; }

.su-name {
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.su-sub {
  color: rgba(255, 255, 255, 0.50);
  font-size: 11px;
}

.su-logout {
  border: none;
  background: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.50);
  padding: 6px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: background 0.14s, color 0.14s;
}

.su-logout:hover { background: rgba(255, 255, 255, 0.10); color: #fff; }
.su-logout .msym { font-size: 19px; }

/* ── CONTENT AREA ── */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
}

/* ── PAGE WRAPPER ── */
.page {
  display: none;
  padding: 24px 26px 36px;
  min-height: 100%;
}

.page.active {
  display: block;
}

/* ── PAGE HEADER ── */
.page-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.page-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.page-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}


.form-grid small {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  color: var(--muted);
}

/* ── Tono de menú CLARO (D1): override de colores hardcodeados del sidebar ── */
body.sidebar-light .sidebar { border-right: 1px solid var(--border, #e3e7e0); }
body.sidebar-light .brand-name { color: #14241B; }
body.sidebar-light .brand-sub { color: rgba(20,36,27,0.50); }
body.sidebar-light .nav-section-label { color: rgba(20,36,27,0.42); }
body.sidebar-light .nav-item:hover { background: rgba(20,36,27,0.06); color: #14241B; }
body.sidebar-light .sidebar-divider { background: rgba(20,36,27,0.10); }
body.sidebar-light .sidebar-rolesmap { background: rgba(20,36,27,0.05); color: rgba(20,36,27,0.70); }
body.sidebar-light .sidebar-rolesmap:hover { background: rgba(20,36,27,0.10); color: #14241B; }
body.sidebar-light .sidebar-user { border-top: 1px solid rgba(20,36,27,0.10); }
body.sidebar-light .su-name { color: #14241B; }
body.sidebar-light .su-sub { color: rgba(20,36,27,0.50); }
body.sidebar-light .su-logout { color: rgba(20,36,27,0.50); }
body.sidebar-light .su-logout:hover { background: rgba(20,36,27,0.10); color: #14241B; }

