/* ================================================================
   VALEX — wwwroot/css/valex.css
   Estilos del layout principal: sidebar, header, contenido, footer
   Compatible con: dark-theme | light-theme | sidebar-mini
   ================================================================ */

/* ── Google Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap');

/* ── Variables globales ────────────────────────────────────────── */
:root {
  /* Colores primarios */
  --vx-primary:          #6259ca;
  --vx-primary-hover:    #4e46b4;
  --vx-primary-rgb:      98, 89, 202;
  --vx-secondary:        #eb6f33;
  --vx-success:          #19b159;
  --vx-info:             #45aaf2;
  --vx-warning:          #ecb403;
  --vx-danger:           #ee335e;

  /* Layout */
  --vx-sidebar-width:       240px;
  --vx-sidebar-mini-width:  70px;
  --vx-header-height:       63px;

  /* Fuente */
  --vx-font:  'Roboto', sans-serif;
  --vx-fs:    0.875rem;

  /* Bordes */
  --vx-border:        1px solid rgba(255,255,255,.1);
  --vx-border-light:  1px solid #e6e6f1;
  --vx-radius:        0.375rem;
}

/* ── Dark Theme (por defecto, como el template original) ───────── */
body.dark-theme {
  --vx-body-bg:        #22223b;
  --vx-sidebar-bg:     #2c2c54;
  --vx-sidebar-text:   rgba(255,255,255,.65);
  --vx-sidebar-hover:  rgba(255,255,255,.07);
  --vx-sidebar-active: rgba(255,255,255,.12);
  --vx-header-bg:      #2c2c54;
  --vx-header-border:  rgba(255,255,255,.08);
  --vx-card-bg:        #2c2c54;
  --vx-card-border:    rgba(255,255,255,.08);
  --vx-text-color:     #cdd4e0;
  --vx-text-muted:     rgba(255,255,255,.4);
  --vx-input-bg:       rgba(0,0,0,.2);
  --vx-input-border:   rgba(255,255,255,.12);
  --vx-badge-bg:       rgba(0,0,0,.25);
}

/* ── Light Theme ───────────────────────────────────────────────── */
body.light-theme {
  --vx-body-bg:        #f0f0ff;
  --vx-sidebar-bg:     #2c2c54;
  --vx-sidebar-text:   rgba(255,255,255,.65);
  --vx-sidebar-hover:  rgba(255,255,255,.07);
  --vx-sidebar-active: rgba(255,255,255,.12);
  --vx-header-bg:      #fff;
  --vx-header-border:  #e6e6f1;
  --vx-card-bg:        #fff;
  --vx-card-border:    #e6e6f1;
  --vx-text-color:     #495057;
  --vx-text-muted:     #74829c;
  --vx-input-bg:       #fff;
  --vx-input-border:   #e6e6f1;
  --vx-badge-bg:       #f0f0ff;
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family:       var(--vx-font);
  font-size:         var(--vx-fs);
  background-color:  var(--vx-body-bg);
  color:             var(--vx-text-color);
  margin:            0;
  overflow-x:        hidden;
  transition:        background-color .25s;
}

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 4px; height: 4px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: rgba(98,89,202,.4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--vx-primary); }

/* ================================================================
   HEADER — #vx-main-header
   ================================================================ */
#vx-main-header {
  position:       fixed;
  top:            0;
  left:           var(--vx-sidebar-width);
  right:          0;
  height:         var(--vx-header-height);
  background:     var(--vx-header-bg);
  border-bottom:  1px solid var(--vx-header-border);
  z-index:        1030;
  display:        flex;
  align-items:    center;
  padding:        0 1.25rem;
  gap:            .75rem;
  transition:     left .3s ease, background .25s;
  box-shadow:     0 2px 8px rgba(0,0,0,.08);
}

body.sidebar-mini #vx-main-header { left: var(--vx-sidebar-mini-width); }

/* Toggle sidebar */
#vx-sidebar-toggle {
  background:    none;
  border:        none;
  color:         var(--vx-text-color);
  font-size:     1.35rem;
  cursor:        pointer;
  padding:       .25rem .45rem;
  border-radius: var(--vx-radius);
  display:       flex;
  align-items:   center;
  transition:    background .2s;
  flex-shrink:   0;
}

