:root {
  /* Height of navbar controls (theme toggle pill). From ORMed v2. */
  --nav-control-height: 32px;
    --pico-spacing: 0.9rem;
    --pico-font-size: 16px;
    --pico-form-element-spacing-vertical: 0.5rem;
    --pico-form-element-spacing-horizontal: 0.5rem;
    --pico-typography-spacing-vertical: 1rem;
    --table-row-hover: #f5f5f5;
}

[data-theme=light],
:root:not([data-theme=dark]) {
  color-scheme: light;
  --form-element-background-color: #fff;
  --sidebar-background-color: #3c4b64;
  --sidebar-brand-background-color: rgba(0, 0, 21, 0.2);
  --sidebar-color: rgba(255, 255, 255, 0.8);
  --background-color: #eee;
  --card-background-color: #fff;
  --breadcrumbs-border-color: #eee;
  --breadcrumbs-box-shadow: 0 2px 2px 0 rgba(27, 40, 50, 0.2);
  --active-dark: #0172ad;
  
}

[data-theme=dark] {
  color-scheme: dark;
  --sidebar-background-color: #18232c;
  --sidebar-brand-background-color: #18232c;
  --sidebar-color: rgba(255, 255, 255, 0.8);
  --card-background-color: #18232c;
  --breadcrumbs-border-color: #333;
  --breadcrumbs-box-shadow: var(--pico-card-box-shadow);
  --background-color: #13171f;
  --table-row-hover: #24313d;
}

theme-toggle {
  --toggle-foreground-color: var(--pico-color);
  --toggle-background-color: var(--background-color);
}

sidebar-toggle {
  --toggle-foreground-color: var(--pico-color);
  margin-left: 16px;
}

.true-check {
  color: var(--pico-ins-color);
}

.false-check {
  color: var(--pico-del-color);
}

body {
  display: flex;
  flex-wrap: nowrap;
}

#main-wrapper {
  flex-basis: 0;
  flex-grow: 999;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

main {
  min-inline-size: 0%;
  --block-spacing-vertical: var(--pico-spacing) !important;
  padding-right: var(--pico-spacing) !important;
  padding-left: var(--pico-spacing) !important;
}


/* ── Sidebar: brand at top, nav in the middle, user at the bottom ──────────
   Ported rule-for-rule from ORMed v2 theme.css so the two apps match.
   Supersedes the older generation this file carried, where the brand was
   `aside li:first-child` inside the nav list; it is now a dedicated
   .sidebar-brand anchor outside <nav>, with .sidebar-footer holding the
   signed-in user and sign-off. That is what lets `aside nav` flex and
   scroll between them. The --sidebar-* variables above already existed
   and are unchanged. */

aside {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 20;
  background: var(--sidebar-background-color);
  height: 100vh;
  padding-left: calc(var(--pico-spacing) - 0.75rem) !important;
  padding-right: calc(var(--pico-spacing) - 0.75rem) !important;
  box-shadow: var(--pico-card-box-shadow);
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 60px;
  flex-shrink: 0;
  background-color: var(--sidebar-brand-background-color);
  margin-left: -4px;
  margin-right: -4px;
  padding: 4px 8px;
  text-decoration: none;
}
.sidebar-brand img {
  height: 36px;
  width: 36px;
  flex-shrink: 0;
}
.sidebar-brand__text {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
/* Open sidebar: a little extra breathing room on the left. */
aside.open .sidebar-brand {
  padding-left: 15px;
}
/* Collapsed sidebar: hide the wordmark, center the logo. */
aside:not(.open) .sidebar-brand {
  justify-content: center;
  padding: 4px;
}
aside:not(.open) .sidebar-brand__text {
  display: none;
}
aside nav {
  display: flex;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* Explicit, not decorative. Without it the computed value is `auto` (CSS
     Overflow spec: a `visible` axis becomes `auto` when the other axis is not
     visible), and the nowrap labels then scroll sideways. */
  overflow-x: hidden;
  /* Lets the nav shrink inside the flex column instead of being floored at its
     widest label's width. */
  min-width: 0;
  scrollbar-width: none; /* Firefox */
}
aside nav::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
aside:not(.open) {
 flex-basis: 64px;
}
aside:not(.open) nav ul li a span {
  display: none;
}
aside.open {
  flex-basis: 220px;
}
aside.open nav ul li a span {
  animation-delay: 0.2s;
  padding-left: 8px;
  /* v1 runs a lighter, slightly smaller label than ORMed's 16px/600 — which
     also buys the vertical room for the extra items. */
  font-size: 15px;
  font-weight: 500;
}
aside nav ul li:hover {
  background-color: var(--pico-primary);
  color: var(--pico-contrast);
}
aside nav ul li.active {
  background-color: #0172ad;
  color: var(--pico-contrast);
}
aside nav ul li a {
  color: var(--sidebar-color);
  /* Density tuned to v1, which fits ~15 items where 1rem padding fit ~11.
     Measured off the v1 screenshot at ~47px per row; 0.7rem top+bottom plus a
     15px line lands about there. */
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  margin-left: 4px;
  margin-right: 4px;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 0;
  transition: background .15s ease,color .15s ease;
}
aside nav ul {
  width: 100%;
}
aside nav ul li a svg {
  display: inline-block;
  /* Scaled down with the label so the icon does not set the row height. */
  transform: scale(1.1);
  margin: 0;
}
aside nav ul:first-child {
  margin-right: 0;
}
aside nav ul:last-child {
  margin-left: 0;
}
/* ── Sidebar footer: user identity at the bottom ──────────────────────── */

.sidebar-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 12px;
  min-height: 56px;
}
.sidebar-footer__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.sidebar-footer__name {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.sidebar-footer__email {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.sidebar-footer__action {
  flex-shrink: 0;
  margin: 0;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}
.sidebar-footer__action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sidebar-footer__action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}
.sidebar-footer__action-btn svg {
  display: block;
}
/* Collapsed sidebar: hide text and sign-out, center avatar */
aside:not(.open) .sidebar-footer {
  justify-content: center;
  padding: 10px 0;
}
aside:not(.open) .sidebar-footer__info,
aside:not(.open) .sidebar-footer__action {
  display: none;
}

















#breadcrumbs {
  position: sticky;
  top: 60px;
  z-index: 2;
  height: 48px;
  background: var(--card-background-color);
  border-top: solid 1px var(--breadcrumbs-border-color);
}

