/* =====================================================================
   CONCEPT 4 — Brant BBPS Operations
   A single design system for the whole application.

   Structure of this file (keep this order when porting):
     01 Tokens              08 Tables
     02 Base                09 Stat tiles
     03 Application shell   10 Callout composer + buckets
     04 Layout primitives   11 eSchedule import results
     05 Buttons             12 Picker rows
     06 Forms               13 Drawers / modals / toasts
     07 Badges + status     14 Charts
                            15 Standalone screens (auth + recipient)
                            16 Design-system page
                            17 Responsive
   ===================================================================== */

/* ---------------------------------------------------------------- 01 Tokens */

:root {
  /* surfaces */
  --bg: #e3e5e7;
  --surface: #ffffff;
  --surface-2: #f2f3f4;
  --surface-3: #d9dbde;
  --line: #cfd1d5;
  --line-2: #b1b5ba;

  /* text */
  --ink: #1b2026;
  --ink-2: #4c535b;
  --ink-3: #5e646c;

  /* navigation rail — light, reads as part of the workspace, not a separate panel */
  --nav-surface: #eeeff0;
  --nav-line: #cfd1d5;
  --nav-ink: #262b31;
  --nav-ink-muted: #5c626a;
  --nav-hover: #e2e3e5;
  --nav-active-bg: #d7e0ea;
  --nav-active-bg-hover: #c6d3e2;
  --nav-active-ink: #26384a;
  --nav-active-accent: #2f5d8a;
  --nav-tooltip: #1b2026;

  /* brand — operational blue, matches the live callout screen */
  --brand: #2f5d8a;
  --brand-2: #24496c;
  --brand-soft: #e5ecf4;
  --brand-line: #b2c6da;

  /* OVERTIME — amber, always paired with wording + structure, never colour alone */
  --ot: #92500f;
  --ot-solid: #8a4205;
  --ot-bg: #fff7ec;
  --ot-line: #dda86a;
  --ot-hatch: repeating-linear-gradient(135deg, #fdf0dd 0 10px, #fff8ee 10px 20px);
  --ot-rule: repeating-linear-gradient(135deg, #b96617 0 7px, #f1c48f 7px 14px);

  /* MANAGEMENT — deliberately not amber, so it never reads as overtime */
  --mgmt: #5b3d92;
  --mgmt-bg: #f2ecfb;
  --mgmt-line: #c6b3e6;

  /* DNC — deliberate system filter, neutral rather than alarming */
  --dnc: #4d5a6d;
  --dnc-bg: #eef1f5;
  --dnc-line: #c3ccda;

  /* semantic */
  --ok: #14714f;
  --ok-bg: #e6f4ee;
  --ok-line: #a9d5c3;
  --warn: #8a6410;
  --warn-bg: #fdf4e0;
  --warn-line: #e6cf95;
  --bad: #a8283c;
  --bad-bg: #fceaed;
  --bad-line: #edbcc4;

  /* geometry */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;

  /* type */
  --sans: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  --sh-1: 0 1px 2px rgba(23, 32, 42, .05), 0 2px 6px rgba(23, 32, 42, .04);
  --sh-2: 0 18px 44px rgba(23, 32, 42, .17);
}

/* ---------------------------------------------------------------- 02 Base */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 14.5px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2.5px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -.35px;
  line-height: 1.2;
}

p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--ink-3);
}

.kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--brand);
}

.kicker--ot {
  color: var(--ot);
}

kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  background: var(--surface);
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- 03 Shell */

.shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 236px;
  background: var(--nav-surface);
  color: var(--nav-ink);
  border-right: 1px solid var(--nav-line);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  transition: width .16s ease;
}

.rail.is-mini {
  width: 68px;
}

.rail-collapse {
  position: absolute;
  right: -13px;
  top: 22px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--sh-1);
  z-index: 6;
}

.rail-collapse svg {
  width: 14px;
  height: 14px;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px 18px;
}

.rail-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12.5px;
  flex: none;
}

.rail-wordmark {
  color: var(--nav-ink);
  font-weight: 800;
  font-size: 14.5px;
  white-space: nowrap;
}

.rail-wordmark em {
  display: block;
  font-style: normal;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--nav-ink-muted);
  letter-spacing: .3px;
}

.rail-nav {
  flex: 1;
  display: grid;
  gap: 2px;
  align-content: start;
}

.rail-group {
  margin: 14px 12px 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--nav-ink-muted);
}

.rail-group:first-child {
  margin-top: 2px;
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: 0;
  color: var(--nav-ink);
  padding: 10px 12px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 13.8px;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
  width: 100%;
  text-align: left;
}

.rail-item svg {
  width: 19px;
  height: 19px;
  flex: none;
}

.rail-item:hover {
  background: var(--nav-hover);
  color: var(--nav-ink);
}

/* Active nav uses four cues at once: pale blue fill, blue text, blue icon
   (inherited from currentColor) and a blue accent on the leading edge. */
.rail-item.is-active {
  background: var(--nav-active-bg);
  color: var(--nav-active-ink);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--nav-active-accent);
}

.rail-item.is-active:hover {
  background: var(--nav-active-bg-hover);
}

.rail-foot {
  display: grid;
  gap: 2px;
  border-top: 1px solid var(--nav-line);
  padding-top: 10px;
}

.rail.is-mini .rail-wordmark,
.rail.is-mini .rail-group,
.rail.is-mini .rail-item span {
  display: none;
}

.rail.is-mini .rail-item {
  justify-content: center;
}

.rail.is-mini .rail-item:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--nav-tooltip);
  color: #fff;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  white-space: nowrap;
  z-index: 12;
}

.frame {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 248, 249, .93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px 24px;
  flex-wrap: wrap;
}

.appbar-heading h1 {
  font-size: 18px;
}

.appbar-heading p {
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 600;
  margin-top: 1px;
}

/* persistent active-callout indicator */
.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--ok-line);
  background: var(--ok-bg);
  color: var(--ok);
  border-radius: 999px;
  padding: 6px 15px 6px 12px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.active-chip:hover {
  border-color: var(--ok);
}

.active-chip-text b {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
}

.active-chip-text em {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  font-family: var(--mono);
  color: var(--ink-2);
}

.active-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(20, 113, 79, .16);
  flex: none;
}

