:root {
  --bs-font-sans-serif: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --app-bg: #f8fafc;
  --brand: #059669;
  --brand-dark: #047857;
  --brand-soft: #ecfdf5;
  --sidebar-w: 300px;
  --bs-primary: #059669;
  --bs-primary-rgb: 5, 150, 105;
  --bs-link-color-rgb: 5, 150, 105;
  --bs-link-hover-color-rgb: 4, 120, 87;
}
[data-bs-theme="dark"] {
  --app-bg: #020617;
  --bs-body-bg: #0f172a;
  --brand-soft: rgba(16, 185, 129, 0.12);
  --bs-primary: #10b981;
  --bs-primary-rgb: 16, 185, 129;
  --bs-link-color-rgb: 52, 211, 153;
  --bs-link-hover-color-rgb: 110, 231, 183;
}

body { background: var(--app-bg); }

/* Brand button + focus colours */
.btn-primary {
  --bs-btn-bg: #059669; --bs-btn-border-color: #059669;
  --bs-btn-hover-bg: #047857; --bs-btn-hover-border-color: #047857;
  --bs-btn-active-bg: #047857; --bs-btn-active-border-color: #047857;
  --bs-btn-disabled-bg: #059669; --bs-btn-disabled-border-color: #059669;
  --bs-btn-focus-shadow-rgb: 16, 185, 129;
  font-weight: 600;
}
.form-control:focus, .form-select:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.2);
}
.form-check-input:checked { background-color: #059669; border-color: #059669; }
.card { --bs-card-border-radius: 1rem; --bs-card-inner-border-radius: 1rem; }
/*.btn, .form-control { border-radius: 0.75rem; }*/

/* Sidebar: fixed on desktop, slide-in drawer on mobile */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040;
  display: flex; flex-direction: column;
  background: var(--bs-body-bg); border-right: 1px solid var(--bs-border-color);
  transform: translateX(-100%); transition: transform 0.2s ease;
}
.sidebar.open { transform: none; }
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 1030; background: rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
.main { min-height: 100vh; }
@media (min-width: 992px) {
  .sidebar { transform: none; }
  .main { margin-left: var(--sidebar-w); }
}

.logo-mark {
  width: 45px; height: 36px; border-radius: 0.6rem; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700;
}
.nav-app .nav-link {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.85rem;
  border-radius: 0.75rem; color: var(--bs-secondary-color); font-weight: 500; font-size: 0.9rem;
}
.nav-app .nav-link:hover { background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.nav-app .nav-link.active { background: var(--brand-soft); color: var(--brand-dark); }
[data-bs-theme="dark"] .nav-app .nav-link.active { color: #34d399; }

.topbar {
  position: sticky; top: 0; z-index: 1020; height: 64px;
  background: color-mix(in srgb, var(--bs-body-bg) 85%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--bs-border-color);
}
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0;
  background: transparent; color: var(--bs-secondary-color); border-radius: 0.75rem; font-size: 1.15rem;
}
.icon-btn:hover { background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.stat-icon { width: 36px; height: 36px; border-radius: 0.6rem; display: grid; place-items: center; }
.brand-panel { background: var(--brand-dark); color: #fff; position: relative; overflow: hidden; }
.brand-panel::after {
  content: ""; position: absolute; right: -8rem; bottom: -8rem; width: 24rem; height: 24rem;
  border-radius: 50%; border: 40px solid rgba(255, 255, 255, 0.05);
}

/* User dropdown (top right) */
.user-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--bs-border-color); background: var(--brand-soft); color: var(--brand-dark);
  font-size: 1.15rem; transition: box-shadow 0.15s;
}
.user-btn:hover, .user-btn.show { box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25); }
[data-bs-theme="dark"] .user-btn { color: #34d399; }
.user-avatar {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 700;
}
.dropdown-menu .dropdown-item { padding: 0.5rem 0.75rem; font-size: 0.9rem; }


/* Sidebar accordion */
.nav-app .nav-link .chevron { font-size: 0.75rem; transition: transform 0.2s ease; }
.nav-app .nav-link[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.nav-app .nav-link[aria-expanded="true"] { color: var(--bs-body-color); }

.nav-sub {
  margin-left: 1.05rem;
  padding-left: 0.6rem;
  border-left: 1px solid var(--bs-border-color);
}
.nav-sub .nav-link {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  margin: 0.15rem 0;
}

.nav-app .nav-link.active[aria-expanded="true"] { color: var(--bs-body-color); background: var(--brand-soft); }
[data-bs-theme="dark"] .nav-app .nav-link.active[aria-expanded="true"] { color: #34d399; }
.nav-sub .nav-link.active { background: transparent; color: var(--brand-dark); font-weight: 600; }
[data-bs-theme="dark"] .nav-sub .nav-link.active { color: #34d399; }

.desktop-toggle { display: none; }
.navbar_header{
	justify-content:end;
}
/* Desktop: toggle = full sidebar <-> icons only. In icons-only mode, hovering the sidebar shows it in full. */
@media (min-width: 992px) {
  :root { --sidebar-mini: 68px; }
  .sidebar { overflow-x: hidden; white-space: nowrap; transition: width 0.2s ease, box-shadow 0.2s ease; }
  .main    { transition: margin-left 0.2s ease; }
  .logo-mark, .sidebar .rounded-circle { flex-shrink: 0; }
.desktop-toggle { display: inline-grid; }
.navbar_header{
	justify-content:space-between;
}
  /* icons only */
  html.sb-collapsed .sidebar { width: var(--sidebar-mini); }
  html.sb-collapsed .main    { margin-left: var(--sidebar-mini); }

  /* hover or keyboard focus: full width, floating over the page (content does not move) */
  html.sb-collapsed .sidebar:hover,
  html.sb-collapsed .sidebar:focus-within {
    width: var(--sidebar-w);
    box-shadow: 8px 0 28px rgba(2, 6, 23, 0.22);
    transition-delay: 0.08s;                       /* small pause, so passing the mouse by does not open it */
  }

  /* in the strip: hide the labels, centre the icons, hide arrows and submenus */
  html.sb-collapsed .sidebar:not(:hover):not(:focus-within) .nav-app .nav-link {
    font-size: 0; gap: 0; justify-content: center; padding-left: 0; padding-right: 0;
  }
  html.sb-collapsed .sidebar:not(:hover):not(:focus-within) .nav-app .nav-link .chevron,
  html.sb-collapsed .sidebar:not(:hover):not(:focus-within) .nav-sub { display: none !important; }
  html.sb-collapsed .sidebar .nav-app .nav-link > i.bi:first-child { font-size: 1.15rem; }
}

@media (min-width: 1400px) {
    .container,
    .container-lg,
    .container-md,
    .container-sm,
    .container-xl,
    .container-xxl {
        max-width: none !important;
    }
}