/*-----------------------------------------------------------------------------------
    Modern Utilities CSS
    Clases de utilidad reutilizables para todo el sistema
-----------------------------------------------------------------------------------*/

/* ============================================
   TIPOGRAFÍA
   ============================================ */
.modern-text-xs {
  font-size: var(--font-size-xs);
}

.modern-text-sm {
  font-size: var(--font-size-sm);
}

.modern-text-base {
  font-size: var(--font-size-base);
}

.modern-text-lg {
  font-size: var(--font-size-lg);
}

.modern-text-xl {
  font-size: var(--font-size-xl);
}

.modern-text-2xl {
  font-size: var(--font-size-2xl);
}

.modern-text-3xl {
  font-size: var(--font-size-3xl);
}

.modern-text-4xl {
  font-size: var(--font-size-4xl);
}

.modern-font-normal {
  font-weight: var(--font-weight-normal);
}

.modern-font-medium {
  font-weight: var(--font-weight-medium);
}

.modern-font-semibold {
  font-weight: var(--font-weight-semibold);
}

.modern-font-bold {
  font-weight: var(--font-weight-bold);
}

.modern-text-primary {
  color: var(--text-primary);
}

.modern-text-secondary {
  color: var(--text-secondary);
}

.modern-text-tertiary {
  color: var(--text-tertiary);
}

.modern-text-muted {
  color: var(--text-muted);
}

.modern-text-inverse {
  color: var(--text-inverse);
}

.modern-text-center {
  text-align: center;
}

.modern-text-left {
  text-align: left;
}

.modern-text-right {
  text-align: right;
}

/* ============================================
   ESPACIADO - MARGIN
   ============================================ */
.modern-m-0 {
  margin: 0;
}

.modern-m-xs {
  margin: var(--spacing-xs);
}

.modern-m-sm {
  margin: var(--spacing-sm);
}

.modern-m-md {
  margin: var(--spacing-md);
}

.modern-m-lg {
  margin: var(--spacing-lg);
}

.modern-m-xl {
  margin: var(--spacing-xl);
}

.modern-m-2xl {
  margin: var(--spacing-2xl);
}

.modern-mt-0 {
  margin-top: 0;
}

.modern-mt-xs {
  margin-top: var(--spacing-xs);
}

.modern-mt-sm {
  margin-top: var(--spacing-sm);
}

.modern-mt-md {
  margin-top: var(--spacing-md);
}

.modern-mt-lg {
  margin-top: var(--spacing-lg);
}

.modern-mt-xl {
  margin-top: var(--spacing-xl);
}

.modern-mt-2xl {
  margin-top: var(--spacing-2xl);
}

.modern-mb-0 {
  margin-bottom: 0;
}

.modern-mb-xs {
  margin-bottom: var(--spacing-xs);
}

.modern-mb-sm {
  margin-bottom: var(--spacing-sm);
}

.modern-mb-md {
  margin-bottom: var(--spacing-md);
}

.modern-mb-lg {
  margin-bottom: var(--spacing-lg);
}

.modern-mb-xl {
  margin-bottom: var(--spacing-xl);
}

.modern-mb-2xl {
  margin-bottom: var(--spacing-2xl);
}

.modern-ml-0 {
  margin-left: 0;
}

.modern-ml-xs {
  margin-left: var(--spacing-xs);
}

.modern-ml-sm {
  margin-left: var(--spacing-sm);
}

.modern-ml-md {
  margin-left: var(--spacing-md);
}

.modern-ml-lg {
  margin-left: var(--spacing-lg);
}

.modern-ml-xl {
  margin-left: var(--spacing-xl);
}

.modern-ml-2xl {
  margin-left: var(--spacing-2xl);
}

.modern-mr-0 {
  margin-right: 0;
}

.modern-mr-xs {
  margin-right: var(--spacing-xs);
}

.modern-mr-sm {
  margin-right: var(--spacing-sm);
}

.modern-mr-md {
  margin-right: var(--spacing-md);
}

.modern-mr-lg {
  margin-right: var(--spacing-lg);
}

.modern-mr-xl {
  margin-right: var(--spacing-xl);
}

.modern-mr-2xl {
  margin-right: var(--spacing-2xl);
}

/* ============================================
   ESPACIADO - PADDING
   ============================================ */
.modern-p-0 {
  padding: 0;
}

.modern-p-xs {
  padding: var(--spacing-xs);
}

.modern-p-sm {
  padding: var(--spacing-sm);
}

.modern-p-md {
  padding: var(--spacing-md);
}

.modern-p-lg {
  padding: var(--spacing-lg);
}

.modern-p-xl {
  padding: var(--spacing-xl);
}

.modern-p-2xl {
  padding: var(--spacing-2xl);
}

.modern-pt-0 {
  padding-top: 0;
}

.modern-pt-xs {
  padding-top: var(--spacing-xs);
}

.modern-pt-sm {
  padding-top: var(--spacing-sm);
}

.modern-pt-md {
  padding-top: var(--spacing-md);
}

.modern-pt-lg {
  padding-top: var(--spacing-lg);
}

.modern-pt-xl {
  padding-top: var(--spacing-xl);
}

.modern-pt-2xl {
  padding-top: var(--spacing-2xl);
}

.modern-pb-0 {
  padding-bottom: 0;
}

.modern-pb-xs {
  padding-bottom: var(--spacing-xs);
}

.modern-pb-sm {
  padding-bottom: var(--spacing-sm);
}

.modern-pb-md {
  padding-bottom: var(--spacing-md);
}

.modern-pb-lg {
  padding-bottom: var(--spacing-lg);
}

.modern-pb-xl {
  padding-bottom: var(--spacing-xl);
}

.modern-pb-2xl {
  padding-bottom: var(--spacing-2xl);
}

.modern-pl-0 {
  padding-left: 0;
}

.modern-pl-xs {
  padding-left: var(--spacing-xs);
}

.modern-pl-sm {
  padding-left: var(--spacing-sm);
}

.modern-pl-md {
  padding-left: var(--spacing-md);
}

.modern-pl-lg {
  padding-left: var(--spacing-lg);
}

.modern-pl-xl {
  padding-left: var(--spacing-xl);
}

.modern-pl-2xl {
  padding-left: var(--spacing-2xl);
}

.modern-pr-0 {
  padding-right: 0;
}

.modern-pr-xs {
  padding-right: var(--spacing-xs);
}

.modern-pr-sm {
  padding-right: var(--spacing-sm);
}

.modern-pr-md {
  padding-right: var(--spacing-md);
}

.modern-pr-lg {
  padding-right: var(--spacing-lg);
}

.modern-pr-xl {
  padding-right: var(--spacing-xl);
}

.modern-pr-2xl {
  padding-right: var(--spacing-2xl);
}

/* ============================================
   FLEXBOX
   ============================================ */
.modern-flex {
  display: flex;
}

.modern-inline-flex {
  display: inline-flex;
}

.modern-flex-row {
  flex-direction: row;
}

.modern-flex-col {
  flex-direction: column;
}

.modern-flex-row-reverse {
  flex-direction: row-reverse;
}

.modern-flex-col-reverse {
  flex-direction: column-reverse;
}

