/* ============================================================
   TEMA PERSONALIZADO - SISTEMA DE TESORERÍA
   H. Ayuntamiento de Martínez de la Torre 2026 - 2029
   ============================================================ */

:root {
  --tes-primary: #96242F;
  --tes-primary-dark: #7F1E29;
  --tes-primary-light: #AE2333;
  --tes-accent: #C72438;
  --tes-gold: #D1905D;
  --tes-dark: #221E1F;
  --tes-gray: #6E6668;
  --tes-light: #F8F3F1;
  --tes-white: #FFFFFF;

  --tes-primary-rgb: 150, 36, 47;
  --tes-accent-rgb: 199, 36, 56;
  --tes-gold-rgb: 209, 144, 93;
  --tes-dark-rgb: 34, 30, 31;
}

/* ============================================================
   BASE GENERAL
   ============================================================ */

.theme-tesoreria {
  background: var(--tes-light);
  color: var(--tes-dark);
}

.theme-tesoreria a {
  color: var(--tes-primary);
}

.theme-tesoreria a:hover {
  color: var(--tes-primary-dark);
}

.theme-tesoreria .text-primary {
  color: var(--tes-primary) !important;
}

.theme-tesoreria .text-success {
  color: var(--tes-primary-light) !important;
}

.theme-tesoreria .text-warning {
  color: var(--tes-gold) !important;
}

.theme-tesoreria .bg-primary {
  background-color: var(--tes-primary) !important;
}

.theme-tesoreria .bg-success {
  background-color: var(--tes-primary-light) !important;
}

.theme-tesoreria .bg-warning {
  background-color: var(--tes-gold) !important;
}

.theme-tesoreria .border-primary {
  border-color: var(--tes-primary) !important;
}

/* ============================================================
   BOTONES BOOTSTRAP / SKYDASH
   ============================================================ */

.theme-tesoreria .btn-primary,
.theme-tesoreria .auth form .auth-form-btn {
  background: linear-gradient(135deg, var(--tes-primary), var(--tes-accent)) !important;
  border-color: var(--tes-primary) !important;
  color: var(--tes-white) !important;
  box-shadow: 0 4px 12px rgba(var(--tes-primary-rgb), 0.25);
}

.theme-tesoreria .btn-primary:hover,
.theme-tesoreria .btn-primary:focus,
.theme-tesoreria .btn-primary:active,
.theme-tesoreria .auth form .auth-form-btn:hover,
.theme-tesoreria .auth form .auth-form-btn:focus {
  background: linear-gradient(135deg, var(--tes-primary-dark), var(--tes-primary)) !important;
  border-color: var(--tes-primary-dark) !important;
  color: var(--tes-white) !important;
  box-shadow: 0 6px 16px rgba(var(--tes-primary-rgb), 0.35);
}

.theme-tesoreria .btn-outline-primary {
  color: var(--tes-primary) !important;
  border-color: var(--tes-primary) !important;
}

.theme-tesoreria .btn-outline-primary:hover,
.theme-tesoreria .btn-outline-primary:focus {
  background-color: var(--tes-primary) !important;
  border-color: var(--tes-primary) !important;
  color: var(--tes-white) !important;
}

.theme-tesoreria .btn-secondary {
  background-color: var(--tes-dark) !important;
  border-color: var(--tes-dark) !important;
}

.theme-tesoreria .btn-warning {
  background-color: var(--tes-gold) !important;
  border-color: var(--tes-gold) !important;
  color: var(--tes-dark) !important;
}

.theme-tesoreria .btn-danger {
  background-color: var(--tes-accent) !important;
  border-color: var(--tes-accent) !important;
}

/* ============================================================
   LOGIN / AUTH
   ============================================================ */

.theme-tesoreria .content-wrapper.auth {
  background:
    radial-gradient(circle at top left, rgba(var(--tes-primary-rgb), 0.12), transparent 32%),
    radial-gradient(circle at bottom right, rgba(var(--tes-gold-rgb), 0.18), transparent 35%),
    var(--tes-light);
}