.appbar-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sysflag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.sysflag svg {
  width: 13px;
  height: 13px;
}

.sysflag--mono {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--mono);
  font-weight: 500;
}

.menu-holder {
  position: relative;
}

.proto-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px dashed var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.proto-btn svg {
  width: 14px;
  height: 14px;
}

.proto-btn:hover {
  background: var(--surface-2);
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 260px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-2);
  padding: 6px;
  z-index: 40;
}

.menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
}

.menu button:hover {
  background: var(--surface-2);
}

.menu-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
  font-weight: 800;
  padding: 10px 11px 4px;
}

.who {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-2);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12.5px;
}

.canvas {
  padding: var(--sp-6);
  min-width: 0;
  max-width: 1480px;
  width: 100%;
}

/* ---------------------------------------------------------------- 04 Layout */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.page-head h2 {
  font-size: 24px;
}

.page-head p {
  color: var(--ink-3);
  margin-top: 4px;
  font-weight: 500;
  max-width: 78ch;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.card-head h3 {
  font-size: 15.5px;
}

.card-head p {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
  font-weight: 500;
}

.card-body {
  padding: 18px;
}

.grid {
  display: grid;
  gap: var(--sp-4);
}

.g2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.g3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.g4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--sp-4);
  align-items: start;
}

.stack {
  display: grid;
  gap: var(--sp-4);
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.kv:last-child {
  border-bottom: 0;
}

.kv span {
  color: var(--ink-3);
  font-weight: 600;
}

.kv b {
  font-weight: 700;
  text-align: right;
}

/* ---------------------------------------------------------------- 05 Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 13.8px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--ink-3);
}

.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn--primary:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
}

.btn--ot {
  background: var(--ot-solid);
  border-color: var(--ot-solid);
  color: #fff;
}

.btn--ot:hover {
  background: #6f3504;
  border-color: #6f3504;
}

.btn--mgmt {
  background: var(--mgmt);
  border-color: var(--mgmt);
  color: #fff;
}

.btn--danger {
  color: var(--bad);
  border-color: var(--bad-line);
  background: var(--bad-bg);
}

.btn--quiet {
  border-color: transparent;
  background: none;
  color: var(--ink-3);
}

.btn--quiet:hover {
  background: var(--surface-3);
  color: var(--ink);
  border-color: transparent;
}

.btn--sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
}

.btn--lg {
  min-height: 48px;
  padding: 0 22px;
  font-size: 15px;
}

.btn--block {
  width: 100%;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.icon-btn {
  border: 0;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--ink);
}

/* segmented control */
.seg {
  display: inline-flex;
  background: var(--surface-3);
  border-radius: var(--r);
  padding: 4px;
  gap: 4px;
}

.seg button {
  border: 0;
  background: none;
  border-radius: 7px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink-3);
}

.seg button:hover {
  color: var(--ink);
}

.seg button.is-on {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--sh-1);
}

/* filter chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink-2);
}

.chip:hover {
  background: var(--surface-2);
}

.chip.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ---------------------------------------------------------------- 06 Forms */

.field {
  display: block;
  min-width: 0;
}

.label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.req {
  color: var(--bad);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  padding: 9px 12px;
  font-weight: 500;
  color: var(--ink);
}

.textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.6;
}

.textarea--code {
  font-family: var(--mono);
  font-size: 13px;
  min-height: 230px;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 93, 138, .18);
}

.help {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 6px;
  font-weight: 500;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
}

.switch-row b {
  display: block;
  font-size: 13.5px;
}

.switch-row span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
}

.yesno {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  overflow: hidden;
  flex: none;
}

.yesno button {
  border: 0;
  background: var(--surface);
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 800;
  font-size: 12.5px;
  color: var(--ink-3);
  min-height: 38px;
}

.yesno button + button {
  border-left: 1px solid var(--line-2);
}

.yesno button.is-on {
  background: var(--mgmt);
  color: #fff;
}

.yesno button.is-off-on {
  background: var(--surface-3);
  color: var(--ink);
}

.search-wrap {
  position: relative;
  min-width: 0;
}

.search-wrap svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--ink-3);
}

.search-wrap .input {
  padding-left: 40px;
}

/* ---------------------------------------------------------------- 07 Badges + status */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--r-sm);
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--ink-2);
  white-space: nowrap;
}

.tag svg {
  width: 11px;
  height: 11px;
}

.tag--reg {
  background: var(--brand-soft);
  border-color: var(--brand-line);
  color: var(--brand-2);
}

.tag--ot {
  background: var(--ot-solid);
  border-color: var(--ot-solid);
  color: #fff;
}

.tag--mgmt {
  background: var(--mgmt-bg);
  border-color: var(--mgmt-line);
  color: var(--mgmt);
}

.tag--dnc {
  background: var(--dnc-bg);
  border-color: var(--dnc-line);
  color: var(--dnc);
}

.tag--ok {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok);
}

.tag--warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn);
}

.tag--bad {
  background: var(--bad-bg);
  border-color: var(--bad-line);
  color: var(--bad);
}

.note {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 13.2px;
  font-weight: 500;
}

.note svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 1px;
}

.note strong {
  font-weight: 800;
}

.note--ok {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok);
}

.note--warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn);
}

.note--bad {
  background: var(--bad-bg);
  border-color: var(--bad-line);
  color: var(--bad);
}

.note--ot {
  background: var(--ot-bg);
  border-color: var(--ot-line);
  color: var(--ot);
}

.note--mgmt {
  background: var(--mgmt-bg);
  border-color: var(--mgmt-line);
  color: var(--mgmt);
}

/* ---------------------------------------------------------------- 08 Tables */

.table-wrap {
  overflow-x: auto;
}

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px;
}

.tbl th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 800;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}

.tbl td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  vertical-align: middle;
}

.tbl tbody tr:last-child td {
  border-bottom: 0;
}

.tbl tbody tr:hover {
  background: var(--surface-2);
}

.tbl .num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.tbl .row-click,
tr.row-click {
  cursor: pointer;
}

.tbl-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
  background: var(--surface-2);
  font-weight: 600;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- 09 Stat tiles */

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 15px 17px;
  box-shadow: var(--sh-1);
}

.tile .t-lab {
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 700;
  min-height: 34px;
}

.tile .t-val {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-top: 3px;
}

