/* ==========================================================================
   IRIS · Modelo Visual Ejecutivo Liquid-Glass (Inspirado en Suite de Referencia)
   Paleta Oficial Estricta:
     1. #06141B (Fondo profundo y contraste base)
     2. #11212D (Cristal oscuro principal y contenedores flotantes)
     3. #253745 (Píldoras de menú, tarjetas interiores y paneles suaves)
     4. #4A5C6A (Bordes esmerilados, divisores y acentos medios)
     5. #9BA8AB (Texto secundario, iconos suaves y leyendas)
     6. #CCD0CF (Texto primario nítido, indicadores clave y brillos)
   ========================================================================== */

:root {
  --iris-c1: #06141B;
  --iris-c2: #11212D;
  --iris-c3: #253745;
  --iris-c4: #4A5C6A;
  --iris-c5: #9BA8AB;
  --iris-c6: #CCD0CF;

  --bg-abyss: var(--iris-c1);
  --bg-surface: var(--iris-c2);
  --bg-panel: var(--iris-c3);
  --border-steel: var(--iris-c4);
  --text-muted: var(--iris-c5);
  --text-primary: var(--iris-c6);

  /* Superficies Liquid-Glass derivadas de la paleta */
  --glass-shell: linear-gradient(155deg, rgba(17, 33, 45, 0.84) 0%, rgba(6, 20, 27, 0.88) 100%);
  --glass-card: linear-gradient(160deg, rgba(37, 55, 69, 0.56) 0%, rgba(17, 33, 45, 0.76) 100%);
  --glass-pill: linear-gradient(180deg, rgba(37, 55, 69, 0.62) 0%, rgba(17, 33, 45, 0.68) 100%);
  --glass-pill-active: linear-gradient(135deg, rgba(74, 92, 106, 0.92) 0%, rgba(37, 55, 69, 0.96) 100%);
  --glass-border: rgba(204, 208, 207, 0.16);
  --glass-border-strong: rgba(204, 208, 207, 0.32);
  --glass-highlight: inset 0 1px 1px rgba(255, 255, 255, 0.16);
  --shadow-float: 0 24px 56px rgba(6, 20, 27, 0.72);
  --shadow-card: 0 12px 28px rgba(6, 20, 27, 0.42);

  /* Acentos semánticos armonizados sobre cristal oscuro */
  --state-ok: #5cd6b3;
  --state-warn: #eab364;
  --state-danger: #ef6b73;
  --state-info: #7bc7dd;

  /* Proporciones estéticas de layout y menú lateral */
  --shell-pad: 18px;
  --sidebar-expanded-w: 256px;
  --sidebar-collapsed-w: 84px;
  --sidebar-w: var(--sidebar-expanded-w);
  --radius-xs: 10px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --transition-fast: 190ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-layout: 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background-color: var(--bg-abyss);
  background-image:
    radial-gradient(circle at 12% 16%, rgba(74, 92, 106, 0.42) 0%, transparent 42%),
    radial-gradient(circle at 86% 14%, rgba(37, 55, 69, 0.68) 0%, transparent 46%),
    radial-gradient(circle at 74% 84%, rgba(74, 92, 106, 0.32) 0%, transparent 45%),
    radial-gradient(circle at 22% 88%, rgba(37, 55, 69, 0.52) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

body.sidebar-collapsed {
  --sidebar-w: var(--sidebar-collapsed-w);
}

/* Justificación editorial de textos descriptivos */
.text-justify,
.section-header__desc,
.detail-block p,
.hud-alert__message,
.hud-empty-state__desc,
.rag-steps li,
.prose-justify {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1.25rem;
  z-index: 2000;
  padding: 0.65rem 1.1rem;
  background: var(--text-primary);
  color: var(--bg-abyss);
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

/* Indicador superior sutil de carga */
.http-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1500;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  background: linear-gradient(90deg, var(--iris-c3), var(--iris-c5), var(--iris-c6), var(--iris-c4));
  background-size: 200% 100%;
}

.http-progress.is-active {
  opacity: 1;
  animation: glassShimmer 1.2s linear infinite;
}

@keyframes glassShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   Arquitectura de Paneles Flotantes Liquid-Glass (Sidebar + Workspace)
   ========================================================================== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: var(--shell-pad);
  padding: var(--shell-pad);
  min-height: 100vh;
  max-width: 1640px;
  margin: 0 auto;
  transition: grid-template-columns var(--transition-layout);
}

.sidebar-backdrop {
  display: none;
}

/* Panel lateral flotante de cristal esmerilado */
.sidebar {
  position: sticky;
  top: var(--shell-pad);
  height: calc(100vh - (var(--shell-pad) * 2));
  background: var(--glass-shell);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-highlight), var(--shadow-float);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  z-index: 900;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar__top {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.15rem 0.25rem 1rem;
  border-bottom: 1px solid rgba(155, 168, 171, 0.14);
}

.brand__identity {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  text-decoration: none;
  color: var(--text-primary);
}

.brand__emblem {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.brand__emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand__text {
  min-width: 0;
  overflow: hidden;
}

.brand__title {
  display: block;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  line-height: 1.18;
}

.brand__tag {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__collapse-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
  border: 1px solid var(--glass-border);
  background: rgba(37, 55, 69, 0.55);
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
}

.sidebar__collapse-btn:hover {
  background: var(--border-steel);
  color: var(--text-primary);
  border-color: var(--glass-border-strong);
}

.nav-section-label {
  margin: 0 0 0.55rem 0.55rem;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Botones de menú tipo píldora elevada (fieles al modelo visual) */
.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.58rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.82rem;
  min-height: 48px;
  padding: 0.65rem 0.92rem;
  border-radius: 14px;
  background: var(--glass-pill);
  border: 1px solid rgba(155, 168, 171, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.91rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  background: rgba(74, 92, 106, 0.45);
  color: var(--text-primary);
  border-color: rgba(204, 208, 207, 0.24);
  transform: translateY(-1px);
}

.nav-link[aria-current="page"] {
  background: linear-gradient(135deg, rgba(123, 199, 221, 0.26) 0%, rgba(74, 92, 106, 0.78) 52%, rgba(37, 55, 69, 0.94) 100%);
  color: var(--text-primary);
  border-color: rgba(204, 208, 207, 0.46);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.28),
    0 8px 22px rgba(6, 20, 27, 0.5),
    0 0 18px rgba(123, 199, 221, 0.16);
}

.nav-link__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: inherit;
}

.nav-link__title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link__count {
  font-size: 0.73rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.14rem 0.52rem;
  border-radius: 999px;
  background: rgba(6, 20, 27, 0.58);
  border: 1px solid rgba(204, 208, 207, 0.18);
  color: var(--text-primary);
}

/* Tarjeta inferior de perfil operativo (sin direcciones técnicas) */
.sidebar__bottom {
  padding-top: 1rem;
  border-top: 1px solid rgba(155, 168, 171, 0.14);
}

.operator-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 0.82rem;
  border-radius: 16px;
  background: var(--glass-pill);
  border: 1px solid rgba(155, 168, 171, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.operator-card__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--iris-c4), var(--iris-c3));
  border: 1px solid var(--glass-border-strong);
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
}