.theme-tesoreria .auth-form-light {
  border-radius: 20px;
  border-top: 5px solid var(--tes-primary);
  box-shadow: 0 14px 40px rgba(var(--tes-dark-rgb), 0.12);
}

.theme-tesoreria .auth .brand-logo img {
  width: 190px;
  max-height: 130px;
  object-fit: contain;
}

.theme-tesoreria .login-title {
  color: var(--tes-primary);
  font-weight: 800;
}

.theme-tesoreria .login-subtitle {
  color: var(--tes-gray);
}

.theme-tesoreria .system-footer {
  color: var(--tes-gray);
}

/* ============================================================
   NAVBAR HORIZONTAL SKYDASH
   Barra superior morada + barra inferior blanca
   ============================================================ */

.theme-tesoreria .horizontal-menu {
  background: transparent;
}

/* Barra superior */
.theme-tesoreria .horizontal-menu .top-navbar {
  background: var(--tes-primary) !important;
  min-height: 64px !important;
  box-shadow: none !important;
}

/* El contenedor de la barra superior debe ser transparente */
.theme-tesoreria .horizontal-menu .top-navbar .container,
.theme-tesoreria .horizontal-menu .top-navbar .container-fluid {
  background: transparent !important;
}

/* Logo y wrapper superior */
.theme-tesoreria .horizontal-menu .top-navbar .navbar-brand-wrapper,
.theme-tesoreria .horizontal-menu .top-navbar .navbar-menu-wrapper {
  background: transparent !important;
  min-height: 64px !important;
}

.theme-tesoreria .horizontal-menu .top-navbar .navbar-brand-wrapper {
  width: auto !important;
  min-width: auto !important;
}

.theme-tesoreria .horizontal-menu .top-navbar .navbar-brand-wrapper .navbar-brand {
  color: var(--tes-white) !important;
}

.theme-tesoreria .horizontal-menu .top-navbar .navbar-brand-wrapper .navbar-brand img {
  max-height: 42px !important;
  width: auto !important;
  object-fit: contain;
}

.theme-tesoreria .horizontal-menu .top-navbar .navbar-brand-wrapper .brand-logo-mini img {
  max-height: 38px !important;
  width: auto !important;
  object-fit: contain;
}

/* Buscador superior */
.theme-tesoreria .horizontal-menu .top-navbar .nav-search .input-group,
.theme-tesoreria .horizontal-menu .top-navbar .nav-search .input-group-prepend,
.theme-tesoreria .horizontal-menu .top-navbar .nav-search .input-group-text,
.theme-tesoreria .horizontal-menu .top-navbar .nav-search .form-control {
  background: transparent !important;
  border: 0 !important;
}

.theme-tesoreria .horizontal-menu .top-navbar .nav-search .form-control {
  color: var(--tes-white) !important;
  box-shadow: none !important;
}

.theme-tesoreria .horizontal-menu .top-navbar .nav-search .form-control::placeholder {
  color: rgba(255, 255, 255, 0.9) !important;
}

.theme-tesoreria .horizontal-menu .top-navbar .nav-search i,
.theme-tesoreria .horizontal-menu .top-navbar .nav-search .input-group-text,
.theme-tesoreria .horizontal-menu .top-navbar .nav-link i {
  color: var(--tes-white) !important;
}

/* Usuario / notificaciones */
.theme-tesoreria .horizontal-menu .top-navbar .navbar-nav .nav-item .nav-link {
  color: var(--tes-white) !important;
}

.theme-tesoreria .horizontal-menu .top-navbar .navbar-nav .nav-item .nav-link:hover,
.theme-tesoreria .horizontal-menu .top-navbar .navbar-nav .nav-item .nav-link:focus {
  color: var(--tes-white) !important;
}

.theme-tesoreria .horizontal-menu .top-navbar .nav-profile img {
  width: 40px !important;
  height: 40px !important;
  object-fit: cover;
}