.modern-flex-wrap {
  flex-wrap: wrap;
}

.modern-flex-nowrap {
  flex-wrap: nowrap;
}

.modern-items-start {
  align-items: flex-start;
}

.modern-items-center {
  align-items: center;
}

.modern-items-end {
  align-items: flex-end;
}

.modern-items-stretch {
  align-items: stretch;
}

.modern-justify-start {
  justify-content: flex-start;
}

.modern-justify-center {
  justify-content: center;
}

.modern-justify-end {
  justify-content: flex-end;
}

.modern-justify-between {
  justify-content: space-between;
}

.modern-justify-around {
  justify-content: space-around;
}

.modern-justify-evenly {
  justify-content: space-evenly;
}

.modern-flex-1 {
  flex: 1;
}

.modern-flex-auto {
  flex: auto;
}

.modern-flex-none {
  flex: none;
}

.modern-gap-xs {
  gap: var(--spacing-xs);
}

.modern-gap-sm {
  gap: var(--spacing-sm);
}

.modern-gap-md {
  gap: var(--spacing-md);
}

.modern-gap-lg {
  gap: var(--spacing-lg);
}

.modern-gap-xl {
  gap: var(--spacing-xl);
}

/* ============================================
   GRID
   ============================================ */
.modern-grid {
  display: grid;
}

.modern-grid-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}

.modern-grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.modern-grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.modern-grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.modern-grid-cols-6 {
  grid-template-columns: repeat(6, 1fr);
}

.modern-grid-cols-12 {
  grid-template-columns: repeat(12, 1fr);
}

/* ============================================
   BORDERS
   ============================================ */
.modern-border {
  border: 1px solid var(--border-color);
}

.modern-border-t {
  border-top: 1px solid var(--border-color);
}

.modern-border-b {
  border-bottom: 1px solid var(--border-color);
}

.modern-border-l {
  border-left: 1px solid var(--border-color);
}

.modern-border-r {
  border-right: 1px solid var(--border-color);
}

.modern-border-0 {
  border: none;
}

.modern-rounded-none {
  border-radius: 0;
}

.modern-rounded-sm {
  border-radius: var(--border-radius-sm);
}

.modern-rounded {
  border-radius: var(--border-radius);
}

.modern-rounded-lg {
  border-radius: var(--border-radius-lg);
}

.modern-rounded-xl {
  border-radius: var(--border-radius-xl);
}

.modern-rounded-full {
  border-radius: 9999px;
}

/* ============================================
   BACKGROUNDS
   ============================================ */
.modern-bg-transparent {
  background: transparent;
}

.modern-bg-primary {
  background: var(--background);
}

.modern-bg-secondary {
  background: var(--background-secondary);
}

.modern-bg-tertiary {
  background: var(--background-tertiary);
}

.modern-bg-card {
  background: var(--background-card);
}

.modern-bg-brand {
  background: var(--brand-primary);
}

.modern-bg-success {
  background: var(--success);
}

.modern-bg-warning {
  background: var(--warning);
}

.modern-bg-error {
  background: var(--error);
}

.modern-bg-info {
  background: var(--info);
}

/* ============================================
   SOMBRAS
   ============================================ */
.modern-shadow-none {
  box-shadow: none;
}

.modern-shadow-xs {
  box-shadow: var(--shadow-xs);
}

.modern-shadow-sm {
  box-shadow: var(--shadow-sm);
}

.modern-shadow-md {
  box-shadow: var(--shadow-md);
}

.modern-shadow-lg {
  box-shadow: var(--shadow-lg);
}

.modern-shadow-xl {
  box-shadow: var(--shadow-xl);
}

.modern-shadow-2xl {
  box-shadow: var(--shadow-2xl);
}

/* ============================================
   DISPLAY
   ============================================ */
.modern-block {
  display: block;
}

.modern-inline-block {
  display: inline-block;
}

.modern-inline {
  display: inline;
}

.modern-hidden {
  display: none;
}

/* ============================================
   POSITION
   ============================================ */
.modern-relative {
  position: relative;
}

.modern-absolute {
  position: absolute;
}

.modern-fixed {
  position: fixed;
}

.modern-sticky {
  position: sticky;
}

/* ============================================
   WIDTH & HEIGHT
   ============================================ */
.modern-w-full {
  width: 100%;
}

.modern-w-auto {
  width: auto;
}

.modern-h-full {
  height: 100%;
}

.modern-h-auto {
  height: auto;
}

.modern-w-screen {
  width: 100vw;
}

.modern-h-screen {
  height: 100vh;
}

/* ============================================
   OVERFLOW
   ============================================ */
.modern-overflow-auto {
  overflow: auto;
}

.modern-overflow-hidden {
  overflow: hidden;
}

.modern-overflow-visible {
  overflow: visible;
}

.modern-overflow-scroll {
  overflow: scroll;
}

/* ============================================
   OPACITY
   ============================================ */
.modern-opacity-0 {
  opacity: 0;
}

.modern-opacity-25 {
  opacity: 0.25;
}

.modern-opacity-50 {
  opacity: 0.5;
}

.modern-opacity-75 {
  opacity: 0.75;
}

.modern-opacity-100 {
  opacity: 1;
}

/* ============================================
   CURSOR
   ============================================ */
.modern-cursor-pointer {
  cursor: pointer;
}

.modern-cursor-default {
  cursor: default;
}

.modern-cursor-not-allowed {
  cursor: not-allowed;
}

/* ============================================
   TRANSICIONES
   ============================================ */
.modern-transition-fast {
  transition: all var(--transition-fast);
}

.modern-transition-base {
  transition: all var(--transition-base);
}

.modern-transition-slow {
  transition: all var(--transition-slow);
}

.modern-transition-none {
  transition: none;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */
.modern-hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.modern-hover-grow:hover {
  transform: scale(1.02);
}

.modern-hover-bg:hover {
  background: var(--background-hover);
}

/* ============================================
   CARDS
   ============================================ */
.modern-card {
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  /* padding: var(--spacing-lg); */
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.modern-card:hover {
  box-shadow: var(--shadow-md);
}

.modern-card-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
}

.modern-card-body {
  padding: var(--spacing-lg);
}

.modern-card-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-color);
}

/* ============================================
   DIVIDER
   ============================================ */
.modern-divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--spacing-lg) 0;
}

/* ============================================
   BADGE
   ============================================ */
.modern-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--border-radius-sm);
  background: var(--background-tertiary);
  color: var(--text-primary);
}

.modern-badge-success {
  background: var(--success-light);
  color: var(--success);
}

.modern-badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.modern-badge-error {
  background: var(--error-light);
  color: var(--error);
}

.modern-badge-info {
  background: var(--info-light);
  color: var(--info);
}

/* ============================================
   AVATAR
   ============================================ */
.modern-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-full);
  background: var(--background-tertiary);
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  overflow: hidden;
}

.modern-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modern-avatar-sm {
  width: 32px;
  height: 32px;
  font-size: var(--font-size-sm);
}

.modern-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: var(--font-size-xl);
}

/* ============================================
   SPINNER / LOADING
   ============================================ */
