/* Incident Core: "the case file". Warm paper, oxblood and ink, a condensed face for labels and headings, monospace only for references and times.
   Loaded after the suite kit and app.css; it replaces the Care Plans look this app started with. */
@font-face { font-family: 'Plex Condensed'; font-weight: 600; font-style: normal; font-display: swap; src: url('/assets/fonts/plex-condensed-600.woff2') format('woff2'); }
@font-face { font-family: 'Plex Condensed'; font-weight: 700; font-style: normal; font-display: swap; src: url('/assets/fonts/plex-condensed-700.woff2') format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('/assets/fonts/plex-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url('/assets/fonts/plex-mono-500.woff2') format('woff2'); }

:root {
  --ink: #1b1215; --ink-soft: #3d3035; --muted: #5c4f55;
  --paper: #f6f1ea; --surface: #fffdf9; --rule: #d9cfc2; --rule-soft: #e9e1d6; --field-border: #7d6f64;
  --brand: #7a1f36; --brand-deep: #561226; --brand-tint: #f5e6ea;
  --signal: #b8650a; --signal-tint: #fbefd9;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif; --font-display: 'Plex Condensed', 'IBM Plex Sans', system-ui, sans-serif; --font-mono: 'Plex Mono', ui-monospace, monospace;
  --radius: 2px; --radius-lg: 3px;
}
html { font-size: 106.25%; }
body { background: var(--paper); font-family: var(--font-body); color: var(--ink); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: .005em; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.05; text-transform: uppercase; }
h2 { font-size: 1.35rem; line-height: 1.15; }
a { color: var(--brand); }
.eyebrow, .page-head .eyebrow { font-family: var(--font-display); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: .82rem; color: var(--brand); }
.eyebrow a { color: var(--brand); text-decoration: none; }

/* header: a dark band, the amber active mark, a square monogram */
header, .navbar { background: var(--ink); color: #f6f1ea; border-bottom: 0; }
.navbar a, header a { color: #f6f1ea; }
.logo { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .08em; font-size: 1.15rem; display: inline-flex; align-items: center; gap: .6rem; color: #fff; }
.logo::before { content: 'IC'; display: inline-grid; place-items: center; width: 2rem; height: 2rem; background: var(--brand); color: #fff; font-family: var(--font-mono); font-size: .8rem; font-weight: 500; letter-spacing: 0; border: 1px solid rgb(255 255 255 / .35); }
.nav-menu a { color: #ddd2d6; font-size: .95rem; }
.nav-menu a:hover { color: #fff; background: rgb(255 255 255 / .08); }
.nav-menu a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--signal); text-decoration: none; }
.who, .who a { color: #ddd2d6; }
.who .btn, .who a.btn { background: transparent; color: #fff; border: 1px solid rgb(255 255 255 / .5); border-radius: var(--radius); }
.who .btn:hover { background: #fff; color: var(--ink); }
.nav-toggle { background: transparent; color: #fff; border: 1px solid rgb(255 255 255 / .5); }
.navbar a:focus-visible, header a:focus-visible, .nav-toggle:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.demo-bar { background: var(--signal-tint); border-bottom: 1px solid #e8cfa3; }
.demo-bar, .demo-bar * { color: #4a2d05; }
.demo-bar a { text-decoration: underline; }

/* page heads read like the front of a file */
.page-head { border-bottom: 2px solid var(--ink); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { margin: .15rem 0 .5rem; }
.page-head .muted, .muted { color: var(--muted); }

/* cards are sheets: square, ruled, no shadow */
.card, .info-box { background: var(--surface); border: 1px solid var(--ink); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--rule); }
.card > h2:first-child { font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; border-bottom: 1px solid var(--rule); padding-bottom: .55rem; margin-bottom: 1rem; color: var(--brand); }
.card .card { box-shadow: none; }
.alert { border-radius: var(--radius); border: 1px solid var(--ink); border-left-width: 1px; }
.alert-warning { background: var(--signal-tint); color: #4a2d05; border-color: #c9923e; }
.alert-error { background: #fbe9ec; color: #5a1226; border-color: #b6586f; }
.alert-success { background: #e8f1ea; color: #14391f; border-color: #6a9a78; }
.alert-info { background: #eef0f4; color: #1f2a3d; border-color: #8c97ad; }

/* buttons */
.btn { border-radius: var(--radius); font-weight: 600; letter-spacing: .02em; }
.btn-primary, button.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn.btn-secondary, .btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.btn-secondary:hover { background: var(--ink); color: #fff; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

/* forms */
input, select, textarea { border-radius: var(--radius); border: 1px solid var(--field-border); background: #fff; }
label, legend { font-weight: 600; color: var(--ink-soft); }

/* tables: ruled ledger */
.table { background: var(--surface); border: 1px solid var(--ink); }
.table th { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .09em; font-size: .8rem; font-weight: 700; color: #fff; background: var(--ink); border-bottom: 0; }
.table td { border-bottom: 1px solid var(--rule); }
.table tbody tr:nth-child(even) td { background: #faf6ef; }
.table tbody tr:hover td { background: var(--brand-tint); }
.table a { font-family: var(--font-mono); font-size: .88rem; font-weight: 500; }
.table td a[href^="/people"], .table td a[href*="/plan"] { font-family: var(--font-body); font-size: inherit; }

/* badges and the severity marker: shape and words, never colour alone */
.badge { border-radius: var(--radius); font-family: var(--font-display); text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border: 1px solid currentColor; background: transparent; }
.badge-secondary { color: var(--ink-soft); } .badge-success { color: #1d5a33; } .badge-warning { color: #7a4605; background: var(--signal-tint); } .badge-danger { color: #8a1030; background: #fbe9ec; }
.sev { border-radius: var(--radius); font-family: var(--font-display); text-transform: uppercase; letter-spacing: .07em; font-size: .74rem; padding: .12rem .55rem .12rem .4rem; background: #fff; border: 1px solid var(--ink); display: inline-flex; align-items: center; gap: .35rem; }
.sev::before { content: ''; width: .6rem; height: .6rem; background: var(--ink); flex: none; }
.sev-moderate::before { background: #c58b12; } .sev-serious::before { background: #c4510a; transform: rotate(45deg); } .sev-critical { background: var(--brand); color: #fff; border-color: var(--brand); } .sev-critical::before { background: #fff; border-radius: 50%; }

/* record entries and the history timeline */
.entry { position: relative; padding: .9rem 0 .9rem 1.6rem; border-top: 0; }
.entry::before { content: ''; position: absolute; left: .32rem; top: 1.25rem; width: .7rem; height: .7rem; background: var(--surface); border: 2px solid var(--brand); border-radius: 50%; z-index: 1; }
.entry::after { content: ''; position: absolute; left: .62rem; top: 1.95rem; bottom: -.4rem; width: 2px; background: var(--rule); }
.entry:last-child::after { display: none; }
.plain li { border-top-color: var(--rule); }
.stats { gap: 0; border: 1px solid var(--ink); background: var(--surface); box-shadow: 4px 4px 0 var(--rule); }
.stat { flex: 1 1 8rem; padding: 1rem 1.25rem; border-right: 1px solid var(--rule); }
.stat:last-child { border-right: 0; }
.stat .figure { font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; line-height: 1; color: var(--brand); }
.bar-cell progress { accent-color: var(--brand); }

/* the case view: the record on the left, a rail of what matters on the right */
.case { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 1.5rem 2rem; align-items: start; }
.case-rail { position: sticky; top: 5rem; display: grid; gap: 1rem; }
.case-ref { font-family: var(--font-mono); font-size: .95rem; color: var(--brand); font-weight: 500; letter-spacing: .04em; }
.stamp { display: inline-block; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: .95rem; border: 2px solid var(--brand); color: var(--brand); padding: .2rem .7rem; transform: rotate(-2deg); background: var(--surface); }
.stamp-closed { border-color: #1d5a33; color: #1d5a33; } .stamp-draft { border-color: var(--muted); color: var(--muted); border-style: dashed; }
.rail-list { margin: 0; padding: 0; list-style: none; font-size: .95rem; } .rail-list li { display: flex; justify-content: space-between; gap: .75rem; padding: .45rem 0; border-top: 1px solid var(--rule-soft); } .rail-list li:first-child { border-top: 0; } .rail-list span:first-child { color: var(--muted); }
@media (max-width: 64rem) { .case { grid-template-columns: 1fr; } .case-rail { position: static; order: -1; } }

footer { background: var(--ink); color: #cdbfc4; margin-top: 3rem; } footer a { color: #fff; } footer p { color: #cdbfc4; }
.session-notice { border-radius: 0; }

/* navigation: one row on a wide screen, a Menu button below it */
.nav-collapse { display: contents; }
.nav-toggle { display: none; }
@media (max-width: 64rem) {
  .bar { flex-wrap: wrap; }
  .js .nav-toggle { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; background: transparent; color: #fff; border: 1px solid rgb(255 255 255 / .6); border-radius: 2px; font: inherit; font-weight: 600; cursor: pointer; }
  .js .nav-toggle[aria-expanded="true"] { background: rgb(255 255 255 / .14); }
  .nav-collapse { display: block; width: 100%; }
  .js .nav-collapse { display: none; } .js .nav-collapse.nav-open { display: block; }
  .nav-menu { flex-direction: column; gap: 0; width: 100%; } .nav-menu a { display: block; }
  .who { padding: .75rem 0; border-top: 1px solid rgb(255 255 255 / .2); }
}
.page-head h1 { border: 0; }
.page-head .row2 { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; }
.page-head .case-ref { margin: .4rem 0 0; }
.page-head > p { margin-top: .6rem; }
.who .btn.btn-secondary, .who button.btn.btn-secondary { background: transparent; color: #fff; border: 1px solid rgb(255 255 255 / .55); }
.who .btn.btn-secondary:hover { background: #fff; color: var(--ink); }
@media (min-width: 64.01rem) { .bar { flex-wrap: nowrap; } .nav-menu a { padding: .5rem .55rem; font-size: .88rem; } .nav-menu { gap: 0; } .who { flex: none; } .logo { flex: none; } }
.page-head .eyebrow { margin: 0 0 .5rem; }
.page-head > .row2 { margin-top: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
legend { padding: 0; margin-bottom: .4rem; }
.row2 > .form-group { margin-top: 0; margin-bottom: 0; }