#vx-sidebar-toggle:hover { background: var(--vx-sidebar-hover); }

/* Buscador */
#vx-header-search {
  flex: 1;
  max-width: 320px;
  position: relative;
}

#vx-header-search .vx-search-input {
  background:    var(--vx-input-bg);
  border:        1px solid var(--vx-input-border);
  border-radius: 2rem;
  color:         var(--vx-text-color);
  font-size:     .8335rem;
  padding:       .4rem 1rem .4rem 2.2rem;
  width:         100%;
  outline:       none;
  transition:    border-color .2s;
}

#vx-header-search .vx-search-input::placeholder { color: var(--vx-text-muted); }
#vx-header-search .vx-search-input:focus { border-color: var(--vx-primary); }

#vx-header-search .vx-search-icon {
  position:  absolute;
  left:      .75rem;
  top:       50%;
  transform: translateY(-50%);
  color:     var(--vx-text-muted);
  font-size: .85rem;
  pointer-events: none;
}

/* Nav derecho */
#vx-header-right {
  display:     flex;
  align-items: center;
  gap:         .2rem;
  margin-left: auto;
}

.vx-nav-btn {
  width:         36px;
  height:        36px;
  background:    none;
  border:        none;
  border-radius: 50%;
  display:       flex;
  align-items:   center;
  justify-content: center;
  color:         var(--vx-text-color);
  font-size:     1rem;
  cursor:        pointer;
  position:      relative;
  transition:    background .2s;
  text-decoration: none;
}

.vx-nav-btn:hover { background: var(--vx-sidebar-hover); color: var(--vx-primary); }

.vx-nav-badge {
  position:    absolute;
  top:         2px;
  right:       2px;
  width:       16px;
  height:      16px;
  background:  var(--vx-danger);
  color:       #fff;
  font-size:   9px;
  font-weight: 700;
  border-radius: 50%;
  display:     flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Dropdown profile en header */
#vx-profile-dropdown .vx-avatar {
  width:         34px;
  height:        34px;
  border-radius: 50%;
  object-fit:    cover;
  cursor:        pointer;
  border:        2px solid rgba(var(--vx-primary-rgb),.3);
}

/* Theme toggle */
#vx-theme-toggle {
  width:         36px;
  height:        20px;
  background:    rgba(var(--vx-primary-rgb),.3);
  border:        none;
  border-radius: 10px;
  cursor:        pointer;
  position:      relative;
  transition:    background .2s;
}

#vx-theme-toggle::after {
  content:       '';
  position:      absolute;
  top:           2px;
  left:          2px;
  width:         16px;
  height:        16px;
  background:    #fff;
  border-radius: 50%;
  transition:    transform .2s;
}

body.light-theme #vx-theme-toggle { background: var(--vx-primary); }
body.light-theme #vx-theme-toggle::after { transform: translateX(16px); }

/* ================================================================
   SIDEBAR — #vx-sidebar
   ================================================================ */
#vx-sidebar-overlay {
  display:    none;
  position:   fixed;
  inset:      0;
  background: rgba(0,0,0,.5);
  z-index:    1029;
}

#vx-sidebar-overlay.show { display: block; }

#vx-sidebar {
  position:       fixed;
  top:            0;
  left:           0;
  width:          var(--vx-sidebar-width);
  height:         100vh;
  background:     var(--vx-sidebar-bg);
  z-index:        1040;
  overflow:       hidden;
  display:        flex;
  flex-direction: column;
  transition:     width .3s ease, transform .3s ease;
  box-shadow:     4px 0 16px rgba(0,0,0,.15);
}

/* Sidebar header con logo */
#vx-sidebar-brand {
  height:         var(--vx-header-height);
  display:        flex;
  align-items:    center;
  padding:        0 1.25rem;
  border-bottom:  1px solid rgba(255,255,255,.08);
  flex-shrink:    0;
  gap:            .65rem;
  text-decoration: none;
}

#vx-sidebar-brand .vx-brand-icon {
  width:            36px;
  height:           36px;
  background:       linear-gradient(135deg, var(--vx-primary), var(--vx-secondary));
  border-radius:    10px;
  display:          flex;
  align-items:      center;
  justify-content:  center;
  font-size:        1.1rem;
  color:            #fff;
  flex-shrink:      0;
  font-weight:      700;
}