.modern-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--brand-primary);
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modern-spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.modern-spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* ============================================
   SKELETON LOADER
   ============================================ */
.modern-skeleton {
  background: linear-gradient(90deg,
      var(--background-secondary) 25%,
      var(--background-tertiary) 50%,
      var(--background-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.modern-skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.modern-skeleton-circle {
  border-radius: 50%;
  width: 40px;
  height: 40px;
}

/* ============================================
   BUTTONS - Estilo moderno EXACTO como el login
   ============================================ */
.modern-btn {
  height: 44px;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--font-size-base);
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: 0.625rem !important;
  /* 10px - como shadcn */
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  outline: none;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.modern-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Primary Button - CON sombra como el login */
.modern-btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
  box-shadow: none;
  font-weight: 400;
  /* Letra más suave - normal weight */
}

.modern-btn-primary:hover:not(:disabled) {
  background-color: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
  color: #ffffff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  transform: none;
  text-decoration: none;
}

.modern-btn-primary:focus:not(:disabled) {
  background-color: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}

.modern-btn-primary:active:not(:disabled) {
  background-color: #0062cc;
  border-color: #005cbf;
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  transform: none;
}

/* Botón Outline - Letra más suave */
.modern-btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-secondary);
  /* Letra más suave */
  box-shadow: none;
  font-weight: 400;
  /* Letra más suave - normal weight */
}

.modern-btn-outline:hover:not(:disabled) {
  background-color: var(--background-hover);
  border-color: var(--border-color);
  color: var(--text-primary);
  /* Un poco más oscuro al hover */
  text-decoration: none;
  transform: none;
  box-shadow: none;
}

.modern-btn-outline:focus:not(:disabled) {
  border-color: var(--border-color);
  /* Sin cambio de color al focus */
  color: var(--text-primary);
  box-shadow: none;
  /* Sin contorno azul */
  outline: none;
  /* Sin outline por defecto del browser */
}

.modern-btn-outline:active:not(:disabled) {
  background-color: var(--background-hover);
  border-color: var(--border-color);
  /* Sin cambio de color al active */
  color: var(--text-primary);
  transform: none;
  box-shadow: none;
  /* Sin contorno azul */
  outline: none;
  /* Sin outline por defecto del browser */
}

/* Dark mode - Botón Outline */
body.skin-dark .modern-btn-outline {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

body.skin-dark .modern-btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Light mode - Botón Outline */
body.skin-light .modern-btn-outline {
  background-color: #ffffff;
  border-color: var(--border-color);
  color: var(--text-secondary);
}

body.skin-light .modern-btn-outline:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

/* ============================================
   FORM LABELS Y INPUTS - Estilo EXACTO del login
   ============================================ */
.modern-form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

/* Inputs modernos - EXACTO como el login */
.modern-input {
  width: 100%;
  height: 44px;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-base);
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--background) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 0.625rem !important;
  /* 10px - como shadcn */
  transition: none !important;
  outline: none !important;
  box-shadow: none !important;
  /* Reset cualquier sombra por defecto */
}

/* Override para estilos legacy que interfieren */
body.skin-light .modern-input {
  border-radius: 0.625rem !important;
  background: var(--background) !important;
}

/* Dark mode - Inputs con fondo igual al panel del dashboard */
body.skin-dark .modern-input,
body.skin-dark .form-control.modern-input,
body.skin-dark textarea.modern-input {
  border-radius: 0.625rem !important;
  background: #18181b !important;
  background-color: #18181b !important;
  border: 1px solid #27272a !important;
}

/* Dark mode - Selects con flecha visible (SVG claro) */
body.skin-dark select.modern-input,
body.skin-dark select.form-control.modern-input {
  border-radius: 0.625rem !important;
  background: #18181b url('/assets/images/icons/select-arrow-down-light.svg') no-repeat right 12px center !important;
  background-color: #18181b !important;
  background-size: 12px 8px !important;
  border: 1px solid #27272a !important;
  padding-right: 36px !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

body.skin-dark .modern-input:hover,
body.skin-dark .form-control.modern-input:hover {
  border-color: #3f3f46 !important;
  background: #18181b !important;
  background-color: #18181b !important;
}

/* Dark mode - Select hover mantiene la flecha */
body.skin-dark select.modern-input:hover,
body.skin-dark select.form-control.modern-input:hover {
  border-color: #3f3f46 !important;
  background: #18181b url('/assets/images/icons/select-arrow-down-light.svg') no-repeat right 12px center !important;
  background-color: #18181b !important;
  background-size: 12px 8px !important;
}

body.skin-dark .modern-input:focus,
body.skin-dark .form-control.modern-input:focus {
  border-color: #3f3f46 !important;
  box-shadow: 0 0 0 0.25rem rgba(39, 39, 42, 0.8) !important;
  background: #18181b !important;
  background-color: #18181b !important;
  outline: none !important;
}

/* Dark mode - Select focus mantiene la flecha */
body.skin-dark select.modern-input:focus,
body.skin-dark select.form-control.modern-input:focus {
  border-color: #3f3f46 !important;
  box-shadow: 0 0 0 0.25rem rgba(39, 39, 42, 0.8) !important;
  background: #18181b url('/assets/images/icons/select-arrow-down-light.svg') no-repeat right 12px center !important;
  background-color: #18181b !important;
  background-size: 12px 8px !important;
  outline: none !important;
}

/* Override específico para form-control + modern-input */
.form-control.modern-input {
  border: 1px solid var(--border-color) !important;
  background: var(--background) !important;
  box-shadow: none !important;
}

.modern-input::placeholder {
  color: var(--text-tertiary);
}

.modern-input:hover {
  border-color: var(--border-color-dark) !important;
  background: var(--background) !important;
  box-shadow: none !important;
}

/* Light mode - Focus con sombra azul como los botones (más fuerte) */
body.skin-light .modern-input:focus,
body.skin-light .form-control.modern-input:focus,
body.skin-light select.modern-input:focus,
body.skin-light select.form-control.modern-input:focus {
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.45) !important;
  background: var(--background) !important;
  outline: none !important;
}

.modern-input.error-input {
  border-color: var(--error) !important;
}

.modern-input.error-input:focus {
  box-shadow: 0 0 0 3px var(--error-light) !important;
}

/* Textarea con modern-input */
textarea.modern-input {
  height: auto;
  resize: vertical;
  min-height: 44px;
}

/* Select con modern-input - Flecha personalizada */
select.form-control.modern-input:not([multiple]),
select.modern-input:not([multiple]) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 35px !important;
  background-image: url(../../../assets/images/icons/select-arrow-down.png) !important;
  background-position: center right !important;
  background-repeat: no-repeat !important;
  cursor: pointer;
}

/* Override para asegurar que el background-color no tape la flecha */
select.form-control.modern-input:not([multiple]),
select.modern-input:not([multiple]) {
  background-color: var(--background) !important;
}

/* ============================================
   DROPIFY - Estilo moderno para documentos
   ============================================ */
.modern-card-documento .dropify-wrapper {
  border-radius: 0.625rem !important;
  border: 2px dashed var(--border-color) !important;
  background: var(--background) !important;
  transition: none !important;
  min-height: 180px !important;
}

