/* ===== DARK THEME WITH ORANGE/YELLOW ACCENTS ===== */

:root {
  /* Dark Backgrounds */
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1419;
  --bg-tertiary: #1a1f2e;

  /* Orange/Yellow Accents */
  --accent-orange: #ff9f0a;
  --accent-yellow: #fbbf24;
  --accent-amber: #f59e0b;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #ff9f0a 0%, #fbbf24 100%);
  --gradient-secondary: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
}

/* ===== GLOBAL STYLES ===== */
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: #e2e8f0;
}

/* ===== GLASSMORPHISM ===== */
.glass {
  background: rgba(26, 31, 46, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 159, 10, 0.1);
}

.glass-dark {
  background: rgba(15, 20, 25, 0.8);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 159, 10, 0.15);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff9f0a 0%, #f59e0b 100%);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #fbbf24 0%, #ff9f0a 100%);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

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

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 159, 10, 0.3);
  }

  50% {
    box-shadow: 0 0 30px rgba(255, 159, 10, 0.6);
  }
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease-out;
}

.animate-slideIn {
  animation: slideIn 0.5s ease-out;
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ===== TEXT GRADIENTS ===== */
.gradient-text {
  background: linear-gradient(135deg, #ff9f0a 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-alt {
  background: linear-gradient(135deg, #fbbf24 0%, #fb923c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== HOVER EFFECTS ===== */
.hover-lift {
  transition: all 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(255, 159, 10, 0.3);
}

.hover-glow:hover {
  box-shadow: 0 0 25px rgba(255, 159, 10, 0.5);
}

/* ===== CARDS ===== */
.card-dark {
  background: linear-gradient(135deg, rgba(26, 31, 46, 0.9) 0%, rgba(15, 20, 25, 0.9) 100%);
  border: 1px solid rgba(255, 159, 10, 0.15);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.card-dark:hover {
  border-color: rgba(255, 159, 10, 0.3);
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, #ff9f0a 0%, #f59e0b 100%);
  color: white;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 159, 10, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 159, 10, 0.5);
}

.btn-secondary {
  background: rgba(255, 159, 10, 0.1);
  color: #ff9f0a;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 8px;
  border: 1px solid rgba(255, 159, 10, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 159, 10, 0.2);
  border-color: #ff9f0a;
}

.btn-xs {
  padding: 4px 8px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  border-radius: 4px !important;
  height: 30px !important;
  width: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ===== BADGES ===== */
.badge-orange {
  background: linear-gradient(135deg, #ff9f0a 0%, #f59e0b 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(255, 159, 10, 0.3);
}

.badge-yellow {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.badge-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* ===== INPUTS ===== */
.input-dark {
  background: rgba(26, 31, 46, 0.8);
  border: 1px solid rgba(255, 159, 10, 0.2);
  color: #e2e8f0;
  padding: 10px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.input-dark:focus {
  outline: none;
  border-color: #ff9f0a;
  box-shadow: 0 0 0 3px rgba(255, 159, 10, 0.1);
}

/* ===== DATATABLES DARK THEME ===== */
.dataTables_wrapper {
  color: #e2e8f0;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  background: rgba(26, 31, 46, 0.8);
  border: 1px solid rgba(255, 159, 10, 0.2);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 6px;
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
  outline: none;
  border-color: #ff9f0a;
}

table.dataTable {
  background: transparent;
  color: #e2e8f0;
}

table.dataTable thead th {
  background: linear-gradient(135deg, #ff9f0a 0%, #f59e0b 100%);
  color: white;
  border-bottom: 2px solid #ff9f0a;
  font-weight: 600;
}

table.dataTable tbody tr {
  background: rgba(26, 31, 46, 0.5);
  border-bottom: 1px solid rgba(255, 159, 10, 0.1);
}

table.dataTable tbody tr:hover {
  background: rgba(255, 159, 10, 0.1);
}

table.dataTable tbody td {
  color: #e2e8f0;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: #ff9f0a !important;
  background: rgba(255, 159, 10, 0.1);
  border: 1px solid rgba(255, 159, 10, 0.2);
  border-radius: 6px;
  margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: rgba(255, 159, 10, 0.2) !important;
  border-color: #ff9f0a !important;
  color: #fbbf24 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: linear-gradient(135deg, #ff9f0a 0%, #f59e0b 100%) !important;
  color: white !important;
  border-color: #ff9f0a !important;
}

/* ===== MODALS ===== */
.modal-dark {
  background: linear-gradient(135deg, rgba(26, 31, 46, 0.98) 0%, rgba(15, 20, 25, 0.98) 100%);
  border: 1px solid rgba(255, 159, 10, 0.2);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-header-dark {
  background: linear-gradient(135deg, #ff9f0a 0%, #f59e0b 100%);
  color: white;
  border-bottom: 1px solid rgba(255, 159, 10, 0.3);
  border-radius: 16px 16px 0 0;
  padding: 20px;
}

/* ===== SWEETALERT2 DARK THEME ===== */
.swal2-popup {
  background: #1a1f2e !important;
  border: 1px solid rgba(255, 159, 10, 0.2) !important;
}

.swal2-title {
  color: #e2e8f0 !important;
}

.swal2-html-container {
  color: #cbd5e1 !important;
}

.swal2-confirm {
  background: linear-gradient(135deg, #ff9f0a 0%, #f59e0b 100%) !important;
  box-shadow: 0 4px 15px rgba(255, 159, 10, 0.3) !important;
}

.swal2-cancel {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
  border: 1px solid #ef4444 !important;
}

/* ===== GLOW EFFECTS ===== */
.drop-shadow-glow {
  filter: drop-shadow(0 0 8px rgba(255, 159, 10, 0.6));
}

.text-glow {
  text-shadow: 0 0 10px rgba(255, 159, 10, 0.5);
}

/* ===== FIX SELECTPICKER DROPDOWN ===== */
.bootstrap-select .dropdown-menu {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 159, 10, 0.2);
  display: none;
  /* Force hidden by default */
}

/* Bootstrap 3 uses .open on the parent, not .show on the menu */
.bootstrap-select.open .dropdown-menu {
  display: block !important;
  /* Force show when active */
}

/* Also support .show for newer versions just in case */
.bootstrap-select .dropdown-menu.show {
  display: block !important;
}

.bootstrap-select .dropdown-menu li a {
  color: #e2e8f0;
}

.bootstrap-select .dropdown-menu li a:hover {
  background: rgba(255, 159, 10, 0.2);
}

.bootstrap-select .btn {
  background: rgba(26, 31, 46, 0.8);
  border: 1px solid rgba(255, 159, 10, 0.2);
  color: #e2e8f0;
}

.bootstrap-select .btn:hover,
.bootstrap-select .btn:focus {
  background: rgba(26, 31, 46, 1) !important;
  border-color: #ff9f0a !important;
  outline: none !important;
}

/* ===== REDESIGNED BOOTSTRAP SELECT ===== */

/* Container */
.bootstrap-select {
  width: 100% !important;
}

/* The Button (Closed State) */
.bootstrap-select>.btn {
  background: linear-gradient(135deg, rgba(26, 31, 46, 0.9) 0%, rgba(15, 20, 25, 0.9) 100%) !important;
  border: 1px solid rgba(255, 159, 10, 0.3) !important;
  color: #e2e8f0 !important;
  padding: 12px 20px !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
}

.bootstrap-select>.btn:hover,
.bootstrap-select>.btn:focus,
.bootstrap-select>.btn:active,
.bootstrap-select.open>.btn {
  background: linear-gradient(135deg, rgba(26, 31, 46, 1) 0%, rgba(15, 20, 25, 1) 100%) !important;
  border-color: #ff9f0a !important;
  box-shadow: 0 0 0 2px rgba(255, 159, 10, 0.2) !important;
  color: #fff !important;
  outline: none !important;
}

/* The Dropdown Menu (Open State) */
.bootstrap-select .dropdown-menu {
  background: #0f1419 !important;
  border: 1px solid #ff9f0a !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important;
  padding: 10px !important;
  margin-top: 5px !important;
  display: none;
  /* Hidden by default */
}

/* Show logic for Bootstrap 3 */
.bootstrap-select.open .dropdown-menu {
  display: block !important;
  animation: fadeIn 0.2s ease-out;
}

/* Search Box inside Dropdown */
.bootstrap-select .bs-searchbox {
  padding: 10px !important;
  background: transparent !important;
}

.bootstrap-select .bs-searchbox .form-control {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 159, 10, 0.3) !important;
  color: #fff !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
}

.bootstrap-select .bs-searchbox .form-control:focus {
  border-color: #ff9f0a !important;
  box-shadow: 0 0 0 2px rgba(255, 159, 10, 0.2) !important;
}

/* List Items */
.bootstrap-select .dropdown-menu li {
  margin-bottom: 2px !important;
}

.bootstrap-select .dropdown-menu li a {
  color: #cbd5e1 !important;
  padding: 10px 15px !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
  font-weight: 500 !important;
}

.bootstrap-select .dropdown-menu li a:hover,
.bootstrap-select .dropdown-menu li a:focus,
.bootstrap-select .dropdown-menu li.selected a {
  background: linear-gradient(90deg, rgba(255, 159, 10, 0.1) 0%, rgba(255, 159, 10, 0.05) 100%) !important;
  color: #ff9f0a !important;
  outline: none !important;
  border-left: 3px solid #ff9f0a !important;
}

.bootstrap-select .dropdown-menu li.active a {
  background: linear-gradient(90deg, rgba(255, 159, 10, 0.2) 0%, rgba(255, 159, 10, 0.1) 100%) !important;
  color: #fbbf24 !important;
}

/* Checkmark Icon */
.bootstrap-select .dropdown-menu li a span.check-mark {
  color: #ff9f0a !important;
}

/* ===== FIX INPUTS IN DETAILS TABLE ===== */
#detalles input[type="number"],
#detalles input[type="text"] {
  background: rgba(26, 31, 46, 0.8) !important;
  border: 1px solid rgba(255, 159, 10, 0.3) !important;
  color: #e2e8f0 !important;
  padding: 8px 12px !important;
  border-radius: 6px !important;
  width: 100% !important;
  max-width: 120px !important;
  transition: all 0.3s ease !important;
}

#detalles input[type="number"]:focus,
#detalles input[type="text"]:focus {
  background: rgba(26, 31, 46, 1) !important;
  border-color: #ff9f0a !important;
  box-shadow: 0 0 0 2px rgba(255, 159, 10, 0.2) !important;
  outline: none !important;
}

/* Remove spinner arrows from number inputs */
#detalles input[type=number]::-webkit-inner-spin-button,
#detalles input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#detalles input[type=number] {
  -moz-appearance: textfield;
}

/* Style the rows in details table */
#detalles tbody tr {
  background: rgba(26, 31, 46, 0.4);
  border-bottom: 1px solid rgba(255, 159, 10, 0.1);
}

#detalles tbody td {
  padding: 10px !important;
  vertical-align: middle !important;
}


/* ===== FIX MODAL LAYOUT ===== */
.modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 9999 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  display: none;
}

.modal.in {
  display: block !important;
  background: rgba(0, 0, 0, 0.8) !important;
  /* Backdrop */
}

.modal-dialog {
  position: relative !important;
  width: auto !important;
  margin: 30px auto !important;
  pointer-events: none !important;
  /* Allow clicks to pass through to backdrop if needed */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: calc(100% - 60px) !important;
}

.modal-content {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  pointer-events: auto !important;
  /* Re-enable clicks on content */
  background-clip: padding-box !important;
  outline: 0 !important;
}

.modal-dark {
  background: linear-gradient(135deg, rgba(26, 31, 46, 0.98) 0%, rgba(15, 20, 25, 0.98) 100%) !important;
  border: 1px solid rgba(255, 159, 10, 0.2) !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6) !important;
}

.modal-header-dark {
  background: linear-gradient(135deg, #1a1f2e 0%, #0f1419 100%) !important;
  color: #ff9f0a !important;
  border-bottom: 1px solid rgba(255, 159, 10, 0.3) !important;
  border-radius: 16px 16px 0 0 !important;
  padding: 20px !important;
}


/* ===== FIX TABLE STYLES FOR DARK THEME ===== */
table.dataTable {
  background: transparent !important;
  color: #e2e8f0 !important;
  border-collapse: collapse !important;
}

table.dataTable thead th {
  background: linear-gradient(135deg, #ff9f0a 0%, #f59e0b 100%) !important;
  color: white !important;
  border-bottom: 2px solid #ff9f0a !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

table.dataTable tbody tr {
  background: rgba(26, 31, 46, 0.6) !important;
  border-bottom: 1px solid rgba(255, 159, 10, 0.1) !important;
  transition: all 0.2s ease !important;
}

table.dataTable tbody tr:nth-of-type(odd) {
  background: rgba(26, 31, 46, 0.4) !important;
}

table.dataTable tbody tr:hover {
  background: rgba(255, 159, 10, 0.15) !important;
}

table.dataTable tbody td {
  color: #e2e8f0 !important;
  border-top: none !important;
  border-bottom: 1px solid rgba(255, 159, 10, 0.1) !important;
  vertical-align: middle !important;
}

/* Fix for white background in some DataTables configurations */
table.dataTable.display tbody tr.odd>.sorting_1,
table.dataTable.order-column.stripe tbody tr.odd>.sorting_1 {
  background-color: rgba(26, 31, 46, 0.6) !important;
}

table.dataTable.display tbody tr.even>.sorting_1,
table.dataTable.order-column.stripe tbody tr.even>.sorting_1 {
  background-color: rgba(26, 31, 46, 0.4) !important;
}

table.dataTable.display tbody tr:hover>.sorting_1,
table.dataTable.order-column.hover tbody tr:hover>.sorting_1 {
  background-color: rgba(255, 159, 10, 0.15) !important;
}