.tile .t-sub {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
}

.tile--ot {
  border-color: var(--ot-line);
  background: linear-gradient(180deg, var(--ot-bg), var(--surface) 62%);
}

.tile--ot .t-val {
  color: var(--ot);
}

.tile--ok .t-val {
  color: var(--ok);
}

.tile--bad .t-val {
  color: var(--bad);
}

/* ---------------------------------------------------------------- 10 Callout composer */

.stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

.stage-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.stage-no {
  flex: none;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
}

.stage-no--ot {
  background: var(--ot-solid);
  border-radius: 50%;
}

.stage-head-text {
  flex: 1;
  min-width: 200px;
}

.stage-head h3 {
  font-size: 17px;
  margin-top: 2px;
}

.stage-head p {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  margin-top: 3px;
  max-width: 76ch;
}

.stage-body {
  padding: 20px;
}

.count-pill {
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--brand-soft);
  color: var(--brand-2);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid var(--brand-line);
}

.count-pill--ot {
  background: var(--ot-bg);
  color: var(--ot);
  border-color: var(--ot-line);
}

/* the Regular stage is marked with a solid brand edge */
.stage--regular {
  border-left: 4px solid var(--brand);
}

/* the OVERTIME stage is structurally different: hatched rule, heavier border,
   tinted header — never colour alone */
.stage--overtime {
  border: 2px solid var(--ot-line);
  position: relative;
}

.stage--overtime::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: var(--ot-rule);
}

.stage--overtime .stage-head {
  padding-top: 21px;
  background: var(--ot-bg);
}

/* shift details grid */
.shift-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.shift-grid .span-2 {
  grid-column: span 2;
}

.custom-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 15px;
  padding: 15px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  background: var(--surface-2);
}

/* the two equal-weight ways to build a list */
.source-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 15px;
}

.source-actions .btn--quiet {
  margin-left: auto;
}

/* selected people */
.bucket {
  min-height: 78px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
}

.stage--overtime .bucket {
  background: var(--ot-hatch);
  border-color: var(--ot-line);
}

.bucket-empty {
  width: 100%;
  align-self: center;
  text-align: center;
  color: var(--ink-3);
  font-weight: 500;
  padding: 10px;
}

.person {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 296px;
  flex: 1 1 296px;
  max-width: 420px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--brand-line);
  border-left: 4px solid var(--brand);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
}

.person--ot {
  border: 1px solid var(--ot-line);
  border-left: 4px solid var(--ot-solid);
}

.person-main {
  flex: 1;
  min-width: 0;
}

.person-main b {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 700;
}

.person-main span {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
  margin-top: 2px;
}

.person-actions {
  display: flex;
  gap: 4px;
  flex: none;
}

.person-actions button {
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  padding: 6px 7px;
  border-radius: var(--r-sm);
}

.person-actions button:hover {
  background: var(--surface-3);
}

.person-actions .drop {
  color: var(--bad);
}

/* review + SMS */
.review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, .95fr);
  gap: 18px;
}

.review-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  margin: 0 0 16px;
}

.review-dl > div {
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
}

.review-dl > div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.review-dl dt {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.review-dl dd {
  margin: 3px 0 0;
  font-weight: 700;
}

.review-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.review-list {
  border: 1px solid var(--brand-line);
  border-radius: var(--r);
  overflow: hidden;
}

.review-list--ot {
  border: 2px solid var(--ot-line);
}

.review-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: var(--brand-soft);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.review-list--ot .review-list-head {
  background: var(--ot-hatch);
  color: var(--ot);
}

.review-list ol {
  margin: 0;
  padding: 10px 12px 12px 30px;
  display: grid;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 600;
}

.review-list ol li::marker {
  color: var(--ink-3);
  font-size: 11.5px;
}

.review-empty {
  padding: 16px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}

.sms-stack {
  display: grid;
  gap: 12px;
  align-content: start;
}

.sms {
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  overflow: hidden;
}

.sms--ot {
  border: 2px solid var(--ot-line);
}

.sms-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: var(--surface-3);
  font-size: 12px;
  font-weight: 800;
}

.sms--ot .sms-head {
  background: var(--ot-hatch);
  color: var(--ot);
}

.sms-head em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
}

.sms--ot .sms-head em {
  color: var(--ot);
}

.sms pre {
  margin: 0;
  padding: 13px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  background: var(--surface);
  color: var(--ink-2);
  font: 500 12px/1.6 var(--mono);
}

.send-bar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  flex-wrap: wrap;
}

.send-bar p {
  color: var(--ink-3);
  font-size: 12.5px;
  margin-top: 3px;
  font-weight: 500;
}

/* send confirmation sequence */
.sequence {
  display: grid;
  gap: 10px;
  justify-items: stretch;
}

.sequence-step {
  padding: 14px 16px;
  border: 1px solid var(--brand-line);
  border-radius: var(--r);
  background: var(--surface);
}

.sequence-step--ot {
  border: 2px solid var(--ot-line);
  background: var(--ot-hatch);
}

.sequence-step b {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
}

.sequence-step b span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  flex: none;
}

.sequence-step--ot b span {
  background: var(--ot-solid);
}

.sequence-step p {
  margin: 6px 0 0 34px;
  color: var(--ink-2);
  font-size: 13.2px;
  font-weight: 500;
}

.sequence-arrow {
  justify-self: center;
  color: var(--ink-3);
}

.sequence-arrow svg {
  width: 20px;
  height: 20px;
}

/* ---------------------------------------------------------------- 11 Import results */

.import-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}

.import-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.import-head b {
  font-size: 13.5px;
}

.import-counts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px;
}

.count-box {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 8px;
  text-align: center;
  background: var(--surface);
}

.count-box b {
  display: block;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.15;
}