/* Dropdowns del navbar superior */
.theme-tesoreria .horizontal-menu .top-navbar .dropdown-menu {
  border: 0;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(var(--tes-dark-rgb), 0.14);
}

.theme-tesoreria .horizontal-menu .top-navbar .dropdown-item {
  color: var(--tes-dark) !important;
}

.theme-tesoreria .horizontal-menu .top-navbar .dropdown-item:hover {
  background: rgba(var(--tes-primary-rgb), 0.08);
  color: var(--tes-primary) !important;
}

/* Barra inferior del menú */
.theme-tesoreria .horizontal-menu .bottom-navbar {
  display: block !important;
  background: var(--tes-white) !important;
  box-shadow: 0 4px 10px rgba(var(--tes-dark-rgb), 0.04) !important;
}

.theme-tesoreria .horizontal-menu .bottom-navbar .container,
.theme-tesoreria .horizontal-menu .bottom-navbar .container-fluid {
  background: var(--tes-white) !important;
}

.theme-tesoreria .horizontal-menu .bottom-navbar .page-navigation {
  justify-content: flex-start;
}

/* Menú principal inferior */
.theme-tesoreria .horizontal-menu .bottom-navbar .page-navigation > .nav-item > .nav-link {
  color: var(--tes-dark) !important;
  font-weight: 500;
}

.theme-tesoreria .horizontal-menu .bottom-navbar .page-navigation > .nav-item > .nav-link .menu-icon {
  color: var(--tes-primary) !important;
}

.theme-tesoreria .horizontal-menu .bottom-navbar .page-navigation > .nav-item.active > .nav-link,
.theme-tesoreria .horizontal-menu .bottom-navbar .page-navigation > .nav-item > .nav-link:hover {
  color: var(--tes-primary) !important;
}

.theme-tesoreria .horizontal-menu .bottom-navbar .page-navigation > .nav-item.active > .nav-link .menu-icon,
.theme-tesoreria .horizontal-menu .bottom-navbar .page-navigation > .nav-item > .nav-link:hover .menu-icon {
  color: var(--tes-primary) !important;
}

/* Submenús inferiores */
.theme-tesoreria .horizontal-menu .bottom-navbar .page-navigation > .nav-item .submenu {
  border: 0;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 12px 28px rgba(var(--tes-dark-rgb), 0.12);
}

.theme-tesoreria .horizontal-menu .bottom-navbar .page-navigation > .nav-item .submenu .nav-link {
  color: var(--tes-dark) !important;
}

.theme-tesoreria .horizontal-menu .bottom-navbar .page-navigation > .nav-item .submenu .nav-link:hover,
.theme-tesoreria .horizontal-menu .bottom-navbar .page-navigation > .nav-item .submenu .nav-link.active {
  color: var(--tes-primary) !important;
}

/* Oculta cualquier menú custom de una sola barra si quedó en HTML anterior */
.theme-tesoreria .tes-navbar-menu,
.theme-tesoreria .tes-navbar-menu-mobile {
  display: none !important;
}

/* ============================================================
   SIDEBAR / MENÚ VERTICAL
   Se deja por compatibilidad si alguna vista lo llegara a usar.
   ============================================================ */

.theme-tesoreria .sidebar {
  background: var(--tes-white);
}

.theme-tesoreria .sidebar .nav .nav-item .nav-link {
  color: var(--tes-dark);
}

.theme-tesoreria .sidebar .nav .nav-item .nav-link i,
.theme-tesoreria .sidebar .nav .nav-item .nav-link .menu-icon {
  color: var(--tes-gray);
}

.theme-tesoreria .sidebar .nav .nav-item.active > .nav-link,
.theme-tesoreria .sidebar .nav .nav-item:hover > .nav-link {
  background: rgba(var(--tes-primary-rgb), 0.08);
  color: var(--tes-primary);
}

