/* The HealthBridge Management System. The look of the design linked from HLTH-70. System fonts
   only, so no page asks another site for anything. */
:root {
  --ground: #F4F5F2;
  --surface: #FFFFFF;
  --ink: #1B2421;
  --muted: #4A5652;
  --line: #D9DDD8;
  --line-soft: #E6E9E5;
  --field: #B9C0BB;
  --accent: #0F5F5A;
  --accent-dark: #0A4440;
  --accent-soft: #E3EFEC;
  --alert: #9A3412;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--ground);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); line-height: 1.45; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
code { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 0.95em; }
h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 17px; font-weight: 600; }
p { margin: 0; }
input, select, button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 10px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 7px; background: var(--accent); color: #FFFFFF; font-size: 13px; font-weight: 600; }
.brand-large { gap: 12px; }
.brand-large div { display: flex; flex-direction: column; }
.brand-large span:not(.brand-mark) { font-size: 13px; color: var(--muted); font-weight: 400; }
nav { flex: 1 1 auto; display: flex; gap: 4px; }
.nav-link { padding: 10px 12px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 500; font-size: 14px; text-decoration: none; }
.who { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--muted); }
.who strong { color: var(--ink); font-weight: 500; }
.link-button { border: 0; background: none; color: var(--accent); text-decoration: underline; padding: 10px 0; cursor: pointer; font-size: 14px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 24px 64px; display: flex; flex-direction: column; gap: 20px; }
.wrap-narrow { max-width: 920px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.centred { text-align: center; }
.strong { font-weight: 500; }
.alert { color: var(--alert); font-weight: 600; }
.back { font-size: 14px; align-self: flex-start; padding: 6px 0; }
.title-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.title-row > div:first-child { display: flex; flex-direction: column; gap: 6px; }
.heading-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #FFFFFF; font-weight: 500; font-size: 15px; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--accent-dark); color: #FFFFFF; }
.button-secondary { background: var(--surface); color: var(--accent); }
.button-secondary:hover { background: var(--accent-soft); color: var(--accent-dark); }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 20px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.tile-value { font-size: 28px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: 1 / -1; }
.subheading { font-size: 14px; color: var(--muted); padding-top: 4px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; margin: 0; padding: 0; }
.field > label, .field > legend { font-size: 14px; font-weight: 500; padding: 0; margin-bottom: 2px; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number],
.field input[type=time], .field input[type=url], .field select {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 6px; background: var(--surface); font-size: 14px; width: 100%;
}
.grow { flex: 1 1 280px; }
.hint { font-size: 12px; color: var(--muted); }
.option { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 32px; }
.choices { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }

.table-box { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1060px; }
th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFBF9; }
td { font-size: 14px; padding: 14px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.badge-outline { border: 1px solid #C9A86A; color: #6B4E12; }
.status-draft { background: #ECEDEA; color: #3A4440; }
.status-test { background: #E6EEF8; color: #1E3F6B; }
.status-live { background: var(--accent-soft); color: var(--accent-dark); }
.status-suspended { background: #FBEDE7; color: #7A2E12; }
.status-retired { background: #ECEDEA; color: #3A4440; text-decoration: line-through; }

.facts { margin: 16px 0 0; display: grid; gap: 14px 16px; }
.facts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.facts-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
dt { font-size: 13px; color: var(--muted); }
dd { margin: 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.history { margin: 12px 0 0; padding: 0; list-style: none; }
.history li { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.history li:last-child { border-bottom: 0; }
.history li span:first-child { width: 170px; }

.message { border-radius: 8px; padding: 14px 16px; font-size: 14px; border: 1px solid; }
.message ul { margin: 8px 0 0; padding-left: 20px; }
.message-error { background: #FBEDE7; border-color: #E3B7A4; color: #7A2E12; }
.message-warning { background: #FFF4E0; border-color: #E2BE7A; color: #5C3D06; }
.message-info { background: #E6EEF8; border-color: #B5C8E3; color: #1E3F6B; }
.message-ok { background: var(--accent-soft); border-color: #A9CCC5; color: var(--accent-dark); }

.issued { display: flex; flex-direction: column; gap: 6px; }
.variable { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 13px; color: var(--muted); }
.issued code { display: block; padding: 12px; background: var(--ground); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; user-select: all; }

.sign-in { max-width: 420px; margin: 48px auto 0; display: flex; flex-direction: column; gap: 24px; }

@media (max-width: 760px) {
  .tiles, .grid-2, .grid-3, .facts-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .wrap { padding: 16px 16px 48px; }
  .top-inner { padding: 10px 16px; }
}
