.documents-grouped-list {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.documents-group-header {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem 1.2rem;
  border-radius: 16px;
  background: var(--surface-soft-alt);
  border: 1px solid var(--surface-border);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.documents-group-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  color: var(--text-dark);
}

.group-title {
  font-size: 0.95rem;
}

.group-code {
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  color: var(--text-dark);
}

.group-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.72rem;
  color: var(--text-gray);
}

.group-meta i {
  margin-right: 0.35rem;
  opacity: 0.7;
}

.group-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--primary-blue-dark);
}

.group-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
}

.doc-card {
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-border);
  box-shadow: var(--surface-shadow-soft);
  overflow: hidden;
}

.doc-card+.doc-card {
  margin-top: 0.75rem;
}

.doc-card-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
  padding: 0.85rem 1.05rem;
  background: var(--surface-soft-alt);
  align-items: center;
  cursor: pointer;
}

.doc-card-summary .doc-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-gray);
}

.doc-card-summary strong {
  font-size: 0.92rem;
}

.doc-toggle {
  justify-self: end;
  border: none;
  background: rgba(33, 150, 243, 0.16);
  color: var(--primary-blue-dark);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.doc-card-body {
  display: none;
  padding: 0.85rem 1.05rem 1.1rem;
}

.doc-card.open .doc-card-body {
  display: block;
}

.doc-body-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
}

.doc-field-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-gray);
  margin-bottom: 0.2rem;
}


#paymentsTable thead th {
  text-align: center;
}

/* Forzar siempre modo claro - deshabilitar modo oscuro */
html,
html[data-theme="light"] {
  --primary-blue: #1E88E5 !important;
  --primary-blue-light: #42A5F5 !important;
  --primary-blue-dark: #1565C0 !important;
  --gradient-start: #2196F3 !important;
  --gradient-end: #0D47A1 !important;
  --sidebar-blue: #1b5fbb !important;
  --sidebar-gradient-start: #1f6fe2 !important;
  --sidebar-gradient-mid: #164dac !important;
  --sidebar-gradient-end: #0f387f !important;
  --header-blue: #1565C0 !important;
  --background-light: #F8F6F2 !important;
  --background-light-gray: #ECE7E0 !important;
  --text-dark: #212121 !important;
  --text-gray: #757575 !important;
  --text-secondary: #6c757d !important;
  --border-light: #E0E0E0 !important;
  --accent-red: #F44336 !important;
  --accent-red-orange: #FF5722 !important;
  --white: #FFFFFF !important;
  --hover-overlay: rgba(255, 255, 255, 0.15) !important;
  --surface-soft: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 248, 255, 0.98) 100%) !important;
  --surface-soft-alt: linear-gradient(145deg, rgba(250, 252, 255, 0.96) 0%, rgba(240, 244, 255, 0.96) 100%) !important;
  --surface-border: rgba(13, 71, 161, 0.08) !important;
  --surface-border-strong: rgba(21, 101, 192, 0.16) !important;
  --surface-shadow: 0 24px 48px rgba(13, 71, 161, 0.12) !important;
  --surface-shadow-soft: 0 12px 26px rgba(13, 71, 161, 0.12) !important;
}

:root {
  /* Colores modo claro */
  --primary-blue: #1E88E5;
  --primary-blue-light: #42A5F5;
  --primary-blue-dark: #1565C0;
  --gradient-start: #2196F3;
  --gradient-end: #0D47A1;
  --sidebar-blue: #1b5fbb;
  --sidebar-gradient-start: #1f6fe2;
  --sidebar-gradient-mid: #164dac;
  --sidebar-gradient-end: #0f387f;
  --header-blue: #1565C0;
  --background-light: #F8F6F2;
  --background-light-gray: #ECE7E0;
  --text-dark: #212121;
  --text-gray: #757575;
  --text-secondary: #6c757d;
  /* Gris para modo claro - NO usar text-muted */
  --border-light: #E0E0E0;
  --accent-red: #F44336;
  --accent-red-orange: #FF5722;
  --white: #FFFFFF;
  --hover-overlay: rgba(255, 255, 255, 0.15);
  --surface-soft: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 248, 255, 0.98) 100%);
  --surface-soft-alt: linear-gradient(145deg, rgba(250, 252, 255, 0.96) 0%, rgba(240, 244, 255, 0.96) 100%);
  --surface-border: rgba(13, 71, 161, 0.08);
  --surface-border-strong: rgba(21, 101, 192, 0.16);
  --surface-shadow: 0 24px 48px rgba(13, 71, 161, 0.12);
  --surface-shadow-soft: 0 12px 26px rgba(13, 71, 161, 0.12);
}

.custom-swal-confirm,
.custom-swal-cancel {
  min-width: 120px;
  margin: 0 0.25rem;
}

.custom-swal-cancel {
  order: 0;
}

.custom-swal-confirm {
  order: 1;
}

/* Icono de calendario oscuro en inputs de fecha */
input[type="date"].date-dark-icon::-webkit-calendar-picker-indicator {
  filter: invert(0);
  opacity: 1;
}

input[type="date"].date-dark-icon::-moz-focus-inner {
  color: black;
}


/* Clase personalizada para texto secundario adaptativo - NO usar text-muted */
.text-secondary-adaptive {
  color: var(--text-secondary) !important;
}

/* Ocultar contador de registros en DataTables */
.dataTables_info {
  display: none !important;
}

/* Configuración estándar para DataTables */
.dataTables_wrapper .dataTables_length {
  display: none !important;
}

.dataTables_wrapper .dataTables_paginate {
  margin-top: 1rem;
}

.dataTables_wrapper .dataTables_filter {
  margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_filter input {
  border-radius: 8px;
  border: 1px solid var(--surface-border);
  padding: 0.5rem 0.75rem;
  background: var(--surface-soft-alt);
  color: var(--text-dark);
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary-blue-light);
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(66, 165, 245, 0.2);
}


/* Estilos uniformes para tablas DataTables */
table.dataTable {
  width: 100% !important;
  margin: 0 !important;
}

table.dataTable thead th {
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.15) 0%, rgba(21, 101, 192, 0.12) 100%);
  border-bottom: 3px solid rgba(30, 136, 229, 0.3);
  font-weight: 700;
  color: var(--primary-blue-dark);
  border-top: none;
  padding: 1rem 0.75rem;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  position: relative;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
  position: relative;
  padding-right: 2rem;
}

table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after {
  content: '';
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

table.dataTable thead th.sorting:after {
  border-top: 6px solid var(--primary-blue);
  border-bottom: none;
  opacity: 0.5;
}

table.dataTable thead th.sorting_asc:after {
  border-bottom: 6px solid var(--primary-blue-dark);
  border-top: none;
}

table.dataTable thead th.sorting_desc:after {
  border-top: 6px solid var(--primary-blue-dark);
  border-bottom: none;
}

table.dataTable thead th:hover {
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.25) 0%, rgba(21, 101, 192, 0.2) 100%);
}


