:root {
  --kyp-blue-900: #0f2f7a;
  --kyp-blue-800: #1d4ed8;
  --kyp-blue-700: #2563eb;
  --kyp-blue-600: #3b82f6;
  --kyp-blue-100: #eaf1ff;
  --kyp-blue-050: #f4f8ff;

  --kyp-text: #0f2554;
  --kyp-muted: #5a6f95;
  --kyp-surface: #ffffff;
  --kyp-border: #c7d8ff;

  --color-primary: #1d4ed8 !important;
  --color-primary-600: #1e40af !important;
  --color-primary-700: #163e9b !important;
  --color-accent: #2563eb !important;
  --color-success: #2563eb !important;
  --color-warning: #2563eb !important;
  --color-info: #2563eb !important;
  --color-bg: #f4f8ff !important;
  --color-surface: #ffffff !important;
  --color-border: #c7d8ff !important;
  --color-text: #0f2554 !important;

  --navbar-bg: #1d4ed8 !important;
  --navbar-border-bottom: #ffffff !important;
  --navbar-link-hover: #3b82f6 !important;

  --bs-primary: #1d4ed8 !important;
  --bs-primary-rgb: 29, 78, 216 !important;
  --bs-success: #1d4ed8 !important;
  --bs-success-rgb: 29, 78, 216 !important;
  --bs-info: #1d4ed8 !important;
  --bs-info-rgb: 29, 78, 216 !important;
  --bs-warning: #1d4ed8 !important;
  --bs-warning-rgb: 29, 78, 216 !important;
}

html,
body {
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%) !important;
  color: var(--kyp-text) !important;
}

.navbar,
.navbar.navbar-expand-lg {
  background: linear-gradient(90deg, var(--kyp-blue-900) 0%, var(--kyp-blue-800) 55%, var(--kyp-blue-700) 100%) !important;
  border-bottom-color: #ffffff !important;
  box-shadow: 0 8px 22px rgba(15, 47, 122, 0.25) !important;
}

.navbar,
.navbar *,
.navbar .nav-link,
.navbar .navbar-brand,
.navbar .dropdown-toggle,
.navbar .user-icon-text,
.navbar .text-white {
  color: #ffffff !important;
}

.navbar .dropdown-menu {
  background: #ffffff !important;
  border: 1px solid var(--kyp-border) !important;
  box-shadow: 0 10px 28px rgba(15, 47, 122, 0.16) !important;
}

.navbar .dropdown-item,
.navbar .nav-dropdown-item {
  color: var(--kyp-text) !important;
}

.navbar .dropdown-item:active,
.navbar .dropdown-item:hover,
.navbar .nav-dropdown-item:active,
.navbar .nav-dropdown-item:hover {
  background: var(--kyp-blue-100) !important;
  color: var(--kyp-blue-900) !important;
}

.card,
.table,
.table-responsive,
.modal-content,
.dropdown-menu,
.ng-dropdown-panel,
.swal2-popup {
  background: var(--kyp-surface) !important;
  border-color: var(--kyp-border) !important;
  box-shadow: 0 8px 22px rgba(15, 47, 122, 0.08) !important;
}

.card,
.card-title,
.card-header,
.card-body,
.table,
.table th,
.table td,
.modal-content,
.modal-title,
.modal-body,
.modal-footer,
.dropdown-menu,
.dropdown-item,
.ng-dropdown-panel,
.ng-option,
.ng-select,
.ng-select-container,
label,
small,
p {
  color: var(--kyp-text);
}