.theme-tesoreria .sidebar .nav .nav-item.active > .nav-link i,
.theme-tesoreria .sidebar .nav .nav-item.active > .nav-link .menu-icon,
.theme-tesoreria .sidebar .nav .nav-item:hover > .nav-link i,
.theme-tesoreria .sidebar .nav .nav-item:hover > .nav-link .menu-icon {
  color: var(--tes-primary);
}

.theme-tesoreria .sidebar .nav.sub-menu .nav-item .nav-link.active {
  color: var(--tes-primary);
}

/* ============================================================
   CARDS / CONTENEDORES
   ============================================================ */

.theme-tesoreria .card {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(var(--tes-dark-rgb), 0.06);
}

.theme-tesoreria .card .card-title {
  color: var(--tes-primary);
  font-weight: 700;
}

.theme-tesoreria .card-header {
  background: var(--tes-white);
  border-bottom: 1px solid rgba(var(--tes-primary-rgb), 0.10);
}

/* Tarjetas Skydash adaptadas */
.theme-tesoreria .card-tale,
.theme-tesoreria .data-icon-card-primary {
  background: linear-gradient(135deg, var(--tes-primary), var(--tes-accent)) !important;
}

.theme-tesoreria .card-dark-blue {
  background: linear-gradient(135deg, var(--tes-dark), #3b3133) !important;
}

.theme-tesoreria .card-light-blue {
  background: linear-gradient(135deg, var(--tes-gold), #e3aa78) !important;
}

.theme-tesoreria .card-light-danger {
  background: linear-gradient(135deg, var(--tes-accent), var(--tes-primary-dark)) !important;
}

/* ============================================================
   BADGES / ESTATUS
   ============================================================ */

.theme-tesoreria .badge-primary,
.theme-tesoreria .badge.bg-primary {
  background-color: var(--tes-primary) !important;
  color: var(--tes-white) !important;
}

.theme-tesoreria .badge-warning,
.theme-tesoreria .badge.bg-warning {
  background-color: var(--tes-gold) !important;
  color: var(--tes-dark) !important;
}

.theme-tesoreria .badge-danger,
.theme-tesoreria .badge.bg-danger {
  background-color: var(--tes-accent) !important;
}

.theme-tesoreria .badge-dark,
.theme-tesoreria .badge.bg-dark {
  background-color: var(--tes-dark) !important;
}

/* Estatus propios para órdenes de pago */
.theme-tesoreria .badge-borrador {
  background-color: #6c757d;
  color: #fff;
}

.theme-tesoreria .badge-generada {
  background-color: var(--tes-primary);
  color: #fff;
}

.theme-tesoreria .badge-autorizada {
  background-color: #198754;
  color: #fff;
}

.theme-tesoreria .badge-cancelada {
  background-color: var(--tes-accent);
  color: #fff;
}

.theme-tesoreria .badge-pagada {
  background-color: var(--tes-gold);
  color: var(--tes-dark);
}

/* ============================================================
   DATATABLES
   ============================================================ */

.theme-tesoreria table.dataTable thead th {
  background-color: var(--tes-primary);
  color: var(--tes-white);
  border-color: var(--tes-primary-dark);
}

.theme-tesoreria table.dataTable tbody tr:hover {
  background-color: rgba(var(--tes-primary-rgb), 0.04);
}

.theme-tesoreria .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.theme-tesoreria .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--tes-primary) !important;
  border-color: var(--tes-primary) !important;
  color: var(--tes-white) !important;
}

.theme-tesoreria .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: rgba(var(--tes-primary-rgb), 0.12) !important;
  border-color: rgba(var(--tes-primary-rgb), 0.25) !important;
  color: var(--tes-primary) !important;
}

.theme-tesoreria .page-item.active .page-link {
  background-color: var(--tes-primary) !important;
  border-color: var(--tes-primary) !important;
}

.theme-tesoreria .page-link {
  color: var(--tes-primary);
}

.theme-tesoreria .page-link:hover {
  color: var(--tes-primary-dark);
}