table.dataTable tbody td {
  vertical-align: middle;
  border-color: rgba(30, 136, 229, 0.1);
  padding: 1rem 0.75rem;
  text-align: center;
}

table.dataTable tbody tr {
  transition: all 0.2s ease;
  border-bottom: 2px solid rgba(66, 165, 245, 0.3);
}

table.dataTable tbody tr:nth-child(even) {
  background: rgba(30, 136, 229, 0.03);
}

table.dataTable tbody tr:hover {
  background: linear-gradient(90deg, rgba(66, 165, 245, 0.15) 0%, rgba(30, 136, 229, 0.12) 100%);
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.1);
}


/* Botones de acciones en DataTables */
table.dataTable .btn-group {
  display: inline-flex;
  gap: 0.5rem;
  justify-content: center;
}

table.dataTable .btn-group .btn {
  min-width: 38px;
  height: 38px;
  padding: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px !important;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

table.dataTable .btn-group .btn:first-child {
  border-top-left-radius: 12px !important;
  border-top-right-radius: 12px !important;
  border-bottom-left-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
}

table.dataTable .btn-group .btn:last-child {
  border-top-left-radius: 12px !important;
  border-top-right-radius: 12px !important;
  border-bottom-left-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
}

table.dataTable .btn-group .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ==================== ESTILOS PARA BOTONES DE BOOTSTRAP ==================== */

/* Base para todos los botones de Bootstrap */
.btn {
  border-radius: 8px !important;
  padding: 0.625rem 1.25rem !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: 2px solid transparent !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  cursor: pointer !important;
  text-decoration: none !important;
  position: relative !important;
  overflow: hidden !important;
  letter-spacing: 0.02em !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
}

.btn:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
}

.btn:focus {
  outline: none !important;
  box-shadow: 0 0 0 0.25rem rgba(66, 165, 245, 0.25) !important;
}

/* Botón Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%) !important;
  color: var(--white) !important;
  border-color: var(--primary-blue-dark) !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-blue-light) 0%, var(--primary-blue) 100%) !important;
  border-color: var(--primary-blue-light) !important;
  color: var(--white) !important;
}

.btn-primary:active,
.btn-primary.active {
  background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue) 100%) !important;
  border-color: var(--primary-blue-dark) !important;
}

.btn-primary:disabled {
  background: linear-gradient(135deg, rgba(66, 165, 245, 0.5) 0%, rgba(30, 136, 229, 0.5) 100%) !important;
  border-color: rgba(66, 165, 245, 0.3) !important;
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

/* Botón Secondary */
.btn-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
  color: var(--white) !important;
  border-color: #5a6268 !important;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #7a8288 0%, #6c757d 100%) !important;
  border-color: #7a8288 !important;
  color: var(--white) !important;
}

.btn-secondary:active,
.btn-secondary.active {
  background: linear-gradient(135deg, #5a6268 0%, #6c757d 100%) !important;
}

/* Botón Success */
.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%) !important;
  color: var(--white) !important;
  border-color: #1e7e34 !important;
}

.btn-success:hover {
  background: linear-gradient(135deg, #34ce57 0%, #28a745 100%) !important;
  border-color: #34ce57 !important;
  color: var(--white) !important;
}

/* Botón Danger */
.btn-danger {
  background: linear-gradient(135deg, var(--accent-red) 0%, #c62828 100%) !important;
  color: var(--white) !important;
  border-color: #c62828 !important;
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--accent-red-orange) 0%, var(--accent-red) 100%) !important;
  border-color: var(--accent-red-orange) !important;
  color: var(--white) !important;
}

/* Botón Warning */
.btn-warning {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
  color: #212529 !important;
  border-color: #e0a800 !important;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #ffcd39 0%, #ffc107 100%) !important;
  border-color: #ffcd39 !important;
  color: #212529 !important;
}

/* Botón Info */
.btn-info {
  background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%) !important;
  color: var(--white) !important;
  border-color: #117a8b !important;
}

.btn-info:hover {
  background: linear-gradient(135deg, #3fc1d8 0%, #17a2b8 100%) !important;
  border-color: #3fc1d8 !important;
  color: var(--white) !important;
}

/* Botones Outline */
.btn-outline-primary {
  background: transparent !important;
  color: var(--primary-blue) !important;
  border-color: var(--primary-blue) !important;
  border-width: 2px !important;
}

.btn-outline-primary:hover {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%) !important;
  color: var(--white) !important;
  border-color: var(--primary-blue-dark) !important;
}

.btn-outline-secondary {
  background: transparent !important;
  color: #6c757d !important;
  border-color: #6c757d !important;
  border-width: 2px !important;
}

.btn-outline-secondary:hover {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
  color: var(--white) !important;
  border-color: #5a6268 !important;
}

.btn-outline-success {
  background: transparent !important;
  color: #28a745 !important;
  border-color: #28a745 !important;
  border-width: 2px !important;
}

.btn-outline-success:hover {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%) !important;
  color: var(--white) !important;
  border-color: #1e7e34 !important;
}

.btn-outline-danger {
  background: transparent !important;
  color: var(--accent-red) !important;
  border-color: var(--accent-red) !important;
  border-width: 2px !important;
}

.btn-outline-danger:hover {
  background: linear-gradient(135deg, var(--accent-red) 0%, #c62828 100%) !important;
  color: var(--white) !important;
  border-color: #c62828 !important;
}

.btn-outline-warning {
  background: transparent !important;
  color: #ffc107 !important;
  border-color: #ffc107 !important;
  border-width: 2px !important;
}

.btn-outline-warning:hover {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
  color: #212529 !important;
  border-color: #e0a800 !important;
}

.btn-outline-info {
  background: transparent !important;
  color: #17a2b8 !important;
  border-color: #17a2b8 !important;
  border-width: 2px !important;
}

.btn-outline-info:hover {
  background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%) !important;
  color: var(--white) !important;
  border-color: #117a8b !important;
}

/* Tamaños de botones */
.btn-sm {
  padding: 0.4rem 0.8rem !important;
  font-size: 0.8rem !important;
  border-radius: 6px !important;
}

.btn-lg {
  padding: 0.875rem 1.75rem !important;
  font-size: 1.1rem !important;
  border-radius: 10px !important;
}

/* Botones con iconos */
.btn i {
  font-size: 1em;
  line-height: 1;
}

.btn-sm i {
  font-size: 0.85em;
}

.btn-lg i {
  font-size: 1.2em;
}


/* Botones en grupos */
.btn-group .btn {
  border-radius: 0 !important;
  margin: 0 !important;
}

.btn-group .btn:first-child {
  border-top-left-radius: 8px !important;
  border-bottom-left-radius: 8px !important;
}

.btn-group .btn:last-child {
  border-top-right-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
}

