/* ED Schedules — shared styles. Module-specific styles go in sections below with a header comment. */

:root {
  --eds-vic: #1fb714;
  --eds-uh: #e6c200;
  --eds-sjh: #8e7cc3;
  --eds-needs: #dc3545;
  --eds-mine: rgba(13, 110, 253, .12);
}
/* #dc3545 is only ~3.4:1 on the dark body; this is Bootstrap's dark danger-text-emphasis (~6:1). */
[data-bs-theme="dark"] { --eds-needs: #ea868f; }

body { font-size: .95rem; }
.navbar-brand { font-size: 1.05rem; }

/* Anchor jumps (/page#section) stop below the sticky header (navbar, "viewing as" bar, messages).
   --eds-header-h is the header's height, set in base.html and kept current by app.js. */
[id] { scroll-margin-top: calc(var(--eds-header-h, 4rem) + .5rem); }

/* Flash messages sit in the sticky header so a redirect to #section can't scroll them away. */
.flash-stack { background: var(--bs-body-bg); max-height: 40vh; overflow-y: auto; }
.flash-stack .alert { margin: .5rem 0; }

@media (max-width: 991.98px) {
  /* The expanded phone menu scrolls inside itself: the header is sticky, so scrolling the page
     never brings an admin's long menu (and the account / log-out menu under it) into view. */
  header .navbar-collapse { max-height: calc(100vh - 4.5rem); max-height: calc(100dvh - 4.5rem); }
  header:has(.impersonation-bar) .navbar-collapse { max-height: calc(100vh - 8rem); max-height: calc(100dvh - 8rem); }
  header .navbar-collapse.show { overflow-y: auto; overscroll-behavior: contain; }
  .impersonation-bar .btn { min-height: 2.5rem; min-width: 3.5rem; }
}

/* Site colour chips: <span class="site-chip" style="--site: {{ site_color }}">VIC</span> */
.site-chip {
  display: inline-block; padding: .05rem .4rem; border-radius: .35rem; font-size: .75rem; font-weight: 600;
  background: color-mix(in srgb, var(--site, #6c757d) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--site, #6c757d) 60%, transparent);
}

/* Person name pills inside schedule cells */
.who { display: block; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-physician { font-weight: 600; }
.who-resident { color: var(--bs-success-text-emphasis); }
.who-clerk { color: var(--bs-info-text-emphasis); }
.who-needs { color: var(--eds-needs); font-weight: 700; }
.is-mine { background: var(--eds-mine) !important; outline: 2px solid rgba(13, 110, 253, .45); outline-offset: -2px; }

/* Cards used for shifts on mobile */
.shift-card { border-left: 4px solid var(--site, #6c757d); }

/* Tables */
.table-sticky thead th { position: sticky; top: 0; z-index: 2; background: var(--bs-body-bg); }
.table-sticky td:first-child, .table-sticky th:first-child { position: sticky; left: 0; z-index: 1; background: var(--bs-body-bg); }
.weekend-row td { background: var(--bs-tertiary-bg); }
.holiday-row td { background: rgba(220, 53, 69, .08); }

/* Small helpers */
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.min-w-0 { min-width: 0; }
.cursor-pointer { cursor: pointer; }

@media (max-width: 575.98px) {
  main.container-xl { padding-left: .75rem; padding-right: .75rem; }
  .btn-touch { padding: .55rem .9rem; }
}

/* ---- module styles below ---- */