.operator-card__info {
  flex: 1;
  min-width: 0;
}

.operator-card__name {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.operator-card__status {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--state-ok);
  box-shadow: 0 0 8px rgba(92, 214, 179, 0.65);
  flex-shrink: 0;
}

.status-dot--offline {
  background: var(--state-danger);
  box-shadow: 0 0 8px rgba(239, 107, 115, 0.65);
}

@media (min-width: 1024px) {
  body.sidebar-collapsed .brand__text,
  body.sidebar-collapsed .nav-section-label,
  body.sidebar-collapsed .nav-link__title,
  body.sidebar-collapsed .nav-link__count,
  body.sidebar-collapsed .operator-card__info {
    display: none;
  }

  body.sidebar-collapsed .brand {
    flex-direction: column;
    padding-inline: 0;
  }

  body.sidebar-collapsed .nav-link {
    justify-content: center;
    padding-inline: 0;
  }

  body.sidebar-collapsed .operator-card {
    justify-content: center;
    padding: 0.55rem;
  }
}

/* ==========================================================================
   Contenedor Flotante Principal y Barra Superior Ejecutiva
   ========================================================================== */
.workspace {
  min-width: 0;
  background: var(--glass-shell);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-highlight), var(--shadow-float);
  display: flex;
  flex-direction: column;
  overflow: clip;
}