.btn-group .btn:not(:first-child) {
  border-left: none !important;
}

.btn-group .btn:hover {
  z-index: 1;
  position: relative;
}

/* Paginación DataTables */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 8px;
  margin: 0 0.25rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--surface-border);
  background: var(--surface-soft-alt);
  color: var(--text-dark);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--primary-blue);
  color: var(--white);
  border-color: var(--primary-blue);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary-blue-dark);
  color: var(--white);
  border-color: var(--primary-blue-dark);
}


html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--background-light);
  color: var(--text-dark);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Header con color sólido */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: var(--header-blue);
  color: var(--white);
  padding: 0 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.app-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
  gap: 1.5rem;
}

.app-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

/* Logo 77app: blanco sobre header azul (si el SVG es negro, filter lo invierte) */
.app-logo .app-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.user-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}

.user-summary-name {
  font-weight: 600;
  color: var(--white);
}

.user-summary-role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
}

.theme-toggle {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.7);
}

.theme-toggle:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.9);
}

.user-profile-btn {
  background: linear-gradient(135deg, rgba(19, 71, 152, 0.9), rgba(13, 46, 100, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0 0.6rem 0 0.5rem;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--white);
  transition: all 0.3s ease;
  font-size: 1rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.user-profile-btn i {
  font-size: 1.1rem;
}

.user-profile-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2));
}

.user-profile-avatar {
  background: radial-gradient(circle at top left, #ff9c52, #ff6b3d);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
}

.user-profile-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.user-profile-name {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-role {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.85);
}

.user-profile-arrow {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.user-profile-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.7);
}

/* Menú lateral */
.sidebar {
  display: none;
}

.sidebar.collapsed {
  width: 70px;
  overflow-y: auto;
  overflow-x: visible;
}

.sidebar.collapsed .sidebar-menu>li>a>span,
.sidebar.collapsed .sidebar-icon-submenu {
  display: none;
}

.sidebar.collapsed .menu-item-has-children.active .submenu {
  display: flex !important;
  flex-direction: column;
  max-height: none !important;
  overflow: visible !important;
  padding: 0.5rem;
  background-color: #ffffff;
  border-radius: 8px;
  margin: 0;
  position: fixed;
  width: 200px;
  left: 70px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.5);
  z-index: 10000;
}

.sidebar.collapsed .submenu li {
  width: 100%;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: block;
}

.sidebar.collapsed .submenu li:last-child {
  border-bottom: none;
}

.sidebar.collapsed .sidebar-menu a {
  justify-content: center;
  padding: 1rem;
  position: relative;
}

.sidebar.collapsed .sidebar-menu a:hover {
  padding-left: 1rem;
}

.sidebar.collapsed .sidebar-icon {
  margin-right: 0;
}

.sidebar.collapsed .submenu-link {
  padding: 0.75rem !important;
  justify-content: flex-start;
  width: 100%;
  height: auto;
  position: relative;
  background-color: var(--white);
  border-radius: 8px;
  transition: all 0.3s ease;
  margin-bottom: 0.25rem;
  color: var(--sidebar-blue);
}

.sidebar.collapsed .submenu-link:hover {
  background-color: var(--primary-blue-dark);
  transform: scale(1.05);
  color: var(--white);
}

.sidebar.collapsed .submenu-link:last-child {
  margin-bottom: 0;
}

.sidebar.collapsed .submenu-link .submenu-icon {
  margin-right: 0.5rem;
  color: var(--sidebar-blue);
}

.sidebar.collapsed .submenu-link:hover .submenu-icon {
  color: var(--white);
}

.sidebar.collapsed .submenu-link span {
  color: inherit;
  display: inline !important;
}

.sidebar.collapsed .menu-item-toggle {
  justify-content: center;
  padding: 1rem;
  position: relative;
}

.sidebar.collapsed .menu-item-toggle:hover {
  padding-left: 1rem;
}

/* Tooltips para menú colapsado */
.sidebar.collapsed .sidebar-menu a:hover::after,
.sidebar.collapsed .menu-item-toggle:hover::after {
  content: attr(data-title);
  position: absolute;
  left: 80px;
  background-color: #1a1a1a;
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  z-index: 10000;
  font-size: 0.875rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

.sidebar.collapsed .submenu-link:hover::after {
  display: none !important;
}

.sidebar.collapsed .submenu-link:hover::before {
  display: none !important;
}

.sidebar.collapsed .sidebar-menu a[data-title=""]:hover::after,
.sidebar.collapsed .menu-item-toggle[data-title=""]:hover::after,
.sidebar.collapsed .submenu-link[data-title=""]:hover::after,
.sidebar.collapsed .menu-toggle-collapse:hover::after {
  display: none;
}

/* Botón de colapsar */
.collapsed-toggle-item {
  margin-top: auto;
  border-top: 2px solid rgba(255, 255, 255, 0.2);
  border-bottom: none !important;
}

.menu-toggle-collapse {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  color: var(--white);
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  font-weight: 500;
  position: relative;
  background-color: rgba(255, 255, 255, 0.05);
}

.menu-toggle-collapse:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

.sidebar.collapsed .menu-toggle-collapse .fa-angle-left {
  transform: rotate(180deg);
}

.sidebar.collapsed .menu-toggle-collapse span {
  display: none !important;
}

.sidebar.collapsed .menu-toggle-collapse {
  padding: 1rem;
}

.sidebar.collapsed .menu-toggle-collapse:hover {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 1rem;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-menu li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 0.7rem 1.4rem;
  color: var(--white);
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
  background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-menu a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding-left: 1.8rem;
}

.sidebar-menu span {
  color: var(--white);
}

.sidebar-menu i {
  color: var(--white);
}

.sidebar-menu a.active {
  background-color: rgba(255, 255, 255, 0.3);
  color: var(--white);
  font-weight: 600;
  border-left: 4px solid var(--white);
  box-shadow: inset 4px 0 0 var(--white);
}

.sidebar-icon {
  margin-right: 0.75rem;
  font-size: 1.2rem;
  width: 20px;
  text-align: center;
}

/* Submenú */
.menu-item-has-children {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.menu-item-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  color: var(--white);
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  font-weight: 500;
  background-color: rgba(255, 255, 255, 0.05);
}

.menu-item-toggle:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

.menu-item-has-children.active .menu-item-toggle {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-weight: 500;
}

/* Cuando hay un submenu-link activo, el toggle del padre NO debe verse seleccionado */
.menu-item-has-children.active:has(.submenu-link.active) .menu-item-toggle {
  background-color: rgba(255, 255, 255, 0.1) !important;
  font-weight: 500 !important;
}

/* Solo el submenu-link activo debe verse seleccionado */
.submenu-link.active {
  background-color: var(--primary-blue-dark) !important;
  color: var(--white) !important;
  padding-left: 2.5rem !important;
  font-weight: 600 !important;
  border-left: 3px solid var(--white) !important;
  box-shadow: inset 3px 0 0 var(--white) !important;
}

.sidebar-icon-submenu {
  margin-left: auto;
  margin-right: 0;
  transition: transform 0.3s ease;
  font-size: 0.875rem;
}

.menu-item-has-children.active .sidebar-icon-submenu {
  transform: rotate(180deg);
}

.submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: rgba(255, 255, 255, 0.08);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.menu-item-has-children.active .submenu {
  max-height: 500px;
}

.submenu li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.submenu li a {
  color: #fff;
}

.submenu li:last-child {
  border-bottom: none;
}

.submenu-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem 0.75rem 2.5rem;
  color: var(--white);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  font-weight: 500;
  background-color: transparent;
  text-align: left;
  justify-content: flex-start;
}