.count-box span {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.count-box--ok b {
  color: var(--ok);
}

.count-box--dnc {
  background: var(--dnc-bg);
  border-color: var(--dnc-line);
}

.count-box--dnc b {
  color: var(--dnc);
}

.count-box--mgmt {
  background: var(--mgmt-bg);
  border-color: var(--mgmt-line);
}

.count-box--mgmt b {
  color: var(--mgmt);
}

.count-box--review {
  background: var(--warn-bg);
  border-color: var(--warn-line);
}

.count-box--review b {
  color: var(--warn);
}

/* one card per exception, resolvable inline */
.exceptions {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.exception {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
}

.exception-main {
  flex: 1;
  min-width: 0;
}

.exception-main .tag {
  margin-bottom: 6px;
}

.exception-main b {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 14.5px;
  font-weight: 700;
}

.exception-main p {
  font-size: 12.8px;
  color: var(--ink-3);
  font-weight: 500;
  margin-top: 3px;
}

.exception-row {
  display: block;
  margin-top: 7px;
  padding: 6px 9px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--ink-2);
  font: 500 11.5px/1.5 var(--mono);
  overflow-wrap: anywhere;
}

.exception-actions {
  display: flex;
  gap: 7px;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 240px;
}

.exception--dnc {
  border-left-color: var(--dnc);
  background: var(--dnc-bg);
}

.exception--mgmt {
  border-left-color: var(--mgmt);
  background: var(--mgmt-bg);
}

.exception--review {
  border-left-color: var(--warn);
  background: var(--warn-bg);
}

.exception--conflict {
  border-left-color: var(--brand);
  background: var(--brand-soft);
}

.exception--duplicate {
  border-left-color: var(--ink-3);
  background: var(--surface-2);
}

.exception--resolved {
  border-left-color: var(--ok);
  background: var(--ok-bg);
}

.exception--ignored {
  opacity: .72;
  background: var(--surface-2);
  border-left-color: var(--ink-3);
}

.exception-group-title {
  padding: 12px 14px 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- 12 Picker rows */

.plist {
  display: grid;
  gap: 8px;
}

.prow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}

.prow.in-regular {
  border-color: var(--brand-line);
  background: var(--brand-soft);
}

.prow.in-overtime {
  border-color: var(--ot-line);
  background: var(--ot-bg);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  flex: none;
}

.prow-main {
  flex: 1;
  min-width: 0;
}

.prow-main b {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 700;
}

.prow-main span {
  display: block;
  font-size: 11.8px;
  color: var(--ink-3);
  font-weight: 600;
  margin-top: 2px;
}

.state-pill {
  border: 1px solid var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand-2);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 800;
  flex: none;
}

.state-pill--ot {
  border: 1px solid var(--ot-line);
  background: var(--ot-bg);
  color: var(--ot);
}

.picker-empty {
  padding: 28px;
  text-align: center;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- 13 Drawers / modals / toasts */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 27, 35, .38);
  z-index: 60;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(600px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--sh-2);
  z-index: 61;
  display: flex;
  flex-direction: column;
  animation: drawer-in .18s ease;
}

@keyframes drawer-in {
  from {
    transform: translateX(26px);
    opacity: .4;
  }
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h3 {
  font-size: 18px;
}

.drawer-head p {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 3px;
  font-weight: 500;
}

.drawer-body {
  padding: 18px 20px;
  overflow: auto;
  flex: 1;
}

.drawer-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--surface-2);
  flex-wrap: wrap;
}

.drawer-sticky {
  position: sticky;
  top: -18px;
  z-index: 2;
  background: var(--surface);
  padding: 4px 0 12px;
  margin-bottom: 4px;
}

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(20, 27, 35, .42);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 95;
}

.modal {
  width: min(660px, 100%);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.modal--wide {
  width: min(820px, 100%);
}

.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.modal-head h3 {
  font-size: 19px;
  margin-top: 2px;
}

.modal-head p {
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
  margin-top: 3px;
}

.modal-body {
  padding: 20px 22px;
  overflow: auto;
}

.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  flex-wrap: wrap;
}

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 9px;
  z-index: 99;
}

.toast {
  background: var(--ink);
  color: #fff;
  border-radius: var(--r);
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--sh-2);
  max-width: 380px;
}

/* ---------------------------------------------------------------- 14 Charts */

.bars {
  display: grid;
  gap: 11px;
}

.bar-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 54px;
  gap: 12px;
  align-items: center;
  font-size: 13.5px;
  font-weight: 600;
}

.bar-track {
  height: 18px;
  background: var(--surface-3);
  border-radius: var(--r-sm);
  overflow: hidden;
  display: flex;
}

.bar-fill {
  background: var(--brand);
}

.bar-fill--miss {
  background: repeating-linear-gradient(135deg, #e3bcc3 0 6px, #f3dade 6px 12px);
}

.legend {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 600;
  flex-wrap: wrap;
}

.legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: -1px;
}

/* progress meter */
.meter {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 12px;
}

.meter > i {
  display: block;
  height: 100%;
  background: var(--brand);
}

.meter--ot > i {
  background: var(--ot-solid);
}

/* phase strip for a running callout */
.phases {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  margin-top: 16px;
}

.phase {
  flex: 1 1 150px;
  border-top: 3px solid var(--line-2);
  padding: 9px 14px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 600;
}

.phase b {
  display: block;
  color: var(--ink);
  font-size: 13.5px;
}

.phase.is-done {
  border-top-color: var(--ok);
}

.phase.is-now {
  border-top-color: var(--brand);
}

.phase.is-ot {
  border-top-color: var(--ot-solid);
}

.phase.is-off {
  opacity: .5;
}