.topbar {
  padding: 1.15rem clamp(1.15rem, 2.2vw, 1.85rem);
  border-bottom: 1px solid rgba(155, 168, 171, 0.14);
  background: linear-gradient(180deg, rgba(37, 55, 69, 0.36) 0%, rgba(17, 33, 45, 0.18) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 1.15rem;
  cursor: pointer;
  place-items: center;
}

.topbar__titles {
  min-width: 0;
}

.topbar__heading {
  margin: 0;
  font-size: clamp(1.22rem, 1.85vw, 1.56rem);
  font-weight: 750;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.topbar__subtitle {
  margin: 0.18rem 0 0;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
}

.global-search__icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.88rem;
}

.global-search__input {
  width: clamp(190px, 20vw, 270px);
  height: 40px;
  padding: 0.45rem 0.9rem 0.45rem 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(6, 20, 27, 0.56);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.84rem;
  transition: all var(--transition-fast);
}

.global-search__input::placeholder {
  color: var(--text-muted);
}

.global-search__input:focus {
  outline: none;
  border-color: var(--glass-border-strong);
  background: rgba(6, 20, 27, 0.82);
  box-shadow: 0 0 0 3px rgba(155, 168, 171, 0.16);
}

.main-content {
  width: 100%;
  padding: clamp(1.1rem, 2vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}

.notification-host {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1350;
  max-width: min(430px, calc(100vw - 2rem));
}

/* ==========================================================================
   Tarjetas de Cristal Esmerilado, KPIs y Grilla Bento del Dashboard
   ========================================================================== */
.hud-panel {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.05rem, 1.8vw, 1.4rem);
  box-shadow: var(--glass-highlight), var(--shadow-card);
  position: relative;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.section-header__title {
  margin: 0;
  font-size: clamp(1.02rem, 1.3vw, 1.16rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-header__desc {
  margin: 0.22rem 0 0;
  font-size: 0.83rem;
  color: var(--text-muted);
  max-width: 68ch;
}

/* Fila de 4 KPIs estilo Suite Ejecutiva */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: linear-gradient(155deg, rgba(37, 55, 69, 0.72) 0%, rgba(17, 33, 45, 0.84) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--glass-highlight), var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-strong);
}

.kpi-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.kpi-card__title-wrap {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  min-width: 0;
}

.kpi-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 20, 27, 0.5);
  border: 1px solid rgba(204, 208, 207, 0.16);
  color: var(--text-primary);
}

.kpi-card__icon--teal {
  background: rgba(92, 214, 179, 0.15);
  border-color: rgba(92, 214, 179, 0.35);
  color: var(--state-ok);
}

.kpi-card__icon--blue {
  background: rgba(123, 199, 221, 0.15);
  border-color: rgba(123, 199, 221, 0.35);
  color: var(--state-info);
}

.kpi-card__icon--amber {
  background: rgba(234, 179, 100, 0.15);
  border-color: rgba(234, 179, 100, 0.35);
  color: var(--state-warn);
}

.kpi-card__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-card__pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(6, 20, 27, 0.48);
  border: 1px solid rgba(204, 208, 207, 0.16);
  color: var(--text-primary);
  white-space: nowrap;
}

.kpi-card__value {
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.65rem, 2.3vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.12;
}

.kpi-card__meta {
  font-size: 0.79rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.kpi-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(6, 20, 27, 0.65);
  overflow: hidden;
}

.kpi-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--state-info), var(--state-ok));
  border-radius: 999px;
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Grilla Bento del Dashboard */
.dashboard-bento {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.15rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.chart-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.8rem;
  min-width: 0;
}