.submenu-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
  padding-left: 2.75rem;
  color: var(--white);
}

.submenu-link.active {
  background-color: var(--primary-blue-dark) !important;
  color: var(--white) !important;
  padding-left: 2.5rem !important;
  font-weight: 600 !important;
  border-left: 3px solid var(--white) !important;
  box-shadow: inset 3px 0 0 var(--white) !important;
  text-align: left !important;
  justify-content: flex-start !important;
}

.submenu-icon {
  margin-right: 0.75rem;
  font-size: 1rem;
  width: 16px;
  text-align: center;
}

/* Menú Horizontal */
.horizontal-menu {
  flex: 1;
  display: flex;
  align-items: center;
  margin: 0 2rem;
}

@media (max-width: 991px) {
  .horizontal-menu {
    display: none;
  }
}

.horizontal-menu-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
  align-items: center;
}

.horizontal-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  color: rgba(255, 255, 255, 0.95) !important;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
}

.horizontal-menu-item i {
  color: rgba(255, 255, 255, 0.95) !important;
  opacity: 1;
}

.horizontal-menu-item span {
  color: rgba(255, 255, 255, 0.95) !important;
}

/* Ocultar la flecha automática de Bootstrap */
.horizontal-menu-item.dropdown-toggle::after {
  display: none !important;
}

/* Agregar flecha personalizada solo para dropdowns */
.horizontal-menu-dropdown .horizontal-menu-item::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.7rem;
  margin-left: 0.5rem;
  opacity: 0.9;
  transition: transform 0.2s ease;
}

.horizontal-menu-dropdown .horizontal-menu-item[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.horizontal-menu-item:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 1) !important;
  transform: translateY(-1px);
}

.horizontal-menu-item:hover i,
.horizontal-menu-item:hover span {
  color: rgba(255, 255, 255, 1) !important;
  opacity: 1;
}

.horizontal-menu-item.active {
  background: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 1) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.horizontal-menu-item.active i,
.horizontal-menu-item.active span {
  color: rgba(255, 255, 255, 1) !important;
  opacity: 1;
}

.horizontal-menu-dropdown .dropdown-menu {
  margin-top: 0.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.08);
  min-width: 200px;
  padding: 0.5rem;
  background: var(--white);
  backdrop-filter: blur(12px);
}

.horizontal-menu-dropdown .dropdown-item {
  padding: 0.625rem 0.875rem;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin: 0.125rem 0;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-dark);
}

.horizontal-menu-dropdown .dropdown-item:hover {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: var(--white);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.2);
}

.horizontal-menu-dropdown .dropdown-item i {
  width: 20px;
  text-align: center;
  margin-right: 0.625rem;
  font-size: 0.875rem;
}

.horizontal-menu-dropdown .dropdown-item.active {
  background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue) 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

/* Responsive para menú horizontal */
.menu-toggle-mobile {
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  margin-right: 1rem;
  display: none;
}

@media (max-width: 991px) {
  .horizontal-menu {
    display: none;
  }

  .app-header-content {
    position: relative;
  }

  .menu-toggle-mobile {
    display: block !important;
  }

  .horizontal-menu.mobile-open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--header-blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    padding: 1rem;
    margin: 0;
  }

  .horizontal-menu.mobile-open .horizontal-menu-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .horizontal-menu.mobile-open .horizontal-menu-item {
    width: 100%;
    justify-content: space-between;
  }

  .horizontal-menu.mobile-open .dropdown-menu {
    position: static !important;
    transform: none !important;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 0.25rem;
    margin-left: 1rem;
    border: none;
  }
}

@media (min-width: 992px) {
  .menu-toggle-mobile {
    display: none !important;
  }
}

/* Contenido principal */
.main-content {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 1;
}

.main-content-wrapper {
  padding: 1.5rem 2rem;
  max-width: 100%;
}

/* Botón toggle menú */
.menu-toggle {
  display: none;
}

/* Dropdown perfil */
.profile-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  z-index: 1000;
  display: none;
  transform: translateY(0);
  pointer-events: all;
}


.profile-dropdown.active {
  display: block;
}

.profile-dropdown-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-dropdown-name {
  font-weight: 600;
  color: var(--text-dark);
}

.profile-dropdown-email {
  font-size: 0.85rem;
  color: var(--text-gray);
}

.profile-dropdown-item {
  padding: 1rem;
  color: var(--text-dark);
  text-decoration: none;
  display: block;
  transition: background-color 0.3s ease;
  border-bottom: 1px solid var(--border-light);
}

.profile-dropdown-item:last-child {
  border-bottom: none;
}

.profile-dropdown-item:hover {
  background-color: var(--background-light-gray);
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: var(--background-light-gray);
  border-top: 1px solid var(--border-light);
  padding: 1rem 0;
  text-align: center;
  color: var(--text-gray);
  transition: background-color 0.3s ease, color 0.3s ease;
  z-index: 100;
}

/* Cards */
/* Botones */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%) !important;
  border: 2px solid var(--primary-blue-dark) !important;
  color: var(--white) !important;
  padding: 0.625rem 1.25rem !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  overflow: hidden !important;
  letter-spacing: 0.02em !important;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: 0;
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-blue-light) 0%, var(--primary-blue) 100%) !important;
  border-color: var(--primary-blue-light) !important;
  color: var(--white) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
}

.btn-primary:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
}

.btn-primary:focus {
  outline: none !important;
  box-shadow: 0 0 0 0.25rem rgba(66, 165, 245, 0.25) !important;
}

.btn-primary:disabled {
  background: linear-gradient(135deg, rgba(66, 165, 245, 0.5) 0%, rgba(30, 136, 229, 0.5) 100%) !important;
  border-color: rgba(66, 165, 245, 0.3) !important;
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

.btn-primary span,
.btn-primary i {
  position: relative;
  z-index: 1;
}

/* Excepción para el botón de filtros en crear pagos - sin movimiento */
#openFiltersModal.btn-primary:hover {
  transform: none !important;
}

.btn-outline-primary {
  border-radius: 8px !important;
  border: 2px solid var(--primary-blue) !important;
  color: var(--primary-blue) !important;
  padding: 0.625rem 1.25rem !important;
  background: transparent !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  overflow: hidden !important;
  letter-spacing: 0.02em !important;
}

