:root {
  --nx-bg: #07111f;
  --nx-bg-soft: #0d1830;
  --nx-surface: rgba(15, 23, 42, 0.78);
  --nx-surface-strong: #101b31;
  --nx-card: rgba(255, 255, 255, 0.92);
  --nx-card-soft: rgba(255, 255, 255, 0.84);
  --nx-border: rgba(148, 163, 184, 0.18);
  --nx-border-strong: rgba(99, 102, 241, 0.26);
  --nx-text: #0f172a;
  --nx-text-soft: #64748b;
  --nx-text-inverse: #e5eefc;
  --nx-primary: #4f46e5;
  --nx-primary-2: #06b6d4;
  --nx-accent: #8b5cf6;
  --nx-success: #059669;
  --nx-warning: #d97706;
  --nx-danger: #dc2626;
  --nx-shadow: 0 20px 45px rgba(2, 8, 23, 0.18);
  --nx-shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.08);
  --nx-radius-xl: 28px;
  --nx-radius-lg: 22px;
  --nx-radius-md: 16px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--nx-text);
  background:
    radial-gradient(circle at 10% 15%, rgba(79, 70, 229, 0.22), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(6, 182, 212, 0.18), transparent 24%),
    radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.14), transparent 26%),
    linear-gradient(180deg, #eef4ff 0%, #f8fbff 34%, #eef2ff 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,0));
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Manrope", "Inter", sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
}

a { text-decoration: none; }

.flash-stack {
  position: fixed;
  top: 1.15rem;
  right: 1.15rem;
  z-index: 1085;
  width: min(420px, calc(100vw - 2rem));
}

.alert {
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(14px);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  gap: 1.15rem;
  padding: 1.15rem;
}

.sidebar {
  width: 290px;
  flex: 0 0 290px;
  background:
    linear-gradient(180deg, rgba(9,16,34,.98), rgba(14,24,48,.94)),
    radial-gradient(circle at top right, rgba(6,182,212,.16), transparent 30%);
  color: var(--nx-text-inverse);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 30px;
  padding: 1.25rem;
  box-shadow: 0 18px 40px rgba(2, 8, 23, 0.34);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 1.15rem;
  max-height: calc(100vh - 2.3rem);
  overflow: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .35rem .2rem 1.1rem;
  margin-bottom: .7rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-symbol {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1.15rem;
  color: #fff;
  background: linear-gradient(135deg, var(--nx-primary), var(--nx-primary-2));
  box-shadow: 0 12px 30px rgba(6, 182, 212, 0.28);
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.brand-meta strong {
  font-size: 1.12rem;
  line-height: 1;
  color: #fff;
}

.brand-meta span {
  font-size: .82rem;
  color: rgba(226, 232, 240, 0.72);
}


.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: .28rem;
}

.nav-section {
  padding: 1rem .75rem .35rem;
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .12em;
  color: rgba(191, 219, 254, 0.52);
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .88rem .95rem;
  border-radius: 16px;
  color: rgba(226, 232, 240, 0.86);
  transition: .25s ease;
  font-weight: 600;
}

.nav-item i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
  transform: translateX(3px);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(79, 70, 229, .92), rgba(6, 182, 212, .82));
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem;
  border-radius: 20px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
}

.sidebar-footer small {
  display: block;
  color: rgba(226, 232, 240, .7);
}

.sidebar-footer strong {
  display: block;
  color: #fff;
  margin: .15rem 0;
}

.main-area {
  /* La hoja app.css reserva 270px para el sidebar fijo anterior.
     En Nexora el sidebar ya forma parte del flex de .app-shell;
     por eso eliminamos ese margen duplicado. */
  margin-left: 0;
  min-width: 0;
  width: 0;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.topbar {
  position: sticky;
  top: 1.15rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255,255,255,.48);
  box-shadow: var(--nx-shadow-soft);
  backdrop-filter: blur(18px);
}

.topbar .btn {
  border-radius: 14px;
}

.global-search {
  align-items: center;
  gap: .7rem;
  padding: .85rem 1rem;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}

.global-search i {
  color: var(--nx-text-soft);
}

.global-search input {
  color: var(--nx-text);
}

.page-content {
  padding: .35rem .15rem 1rem;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
}

.page-heading h1 {
  margin: .45rem 0 .3rem;
  font-size: clamp(1.9rem, 1.35rem + 1.4vw, 2.7rem);
}

.page-heading p {
  margin: 0;
  color: var(--nx-text-soft);
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .8rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, .1);
  color: var(--nx-primary);
  border: 1px solid rgba(99, 102, 241, .18);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.panel-card,
.metric-card,
.login-card,
.login-brand,
.table-container {
  border-radius: var(--nx-radius-lg);
}

