/* =============================================================================
   TrendContratos — app.css
   Variables globales, componentes base, topbar, menú, FAB, toasts
   ============================================================================= */

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

/* ── VARIABLES GLOBALES ──────────────────────────────────────────────────── */
:root {
  --color-primary: #4A6CF7;
  --color-primary-dark: #3451D1;
  --color-secondary: #7C3AED;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;
  --color-info: #3B82F6;
  --bg-page: #F3F4F6;
  --bg-card: #FFFFFF;
  --border-color: #E5E7EB;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.10);
  --shadow-topbar: 0 1px 0 #E5E7EB;
  --border-radius-card: 12px;
  --border-radius-btn: 8px;
  --border-radius-badge: 20px;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --topbar-height: 60px;
  --font-base: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --bs-body-font-size: 0.8rem !important;
}

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

body {
  font-family: var(--font-base);
  font-size: var(--bs-body-font-size);
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

/* ── TIPOGRAFÍA ──────────────────────────────────────────────────────────── */
.fw-500 {
  font-weight: 500 !important;
}

.fw-600 {
  font-weight: 600 !important;
}

.fw-700 {
  font-weight: 700 !important;
}

.text-primary-dark {
  color: var(--color-primary-dark) !important;
}

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

/* ── TOPBAR ──────────────────────────────────────────────────────────────── */
.clm-topbar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: var(--shadow-topbar);
}

.clm-brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
}

.clm-brand-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

/* Links de navegación */
.clm-nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary) !important;
  border-radius: 6px;
  padding: 6px 12px !important;
  transition: all 0.15s;
}

.clm-nav-link:hover,
.clm-nav-link.active {
  color: var(--color-primary) !important;
  background: rgba(74, 108, 247, 0.08);
}

/* Dropdown de navegación */
.clm-dropdown-menu {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 4px;
  min-width: 180px;
}

.clm-dropdown-menu .dropdown-item {
  border-radius: 6px;
  font-size: 13px;
  padding: 8px 12px;
  color: var(--text-primary);
  transition: background 0.1s;
}

.clm-dropdown-menu .dropdown-item:hover {
  background: var(--bg-page);
}

.clm-dropdown-menu .dropdown-item.active {
  background: rgba(74, 108, 247, 0.08);
  color: var(--color-primary);
}

.clm-dropdown-section-label {
  font-size: 10px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted) !important;
  padding: 6px 12px 2px !important;
}


/* Avatar del usuario */
.clm-avatar-btn {
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.clm-avatar-btn:hover {
  background: var(--bg-page);
}

.clm-avatar-btn::after {
  display: none !important;
}

.clm-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.clm-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clm-avatar-placeholder.sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.clm-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.clm-user-rol {
  font-size: 11px;
  color: var(--text-muted);
}

/* Búsqueda global */
.clm-search-wrap {
  position: relative;
  width: 240px;
}

.clm-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.clm-search-input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: var(--bg-page);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.clm-search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.12);
  background: #fff;
}

.clm-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  max-height: 300px;
  overflow-y: auto;
}

/* ===== Campana de notificaciones (menú) ===== */
.notif-bell-wrap {
  position: relative;
}

.notif-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: #EF4444;
  border-radius: 8px;
}

.notif-dropdown {
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  padding: 0;
}

.notif-dd-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f3f5;
  text-decoration: none;
  cursor: pointer;
}

.notif-dd-item:last-child {
  border-bottom: 0;
}

.notif-dd-item.no-leida {
  background: rgba(74, 144, 217, .06);
}

.notif-dd-cuerpo {
  flex: 1 1 auto;
  min-width: 0;
}

.notif-dd-titulo {
  font-size: 13px;
  color: #111827;
  font-weight: 500;
}

.notif-dd-msg {
  font-size: 12px;
  color: #6B7280;
}

.notif-dd-empty {
  padding: 24px 14px;
  text-align: center;
  color: #9CA3AF;
  font-size: 13px;
}

/* ── MAIN CONTENT ────────────────────────────────────────────────────────── */
.clm-main-content {
  min-height: calc(100vh - var(--topbar-height));
  padding-bottom: 16px;
  overflow-x: hidden;
}