.btn-outline-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(66, 165, 245, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: 0;
}

.btn-outline-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-outline-primary:hover {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%) !important;
  color: var(--white) !important;
  border-color: var(--primary-blue-dark) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(66, 165, 245, 0.3) !important;
}

.btn-outline-primary:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
}

.btn-outline-primary:focus {
  outline: none !important;
  box-shadow: 0 0 0 0.25rem rgba(66, 165, 245, 0.25) !important;
}

.btn-outline-primary span,
.btn-outline-primary i {
  position: relative;
  z-index: 1;
}


.btn-accent {
  background-color: var(--accent-red-orange);
  border: none;
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.btn-accent:hover {
  opacity: 0.9;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background-color: var(--background-light-gray);
}

::-webkit-scrollbar-thumb {
  background-color: var(--primary-blue);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary-blue-dark);
}

/* Resumen de venta */
.summary-card {
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  color: var(--white);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.summary-title {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.summary-value {
  font-size: 2.5rem;
  font-weight: bold;
}

/* Secciones expandibles */
.expandable-section {
  background-color: var(--background-light-gray);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.expandable-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 1rem;
  background-color: var(--background-light);
  border-radius: 8px;
  color: var(--primary-blue);
  font-weight: 600;
}

.expandable-content {
  padding: 1rem;
  background-color: var(--background-light);
  border-radius: 8px;
  margin-top: 0.5rem;
}

/* Forms */
.form-control {
  background: var(--surface-soft-alt);
  border: 1px solid var(--surface-border);
  color: var(--text-dark);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.form-control:focus {
  border-color: var(--primary-blue-light);
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(66, 165, 245, 0.2);
  background: var(--surface-soft);
}

.form-select {
  border-radius: 14px;
  border: 1px solid var(--surface-border);
  background: var(--surface-soft-alt);
  color: var(--text-dark);
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.form-select:focus {
  border-color: var(--primary-blue-light);
  box-shadow: 0 0 0 0.2rem rgba(66, 165, 245, 0.2);
  background: var(--surface-soft);
}

.form-label {
  color: var(--text-dark);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  border-radius: 4px;
  font-size: 0.875em;
  font-weight: 500;
}

.badge-pending {
  background-color: var(--accent-red-orange);
  color: var(--white);
}

.badge-success {
  background-color: #4CAF50;
  color: var(--white);
}

/* Botón hamburger para móvil */
.menu-toggle-mobile {
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  transition: all 0.3s ease;
  font-size: 1.1rem;
  margin-right: 1rem;
}

.menu-toggle-mobile:hover {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.7);
}

/* Sidebar en móvil */
@media (max-width: 767px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 2000;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    left: 0 !important;
    padding: 1rem;
  }

  .app-header {
    padding: 1rem;
  }

  .summary-value {
    font-size: 2rem;
  }

  /* Overlay para cerrar sidebar en móvil */
  .sidebar-overlay {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
  }

  .sidebar-overlay.active {
    display: block;
  }
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }

  .menu-toggle-mobile {
    display: none;
  }

  .sidebar-overlay {
    display: none !important;
  }
}

/* Iconos */
.icon {
  display: inline-block;
  font-size: 1.5rem;
}

.icon-sm {
  font-size: 1.2rem;
}

.icon-lg {
  font-size: 2rem;
}

/* Pagos Por Procesar */
.page-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 0.75rem;
  border: 1px solid rgba(30, 136, 229, 0.1);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 1;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-blue) 0%, rgba(30, 136, 229, 0.5) 100%);
  border-radius: 12px 12px 0 0;
}

.page-info {
  flex: 1 1 320px;
  min-width: 260px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-title i {
  font-size: 1.25rem;
  opacity: 0.8;
}

.page-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
  justify-content: flex-end;
}

.page-actions .btn {
  min-width: 140px;
  box-shadow: 0 12px 24px rgba(30, 136, 229, 0.18);
}

.modal-backdrop {
  z-index: 1040;
  background: rgba(8, 14, 31, 0.78);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.show {
  opacity: 1;
}


/* Asegurar que los modales estén por encima de todo */
.modal {
  z-index: 1055 !important;
  position: fixed !important;
}

.modal-backdrop {
  z-index: 1040 !important;
  position: fixed !important;
}

.modal-open .modal {
  z-index: 1055 !important;
  position: fixed !important;
}

.modal-open .modal-dialog {
  z-index: 1060 !important;
  position: relative;
}

.modal-open .modal-content {
  z-index: 1061 !important;
  position: relative;
}

.modal.show {
  z-index: 1055 !important;
  position: fixed !important;
}

.modal.show .modal-dialog {
  z-index: 1060 !important;
  position: relative;
}

.modal.show .modal-content {
  z-index: 1061 !important;
  position: relative;
}

/* Asegurar que main-content no interfiera con modales */
.main-content {
  z-index: 1;
}

body.modal-open .main-content {
  z-index: 1;
}

.modal-content {
  border-radius: 22px;
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
  box-shadow: var(--surface-shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.modal-content:hover {
  box-shadow: var(--surface-shadow-soft);
}


.modal-header,
.modal-footer {
  border: none;
  background: transparent;
  padding: 1.5rem 1.75rem;
}

.modal-body {
  padding: 1.5rem 1.75rem;
}

.modal-title {
  font-weight: 600;
  color: var(--primary-blue-dark);
}


.pending-content {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.orders-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
}

.orders-loading-overlay.d-none {
  display: none !important;
}

.orders-loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
  font-size: 0.95rem;
  color: #0d6efd;
}

/* DataTables Processing Indicator - Estilo consistente con orders-loading */
.dataTables_processing {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0.75rem 1.5rem !important;
  background: #ffffff !important;
  border: none !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
  font-size: 0.95rem !important;
  color: #0d6efd !important;
  font-weight: 500 !important;
  z-index: 100 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.dataTables_processing::before {
  content: '';
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #e2e8f0;
  border-top-color: #0d6efd;
  border-radius: 50%;
  animation: datatables-spin 0.8s linear infinite;
}

@keyframes datatables-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Ocultar el texto por defecto y reemplazarlo */
.dataTables_processing>div {
  display: none !important;
}

.seller-group-row td {
  padding: 1rem 1.5rem;
  background: var(--surface-soft-alt);
  border: none;
}

.seller-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.seller-group-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  color: var(--primary-blue-dark);
  font-weight: 600;
}

.seller-group-title {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.seller-group-code {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: var(--primary-blue-dark);
  box-shadow: 0 8px 18px rgba(33, 150, 243, 0.2);
}

.seller-group-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--text-gray);
  font-weight: 500;
  font-size: 0.85rem;
}

.seller-group-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.seller-group-meta-item i {
  opacity: 0.65;
}

.seller-group-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--primary-blue-dark);
  font-size: 0.85rem;
  text-transform: uppercase;
  font-weight: 600;
}