.modern-card-documento .dropify-wrapper:hover {
  border-color: var(--brand-primary) !important;
  background: var(--background-hover) !important;
}

.modern-card-documento .dropify-wrapper .dropify-message {
  color: var(--text-secondary) !important;
}

.modern-card-documento .dropify-wrapper .dropify-preview {
  border-radius: 0.625rem !important;
}

/* Dark mode - Preview con fondo visible para que la imagen se vea bien */
body.skin-dark .modern-card-documento .dropify-wrapper .dropify-preview {
  background: #18181b !important;
  background-color: #18181b !important;
}

body.skin-dark .modern-card-documento .dropify-wrapper {
  background: #18181b !important;
  background-color: #18181b !important;
  border-color: #27272a !important;
}

body.skin-dark .modern-card-documento .dropify-wrapper:hover {
  background: #18181b !important;
  background-color: #18181b !important;
  border-color: var(--brand-primary) !important;
}

/* Dropify en Builder */
.builder-content .dropify-wrapper {
  border-radius: 0.625rem !important;
  border: 2px dashed var(--border-color) !important;
  background: var(--background) !important;
  transition: none !important;
}

.builder-content .dropify-wrapper:hover {
  border-color: var(--brand-primary) !important;
  background: var(--background-hover) !important;
}

body.skin-dark .builder-content .dropify-wrapper {
  background: #18181b !important;
  background-color: #18181b !important;
  border-color: #27272a !important;
}

body.skin-dark .builder-content .dropify-wrapper:hover {
  background: #18181b !important;
  background-color: #18181b !important;
  border-color: var(--brand-primary) !important;
}

/* Dropify Loader moderno */
.modern-card-documento .dropify-wrapper .dropify-loader,
.builder-content .dropify-wrapper .dropify-loader,
.modal-body.modern-modal-body .dropify-wrapper .dropify-loader {
  width: 40px !important;
  height: 40px !important;
}

.modern-card-documento .dropify-wrapper .dropify-loader::after,
.builder-content .dropify-wrapper .dropify-loader::after,
.modal-body.modern-modal-body .dropify-wrapper .dropify-loader::after {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  border: 3px solid rgba(0, 123, 255, 0.15) !important;
  border-top-color: var(--brand-primary) !important;
  border-right-color: var(--brand-primary) !important;
  animation: modernDropifyRotate 0.7s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
}

/* Porcentaje centrado dentro del círculo */
.modern-card-documento .dropify-wrapper .dropify-loader-pct,
.builder-content .dropify-wrapper .dropify-loader-pct,
.modal-body.modern-modal-body .dropify-wrapper .dropify-loader-pct {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1;
  text-align: center;
  z-index: 1;
}

body.skin-dark .modern-card-documento .dropify-wrapper .dropify-loader::after,
body.skin-dark .builder-content .dropify-wrapper .dropify-loader::after,
body.skin-dark .modal-body.modern-modal-body .dropify-wrapper .dropify-loader::after {
  border-color: rgba(59, 130, 246, 0.15) !important;
  border-top-color: #60a5fa !important;
  border-right-color: #60a5fa !important;
}

body.skin-dark .modern-card-documento .dropify-wrapper .dropify-loader-pct,
body.skin-dark .builder-content .dropify-wrapper .dropify-loader-pct,
body.skin-dark .modal-body.modern-modal-body .dropify-wrapper .dropify-loader-pct {
  color: #60a5fa;
}

@keyframes modernDropifyRotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* ============================================
   BUILDER CONTENT - Inputs y Labels dinámicos
   ============================================ */
.builder-content .form-group label,
.builder-content label.modern-form-label,
.builder-content label.form-label {
  display: block !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  color: var(--text-secondary) !important;
  margin-bottom: 0.5rem !important;
}

body.skin-dark .builder-content .form-group label,
body.skin-dark .builder-content label.form-label {
  color: #a1a1aa !important;
}

body.skin-light .builder-content .form-group label,
body.skin-light .builder-content label.form-label {
  color: #71717a !important;
}

.builder-content .form-control,
.builder-content .form-control.modern-input,
.builder-content input.form-control,
.builder-content select.form-control,
.builder-content textarea.form-control,
.builder-content .form-input,
.builder-content input.form-input,
.builder-content select.form-input,
.builder-content textarea.form-input {
  width: 100% !important;
  height: 38px !important;
  padding: 0 0.875rem !important;
  font-size: 0.8125rem !important;
  color: var(--text-primary) !important;
  background: var(--background) !important;
  background-color: var(--background) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 0.5rem !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  outline: none !important;
  box-shadow: none !important;
}

body.skin-dark .builder-content .form-input,
body.skin-dark .builder-content input.form-input,
body.skin-dark .builder-content select.form-input,
body.skin-dark .builder-content textarea.form-input {
  background: #0f0f11 !important;
  border-color: #3f3f46 !important;
  color: #fafafa !important;
}

body.skin-light .builder-content .form-input,
body.skin-light .builder-content input.form-input,
body.skin-light .builder-content select.form-input,
body.skin-light .builder-content textarea.form-input {
  background-color: #ffffff !important;
  border-color: #d4d4d8 !important;
  color: #18181b !important;
}

.builder-content textarea.form-control,
.builder-content textarea.form-input {
  height: auto !important;
  min-height: 80px !important;
  padding: 0.75rem 0.875rem !important;
}

.builder-content .form-control:focus,
.builder-content .form-control.modern-input:focus,
.builder-content .form-input:focus {
  border-color: #a1a1aa !important;
  box-shadow: 0 0 0 3px rgba(113, 113, 122, 0.15) !important;
  background: var(--background) !important;
}

.builder-content .form-control::placeholder,
.builder-content .form-input::placeholder {
  color: var(--text-tertiary) !important;
}

/* ============================================
   BUILDER ROW/COL - Ajustar padding Bootstrap
   para alinear con form-row (gap: 1rem = 0.5rem * 2)
   ============================================ */
.builder-content>.row,
.form-section>.row {
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

.builder-content>.row>[class*="col-sm"],
.form-section>.row>[class*="col-sm"] {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  margin-bottom: 1rem;
}

/* Select en builder con flecha */
.builder-content select.form-control,
.builder-content select.form-input {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  padding-right: 2.5rem !important;
  cursor: pointer !important;
}

body.skin-dark .builder-content select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a1a1aa' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.875rem center !important;
}

body.skin-light .builder-content select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.875rem center !important;
}

/* Dark mode para builder */
body.skin-dark .builder-content .form-control,
body.skin-dark .builder-content .form-control.modern-input {
  background: var(--background) !important;
  background-color: var(--background) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

body.skin-dark .builder-content .form-group label {
  color: #a1a1aa !important;
}

/* ============================================
   CARD ACTIONS - Sección de acciones flotante
   ============================================ */
.modern-card-actions {
  padding: 1rem 0;
  margin-top: 0.5rem;
}

/* Clase utilitaria para margin bottom */
.mb-20 {
  margin-bottom: 20px !important;
}

/* ============================================
   SECTION DIVIDER STANDALONE - Separador fuera de cards
   ============================================ */
.modern-section-divider-standalone {
  display: flex;
  align-items: center;
  margin: 1.5rem 0 1.25rem 0;
  position: relative;
}

.modern-section-divider-standalone::before,
.modern-section-divider-standalone::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, currentColor, transparent);
  opacity: 0.2;
}

