@charset "UTF-8";

/**
 * layout.css
 *
 * Estructura general de la página, encabezado y menú principal. 
 */

.fx-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--fx-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--fx-border);
}

.fx-header__left { display: flex; align-items: center; gap: 12px; }

.fx-menu-toggle {                 /* colapsa el panel en desktop / lo abre en móvil */
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--fx-border);
  border-radius: 10px;
  background: #fff;
  color: var(--fx-title);
  cursor: pointer;
}
.fx-menu-toggle svg { width: 20px; height: 20px; }

.fx-header-favorites {                 /* menú desplegable de favoritos */
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 0;
  background: #fff;
  color: var(--fx-title);
  cursor: pointer;
}
.fx-header-favorites svg { width: 20px; height: 20px; }

.fx-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--fx-title); }
.fx-brand__mark {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  color: #fff;
}
.fx-brand__mark img { width: 40px; height: 40px; display: block; }
.fx-brand__name { font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em; }

.fx-header__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Pill de tareas */
.fx-header-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--fx-pill-bg, #eef2ff);
  color: var(--fx-pill-fg, #4338ca);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.fx-header-pill__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--fx-pill-fg, #4338ca);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.fx-header-search__input {
  padding: 0.25em 0.5em;
  border: 1px solid var(--fx-border);
  border-radius: 8px;
}