.panel-card {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.9));
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: var(--nx-shadow-soft);
  padding: 1.3rem;
  overflow: hidden;
}

.panel-card > hr {
  border-color: rgba(148, 163, 184, 0.18);
}

.panel-card:hover {
  border-color: rgba(129, 140, 248, 0.25);
}

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

.panel-header h2,
.panel-card h2 {
  margin: 0;
  font-size: 1.08rem;
}

.panel-header p,
.panel-card p {
  margin: .28rem 0 0;
  color: var(--nx-text-soft);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.metric-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,247,255,.92));
  border: 1px solid rgba(255,255,255,.8);
  box-shadow: var(--nx-shadow-soft);
  padding: 1.15rem;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -40px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79,70,229,.18), transparent 65%);
}

.metric-card span {
  display: block;
  color: var(--nx-text-soft);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.metric-card strong {
  display: block;
  font-size: 1.85rem;
  margin: .3rem 0;
  line-height: 1.1;
}

.metric-card small {
  color: var(--nx-text-soft);
}

.table,
.modern-table {
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  padding: .9rem .85rem;
  border-bottom-color: rgba(226, 232, 240, 0.82);
}

.table thead th,
.modern-table thead th {
  border-bottom-width: 1px;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--nx-text-soft);
  font-weight: 800;
  background: rgba(248, 250, 252, 0.88);
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  padding: .35rem .65rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  background: rgba(148, 163, 184, .14);
  color: var(--nx-text);
}

.badge-soft.success { background: rgba(16,185,129,.14); color: #047857; }
.badge-soft.info { background: rgba(59,130,246,.14); color: #1d4ed8; }

.btn {
  border-radius: 15px;
  font-weight: 700;
  padding: .72rem 1rem;
  transition: .22s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-brand,
.btn-dark {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--nx-primary), var(--nx-primary-2));
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.2);
}

.btn-brand:hover,
.btn-dark:hover,
.btn-brand:focus,
.btn-dark:focus {
  color: #fff;
  background: linear-gradient(135deg, #4338ca, #0891b2);
}

.btn-light,
.btn-outline-secondary {
  background: rgba(255,255,255,.92);
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: var(--nx-text);
}

.form-control,
.form-select {
  border-radius: 14px;
  padding: .82rem .95rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(79, 70, 229, .45);
  box-shadow: 0 0 0 .24rem rgba(79, 70, 229, .12);
}

.form-check {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: rgba(248, 250, 252, 0.72);
}

.notif-badge {
  position: absolute;
  top: -.35rem;
  right: -.3rem;
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 .24rem;
  font-size: .68rem;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.28);
}

.text-secondary {
  color: var(--nx-text-soft) !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(360px, .9fr);
  gap: 1.2rem;
  padding: 1.2rem;
  align-items: stretch;
}

.login-brand,
.login-card {
  position: relative;
  overflow: hidden;
}

.login-brand {
  display: flex;
  align-items: flex-end;
  padding: clamp(2rem, 5vw, 4rem);
  background:
    radial-gradient(circle at 20% 20%, rgba(6,182,212,.24), transparent 18%),
    radial-gradient(circle at 80% 15%, rgba(139,92,246,.22), transparent 18%),
    linear-gradient(135deg, #09162e 0%, #0d1e44 54%, #102a63 100%);
  color: #fff;
  box-shadow: 0 24px 48px rgba(2, 8, 23, 0.28);
}

.login-brand::before,
.login-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.12), transparent 68%);
}

.login-brand::before {
  width: 280px;
  height: 280px;
  top: -110px;
  right: -80px;
}

.login-brand::after {
  width: 220px;
  height: 220px;
  bottom: -90px;
  left: -70px;
}

.login-brand h1 {
  font-size: clamp(2.6rem, 2rem + 2vw, 4.2rem);
  margin: .8rem 0;
}

.login-brand p {
  color: rgba(226,232,240,.84);
  max-width: 560px;
  font-size: 1.02rem;
}

.login-form {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: min(100%, 520px);
  padding: clamp(1.6rem, 4vw, 2.5rem);
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(16px);
}

.login-card h2 {
  font-size: 2rem;
}

.login-card .form-label {
  font-weight: 700;
  color: #334155;
}

.login-card a {
  color: var(--nx-primary);
  font-weight: 600;
}

.pagination .page-link {
  border-radius: 12px !important;
  margin: 0 .12rem;
  border-color: rgba(148,163,184,.18);
}

@media (max-width: 1199.98px) {
  .sidebar {
    width: 270px;
    flex-basis: 270px;
  }
}

