/* Exclivia · layout.css — el armazón: barra fija, menú lateral, navegación
 * inferior de celular y el área de contenido.
 *
 * Móvil primero: el menú lateral es un cajón que se desliza, y abajo queda una
 * barra con lo que más se usa, al alcance del pulgar. En escritorio el lateral
 * se queda fijo y la barra de abajo desaparece.
 */

:root {
  --exc-topbar-h: 60px;
  --exc-sidebar-w: 260px;
  --exc-bottomnav-h: 62px;
}

/* ── Barra superior fija ────────────────────────────────────────────────── */

.exc-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1030;
  height: var(--exc-topbar-h);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1rem;
  background: var(--exc-surface);
  border-bottom: 1px solid var(--exc-border);
  padding-top: env(safe-area-inset-top, 0px);
}

.exc-topbar-brand,
.exc-sidebar-brand {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--exc-text); font-weight: 600;
  min-width: 0;
}
.exc-logo-img  { height: 30px; width: auto; display: block; }
.exc-logo-text {
  font-family: var(--exc-font-display);
  font-size: 1.25rem; letter-spacing: .01em;
  color: var(--exc-accent);
}

.exc-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; }

.exc-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border: 0; border-radius: var(--exc-radius);
  background: transparent; color: var(--exc-text);
  font-size: 1.05rem; cursor: pointer;
  transition: background .15s ease;
}
.exc-iconbtn:hover { background: var(--exc-surface-2); }

/* Menú de la cuenta */
.exc-usermenu { position: relative; }
.exc-usermenu-panel {
  position: absolute; top: calc(100% + .4rem); right: 0;
  min-width: 220px;
  background: var(--exc-surface);
  border: 1px solid var(--exc-border);
  border-radius: var(--exc-radius-card);
  box-shadow: var(--exc-shadow-lg);
  padding: .4rem;
  display: none;
  z-index: 1040;
}
.exc-usermenu.is-open .exc-usermenu-panel { display: block; }
.exc-usermenu-head { padding: .6rem .7rem; border-bottom: 1px solid var(--exc-border); margin-bottom: .3rem; }
.exc-usermenu-name { font-weight: 600; font-size: .92rem; }
.exc-usermenu-mail { font-size: .78rem; color: var(--exc-muted); word-break: break-all; }
.exc-usermenu-item {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; padding: .6rem .7rem;
  border: 0; background: transparent; color: var(--exc-text);
  font: inherit; font-size: .9rem; text-align: left;
  border-radius: var(--exc-radius-sm); cursor: pointer;
}
.exc-usermenu-item:hover { background: var(--exc-surface-2); opacity: 1; }

/* ── Menú lateral ───────────────────────────────────────────────────────── */

.exc-sidebar {
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 1050;
  width: var(--exc-sidebar-w);
  background: var(--exc-sidebar-bg);
  color: var(--exc-sidebar-text);
  border-right: 1px solid var(--exc-border);
  transform: translateX(-100%);
  transition: transform .22s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 1.5rem;
}
.exc-sidebar.is-open { transform: translateX(0); }

.exc-sidebar-head {
  height: var(--exc-topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid var(--exc-border);
  position: sticky; top: 0;
  background: inherit;
  z-index: 1;
}

/* El logotipo, centrado en cuanto se queda solo en la cabecera.
   El `space-between` de arriba existe para empujar el ✕ a la derecha, pero ese
   botón es `.exc-only-mobile` y desaparece a partir de 768px: de ahí para
   arriba el logo queda solo y pegado a la izquierda, como si faltara algo.
   Por debajo de 768 sigue el ✕ y el logo se queda a la izquierda, que es como
   se ve la cabecera de cualquier cajón. */
@media (min-width: 768px) {
  .exc-sidebar-head { justify-content: center; }
}

.exc-sidebar-nav { padding: .75rem .6rem; display: flex; flex-direction: column; gap: .15rem; }

.exc-nav-section {
  padding: .9rem .7rem .35rem;
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--exc-muted);
}

.exc-nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .68rem .7rem;
  border-radius: var(--exc-radius);
  color: inherit;
  font-size: .93rem; font-weight: 500;
  transition: background .14s ease, color .14s ease;
}
.exc-nav-item:hover { background: var(--exc-sidebar-hover); opacity: 1; }
.exc-nav-item.is-active {
  background: rgba(var(--exc-accent-rgb), .14);
  color: var(--exc-accent);
  font-weight: 600;
}
.exc-nav-icon  { width: 22px; text-align: center; font-size: 1.05rem; flex: none; }
.exc-nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exc-nav-badge {
  margin-left: auto;
  background: var(--exc-accent); color: var(--exc-accent-contrast);
  border-radius: 999px; padding: .05rem .45rem;
  font-size: .7rem; font-weight: 700;
}