.seller-group-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.seller-summary-row td {
  background: rgba(66, 165, 245, 0.12);
  border-top: 1px solid var(--surface-border-strong);
  padding: 0.75rem 1rem;
  color: var(--primary-blue-dark);
}

.seller-group-stats strong {
  font-size: 1.05rem;
}

.pending-summary-card,
.pending-table-card {
  border-radius: 24px;
  border: 1px solid rgba(21, 101, 192, 0.08);
  box-shadow: 0 14px 28px rgba(13, 71, 161, 0.12);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 248, 242, 0.98) 100%);
  padding: 1.75rem;
}


.pending-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.pending-metric {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  background: var(--surface-soft-alt);
  border: 1px solid var(--surface-border);
  box-shadow: var(--surface-shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.pending-metric:hover {
  transform: translateY(-4px);
  box-shadow: var(--surface-shadow);
}


.pending-metric-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pending-metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: white;
}

.bg-clients {
  background: linear-gradient(135deg, #42A5F5, #1E88E5);
}

.bg-payments {
  background: linear-gradient(135deg, #7E57C2, #5E35B1);
}

.bg-amount {
  background: linear-gradient(135deg, #26C6DA, #0097A7);
}

.bg-dates {
  background: linear-gradient(135deg, #FFB74D, #FB8C00);
}

.pending-metric-label {
  font-size: 0.85rem;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pending-metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-blue);
}


.pending-table-card {
  padding: 0;
  overflow: hidden;
}

.pending-table-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.75rem 1.75rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.pending-table-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary-blue-dark);
}

.pending-table-subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-gray);
  font-size: 0.9rem;
}

.pending-table-badge {
  background: rgba(30, 136, 229, 0.15);
  color: var(--primary-blue);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}


.pending-table-responsive {
  padding: 1rem 1.75rem 0;
}

.pending-table-card .table {
  margin-bottom: 0;
}

.pending-table-card .table thead th {
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.15) 0%, rgba(21, 101, 192, 0.12) 100%);
  border-bottom: 3px solid rgba(30, 136, 229, 0.3);
  font-weight: 700;
  color: var(--primary-blue-dark);
  border-top: none;
  padding: 0.6rem 0.75rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  position: relative;
  text-align: center;
}

.pending-table-card .table thead th::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(30, 136, 229, 0.4), rgba(21, 101, 192, 0.6));
}


.pending-table-card .table tbody td {
  vertical-align: middle;
  border-color: rgba(30, 136, 229, 0.1);
  padding: 0.5rem 0.75rem;
  text-align: center;
  font-size: 0.875rem;
}

.pending-table-card .table tbody tr {
  transition: all 0.2s ease;
  border-bottom: 2px solid rgba(66, 165, 245, 0.3);
}

.pending-table-card .table tbody tr:nth-child(even) {
  background: rgba(30, 136, 229, 0.03);
}

.pending-table-card .table tbody tr:hover {
  background: linear-gradient(90deg, rgba(66, 165, 245, 0.15) 0%, rgba(30, 136, 229, 0.12) 100%);
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.1);
}


.pending-table-card .table tbody td:first-child {
  font-weight: 700;
  color: var(--primary-blue-dark);
  font-size: 0.95rem;
}


.pending-table-card .table tbody td:nth-child(2),
.pending-table-card .table tbody td:nth-child(3) {
  color: #1e3a5f;
  font-weight: 500;
}


.pending-table-card .table tbody td:nth-child(5),
.pending-table-card .table tbody td:nth-child(6) {
  color: #1565c0;
  font-weight: 700;
  font-size: 0.95rem;
}


.pending-empty-row td {
  text-align: center;
  padding: 2.75rem 1rem;
  color: var(--text-gray);
}

.pending-empty-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.pending-empty-message i {
  font-size: 1.75rem;
  color: var(--primary-blue);
}

.pending-badge {
  background: rgba(255, 193, 7, 0.18);
  color: #f57f17;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}


.pending-pagination {
  padding: 1.15rem 1.75rem 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.pending-pagination-status {
  font-size: 0.95rem;
  color: var(--text-gray);
}

.pending-pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pending-pagination-controls .btn {
  min-width: 44px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.pending-pagination-controls .btn:disabled {
  opacity: 0.6;
  box-shadow: none;
}

/* Paginación estándar (DataTables + GssPagination) */
.pagination {
  margin-bottom: 0;
}

.pagination .page-item .page-link {
  border-radius: 999px;
  border: none;
  margin: 0 2px;
  padding: 0.35rem 0.75rem;
  color: var(--primary-blue-dark);
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(13, 71, 161, 0.12);
  font-size: 0.85rem;
}

.pagination .page-item .page-link:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-blue);
}

.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(13, 71, 161, 0.4);
}

.pagination .page-item.disabled .page-link {
  opacity: 0.5;
  box-shadow: none;
  cursor: default;
}

.payment-detail-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.75rem;
  margin-bottom: 1.75rem;
}

.payment-detail-title {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.payment-detail-title .badge {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  align-self: flex-start;
}

.payment-detail-title h4 {
  font-size: 1.35rem;
  margin: 0;
}

.payment-detail-client {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.95rem;
}

.payment-detail-clientcode {
  color: var(--text-gray);
  font-size: 0.85rem;
}

.payment-detail-summary {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.payment-detail-summary>div {
  min-width: 140px;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  background: rgba(33, 150, 243, 0.12);
  text-align: right;
  box-shadow: 0 15px 30px rgba(30, 136, 229, 0.12);
}


.payment-detail-summary .label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-gray);
}

.payment-detail-summary .value {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-blue-dark);
}


.payment-detail-grid {
  margin-bottom: 1.25rem;
}

.payment-detail-card {
  border: none;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 244, 255, 0.95) 100%);
  padding: 1.25rem 1.4rem;
  box-shadow: 0 28px 48px rgba(30, 136, 229, 0.16);
}


.payment-detail-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
}

.payment-detail-card-header h6 {
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-blue-dark);
}

.detail-status-badge {
  box-shadow: 0 10px 24px rgba(33, 150, 243, 0.18);
}


.payment-detail-card-header .badge {
  font-size: 0.75rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
}

.payment-detail-card .table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-blue-dark);
}


.payment-detail-card .table tbody td {
  border-color: rgba(0, 0, 0, 0.04);
}


.payment-detail-totals {
  display: flex;
  justify-content: flex-end;
  gap: 2rem;
  margin: 1.5rem 0 0;
  font-weight: 600;
  color: var(--primary-blue-dark);
}


.payment-detail-totals>div {
  text-align: right;
}