/* ============================================================
   MODALES
   ============================================================ */

.theme-tesoreria .modal-content {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(var(--tes-dark-rgb), 0.18);
}

.theme-tesoreria .modal-header {
  background: linear-gradient(135deg, var(--tes-primary), var(--tes-accent));
  color: var(--tes-white);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
}

.theme-tesoreria .modal-header .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.theme-tesoreria .modal-title {
  color: var(--tes-white);
  font-weight: 700;
}

/* ============================================================
   SWEETALERT ORIGINAL
   ============================================================ */

.theme-tesoreria .swal-button {
  border-radius: 8px;
}

.theme-tesoreria .swal-button--confirm {
  background-color: var(--tes-primary);
}

.theme-tesoreria .swal-button--confirm:hover {
  background-color: var(--tes-primary-dark) !important;
}

.theme-tesoreria .swal-button--danger {
  background-color: var(--tes-accent);
}

.theme-tesoreria .swal-button--danger:hover {
  background-color: var(--tes-primary-dark) !important;
}

.theme-tesoreria .swal-title {
  color: var(--tes-dark);
}

.theme-tesoreria .swal-icon--warning {
  border-color: var(--tes-gold);
}

.theme-tesoreria .swal-icon--warning__body,
.theme-tesoreria .swal-icon--warning__dot {
  background-color: var(--tes-gold);
}

/* ============================================================
   TOASTR
   ============================================================ */

.theme-tesoreria #toast-container > .toast-success {
  background-color: var(--tes-primary);
}

.theme-tesoreria #toast-container > .toast-error {
  background-color: var(--tes-accent);
}

.theme-tesoreria #toast-container > .toast-warning {
  background-color: var(--tes-gold);
  color: var(--tes-dark);
}

.theme-tesoreria #toast-container > .toast-info {
  background-color: var(--tes-dark);
}

/* ============================================================
   FORMULARIOS
   ============================================================ */

.theme-tesoreria label {
  color: var(--tes-dark);
  font-weight: 600;
}

.theme-tesoreria .form-control,
.theme-tesoreria .form-select {
  border-radius: 10px;
}

.theme-tesoreria .form-control:focus,
.theme-tesoreria .form-select:focus {
  border-color: var(--tes-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(var(--tes-primary-rgb), 0.15) !important;
}

.theme-tesoreria .input-group .btn-outline-secondary {
  border-color: #ced4da;
  color: var(--tes-primary);
}

.theme-tesoreria .input-group .btn-outline-secondary:hover {
  background-color: var(--tes-primary);
  border-color: var(--tes-primary);
  color: var(--tes-white);
}

.theme-tesoreria .form-check-input:checked {
  background-color: var(--tes-primary);
  border-color: var(--tes-primary);
}

/* ============================================================
   DROPDOWNS
   ============================================================ */

.theme-tesoreria .dropdown-item.active,
.theme-tesoreria .dropdown-item:active {
  background-color: var(--tes-primary);
  color: var(--tes-white);
}

.theme-tesoreria .dropdown-item:hover {
  background-color: rgba(var(--tes-primary-rgb), 0.08);
  color: var(--tes-primary);
}

/* ============================================================
   UTILIDADES PROPIAS
   ============================================================ */

.theme-tesoreria .tes-text-primary {
  color: var(--tes-primary) !important;
}

.theme-tesoreria .tes-bg-primary {
  background-color: var(--tes-primary) !important;
  color: var(--tes-white) !important;
}

.theme-tesoreria .tes-bg-gradient {
  background: linear-gradient(135deg, var(--tes-primary), var(--tes-accent)) !important;
  color: var(--tes-white) !important;
}

.theme-tesoreria .tes-border-left {
  border-left: 5px solid var(--tes-primary) !important;
}

.theme-tesoreria .tes-border-gold {
  border-color: var(--tes-gold) !important;
}

.theme-tesoreria .tes-shadow {
  box-shadow: 0 8px 22px rgba(var(--tes-dark-rgb), 0.10) !important;
}

/* ============================================================
   FONT AWESOME 7 - MENÚ HORIZONTAL
   No usar .menu-icon porque Skydash lo sobreescribe
   ============================================================ */

.theme-tesoreria .horizontal-menu .bottom-navbar .page-navigation > .nav-item > .nav-link .tes-menu-icon {
  font-size: 17px;
  width: 24px;
  min-width: 24px;
  margin-right: 10px;
  text-align: center;
  line-height: 1;
  color: var(--tes-primary) !important;
}

.theme-tesoreria .horizontal-menu .bottom-navbar .page-navigation > .nav-item.active > .nav-link .tes-menu-icon,
.theme-tesoreria .horizontal-menu .bottom-navbar .page-navigation > .nav-item:hover > .nav-link .tes-menu-icon {
  color: var(--tes-primary-dark) !important;
}

/* Modal visor encima del modal de comprobantes */
#modalVisorComprobante {
  z-index: 1085 !important;
}

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

