@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
  --allende-guinda: #80142b;
  --allende-dorado: #b5935e;
  --allende-gris-fondo: #f8f9fc;
  --allende-gris-hover: rgba(31, 41, 55, 0.05);
  --allende-text: #1f2937;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--allende-text);
  background-color: #f8f9fc;
}

#content-wrapper,
#wrapper {
  background-color: #f8f9fc !important;
}

/* Typography for titles */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-weight: 700;
}

/* Sidebar (Elegancia) */
#accordionSidebar.sidebar,
#accordionSidebar {
  background-image: none !important;
  background-color: #ffffff !important;
  box-shadow: none !important;
  border: 0 !important;
  border-right: 1px solid rgba(31, 41, 55, 0.08) !important;
}

.sidebar .nav-item .nav-link,
.sidebar .nav-item .nav-link i,
.sidebar .nav-item .nav-link span {
  color: var(--allende-guinda) !important;
  font-weight: 600;
}

.sidebar .nav-item .nav-link:hover {
  background-color: #fff5f5 !important;
}

.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item .nav-link:hover span {
  font-weight: 700;
}

.sidebar .nav-item.active .nav-link {
  background-color: #fff5f5 !important;
}

/* Brand/logo container */
.sidebar .sidebar-brand {
  background-color: #ffffff !important;
  margin: 0;
  border-radius: 0;
  box-shadow: none !important;
}

.sidebar .sidebar-brand,
.sidebar .sidebar-brand i,
.sidebar .sidebar-brand-text,
.sidebar .sidebar-brand-text small {
  color: var(--allende-guinda) !important;
}

.sidebar .sidebar-heading {
  color: rgba(31, 41, 55, 0.7) !important;
}

.sidebar-divider {
  border-top: 1px solid rgba(31, 41, 55, 0.12) !important;
}

/* Topbar */
.top-contact-bar {
  height: 30px;
  background-color: var(--allende-guinda);
  color: #ffffff;
  font-size: 0.85rem;
}

.top-contact-bar a {
  color: #ffffff;
  text-decoration: none;
}

.top-contact-bar a:hover {
  text-decoration: underline;
}

.topbar.navbar {
  background-color: #ffffff !important;
  box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1) !important;
  border-bottom: 3px solid var(--allende-dorado) !important;
}

/* Topbar hamburger (sidebar toggle) */
.topbar #sidebarToggleTop,
.topbar #sidebarToggleTop.btn,
.topbar #sidebarToggleTop.btn-link,
.topbar #sidebarToggleTop i {
  color: var(--allende-guinda) !important;
}

.topbar #sidebarToggleTop:hover,
.topbar #sidebarToggleTop:focus {
  background-color: rgba(128, 20, 43, 0.08) !important;
  text-decoration: none !important;
}

.topbar #sidebarToggleTop:active {
  background-color: rgba(128, 20, 43, 0.12) !important;
}

/* Cards */
.card {
  border-radius: 15px !important;
  border: 0 !important;
  box-shadow: 0 0.35rem 1.25rem rgba(0, 0, 0, 0.08) !important;
}

.card-header {
  background-color: #ffffff !important;
  border-bottom: 0 !important;
}

.card-header .text-primary,
.card-header .m-0.text-primary {
  color: var(--allende-guinda) !important;
  font-weight: 700 !important;
}

.text-primary,
a.text-primary {
  color: var(--allende-guinda) !important;
}

/* Buttons */
.btn-primary {
  background-color: var(--allende-guinda) !important;
  border: 0 !important;
  border-radius: 25px !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #5f0f20 !important;
}

.btn-warning {
  background-color: var(--allende-dorado) !important;
  border: 0 !important;
  color: #ffffff !important;
  border-radius: 25px !important;
}

.btn-warning:hover,
.btn-warning:focus {
  background-color: #9b7e50 !important;
}

.btn-info {
  background-color: #6b7280 !important;
  border: 0 !important;
  color: #ffffff !important;
  border-radius: 25px !important;
}

.btn-success {
  background-color: var(--allende-guinda) !important;
  border: 0 !important;
  color: #ffffff !important;
  border-radius: 25px !important;
}

.btn-success:hover,
.btn-success:focus {
  background-color: #5f0f20 !important;
}

.btn-secondary {
  border-radius: 25px !important;
}

/* Forms */
.form-control,
select.form-control,
textarea.form-control {
  background-color: #ffffff !important;
  color: #111827 !important;
  border: 1px solid rgba(31, 41, 55, 0.2) !important;
}

select,
select.form-control,
select.custom-select,
select.form-select {
  background-color: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #ced4da !important;
}

select:focus,
select.form-control:focus,
select.custom-select:focus,
select.form-select:focus {
  border-color: var(--allende-guinda) !important;
  box-shadow: 0 0 0 0.2rem rgba(128, 20, 43, 0.18) !important;
}

