:root {
  --sidebar-width: 280px;
  --transition-speed: 0.3s;
  --sidebar-bg: #ffffff;
  --sidebar-shadow: rgba(15, 23, 42, 0.08) 0px 10px 25px -5px, rgba(15, 23, 42, 0.04) 0px 8px 10px -6px;
  --overlay-bg: rgba(15, 23, 42, 0.3);
  --link-hover-bg: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --brand-orange: #007f2d;
  --brand-orange-hover: #006623;
}

/* =========================
   Body Reset
========================= */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8fafc;
  color: var(--text-main);
}

/* =========================
   Hamburger Button (Squish-Resistant)
========================= */
#hamburger {
  position: fixed;
  top: 18px;
  left: 18px;
  padding: 8px;
  cursor: pointer;
  z-index: 1000;
  display: block; 
  background: transparent;
  border: none;
}

#hamburger .bar {
  display: block;
  width: 24px;
  height: 3px;
  margin: 5px 0;
  background: white;
  border-radius: 4px;
  transition: all var(--transition-speed) ease;
}

#hamburger:hover .bar {
  background: var(--brand-green);
}

/* =========================
   Overlay
========================= */
#overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1050;
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
}

#overlay.visible {
  display: block;
  opacity: 1;
}

/* =========================
   Sidebar
========================= */
#mySidebar {
  position: fixed;
  top: 0;
  left: -280px;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  box-shadow: var(--sidebar-shadow);
  transition: left var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1100;
  display: flex;
  flex-direction: column;
}

#mySidebar.open {
  left: 0;
}

/* =========================
   Sidebar Top (Logo + Close)
========================= */
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.logoH {
  display: block;
  width: 44px;
  height: 44px;
  /* Absolute asset targeting path: Change /assets/ to reflect your true local subfolder if working inside one */
  background: url("/assets/images/logo-gold.png") no-repeat center;
  background-size: contain;
}

#closeBtn {
  font-size: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

#closeBtn:hover {
  color: #ef4444;
  background-color: #fef2f2;
}

/* =========================
   Sidebar Core Links Setup
========================= */
.sidebar-links {
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 4px;
  overflow-y: auto;
  margin-bottom: auto; 
}

#mySidebar a, 
.dropdown-btn {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  width: auto;
  cursor: pointer;
  text-align: left;
}

#mySidebar a:hover, 
.dropdown-btn:hover {
  background: var(--link-hover-bg);
  color: var(--text-main);
}

/* Styled Primary Admin Dashboard bar accent */
.admin-btn {
  background-color: #7c1400 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  margin-bottom: 4px;
}
.admin-btn:hover {
  background-color: #0f172a !important;
}

/* Styled Home Dashboard link block below Admin layout */
.home-dashboard-btn {
  background-color: #f1f5f9 !important;
  color: var(--text-main) !important;
  font-weight: 600 !important;
  margin-bottom: 8px;
}
.home-dashboard-btn:hover {
  background-color: #e2e8f0 !important;
}

/* Highlight dynamic active layouts */
#mySidebar a.active {
  background-color: #fff4f3;  
  color: #aa1c00;
  font-weight: 600;
}

#mySidebar a.active:hover {
  background-color: #e6fded;
}

/* =========================
   Categories Dropdown Elements
========================= */
.dropdown-btn {
  justify-content: space-between;
}

.dropdown-btn .arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition-speed) ease;
}

.dropdown-btn.active {
  color: var(--text-main);
}

.dropdown-btn.active .arrow {
  transform: rotate(90deg);
}

.dropdown-container {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 12px;
  margin: 2px 0 6px 0;
  border-left: 1px solid #fff4f3;
}

.dropdown-container.show {
  display: flex;
}

.dropdown-container a {
  font-size: 13.5px !important;
  padding: 10px 16px !important;
}

/* =========================
   Account Button (Bottom)
========================= */
.account {
  margin: 16px;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff !important;
  background-color: #0f4000;
  border-radius: 8px;
  transition: all 0.2s ease;
  width: calc(100% - 32px);
  box-sizing: border-box;
  justify-content: center;
}

.account:hover {
  background-color: var(--brand-green-hover);
  color: #ffffff !important;
}

/* =========================
   Responsive Breakpoints
========================= */
@media (max-width: 768px) {
  :root { --sidebar-width: 260px; }
  #mySidebar a, .dropdown-btn { font-size: 13.5px; padding: 11px 14px; }
}