/* ==========================================================================
   CNX ERP V2 — Tema visual "CNX" (capa de diseño sobre la plantilla Vuexy)
   --------------------------------------------------------------------------
   Solo estilos: no cambia funciones. Para desactivar el rediseño basta con
   quitar el <link> de este archivo en index.html.
   Paleta de marca: navy #0B1B3D · azul eléctrico #1872F6 · cian #22D3EE
   ========================================================================== */

/* ---------- Tipografía local (Plus Jakarta Sans, licencia SIL OFL) ---------- */
@font-face { font-family: 'Plus Jakarta Sans'; src: url('/assets/fonts/plus-jakarta-sans/PlusJakartaSans-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url('/assets/fonts/plus-jakarta-sans/PlusJakartaSans-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url('/assets/fonts/plus-jakarta-sans/PlusJakartaSans-SemiBold.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url('/assets/fonts/plus-jakarta-sans/PlusJakartaSans-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url('/assets/fonts/plus-jakarta-sans/PlusJakartaSans-ExtraBold.ttf') format('truetype'); font-weight: 800 900; font-style: normal; font-display: swap; }

/* ---------- Variables de marca ---------- */
:root,
[data-bs-theme=light] {
  --cnx-navy: #0b1b3d;
  --cnx-navy-2: #0e2d6a;
  --cnx-blue: #1872f6;
  --cnx-blue-2: #1456c4;
  --cnx-cyan: #22d3ee;
  --cnx-surface: #ffffff;
  --cnx-bg: #f3f6fb;
  --cnx-border: #e6ecf5;
  --cnx-muted: #64748b;
  --cnx-ring: 0 0 0 4px rgba(24, 114, 246, 0.14);
  --cnx-shadow-sm: 0 1px 2px rgba(11, 27, 61, 0.04), 0 2px 8px rgba(11, 27, 61, 0.04);
  --cnx-shadow: 0 1px 2px rgba(11, 27, 61, 0.04), 0 8px 24px -6px rgba(11, 27, 61, 0.08);
  --cnx-shadow-lg: 0 18px 40px -12px rgba(11, 27, 61, 0.22);
  --cnx-ease: cubic-bezier(0.2, 0, 0, 1);

  --bs-primary: #1872f6 !important;
  --bs-primary-rgb: 24, 114, 246 !important;
  --bs-primary-text-emphasis: #0e3f8c;
  --bs-primary-bg-subtle: #e8f1fe;
  --bs-primary-border-subtle: #bcd6fc;
  --bs-secondary: #64748b;
  --bs-secondary-rgb: 100, 116, 139;
  --bs-success: #10b981;
  --bs-success-rgb: 16, 185, 129;
  --bs-info: #06b6d4;
  --bs-info-rgb: 6, 182, 212;
  --bs-warning: #f59e0b;
  --bs-warning-rgb: 245, 158, 11;
  --bs-danger: #ef4444;
  --bs-danger-rgb: 239, 68, 68;

  --bs-font-sans-serif: 'Plus Jakarta Sans', 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-body-color: #475569;
  --bs-body-color-rgb: 71, 85, 105;
  --bs-body-bg: #f3f6fb;
  --bs-body-bg-rgb: 243, 246, 251;
  --bs-heading-color: #0b1b3d;
  --bs-border-color: #e6ecf5;
  --bs-border-radius: 0.625rem;
  --bs-border-radius-sm: 0.5rem;
  --bs-border-radius-lg: 0.875rem;
  --bs-border-radius-xl: 1.125rem;
  --bs-box-shadow: var(--cnx-shadow);
  --bs-box-shadow-sm: var(--cnx-shadow-sm);
  --bs-box-shadow-lg: var(--cnx-shadow-lg);
  --bs-link-color: #1872f6;
  --bs-link-color-rgb: 24, 114, 246;
  --bs-link-hover-color: #1456c4;
}

html, body {
  font-family: var(--bs-font-sans-serif) !important;
  background: var(--cnx-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--bs-font-sans-serif);
  color: var(--bs-heading-color);
  letter-spacing: -0.02em;
}
.fw-bold, b, strong { font-weight: 700; }
.text-muted { color: var(--cnx-muted) !important; }
.text-primary { color: var(--cnx-blue) !important; }
.text-heading { color: var(--cnx-navy) !important; }

::selection { background: rgba(24, 114, 246, 0.18); }

/* Barras de desplazamiento discretas */
* { scrollbar-width: thin; scrollbar-color: #c8d3e3 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #c8d3e3; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: #9fb0c8; }

/* ==========================================================================
   MENÚ LATERAL
   ========================================================================== */
.layout-menu.cnx-sidebar,
.bg-menu-theme.cnx-sidebar {
  --bs-menu-bg: #0b1b3d;
  --bs-menu-color: #b9c6dd;
  background: radial-gradient(120% 60% at 0% 0%, rgba(24, 114, 246, 0.28) 0%, rgba(24, 114, 246, 0) 55%),
              radial-gradient(90% 50% at 100% 100%, rgba(34, 211, 238, 0.14) 0%, rgba(34, 211, 238, 0) 60%),
              linear-gradient(180deg, #0b1b3d 0%, #0a1733 100%) !important;
  color: #b9c6dd !important;
  box-shadow: 4px 0 30px rgba(11, 27, 61, 0.12) !important;
  border-right: 0 !important;
  display: flex;
  flex-direction: column;
}

.cnx-sidebar .cnx-brand {
  height: auto !important;
  min-height: 76px;
  padding: 18px 18px 14px !important;
  margin: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cnx-sidebar .app-brand-link { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.cnx-sidebar .cnx-brand-logo {
  width: 46px; height: 46px; object-fit: contain;
  padding: 7px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  filter: brightness(0) invert(1);
  box-shadow: 0 8px 20px -6px rgba(24, 114, 246, 0.55);
}
.cnx-sidebar .cnx-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.cnx-sidebar .cnx-brand-title { color: #fff; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.cnx-sidebar .cnx-brand-sub { color: #7f93b5; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.cnx-sidebar .cnx-brand { position: relative; }
.cnx-sidebar .layout-menu-toggle {
  color: #7f93b5 !important;
  position: absolute !important; right: 10px; top: 10px;
  padding: 4px !important; margin: 0 !important;
  font-size: 0.9rem; opacity: 0.6;
}
.cnx-sidebar .layout-menu-toggle:hover { color: #fff !important; opacity: 1; }

.cnx-sidebar .menu-inner { padding: 8px 12px 16px !important; flex: 1 1 auto; overflow-y: auto; }
.cnx-sidebar .menu-inner-shadow { display: none !important; }

.cnx-sidebar .cnx-menu-header {
  list-style: none;
  padding: 16px 12px 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5f7395;
}

.cnx-sidebar .menu-inner > .menu-item,
.cnx-sidebar .menu-item { margin: 2px 0 !important; width: auto !important; max-width: 100%; align-self: stretch !important; }
.cnx-sidebar .menu-inner { box-sizing: border-box; overflow-x: hidden; }
.cnx-sidebar .menu-item .menu-link {
  position: relative;
  width: 100% !important;
  color: #b9c6dd !important;
  border-radius: 12px !important;
  padding: 9px 12px !important;
  margin: 0 !important;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background-color 0.22s var(--cnx-ease), color 0.22s var(--cnx-ease), transform 0.22s var(--cnx-ease);
}
.cnx-sidebar .menu-item .menu-link .menu-icon {
  color: #7f93b5 !important;
  font-size: 1.2rem;
  margin-right: 0.7rem;
  transition: color 0.22s var(--cnx-ease), transform 0.3s var(--cnx-ease);
}
.cnx-sidebar .menu-item:not(.active) .menu-link:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
  transform: translateX(3px);
}
.cnx-sidebar .menu-item:not(.active) .menu-link:hover .menu-icon { color: var(--cnx-cyan) !important; transform: scale(1.08); }

.cnx-sidebar .menu-item.active > .menu-link {
  background: linear-gradient(135deg, #1872f6 0%, #1456c4 100%) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px -8px rgba(24, 114, 246, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
}
.cnx-sidebar .menu-item.active > .menu-link .menu-icon { color: #fff !important; }
.cnx-sidebar .menu-item.active > .menu-link::before {
  content: '';
  position: absolute; left: -12px; top: 9px; bottom: 9px;
  width: 4px; border-radius: 0 4px 4px 0;
  background: var(--cnx-cyan);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.8);
}

/* Tarjeta del usuario al pie del menú */
.cnx-user-card {
  margin: 10px 12px 14px;
  padding: 10px;
  display: flex; align-items: center; gap: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.cnx-user-avatar {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #22d3ee, #1872f6);
  box-shadow: 0 6px 14px -4px rgba(34, 211, 238, 0.6);
}
.cnx-user-info { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.cnx-user-name { color: #fff; font-weight: 700; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cnx-user-role { color: #7f93b5; font-size: 0.7rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cnx-user-logout {
  border: 0; background: rgba(255, 255, 255, 0.06); color: #b9c6dd;
  width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--cnx-ease);
}
.cnx-user-logout:hover { background: rgba(239, 68, 68, 0.18); color: #fecaca; }

/* ==========================================================================
   BARRA SUPERIOR
   ========================================================================== */
.layout-navbar.cnx-topbar {
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: saturate(180%) blur(14px) !important;
  -webkit-backdrop-filter: saturate(180%) blur(14px) !important;
  border: 1px solid rgba(230, 236, 245, 0.9) !important;
  border-radius: 18px !important;
  box-shadow: 0 8px 30px -12px rgba(11, 27, 61, 0.12) !important;
  min-height: 64px;
}
.cnx-icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px !important;
  background: #f1f5fb !important;
  color: var(--cnx-navy) !important;
  border: 1px solid var(--cnx-border) !important;
  transition: all 0.2s var(--cnx-ease);
}
.cnx-icon-btn:hover { background: #e8f1fe !important; color: var(--cnx-blue) !important; transform: translateY(-1px); }
.cnx-page-title { align-items: center; gap: 8px; margin-right: 18px; white-space: nowrap; }
.cnx-crumb { color: var(--cnx-muted); font-weight: 600; font-size: 0.85rem; }
.cnx-crumb-sep { color: #b4c0d3; font-size: 0.9rem; }
.cnx-crumb-current { color: var(--cnx-navy); font-weight: 800; font-size: 0.95rem; }
.cnx-search {
  width: 100%; max-width: 420px;
  background: #f1f5fb;
  border: 1px solid var(--cnx-border);
  border-radius: 12px;
  padding: 0 12px;
  height: 40px;
  color: var(--cnx-muted);
  transition: all 0.2s var(--cnx-ease);
}
.cnx-search:focus-within { background: #fff; border-color: #9cc2fb; box-shadow: var(--cnx-ring); }
.cnx-search .form-control { padding-left: 0; font-size: 0.875rem; }
.cnx-date-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 10px;
  background: #f1f5fb; color: var(--cnx-navy);
  font-size: 0.8rem; font-weight: 600;
  border: 1px solid var(--cnx-border);
}
.cnx-ghost-btn {
  background: #f1f5fb !important; color: var(--cnx-navy) !important;
  border: 1px solid var(--cnx-border) !important; border-radius: 10px !important;
  font-weight: 600; font-size: 0.8rem; padding: 7px 12px !important;
}
.cnx-ghost-btn:hover { background: #e8f1fe !important; color: var(--cnx-blue) !important; }
.cnx-avatar {
  background: linear-gradient(135deg, #0b1b3d, #1872f6) !important;
  color: #fff !important; font-weight: 800;
  box-shadow: 0 6px 16px -6px rgba(24, 114, 246, 0.7);
}
.cnx-dropdown { min-width: 220px; }

/* ==========================================================================
   TRANSICIÓN ENTRE SECCIONES Y ENTRADA DE CONTENIDO
   ========================================================================== */
/* Solo animación de entrada: la sección anterior se retira al instante
   (así ninguna pantalla puede quedarse "atorada" durante el cambio). */
.cnx-page-enter-active { transition: opacity 0.32s var(--cnx-ease), transform 0.42s var(--cnx-ease); }
.cnx-page-leave-active { display: none !important; }
.cnx-page-enter-from { opacity: 0; transform: translateY(14px); }

@keyframes cnx-rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes cnx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cnx-shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes cnx-pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); } 100% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); } }

/* Las tarjetas de cada sección aparecen escalonadas */
.container-p-y .row > [class*='col'] > .card,
.container-p-y > div > .card {
  animation: cnx-rise 0.55s var(--cnx-ease) both;
}
.container-p-y .row > [class*='col']:nth-child(2) > .card { animation-delay: 0.05s; }
.container-p-y .row > [class*='col']:nth-child(3) > .card { animation-delay: 0.1s; }
.container-p-y .row > [class*='col']:nth-child(4) > .card { animation-delay: 0.15s; }
.container-p-y .row > [class*='col']:nth-child(5) > .card { animation-delay: 0.2s; }
.container-p-y .row > [class*='col']:nth-child(6) > .card { animation-delay: 0.25s; }
.container-p-y .row > [class*='col']:nth-child(n+7) > .card { animation-delay: 0.3s; }

/* Esqueleto de carga reutilizable */
.cnx-skeleton {
  background: linear-gradient(90deg, #eef2f8 0px, #f8fafd 120px, #eef2f8 240px);
  background-size: 800px 100%;
  animation: cnx-shimmer 1.3s linear infinite;
  border-radius: 8px;
}

/* ==========================================================================
   TARJETAS
   ========================================================================== */
.card {
  border: 1px solid var(--cnx-border) !important;
  border-radius: 18px !important;
  box-shadow: var(--cnx-shadow) !important;
  background-color: var(--cnx-surface);
  transition: box-shadow 0.25s var(--cnx-ease), transform 0.25s var(--cnx-ease), border-color 0.25s var(--cnx-ease) !important;
}
/* Sin "brinco" en tarjetas grandes (tablas, formularios) */
.card:hover { transform: none !important; box-shadow: var(--cnx-shadow) !important; }
/* Tarjetas pequeñas tipo KPI sí se elevan al pasar el mouse */
.row > [class*='col-xl-2'] > .card:hover,
.row > [class*='col-xl-3'] > .card:hover,
.row > [class*='col-lg-3'] > .card:hover,
.row > [class*='col-md-3'] > .card:hover,
.card.cnx-hover:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 16px 34px -14px rgba(11, 27, 61, 0.22) !important;
  border-color: #d6e3f6 !important;
}
.card-header {
  background: transparent !important;
  border-bottom: 0 !important;
  padding-top: 1.25rem;
}
.card-title, .card-header h5, .card-header .h5 { font-weight: 800; color: var(--cnx-navy); letter-spacing: -0.015em; }
.card .card-header + .card-body { padding-top: 0.75rem; }

/* Tarjetas KPI con borde lateral → acento superior más elegante */
.card.border-start.border-4 {
  border-left-width: 1px !important;
  border-left-color: var(--cnx-border) !important;
  position: relative;
  overflow: hidden;
}
.card.border-start.border-4::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--cnx-accent, #1872f6), color-mix(in srgb, var(--cnx-accent, #1872f6) 35%, #22d3ee));
}
.card.border-start.border-primary { --cnx-accent: #1872f6; }
.card.border-start.border-success { --cnx-accent: #10b981; }
.card.border-start.border-danger { --cnx-accent: #ef4444; }
.card.border-start.border-info { --cnx-accent: #06b6d4; }
.card.border-start.border-warning { --cnx-accent: #f59e0b; }
.card.border-start.border-secondary { --cnx-accent: #64748b; }

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn {
  border-radius: 11px;
  font-weight: 700;
  letter-spacing: 0.005em;
  transition: transform 0.18s var(--cnx-ease), box-shadow 0.22s var(--cnx-ease), background-color 0.2s, color 0.2s, border-color 0.2s !important;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-sm, .btn-group-sm > .btn { border-radius: 9px; }
.btn-xs { border-radius: 8px; }

.btn-primary {
  background: linear-gradient(135deg, #1872f6 0%, #1456c4 100%) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: 0 8px 18px -8px rgba(24, 114, 246, 0.75) !important;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2a80ff 0%, #1872f6 100%) !important;
  box-shadow: 0 12px 24px -10px rgba(24, 114, 246, 0.85) !important;
  transform: translateY(-1px);
}
.btn-success:not(.btn-outline-success) { box-shadow: 0 8px 18px -10px rgba(16, 185, 129, 0.8); }
.btn-danger:not(.btn-outline-danger) { box-shadow: 0 8px 18px -10px rgba(239, 68, 68, 0.8); }
.btn-success:hover:not(:disabled), .btn-danger:hover:not(:disabled), .btn-info:hover:not(:disabled), .btn-warning:hover:not(:disabled) { transform: translateY(-1px); }

[class*='btn-outline-'] { border-width: 1.5px; background: #fff; }
[class*='btn-outline-']:hover:not(:disabled) { transform: translateY(-1px); }
[class*='btn-label-'] { border: 0; }
.btn:focus-visible { box-shadow: var(--cnx-ring) !important; }

/* ==========================================================================
   INSIGNIAS
   ========================================================================== */
.badge { font-weight: 700; letter-spacing: 0.01em; border-radius: 8px; }
.badge.rounded-pill { border-radius: 50rem; }
.bg-label-primary { background-color: #e8f1fe !important; color: #1456c4 !important; }
.bg-label-success { background-color: #e6f8f1 !important; color: #047857 !important; }
.bg-label-danger { background-color: #fdecec !important; color: #b91c1c !important; }
.bg-label-warning { background-color: #fef4e2 !important; color: #b45309 !important; }
.bg-label-info { background-color: #e3f8fb !important; color: #0e7490 !important; }
.bg-label-secondary { background-color: #eef2f7 !important; color: #475569 !important; }

/* ==========================================================================
   TABLAS
   ========================================================================== */
.table { --bs-table-hover-bg: #f5f9ff; --bs-table-striped-bg: #fafcff; color: #334155; }
.table > :not(caption) > * > * { border-bottom-color: #eef2f8; padding-top: 0.8rem; padding-bottom: 0.8rem; }
.table thead th,
.table .table-light th,
.table > thead > tr > th {
  background: #f6f8fc !important;
  color: #64748b !important;
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid #e6ecf5 !important;
  white-space: nowrap;
}
.table thead th:first-child { border-top-left-radius: 12px; }
.table thead th:last-child { border-top-right-radius: 12px; }
.table-hover > tbody > tr { transition: background-color 0.15s ease; }
.table-hover > tbody > tr:hover > * { background-color: #f5f9ff !important; }
.table-responsive { border-radius: 0 0 18px 18px; }

/* ==========================================================================
   FORMULARIOS
   ========================================================================== */
.form-control, .form-select {
  border-radius: 11px;
  border-color: #dfe6f1;
  background-color: #fff;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.form-control:hover:not(:disabled):not(:focus), .form-select:hover:not(:disabled):not(:focus) { border-color: #c7d3e5; }
.form-control:focus, .form-select:focus {
  border-color: #6ea6fa !important;
  box-shadow: var(--cnx-ring) !important;
}
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: #f6f8fc; }
.form-label, label.form-label { font-weight: 700; color: #334155; font-size: 0.8rem; letter-spacing: 0.01em; }
.input-group-text { border-color: #dfe6f1; background: #f8fafd; border-radius: 11px; }
.input-group:focus-within .input-group-text { border-color: #6ea6fa; }
.form-check-input:checked { background-color: #1872f6; border-color: #1872f6; }
.form-check-input:focus { box-shadow: var(--cnx-ring); }
.form-switch .form-check-input { cursor: pointer; }

/* ==========================================================================
   MODALES, MENÚS DESPLEGABLES, ALERTAS, PESTAÑAS, PAGINACIÓN
   ========================================================================== */
.modal-backdrop.show { opacity: 1 !important; background: rgba(11, 27, 61, 0.42); backdrop-filter: blur(4px); }
.modal-content {
  border: 0 !important;
  border-radius: 22px !important;
  box-shadow: 0 30px 70px -20px rgba(11, 27, 61, 0.45) !important;
  overflow: hidden;
}
.modal.fade .modal-dialog { transform: translateY(18px) scale(0.98); transition: transform 0.32s var(--cnx-ease), opacity 0.25s; }
.modal.show .modal-dialog { transform: none; }
.modal-header { border-bottom: 1px solid #eef2f8 !important; padding: 1.15rem 1.5rem; }
.modal-header .modal-title { font-weight: 800; color: var(--cnx-navy); }
.modal-footer { border-top: 1px solid #eef2f8 !important; }

.dropdown-menu {
  border: 1px solid var(--cnx-border) !important;
  border-radius: 14px !important;
  box-shadow: 0 18px 40px -16px rgba(11, 27, 61, 0.28) !important;
  padding: 6px;
  animation: cnx-rise 0.18s var(--cnx-ease) both;
}
.dropdown-item { border-radius: 9px; font-weight: 600; font-size: 0.85rem; padding: 8px 12px; }
.dropdown-item:hover, .dropdown-item:focus { background: #f1f6fe; color: #1456c4; }

.alert { border-radius: 14px; border: 1px solid transparent; font-weight: 600; }

.nav-tabs { border-bottom: 1px solid var(--cnx-border); gap: 4px; }
.nav-tabs .nav-link { border: 0 !important; border-radius: 10px 10px 0 0; font-weight: 700; color: var(--cnx-muted); position: relative; }
.nav-tabs .nav-link.active { color: var(--cnx-blue) !important; background: transparent; }
.nav-tabs .nav-link.active::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px;
  border-radius: 3px 3px 0 0; background: linear-gradient(90deg, #1872f6, #22d3ee);
}
.nav-pills .nav-link { border-radius: 11px; font-weight: 700; color: var(--cnx-muted); transition: all 0.2s var(--cnx-ease); }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
  background: linear-gradient(135deg, #1872f6, #1456c4) !important; color: #fff !important;
  box-shadow: 0 8px 18px -10px rgba(24, 114, 246, 0.8);
}

.pagination { gap: 4px; }
.page-link { border-radius: 10px !important; border: 1px solid var(--cnx-border); font-weight: 700; color: #475569; min-width: 36px; text-align: center; }
.page-item.active .page-link { background: linear-gradient(135deg, #1872f6, #1456c4); border-color: transparent; color: #fff; box-shadow: 0 8px 16px -8px rgba(24, 114, 246, 0.8); }

.progress { border-radius: 10px; background: #edf2f9; }
.progress-bar { border-radius: 10px; }

.list-group-item { border-color: #eef2f8; }

/* Avatares e indicador "en línea" */
.avatar-online::after { animation: cnx-pulse-ring 1.8s ease-out infinite; }

/* ==========================================================================
   SWEETALERT2
   ========================================================================== */
.swal2-container.swal2-backdrop-show { background: rgba(11, 27, 61, 0.42) !important; backdrop-filter: blur(4px); }
.swal2-popup {
  border-radius: 22px !important;
  font-family: var(--bs-font-sans-serif) !important;
  box-shadow: 0 30px 70px -20px rgba(11, 27, 61, 0.45) !important;
  padding: 1.6rem 1.4rem 1.4rem !important;
}
.swal2-title { color: var(--cnx-navy) !important; font-weight: 800 !important; letter-spacing: -0.02em; }
.swal2-html-container { color: #475569 !important; }
.swal2-styled { border-radius: 11px !important; font-weight: 700 !important; padding: 0.65rem 1.4rem !important; }
.swal2-styled.swal2-confirm:not([style*='background']) { background: linear-gradient(135deg, #1872f6, #1456c4) !important; }
.swal2-styled:focus { box-shadow: var(--cnx-ring) !important; }
.swal2-input, .swal2-textarea, .swal2-select { border-radius: 11px !important; }

/* ==========================================================================
   GRÁFICAS (ApexCharts)
   ========================================================================== */
.apexcharts-canvas, .apexcharts-text, .apexcharts-legend-text, .apexcharts-datalabel, .apexcharts-tooltip {
  font-family: var(--bs-font-sans-serif) !important;
}
.apexcharts-tooltip {
  border-radius: 12px !important;
  border: 1px solid var(--cnx-border) !important;
  box-shadow: 0 14px 30px -12px rgba(11, 27, 61, 0.3) !important;
}

/* ==========================================================================
   ACCESIBILIDAD: respetar "reducir movimiento"
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Impresión: sin efectos */
@media print {
  .cnx-sidebar, .cnx-topbar { display: none !important; }
  .card { box-shadow: none !important; animation: none !important; }
}