#vx-sidebar-brand .vx-brand-name {
  font-size:    1.3rem;
  font-weight:  700;
  color:        #fff;
  letter-spacing: .04em;
  white-space:  nowrap;
  overflow:     hidden;
  transition:   opacity .2s, width .2s;
}

#vx-sidebar-brand .vx-brand-name span { color: var(--vx-secondary); }

/* Avatar usuario */
#vx-sidebar-user {
  padding:        1rem 1.25rem;
  border-bottom:  1px solid rgba(255,255,255,.06);
  display:        flex;
  align-items:    center;
  gap:            .75rem;
  flex-shrink:    0;
}

#vx-user-avatar-wrap {
  position:    relative;
  flex-shrink: 0;
}

#vx-user-avatar {
  width:         42px;
  height:        42px;
  border-radius: 50%;
  object-fit:    cover;
  border:        2px solid rgba(255,255,255,.2);
}

#vx-user-status-dot {
  width:         10px;
  height:        10px;
  background:    var(--vx-success);
  border:        2px solid var(--vx-sidebar-bg);
  border-radius: 50%;
  position:      absolute;
  bottom:        1px;
  right:         1px;
}

#vx-user-info { overflow: hidden; transition: opacity .2s; }

#vx-user-name {
  font-size:   .875rem;
  font-weight: 600;
  color:       #fff;
  white-space: nowrap;
  overflow:    hidden;
  text-overflow: ellipsis;
  margin:      0;
}

#vx-user-role {
  font-size:  .75rem;
  color:      rgba(255,255,255,.45);
  margin:     0;
}

/* Menú lateral scrollable */
#vx-sidebar-menu {
  flex:       1;
  overflow-y: auto;
  overflow-x: hidden;
  padding:    .5rem 0 1rem;
}

/* ── Categoría separador ─────────────────────────────────────── */
.vx-menu-category {
  font-size:      10px;
  font-weight:    700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color:          rgba(255,255,255,.3);
  padding:        1.1rem 1.25rem .4rem;
  margin:         0;
  list-style:     none;
  white-space:    nowrap;
  overflow:       hidden;
}

/* ── Item de menú ────────────────────────────────────────────── */
.vx-menu-item { list-style: none; }

.vx-menu-link {
  display:        flex;
  align-items:    center;
  gap:            .75rem;
  padding:        .625rem 1.25rem;
  color:          var(--vx-sidebar-text);
  text-decoration: none;
  font-size:      .8535rem;
  font-weight:    400;
  border-left:    3px solid transparent;
  transition:     background .18s, color .18s, border-color .18s;
  cursor:         pointer;
  background:     none;
  border-top:     none;
  border-right:   none;
  border-bottom:  none;
  width:          100%;
  text-align:     left;
  white-space:    nowrap;
  overflow:       hidden;
}

.vx-menu-link:hover {
  background: var(--vx-sidebar-hover);
  color:      #fff;
}

.vx-menu-link.active {
  background:   var(--vx-sidebar-active);
  color:        #fff;
  border-left-color: var(--vx-primary);
  font-weight:  500;
}

.vx-menu-icon {
  width:         20px;
  height:        20px;
  flex-shrink:   0;
  opacity:       .75;
}

.vx-menu-link:hover .vx-menu-icon,
.vx-menu-link.active .vx-menu-icon { opacity: 1; }

.vx-menu-label { flex: 1; }

.vx-menu-badge {
  font-size:     9px;
  font-weight:   700;
  padding:       2px 6px;
  border-radius: 10px;
  flex-shrink:   0;
}

/* Ángulo para menús con submenu */
.vx-angle {
  font-size:   .75rem;
  flex-shrink: 0;
  transition:  transform .25s;
  opacity:     .6;
}

.vx-menu-link[aria-expanded="true"] .vx-angle { transform: rotate(90deg); }

/* ── Submenu nivel 1 ─────────────────────────────────────────── */
.vx-submenu {
  list-style:  none;
  padding:     .25rem 0;
  margin:      0;
  background:  rgba(0,0,0,.12);
}

