/* Dark Theme Overrides */
body.dark-mode {
  background-color: #121212 !important;
  color: #e0e0e0 !important;
}

body.dark-mode nav,
body.dark-mode .nav-wrapper,
body.dark-mode .side-nav,
body.dark-mode footer,
body.dark-mode .card,
body.dark-mode .card-panel,
body.dark-mode .modal,
body.dark-mode .dropdown-content,
body.dark-mode .abajo-izq-fijo {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
}

body.dark-mode .collapsible-header,
body.dark-mode .collapsible-body {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
  border-bottom: 1px solid #333 !important;
}

body.dark-mode .bi-card,
body.dark-mode .bi-card-body,
body.dark-mode .bi-info-box,
body.dark-mode .autocomplete-suggestions {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
  border-color: #333 !important;
}

body.dark-mode .bi-info-box .bi-chip {
  background-color: #333 !important;
  color: #90caf9 !important;
}

body.dark-mode input[type=text],
body.dark-mode input[type=password],
body.dark-mode input[type=email],
body.dark-mode input[type=url],
body.dark-mode input[type=number],
body.dark-mode textarea.materialize-textarea,
body.dark-mode select.bi-select {
  color: #e0e0e0 !important;
  border-bottom-color: #555 !important;
}

body.dark-mode input[type=text]:focus,
body.dark-mode input[type=password]:focus,
body.dark-mode input[type=email]:focus,
body.dark-mode input[type=url]:focus,
body.dark-mode input[type=number]:focus,
body.dark-mode textarea.materialize-textarea:focus {
  border-bottom-color: #90caf9 !important;
  box-shadow: 0 1px 0 0 #90caf9 !important;
}

body.dark-mode th {
  color: #ffffff !important;
  border-bottom-color: #444 !important;
}

body.dark-mode td {
  border-bottom-color: #333 !important;
  color: #e0e0e0 !important;
}

body.dark-mode table.striped > tbody > tr:nth-child(odd) {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: #ffffff !important;
}

body.dark-mode a {
  color: #90caf9;
}

body.dark-mode nav a,
body.dark-mode .side-nav a,
body.dark-mode .bi-btn {
  color: #ffffff !important;
}

body.dark-mode .side-nav a:hover,
body.dark-mode .side-nav li.active > a {
  background-color: #333 !important;
}

/* Bi Module Specifics */
body.dark-mode .bi-header {
  background: linear-gradient(135deg, #1a237e 0%, #000000 100%) !important;
}

body.dark-mode .bi-card-header {
  background: linear-gradient(135deg, #2c3e50 0%, #1a1a1a 100%) !important;
}

body.dark-mode .bi-file-input {
  background: #2a2a2a !important;
  border-color: #555 !important;
}

body.dark-mode .bi-file-input:hover {
  background: #333 !important;
  border-color: #90caf9 !important;
}

body.dark-mode .bi-select {
  background: #2a2a2a !important;
  border-color: #555 !important;
  color: #e0e0e0 !important;
}

body.dark-mode .bi-btn {
  background: linear-gradient(135deg, #1565c0, #1a237e) !important;
}

/* Override side nav icon colors */
body.dark-mode .side-nav i.material-icons {
  color: #e0e0e0 !important;
}

body.dark-mode .bi-info-box strong { color: #e0e0e0 !important; }

/* GridView and Tables */
body.dark-mode table.items > tbody > tr:nth-child(odd) {
  background-color: #262626 !important;
}

body.dark-mode table.items > tbody > tr:nth-child(even) {
  background-color: #1a1a1a !important;
}

body.dark-mode table.items > tbody > tr.red-bg {
  background-color: #b71c1c !important; /* Darker red for dark mode */
}

body.dark-mode table.items > tbody > tr > td {
  background-color: transparent !important;
  color: #e0e0e0 !important;
}

body.dark-mode table.items > tbody > tr:hover {
  background-color: #333 !important;
}

body.dark-mode table th,
body.dark-mode table.items > thead > tr > th {
  background-color: #2c3e50 !important;
  color: #ffffff !important;
  border-bottom: 2px solid #555 !important;
}

/* Form Buttons */
body.dark-mode input[type=submit],
body.dark-mode input[type=button],
body.dark-mode button,
body.dark-mode .button,
body.dark-mode .btn,
body.dark-mode a.button {
  background-color: #1976d2 !important;
  color: #ffffff !important;
  border: 1px solid #1565c0 !important;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
}

body.dark-mode input[type=submit]:hover,
body.dark-mode input[type=button]:hover,
body.dark-mode button:hover,
body.dark-mode .button:hover,
body.dark-mode .btn:hover,
body.dark-mode a.button:hover {
  opacity: 0.9 !important;
}
