/* Estructura común de las pantallas internas: barra lateral, barra superior, pie y barra inferior móvil. */

.layout {
  display: grid;
  grid-template-columns: var(--side) 1fr;
  min-height: 100vh;
}
.side {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  padding: 0 6px;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: none;
}
.brand strong {
  display: block;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.1;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-top: 3px;
}
.side-org {
  font-size: 12px;
  color: var(--ink-3);
  padding: 0 6px;
  line-height: 1.5;
}
.role-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--mint);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--brand-2);
}
.nav-title {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: -8px;
}
.nav {
  display: grid;
  gap: 4px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-weight: 500;
}
.nav a:hover {
  background: var(--bg);
  text-decoration: none;
}
.nav a.on {
  background: var(--mint);
  color: var(--brand-2);
}
.nav a.off {
  opacity: 0.45;
  pointer-events: none;
}
.nav svg {
  flex: none;
}
.nav em {
  margin-left: auto;
  font-style: normal;
  font-size: 12px;
  color: var(--brand);
}
.help {
  margin-top: auto;
  background: var(--bg);
  border-radius: 12px;
  padding: 14px;
  font-size: 12px;
  color: var(--ink-2);
}
.help b {
  display: block;
  color: var(--ink);
  font-size: 13px;
  margin: 6px 0 2px;
}
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
}
.me div {
  flex: 1;
  min-width: 0;
}
.me b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.me small {
  color: var(--ink-3);
}
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  font-size: 13px;
  color: var(--ink-3);
}
.crumbs {
  display: flex;
  gap: 8px;
  align-items: center;
}
.crumbs b {
  color: var(--ink);
  font-weight: 500;
}
.period {
  background: var(--bg);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--ink-2);
}
.page {
  padding: 28px 32px 20px;
  display: grid;
  gap: 22px;
  width: 100%;
}
.page-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  padding: 14px 32px;
  font-size: 12px;
  color: var(--ink-3);
}
.notice {
  position: fixed;
  right: 24px;
  top: 70px;
  z-index: 30;
  background: var(--forest);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(18, 61, 43, 0.25);
  max-width: 340px;
}
.notice[hidden] {
  display: none;
}
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.page-head .eyebrow {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 6px;
}
.page-head p {
  color: var(--ink-2);
  margin-top: 6px;
}
.tabbar {
  display: none;
}
.logo-fallback {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  flex: none;
}
.only-mobile {
  display: none;
}
.topbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}
.page-head .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .side {
    display: none;
  }
  .topbar {
    padding: 0 18px;
  }
  .page {
    padding: 20px 16px 90px;
  }
  .page-foot {
    padding: 12px 16px 84px;
  }
  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 20;
    overflow-x: auto;
  }
  .tabbar a {
    display: grid;
    justify-items: center;
    gap: 2px;
    font-size: 10.5px;
    color: var(--ink-3);
    padding: 4px 0;
    flex: 1 0 64px;
  }
  .tabbar a.on {
    color: var(--brand-2);
    font-weight: 600;
  }
  .tabbar a.off {
    opacity: 0.4;
    pointer-events: none;
  }
  .tabbar a:hover {
    text-decoration: none;
  }
  .only-mobile {
    display: inline-flex;
  }
}

@media (max-width: 520px) {
  .notice {
    left: 16px;
    right: 16px;
  }
}

/* Avatar y nombre de la barra lateral: llevan a Mi perfil */
.me-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
}
.me-link:hover b {
  color: var(--brand);
}