.vx-submenu-link {
  display:         flex;
  align-items:     center;
  gap:             .5rem;
  padding:         .5rem 1.25rem .5rem 3.2rem;
  color:           rgba(255,255,255,.5);
  text-decoration: none;
  font-size:       .8335rem;
  transition:      color .18s, background .18s;
  white-space:     nowrap;
  overflow:        hidden;
}

.vx-submenu-link::before {
  content:      '';
  width:        5px;
  height:       5px;
  border-radius: 50%;
  background:   rgba(255,255,255,.3);
  flex-shrink:  0;
  transition:   background .18s;
}

.vx-submenu-link:hover,
.vx-submenu-link.active {
  color:      #fff;
  background: rgba(255,255,255,.04);
}

.vx-submenu-link:hover::before,
.vx-submenu-link.active::before { background: var(--vx-primary); }

/* ── Submenu nivel 2 ─────────────────────────────────────────── */
.vx-submenu-2 {
  list-style:  none;
  padding:     .15rem 0;
  margin:      0;
  background:  rgba(0,0,0,.08);
}

.vx-submenu-2-link {
  display:         block;
  padding:         .4rem 1.25rem .4rem 4rem;
  color:           rgba(255,255,255,.4);
  text-decoration: none;
  font-size:       .815rem;
  transition:      color .18s;
  white-space:     nowrap;
  overflow:        hidden;
}

.vx-submenu-2-link:hover,
.vx-submenu-2-link.active { color: #fff; }

/* ── Sub-ítem con su propio toggle ───────────────────────────── */
.vx-sub-toggle {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
}

.vx-sub-angle {
  font-size:  .7rem;
  opacity:    .5;
  transition: transform .2s;
}

.vx-sub-toggle[aria-expanded="true"] .vx-sub-angle { transform: rotate(90deg); }

/* ── Modo mini sidebar ───────────────────────────────────────── */
body.sidebar-mini #vx-sidebar { width: var(--vx-sidebar-mini-width); }

body.sidebar-mini #vx-sidebar-brand .vx-brand-name,
body.sidebar-mini #vx-user-info,
body.sidebar-mini .vx-menu-label,
body.sidebar-mini .vx-angle,
body.sidebar-mini .vx-menu-badge,
body.sidebar-mini .vx-menu-category { opacity: 0; width: 0; overflow: hidden; }

body.sidebar-mini .vx-menu-link { padding: .625rem; justify-content: center; }
body.sidebar-mini #vx-sidebar-user { padding: .75rem; justify-content: center; }
body.sidebar-mini #vx-sidebar-brand { padding: 0; justify-content: center; }
body.sidebar-mini .vx-submenu { display: none !important; }

/* ================================================================
   CONTENIDO PRINCIPAL — #vx-main-content
   ================================================================ */
#vx-main-content {
  margin-left:   var(--vx-sidebar-width);
  padding-top:   var(--vx-header-height);
  min-height:    100vh;
  display:       flex;
  flex-direction: column;
  transition:    margin-left .3s ease;
}

body.sidebar-mini #vx-main-content { margin-left: var(--vx-sidebar-mini-width); }

#vx-page-content {
  flex:    1;
  padding: 1.5rem;
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
#vx-page-header { margin-bottom: 1.5rem; }

#vx-page-title {
  font-size:   1.1rem;
  font-weight: 600;
  color:       var(--vx-text-color);
  margin:      0 0 .25rem;
}

.vx-breadcrumb {
  display:    flex;
  flex-wrap:  wrap;
  gap:        .35rem;
  align-items: center;
  list-style: none;
  padding:    0;
  margin:     0;
  font-size:  .8rem;
}

.vx-breadcrumb-item { color: var(--vx-text-muted); }
.vx-breadcrumb-item a { color: var(--vx-primary); text-decoration: none; }
.vx-breadcrumb-item + .vx-breadcrumb-item::before {
  content: '/';
  margin-right: .35rem;
  color: var(--vx-text-muted);
}

/* ── Cards ───────────────────────────────────────────────────── */
.vx-card {
  background:    var(--vx-card-bg);
  border:        1px solid var(--vx-card-border);
  border-radius: .5rem;
  margin-bottom: 1.5rem;
  box-shadow:    0 2px 8px rgba(0,0,0,.06);
}