.payment-detail-extra {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.payment-detail-extra .payment-detail-card {
  min-height: 170px;
}

.payment-detail-discounts {
  font-weight: 600;
  color: var(--primary-blue-dark);
}


.payment-detail-attachment+.payment-detail-attachment {
  margin-top: 0.35rem;
}

.payment-detail-attachment a {
  color: var(--primary-blue-dark);
  text-decoration: none;
  font-weight: 600;
}

.payment-detail-attachment a:hover {
  text-decoration: underline;
}

.payment-detail-attachment span {
  margin-left: 0.35rem;
}

.discounts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.discount-item {
  border-radius: 14px;
  background: var(--surface-soft-alt);
  padding: 0.75rem 1rem;
  box-shadow: var(--surface-shadow-soft);
}

.discount-item-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 600;
  color: var(--primary-blue-dark);
  text-transform: uppercase;
  font-size: 0.85rem;
}

.discount-breakdown {
  margin-top: 0.5rem;
  color: var(--text-gray);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}


.attachment-link {
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-blue-dark);
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

.attachment-link i {
  font-size: 1.05rem;
}

.attachment-link:hover,
.attachment-link:focus {
  color: var(--primary-blue);
  text-decoration: underline;
}

.attachment-viewer-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.attachment-viewer-actions .btn {
  min-width: 42px;
}

.attachment-viewer-body {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(33, 150, 243, 0.12), rgba(255, 255, 255, 0.3));
  border-radius: 18px;
  overflow: hidden;
}

.attachment-viewer-image {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 18px;
  box-shadow: 0 30px 60px rgba(33, 150, 243, 0.2);
}

.attachment-viewer-frame,
.attachment-viewer-media {
  width: 100%;
  min-height: 65vh;
  border: none;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.attachment-viewer-fallback {
  text-align: center;
  color: var(--text-gray);
  max-width: 420px;
}

.attachment-viewer-fallback i {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  color: var(--primary-blue-dark);
}

.attachment-viewer-counter {
  font-weight: 600;
}

.attachment-viewer-nav {
  font-weight: 600;
}


.bg-gradient-primary {
  background: linear-gradient(135deg, #2196F3, #0D47A1);
  color: var(--white);
}

.badge-soft-primary {
  background: rgba(33, 150, 243, 0.18);
  color: var(--primary-blue-dark);
}


.bg-gradient-success {
  background: linear-gradient(135deg, #43A047, #1B5E20);
  color: var(--white);
}

.bg-gradient-warning {
  background: linear-gradient(135deg, #FFD54F, #FB8C00);
  color: #3d2e02;
}

.bg-gradient-danger {
  background: linear-gradient(135deg, #E53935, #B71C1C);
  color: var(--white);
}

.pending-filters-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pending-filters-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

.pending-filters-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pending-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
}

.pending-filters-container .form-group {
  margin-bottom: 0.25rem;
}

.pending-filters-container .form-group:last-child {
  margin-bottom: 0;
}

#paymentsFiltersModal .modal-content,
#ordersFiltersModal .modal-content {
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

#paymentsFiltersModal .modal-header,
#ordersFiltersModal .modal-header {
  border-bottom: none;
  padding: 1rem 1.5rem 0;
}

#paymentsFiltersModal .modal-body,
#ordersFiltersModal .modal-body {
  padding: 0.75rem 1.5rem 1rem;
}

#paymentsFiltersModal .modal-footer,
#ordersFiltersModal .modal-footer {
  border-top: none;
  padding: 0.75rem 1.5rem 1.25rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

#paymentsFiltersModal.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

#paymentsFiltersModal .modal-dialog {
  margin: 0;
  max-width: 780px;
  width: 100%;
}

@media (max-width: 992px) {
  .pending-summary-row {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .pending-table-header {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 768px) {

  .pending-summary-card,
  .pending-table-card {
    padding: 1.5rem;
  }

  .pending-table-responsive {
    padding: 1rem 1rem 0;
  }

  .pending-pagination {
    padding: 1rem;
  }

  .pending-filters-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .pending-filters-dates {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   MASTERS STYLES
   ============================================ */

.masters-container {
  padding: 2rem;
}

.masters-table-card {
  border-radius: 24px;
  border: 1px solid rgba(21, 101, 192, 0.08);
  box-shadow: 0 14px 28px rgba(13, 71, 161, 0.12);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 248, 242, 0.98) 100%);
  padding: 0;
  overflow: hidden;
}


.masters-table-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.75rem 1.75rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.masters-table-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary-blue-dark);
}

.masters-table-subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-gray);
  font-size: 0.9rem;
}

.masters-table-badge {
  background: rgba(30, 136, 229, 0.15);
  color: var(--primary-blue);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}


.masters-table-responsive {
  padding: 1rem 1.75rem 1.75rem;
}

.masters-table-card .table {
  margin-bottom: 0;
}

.masters-table-card .table thead th {
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.15) 0%, rgba(21, 101, 192, 0.12) 100%);
  border-bottom: 3px solid rgba(30, 136, 229, 0.3);
  font-weight: 700;
  color: var(--primary-blue-dark);
  border-top: none;
  padding: 1rem 0.75rem;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  position: relative;
}

.masters-table-card .table thead th::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(30, 136, 229, 0.4), rgba(21, 101, 192, 0.6));
}


.masters-table-card .table tbody td {
  vertical-align: middle;
  border-color: rgba(30, 136, 229, 0.1);
  padding: 1rem 0.75rem;
}

.masters-table-card .table tbody tr {
  transition: all 0.2s ease;
  border-bottom: 2px solid rgba(66, 165, 245, 0.3);
}

.masters-table-card .table tbody tr:nth-child(even) {
  background: rgba(30, 136, 229, 0.03);
}

.masters-table-card .table tbody tr:hover {
  background: linear-gradient(90deg, rgba(66, 165, 245, 0.15) 0%, rgba(30, 136, 229, 0.12) 100%);
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.1);
}

.masters-table-card .pagination-container {
  margin-top: 0.5rem;
}

@media (max-width: 767px) {
  .masters-container {
    padding: 1rem;
  }

  .masters-table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .masters-table-responsive {
    padding: 0.5rem;
  }
}

/* ============================================
   PRODUCTS LIST STYLES - COMPACT
   ============================================ */

.orders-create-products-page {
  padding: 1rem;
}

.products-grid-view .row {
  margin: 0;
}