.chart-svg-wrap {
  width: 100%;
  background: rgba(6, 20, 27, 0.42);
  border: 1px solid rgba(204, 208, 207, 0.1);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  overflow: hidden;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-tooltip {
  min-height: 2.1rem;
  padding: 0.45rem 0.78rem;
  border-radius: var(--radius-xs);
  background: rgba(6, 20, 27, 0.48);
  border: 1px solid rgba(204, 208, 207, 0.12);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Filtros, Formularios y Botones Estilizados
   ========================================================================== */
.filters-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 0.85rem;
  align-items: end;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
  min-width: 0;
}

.field-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field-control {
  width: 100%;
  min-height: 41px;
  padding: 0.52rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(6, 20, 27, 0.62);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.87rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.field-control:hover {
  border-color: var(--glass-border-strong);
}

.field-control:focus {
  outline: none;
  border-color: var(--text-primary);
  background: rgba(6, 20, 27, 0.85);
  box-shadow: 0 0 0 3px rgba(155, 168, 171, 0.18);
}

.field-control[aria-invalid="true"] {
  border-color: var(--state-danger);
  box-shadow: 0 0 0 3px rgba(239, 107, 115, 0.18);
}

textarea.field-control {
  min-height: 98px;
  resize: vertical;
  line-height: 1.5;
}

.field-error {
  min-height: 1rem;
  font-size: 0.75rem;
  color: var(--state-danger);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chip-group {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  flex-wrap: wrap;
}

.chip {
  padding: 0.38rem 0.82rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(6, 20, 27, 0.48);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover {
  color: var(--text-primary);
  border-color: var(--glass-border-strong);
}

.chip.is-active {
  background: var(--glass-pill-active);
  color: var(--text-primary);
  border-color: rgba(204, 208, 207, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Botones Ejecutivos */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  min-height: 40px;
  padding: 0.5rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(135deg, var(--iris-c6) 0%, #dfe4e3 100%);
  color: var(--bg-abyss);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 6px 18px rgba(6, 20, 27, 0.38);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(204, 208, 207, 0.25);
}

.btn--secondary {
  background: var(--glass-pill-active);
  color: var(--text-primary);
  border-color: var(--glass-border-strong);
  box-shadow: var(--glass-highlight);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--border-steel);
}

.btn--ghost {
  background: rgba(6, 20, 27, 0.36);
  color: var(--text-muted);
  border-color: var(--glass-border);
}

.btn--ghost:hover:not(:disabled) {
  background: rgba(37, 55, 69, 0.58);
  color: var(--text-primary);
  border-color: var(--glass-border-strong);
}

.btn--sm {
  min-height: 34px;
  padding: 0.32rem 0.74rem;
  font-size: 0.78rem;
  border-radius: var(--radius-xs);
}

.btn--icon {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
}

/* ==========================================================================
   Píldoras de Estado, Alertas, Tablas Ejecutivas y Modales
   ========================================================================== */
.hud-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 650;
  border: 1px solid var(--glass-border);
  background: rgba(37, 55, 69, 0.72);
  color: var(--text-primary);
  white-space: nowrap;
}

.hud-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.hud-badge--open {
  background: rgba(123, 199, 221, 0.16);
  border-color: rgba(123, 199, 221, 0.42);
  color: var(--state-info);
}

.hud-badge--progress {
  background: rgba(234, 179, 100, 0.16);
  border-color: rgba(234, 179, 100, 0.42);
  color: var(--state-warn);
}

.hud-badge--resolved {
  background: rgba(92, 214, 179, 0.16);
  border-color: rgba(92, 214, 179, 0.42);
  color: var(--state-ok);
}

.hud-badge--closed {
  background: rgba(155, 168, 171, 0.14);
  border-color: rgba(155, 168, 171, 0.28);
  color: var(--text-muted);
}

.hud-badge--danger,
.hud-badge--prio-critical {
  background: rgba(239, 107, 115, 0.17);
  border-color: rgba(239, 107, 115, 0.46);
  color: var(--state-danger);
}

.hud-badge--prio-high {
  background: rgba(234, 179, 100, 0.17);
  border-color: rgba(234, 179, 100, 0.46);
  color: var(--state-warn);
}

.hud-badge--prio-medium {
  background: rgba(37, 55, 69, 0.8);
  border-color: var(--glass-border-strong);
  color: var(--text-primary);
}

.hud-badge--prio-low {
  background: rgba(6, 20, 27, 0.65);
  border-color: var(--glass-border);
  color: var(--text-muted);
}

/* Alertas */
.hud-alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.9rem 1.08rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border-strong);
  background: rgba(17, 33, 45, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
}

.hud-alert--error {
  border-color: rgba(239, 107, 115, 0.55);
  background: linear-gradient(90deg, rgba(239, 107, 115, 0.16), rgba(17, 33, 45, 0.96));
}

.hud-alert--success {
  border-color: rgba(92, 214, 179, 0.55);
  background: linear-gradient(90deg, rgba(92, 214, 179, 0.16), rgba(17, 33, 45, 0.96));
}

.hud-alert--warning {
  border-color: rgba(234, 179, 100, 0.55);
  background: linear-gradient(90deg, rgba(234, 179, 100, 0.16), rgba(17, 33, 45, 0.96));
}

.hud-alert--info {
  border-color: rgba(123, 199, 221, 0.55);
  background: linear-gradient(90deg, rgba(123, 199, 221, 0.16), rgba(17, 33, 45, 0.96));
}

.hud-alert__title {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.18rem;
  color: var(--text-primary);
}

.hud-alert__message {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-primary);
}

.hud-alert__list {
  margin: 0.42rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hud-alert__actions {
  margin-top: 0.65rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Tablas Ejecutivas */
.hud-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(204, 208, 207, 0.12);
  background: rgba(6, 20, 27, 0.38);
}

.hud-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.hud-table thead th {
  background: rgba(37, 55, 69, 0.58);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.82rem 0.95rem;
  text-align: left;
  border-bottom: 1px solid rgba(204, 208, 207, 0.12);
  white-space: nowrap;
}

.hud-table tbody td {
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid rgba(155, 168, 171, 0.1);
  vertical-align: middle;
  color: var(--text-primary);
}

.hud-table tbody tr:last-child td {
  border-bottom: none;
}

.hud-table__row {
  transition: background var(--transition-fast);
}

.hud-table__row:hover {
  background: rgba(37, 55, 69, 0.42);
}

.hud-table__row--interactive {
  cursor: pointer;
}

.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

.cell-id {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cell-title {
  font-weight: 650;
  color: var(--text-primary);
  display: block;
}

.cell-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.16rem;
  text-align: justify;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.42rem;
  flex-wrap: wrap;
}

.inline-select {
  min-height: 32px;
  padding: 0.24rem 0.55rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--glass-border);
  background: rgba(6, 20, 27, 0.7);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.78rem;
}

/* Estados vacíos y carga */
.hud-empty-state {
  text-align: center;
  padding: 2.5rem 1.4rem;
  border: 1px dashed var(--glass-border-strong);
  border-radius: var(--radius-md);
  background: rgba(6, 20, 27, 0.35);
}

.hud-empty-state__icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(37, 55, 69, 0.6);
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.hud-empty-state__title {
  margin: 0;
  font-size: 1.02rem;
  color: var(--text-primary);
}

.hud-empty-state__desc {
  margin: 0.45rem auto 0;
  max-width: 460px;
  font-size: 0.84rem;
  color: var(--text-muted);
  text-align: center;
}

.hud-empty-state__action {
  margin-top: 1.1rem;
}

.hud-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.4rem 0;
}

.hud-skeleton__row {
  display: grid;
  grid-template-columns: 80px 1fr 130px;
  gap: 0.85rem;
  padding: 0.78rem;
  border-radius: var(--radius-sm);
  background: rgba(37, 55, 69, 0.28);
}

.hud-skeleton__line {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bg-panel), var(--border-steel), var(--bg-panel));
  background-size: 200% 100%;
  animation: glassShimmer 1.4s ease-in-out infinite;
}