.vx-card-header {
  display:        flex;
  align-items:    center;
  justify-content: space-between;
  padding:        1rem 1.25rem;
  border-bottom:  1px solid var(--vx-card-border);
}

.vx-card-title {
  font-size:   .95rem;
  font-weight: 600;
  color:       var(--vx-text-color);
  margin:      0;
}

.vx-card-body { padding: 1.25rem; }

/* ── Footer ──────────────────────────────────────────────────── */
#vx-footer {
  padding:       1rem 1.5rem;
  border-top:    1px solid var(--vx-card-border);
  font-size:     .8rem;
  color:         var(--vx-text-muted);
  text-align:    center;
}

#vx-footer a { color: var(--vx-primary); text-decoration: none; }

/* ================================================================
   DROPDOWN NOTIFICATIONS / PROFILE
   ================================================================ */
.vx-dropdown-menu {
  background:    var(--vx-card-bg);
  border:        1px solid var(--vx-card-border);
  border-radius: .5rem;
  box-shadow:    0 8px 24px rgba(0,0,0,.15);
  padding:       .5rem 0;
  min-width:     280px;
}

.vx-dropdown-header {
  padding:       .65rem 1rem;
  border-bottom: 1px solid var(--vx-card-border);
  font-size:     .8335rem;
  font-weight:   600;
  color:         var(--vx-text-color);
}

.vx-dropdown-item {
  display:         flex;
  align-items:     center;
  gap:             .75rem;
  padding:         .65rem 1rem;
  color:           var(--vx-text-color);
  text-decoration: none;
  font-size:       .8335rem;
  transition:      background .18s;
  cursor:          pointer;
}

.vx-dropdown-item:hover { background: var(--vx-sidebar-hover); }

.vx-dropdown-divider {
  border:     none;
  border-top: 1px solid var(--vx-card-border);
  margin:     .25rem 0;
}

.vx-notif-icon {
  width:         36px;
  height:        36px;
  border-radius: 50%;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     1rem;
  flex-shrink:   0;
}

.vx-notif-text { flex: 1; overflow: hidden; }
.vx-notif-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vx-notif-time  { font-size: .75rem; color: var(--vx-text-muted); }

/* ── Inputs (dark/light) ─────────────────────────────────────── */
.form-control, .form-select {
  background-color: var(--vx-input-bg);
  border-color:     var(--vx-input-border);
  color:            var(--vx-text-color);
  font-size:        .875rem;
}

.form-control:focus, .form-select:focus {
  background-color: var(--vx-input-bg);
  border-color:     var(--vx-primary);
  color:            var(--vx-text-color);
  box-shadow:       0 0 0 .2rem rgba(var(--vx-primary-rgb),.2);
}

.form-label { color: var(--vx-text-color); font-size: .8335rem; font-weight: 500; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 991.98px) {
  #vx-sidebar {
    transform: translateX(calc(-1 * var(--vx-sidebar-width)));
  }

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

  #vx-main-header { left: 0 !important; }
  #vx-main-content { margin-left: 0 !important; }
}

@media (max-width: 575.98px) {
  #vx-page-content { padding: 1rem; }
  #vx-header-search { display: none; }
}

/* ── Animaciones de entrada ──────────────────────────────────── */
@keyframes vxFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

#vx-page-content { animation: vxFadeIn .3s ease both; }

/* ── Jumps prevent (compensa header fijo) ────────────────────── */
.vx-jumps-prevent { padding-top: var(--vx-header-height); }


/*CRUD*/
/* ── Toolbar de acciones ───────────────────────────────── */
#crud-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

    #crud-toolbar .btn {
        display: inline-flex;
        align-items: center;
        gap: .4rem;
        font-size: .835rem;
        font-weight: 500;
        padding: .45rem .9rem;
        border-radius: .375rem;
    }

/* ── Card contenedor ───────────────────────────────────── */