select option,
select optgroup {
  background-color: #ffffff !important;
  color: #111827 !important;
}

.form-control::placeholder {
  color: rgba(17, 24, 39, 0.55) !important;
}

.form-control:focus {
  border-color: var(--allende-dorado) !important;
  box-shadow: 0 0 0 0.2rem rgba(181, 147, 94, 0.25) !important;
}

/* Prevent gray inputs on focus/autofill (SB Admin 2 + browsers) */
input.form-control,
input.form-control-user,
textarea.form-control,
select.form-control,
select.custom-select {
  background-color: #ffffff !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}

input.form-control:focus,
input.form-control-user:focus,
textarea.form-control:focus,
select.form-control:focus,
select.custom-select:focus {
  background-color: #ffffff !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}

input.form-control:-webkit-autofill,
input.form-control:-webkit-autofill:hover,
input.form-control:-webkit-autofill:focus,
input.form-control-user:-webkit-autofill,
input.form-control-user:-webkit-autofill:hover,
input.form-control-user:-webkit-autofill:focus,
textarea.form-control:-webkit-autofill,
textarea.form-control:-webkit-autofill:hover,
textarea.form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: #111827 !important;
  box-shadow: 0 0 0px 1000px #ffffff inset !important;
  transition: background-color 50000s ease-in-out 0s;
}

label,
.form-label {
  color: #111827 !important;
  font-weight: 600;
}

.text-gray-800 {
  color: #111827 !important;
}

/* Dorado section header (e.g. form sections) */
.allende-section-card .card-header {
  background-color: var(--allende-dorado) !important;
}

.allende-section-card .card-header .text-primary,
.allende-section-card .card-header h6 {
  color: #ffffff !important;
}

/* Tables */
.table thead th {
  background-color: var(--allende-guinda) !important;
  color: #ffffff !important;
  border: 0 !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.table-hover tbody tr:hover {
  background-color: #fffaf0 !important;
}

.table tbody tr:nth-of-type(odd) {
  background-color: rgba(31, 41, 55, 0.03);
}

.table-bordered,
.table-bordered td,
.table-bordered th {
  border-color: rgba(31, 41, 55, 0.08) !important;
}

/* DataTables controls */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter select {
  background-color: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #ced4da !important;
  border-radius: 0.35rem !important;
  height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
}

.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
  color: #111827 !important;
  font-weight: 600;
}

/* Alerts - readability (texto negro para máxima visibilidad) */
.alert,
.alert-info,
.alert-success,
.alert-warning,
.alert-danger {
  color: #000000 !important;
  font-weight: 500;
}

/* Footer (Institucional definitivo) */
footer.sticky-footer,
.sticky-footer {
  background-color: #ffffff !important;
  padding: 1rem 0 !important;
  border-top: 2px solid var(--allende-guinda) !important;
}

.sticky-footer .copyright,
.sticky-footer .copyright span {
  color: #374151 !important;
  text-align: center;
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
  background-color: var(--allende-guinda) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.mobile-bottom-nav .nav-item,
.mobile-bottom-nav .nav-item i,
.mobile-bottom-nav .nav-item span {
  color: #ffffff !important;
}

.mobile-bottom-nav .nav-item.active {
  background-color: rgba(255, 255, 255, 0.15);
}

.mobile-bottom-nav .nav-item.active i,
.mobile-bottom-nav .nav-item.active span {
  color: #ffffff !important;
  font-weight: 700;
}

.mobile-bottom-nav .nav-item.create-btn {
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 14px;
}

/* Mobile sidebar (if shown by JS) */
#accordionSidebar.show,
.sidebar.show {
  background-color: #ffffff !important;
}

#accordionSidebar.show .nav-link,
#accordionSidebar.show .nav-link i,
#accordionSidebar.show .nav-link span {
  color: var(--allende-guinda) !important;
}

/* Dashboard grid component */
.allende-dept-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 992px) {
  .allende-dept-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 576px) {
  .allende-dept-grid {
    grid-template-columns: 1fr;
  }
}

.allende-dept-item {
  background: #ffffff;
  border-radius: 15px;
  padding: 1.25rem;
  border: 0;
  border-top: 4px solid var(--allende-dorado);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  text-align: center;
}

.allende-dept-item:hover {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
  transform: translateY(-5px);
}

.allende-dept-item .dept-icon {
  font-size: 2.3rem;
  color: var(--allende-guinda);
  margin-bottom: 0.75rem;
}

.allende-dept-item .dept-title {
  font-weight: 700;
  color: var(--allende-guinda);
}

.allende-dept-item:focus,
.allende-dept-item:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(181, 147, 94, 0.35);
}