/* Modales de Cristal */
.hud-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(6, 20, 27, 0.72);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.hud-modal {
  width: 100%;
  max-height: min(88vh, 860px);
  background: linear-gradient(160deg, rgba(17, 33, 45, 0.96) 0%, rgba(6, 20, 27, 0.98) 100%);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-highlight), 0 28px 64px rgba(6, 20, 27, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hud-modal--sm { max-width: 460px; }
.hud-modal--md { max-width: 650px; }
.hud-modal--lg { max-width: 840px; }

.hud-modal__header {
  padding: 1.15rem 1.4rem;
  background: rgba(37, 55, 69, 0.52);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.hud-modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 750;
  color: var(--text-primary);
}

.hud-modal__subtitle {
  margin: 0.22rem 0 0;
  font-size: 0.81rem;
  color: var(--text-muted);
}

.hud-modal__body {
  padding: 1.3rem 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.hud-modal__footer {
  padding: 0.95rem 1.4rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(6, 20, 27, 0.5);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  background: rgba(6, 20, 27, 0.52);
  border: 1px solid var(--glass-border);
}

.detail-item__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.detail-item__val {
  display: block;
  margin-top: 0.22rem;
  font-size: 0.89rem;
  font-weight: 650;
  color: var(--text-primary);
}

.detail-block {
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-md);
  background: rgba(6, 20, 27, 0.48);
  border: 1px solid var(--glass-border);
}

.detail-block h4 {
  margin: 0 0 0.4rem;
  font-size: 0.77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.detail-block p {
  margin: 0;
  font-size: 0.88rem;
  white-space: pre-wrap;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Barras de progreso por categoría estilo Suite Ejecutiva */
.category-progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.category-progress-item {
  padding: 0.68rem 0.85rem;
  border-radius: 14px;
  background: rgba(6, 20, 27, 0.42);
  border: 1px solid rgba(204, 208, 207, 0.1);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.category-progress-item:hover {
  background: rgba(37, 55, 69, 0.48);
  border-color: var(--glass-border-strong);
}

.category-progress-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
}

.category-progress-item__name {
  font-weight: 650;
  color: var(--text-primary);
}

.category-progress-item__stats {
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.category-progress-item__track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(37, 55, 69, 0.72);
  overflow: hidden;
}

.category-progress-item__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Vista Asistente Inteligente */
.rag-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 1.15rem;
  align-items: start;
}

.rag-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  font-size: 0.87rem;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
  margin-top: 0.55rem;
}

.source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.62rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(6, 20, 27, 0.55);
  border: 1px solid var(--glass-border);
  font-size: 0.84rem;
}