.modern-section-divider-standalone .modern-section-divider-text {
  padding: 0 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

body.skin-light .modern-section-divider-standalone {
  color: #64748b;
}

body.skin-light .modern-section-divider-standalone .modern-section-divider-text {
  color: #475569;
}

body.skin-dark .modern-section-divider-standalone {
  color: #94a3b8;
}

body.skin-dark .modern-section-divider-standalone .modern-section-divider-text {
  color: #cbd5e1;
}

/* ============================================
   DOCUMENTOS NESTED CARDS - Sin padding bottom
   ============================================ */
.modern-card-documento-nested .modern-card-body {
  padding-bottom: 0 !important;
}

.modern-card-documento-actions {
  padding-top: 1.25rem;
}

/* ============================================
   SLIDES STATS CARDS - Diseño vertical limpio
   ============================================ */

/* Card principal - Layout vertical */
/* ============================================
   SLIDE CARDS - shadcn/ui Premium
   Thumbnail-first, overlay on hover, glassmorphism
   ============================================ */

/* --- Card --- */
.ps9-slide-card {
  position: relative;
  background: var(--background-card);
  border-radius: var(--border-radius-xl);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.ps9-slide-card:hover {
  border-color: var(--brand-primary);
  box-shadow:
    0 0 0 1px var(--brand-primary),
    var(--shadow-lg);
  transform: translateY(-3px);
}

/* --- Body / Preview (protagonista) --- */
.ps9-slide-body {
  position: relative;
  height: 160px;
  background: var(--background);
  overflow: hidden;
}

.ps9-thumb {
  position: absolute;
  inset: 0;
}

.ps9-thumb-scale {
  transform: scale(0.25);
  transform-origin: top left;
  width: 400%;
  pointer-events: none;
}

.ps9-thumb-scale .slide-container {
  min-height: 560px;
  box-shadow: none !important;
}

/* --- Overlay (solo para posicionar el badge) --- */
.ps9-slide-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.625rem;
  z-index: 2;
  pointer-events: none;
}

/* --- Badge numérico --- */
.ps9-slide-badge-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 0.5rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  font-weight: var(--font-weight-bold);
  color: #0f172a;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.skin-dark .ps9-slide-badge-num {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.ps9-slide-card:hover .ps9-slide-badge-num {
  opacity: 1;
  transform: translateY(0);
}

/* --- Info bar (abajo) --- */
.ps9-slide-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
}

.ps9-slide-info-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

/* --- Title --- */
.ps9-slide-title {
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  line-height: 1.3;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
  transition: color var(--transition-fast);
}

.ps9-slide-card:hover .ps9-slide-title {
  color: var(--brand-primary);
}