#breadcrumbs li:first-child {
  margin-left: 16px;
}

#breadcrumbs a {
  color: var(--h1-color);
  font-weight: 500;
}

.menu-opener {
  margin-left: 16px;
}

.menu-opener svg {
  display: inline-flex;
  transform: scale(1.25);
  align-self: center;
}

.menu-opener svg:hover {
  display: inline-flex;
  transform: scale(1.3);
  color: var(--contrast);
}



















#main-wrapper > nav:first-of-type {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 60px;
  background: var(--card-background-color);
  padding-right: 16px;
}

#main-wrapper > nav:last-of-type {
  box-shadow: var(--breadcrumbs-box-shadow);
}

body > nav ul li form {
  margin-bottom: 0;
}

body > nav ul li form input[type="search"] {
  margin-bottom: 0;
}

summary > img {
  height: 32px;
  width: 32px;
  border-radius: 16px;
}

th {
  font-weight: 600;
}

td {
  font-size: 14px;
}

td > img {
  height: 32px;
  width: 32px;
  border-radius: 16px;
}

td > a[role="button"] {
  font-size: 14px;
  padding: 4px;
}

div[role="group"] > a[role="button"] {
  font-size: 14px;
  padding: 4px;
}

td > div[role="group"] > a[role="button"] {
  min-width: 100px;
  max-width: 100px;
}

summary[role="button"] {
  font-size: 14px;
  padding: 4px;
  max-width: 200px;
}

.dropdown > ul > li > a {
  font-size: 22px;
  margin: 1rem;
}

h4 > a[role="button"] {
  font-size: 14px;
  padding: 5px 10px 5px 10px;
  margin-left: 10px;
}

article {
  margin-top: var(--pico-spacing);
}

article > header > nav > ul > li > a[role="button"] {
  font-size: 14px;
  padding: 5px 10px 5px 10px;
}

td > a[role="button"] > svg {
  transform: scale(0.75);
}

article > header > nav > ul > li {
  padding-top: 2px;
  padding-bottom: 2px;
}

dt {
  font-weight: 600;
}

dd {
  min-height: 24px;
  margin-bottom: 6px;
}

.fullwidth {
  width: 100%;
}

.tooltip {
  position: relative;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: black;
  color: #fff;
  text-align: center;
  padding: 5px 0;
  border-radius: 6px;
  left: 80%;
  position: absolute;
  z-index: 1;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
}
table[role="grid"] tbody tr:hover td {
  background-color: var(--table-row-hover) !important;
}

.red-text {
  color: var(--pico-del-color);
}
.green-text {
  color: var(--pico-ins-color); 
} 
.grey-text {
  color: var(--pico-muted-color);
}

/* ── Navbar icon pill ──────────────────────────────────────────────────────
   From ORMed v2. Groups the theme toggle (and later a help button) into a
   single pill. --nav-control-height is defined here because ORMed sets it in
   a :root block this port deliberately does not copy — copying that block
   wholesale would override HealthEd's own brand colours. */
/* Groups theme + help into a pill for visual unity */
.nav-icon-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: var(--nav-control-height);
  background: color-mix(in srgb, var(--pico-muted-color, #888) 10%, transparent);
  border: 1px solid var(--muted-border-color, rgba(0,0,0,0.12));
  border-radius: 2rem;
  padding: 2px 4px;
  box-sizing: border-box;
}
[data-theme="dark"] .nav-icon-group {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}
.nav-icon-btn {
  background: transparent;
  border: none;
  padding: 0 0.4rem;
  margin: 0;
  height: 100%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.5rem;
  color: var(--pico-muted-color, #666);
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.nav-icon-btn:hover,
.nav-icon-btn:focus {
  background: color-mix(in srgb, var(--pico-primary, #0172ad) 12%, transparent);
  color: var(--pico-primary, #0172ad);
  outline: none;
}
theme-toggle {
  padding: 0 0.4rem;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.5rem;
  cursor: pointer;
  transition: background 0.15s;
}
theme-toggle:hover {
  background: color-mix(in srgb, var(--pico-primary, #0172ad) 12%, transparent);
}