.star-group {
  display: inline-flex;
  gap: 0.32rem;
}

.star-btn {
  width: 35px;
  height: 35px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--glass-border);
  background: rgba(6, 20, 27, 0.65);
  color: var(--text-muted);
  font-size: 1.02rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.star-btn.is-selected,
.star-btn:hover {
  background: rgba(234, 179, 100, 0.18);
  color: var(--state-warn);
  border-color: var(--state-warn);
}

/* ==========================================================================
   Responsividad Integral (Escritorio 1512px · Tablet 834px · Móvil 390px)
   ========================================================================== */
@media (max-width: 1220px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-bento {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1023px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .mobile-menu-btn {
    display: grid;
  }

  .sidebar__collapse-btn {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 12px;
    left: 12px;
    bottom: 12px;
    height: auto;
    width: min(86vw, 276px);
    transform: translateX(-112%);
    transition: transform var(--transition-layout);
    z-index: 1200;
  }

  body.sidebar-mobile-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(6, 20, 27, 0.72);
    backdrop-filter: blur(5px);
    z-index: 1150;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-layout);
  }

  body.sidebar-mobile-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .charts-grid,
  .rag-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 8px;
  }

  .kpi-grid,
  .form-grid-2,
  .filters-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar {
    padding: 0.95rem 1rem;
  }

  .global-search {
    width: 100%;
    order: 3;
  }

  .global-search__input {
    width: 100%;
  }

  .hud-table thead {
    display: none;
  }

  .hud-table,
  .hud-table tbody,
  .hud-table tr,
  .hud-table td {
    display: block;
    width: 100%;
  }

  .hud-table tr {
    padding: 0.82rem 0.9rem;
    border-bottom: 1px solid var(--glass-border);
  }

  .hud-table tbody td {
    padding: 0.36rem 0;
    border-bottom: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: right;
  }

  .hud-table tbody td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: left;
    flex-shrink: 0;
  }

  .cell-sub {
    text-align: right;
  }

  .row-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ==========================================================================
   Animación de carga previa al login (ojo de IRIS)
   ========================================================================== */
