﻿/* AdminLTE override - custom color palette
   Primary: Orange  #E9531D
   Secondary: Blue  #003366
   ONLY modify visual styles here. Keep specificity high and use !important where needed to override AdminLTE defaults.
*/
:root {
  --uni-primary: #E9531D; /* Orange */
  --uni-secondary: #003366; /* Deep Blue */
}

/* Global text/link colors */
/* Apply secondary blue to regular anchors, but avoid forcing .nav-link (sidebar) to blue which hurts contrast */
a {
  color: var(--uni-secondary) !important;
}
a:hover {
  color: var(--uni-primary) !important;
}

/* Sidebar-specific: ensure nav links are readable on dark background */
.nav-sidebar .nav-link,
.sidebar-dark-primary .nav-sidebar .nav-link,
.nav-sidebar .nav-treeview .nav-link {
  color: rgba(255,255,255,0.92) !important; /* readable light text */
}
.nav-sidebar .nav-link:hover,
.nav-sidebar .nav-treeview .nav-link:hover {
  color: var(--uni-primary) !important;
}

/* Make the user-panel name readable (was too dim) */
.user-panel .info,
.user-panel .info a,
.user-panel .info p {
  color: rgba(255,255,255,0.92) !important;
}
.user-panel .info a:hover {
  color: var(--uni-primary) !important;
}

/* Icon color inside sidebar (e.g., the circle indicators) */
.nav-sidebar .nav-icon,
.nav-sidebar .nav-treeview .nav-icon {
  color: rgba(255,255,255,0.65) !important;
}

/* Brand / header */
.brand-link {
  background-color: var(--uni-secondary) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important; /* center horizontally */
  padding: .45rem .5rem !important;
}
.brand-link .brand-image img {
  opacity: 0.95;
}
.brand-link .brand-text {
  color: #ffffff !important;
}

/* Hide the filler span used earlier to preserve spacing (we center via flexbox instead) */
.brand-link .brand-filler {
  display: none !important;
}

/* Ensure the SVG logo inside .brand-link is centered and doesn't carry extra left margin */
.brand-link img.brand-image {
  margin-left: 0 !important;
  display: inline-block !important;
}

/* Main navbar */
.main-header .navbar {
  background-color: var(--uni-secondary) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}
.main-header .navbar .nav-link,
.main-header .navbar .navbar-nav .user-panel a {
  color: #ffffff !important;
}

/* Sidebar background and links */
.main-sidebar {
  background-color: #071a2b !important; /* keep dark base for contrast */
  min-height: 100vh !important; /* ensure sidebar covers full viewport height */
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  height: 100vh !important;
  overflow-y: auto !important;
}
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link {
  color: rgba(255,255,255,0.9) !important;
}
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link:hover {
  background-color: rgba(0,0,0,0.04) !important;
  color: var(--uni-primary) !important;
}
/* Active/selected sidebar item */
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
.nav-pills .nav-link.active {
  background-color: var(--uni-primary) !important;
  color: #ffffff !important;
  border-left-color: var(--uni-primary) !important;
}

/* Buttons */
.btn-primary {
  background-color: var(--uni-primary) !important;
  border-color: var(--uni-primary) !important;
  color: #ffffff !important;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: #cf4016 !important; /* slightly darker orange */
  border-color: #cf4016 !important;
  color: #fff !important;
}
.btn-outline-primary {
  color: var(--uni-primary) !important;
  border-color: var(--uni-primary) !important;
}
.btn-outline-primary:hover {
  background-color: var(--uni-primary) !important;
  color: #ffffff !important;
}

/* Badges, bg utilities */
.bg-primary, .badge-primary,
.badge.bg-primary {
  background-color: var(--uni-primary) !important;
  color: #ffffff !important;
}
.text-primary {
  color: var(--uni-primary) !important;
}

/* Cards and headers */
.card.card-primary > .card-header,
.card.card-primary .card-header {
  background-color: var(--uni-secondary) !important;
  border-color: var(--uni-secondary) !important;
  color: #ffffff !important;
}
.card .card-header {
  background-color: rgba(0,0,0,0.02) !important;
}

/* Form controls focus states */
.form-control:focus,
.input-group-text:focus {
  border-color: var(--uni-primary) !important;
  box-shadow: 0 0 0 .2rem rgba(233,83,29,0.18) !important;
}

/* Progress bars, switches */
.progress-bar,
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--uni-primary) !important;
  border-color: var(--uni-primary) !important;
}

/* Small components */
.badge-pill.badge-primary,
.info-box .info-box-icon.bg-primary,
.callout.callout-primary {
  background-color: var(--uni-primary) !important;
  color: #ffffff !important;
}

/* Tables - header accent */
.table thead th {
  background-color: rgba(0,0,0,0.03) !important;
}
.table-hover tbody tr:hover {
  background-color: rgba(233,83,29,0.04) !important;
}

/* Breadcrumbs */
.breadcrumb {
  background: transparent !important;
}
.breadcrumb .breadcrumb-item a {
  color: var(--uni-secondary) !important;
}

/* Footer */
.main-footer {
  background-color: #021226 !important;
  color: rgba(255,255,255,0.7) !important;
  border-top: 1px solid rgba(255,255,255,0.04) !important;
}

/* Misc overrides for components that rely on AdminLTE "primary" variable */
.btn.btn-tool.text-primary,
.link-muted.text-primary {
  color: var(--uni-primary) !important;
}

/* Ensure forms of collapsed/expanded elements highlight with primary */
.nav-sidebar .menu-open > .nav-treeview,
.nav-sidebar .menu-open > .nav-treeview > .nav-item > .nav-link.active {
  background-color: rgba(233,83,29,0.06) !important;
  color: var(--uni-primary) !important;
}

/* Make sure badges/icons inside header menus use secondary color where appropriate */
.dropdown-menu .dropdown-item .fas,
.dropdown-menu .dropdown-item .ion {
  color: var(--uni-secondary) !important;
}

/* Utility: accent borders */
.border-accent-primary {
  border-color: var(--uni-primary) !important;
}
.border-accent-secondary {
  border-color: var(--uni-secondary) !important;
}

/* Responsive: keep overrides intact on small screens */
@media (max-width: 575.98px) {
  .brand-link {
    padding: .45rem .5rem !important;
  }
}

/* Sticky footer additions */
/* Fix the AdminLTE main footer to the bottom of the viewport and ensure content isn't hidden underneath it. */
.main-footer {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  z-index: 1030; /* above normal content but below modals */
}

/* Provide bottom padding on the app wrapper so the page content doesn't overlap the fixed footer. Adjust the padding to match footer height if you customize the footer size. */
.app-wrapper {
  padding-bottom: 3.5rem; /* ~56px, adjust if footer height changes */
}

/* On very small screens reduce the padding so the footer doesn't take too much space */
@media (max-width: 575.98px) {
  .app-wrapper {
    padding-bottom: 4.5rem; /* keep a bit more space on small screens if footer wraps */
  }
}