.table thead th {
  background: linear-gradient(180deg, #f3f7ff 0%, #e7efff 100%) !important;
  color: #1a3d91 !important;
  border-color: var(--kyp-border) !important;
  font-weight: 700 !important;
}

.table tbody tr,
.table tbody td,
.table tfoot td {
  background: #ffffff !important;
  color: var(--kyp-text) !important;
  border-color: #d7e3ff !important;
}

.text-muted,
small,
.table .text-muted {
  color: var(--kyp-muted) !important;
}

/* Corrige contraste no rodapé de tabelas/paginação */
.data-table__footer,
.items-per-page,
.pagination-controls,
.pagination-info,
.results-hint,
.page-indicator,
.total-items,
.table-footer,
.table-footer * {
  color: var(--kyp-text) !important;
  background-color: #f5f9ff !important;
}

.data-table__footer *,
.data-table__footer label,
.data-table__footer div,
.data-table__footer span,
.data-table__footer .pagination-info,
.data-table__footer .total-items {
  color: var(--kyp-text) !important;
  opacity: 1 !important;
}

.data-table__footer .btn-pagination:disabled {
  color: #7b8fb6 !important;
  background: #eef4ff !important;
  border-color: #d7e3ff !important;
}

.data-table__footer select,
.items-per-page select,
.data-table__footer option {
  color: var(--kyp-text) !important;
  background: #ffffff !important;
}

.form-control,
.form-select,
.ng-select-container,
input,
textarea,
select {
  background: #ffffff !important;
  color: var(--kyp-text) !important;
  border: 1px solid var(--kyp-border) !important;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: #7b8fb6 !important;
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus,
.ng-select.ng-select-focused .ng-select-container {
  border-color: var(--kyp-blue-800) !important;
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.2) !important;
  outline: none !important;
}

select option {
  background: #ffffff !important;
  color: var(--kyp-text) !important;
}

.btn-primary,
.btn-success,
.btn-info,
.btn-warning,
.btn-secondary {
  background: linear-gradient(90deg, var(--kyp-blue-800) 0%, var(--kyp-blue-700) 100%) !important;
  border-color: var(--kyp-blue-700) !important;
  color: #ffffff !important;
}

.btn-primary:hover,
.btn-success:hover,
.btn-info:hover,
.btn-warning:hover,
.btn-secondary:hover {
  background: linear-gradient(90deg, #163e9b 0%, #1d4ed8 100%) !important;
  border-color: #163e9b !important;
}

.btn-outline-success,
.btn-outline-info,
.btn-outline-warning,
.btn-outline-secondary {
  color: var(--kyp-blue-800) !important;
  border-color: var(--kyp-blue-800) !important;
  background: #ffffff !important;
}

.btn-outline-success:hover,
.btn-outline-info:hover,
.btn-outline-warning:hover,
.btn-outline-secondary:hover {
  background: var(--kyp-blue-800) !important;
  border-color: var(--kyp-blue-800) !important;
  color: #ffffff !important;
}

.page-item .page-link,
.pagination .page-link,
.btn-pagination {
  color: var(--kyp-blue-900) !important;
  background: #ffffff !important;
  border-color: var(--kyp-border) !important;
}

.page-item.active .page-link,
.pagination .active .page-link {
  color: #ffffff !important;
  background: var(--kyp-blue-800) !important;
  border-color: var(--kyp-blue-800) !important;
}

.page-item.disabled .page-link,
.pagination .disabled .page-link {
  color: #8aa0c5 !important;
  background: #f1f6ff !important;
}

/* Corrige textos escuros em blocos com fundo gradiente/escuro */
[style*="linear-gradient"],
[style*="linear-gradient"] *,
.hero,
.hero *,
.banner,
.banner * {
  color: #ffffff !important;
}

.swal2-popup,
.swal2-popup * {
  color: var(--kyp-text) !important;
}

.swal2-styled.swal2-confirm,
.swal2-confirm {
  background: var(--kyp-blue-800) !important;
  border-color: var(--kyp-blue-800) !important;
  color: #ffffff !important;
}

.swal2-styled.swal2-cancel,
.swal2-cancel {
  background: #eef4ff !important;
  border-color: #bfd4ff !important;
  color: #1e3a8a !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'],
.swal2-icon.swal2-success [class*=' swal2-success-line'] {
  background-color: var(--kyp-blue-800) !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(29, 78, 216, 0.35) !important;
}

a,
.text-primary,
.link-primary {
  color: var(--kyp-blue-800) !important;
}

/* Relatórios: visual mais premium sem alterar estrutura de menu */
.container-fluid.p-4 .nav.nav-tabs {
  border: none !important;
  gap: 0.5rem !important;
}

.container-fluid.p-4 .nav.nav-tabs .nav-link {
  border: 1px solid #cfe0ff !important;
  border-radius: 999px !important;
  background: #f7faff !important;
  color: #1d3f8f !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  transition: all 0.2s ease !important;
}

.container-fluid.p-4 .nav.nav-tabs .nav-link.active {
  border-color: transparent !important;
  color: #ffffff !important;
  background: linear-gradient(90deg, #1d4ed8 0%, #4f46e5 100%) !important;
  box-shadow: 0 10px 22px rgba(29, 78, 216, 0.3) !important;
}

.container-fluid.p-4 .card {
  border: 1px solid #d6e4ff !important;
  border-radius: 16px !important;
  box-shadow: 0 14px 34px rgba(18, 38, 98, 0.08) !important;
}

.container-fluid.p-4 .table thead th {
  background: #f2f7ff !important;
  color: #39527f !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  font-size: 0.78rem !important;
}

.container-fluid.p-4 .table tbody td {
  color: #0f2550 !important;
}

/* Rodapé institucional (evita quebra feia e mantém contraste) */
#platformFooter,
#platformFooter * {
  color: var(--kyp-text) !important;
}

#platformFooter .custom-copyright-mobile span {
  display: block !important;
  max-width: 560px !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  text-wrap: balance !important;
}

#platformFooter .custom-copyright-mobile {
  max-width: 560px !important;
}

@media (max-width: 768px) {
  #platformFooter .custom-copyright-mobile,
  #platformFooter .custom-copyright-mobile span {
    max-width: 100% !important;
  }
}