/* ============================================================
   TOASTR / ALERTAS DEL SISTEMA
   ============================================================ */

.toast-success {
  background-color: #198754 !important;
  color: #ffffff !important;
}

.toast-warning {
  background-color: #ffc107 !important;
  color: #212529 !important;
}

.toast-error {
  background-color: #dc3545 !important;
  color: #ffffff !important;
}

.toast-info {
  background-color: #0d6efd !important;
  color: #ffffff !important;
}

/* Títulos y mensajes */
#toast-container > div {
  opacity: 1 !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18) !important;
  font-size: 14px !important;
}

#toast-container > div.toast-success {
  border-left: 5px solid #0f5132 !important;
}

#toast-container > div.toast-warning {
  border-left: 5px solid #cc9a06 !important;
}

#toast-container > div.toast-error {
  border-left: 5px solid #842029 !important;
}

#toast-container > div.toast-info {
  border-left: 5px solid #084298 !important;
}

.toast-title {
  font-weight: 700 !important;
}

.toast-message {
  font-weight: 400 !important;
}

/* ============================================================
   SELECT2 - AJUSTE VISUAL EN MODALES
   ============================================================ */

.select2-container {
  width: 100% !important;
}

.select2-container--default .select2-selection--single {
  height: 56px !important;
  min-height: 56px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 12px !important;
  background-color: #ffffff !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #212529 !important;
  line-height: normal !important;
  padding-left: 0 !important;
  padding-right: 28px !important;
  width: 100% !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #9ca3af !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 56px !important;
  right: 10px !important;
  top: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
  position: absolute !important;
  right: 34px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin-right: 0 !important;
  font-size: 18px !important;
  color: #333 !important;
}

.select2-dropdown {
  border: 1px solid #d1d5db !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  z-index: 20000 !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
}

.select2-container--default .select2-results__option {
  padding: 9px 12px !important;
}

.modal .form-control,
.modal .form-select {
  min-height: 56px;
  border-radius: 10px;
}

.page-ordenes-pago .filtro-ordenes-select {
  min-width: 185px;
  max-width: 220px;
  height: 32px;
  padding-top: 3px;
  padding-bottom: 3px;
}

.page-ordenes-pago #bloqueFiltrosOrdenes label {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .page-ordenes-pago #bloqueFiltrosOrdenes {
    justify-content: flex-start !important;
  }

  .page-ordenes-pago .filtro-ordenes-select {
    min-width: 180px;
    max-width: 100%;
  }
}

.page-ordenes-pago .badge-egresos,
.badge-egresos {
  background-color: #d99a2b !important;
  color: #2b1b00 !important;
  border: 1px solid #b87916 !important;
  font-weight: 700 !important;
  padding: 6px 10px !important;
  border-radius: 999px !important;
  opacity: 1 !important;
  display: inline-block !important;
  min-width: 70px;
  text-align: center;
}