/* ═══════════════════════════════════════════════════════════════════
   CONTRAVEL — DESIGN SYSTEM v4.0 — COMPONENTS
   Comprehensive component library for institutional visual identity.
   Prefix: ct4- (avoids collision with Bootstrap 3, ct-, ct3-)
   Depends on: css/v3/tokens.css (V4 tokens)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Page Surface ── */
.ct4-page {
  background: var(--ct4-surface, #F0F4F8) !important;
  padding-bottom: 24px;
}

.ct4-page-gradient {
  background: linear-gradient(180deg, var(--ct4-surface, #F0F4F8) 0%, #FFFFFF 100%) !important;
}

/* ── Section Page Header ── */
.ct4-page-header {
  background: var(--ct4-surface-card, #FFFFFF);
  border-bottom: 1px solid var(--ct4-surface-dark, #D8E0E8);
  padding: 24px 0 20px;
  margin-bottom: 24px;
}
.ct4-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ct4-primary-dark, #1E2A4A);
  margin: 0;
  font-family: 'Inter', 'Roboto', sans-serif;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ct4-page-title i {
  color: var(--ct4-primary, #0A85C2);
  font-size: 20px;
}
.ct4-page-subtitle {
  font-size: 13px;
  color: var(--ct3-neutral-500, #64748B);
  margin: 4px 0 0;
}

/* ── Panel (replaces legacy Bootstrap panels) ── */
.ct4-panel {
  background: var(--ct4-surface-card, #FFFFFF);
  border-radius: 10px;
  border: 1px solid var(--ct4-surface-dark, #D8E0E8);
  box-shadow: 0 1px 3px rgba(30,42,74,0.06), 0 1px 2px rgba(30,42,74,0.04);
  overflow: hidden;
  margin-bottom: 24px;
}
.ct4-panel-header {
  background: linear-gradient(135deg, var(--ct4-primary-dark, #1E2A4A) 0%, var(--ct4-primary-dark-light, #253555) 100%);
  color: #FFFFFF;
  padding: 14px 20px;
  border-bottom: 2px solid var(--ct4-primary, #0A85C2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.ct4-panel-header i {
  color: var(--ct4-accent, #E86F3A);
  font-size: 14px;
}
.ct4-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
  font-family: 'Inter', 'Roboto', sans-serif;
  letter-spacing: 0.02em;
}
.ct4-panel-body {
  padding: 20px;
}
.ct4-panel-footer {
  padding: 14px 20px;
  background: var(--ct4-surface-light, #F5F8FB);
  border-top: 1px solid var(--ct4-surface-dark, #D8E0E8);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Form Controls (V4 override) ── */
.ct4-form-group {
  margin-bottom: 16px;
}
.ct4-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ct4-primary-dark, #1E2A4A);
  margin-bottom: 6px;
  font-family: 'Inter', 'Roboto', sans-serif;
}
.ct4-form-label .ct4-required {
  color: var(--ct3-danger, #DC2626);
  margin-left: 2px;
}
.ct4-input {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: 'Inter', 'Roboto', sans-serif;
  color: var(--ct3-neutral-700, #334155);
  background: var(--ct4-surface-card, #FFFFFF);
  border: 1px solid var(--ct3-neutral-200, #E2E8F0);
  border-radius: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.ct4-input:focus {
  border-color: var(--ct4-primary, #0A85C2);
  box-shadow: 0 0 0 3px rgba(10,133,194,0.15);
  outline: none;
}
.ct4-input::placeholder {
  color: var(--ct3-neutral-400, #94A3B8);
}
.ct4-input:disabled,
.ct4-input[readonly] {
  background: var(--ct3-neutral-100, #F1F5F9);
  color: var(--ct3-neutral-400, #94A3B8);
  cursor: not-allowed;
}
.ct4-input-error {
  border-color: var(--ct3-danger, #DC2626) !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.10) !important;
}
.ct4-input-success {
  border-color: var(--ct3-success, #059669) !important;
}

/* Select */
.ct4-select {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 32px 8px 12px;
  font-size: 14px;
  font-family: 'Inter', 'Roboto', sans-serif;
  color: var(--ct3-neutral-700, #334155);
  background: var(--ct4-surface-card, #FFFFFF) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--ct3-neutral-200, #E2E8F0);
  border-radius: 6px;
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.ct4-select:focus {
  border-color: var(--ct4-primary, #0A85C2);
  box-shadow: 0 0 0 3px rgba(10,133,194,0.15);
  outline: none;
}

/* Textarea */
textarea.ct4-input {
  min-height: 100px;
  resize: vertical;
}

/* ── Buttons (V4) ── */
.ct4-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none !important;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  line-height: 1.4;
  font-family: 'Inter', 'Roboto', sans-serif;
}
.ct4-btn-primary {
  background: var(--ct4-primary, #0A85C2);
  color: #fff !important;
  border-color: var(--ct4-primary, #0A85C2);
}
.ct4-btn-primary:hover,
.ct4-btn-primary:focus {
  background: var(--ct4-primary-hover, #0873A5);
  border-color: var(--ct4-primary-hover, #0873A5);
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(10,133,194,0.35);
}
.ct4-btn-accent {
  background: var(--ct4-accent, #E86F3A);
  color: var(--ct4-primary-dark, #1E2A4A) !important;
  border-color: var(--ct4-accent, #E86F3A);
  font-weight: 700;
}
.ct4-btn-accent:hover,
.ct4-btn-accent:focus {
  background: var(--ct4-accent-hover, #D55E30);
  border-color: var(--ct4-accent-hover, #D55E30);
  box-shadow: 0 4px 16px rgba(232,111,58,0.4);
}
.ct4-btn-outline {
  background: transparent;
  color: var(--ct4-primary, #0A85C2) !important;
  border-color: var(--ct4-primary, #0A85C2);
}
.ct4-btn-outline:hover {
  background: var(--ct4-primary, #0A85C2);
  color: #fff !important;
}
.ct4-btn-danger {
  background: var(--ct3-danger, #DC2626);
  color: #fff !important;
  border-color: var(--ct3-danger, #DC2626);
}
.ct4-btn-danger:hover {
  background: #B91C1C;
  border-color: #B91C1C;
  box-shadow: 0 4px 16px rgba(220,38,38,0.35);
}
.ct4-btn-success {
  background: var(--ct3-success, #059669);
  color: #fff !important;
  border-color: var(--ct3-success, #059669);
}
.ct4-btn-success:hover {
  background: #047857;
  border-color: #047857;
}
.ct4-btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.85) !important;
  border-color: rgba(255,255,255,0.35);
}
.ct4-btn-ghost:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.7);
  color: #fff !important;
}
.ct4-btn-sm  { padding: 7px 14px; font-size: 12px; }
.ct4-btn-lg  { padding: 12px 30px; font-size: 15px; font-weight: 700; }
.ct4-btn-block { display: flex; width: 100%; }
.ct4-btn:disabled,
.ct4-btn.disabled {
  background: var(--ct3-neutral-200, #E2E8F0) !important;
  color: var(--ct3-neutral-400, #94A3B8) !important;
  border-color: var(--ct3-neutral-200, #E2E8F0) !important;
  cursor: not-allowed;
  box-shadow: none !important;
}

/* ── Tables (V4) ── */
.ct4-table-wrap {
  border-radius: 10px;
  overflow: hidden;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--ct4-surface-dark, #D8E0E8);
  box-shadow: 0 1px 3px rgba(30,42,74,0.06);
  background: var(--ct4-surface-card, #FFFFFF);
}
.ct4-table-wrap .table {
  margin-bottom: 0 !important;
  font-size: 13px;
  border: none !important;
  font-family: 'Inter', 'Roboto', sans-serif;
}
.ct4-table-wrap .table > thead > tr > th {
  background: var(--ct4-primary-dark, #1E2A4A) !important;
  color: rgba(255,255,255,0.92) !important;
  font-weight: 600;
  padding: 11px 14px !important;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.3px;
  border: none !important;
  border-right: 1px solid rgba(255,255,255,0.06) !important;
  white-space: nowrap;
}
.ct4-table-wrap .table > thead > tr > th:last-child {
  border-right: none !important;
}
.ct4-table-wrap .table > tbody > tr > td {
  padding: 10px 14px !important;
  border-top: none !important;
  border-bottom: 1px solid var(--ct4-surface-dark, #D8E0E8) !important;
  color: var(--ct3-neutral-700, #334155);
  vertical-align: middle;
}
.ct4-table-wrap .table > tbody > tr:nth-child(even) > td {
  background: var(--ct4-surface, #F0F4F8) !important;
}
.ct4-table-wrap .table > tbody > tr:hover > td {
  background: var(--ct4-primary-light, #E5F2FA) !important;
}
.ct4-table-wrap .table > tbody > tr:last-child > td {
  border-bottom: none !important;
}
.ct4-table-wrap .table a {
  color: var(--ct4-primary, #0A85C2) !important;
  text-decoration: none !important;
}
.ct4-table-wrap .table a:hover {
  color: var(--ct4-accent, #E86F3A) !important;
}

/* ── Badges ── */
.ct4-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', 'Roboto', sans-serif;
  border-radius: 9999px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.ct4-badge-primary {
  background: var(--ct4-primary-light, #E5F2FA);
  color: var(--ct4-primary, #0A85C2);
}
.ct4-badge-accent {
  background: var(--ct4-accent-light, #FDF0E8);
  color: var(--ct4-accent-hover, #D55E30);
}
.ct4-badge-success {
  background: var(--ct3-success-light, #ECFDF5);
  color: var(--ct3-success, #059669);
}
.ct4-badge-warning {
  background: var(--ct3-warning-light, #FFFBEB);
  color: var(--ct3-warning, #D97706);
}
.ct4-badge-danger {
  background: var(--ct3-danger-light, #FEF2F2);
  color: var(--ct3-danger, #DC2626);
}
.ct4-badge-neutral {
  background: var(--ct3-neutral-100, #F1F5F9);
  color: var(--ct3-neutral-600, #475569);
}
.ct4-badge-navy {
  background: rgba(30,42,74,0.08);
  color: var(--ct4-primary-dark, #1E2A4A);
}

/* ── Alerts ── */
.ct4-alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Inter', 'Roboto', sans-serif;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  border-left: 3px solid;
}
.ct4-alert i {
  font-size: 16px;
  margin-top: 1px;
  flex-shrink: 0;
}
.ct4-alert-info {
  background: var(--ct3-info-light, #F0F9FF);
  border-left-color: var(--ct3-info, #0284C7);
  color: var(--ct3-neutral-700, #334155);
}
.ct4-alert-info i { color: var(--ct3-info, #0284C7); }
.ct4-alert-success {
  background: var(--ct3-success-light, #ECFDF5);
  border-left-color: var(--ct3-success, #059669);
  color: var(--ct3-neutral-700, #334155);
}
.ct4-alert-success i { color: var(--ct3-success, #059669); }
.ct4-alert-warning {
  background: var(--ct3-warning-light, #FFFBEB);
  border-left-color: var(--ct3-warning, #D97706);
  color: var(--ct3-neutral-700, #334155);
}
.ct4-alert-warning i { color: var(--ct3-warning, #D97706); }
.ct4-alert-danger {
  background: var(--ct3-danger-light, #FEF2F2);
  border-left-color: var(--ct3-danger, #DC2626);
  color: var(--ct3-neutral-700, #334155);
}
.ct4-alert-danger i { color: var(--ct3-danger, #DC2626); }

/* ── Modal (V4 header) ── */
.ct4-modal-header {
  background: linear-gradient(135deg, var(--ct4-primary-dark, #1E2A4A) 0%, var(--ct4-primary-dark-light, #253555) 100%) !important;
  color: #fff !important;
  text-align: center;
  padding: 16px 20px !important;
  border-bottom: 2px solid var(--ct4-primary, #0A85C2) !important;
}
.ct4-modal-header .close {
  color: rgba(255,255,255,0.75) !important;
  font-size: 20px;
  opacity: 1;
}
.ct4-modal-header .modal-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #fff !important;
  font-family: 'Inter', 'Roboto', sans-serif;
}
.ct4-modal-body {
  padding: 24px 20px;
  background: var(--ct4-surface-card, #FFFFFF);
}
.ct4-modal-footer {
  padding: 14px 20px;
  background: var(--ct4-surface-light, #F5F8FB);
  border-top: 1px solid var(--ct4-surface-dark, #D8E0E8);
}

/* ── Tabs (V4 override) ── */
.ct4-tabs .nav-tabs {
  border-bottom: 2px solid var(--ct4-surface-dark, #D8E0E8) !important;
  margin-bottom: 0 !important;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  background: transparent;
}
.ct4-tabs .nav-tabs > li {
  margin-bottom: -2px !important;
  float: none;
}
.ct4-tabs .nav-tabs > li > a {
  border: 1px solid transparent !important;
  border-radius: 8px 8px 0 0 !important;
  color: var(--ct3-neutral-500, #64748B) !important;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px !important;
  background: transparent !important;
  border-bottom: 2px solid transparent !important;
  transition: all 0.2s ease;
  text-decoration: none !important;
  font-family: 'Inter', 'Roboto', sans-serif;
}
.ct4-tabs .nav-tabs > li > a:hover {
  color: var(--ct4-primary, #0A85C2) !important;
  background: rgba(10,133,194,0.06) !important;
}
.ct4-tabs .nav-tabs > li.active > a,
.ct4-tabs .nav-tabs > li.active > a:focus,
.ct4-tabs .nav-tabs > li.active > a:hover {
  color: var(--ct4-primary, #0A85C2) !important;
  background: rgba(10,133,194,0.08) !important;
  border-color: var(--ct4-surface-dark, #D8E0E8) var(--ct4-surface-dark, #D8E0E8) transparent !important;
  border-bottom: 2px solid var(--ct4-primary, #0A85C2) !important;
}
.ct4-tabs .tab-content {
  border: 1px solid var(--ct4-surface-dark, #D8E0E8) !important;
  border-top: none !important;
  border-radius: 0 0 8px 8px !important;
  padding: 20px !important;
  background: var(--ct4-surface-card, #FFFFFF) !important;
}

/* ── Breadcrumbs ── */
.ct4-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ct3-neutral-400, #94A3B8);
  padding: 8px 0;
  margin-bottom: 16px;
}
.ct4-breadcrumb a {
  color: var(--ct4-primary, #0A85C2) !important;
  text-decoration: none !important;
}
.ct4-breadcrumb a:hover {
  color: var(--ct4-accent, #E86F3A) !important;
}
.ct4-breadcrumb .ct4-bc-sep {
  color: var(--ct3-neutral-300, #CBD5E1);
}
.ct4-breadcrumb .ct4-bc-current {
  color: var(--ct3-neutral-600, #475569);
  font-weight: 600;
}

/* ── Pagination ── */
.ct4-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  margin: 20px 0;
}
.ct4-pagination a,
.ct4-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none !important;
  transition: all 0.15s ease;
  font-family: 'Inter', 'Roboto', sans-serif;
}
.ct4-pagination a {
  color: var(--ct3-neutral-600, #475569) !important;
  background: var(--ct4-surface-card, #FFFFFF);
  border: 1px solid var(--ct4-surface-dark, #D8E0E8);
}
.ct4-pagination a:hover {
  background: var(--ct4-primary-light, #E5F2FA);
  border-color: var(--ct4-primary, #0A85C2);
  color: var(--ct4-primary, #0A85C2) !important;
}
.ct4-pagination .active,
.ct4-pagination .current {
  background: var(--ct4-primary, #0A85C2) !important;
  color: #fff !important;
  border: 1px solid var(--ct4-primary, #0A85C2);
}

/* ── Accordion (replaces Bootstrap panel-group) ── */
.ct4-accordion {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--ct4-surface-dark, #D8E0E8);
}
.ct4-accordion-item {
  border-bottom: 1px solid var(--ct4-surface-dark, #D8E0E8);
}
.ct4-accordion-item:last-child {
  border-bottom: none;
}
.ct4-accordion-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: var(--ct4-surface-card, #FFFFFF);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--ct4-primary-dark, #1E2A4A);
  font-family: 'Inter', 'Roboto', sans-serif;
  text-align: left;
  transition: background 0.15s ease;
}
.ct4-accordion-toggle:hover {
  background: var(--ct4-surface-light, #F5F8FB);
}
.ct4-accordion-toggle i {
  color: var(--ct4-accent, #E86F3A);
  font-size: 14px;
  transition: transform 0.2s ease;
}
.ct4-accordion-body {
  padding: 16px 20px;
  background: var(--ct4-surface-card, #FFFFFF);
  border-top: 1px solid var(--ct4-surface-dark, #D8E0E8);
}

/* ── Empty State ── */
.ct4-empty {
  text-align: center;
  padding: 48px 24px;
}
.ct4-empty-icon {
  font-size: 48px;
  color: var(--ct3-neutral-300, #CBD5E1);
  margin-bottom: 16px;
}
.ct4-empty-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--ct3-neutral-600, #475569);
  margin: 0 0 8px;
}
.ct4-empty-text {
  font-size: 13px;
  color: var(--ct3-neutral-400, #94A3B8);
  margin: 0 0 20px;
}

/* ── Loading / Spinner ── */
.ct4-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--ct4-surface-dark, #D8E0E8);
  border-top-color: var(--ct4-primary, #0A85C2);
  border-radius: 50%;
  animation: ct4-spin 0.7s linear infinite;
}
.ct4-spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}
@keyframes ct4-spin {
  to { transform: rotate(360deg); }
}
.ct4-loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  color: var(--ct3-neutral-500, #64748B);
  font-size: 13px;
}

/* ── Skeleton ── */
.ct4-skeleton {
  background: linear-gradient(90deg, var(--ct3-neutral-200, #E2E8F0) 25%, var(--ct3-neutral-100, #F1F5F9) 50%, var(--ct3-neutral-200, #E2E8F0) 75%);
  background-size: 200% 100%;
  animation: ct4-shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes ct4-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.ct4-skeleton-text {
  height: 12px;
  margin-bottom: 8px;
}
.ct4-skeleton-heading {
  height: 20px;
  width: 60%;
  margin-bottom: 12px;
}
.ct4-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* ── Status indicators (for factura/reembolso) ── */
.ct4-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', 'Roboto', sans-serif;
}
.ct4-status-success {
  background: var(--ct3-success-light, #ECFDF5);
  color: var(--ct3-success, #059669);
}
.ct4-status-danger {
  background: var(--ct3-danger-light, #FEF2F2);
  color: var(--ct3-danger, #DC2626);
}
.ct4-status-warning {
  background: var(--ct3-warning-light, #FFFBEB);
  color: var(--ct3-warning, #D97706);
}
.ct4-status-info {
  background: var(--ct3-info-light, #F0F9FF);
  color: var(--ct3-info, #0284C7);
}
.ct4-status-neutral {
  background: var(--ct3-neutral-100, #F1F5F9);
  color: var(--ct3-neutral-600, #475569);
}

/* ── Divider ── */
.ct4-divider {
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ct4-primary-dark, #1E2A4A), var(--ct4-primary, #0A85C2) 35%, var(--ct4-coral, #D4587A) 65%, var(--ct4-accent, #E86F3A));
  margin-bottom: 24px;
}
.ct4-divider-center {
  margin-left: auto;
  margin-right: auto;
}

/* ── File Upload Zone ── */
.ct4-upload-zone {
  border: 2px dashed var(--ct4-surface-dark, #D8E0E8);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  background: var(--ct4-surface-light, #F5F8FB);
  transition: border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}
.ct4-upload-zone:hover {
  border-color: var(--ct4-primary, #0A85C2);
  background: var(--ct4-primary-light, #E5F2FA);
}
.ct4-upload-zone i {
  font-size: 32px;
  color: var(--ct3-neutral-400, #94A3B8);
  margin-bottom: 8px;
}
.ct4-upload-zone p {
  font-size: 13px;
  color: var(--ct3-neutral-500, #64748B);
  margin: 0;
}

/* ── Calendar overrides ── */
.ct4-calendar .eventsCalendar-list-wrap {
  background: var(--ct4-surface, #F0F4F8) !important;
  border-radius: 8px;
}
.ct4-calendar .hoverWeek {
  background: var(--ct4-primary-light, #E5F2FA) !important;
}
.ct4-calendar .eventsCalendar-list li {
  border-bottom-color: var(--ct4-surface-dark, #D8E0E8) !important;
}

/* ── Legacy Bootstrap overrides for V4 consistency ── */
.ct4-page .panel-heading.header-contravel,
.ct4-page .panel-heading.header-contravel2 {
  background: linear-gradient(135deg, var(--ct4-primary-dark, #1E2A4A) 0%, var(--ct4-primary-dark-light, #253555) 100%) !important;
  color: #fff !important;
  border: none !important;
  padding: 14px 20px !important;
  border-radius: 10px 10px 0 0;
}
.ct4-page .panel-heading.header-contravel .panel-title,
.ct4-page .panel-heading.header-contravel2 .panel-title,
.ct4-page .panel-heading.header-contravel .panel-title2,
.ct4-page .panel-heading.header-contravel2 .panel-title2 {
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  font-family: 'Inter', 'Roboto', sans-serif !important;
}
.ct4-page .panel-default {
  border-color: var(--ct4-surface-dark, #D8E0E8) !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 3px rgba(30,42,74,0.06) !important;
  overflow: hidden;
}
.ct4-page .panel-footer {
  background: var(--ct4-surface-light, #F5F8FB) !important;
  border-top-color: var(--ct4-surface-dark, #D8E0E8) !important;
}

/* Override Bootstrap form-control in V4 pages */
.ct4-page .form-control {
  border-color: var(--ct3-neutral-200, #E2E8F0) !important;
  border-radius: 6px !important;
  font-family: 'Inter', 'Roboto', sans-serif;
  font-size: 14px;
  color: var(--ct3-neutral-700, #334155);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ct4-page .form-control:focus {
  border-color: var(--ct4-primary, #0A85C2) !important;
  box-shadow: 0 0 0 3px rgba(10,133,194,0.15) !important;
  outline: none;
}

/* Override Bootstrap tables in V4 pages */
.ct4-page .table-bordered {
  border-color: var(--ct4-surface-dark, #D8E0E8) !important;
}
.ct4-page .table > thead > tr > th {
  background: var(--ct4-primary-dark, #1E2A4A) !important;
  color: rgba(255,255,255,0.92) !important;
  font-weight: 600;
  font-size: 12px;
  border-color: rgba(255,255,255,0.06) !important;
  font-family: 'Inter', 'Roboto', sans-serif;
}
.ct4-page .table-striped > tbody > tr:nth-child(even) > td {
  background: var(--ct4-surface, #F0F4F8) !important;
}
.ct4-page .table > tbody > tr > td {
  border-color: var(--ct4-surface-dark, #D8E0E8) !important;
  color: var(--ct3-neutral-700, #334155);
}
.ct4-page .table > tbody > tr:hover > td {
  background: var(--ct4-primary-light, #E5F2FA) !important;
}

/* Override Bootstrap buttons in V4 pages */
.ct4-page .btn-success {
  background: var(--ct4-primary, #0A85C2) !important;
  border-color: var(--ct4-primary, #0A85C2) !important;
  font-family: 'Inter', 'Roboto', sans-serif;
  font-weight: 600;
  border-radius: 6px;
}
.ct4-page .btn-success:hover,
.ct4-page .btn-success:focus {
  background: var(--ct4-primary-hover, #0873A5) !important;
  border-color: var(--ct4-primary-hover, #0873A5) !important;
}
.ct4-page .btn-default {
  border-color: var(--ct3-neutral-200, #E2E8F0) !important;
  font-family: 'Inter', 'Roboto', sans-serif;
  border-radius: 6px;
}
.ct4-page .btn-danger {
  background: var(--ct3-danger, #DC2626) !important;
  border-color: var(--ct3-danger, #DC2626) !important;
  font-family: 'Inter', 'Roboto', sans-serif;
  border-radius: 6px;
}

/* Override Bootstrap alerts in V4 pages */
.ct4-page .alert-success {
  background: var(--ct3-success-light, #ECFDF5) !important;
  border-color: var(--ct3-success-border, #A7F3D0) !important;
  color: var(--ct3-success, #059669) !important;
  border-left: 3px solid var(--ct3-success, #059669) !important;
  border-radius: 6px !important;
}
.ct4-page .alert-danger {
  background: var(--ct3-danger-light, #FEF2F2) !important;
  border-color: var(--ct3-danger-border, #FECACA) !important;
  color: var(--ct3-danger, #DC2626) !important;
  border-left: 3px solid var(--ct3-danger, #DC2626) !important;
  border-radius: 6px !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PHASE 2 — RESPONSIVE DEEP FIXES
   ═══════════════════════════════════════════════════════════════════ */

/* ── Global: force all tables in ct4-page to be responsive ── */
.ct4-page .table-responsive {
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
}

/* ── Fix: remove hardcoded width attrs on td/th via CSS ── */
.ct4-page .table td[width],
.ct4-page .table th[width] {
  width: auto !important;
}

/* ── Fix: modals responsive on all breakpoints ── */
.ct4-page .modal-dialog {
  margin: 16px auto !important;
  max-width: calc(100vw - 32px) !important;
}
.ct4-page .modal-body iframe {
  width: 100% !important;
  max-height: 70vh;
  min-height: 300px;
}

/* Global modal responsive (works outside ct4-page too) */
.modal-dialog {
  max-width: calc(100vw - 32px);
}
.modal-body iframe {
  max-width: 100%;
}

/* ── Fix: operadora region filter buttons ── */
.ct4-page .operadora,
.ct4-page .operadora-sel {
  height: auto !important;
  min-height: 64px;
  padding: 12px 8px !important;
}
.ct4-page .operadora2,
.ct4-page .operadora-sel2 {
  height: auto !important;
  min-height: 48px;
  padding: 10px 8px !important;
}

/* ── Fix: forms inside ct4-page ── */
.ct4-page input[size] {
  width: 100% !important;
  max-width: 100%;
}
.ct4-page select.form-control {
  max-width: 100%;
}

/* ── Fix: page-title responsive across modules ── */
.ct4-page .page-title {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: var(--ct4-primary-dark, #1E2A4A) !important;
  font-family: 'Inter', 'Roboto', sans-serif !important;
  line-height: 1.3;
  margin-bottom: 16px;
}

/* ── Fix: comunicados orange panel headers ── */
.ct4-page .panel-heading[style*="background-color"] {
  background: linear-gradient(135deg, var(--ct4-primary-dark, #1E2A4A) 0%, var(--ct4-primary-dark-light, #253555) 100%) !important;
  border: none !important;
  border-radius: 10px 10px 0 0;
  padding: 14px 20px !important;
}
.ct4-page .panel-heading[style*="background-color"] .panel-title {
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  font-family: 'Inter', 'Roboto', sans-serif !important;
}

/* ── Responsive breakpoints ── */
@media (max-width: 991px) {
  .ct4-panel-body { padding: 16px; }
  .ct4-page-title { font-size: 19px; }
  .ct4-page .page-title { font-size: 19px !important; }
}

@media (max-width: 767px) {
  .ct4-panel-body { padding: 14px; }
  .ct4-panel-header { padding: 12px 14px; }
  .ct4-panel-title { font-size: 13px; }
  .ct4-page-title { font-size: 17px; }
  .ct4-table-wrap { border-radius: 8px; }
  .ct4-btn-block { font-size: 14px; }
  .ct4-tabs .nav-tabs > li > a {
    padding: 8px 12px !important;
    font-size: 12px;
  }
  .ct4-page .page-title { font-size: 17px !important; }

  .ct4-page .modal-dialog {
    margin: 8px !important;
    width: auto !important;
  }
  .ct4-page .modal-body iframe {
    min-height: 250px;
    max-height: 60vh;
  }

  .ct4-page .operadora,
  .ct4-page .operadora-sel {
    min-height: 50px;
    font-size: 14px;
  }
  .ct4-page .operadora a,
  .ct4-page .operadora-sel a {
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  .ct4-panel-body { padding: 12px; }
  .ct4-panel-header { padding: 10px 12px; }
  .ct4-panel-footer { flex-wrap: wrap; }
  .ct4-pagination a,
  .ct4-pagination span { min-width: 32px; height: 32px; font-size: 12px; }

  .ct4-page .operadora,
  .ct4-page .operadora-sel {
    min-height: 44px;
    padding: 8px 4px !important;
  }
  .ct4-page .operadora a,
  .ct4-page .operadora-sel a {
    font-size: 12px !important;
  }
}

@media (max-width: 320px) {
  .ct4-page .btn { font-size: 12px; padding: 8px 12px; }
  .ct4-panel-header { padding: 8px 10px; }
  .ct4-panel-title { font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════════════
   PHASE 2 — ACCESSIBILITY HARDENING
   ═══════════════════════════════════════════════════════════════════ */

/* ── Global focus-visible on ALL interactive elements ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ct4-primary, #0A85C2) !important;
  outline-offset: 2px !important;
}
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* ── Skip link (activated in header.php HTML) ── */
.ct4-skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ct4-primary-dark, #1E2A4A);
  color: var(--ct4-accent, #E86F3A) !important;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Inter', 'Roboto', sans-serif;
  border-radius: 0 0 8px 8px;
  z-index: 10000;
  text-decoration: none !important;
  transition: top 0.15s ease;
  box-shadow: 0 4px 16px rgba(30,42,74,0.3);
}
.ct4-skip-link:focus {
  top: 0;
  outline: 2px solid var(--ct4-accent, #E86F3A);
  outline-offset: 2px;
}

/* ── Fix: footer contrast — raise text opacity for AA compliance ── */
.ct-footer p {
  color: rgba(255,255,255,0.72) !important;
}
.ct-footer-desc {
  color: rgba(255,255,255,0.68) !important;
}
.ct-footer-bar p {
  color: rgba(255,255,255,0.50) !important;
}
.ct-footer-bar a {
  color: rgba(255,255,255,0.60) !important;
}

/* ── Fix: touch targets — minimum 44px for links in tables and footer ── */
.ct4-page .table a {
  display: inline-block;
  padding: 4px 2px;
  min-height: 28px;
  line-height: 1.4;
}
.ct-footer ul li {
  min-height: 36px;
}
.ct-footer ul li a {
  padding: 2px 0;
}

/* ── ARIA: dropdown gets role ── */
.ct-dd-menu[role="menu"] a {
  role: menuitem;
}

/* ── Fix: hexagon panel keyboard accessible ── */
.ct-op-hexagon-item {
  outline: none;
}
.ct-op-hexagon-item:focus-visible .ct-op-hex-frame:last-child {
  transform: scale(1.12);
}
.ct-op-hexagon-item:focus-visible .ct-op-hex-label-text {
  color: var(--ct-orange, #E86F3A) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PHASE 2 — PREMIUM POLISH
   ═══════════════════════════════════════════════════════════════════ */

/* ── Premium: global body font upgrade for ct4-page modules ── */
.ct4-page {
  font-family: 'Inter', 'Roboto', -apple-system, sans-serif;
  color: var(--ct3-neutral-700, #334155);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Premium: improved panel spacing and density ── */
.ct4-page .panel-default {
  margin-bottom: 20px !important;
}
.ct4-page .list-group-item {
  border-color: var(--ct4-surface-dark, #D8E0E8) !important;
  padding: 14px 20px !important;
}
.ct4-page .panel-body {
  padding: 20px !important;
}

/* ── Premium: form labels and inputs ── */
.ct4-page label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ct4-primary-dark, #1E2A4A);
  font-family: 'Inter', 'Roboto', sans-serif;
  margin-bottom: 5px;
}
.ct4-page .form-control {
  min-height: 40px;
  padding: 8px 12px !important;
}

/* ── Premium: section separator line ── */
.ct4-page hr {
  border-color: var(--ct4-surface-dark, #D8E0E8);
  margin: 20px 0;
}

/* ── Premium: smooth transition on all interactive elements ── */
.ct4-page a,
.ct4-page .btn,
.ct4-page .form-control {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Premium: card hover micro-interaction ── */
.ct4-page .panel-default:hover {
  box-shadow: 0 4px 12px rgba(30,42,74,0.09) !important;
}

/* ── Premium: table polish ── */
.ct4-page .table {
  font-family: 'Inter', 'Roboto', sans-serif;
  font-size: 13px;
}
.ct4-page .table > thead > tr > th {
  letter-spacing: 0.3px;
  text-transform: none;
  padding: 12px 14px !important;
}
.ct4-page .table > tbody > tr > td {
  padding: 10px 14px !important;
  vertical-align: middle;
}

/* ── Premium: link styling in ct4-page ── */
.ct4-page a:not(.btn):not(.ct-nav-pill):not(.ct-pkg-link):not([class*="ct4-"]) {
  color: var(--ct4-primary, #0A85C2);
  transition: color 0.15s ease;
}
.ct4-page a:not(.btn):not(.ct-nav-pill):not(.ct-pkg-link):not([class*="ct4-"]):hover {
  color: var(--ct4-accent, #E86F3A);
}

/* ── Premium: improved spacing for stacked form groups ── */
.ct4-page .form-group {
  margin-bottom: 16px;
}

/* ── Premium: better button sizing ── */
.ct4-page .btn {
  min-height: 38px;
  padding: 8px 20px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.ct4-page .btn-lg {
  min-height: 44px;
  padding: 10px 28px;
  font-size: 14px;
}

/* ── Premium: comunicados heading style override ── */
.ct4-page .panel-heading {
  font-family: 'Inter', 'Roboto', sans-serif;
}

/* ── Premium: scrollbar styling for table wraps ── */
.ct4-table-wrap::-webkit-scrollbar {
  height: 6px;
}
.ct4-table-wrap::-webkit-scrollbar-track {
  background: var(--ct4-surface, #F0F4F8);
  border-radius: 3px;
}
.ct4-table-wrap::-webkit-scrollbar-thumb {
  background: var(--ct3-neutral-300, #CBD5E1);
  border-radius: 3px;
}
.ct4-table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--ct3-neutral-400, #94A3B8);
}

/* ── Premium: inline style overrides for known patterns ── */
.ct4-page [style*="margin-top: 25%"] {
  margin-top: 0 !important;
  padding: 12px 0 !important;
  vertical-align: middle !important;
}
.ct4-page .gris2 {
  background-color: var(--ct4-surface, #F0F4F8) !important;
}
.ct4-page .container-gris {
  background-color: var(--ct4-surface, #F0F4F8) !important;
}

/* ── Premium: star-contra border fix ── */
.ct4-page .star-contra {
  border-right-color: var(--ct4-primary, #0A85C2) !important;
  border-radius: 10px !important;
  overflow: hidden;
}

/* ── Premium: datepicker overflow fix ── */
.ui-datepicker {
  max-width: calc(100vw - 20px) !important;
  z-index: 1100 !important;
}

/* ═══════════════════════════════════════════════════════════════════
   ART DIRECTION — Accent Strategy (B2B portal)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Active tab indicator: accent orange underline ── */
.ct4-page .nav-tabs > li.active > a {
  border-bottom: 2px solid var(--ct4-accent, #E86F3A) !important;
}

/* ── Table header: subtle accent separator ── */
.ct4-table-wrap .table > thead > tr > th:first-child {
  border-left: 3px solid var(--ct4-accent, #E86F3A) !important;
}

/* ── Panel header: accent icon marker ── */
.ct4-page .panel-heading.header-contravel::before,
.ct4-page .panel-heading.header-contravel2::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  background: var(--ct4-accent, #E86F3A);
  border-radius: 2px;
  margin-right: 10px;
  flex-shrink: 0;
}

/* ── Status badges: subtle accent ring on hover ── */
.ct4-status:hover {
  box-shadow: 0 0 0 2px rgba(232,111,58,0.15);
}

/* ── Btn primary: accent border on focus for premium feel ── */
.ct4-page .btn-success:focus,
.ct4-page .btn-primary:focus {
  box-shadow: 0 0 0 3px rgba(232,111,58,0.25) !important;
}

/* ── Inline style cleanup: common patterns migrated to CSS ── */
.ct4-text-center { text-align: center !important; }
.ct4-w-full { width: 100% !important; }
.ct4-mb-20 { margin-bottom: 20px !important; }
.ct4-mt-25 { margin-top: 25px !important; }
.ct4-pt-8 { padding-top: 8px !important; }