/* live callout card */
.live {
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

.live-spine {
  background: var(--brand);
}

.live--ot .live-spine {
  background: repeating-linear-gradient(180deg, var(--ot-solid) 0 8px, #d79a54 8px 16px);
}

.live-body {
  padding: 17px 19px;
}

.live-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.live-top h3 {
  font-size: 17px;
}

.live-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 3px;
}

.live-stats {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.live-stats div b {
  display: block;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.5px;
}

.live-stats div span {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 800;
}

.message-history-item {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 11px 12px;
  background: var(--surface-2);
}

.message-history-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.message-history-preview {
  font-size: 13px;
  margin-top: 7px;
  color: var(--ink-2);
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* prototype-only controls, visually marked as not part of the product */
.proto-controls {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  background: var(--surface-2);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.proto-controls .proto-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- 15 Standalone screens */

.standalone {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(760px 400px at 12% 0%, #e3ebf3, transparent),
    radial-gradient(700px 420px at 100% 100%, #fdf1e2, transparent),
    var(--bg);
}

.pane {
  width: min(470px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px;
  box-shadow: var(--sh-2);
}

.pane h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.pane-center {
  text-align: center;
}

.pane-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}

.pane-brand strong {
  display: block;
  font-size: 14.5px;
}

.pane-brand span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* recipient (SMS) screens are mobile-first: large type, one action */
.recipient-head {
  display: block;
  text-align: center;
  padding: 12px;
  border-radius: var(--r);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.recipient-head--reg {
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  color: var(--brand-2);
}

.recipient-head--ot {
  background: var(--ot-solid);
  color: #fff;
  border: 1px solid var(--ot-solid);
}

.shift-facts {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  padding: 4px 16px;
  margin: 20px 0;
  text-align: left;
}

.shift-facts div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.shift-facts div:last-child {
  border-bottom: 0;
}

.shift-facts span {
  color: var(--ink-3);
  font-weight: 600;
}

.shift-facts b {
  font-weight: 800;
  text-align: right;
}

.round {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  background: var(--ok-bg);
  color: var(--ok);
}

.round svg {
  width: 27px;
  height: 27px;
}

.round--warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.round--info {
  background: var(--brand-soft);
  color: var(--brand);
}

.back-link {
  margin-top: 20px;
  font-size: 13px;
  color: var(--ink-3);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
}

/* ---------------------------------------------------------------- 16 Design-system page */

.ds-section {
  margin-bottom: 26px;
}

.ds-section > h3 {
  font-size: 15px;
  margin-bottom: 4px;
}

.ds-section > p {
  color: var(--ink-3);
  font-size: 13px;
  margin-bottom: 14px;
  font-weight: 500;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.swatch {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}

.swatch i {
  display: block;
  height: 52px;
}

.swatch div {
  padding: 8px 10px;
}

.swatch b {
  display: block;
  font-size: 12.5px;
}

.swatch code {
  font: 500 11px var(--mono);
  color: var(--ink-3);
}

.ds-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* authoritative navigation sample — same classes the real rail uses */
.ds-nav {
  width: 236px;
  max-width: 100%;
  background: var(--nav-surface);
  border: 1px solid var(--nav-line);
  border-radius: var(--r);
  padding: 12px;
}

.ds-nav .rail-item {
  cursor: default;
}

.ds-nav .rail-item--hover {
  background: var(--nav-hover);
}

.ds-nav .rail-item--focus {
  outline: 2.5px solid var(--brand);
  outline-offset: 2px;
}

.ds-type p {
  margin-bottom: 8px;
}

/* ---------------------------------------------------------------- 17 Responsive */

@media (max-width: 1280px) {
  .split,
  .review-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .shift-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .g4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-counts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--nav-line);
  }

  .rail-nav,
  .rail-foot {
    display: flex;
    border: 0;
    padding: 0;
    gap: 4px;
  }

  .rail-collapse,
  .rail-group,
  .rail-item span,
  .rail-wordmark {
    display: none;
  }

  .canvas {
    padding: 16px;
  }

  .g2,
  .g3,
  .g4,
  .shift-grid,
  .custom-panel,
  .review-dl,
  .review-lists {
    grid-template-columns: minmax(0, 1fr);
  }

  .import-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exception {
    flex-direction: column;
  }

  .exception-actions {
    max-width: none;
    justify-content: flex-start;
  }

  .person {
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .appbar {
    padding: 10px 14px;
  }

  .sysflag {
    display: none;
  }

  .pane {
    padding: 22px 18px;
  }
}

/* Production integration -------------------------------------------------
   These selectors bridge established Jinja/JavaScript hooks to the Concept 4
   system without changing operational behavior. */
.rail-item { text-decoration: none; }
.rail-logo img, .pane-brand img { width: 34px; height: 34px; object-fit: contain; }
.canvas > * + * { margin-top: 18px; }
.appbar-heading { min-width: 0; }
.appbar-heading p, .topbar-status, .admin-crumbs { color: var(--ink-3); font-size: 12px; }
.admin-crumbs { display: flex; align-items: center; gap: 8px; }
.admin-crumbs a { color: var(--brand); text-decoration: none; font-weight: 700; }
.topbar-status { margin-left: auto; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.page-head h1 { font-size: 24px; letter-spacing: -.45px; }
.card-header { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.card-title { font-weight: 800; }
.card-subtitle, .text-muted, .muted, .help { color: var(--ink-3); font-size: 12.5px; }
.card-body > * + *, form > * + * { margin-top: 14px; }
.table-frame { overflow: auto; }
.table, .table-wrap > table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table-wrap > table th { background: var(--surface-2); padding: 10px 12px; text-align: left; color: var(--ink-3); border-bottom: 1px solid var(--line); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.table td, .table-wrap > table td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.table tbody tr:hover, .table-wrap > table tbody tr:hover { background: var(--brand-soft); }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; color: var(--ink-3); font-size: 12px; }
.text-right { text-align: right !important; }
.grid-2, .admin-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.reference-grid { margin-top: 18px; }
.admin-form, .form-row, .directory-tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.field--wide { grid-column: 1 / -1; }
.field label, .field > label, .label { display: block; color: var(--ink-2); font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.field input:not([type="checkbox"]), .field select, .field textarea, .admin-form input:not([type="checkbox"]) { width: 100%; min-height: 39px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); padding: 9px 11px; font: inherit; }
.check-row, .chip { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check-row small { display: block; color: var(--ink-3); margin-top: 2px; }
.btn--brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--small { min-height: 30px; padding: 6px 9px; font-size: 11.5px; }
.btn--large { min-height: 44px; padding: 11px 17px; }
.actions, .page-actions, .compact-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.flash-stack { display: grid; gap: 8px; }
.app-alert, .callout-alert, .inline-error { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.app-alert--success, .callout-alert--success { background: var(--ok-bg); border-color: #a8d9c2; color: var(--ok); }
.app-alert--warning, .callout-alert--warning { background: var(--warn-bg); border-color: #ecd29b; color: var(--warn); }
.callout-alert--error, .inline-error { background: var(--bad-bg); border-color: #e8bbc2; color: var(--bad); }
[hidden], .hidden { display: none !important; }

/* Callout composer hooks */
.callout-workspace { max-width: 1280px; }
.stage-head h2 { font-size: 18px; }
.stage-head > div { min-width: 0; flex: 1; }
.stage-head .eyebrow { margin-bottom: 3px; }
.req { color: var(--bad); }
.span-3 { grid-column: 1 / -1; }
.custom-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.source-actions { align-items: center; }
.bucket .empty { color: var(--ink-3); padding: 8px 2px; }
.person-main { flex: 1; min-width: 120px; }
.person-main strong, .person-main span { display: block; }
.person-main span { color: var(--ink-3); font-size: 11.5px; }
.person-main .tag { display: inline-flex; margin-left: 7px; }
.person-actions { display: flex; gap: 6px; margin-left: auto; }
.person-actions button { border: 0; background: transparent; color: var(--brand); font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.person-actions .remove-person { color: var(--bad); }
.review-main { min-width: 0; }
.review-recipients { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.review-recipients > div { border: 1px solid var(--brand-line); border-radius: var(--r); background: var(--brand-soft); padding: 12px; }
.review-recipients .review-recipients__ot { border-color: var(--ot-line); background: var(--ot-bg); }
.review-recipients h3 { font-size: 13px; margin-bottom: 5px; }
.review-name-list { color: var(--ink-3); font-size: 12.5px; }
.not-included { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 14px; padding: 12px; background: var(--warn-bg); border: 1px solid #ecd29b; border-radius: var(--r); }
.not-included p, .send-bar p { color: var(--ink-3); font-size: 12px; margin-top: 3px; }
.sms-head span { color: var(--ink-3); font-size: 11px; }
.sms-stack pre { white-space: pre-wrap; word-break: break-word; }
.send-bar { grid-column: 1 / -1; }
.import-panel { margin-top: 14px; }
.import-panel summary { cursor: pointer; list-style: none; }
.import-counts { padding: 12px; }
.import-counts span { padding: 9px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 11.5px; }
.import-counts b { display: block; font-size: 17px; }
.import-note { padding: 0 12px 12px; color: var(--ink-3); font-size: 12px; }
.import-note button { border: 0; background: transparent; color: var(--brand); font-weight: 800; cursor: pointer; }
.prow-main { flex: 1; }
.prow-main strong, .prow-main span { display: block; }
.state-pill { padding: 5px 8px; border-radius: 99px; background: var(--surface-3); color: var(--ink-3); font-size: 11px; font-weight: 800; }
.state-pill--regular { background: var(--brand-soft); color: var(--brand); }
.state-pill--overtime { background: var(--ot-bg); color: var(--ot-solid); }

/* Native dialogs retain their production semantics and adopt Concept 4 surfaces. */
dialog { color: var(--ink); }
.callout-dialog, .picker-dialog { width: min(680px, calc(100vw - 28px)); max-height: calc(100vh - 36px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-3); }
.picker-dialog { width: min(760px, calc(100vw - 28px)); }
.callout-dialog::backdrop, .picker-dialog::backdrop { background: rgba(20, 27, 35, .52); }
.dialog-shell, .picker-shell { display: flex; flex-direction: column; max-height: calc(100vh - 38px); }
.dialog-shell > header, .picker-shell > header { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 18px 20px; overflow: auto; }
.picker-controls, .picker-list { padding: 18px 20px; }
.dialog-shell > footer, .picker-shell > footer { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); }
.icon-close { border: 0; background: transparent; color: var(--ink-3); font-size: 24px; cursor: pointer; }
.paste-area { min-height: 190px; }
.filter-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.filter-buttons button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 10px; font: inherit; font-size: 11.5px; cursor: pointer; }
.filter-buttons button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.picker-list { display: grid; gap: 8px; }
.sequence-confirm { display: grid; gap: 9px; }
.sequence-confirm > div:not(.sequence-arrow) { padding: 12px; border: 1px solid var(--brand-line); background: var(--brand-soft); border-radius: var(--r); }
.sequence-confirm .sequence-confirm__ot { border-color: var(--ot-line); background: var(--ot-bg); }
.sequence-arrow { text-align: center; color: var(--ink-3); }
.confirmation-warning { margin-top: 14px; color: var(--warn); font-weight: 700; }

/* Existing data-page controls and interactive detail surfaces */
.form-row { margin-bottom: 12px; }
.filters, .toolbar, .group-grid { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.stats-grid, .kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.record-drawer, .drawer { position: fixed; inset: 0 0 0 auto; z-index: 50; width: min(460px, 100vw); transform: translateX(102%); transition: transform .2s ease; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--sh-3); overflow: auto; }
.record-drawer.is-open, .drawer.is-open { transform: translateX(0); }
.record-drawer__head, .drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 19px 20px; border-bottom: 1px solid var(--line); }
dialog.picker-dialog.drawer { inset: 0 0 0 auto; width: min(600px, 100vw); height: 100dvh; max-height: none; margin: 0; transform: none; overflow: hidden; border: 0; border-left: 1px solid var(--line); border-radius: 0; }
dialog.picker-dialog.drawer:not([open]) { display: none; }
dialog.picker-dialog.drawer[open] { display: block; }
dialog.picker-dialog.drawer .picker-shell { display: flex; height: 100dvh; max-height: none; min-height: 0; overflow: hidden; }
.picker-shell > .picker-head { position: static; flex: 0 0 auto; background: var(--surface); }
.picker-head h3 { font-size: 18px; }
.picker-head p { max-width: 500px; }
.picker-controls { flex: 0 0 auto; padding: 16px 20px 15px; overflow: visible; border-bottom: 1px solid var(--line); background: var(--surface); }
.picker-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.picker-counts .tile { padding: 11px 13px; }
.picker-counts .t-lab { min-height: 0; }
.picker-counts .t-val { font-size: 22px; }
.picker-search { margin-bottom: 10px; }
.picker-filters { gap: 8px; }
.picker-results { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.picker-list { padding: 14px 20px 20px; overflow: visible; }
.picker-shell > .picker-footer { position: static; flex: 0 0 auto; padding: 14px 20px; background: var(--surface-2); }
.picker-footer .btn { min-width: 94px; }
.picker-dialog--overtime .picker-head { border-bottom-color: var(--ot-line); }
.picker-dialog .prow-main b > .tag { display: inline-flex; margin-top: 0; }
.record-list { padding: 16px 20px; }
.record-list div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.record-list dt { color: var(--ink-3); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.record-list dd { margin-top: 3px; font-weight: 700; }
.drawer-scrim, .modal-backdrop { position: fixed; inset: 0; z-index: 49; background: rgba(20, 27, 35, .45); }
.modal-card { width: min(620px, calc(100vw - 28px)); max-height: calc(100vh - 36px); overflow: auto; margin: 18px auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-3); padding: 20px; }

/* Standalone production forms */
.pane > .pane-brand + .flash-messages, .pane > .flash-stack { margin-bottom: 14px; }
.pane header p { color: var(--ink-3); margin-top: 5px; }
.pane form { margin-top: 20px; }
.pane .actions .btn { width: 100%; }
.round { font-size: 25px; font-weight: 900; }

@media (max-width: 900px) {
  .grid-2, .admin-two-column, .directory-tools-grid, .stats-grid, .kpi-grid { grid-template-columns: 1fr 1fr; }
  .review-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .grid-2, .admin-two-column, .admin-form, .form-row, .directory-tools-grid, .stats-grid, .kpi-grid, .custom-panel, .review-recipients { grid-template-columns: 1fr; }
  .field--wide, .span-3 { grid-column: auto; }
  .page-head { align-items: flex-start; }
  dialog.picker-dialog.drawer { width: 100vw; }
  .picker-head, .picker-controls, .picker-list, .picker-shell > .picker-footer { padding-left: 16px; padding-right: 16px; }
  .picker-dialog .prow { align-items: flex-start; flex-wrap: wrap; }
  .picker-dialog .prow > .btn, .picker-dialog .prow > .state-pill { margin-left: 48px; }
}

/* Message Centre ---------------------------------------------------------
   Production implementation of the approved Concept 4 compose/review view. */
.message-centre-canvas { max-width: 1280px; }
.message-centre-head { align-items: flex-end; }
.message-centre-workspace { grid-template-columns: minmax(0, 1fr) 360px; }
.message-composer-column { min-width: 0; }
.message-mode-panel { min-height: 100%; }
.message-field-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.message-road-field { min-width: 0; margin: 14px 0 0; padding: 0; border: 0; }
.message-notes-grid { margin-top: 14px; align-items: start; }
.field .message-notes { min-height: 88px; }
.message-custom-warning { margin-bottom: 14px; }
.field .message-custom-text { min-height: 260px; }
.message-review-column { min-width: 0; }
.message-exact-card .card-body { padding: 16px; }
.message-exact-preview pre { min-height: 96px; max-height: 320px; }
.message-recipient-summary .card-head strong { color: var(--ink); }
.message-recipient-pills { max-height: 130px; margin-top: 12px; overflow-y: auto; }
.message-recipient-summary .btn--block { margin-top: 16px; }
.message-history-card { margin-top: 16px; }
.message-history-table { min-width: 900px; }
.message-history-table th:last-child,
.message-history-table td:last-child { width: 34%; }
.message-history-excerpt {
  display: -webkit-box;
  overflow: hidden;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.message-history-empty { padding: 22px !important; text-align: center; color: var(--ink-3); }

dialog.message-recipient-drawer {
  inset: 0 0 0 auto;
  width: min(600px, 100vw);
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  transform: none;
  overflow: hidden;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}
dialog.message-recipient-drawer:not([open]) { display: none; }
dialog.message-recipient-drawer[open] { display: block; }
dialog.message-recipient-drawer::backdrop { background: rgba(20, 27, 35, .52); }
.message-recipient-shell { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; }
.message-recipient-shell > .drawer-head,
.message-recipient-shell > .drawer-foot { flex: 0 0 auto; }
.message-recipient-shell > .drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.message-recipient-section + .message-recipient-section { margin-top: 20px; }
.message-recipient-section > .label { margin-bottom: 8px; }
.message-recipient-choice { position: relative; cursor: pointer; }
.message-recipient-choice--all { margin-bottom: 18px; }
.message-recipient-choice--group { margin-bottom: 8px; background: var(--surface-2); }
.message-recipient-choice input[type="checkbox"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.message-recipient-choice:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.message-recipient-choice .prow-main b,
.message-recipient-choice .prow-main span { display: block; }
.message-recipient-choice .state-pill { flex: none; }
.message-recipient-choice.in-regular .state-pill { background: var(--brand-soft); color: var(--brand); }
.message-recipient-choice input:disabled ~ .state-pill { opacity: .72; }

@media (max-width: 1050px) {
  .message-centre-workspace { grid-template-columns: 1fr; }
  .message-review-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .message-centre-head { align-items: flex-start; }
  .message-centre-head .seg { width: 100%; }
  .message-centre-head .seg button { flex: 1; }
  .message-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .message-review-column { grid-template-columns: 1fr; }
  dialog.message-recipient-drawer { width: 100vw; }
}

@media (max-width: 480px) {
  .message-field-grid, .message-notes-grid { grid-template-columns: 1fr; }
}

/* Call Logs --------------------------------------------------------------
   Concept 4 history scan, filters, and full response-record drawer. */
.call-logs-canvas { max-width: 1320px; }
.call-logs-head { align-items: flex-end; }
.call-log-filters { padding: 16px 18px; }
.call-log-filter-grid {
  display: grid;
  grid-template-columns: 170px 170px 220px minmax(280px, 1fr);
  gap: 14px;
  align-items: end;
}
.call-log-error { margin-top: 12px; }
.call-log-results { margin-top: 16px; }
.call-log-table { min-width: 1160px; font-size: 12.5px; }
.call-log-table th { padding: 10px 11px; }
.call-log-table td { padding: 10px 11px; }
.call-log-table .tag { white-space: nowrap; }
.call-log-shift { font-size: 11.5px; }
.call-log-held,
.call-log-overtime-count { color: var(--ot); font-weight: 800; white-space: nowrap; }
.call-log-interested-names { min-width: 190px; line-height: 1.5; }
.call-log-empty { padding: 24px !important; text-align: center; color: var(--ink-3); }

.drawer.call-log-drawer {
  width: min(600px, 100vw);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.call-log-drawer > .drawer-head,
.call-log-drawer > .drawer-foot { flex: 0 0 auto; }
.call-log-drawer > .drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.call-log-drawer-tiles { gap: 10px; margin-bottom: 16px; }
.call-log-drawer-tiles .tile { padding: 11px 12px; }
.call-log-drawer-tiles .t-lab { min-height: 32px; }
.call-log-drawer-tiles .t-val { font-size: 23px; }
.call-log-outcome { margin-top: 8px; }
.call-log-summary { margin-bottom: 16px; }
.call-log-contact-group + .call-log-contact-group { margin-top: 14px; }
table.call-log-contact-table { min-width: 500px; font-size: 12px; }
.call-log-contact-table th,
.call-log-contact-table td { padding: 9px 10px; }
.call-log-contact-table .tag { white-space: nowrap; }

@media (max-width: 1050px) {
  .call-log-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .call-log-search { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .call-logs-head { align-items: flex-start; }
  .call-log-filter-grid { grid-template-columns: 1fr 1fr; }
  .call-log-filter-grid .field:nth-child(3), .call-log-search { grid-column: 1 / -1; }
  .call-log-drawer-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Paramedic Activity -----------------------------------------------------
   Concept 4 compact filters, six-tile summary, scan table, and detail drawer. */
.activity-canvas { max-width: 1320px; }
.activity-filter-card { margin-bottom: 16px; }
.activity-filter-card.card-body > * + * { margin-top: 10px; }
.activity-filter-grid { align-items: end; }
.activity-filter-grid .search-wrap { display: block; }
.activity-filter-grid .search-wrap .input { padding-left: 40px; }
.activity-kpis { margin-bottom: 16px; }
.activity-results { margin-top: 0; }
.activity-table { min-width: 790px; }
.activity-table .activity-acceptance-column { width: 170px; }
.activity-acceptance { width: 100%; }
.activity-empty { padding: 24px !important; text-align: center; color: var(--ink-3); }
.activity-error { color: var(--bad); font-size: 12.5px; font-weight: 700; }
.activity-table tr:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.drawer.activity-detail {
  width: min(600px, 100vw);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.activity-detail > .drawer-head,
.activity-detail > .drawer-foot { flex: 0 0 auto; }
.activity-detail > .drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.activity-drawer-tiles { gap: 10px; margin-bottom: 16px; }
.activity-drawer-tiles .tile { padding: 12px 14px; }
.activity-drawer-tiles .t-lab { min-height: 0; }
.activity-drawer-tiles .t-val { font-size: 24px; }
.activity-calls-label { margin-top: 18px; }
.activity-detail-table { min-width: 520px; font-size: 12px; }
.activity-detail-table th,
.activity-detail-table td { padding: 9px 10px; }

@media (max-width: 680px) {
  .activity-drawer-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-table { min-width: 720px; }
}

/* Service Statistics ----------------------------------------------------
   Concept 4 grouped outcomes, compact filters, and side-by-side detail. */
.service-stats-canvas { max-width: 1320px; }
.service-stats-head { align-items: flex-end; }
.service-stats-filter-card { margin-bottom: 16px; }
.service-stats-filter-card.card-body > * + * { margin-top: 10px; }
.service-stats-filter-grid { align-items: end; }
.service-stats-kpis { margin-bottom: 16px; }
.service-stats-analytics { align-items: start; }
.service-stats-outcome-card,
.service-stats-detail-card { min-width: 0; }
.service-stats-bars { min-height: 180px; }
.service-stats-bucket { text-transform: capitalize; }
.service-stats-outcome-track { min-width: 2px; }
.service-stats-interest-key { background: var(--brand); }
.service-stats-no-taker-key { background: repeating-linear-gradient(135deg, #e3bcc3 0 5px, #f3dade 5px 10px); }
table.service-stats-detail-table { min-width: 0; font-size: 12.5px; }
.service-stats-empty { padding: 24px !important; text-align: center; color: var(--ink-3); }
.service-stats-error { color: var(--bad); font-size: 12.5px; font-weight: 700; }

@media (max-width: 1100px) {
  .service-stats-analytics { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 680px) {
  .service-stats-head { align-items: flex-start; }
  .service-stats-head .seg { width: 100%; }
  .service-stats-head .seg button { flex: 1; }
}

/* Paramedics ------------------------------------------------------------
   Concept 4 roster toolbar, dense directory table, and maintenance modals. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.paramedic-directory-canvas { max-width: 1320px; }
.paramedic-directory-head { align-items: flex-end; }
.paramedic-directory-head .btn svg { width: 16px; height: 16px; }
.paramedic-directory-card { overflow: hidden; }
.paramedic-directory-toolbar { flex-wrap: wrap; }
.paramedic-directory-search { flex: 1 1 260px; max-width: 340px; }
.paramedic-directory-filters { margin-left: auto; }
.paramedic-directory-filters .chip span { font-family: var(--mono); font-size: 11.5px; }
.paramedic-management-filter.is-on { background: var(--mgmt); border-color: var(--mgmt); }
.paramedic-directory-table-wrap { overflow-x: auto; }
table.paramedic-details-table { min-width: 930px; font-size: 13px; }
.paramedic-details-table th,
.paramedic-details-table td { padding: 10px 13px; }
.paramedic-details-table td:first-child,
.paramedic-details-table td:nth-child(2) { font-weight: 700; }
.paramedic-actions-heading { text-align: right !important; }
.paramedic-row-actions { text-align: right; white-space: nowrap; }
.paramedic-row-actions .btn + .btn { margin-left: 5px; }
.paramedic-directory-foot { border-top: 0; }
.paramedic-modal-field { margin-top: 14px; }
.paramedic-management-switch { margin-top: 16px; }
.paramedic-management-switch > div { flex: 1; }
.paramedic-management-switch > .yesno { display: inline-flex; }
.paramedic-modal-error { margin-top: 14px; color: var(--bad); font-size: 12.5px; font-weight: 700; }
.paramedic-remove-modal { width: min(560px, 100%); }

@media (max-width: 820px) {
  .paramedic-directory-head { align-items: flex-start; }
  .paramedic-directory-toolbar { align-items: stretch; }
  .paramedic-directory-search { flex-basis: 100%; max-width: none; }
  .paramedic-directory-filters { margin-left: 0; }
}

@media (max-width: 560px) {
  .paramedic-directory-head .btn { width: 100%; }
  .paramedic-directory-filters .chip { flex: 1 1 calc(50% - 4px); justify-content: center; }
  .paramedic-modal-grid { grid-template-columns: 1fr; }
  .paramedic-management-switch { align-items: flex-start; flex-direction: column; }
}
