:root{
  /* How2behealthy palette (sampled from brand visuals) */
  --h2bh-primary: #107060;      /* teal */
  --h2bh-primary-rgb: 16,112,96;
  --h2bh-secondary: #9b7a5f;    /* warm sand */
  --h2bh-secondary-rgb: 155,122,95;

  /* Theme */
  --sidebar-width: 280px;
  --sidebar-bg-top: #0b2a26;
  --sidebar-bg-bottom: #071e1b;
  --sidebar-border: rgba(255,255,255,.08);
  --sidebar-link: rgba(255,255,255,.88);
  --sidebar-muted: rgba(255,255,255,.55);
  --sidebar-hover-bg: rgba(16,112,96,.18);
  --sidebar-active-bg: rgba(16,112,96,.28);
  --card-radius: 1rem;
  --control-radius: .75rem;

  /* Bootstrap 5.3 CSS variables override */
  --bs-primary: var(--h2bh-primary);
  --bs-primary-rgb: var(--h2bh-primary-rgb);
  --bs-secondary: var(--h2bh-secondary);
  --bs-secondary-rgb: var(--h2bh-secondary-rgb);
  --bs-link-color: var(--h2bh-primary);
  --bs-link-hover-color: #0c5b4e;
}

/* Topbar */
.app-topbar{
  background: linear-gradient(180deg, var(--sidebar-bg-top), var(--sidebar-bg-bottom));
  border-bottom: 1px solid var(--sidebar-border);
}

/* Mark (small brand dot) */
.app-mark{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--h2bh-primary);
  box-shadow: 0 0 0 3px rgba(16,112,96,.18);
  display: inline-block;
}

/* Sidebar */
.sidebar{
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  min-height: 100vh;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, var(--sidebar-bg-top), var(--sidebar-bg-bottom));
  color: #fff;
  border-right: 1px solid var(--sidebar-border);
}
.sidebar .border-bottom,
.sidebar .border-top{
  border-color: var(--sidebar-border) !important;
}

.app-nav .nav-section{
  color: var(--sidebar-muted);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .75rem .75rem .25rem;
}

.sidebar .nav-link{
  color: var(--sidebar-link);
  border-radius: .75rem;
  padding: .6rem .75rem;
  margin: 0 .25rem;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.sidebar .nav-link i{
  font-size: 1.05rem;
  opacity: .95;
}
.sidebar .nav-link:hover{
  background: var(--sidebar-hover-bg);
  color: #fff;
}
.sidebar .nav-link.active{
  background: var(--sidebar-active-bg);
  color: #fff;
  font-weight: 600;
  border-left: 3px solid var(--h2bh-primary);
  padding-left: calc(.75rem - 3px);
  box-shadow: inset 0 0 0 1px rgba(16,112,96,.30);
}

/* Content */
.content{
  min-width: 0;

  min-height: 100vh;
}
.content .container-fluid{
  max-width: 1400px;
}

/* Cards & controls */
.card{
  border-radius: var(--card-radius);
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card .card-header{
  background: transparent;
  border-bottom: 1px solid rgba(15,23,42,.08);
  font-weight: 600;
}
.btn{ border-radius: var(--control-radius); }
.form-control, .form-select, .input-group-text{ border-radius: var(--control-radius); }

/* Tables: nicer on mobile */
.table-responsive{ -webkit-overflow-scrolling: touch; }
.table thead th{
  background: rgba(16,112,96,.06);
}

/* Improve focus ring with brand */
.btn:focus-visible,
.form-control:focus,
.form-select:focus{
  box-shadow: 0 0 0 .25rem rgba(16,112,96,.25) !important;
}

/* Prevent horizontal page scroll from long strings */
html, body { height: 100%; }
body { overflow-x: hidden; }
.app { width: 100%; min-height: 100vh; }
.sidebar { height: 100vh; overflow-y: auto; overflow-x: hidden; }
.content { overflow-x: hidden; }

/* Wrap long JSON / strings inside <pre> without causing horizontal scrollbars */
.pre-wrap { white-space: pre-wrap; word-break: break-word; overflow-x: auto; }

/* Table cells wrapping */
.table td, .table th { vertical-align: middle; }


/* Layout tweaks for a cleaner, modern feel */
.main-layout { display:flex; min-height: 100vh; width:100%; }
.sidebar { width: 260px; min-width: 260px; max-width: 260px; }
.content { flex:1; min-width:0; padding: 1rem; }
@media (max-width: 991.98px) {
  .sidebar { width: 240px; min-width: 240px; max-width: 240px; }
  .content { padding: .75rem; }
}

/* Cards and tables */
.card { border-radius: 16px; }
.table-responsive { border-radius: 16px; }
.table thead th { white-space: nowrap; }