/* Velo que oscurece el fondo cuando el cajón está abierto (solo móvil). */
.exc-backdrop {
  position: fixed; inset: 0; z-index: 1040;
  background: rgba(0, 0, 0, .5);
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.exc-backdrop.is-open { opacity: 1; visibility: visible; }

/* ── Contenido ──────────────────────────────────────────────────────────── */

.exc-main {
  padding-top: calc(var(--exc-topbar-h) + 1rem);
  padding-bottom: calc(var(--exc-bottomnav-h) + env(safe-area-inset-bottom, 0px) + 1.5rem);
  min-height: 100dvh;
}

/* ── Navegación inferior (celular) ──────────────────────────────────────── */

.exc-bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 1035;
  height: calc(var(--exc-bottomnav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  background: var(--exc-surface);
  border-top: 1px solid var(--exc-border);
}
.exc-bottomnav-item {
  flex: 1 1 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .15rem;
  color: var(--exc-muted);
  font-size: .68rem; font-weight: 600;
  min-width: 0;
  padding: .3rem .2rem;
}
.exc-bottomnav-item.is-active { color: var(--exc-accent); }
.exc-bottomnav-icon  { font-size: 1.25rem; line-height: 1; }
.exc-bottomnav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ── Escritorio ─────────────────────────────────────────────────────────── */

@media (min-width: 992px) {
  .exc-app-with-sidebar .exc-sidebar { transform: translateX(0); }
  .exc-app-with-sidebar .exc-topbar  { left: var(--exc-sidebar-w); }
  .exc-app-with-sidebar .exc-main    { margin-left: var(--exc-sidebar-w); padding-bottom: 2.5rem; }

  .exc-bottomnav,
  .exc-backdrop,
  .exc-sidebar-toggle { display: none !important; }

  /* El logotipo de la barra de arriba sobra cuando la lateral está fija: los
     dos se ven a la vez y a la misma altura, uno junto al otro. Se quita el de
     arriba y no el de la lateral, que es el que ancla el menú.

     Sólo con barra lateral: en las pantallas que no la tienen, el de arriba es
     el único que hay. Y en celular tampoco, que ahí la lateral está guardada.

     Antes las dos marcas compartían la clase `.exc-topbar-brand` y esta regla
     escondía las dos: la pantalla se quedaba sin logotipo. Por eso la lateral
     tiene ahora la suya, `.exc-sidebar-brand`. */
  .exc-app-with-sidebar .exc-topbar-brand { display: none; }
}

/* ── Aviso de suplantación ──────────────────────────────────────────────── */

/* Naranja y siempre visible: si el admin olvida que está viendo como alguien
   más, va a creer que la plataforma está rota. */
.exc-impersonate {
  position: sticky; top: var(--exc-topbar-h);
  z-index: 1025;
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .6rem 1rem;
  background: #d98518;
  color: #1b1a17;
  font-size: .87rem; font-weight: 600;
}
.exc-impersonate form { margin: 0; margin-left: auto; }
.exc-impersonate .exc-btn { background: #1b1a17; color: #fff; border-color: #1b1a17; }

/* ── Layout de acceso (login / registro) ────────────────────────────────── */

.exc-auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}
.exc-auth-aside { display: none; }
.exc-auth-main {
  display: flex; flex-direction: column; justify-content: center;
  padding: 1.5rem 1rem calc(env(safe-area-inset-bottom, 0px) + 2rem);
}
.exc-auth-box { width: 100%; max-width: 420px; margin-inline: auto; }
.exc-auth-head { text-align: center; margin-bottom: 1.75rem; }
.exc-auth-head .exc-logo-text { font-size: 1.9rem; }
.exc-auth-title { margin: 1rem 0 .25rem; font-size: 1.4rem; font-weight: 500; }
.exc-auth-sub   { margin: 0; color: var(--exc-muted); font-size: .92rem; }
.exc-auth-foot  { margin-top: 1.5rem; text-align: center; font-size: .9rem; color: var(--exc-muted); }

@media (min-width: 992px) {
  .exc-auth { grid-template-columns: 1fr 1fr; }
  .exc-auth-aside {
    display: flex; flex-direction: column; justify-content: center;
    padding: 3rem;
    background: linear-gradient(150deg, rgba(var(--exc-accent-rgb), .18), var(--exc-surface));
    border-right: 1px solid var(--exc-border);
  }
  .exc-auth-aside h2 { font-family: var(--exc-font-display); font-size: 2.1rem; font-weight: 500; }
  .exc-auth-points { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .9rem; }
  .exc-auth-points li { display: flex; gap: .7rem; align-items: flex-start; font-size: .95rem; }
}

/* ── Barra superior pública (landing) ───────────────────────────────────── */

.exc-public { padding-top: var(--exc-topbar-h); }
.exc-public .exc-topbar { background: color-mix(in srgb, var(--exc-surface) 88%, transparent); backdrop-filter: blur(10px); }

/* ── Pie ────────────────────────────────────────────────────────────────── */

.exc-footer {
  border-top: 1px solid var(--exc-border);
  padding: 2rem 0;
  margin-top: 3rem;
  font-size: .88rem;
  color: var(--exc-muted);
}
.exc-footer a { color: var(--exc-muted); }
.exc-footer a:hover { color: var(--exc-accent); }
.exc-footer-cols { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .exc-footer-cols { grid-template-columns: 2fr 1fr 1fr; } }