@property --intro-r {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}

.intro {
  --intro-e: clamp(160px, 30vmin, 256px);
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  perspective: 900px;
  overflow: hidden;
  background: #06141B;
}

.intro__eye {
  width: var(--intro-e);
  height: var(--intro-e);
  animation: intro-emerge 1.5s 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.intro__name {
  position: absolute;
  top: calc(50% + var(--intro-e) / 2 + 1.1rem);
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-family: var(--font-sans);
  font-size: clamp(1.9rem, 6vmin, 2.9rem);
  font-weight: 700;
  color: var(--text-primary);
  animation: intro-name 1.2s 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Una sola curva suave mueve el giro del ojo y la apertura de la pupila; el borde del agujero es difuso. */
.intro.is-revealing {
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent var(--intro-r), #000 calc(var(--intro-r) + 36px));
  mask-image: radial-gradient(circle at 50% 50%, transparent var(--intro-r), #000 calc(var(--intro-r) + 36px));
  animation: intro-hole 2.2s cubic-bezier(0.65, 0, 0.2, 1) forwards;
}

.intro.is-revealing .intro__eye {
  animation: intro-spin 2.2s cubic-bezier(0.65, 0, 0.2, 1) forwards;
}

.intro.is-revealing .intro__name {
  animation: intro-name-out 0.7s ease-in-out forwards;
}

.intro.is-fading {
  opacity: 0;
  transition: opacity 0.45s ease;
}

@keyframes intro-emerge {
  from { opacity: 0; transform: translateZ(-700px) scale(0.6); filter: blur(12px); }
  to   { opacity: 1; transform: translateZ(0) scale(1); filter: blur(0); }
}

@keyframes intro-name {
  from { opacity: 0; transform: translateZ(-500px); letter-spacing: 1.1em; filter: blur(8px); }
  to   { opacity: 1; transform: translateZ(0); letter-spacing: 0.55em; filter: blur(0); }
}

@keyframes intro-name-out {
  from { opacity: 1; letter-spacing: 0.55em; }
  to   { opacity: 0; letter-spacing: 0.55em; }
}

@keyframes intro-spin {
  from { transform: rotate(0deg) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  to   { transform: rotate(360deg) scale(1.25); opacity: 0; }
}

@keyframes intro-hole {
  from { --intro-r: 0px; }
  to   { --intro-r: 90vmax; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Modo Claro Ejecutivo (Derivado de la misma paleta #06141B – #CCD0CF)
   ========================================================================== */
body.theme-light {
  color-scheme: light;
  --bg-abyss: #CCD0CF;
  --bg-surface: #9BA8AB;
  --bg-panel: #4A5C6A;
  --border-steel: #4A5C6A;
  --text-muted: #253745;
  --text-primary: #06141B;

  --glass-shell: linear-gradient(155deg, rgba(255, 255, 255, 0.86) 0%, rgba(204, 208, 207, 0.92) 100%);
  --glass-card: linear-gradient(160deg, rgba(255, 255, 255, 0.82) 0%, rgba(204, 208, 207, 0.72) 100%);
  --glass-pill: linear-gradient(180deg, rgba(204, 208, 207, 0.72) 0%, rgba(155, 168, 171, 0.45) 100%);
  --glass-pill-active: linear-gradient(135deg, #253745 0%, #11212D 100%);
  --glass-border: rgba(37, 55, 69, 0.2);
  --glass-border-strong: rgba(17, 33, 45, 0.36);
  --glass-highlight: inset 0 1px 1px rgba(255, 255, 255, 0.72);
  --shadow-float: 0 22px 48px rgba(17, 33, 45, 0.16);
  --shadow-card: 0 10px 24px rgba(17, 33, 45, 0.1);

  --state-ok: #0e7c61;
  --state-warn: #9a5d07;
  --state-danger: #b4232d;
  --state-info: #165e77;

  background-color: #CCD0CF;
  background-image:
    radial-gradient(circle at 12% 16%, rgba(155, 168, 171, 0.55) 0%, transparent 45%),
    radial-gradient(circle at 86% 14%, rgba(74, 92, 106, 0.22) 0%, transparent 46%),
    radial-gradient(circle at 74% 84%, rgba(155, 168, 171, 0.48) 0%, transparent 45%);
}

body.theme-light .nav-link[aria-current="page"],
body.theme-light .chip.is-active {
  color: #CCD0CF;
}

body.theme-light .nav-link__count {
  background: rgba(17, 33, 45, 0.14);
  color: #06141B;
}

body.theme-light .field-control,
body.theme-light .global-search__input,
body.theme-light .detail-block,
body.theme-light .detail-grid,
body.theme-light .chart-svg-wrap,
body.theme-light .chart-tooltip,
body.theme-light .source-item,
body.theme-light .star-btn,
body.theme-light .chip {
  background: rgba(255, 255, 255, 0.78);
  color: #06141B;
}

body.theme-light .kpi-card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.9) 0%, rgba(204, 208, 207, 0.76) 100%);
}

body.theme-light .kpi-card__pill {
  background: rgba(17, 33, 45, 0.1);
  color: #11212D;
}

body.theme-light .hud-modal {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96) 0%, rgba(204, 208, 207, 0.98) 100%);
}

body.theme-light .hud-modal__header {
  background: rgba(155, 168, 171, 0.28);
}

body.theme-light .hud-modal__footer {
  background: rgba(155, 168, 171, 0.2);
}

body.theme-light .btn--primary {
  background: linear-gradient(135deg, #11212D 0%, #253745 100%);
  color: #CCD0CF;
}

body.theme-light .btn--secondary {
  background: rgba(37, 55, 69, 0.12);
  color: #06141B;
  border-color: rgba(37, 55, 69, 0.24);
}

/* ==========================================================================
   Pantalla de Autenticación (Login / Registro) y Ajustes de Perfil
   ========================================================================== */
body.is-auth-screen .app-shell {
  display: block;
  padding: clamp(1rem, 3vw, 2.5rem);
}

body.is-auth-screen .sidebar,
body.is-auth-screen .topbar {
  display: none;
}

body.is-auth-screen .workspace {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

body.is-auth-screen .main-content {
  padding: 0;
}

.auth-shell {
  min-height: calc(100vh - 5rem);
  display: grid;
  place-items: center;
  padding: 1rem 0;
}

.auth-card {
  width: min(100%, 920px);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  background: var(--glass-shell);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-highlight), var(--shadow-float);
  overflow: hidden;
}

.auth-hero {
  padding: clamp(1.6rem, 3vw, 2.4rem);
  background: linear-gradient(155deg, rgba(37, 55, 69, 0.72) 0%, rgba(17, 33, 45, 0.92) 100%);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

body.theme-light .auth-hero {
  background: linear-gradient(155deg, rgba(17, 33, 45, 0.94) 0%, rgba(37, 55, 69, 0.96) 100%);
  color: #CCD0CF;
}

body.theme-light .auth-hero .field-hint,
body.theme-light .auth-hero p {
  color: #9BA8AB;
}

.auth-hero__logo {
  display: block;
  width: auto;
  height: clamp(150px, 22vw, 210px);
  margin: 0 auto;
}

.auth-form-pane {
  padding: clamp(1.6rem, 3vw, 2.4rem);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.3rem;
  border-radius: 14px;
  background: rgba(6, 20, 27, 0.38);
  border: 1px solid var(--glass-border);
}

.auth-tab {
  min-height: 38px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-tab.is-active {
  background: var(--glass-pill-active);
  color: #CCD0CF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.theme-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  background: rgba(6, 20, 27, 0.32);
  border: 1px solid var(--glass-border);
}

@media (max-width: 820px) {
  .auth-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-hero {
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
  }
}