.product-card-compact {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  transition: all 0.2s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card-compact:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.product-image-wrapper {
  width: 100%;
  height: 120px;
  overflow: hidden;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-compact {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.product-title-compact {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
  color: #333;
}

.product-code-compact {
  font-size: 0.75rem;
  margin: 0;
  color: #6c757d;
}

.product-price-compact {
  font-size: 0.9rem;
}

.product-pricing-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.product-pricing-compact .text-decoration-line-through {
  font-size: 0.75rem;
  opacity: 0.7;
}

.product-stock-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
}

.product-stock-badge-compact {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
}

.product-card-compact .btn {
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
}

/* Asegurar simetría vertical en vista grid */
/* Mejorar sombras en contenedores del modal de detalle de pedido para mejor contraste en pantallas LCD */
.order-detail-content .card {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15), 0 1px 4px rgba(0, 0, 0, 0.1) !important;
}

.order-detail-content .card.shadow-sm {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.product-card-compact .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.product-card-compact .product-info-compact {
  margin-bottom: 0.25rem;
}

.product-card-compact .product-actions-compact {
  margin-top: auto;
}

/* Vista de lista compacta */
.products-list-view .table {
  font-size: 0.875rem;
  margin-bottom: 0;
}

.products-list-view .table thead th {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.products-list-view .table tbody td {
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
}

.product-row-compact:hover {
  background-color: #f8f9fa;
}

.product-thumb-compact {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 4px;
  background: #f8f9fa;
  padding: 4px;
}

.product-code-cell {
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
  color: #6c757d;
}

.product-name-cell {
  font-weight: 500;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-brand-cell,
.product-line-cell {
  font-size: 0.85rem;
  color: #6c757d;
}

.product-price-cell {
  font-weight: 600;
  color: #0d6efd;
}

@media (max-width: 768px) {
  .product-card-compact {
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .product-image-wrapper {
    height: 100px;
  }

  .products-list-view .table {
    font-size: 0.75rem;
  }

  .products-list-view .table thead th,
  .products-list-view .table tbody td {
    padding: 0.4rem 0.5rem;
  }

  .product-name-cell {
    max-width: 150px;
  }

  .product-brand-cell,
  .product-line-cell {
    display: none;
  }
}

/* ============================================
   PRODUCT DETAIL PAGE STYLES
   ============================================ */

.product-detail-page {
  padding: 1.5rem 0;
}

.product-image-container {
  position: sticky;
  top: 20px;
}

.product-image-wrapper {
  position: relative;
  width: 100%;
  background: #f8f9fa;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-detail-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2rem;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.product-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #adb5bd;
  font-size: 3rem;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.product-detail-image.loaded~.product-image-overlay {
  opacity: 0;
}

.product-detail-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.product-header {
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 1.5rem;
}

.product-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.product-code {
  color: #6c757d;
  font-size: 0.95rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.product-code i {
  opacity: 0.6;
}

.product-categories {
  padding: 1rem 0;
}

.category-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

.category-badge:hover {
  background: #e9ecef;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-badge i {
  font-size: 1.25rem;
  color: #0d6efd;
  width: 24px;
  text-align: center;
}

.category-badge strong {
  font-size: 0.9rem;
  color: #212529;
  display: block;
  line-height: 1.2;
}

.product-pricing {
  padding: 1rem 0;
}

.pricing-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 1.5rem;
  color: white;
}

.pricing-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
}

.pricing-item:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.pricing-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

.pricing-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.product-equivalency {
  padding: 1rem 0;
}

.equivalency-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #e7f3ff;
  border-left: 4px solid #0d6efd;
  border-radius: 8px;
}

.equivalency-badge i {
  font-size: 1.5rem;
  color: #0d6efd;
}

.equivalency-badge strong {
  color: #212529;
  font-size: 0.95rem;
}

.product-actions {
  padding-top: 1.5rem;
  border-top: 2px solid #f0f0f0;
}

.quantity-input-group label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-input-group .input-group {
  max-width: 200px;
}

.quantity-input-group .btn {
  border-color: #dee2e6;
  color: #495057;
}

.quantity-input-group .btn:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.quantity-input-group input {
  font-weight: 600;
  border-color: #dee2e6;
}

@media (max-width: 991px) {
  .product-image-container {
    position: relative;
    top: 0;
    margin-bottom: 2rem;
  }

  .product-detail-card {
    padding: 1.5rem;
  }

  .product-title {
    font-size: 1.5rem;
  }

  .category-badge {
    margin-bottom: 0.5rem;
  }
}

/* ============================================
   SELECT SEARCH STYLES
   ============================================ */

#filterManager,
#filterSupervisor,
#filterSeller {
  max-height: 150px;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
}

#filterManager:focus,
#filterSupervisor:focus,
#filterSeller:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#filterManagerSearch,
#filterSupervisorSearch,
#filterSellerSearch {
  font-size: 0.875rem;
}

#filterManagerSearch:disabled,
#filterSupervisorSearch:disabled,
#filterSellerSearch:disabled {
  background-color: #e9ecef;
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================
   ESTADOS UNIFICADOS (LOADING, EMPTY, ERROR)
   ============================================ */

/* Estado de carga */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  min-height: 200px;
  color: var(--text-gray);
}

.loading-state i {
  font-size: 2.5rem;
  color: var(--primary-blue);
  margin-bottom: 1rem;
  animation: pulse 1.5s ease-in-out infinite;
}

.loading-state p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-gray);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Estado vacío */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  min-height: 200px;
  text-align: center;
  color: var(--text-gray);
  background: rgba(15, 23, 42, 0.02);
  border-radius: 12px;
}

.empty-state i {
  font-size: 3rem;
  color: var(--primary-blue);
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-state p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-gray);
  max-width: 400px;
}

.empty-state .empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.empty-state .empty-state-subtitle {
  font-size: 0.85rem;
  color: var(--text-gray);
}

/* Estado de error */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  min-height: 200px;
  text-align: center;
  background: rgba(244, 67, 54, 0.05);
  border: 1px solid rgba(244, 67, 54, 0.2);
  border-radius: 12px;
}

.error-state i {
  font-size: 3rem;
  color: var(--accent-red);
  margin-bottom: 1rem;
}

.error-state .error-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-red);
  margin-bottom: 0.5rem;
}

.error-state .error-state-message {
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: 1rem;
  max-width: 400px;
}

.error-state .error-state-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Estados dentro de tarjetas */
.pending-table-card .loading-state,
.pending-table-card .empty-state,
.pending-table-card .error-state,
.masters-table-card .loading-state,
.masters-table-card .empty-state,
.masters-table-card .error-state {
  margin: 1rem;
  border-radius: 8px;
}

/* Estados en modo oscuro */

/* ═══════════════════════════════════════════════════════════════════════════
   BOTONES DE ACCIÓN EN TABLAS
   ═══════════════════════════════════════════════════════════════════════════ */

.table-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.table-action-btn i {
  font-size: 0.75rem;
}

/* Botón Editar - Azul primario */
.table-action-btn.btn-edit {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.table-action-btn.btn-edit:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  color: white;
}

.table-action-btn.btn-edit:disabled,
.table-action-btn.btn-edit.disabled {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: not-allowed;
  opacity: 0.7;
  pointer-events: none;
}

/* Botón Ver - Gris elegante */
.table-action-btn.btn-view {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #475569;
  border: 1px solid #cbd5e1;
}

.table-action-btn.btn-view:hover {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: #334155;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Contenedor de acciones */
.table-actions-container {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}