/* ── CARDS ───────────────────────────────────────────────────────────────── */
.clm-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.clm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 15px;
  border-bottom: 1px solid var(--border-color);
  background: #FAFAFA;
}

.clm-card-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin: 0;
}

.clm-card-body {
  padding: 10px 20px;
}

/* ── ICON BOXES ──────────────────────────────────────────────────────────── */
.clm-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.clm-icon-box.blue {
  background: rgba(74, 108, 247, 0.12);
  color: #4A6CF7;
}

.clm-icon-box.red {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
}

.clm-icon-box.yellow {
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
}

.clm-icon-box.green {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
}

.clm-icon-box.gray {
  background: rgba(107, 114, 128, 0.12);
  color: #6B7280;
}

.clm-icon-box.violet {
  background: rgba(124, 58, 237, 0.12);
  color: #7C3AED;
}

/* ── BOTONES ─────────────────────────────────────────────────────────────── */
.clm-btn-primary {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--border-radius-btn);
  font-weight: 600;
  font-size: 13px;
  padding: 5px 15px;
  transition: all 0.15s;
}

.clm-btn-primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(74, 108, 247, 0.35);
  transform: translateY(-1px);
}

.clm-btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-btn);
  font-weight: 500;
  font-size: 13px;
  padding: 5px 15px;
  transition: all 0.15s;
}

.clm-btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(74, 108, 247, 0.06);
}

.clm-btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
}

.clm-btn-icon:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(74, 108, 247, 0.06);
}

.clm-btn-danger {
  background: #e53e3e;
  color: #fff;
  border: none;
  border-radius: var(--border-radius-btn);
  font-weight: 600;
  font-size: 13px;
  padding: 5px 15px;
  transition: all 0.15s;
}

.clm-btn-danger:hover {
  background: #c53030;
  color: #fff;
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.35);
  transform: translateY(-1px);
}

/* ── FAB ─────────────────────────────────────────────────────────────────── */
.clm-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--color-primary, #6366F1) 0%, var(--color-secondary, #8B5CF6) 100%);
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(99, 102, 241, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  border: none;
  cursor: pointer;
  transition: transform .3s ease, box-shadow .25s ease;
  z-index: 1000;
}

.clm-fab:hover {
  box-shadow: 0 6px 28px rgba(99, 102, 241, .6);
  transform: scale(1.08);
}

.clm-fab:active {
  transform: scale(0.96);
}

/* ── BADGES DE ESTADO ────────────────────────────────────────────────────── */
.clm-badge-borrador {
  display: inline-flex;
  align-items: center;
  background: rgba(107, 114, 128, 0.12);
  color: #6B7280;
  border-radius: var(--border-radius-badge);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  letter-spacing: 0.3px;
}

.clm-badge-negociacion {
  display: inline-flex;
  align-items: center;
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
  border-radius: var(--border-radius-badge);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
}

.clm-badge-firmado {
  display: inline-flex;
  align-items: center;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-radius: var(--border-radius-badge);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
}

.clm-badge-tipo {
  display: inline-flex;
  align-items: center;
  background: rgba(74, 108, 247, 0.08);
  color: var(--color-primary);
  border-radius: var(--border-radius-badge);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  white-space: nowrap;
}