/* --- Subtitle --- */
.ps9-slide-sub {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: var(--font-weight-normal);
  color: var(--text-tertiary);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ps9-slide-sub::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background: var(--brand-primary);
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Time badge --- */
.ps9-slide-time {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: var(--background);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.ps9-slide-card:hover .ps9-slide-time {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

.ps9-slide-time i {
  font-size: 0.625rem;
  color: inherit;
}

/* --- Clases legacy (ocultas, ya no se usan) --- */
.ps9-slide-header,
.ps9-slide-footer,
.ps9-slide-left,
.ps9-slide-right,
.ps9-slide-meta,
.ps9-slide-icon {
  display: none !important;
}

/* --- Status badge (por si se reactiva) --- */
.ps9-slide-status {
  background: var(--brand-primary);
  color: #ffffff;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  font-size: 0.625rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================
   DASHBOARD - Stat Card
   ============================================ */
.modern-stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.modern-stat-card:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25), 0 4px 12px rgba(0, 123, 255, 0.15);
}

.modern-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 0.625rem;
  background: rgba(0, 123, 255, 0.1);
  color: var(--brand-primary);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.modern-stat-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.modern-stat-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
}

.modern-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Skeleton cuando el valor está vacío */
.modern-stat-value:empty::before {
  content: '';
  display: inline-block;
  width: 60px;
  height: 20px;
  background: var(--background-hover);
  border-radius: 0.375rem;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

body.skin-light .modern-stat-value:empty::before {
  background: rgba(0, 0, 0, 0.08);
}

/* Dark mode stat card */
body.skin-dark .modern-stat-card {
  background: #18181b;
  border-color: #27272a;
}

body.skin-dark .modern-stat-card:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 4px 12px rgba(59, 130, 246, 0.15);
}

body.skin-dark .modern-stat-icon {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

/* ============================================
   DASHBOARD - Chart Card
   ============================================ */
.modern-chart-card {
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.2s ease;
}

/* Título de panel (fuera del panel) */
.modern-panel-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 0.75rem 0;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

body.skin-dark .modern-panel-title {
  color: #a1a1aa;
  /* zinc-400 */
}

body.skin-light .modern-panel-title {
  color: #71717a;
  /* zinc-500 */
}

.modern-chart-header {
  padding: 1.25rem 1.5rem 0;
}

.modern-chart-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.modern-chart-body {
  padding: 1rem 1.5rem 1.5rem;
}

.modern-chart-canvas {
  position: relative;
  width: 100%;
}

/* Light mode chart card - Inputs con fondo blanco para contraste */
body.skin-light .modern-chart-card .modern-input,
body.skin-light .modern-chart-card .form-control.modern-input,
body.skin-light .modern-chart-card textarea.modern-input,
body.skin-light .modern-chart-card select.modern-input {
  background: #ffffff !important;
  background-color: #ffffff !important;
}

body.skin-light .modern-chart-card .dropify-wrapper {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: 2px dashed #e4e4e7 !important;
  border-radius: 0.625rem !important;
}

body.skin-light .modern-chart-card .dropify-wrapper:hover {
  border-color: #a1a1aa !important;
}

/* Dark mode chart card */
body.skin-dark .modern-chart-card {
  background: #18181b;
  border-color: #27272a;
}

body.skin-dark .modern-chart-title {
  color: #fafafa;
}

/* ============================================
   CHART CARD - Inputs con fondo oscuro y borde visible
   ============================================ */
body.skin-dark .modern-chart-card .modern-input,
body.skin-dark .modern-chart-card .form-control.modern-input,
body.skin-dark .modern-chart-card textarea.modern-input {
  background: #0f0f11 !important;
  background-color: #0f0f11 !important;
  border: 1px solid #27272a !important;
}

body.skin-dark .modern-chart-card select.modern-input,
body.skin-dark .modern-chart-card select.form-control.modern-input {
  background: #0f0f11 url('/assets/images/icons/select-arrow-down-light.svg') no-repeat right 12px center !important;
  background-color: #0f0f11 !important;
  background-size: 12px 8px !important;
  border: 1px solid #27272a !important;
}

body.skin-dark .modern-chart-card .modern-input:hover,
body.skin-dark .modern-chart-card .form-control.modern-input:hover {
  border-color: #3f3f46 !important;
  background: #0f0f11 !important;
  background-color: #0f0f11 !important;
}

body.skin-dark .modern-chart-card select.modern-input:hover,
body.skin-dark .modern-chart-card select.form-control.modern-input:hover {
  border-color: #3f3f46 !important;
  background: #0f0f11 url('/assets/images/icons/select-arrow-down-light.svg') no-repeat right 12px center !important;
  background-color: #0f0f11 !important;
  background-size: 12px 8px !important;
}

body.skin-dark .modern-chart-card .modern-input:focus,
body.skin-dark .modern-chart-card .form-control.modern-input:focus {
  border-color: #3f3f46 !important;
  box-shadow: 0 0 0 0.25rem rgba(39, 39, 42, 0.6) !important;
  background: #0f0f11 !important;
  background-color: #0f0f11 !important;
}

body.skin-dark .modern-chart-card select.modern-input:focus,
body.skin-dark .modern-chart-card select.form-control.modern-input:focus {
  border-color: #3f3f46 !important;
  box-shadow: 0 0 0 0.25rem rgba(39, 39, 42, 0.6) !important;
  background: #0f0f11 url('/assets/images/icons/select-arrow-down-light.svg') no-repeat right 12px center !important;
  background-color: #0f0f11 !important;
  background-size: 12px 8px !important;
}

/* Dropify dentro de chart-card */
body.skin-dark .modern-chart-card .dropify-wrapper {
  background: #0f0f11 !important;
  background-color: #0f0f11 !important;
  border: 2px dashed #27272a !important;
  border-radius: 0.625rem !important;
}

body.skin-dark .modern-chart-card .dropify-wrapper:hover {
  border-color: #3f3f46 !important;
  background: #0f0f11 !important;
}

body.skin-dark .modern-chart-card .dropify-wrapper .dropify-preview {
  background: #0f0f11 !important;
}

/* Tabla de colores dentro de chart-card */
body.skin-dark .modern-chart-card .table {
  background: transparent !important;
}

body.skin-dark .modern-chart-card .table thead th {
  background: #0f0f11 !important;
  border-color: #27272a !important;
  color: #a1a1aa;
}

body.skin-dark .modern-chart-card .table tbody td {
  background: transparent !important;
  border-color: #3f3f46 !important;
}

/* ============================================
   CARD MINIMAL - Estilo minimalista sin fondo extra
   Mantiene el padding de la card normal, solo mejora inputs
   ============================================ */
.modern-card-minimal {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Dark mode - Inputs minimalistas con borde más visible */
body.skin-dark .modern-card-minimal .modern-input,
body.skin-dark .modern-card-minimal .form-control.modern-input,
body.skin-dark .modern-card-minimal textarea.modern-input {
  background: transparent !important;
  background-color: transparent !important;
  border: 1px solid #3f3f46 !important;
  /* zinc-700 - borde más visible */
}

body.skin-dark .modern-card-minimal .modern-input:hover,
body.skin-dark .modern-card-minimal .form-control.modern-input:hover {
  border-color: #52525b !important;
  /* zinc-600 */
}

body.skin-dark .modern-card-minimal .modern-input:focus,
body.skin-dark .modern-card-minimal .form-control.modern-input:focus {
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

/* Labels más sutiles */
body.skin-dark .modern-card-minimal .modern-form-label {
  color: #a1a1aa;
  /* zinc-400 */
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* ============================================
   CARD GLASS - Panel estilo glassmorphism sutil
   Inspirado en Linear/Notion - elegante y profesional
   ============================================ */
.modern-card-glass {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 1rem !important;
  box-shadow: none !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modern-card-glass .modern-card-header {
  padding: 1.5rem 1.75rem 0.5rem !important;
  border: none !important;
  background: transparent !important;
}

.modern-card-glass .modern-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.modern-card-glass .modern-card-body {
  padding: 0.75rem 1.75rem 1.25rem;
}

.modern-card-glass .modern-card-footer {
  padding: 0.5rem 1.75rem 1.5rem !important;
  border: none !important;
  background: transparent !important;
}

/* Light mode */
body.skin-light .modern-card-glass {
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

/* Dark mode */
body.skin-dark .modern-card-glass {
  background: rgba(255, 255, 255, 0.025) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.skin-dark .modern-card-glass .modern-card-title {
  color: #f4f4f5;
  /* zinc-100 */
}

/* Inputs dentro del glass panel - mismo fondo que el panel */
body.skin-dark .modern-card-glass .modern-input,
body.skin-dark .modern-card-glass .form-control.modern-input,
body.skin-dark .modern-card-glass textarea.modern-input {
  background: transparent !important;
  background-color: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

body.skin-dark .modern-card-glass .modern-input:hover,
body.skin-dark .modern-card-glass .form-control.modern-input:hover {
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: transparent !important;
}

body.skin-dark .modern-card-glass .modern-input:focus,
body.skin-dark .modern-card-glass .form-control.modern-input:focus {
  border-color: var(--brand-primary) !important;
  background: transparent !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
}

body.skin-dark .modern-card-glass .modern-form-label {
  color: #a1a1aa;
  /* zinc-400 */
  font-weight: 500;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.625rem;
}

/* ============================================
   GLOBAL TRANSITION OVERRIDES
   Deshabilita transiciones para cambio de tema instantáneo
   Estos overrides tienen máxima especificidad para anular CSS antiguos
   ============================================ */

/* Clase global para desactivar TODAS las transiciones durante cambio de tema */
body.no-transitions,
body.no-transitions *,
body.no-transitions *::before,
body.no-transitions *::after {
  -webkit-transition: none !important;
  -moz-transition: none !important;
  -ms-transition: none !important;
  -o-transition: none !important;
  transition: none !important;
}

/* Override global para TODOS los form-control */
.form-control,
input.form-control,
select.form-control,
textarea.form-control,
.modern-input,
input.modern-input,
select.modern-input,
textarea.modern-input {
  -webkit-transition: none !important;
  -o-transition: none !important;
  transition: none !important;
}

/* Override para dropify */
.dropify-wrapper,
.dropify-wrapper *,
.dropify-preview,
.dropify-render,
.dropify-infos {
  -webkit-transition: none !important;
  -o-transition: none !important;
  transition: none !important;
}

/* Override con body.skin-dark para máxima especificidad */
body.skin-dark .form-control,
body.skin-dark input.form-control,
body.skin-dark select.form-control,
body.skin-dark textarea.form-control,
body.skin-dark .modern-input,
body.skin-dark input.modern-input,
body.skin-dark select.modern-input,
body.skin-dark textarea.modern-input {
  -webkit-transition: none !important;
  -o-transition: none !important;
  transition: none !important;
}

body.skin-dark .dropify-wrapper,
body.skin-dark .dropify-wrapper *,
body.skin-dark .dropify-preview,
body.skin-dark .dropify-render,
body.skin-dark .dropify-infos {
  -webkit-transition: none !important;
  -o-transition: none !important;
  transition: none !important;
}

/* Override con body.skin-light para máxima especificidad */
body.skin-light .form-control,
body.skin-light input.form-control,
body.skin-light select.form-control,
body.skin-light textarea.form-control,
body.skin-light .modern-input,
body.skin-light input.modern-input,
body.skin-light select.modern-input,
body.skin-light textarea.modern-input {
  -webkit-transition: none !important;
  -o-transition: none !important;
  transition: none !important;
}

body.skin-light .dropify-wrapper,
body.skin-light .dropify-wrapper *,
body.skin-light .dropify-preview,
body.skin-light .dropify-render,
body.skin-light .dropify-infos {
  -webkit-transition: none !important;
  -o-transition: none !important;
  transition: none !important;
}

/* Override adicional para selectores anidados comunes */
.modern-card .form-control,
.modern-card .modern-input,
.modern-card .dropify-wrapper,
.modern-card-nested .form-control,
.modern-card-nested .modern-input,
.modern-card-nested .dropify-wrapper,
.modal .form-control,
.modal .modern-input,
.modal .dropify-wrapper {
  -webkit-transition: none !important;
  -o-transition: none !important;
  transition: none !important;
}

/* ============================================
   SELECT / DROPDOWN - Override hover azul
   Bootstrap-select & Bootstrap 4 dropdowns
   Hover gris neutro consistente con inputs
   ============================================ */

/* --- Bootstrap 4 base dropdown --- */
.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active,
.dropdown-item:active,
.dropdown-menu>li>a:hover,
.dropdown-menu>li>a:focus,
.dropdown-menu>li.active>a,
.dropdown-menu>li.selected>a,
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus,
.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item:active,
body.skin-dark .dropdown-item:hover,
body.skin-dark .dropdown-item:focus,
body.skin-dark .dropdown-item.active,
body.skin-dark .dropdown-item:active,
body.skin-light .dropdown-item:hover,
body.skin-light .dropdown-item:focus,
body.skin-light .dropdown-item.active,
body.skin-light .dropdown-item:active {
  background-color: var(--background-hover) !important;
  color: var(--text-primary) !important;
  outline: none !important;
}

/* --- Bootstrap-select plugin: todas las variantes --- */
.bootstrap-select .dropdown-menu li a:hover,
.bootstrap-select .dropdown-menu li a:focus,
.bootstrap-select .dropdown-menu li.active a,
.bootstrap-select .dropdown-menu li.selected a,
.bootstrap-select .dropdown-menu li.active a:hover,
.bootstrap-select .dropdown-menu li.active a:focus,
.bootstrap-select .dropdown-menu li.selected a:hover,
.bootstrap-select .dropdown-menu li.selected a:focus,
.bootstrap-select .dropdown-menu>.active>a,
.bootstrap-select .dropdown-menu>.active>a:hover,
.bootstrap-select .dropdown-menu>.active>a:focus,
body.skin-dark .bootstrap-select .dropdown-menu li a:hover,
body.skin-dark .bootstrap-select .dropdown-menu li a:focus,
body.skin-dark .bootstrap-select .dropdown-menu li.active a,
body.skin-dark .bootstrap-select .dropdown-menu li.selected a,
body.skin-dark .bootstrap-select .dropdown-menu>.active>a,
body.skin-dark .bootstrap-select .dropdown-menu>.active>a:hover,
body.skin-light .bootstrap-select .dropdown-menu li a:hover,
body.skin-light .bootstrap-select .dropdown-menu li a:focus,
body.skin-light .bootstrap-select .dropdown-menu li.active a,
body.skin-light .bootstrap-select .dropdown-menu li.selected a,
body.skin-light .bootstrap-select .dropdown-menu>.active>a,
body.skin-light .bootstrap-select .dropdown-menu>.active>a:hover {
  background-color: var(--background-hover) !important;
  color: var(--text-primary) !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Color del small/subtext en active (bootstrap-select pone blanco) */
.bootstrap-select .dropdown-menu li.active small,
.bootstrap-select .dropdown-menu li.selected small,
body.skin-dark .bootstrap-select .dropdown-menu li.active small,
body.skin-light .bootstrap-select .dropdown-menu li.active small {
  color: var(--text-tertiary) !important;
}

/* --- Dropdown menu container --- */
.bootstrap-select .dropdown-menu {
  background: var(--background-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius) !important;
  box-shadow: var(--shadow-lg) !important;
}

body.skin-dark .bootstrap-select .dropdown-menu {
  background: var(--background-card) !important;
  border-color: var(--border-color) !important;
}

/* --- Opciones dentro del dropdown --- */
.bootstrap-select .dropdown-menu li a {
  color: var(--text-primary) !important;
  padding: 0.5rem 0.75rem;
  font-size: var(--font-size-sm);
  transition: background-color var(--transition-fast);
}

body.skin-dark .bootstrap-select .dropdown-menu li a {
  color: var(--text-primary) !important;
}

/* --- Searchbox dentro del select --- */
.bootstrap-select .bs-searchbox .form-control {
  background: var(--background) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--border-radius-sm) !important;
}

.bootstrap-select .bs-searchbox .form-control:focus {
  border-color: var(--border-color-dark) !important;
  box-shadow: none !important;
}

/* --- Select nativo: estilizar opciones (Chrome/Edge) --- */
select.form-input option,
select.modern-input option {
  background: #ffffff;
  color: #18181b;
}

select.form-input option:checked,
select.modern-input option:checked {
  background: #f4f4f5;
  color: #18181b;
}

body.skin-dark select.form-input,
body.skin-dark select.modern-input {
  color-scheme: dark;
}

body.skin-dark select.form-input option,
body.skin-dark select.modern-input option {
  background: #1c1c1e;
  color: #e4e4e7;
}

body.skin-dark select.form-input option:checked,
body.skin-dark select.modern-input option:checked {
  background: #2a2a2e;
  color: #fafafa;
}

/* ============================================
   DATATABLES SEARCH INPUT - Estilo modern-input
   Para que el input de búsqueda de DataTables
   tenga el mismo look que los demás inputs.
   Cubre DataTables v1.x (.dataTables_filter)
   y DataTables v2.x (.dt-search .dt-input)
   ============================================ */

/* --- Base: ambas versiones (v1.x y v2.x) --- */
/* Override directo del plugin: div.dt-container .dt-input */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_filter label input,
div.dt-container .dt-search input.dt-input,
div.dt-container .dt-input[type="search"],
.dt-search input.dt-input {
  border: 1px solid var(--border-color) !important;
  border-radius: 0.625rem !important;
  background: var(--background-card) !important;
  background-color: var(--background-card) !important;
  color: var(--text-primary) !important;
  font-size: 0.8125rem !important;
  padding: 0.375rem 0.75rem !important;
  height: auto !important;
  width: auto !important;
  max-width: 200px !important;
  box-shadow: none !important;
  outline: none !important;
}

/* --- Placeholder --- */
.dataTables_wrapper .dataTables_filter input::placeholder,
div.dt-container .dt-search input.dt-input::placeholder,
.dt-search input.dt-input::placeholder {
  color: var(--text-tertiary) !important;
}

/* --- Hover --- */
.dataTables_wrapper .dataTables_filter input:hover,
div.dt-container .dt-search input.dt-input:hover,
.dt-search input.dt-input:hover {
  border-color: var(--border-color-dark) !important;
}

/* --- Light mode: Input con fondo blanco (igual que modern-input en chart-card) --- */
body.skin-light div.dt-container .dt-search input.dt-input,
body.skin-light div.dt-container .dt-input[type="search"],
body.skin-light .dataTables_wrapper .dataTables_filter input {
  background: #ffffff !important;
  background-color: #ffffff !important;
}

/* --- Light mode: Focus con sombra gris suave --- */
body.skin-light div.dt-container .dt-search input.dt-input:focus,
body.skin-light .dataTables_wrapper .dataTables_filter input:focus {
  border-color: #a1a1aa !important;
  box-shadow: 0 0 0 0.25rem rgba(161, 161, 170, 0.3) !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  outline: none !important;
}

/* --- Dark mode: Fondo #0f0f11 (igual que modern-input en chart-card) --- */
body.skin-dark div.dt-container .dt-search input.dt-input,
body.skin-dark div.dt-container .dt-input[type="search"],
body.skin-dark .dataTables_wrapper .dataTables_filter input,
body.skin-dark .dataTables_wrapper .dataTables_filter label input {
  background: #0f0f11 !important;
  background-color: #0f0f11 !important;
  border: 1px solid #3f3f46 !important;
  border-color: #3f3f46 !important;
  color: #fafafa !important;
}

/* --- Dark mode: Hover --- */
body.skin-dark div.dt-container .dt-search input.dt-input:hover,
body.skin-dark .dataTables_wrapper .dataTables_filter input:hover {
  border-color: #3f3f46 !important;
  background: #0f0f11 !important;
  background-color: #0f0f11 !important;
}

/* --- Dark mode: Focus con sombra gris oscura --- */
body.skin-dark div.dt-container .dt-search input.dt-input:focus,
body.skin-dark .dataTables_wrapper .dataTables_filter input:focus {
  border-color: #3f3f46 !important;
  box-shadow: 0 0 0 0.25rem rgba(39, 39, 42, 0.6) !important;
  background: #0f0f11 !important;
  background-color: #0f0f11 !important;
  outline: none !important;
}

/* ============================================
   DATATABLES LENGTH SELECT - Estilo modern-input
   Select de "Mostrar registros" con mismo look
   Cubre v1.x (.dataTables_length) y v2.x (.dt-length)
   ============================================ */

/* --- Base --- */
/* Override directo del plugin: div.dt-container select.dt-input */
.dataTables_wrapper .dataTables_length select,
div.dt-container .dt-length select.dt-input,
div.dt-container select.dt-input,
.dt-length select.dt-input {
  border: 1px solid var(--border-color) !important;
  border-radius: 0.625rem !important;
  background: var(--background-card) !important;
  background-color: var(--background-card) !important;
  color: var(--text-primary) !important;
  font-size: 0.8125rem !important;
  padding: 0.375rem 2rem 0.375rem 0.75rem !important;
  margin-left: 0.35rem !important;
  height: auto !important;
  width: auto !important;
  box-shadow: none !important;
  outline: none !important;
  cursor: pointer;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url(../../../assets/images/icons/select-arrow-down.png) !important;
  background-position: right 0.5rem center !important;
  background-repeat: no-repeat !important;
  background-size: 12px 8px !important;
}

/* --- Light mode: Select con fondo blanco --- */
body.skin-light div.dt-container .dt-length select.dt-input,
body.skin-light div.dt-container select.dt-input,
body.skin-light .dataTables_wrapper .dataTables_length select {
  background: #ffffff url('../../../assets/images/icons/select-arrow-down.png') no-repeat right 0.5rem center !important;
  background-color: #ffffff !important;
  background-size: 12px 8px !important;
}

/* --- Hover --- */
.dataTables_wrapper .dataTables_length select:hover,
div.dt-container .dt-length select.dt-input:hover,
div.dt-container select.dt-input:hover {
  border-color: var(--border-color-dark) !important;
}

/* --- Light mode: Focus --- */
body.skin-light div.dt-container .dt-length select.dt-input:focus,
body.skin-light .dataTables_wrapper .dataTables_length select:focus {
  border-color: #a1a1aa !important;
  box-shadow: 0 0 0 0.25rem rgba(161, 161, 170, 0.3) !important;
  background: #ffffff url('../../../assets/images/icons/select-arrow-down.png') no-repeat right 0.5rem center !important;
  background-color: #ffffff !important;
  background-size: 12px 8px !important;
  outline: none !important;
}

/* --- Dark mode: Fondo #0f0f11 (igual que modern-input en chart-card) --- */
body.skin-dark div.dt-container .dt-length select.dt-input,
body.skin-dark div.dt-container select.dt-input,
body.skin-dark .dataTables_wrapper .dataTables_length select {
  background: #0f0f11 url('/assets/images/icons/select-arrow-down-light.svg') no-repeat right 0.5rem center !important;
  background-color: #0f0f11 !important;
  background-size: 12px 8px !important;
  border: 1px solid #3f3f46 !important;
  border-color: #3f3f46 !important;
  color: #fafafa !important;
}

/* --- Dark mode: Hover --- */
body.skin-dark div.dt-container .dt-length select.dt-input:hover,
body.skin-dark div.dt-container select.dt-input:hover,
body.skin-dark .dataTables_wrapper .dataTables_length select:hover {
  border-color: #3f3f46 !important;
  background: #0f0f11 url('/assets/images/icons/select-arrow-down-light.svg') no-repeat right 0.5rem center !important;
  background-color: #0f0f11 !important;
  background-size: 12px 8px !important;
}

/* --- Dark mode: Focus --- */
body.skin-dark div.dt-container .dt-length select.dt-input:focus,
body.skin-dark div.dt-container select.dt-input:focus,
body.skin-dark .dataTables_wrapper .dataTables_length select:focus {
  border-color: #3f3f46 !important;
  box-shadow: 0 0 0 0.25rem rgba(39, 39, 42, 0.6) !important;
  background: #0f0f11 url('/assets/images/icons/select-arrow-down-light.svg') no-repeat right 0.5rem center !important;
  background-color: #0f0f11 !important;
  background-size: 12px 8px !important;
  outline: none !important;
}

/* ============================================
   BADGE SHADCN LOADING
   ============================================ */
.modern-badge-shadcn-loading {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background-color: #f4f4f5;
  /* Light Mode: Zinc-100 */
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25rem;
  border: 1px solid var(--border-color);
  box-shadow: none;
  /* Sin sombra (Flat) */
  transition: all var(--transition-base);
}

.modern-badge-shadcn-loading:hover {
  background-color: #e4e4e7;
  /* Zinc-200 for Light Mode Hover */
}

.modern-badge-shadcn-loading svg {
  margin-right: 0.5rem;
  height: 1rem;
  width: 1rem;
  animation: spin 1s linear infinite;
  color: var(--brand-primary);
}

/* Dark Mode: Badge plano (Fondo panel, sin sombra) */
body.skin-dark .modern-badge-shadcn-loading {
  background-color: #18181b;
  /* Dark Mode: Zinc-900 */
  /* Fondo del panel */
  color: var(--text-primary);
  border: 1px solid var(--border-color-dark);
  box-shadow: none;
}

body.skin-dark .modern-badge-shadcn-loading:hover {
  background-color: var(--background-hover);
  border-color: var(--border-color);
}