.crud-card {
    background: var(--vx-card-bg, #fff);
    border: 1px solid var(--vx-card-border, #e6e6f1);
    border-radius: .5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.crud-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--vx-card-border, #e6e6f1);
}

.crud-card-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--vx-text-color, #495057);
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.crud-card-body {
    padding: 1.25rem;
}
/*por id*/
#crud-card {
    background: var(--vx-card-bg, #fff);
    border: 1px solid var(--vx-card-border, #e6e6f1);
    border-radius: .5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

#crud-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--vx-card-border, #e6e6f1);
}

#crud-card-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--vx-text-color, #495057);
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}

#crud-card-body {
    padding: 1.25rem;
}

/* ── Badge de estado ───────────────────────────────────── */
.crud-badge-activa {
    background: rgba(25,177,89,.15);
    color: #19b159;
}

.crud-badge-inactiva {
    background: rgba(238,51,94,.15);
    color: #ee335e;
}

.crud-estado-badge {
    font-size: .72rem;
    font-weight: 600;
    padding: .25em .65em;
    border-radius: 2rem;
    white-space: nowrap;
}

/* ── Botones de fila ───────────────────────────────────── */
.crud-row-actions {
    display: flex;
    gap: .3rem;
}

    .crud-row-actions .btn {
        padding: .25rem .55rem;
        font-size: .8rem;
        border-radius: .3rem;
        display: inline-flex;
        align-items: center;
        gap: .25rem;
    }

/* ── DataTable overrides coherentes con Valex dark ─────── */
.dark-theme .dataTables_wrapper .dataTables_length select,
.dark-theme .dataTables_wrapper .dataTables_filter input {
    background-color: var(--vx-input-bg, rgba(0,0,0,.2));
    border-color: var(--vx-input-border, rgba(255,255,255,.12));
    color: var(--vx-text-color, #cdd4e0);
}

.dark-theme .dataTables_info,
.dark-theme .dataTables_length label,
.dark-theme .dataTables_filter label {
    color: var(--vx-text-muted);
}

.dark-theme table.dataTable thead th,
.dark-theme table.dataTable thead td {
    background: var(--vx-card-bg, #2c2c54);
    color: var(--vx-text-color, #cdd4e0);
    border-color: var(--vx-card-border, rgba(255,255,255,.08));
}

.dark-theme table.dataTable tbody tr {
    background-color: var(--vx-card-bg, #2c2c54);
    color: var(--vx-text-color, #cdd4e0);
}

    .dark-theme table.dataTable tbody tr:hover td {
        background: rgba(255,255,255,.04);
    }

/* ── Modal overrides dark ──────────────────────────────── */
.dark-theme #crud-modal .modal-content {
    background: var(--vx-card-bg, #2c2c54);
    border: 1px solid var(--vx-card-border, rgba(255,255,255,.08));
    color: var(--vx-text-color, #cdd4e0);
}

.dark-theme #crud-modal .modal-header {
    border-bottom: 1px solid var(--vx-card-border, rgba(255,255,255,.08));
}

.dark-theme #crud-modal .modal-footer {
    border-top: 1px solid var(--vx-card-border, rgba(255,255,255,.08));
}

.dark-theme #crud-modal .form-control,
.dark-theme #crud-modal .form-select {
    background: var(--vx-input-bg, rgba(0,0,0,.2));
    border-color: var(--vx-input-border, rgba(255,255,255,.12));
    color: var(--vx-text-color, #cdd4e0);
}

.dark-theme #crud-modal .form-label {
    color: var(--vx-text-color, #cdd4e0);
}

.dark-theme #crud-modal .btn-close {
    filter: invert(1);
}

/* ── Modal de confirmación ─────────────────────────────── */
.dark-theme #crud-modal-eliminar .modal-content {
    background: var(--vx-card-bg, #2c2c54);
    border: 1px solid var(--vx-card-border, rgba(255,255,255,.08));
    color: var(--vx-text-color, #cdd4e0);
}

.dark-theme #crud-modal-eliminar .modal-header,
.dark-theme #crud-modal-eliminar .modal-footer {
    border-color: var(--vx-card-border, rgba(255,255,255,.08));
}

.dark-theme #crud-modal-eliminar .btn-close {
    filter: invert(1);
}

/* ── Skeleton loader ───────────────────────────────────── */
@keyframes crud-shimmer {
    0% {
        background-position: -500px 0;
    }

    100% {
        background-position: 500px 0;
    }
}

.crud-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.06) 75%);
    background-size: 500px 100%;
    animation: crud-shimmer 1.4s infinite linear;
    border-radius: 4px;
    height: 14px;
}