.clm-badge-sistema {
  display: inline-flex;
  align-items: center;
  background: rgba(124, 58, 237, 0.12);
  color: #7C3AED;
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--border-radius-badge);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.clm-badge-vence {
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.clm-badge-vencido {
  background: rgba(239, 68, 68, 0.12);
  color: #DC2626;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.clm-badge-plan {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--border-radius-badge);
  letter-spacing: 1px;
}

.clm-badge-rol--admin {
  background: rgba(74, 108, 247, 0.12);
  color: #4A6CF7;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.clm-badge-rol--editor {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.clm-badge-rol--viewer {
  background: rgba(107, 114, 128, 0.12);
  color: #6B7280;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

/* === BADGES ESTADO ETAPA WORKFLOW === */
.etapa-badge-ok {
  display: inline-flex;
  align-items: center;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
}

.etapa-badge-alerta {
  display: inline-flex;
  align-items: center;
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  animation: etapa-pulse-alerta 2s ease-in-out infinite;
}

.etapa-badge-vencida {
  display: inline-flex;
  align-items: center;
  background: rgba(239, 68, 68, 0.12);
  color: #DC2626;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  animation: etapa-pulse-vencida 1.5s ease-in-out infinite;
}

@keyframes etapa-pulse-alerta {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes etapa-pulse-vencida {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3);
  }

  50% {
    opacity: 0.85;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
  }
}

/* === WORKFLOW PREVIEW MODAL === */
.workflow-preview-etapas {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
}

.workflow-preview-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  background: #F3F4F6;
  border-radius: 20px;
  border: 1px solid #E5E7EB;
  white-space: nowrap;
  transition: all .15s;
}

.workflow-preview-item:hover {
  background: rgba(74, 108, 247, 0.08);
  border-color: rgba(74, 108, 247, 0.25);
}

.workflow-preview-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.workflow-preview-nombre {
  font-weight: 600;
  color: var(--text-primary);
}

.workflow-preview-plazo {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

#modal_form_manual {
  max-height: 78vh;
  overflow-y: auto;
}

/* ── TABLA ───────────────────────────────────────────────────────────────── */
.clm-table {
  font-size: 13px;
}

.clm-table thead th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  background: #FAFAFA;
}

.clm-table tbody td {
  padding: 6px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  color: var(--text-primary);
}

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

.clm-table tbody tr:hover td {
  background: #F9FAFB;
}

/* ── TOASTS ──────────────────────────────────────────────────────────────── */
.clm-toast {
  position: fixed;
  top: 15px;
  right: 15px;
  padding: 10px 15px;
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: clm-toast-in 0.3s ease, clm-toast-out 0.3s ease 3.2s;
  max-width: calc(100vw - 30px);
  min-width: 260px;
}

@keyframes clm-toast-in {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes clm-toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-16px);
  }
}

/* ── MODALES ─────────────────────────────────────────────────────────────── */
.clm-modal {
  border-radius: 16px;
  overflow: hidden;
  border: none;
}

.clm-modal-header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.clm-modal-header .modal-title {
  color: #fff;
}

.clm-modal-header p {
  color: rgba(255, 255, 255, 0.8);
}

/* ── OPCIONES DE MODAL ───────────────────────────────────────────────────── */
.clm-opcion-card {
  display: block;
  padding: 24px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  color: var(--text-primary);
}

.clm-opcion-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.clm-opcion-icon--ia {
  color: var(--color-secondary);
}

.clm-opcion-icon--manual {
  color: var(--text-secondary);
}

/* ── FILAS DE ALERT Y VERSIONES ──────────────────────────────────────────── */
.clm-alert-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.1s;
}

.clm-alert-row:last-child {
  border-bottom: none;
}

.clm-alert-row:hover {
  background: #F9FAFB;
}

.clm-alert-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.clm-version-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.1s;
}

.clm-version-row:last-child {
  border-bottom: none;
}

.clm-version-row:hover,
.clm-version-row.active {
  background: rgba(74, 108, 247, 0.06);
}

.clm-version-num {
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.clm-anexo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.1s;
}

.clm-anexo-row:last-child {
  border-bottom: none;
}

.clm-anexo-row:hover {
  background: #F9FAFB;
}

/* ── INFO ROWS (VISUALIZADOR) ────────────────────────────────────────────── */
.clm-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid #F3F4F6;
  font-size: 13px;
}

.clm-info-row:last-child {
  border-bottom: none;
}

.clm-info-label {
  color: var(--text-muted);
  font-weight: 500;
}

.clm-info-value {
  font-weight: 500;
}

/* ── BREADCRUMB ──────────────────────────────────────────────────────────── */
.clm-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.clm-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.clm-breadcrumb a:hover {
  color: var(--color-primary);
}

.clm-breadcrumb i {
  margin: 0 4px;
  font-size: 10px;
}

/* ── LINKS ───────────────────────────────────────────────────────────────── */
.clm-contrato-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.1s;
}