/* Botones de ícono "ghost" (recordatorios) */
.fx-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--fx-fg-muted, #475569);
  cursor: pointer;
  text-decoration: none;
}
.fx-header-icon:hover {
  background: var(--fx-hover, #f1f5f9);
  color: var(--fx-fg, #0f172a);
}

/* Botones de acción (nueva ventana) */
.fx-header-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: var(--fx-primary, #4f46e5);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.fx-header-button:hover { background: var(--fx-primary-hover, #4338ca); }

/* Separador vertical */
.fx-header-divider {
  width: 1px;
  height: 24px;
  background: var(--fx-border);
}

/* Usuario + dropdown */
.fx-header-user { position: relative; }
.fx-header-user__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--fx-fg, #0f172a);
}
.fx-header-user__name { font-size: 14px; font-weight: 500; }
.fx-header-user__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--fx-primary, #4f46e5);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.fx-header-user__caret { color: var(--fx-fg-muted, #475569); }

.fx-header-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--fx-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.fx-header-menu__header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
}
.fx-header-menu__name { font-size: 14px; font-weight: 600; }
.fx-header-menu__sub { font-size: 12px; color: var(--fx-fg-muted, #475569); }
.fx-header-menu__item {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--fx-fg, #0f172a);
  text-decoration: none;
}
.fx-header-menu__item:hover { background: var(--fx-hover, #f1f5f9); }
.fx-header-menu__item--danger { color: var(--fx-danger, #dc2626); }
.fx-header-menu__sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--fx-border);
}

.fx-header-favorites { position: relative; }

.fx-header-favorites__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--fx-fg, #0f172a);
}

.fx-favorites-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--fx-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.fx-favorites-menu__header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
}
.fx-favorites-menu__name { font-size: 14px; font-weight: 600; }
.fx-favorites-menu__sub { font-size: 12px; color: var(--fx-fg-muted, #475569); }
.fx-favorites-menu__item {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--fx-fg, #0f172a);
  text-decoration: none;
}
.fx-favorites-menu__item:hover { background: var(--fx-hover, #f1f5f9); }
.fx-favorites-menu__item--danger { color: var(--fx-danger, #dc2626); }
.fx-favorites-menu__sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--fx-border);
}

/*-------------------*/
.fx-favorites-menu__group { display: flex; flex-direction: column; }

.fx-favorites-menu__toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px;
  border: none; background: transparent; border-radius: 6px;
  font: inherit; font-size: 14px; color: var(--fx-fg, #0f172a);
  text-align: left; cursor: pointer;
}
.fx-favorites-menu__toggle:hover { background: var(--fx-hover, #f1f5f9); }
.fx-favorites-menu__toggle-label { flex: 1; }

.fx-favorites-menu__chevron {
  width: 16px; height: 16px; flex-shrink: 0; color: #94a3b8;
  transition: transform .2s ease;
}
.fx-favorites-menu__group.is-open > .fx-favorites-menu__toggle .fx-favorites-menu__chevron {
  transform: rotate(90deg);
}

/* colapsable, funciona a cualquier profundidad */
.fx-favorites-menu__sub {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .2s ease;
}
.fx-favorites-menu__group.is-open > .fx-favorites-menu__sub { grid-template-rows: 1fr; }
.fx-favorites-menu__sub-inner {
  overflow: hidden;
  margin-left: 10px; padding-left: 10px;
  border-left: 1px solid var(--fx-border);
}
/*-------------------*/


/* ============================  ESTRUCTURA  ============================ */
.fx-shell { display: flex; align-items: flex-start; }

/* ----------  PANEL DE NAVEGACIÓN (IZQUIERDA)  ---------- */
.fx-sidebar {
  /* El color del módulo entra por acá; el tono suave se calcula solo */
  --accent: #0d9488;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, #ffffff);

  width: var(--fx-sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--fx-header-h);
  height: calc(100vh - var(--fx-header-h));
  overflow-y: auto;
  background: var(--fx-card-bg);
  border-right: 1px solid var(--fx-border);
  padding: 18px 14px 24px;
  transition: width .25s ease, padding .25s ease, border-color .2s ease;
}

.fx-sidebar__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--fx-border);
}
.fx-sidebar__module-icon {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--accent-soft);
  flex-shrink: 0;
}
.fx-sidebar__module-icon i {
  width: 22px; height: 22px;
  background-color: var(--accent);
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
}
.fx-sidebar__module-text { display: flex; flex-direction: column; line-height: 1.25; }
.fx-sidebar__module-name { font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; }
.fx-sidebar__module-tag { font-size: 0.72rem; color: var(--fx-text); }

/* ----------  MENÚ  ---------- */
.fx-nav { display: flex; flex-direction: column; gap: 2px; }

/* Fila base compartida por links y por cabeceras de grupo */
.fx-nav__link,
.fx-nav__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.875rem;
  color: #334155;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.fx-nav__link:hover,
.fx-nav__toggle:hover { background: #f1f5f9; color: var(--fx-title); }

.fx-nav__link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.fx-nav__toggle-label { flex: 1; }

.fx-nav__chevron {
  width: 16px; height: 16px;
  flex-shrink: 0;
  color: #94a3b8;
  transition: transform .22s ease;
}
.fx-nav__group.is-open > .fx-nav__toggle .fx-nav__chevron { transform: rotate(90deg); }
.fx-nav__group.is-open > .fx-nav__toggle { color: var(--fx-title); }

/* Contenedor colapsable: animación limpia con grid 0fr -> 1fr (sirve a cualquier profundidad) */
.fx-nav__sub {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .25s ease;
}
.fx-nav__group.is-open > .fx-nav__sub { grid-template-rows: 1fr; }

.fx-nav__sub-inner {
  overflow: hidden;
  margin: 2px 0 2px 20px;
  padding-left: 12px;
  border-left: 1px solid var(--fx-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Subitems un poco más chicos */
.fx-nav__sub-inner .fx-nav__link,
.fx-nav__sub-inner .fx-nav__toggle { font-size: 0.84rem; padding: 8px 10px; }

/* ----------  CONTENIDO  ---------- */

.fx-content { flex: 1; min-width: 0; padding: 0 15px; }

/* ----------  OVERLAY (móvil)  ---------- */
.fx-overlay {
  display: none;
  position: fixed;
  inset: var(--fx-header-h) 0 0 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 35;
  opacity: 0;
  transition: opacity .2s ease;
}

/* ----------  COLAPSAR PANEL (desktop)  ---------- */
@media (min-width: 861px) {
  body.fx-sidebar-collapsed .fx-sidebar {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border-right-color: transparent;
    overflow: hidden;
  }
}

/* ============================  RESPONSIVE  ============================ */
@media (max-width: 860px) {
  .fx-sidebar {
    position: fixed;
    top: var(--fx-header-h);
    left: 0;
    height: calc(100vh - var(--fx-header-h));
    z-index: 38;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 0 20px 40px -20px rgba(15, 23, 42, .3);
  }
  body.fx-sidebar-open .fx-sidebar { transform: none; }

  .fx-overlay { display: block; }
  body.fx-sidebar-open .fx-overlay { opacity: 1; }
  body:not(.fx-sidebar-open) .fx-overlay { pointer-events: none; }

  .fx-content__inner { padding: 24px 18px 48px; }
}

@media (max-width: 520px) {
  .fx-user__meta { display: none; }
  .fx-header { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-nav__sub, .fx-nav__chevron, .fx-sidebar, .fx-overlay { transition: none; }
}