@media (max-width: 991.98px) {
  .app-shell {
    padding: .85rem;
  }

  .sidebar {
    position: fixed;
    left: .85rem;
    top: .85rem;
    bottom: .85rem;
    max-height: none;
    transform: translateX(-120%);
    transition: transform .28s ease;
    z-index: 1045;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-area {
    width: 100%;
  }

  .topbar {
    top: .85rem;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 260px;
    align-items: end;
  }
}

@media (max-width: 767.98px) {
  .page-heading {
    align-items: start;
  }

  .page-heading h1 {
    font-size: 1.8rem;
  }

  .panel-card,
  .metric-card,
  .login-card {
    padding: 1rem;
  }

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

/* =======================================================
   IMPACTO NEXORA — IDENTIDAD VISUAL OFICIAL
   Integra el logotipo aprobado sin afectar el layout.
   ======================================================= */

.sidebar-brand {
  min-width: 0;
  gap: 0;
}

.nexora-brand-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: .58rem;
  color: #fff;
  text-decoration: none;
  border-radius: 14px;
}

.nexora-brand-link:hover,
.nexora-brand-link:focus-visible {
  color: #fff;
  text-decoration: none;
}

.nexora-brand-link:focus-visible {
  outline: 2px solid #22d3ee;
  outline-offset: 4px;
}

.nexora-brand-icon {
  display: block;
  width: 67px;
  height: 67px;
  flex: 0 0 67px;
  object-fit: contain;
  filter: drop-shadow(0 7px 12px rgba(6,182,212,.2));
}

.nexora-brand-link .brand-meta {
  min-width: 0;
  gap: .12rem;
}

.nexora-brand-link .nexora-brand-parent {
  font-size: .69rem;
  letter-spacing: .17em;
  font-weight: 800;
  color: #a5b4fc;
  line-height: 1.2;
}

.nexora-brand-link .brand-meta strong {
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 1.56rem;
  line-height: 1.03;
  letter-spacing: -.035em;
  color: #fff;
}

.nexora-brand-link .nexora-brand-caption {
  font-size: .68rem;
  line-height: 1.3;
  color: #cbd5e1;
  max-width: 160px;
}

/* Login: el logo completo tiene letras azul marino y se muestra
   únicamente sobre el panel claro, garantizando contraste. */
.nexora-login-identity {
  position: relative;
  z-index: 1;
}

.login-brand .nexora-login-identity .eyebrow {
  color: #e0e7ff;
  background: rgba(99, 102, 241, .23);
  border-color: rgba(165, 180, 252, .24);
}

.nexora-login-orbit {
  display: block;
  width: clamp(92px, 10vw, 132px);
  height: auto;
  margin-bottom: 1rem;
  filter: drop-shadow(0 16px 23px rgba(6,182,212,.24));
}

.login-brand .nexora-login-identity h1 {
  color: #fff;
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1.08;
}

.login-brand .nexora-login-identity h1 span {
  color: #67e8f9;
}

.nexora-login-wordmark {
  display: block;
  width: min(100%, 330px);
  height: auto;
  object-fit: contain;
  margin: 0 0 1.25rem;
}

@media (max-width: 1199.98px) {
  .nexora-brand-icon { width: 58px; height: 58px; flex-basis: 58px; }
  .nexora-brand-link .brand-meta strong { font-size: 1.42rem; }
}

@media (max-width: 991.98px) {
  .nexora-login-identity { max-width: 720px; }
  .nexora-login-orbit { width: 96px; }
}

@media (max-width: 767.98px) {
  .login-brand .nexora-login-identity h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .nexora-login-wordmark { width: min(100%, 280px); }
}


/* Nexora v1.26.5: identidad compacta con isotipo original y nuevo eslogan */
.nexora-brand-link .brand-meta { gap: .20rem; }
.nexora-brand-link .brand-meta strong { font-size: 1.63rem; letter-spacing: -.045em; }
.nexora-brand-link .nexora-brand-caption {
  display: block;
  max-width: 192px;
  font-size: .62rem;
  line-height: 1.38;
  letter-spacing: 0;
  color: #cbd5e1;
}
.nexora-login-wordmark-compact {
  display: flex;
  align-items: center;
  gap: .8rem;
  max-width: 100%;
  margin-bottom: 1.35rem;
}
.nexora-login-wordmark-compact img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex: 0 0 64px;
  filter: drop-shadow(0 7px 12px rgba(37,99,235,.15));
}
.nexora-login-wordmark-compact strong {
  display: block;
  color: #131c3b;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: 1.08;
}
.nexora-login-wordmark-compact small {
  display: block;
  margin-top: .25rem;
  color: #60718c;
  font-size: .72rem;
  line-height: 1.35;
}