.clm-contrato-link:hover {
  color: var(--color-primary);
}

/* ── DROPZONE ────────────────────────────────────────────────────────────── */
.clm-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: #FAFAFA;
  position: relative;
}

.clm-dropzone:hover,
.clm-dropzone.drag-over {
  border-color: var(--color-primary);
  background: rgba(74, 108, 247, 0.03);
}

.clm-dropzone--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.clm-dropzone-inner {
  padding: 28px 20px;
  text-align: center;
  pointer-events: none;
}

.clm-dropzone--sm .clm-dropzone-inner {
  padding: 16px;
  text-align: left;
}

.clm-preview-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

/* ── EMPTY STATE ─────────────────────────────────────────────────────────── */
.clm-empty-state {
  text-align: center;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .clm-search-wrap {
    display: none;
  }

  .clm-fab {
    bottom: 20px;
    right: 20px;
  }
}

/* ── DATATABLES — premium redesign ──────────────────────────────────────── */
.dataTables_wrapper .dataTables_length {
  display: none !important;
}

.dataTables_wrapper .dataTables_filter {
  text-align: left !important;
  margin-bottom: 16px;
}

.dataTables_wrapper .dataTables_filter label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
}

.dataTables_wrapper .dataTables_filter input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  border-bottom: 1.5px solid var(--border-color) !important;
  border-radius: 0 !important;
  color: var(--text-primary) !important;
  font-size: 13px !important;
  font-family: var(--font-base) !important;
  padding: 6px 4px !important;
  margin-bottom: 4px;
  outline: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.dataTables_wrapper .dataTables_filter input::placeholder {
  color: var(--text-muted);
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-bottom-color: var(--color-primary) !important;
  box-shadow: 0 2px 0 0 rgba(74, 108, 247, 0.15) !important;
}

table.dataTable tbody tr:last-child td {
  border-bottom: none !important;
}

.dataTables_wrapper .dataTables_paginate {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 12px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  background: #fff !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
  border-radius: 6px !important;
  margin: 0 !important;
  padding: 5px 11px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  transition: all 0.15s ease !important;
  font-family: var(--font-base) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled) {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(74, 108, 247, 0.3) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
}

.dataTables_wrapper .dataTables_info {
  color: var(--text-muted) !important;
  font-size: 12px !important;
  padding-top: 14px !important;
}

/* === FORM CHECKS Y SWITCHES EN MODALES === */
.modal .form-check-input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 0.1em;
  cursor: pointer;
  border: 1.5px solid #D1D5DB;
  border-radius: 4px;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.modal .form-check-input[type="checkbox"]:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.modal .form-check-input[type="checkbox"]:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(74, 108, 247, 0.2);
}

.modal .form-switch .form-check-input {
  width: 42px;
  height: 22px;
  margin-top: 0;
  margin-left: 0;
  cursor: pointer;
  border-radius: 22px;
  border: none;
  background-color: #D1D5DB;
  transition: background-color 0.2s ease;
  box-shadow: none;
  flex-shrink: 0;
}

.modal .form-switch .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(74, 108, 247, 0.2);
  background-color: #D1D5DB;
}

.modal .form-switch .form-check-input:checked {
  background-color: var(--color-primary);
  border-color: transparent;
}

.modal .form-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-left: 0;
  min-height: auto;
}

.modal .form-check-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  margin-bottom: 0;
  line-height: 1;
  margin-left: 5px;
}

/* ── CORRECCIÓN MODALES — stacking context con topbar sticky ─────────────── */
.modal {
  z-index: 1055 !important;
}

.modal-backdrop {
  z-index: 1050 !important;
}

.modal-dialog {
  position: relative;
  z-index: 1056;
}

body.modal-open {
  overflow: hidden !important;
  padding-right: 0 !important;
}

/* ── OVERLAY ENTRE MODALES APILADOS ─────────────────────────────────────── */
.clm-modal-stack-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1060;
  animation: clm-overlay-in 0.2s ease;
}

@keyframes clm-overlay-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

#modal_nueva_contraparte_rapida.show {
  z-index: 1065 !important;
}