:root {
  --navy: #1F3B57;
  --blue: #2E6CA4;
  --lblue: #D6E4F0;
  --lgrey: #F2F4F7;
  --amber: #FCE8C8;
  --green: #DDEBD3;
  --red: #C0392B;
  --border: #d9dee5;
  --text: #1c2733;
  --muted: #6b7785;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--lgrey);
  font-size: 14px;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--navy); color: #cfe0ef; flex-shrink: 0;
  display: flex; flex-direction: column; padding-bottom: 24px;
}
.brand { padding: 20px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.brand-mark span { color: #7fb2e0; }
.brand-sub { display: block; font-size: 11px; color: #8aa6c0; margin-top: 2px; text-transform: uppercase; letter-spacing: 1px; }
.sidebar nav { display: flex; flex-direction: column; margin-top: 8px; }
.sidebar nav a { color: #cfe0ef; padding: 9px 18px; font-size: 13px; border-left: 3px solid transparent; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.sidebar nav a.active { background: rgba(127,178,224,.16); border-left-color: #7fb2e0; color: #fff; }
.nav-group { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #6f8aa6; padding: 14px 18px 4px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px;
}
.topbar-title { font-size: 16px; font-weight: 600; color: var(--navy); }
.content { padding: 24px; flex: 1; }
.footer { padding: 14px 24px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); background: #fff; }

/* ---------- Account menu ---------- */
.account { position: relative; }
.account-btn { background: var(--lgrey); border: 1px solid var(--border); border-radius: 6px; padding: 7px 12px; cursor: pointer; font-size: 13px; }
.account-dd { position: absolute; right: 0; top: 42px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 220px; display: none; z-index: 50; overflow: hidden; }
.account-dd.open { display: block; }
.account-info { padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--lgrey); }
.account-dd a, .account-dd button { display: block; width: 100%; text-align: left; padding: 10px 14px; background: none; border: none; font-size: 13px; cursor: pointer; color: var(--text); }
.account-dd a:hover, .account-dd button:hover { background: var(--lblue); text-decoration: none; }
.account-dd form { margin: 0; }

/* ---------- Messages ---------- */
.messages { padding: 12px 24px 0; }
.msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; font-size: 13px; }
.msg.success { background: var(--green); color: #2c5b1f; }
.msg.error { background: #f8d7da; color: #842029; }
.msg.info, .msg.warning { background: var(--amber); color: #7a5a16; }

/* ---------- Cards / panels ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 22px; margin-bottom: 18px; }
.card h2 { margin: 0 0 4px; color: var(--navy); font-size: 18px; }
.card .lead { color: var(--muted); margin: 0 0 16px; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

.page-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.page-head h1 { color: var(--navy); font-size: 22px; margin: 0; }

/* ---------- Demo banner ---------- */
.demo-banner { background: var(--red); color: #fff; padding: 10px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 16px; }
.form-row label.field-label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--navy); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=password], input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,108,164,.12); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check, .radio { display: flex; align-items: center; gap: 7px; font-weight: normal; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.check input, .radio input { width: auto; }
.check:hover, .radio:hover { background: var(--lgrey); }
.help { color: var(--muted); font-size: 12px; margin-top: 4px; }
/* Section headings inside a multi-section form (Insurance / Patient steps) */
.section-head { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--blue); margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.section-head:first-of-type { margin-top: 6px; }
/* Read-only recap of details captured on an earlier step (so nothing is re-entered) */
.ro-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 20px;
  background: var(--lgrey); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.ro-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ro-value { font-weight: 600; color: var(--navy); }

.btn { background: var(--blue); color: #fff; border: none; border-radius: 7px; padding: 10px 20px; font-size: 14px; cursor: pointer; font-weight: 600; }
.btn:hover { background: #25588a; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--lgrey); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.danger { background: var(--red); }
.form-actions { display: flex; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.irreversible-note { color: var(--red); font-size: 12px; margin-top: 8px; }

/* ---------- Progress bar ---------- */
.progress { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
/* Completed steps: bold, clickable, take the user back to that page. */
.progress a.step.done { font-weight: 700; text-decoration: none; cursor: pointer; }
.progress a.step.done:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.progress-track { position: relative; height: 14px; border-radius: 8px; background: #e8eef5;
  border: 1px solid var(--border); overflow: hidden; margin-bottom: 18px; max-width: 720px; }
.progress-fill { height: 100%; background: var(--blue); border-radius: 8px 0 0 8px;
  transition: width .3s ease; }
.progress-pct { position: absolute; top: 0; right: 8px; font-size: 10px; line-height: 14px;
  color: var(--navy); font-weight: 700; }
.progress .step { font-size: 11px; padding: 5px 10px; border-radius: 20px; background: #fff; border: 1px solid var(--border); color: var(--muted); }
.progress .step.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.progress .step.done { background: var(--lblue); color: var(--navy); }

/* ---------- Tables ---------- */
table.grid { width: 100%; border-collapse: collapse; background: #fff; }
table.grid th, table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; vertical-align: middle; }
table.grid th { background: var(--navy); color: #fff; font-weight: 600; position: sticky; top: 0; }
table.grid tr:nth-child(even) td { background: var(--lgrey); }
table.grid tr:hover td { background: var(--lblue); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.pill.active { background: var(--green); color: #2c5b1f; }
.pill.inactive { background: #eee; color: #888; }
.pill.demo { background: var(--red); color: #fff; }
.pill.tele { background: var(--amber); color: #7a5a16; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; }
.pagination { display: flex; gap: 6px; margin-top: 14px; align-items: center; font-size: 13px; }
.pagination a, .pagination span { padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.pagination .current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- Dashboard counters ---------- */
.counter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px,1fr)); gap: 14px; }
.counter { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.counter .code { font-size: 12px; font-weight: 700; color: var(--blue); letter-spacing: 1px; }
.counter .rows { margin-top: 8px; }
.counter .rows div { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; border-bottom: 1px dashed #eee; }
.counter .rows b { color: var(--navy); }

/* ---------- Icons (file/signature legend) ---------- */
.ico { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 5px; font-size: 11px; font-weight: 700; margin: 1px; }

/* Genetic / Whole Exome Records: the 17-column table would otherwise crush the
   Status / Files / GTC cells (chips stacking one per line, "Not Collected"
   truncated). Firm minimum widths keep them readable; the wrapper scrolls. */
.fm-status { min-width: 96px; }
.fm-status .btn { margin-top: 4px; display: inline-block; }
.fm-files { display: flex; flex-wrap: wrap; gap: 2px; min-width: 120px; max-width: 172px; align-content: flex-start; }
select.fm-collect { min-width: 120px; }
.fm-gtcdate input[type="date"] { min-width: 130px; }

/* Collapsed multi-select dropdown (dynamic questions, e.g. WES clinical). */
.dd-multi { position: relative; }
.dd-multi > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; background: #fff; font-size: 13.5px; }
.dd-multi > summary::-webkit-details-marker { display: none; }
.dd-multi .dd-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-multi .dd-caret { color: #97a1ad; }
.dd-multi[open] > summary { border-color: var(--blue); }
.dd-multi .dd-panel { position: absolute; z-index: 30; left: 0; right: 0; margin-top: 4px; max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.12); padding: 8px 10px; }
.dd-multi .dd-panel label { display: block; font-weight: normal; font-size: 13px; margin-bottom: 5px; }
.dd-multi .dd-panel input[disabled] + * , .dd-multi .dd-panel label:has(input[disabled]) { color: #b6bec7; }
.ico.on { background: var(--blue); color: #fff; }
.ico.gen { background: var(--green); color: #2c5b1f; }
.ico.off { background: #eee; color: #bbb; }
.ico.sig-digital { background: var(--green); color: #2c5b1f; }
.ico.sig-manual { background: var(--amber); color: #7a5a16; }
.ico.sig-missing { background: #f8d7da; color: #842029; }
.ico.missing { background: #f8d7da; color: #842029; border: 1px solid #dc3545; }

/* PGX page: full-width card so the clinical table has room to breathe */
.pgx-card { max-width: 1180px; }

/* PGX line: three-column top row (medication · diagnosis · reason), full-width alternatives */
.pgx-top { display: grid; grid-template-columns: 1.15fr 1.15fr 1fr; gap: 18px; align-items: start; }
.pgx-top .med-search, .pgx-top .dx-search,
.reason-select, .reason-other, .alt-search { width: 100%; box-sizing: border-box; }
@media (max-width: 900px) { .pgx-top { grid-template-columns: 1fr; gap: 12px; } }
.pgx-line-actions { margin-top: 12px; text-align: right; }

/* PGX diagnosis typeahead */
.dx-search { width: 100%; }
.dx-results, .med-results { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 2px;
  background: #fff; border: 1px solid #c7d2e0; border-radius: 6px; max-height: 260px;
  overflow-y: auto; box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.dx-opt { padding: 7px 10px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f1f4f8; }
.dx-opt:last-child { border-bottom: 0; }
.dx-opt:hover { background: #eef4fb; }
.dx-rel { background: var(--green); color: #2c5b1f; font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px; margin-right: 4px; }
.dx-empty { padding: 9px 10px; color: #8a93a0; font-size: 13px; }
.med-meta { color: var(--navy); font-size: 11px; font-weight: 600; margin-left: 4px; }
.med-sub { color: #6b7480; font-size: 11px; margin-top: 2px; }
/* PGX line: reason + alternatives (chips / suggestion pills).
   Override the generic .med-row grid so the line stacks full-width (top row + alternatives). */
.med-row.pgx-line { display: block; border: 1px solid #dbe3ec; border-radius: 10px; padding: 18px; margin-bottom: 14px; }
/* Order lifecycle pills */
.pill.st-in_progress { background: var(--amber); color: #7a5a16; }
.pill.st-entered { background: var(--lblue); color: var(--navy); }
.pill.st-signed { background: var(--green); color: #2c5b1f; }
/* Grayed-out info line under a selected medication (gene, CPIC, class). */
.med-info { margin-top: 4px; font-size: 11.5px; color: #97a1ad; }
/* Diagnosis chips: ordered, first = primary. Click a later chip to promote it. */
.dx-chips { margin-bottom: 6px; }
.dx-chip { display: inline-flex; align-items: center; gap: 4px; background: #eef3ea; color: #2c4a2c;
  border: 1px solid #cfe0cc; border-radius: 14px; padding: 3px 6px 3px 10px; margin: 2px 4px 2px 0;
  font-size: 12px; cursor: pointer; }
.dx-chip:first-child { background: #dcebd8; border-color: #9fc39a; font-weight: 600; }
.dx-chip:first-child::before { content: "PRIMARY"; font-size: 9px; letter-spacing: .4px;
  background: #4c7d46; color: #fff; border-radius: 8px; padding: 1px 6px; margin-right: 2px; }
.dx-x { border: 0; background: transparent; cursor: pointer; font-size: 15px; line-height: 1; color: #6b7480; padding: 0 2px; }
.dx-x:hover { color: var(--red); }
.alt-chips { margin-bottom: 6px; }
.alt-chip { display: inline-flex; align-items: center; gap: 4px; background: #e7eefb; color: #1F3B57;
  border-radius: 14px; padding: 3px 6px 3px 10px; margin: 2px 4px 2px 0; font-size: 12px; }
.alt-chip small { color: #5b6675; }
.alt-x { border: 0; background: transparent; cursor: pointer; font-size: 15px; line-height: 1; color: #6b7480; padding: 0 2px; }
.alt-x:hover { color: var(--red); }
.alt-suggestions { margin-top: 6px; }
.alt-pill { display: inline-block; background: #f1f4f8; border: 1px solid #d6deea; border-radius: 12px;
  padding: 3px 9px; margin: 2px 4px 2px 0; font-size: 12px; cursor: pointer; }
.alt-pill small { color: #6b7480; }
.alt-pill:hover { background: #e7eefb; }
.alt-pill.picked { opacity: .4; pointer-events: none; }

/* ---------- Signature pad ---------- */
.sigpad-wrap { border: 1px dashed var(--blue); border-radius: 10px; padding: 10px; background: #fff; display: inline-block; }
canvas.sigpad { border: 1px solid var(--border); border-radius: 6px; touch-action: none; background: #fff; display: block; }
.secured { color: #2c5b1f; font-size: 12px; font-weight: 600; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-overlay[hidden] { display: none; }
.modal { background: #fff; border-radius: 12px; padding: 26px; width: 380px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h3 { margin-top: 0; color: var(--navy); }
.modal .countdown { font-size: 22px; color: var(--red); font-weight: 700; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }

/* ---------- Auth ---------- */
body.auth { background: var(--navy); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: #fff; padding: 36px; border-radius: 14px; width: 360px; box-shadow: 0 24px 70px rgba(0,0,0,.4); }
.login-card .brand-mark { font-size: 30px; font-weight: 700; color: var(--navy); }
.login-card .brand-mark span { color: var(--blue); }
.login-card h1 { font-size: 16px; color: var(--muted); font-weight: 500; margin: 4px 0 22px; }

.muted { color: var(--muted); }
.small { font-size: 11px; }
.mb0 { margin-bottom: 0; }
.tests-list { display: grid; gap: 10px; }
.test-item { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.test-item .code { font-weight: 700; color: var(--blue); }
.med-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-bottom: 8px; align-items: end; }

/* --- Insurance card scan (Insurance step) --- */
.cardscan { border: 1px solid var(--border); background: #fbfcfe; border-radius: 6px;
  padding: 14px 16px; margin: 14px 0 22px; }
.cardscan-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: start; }
.cardscan-grid input[type=file] { width: 100%; font-size: 12px; }
.cardscan-actions { padding-top: 20px; }
.cardscan .thumb { display: inline-block; margin-top: 8px; }
.cardscan .thumb img { max-height: 78px; border: 1px solid var(--border); border-radius: 4px; }

.scan-result { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.scan-title { margin: 0 0 8px; font-size: 13px; color: var(--navy); }
.scan-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.scan-table th { text-align: left; font-weight: 600; color: var(--muted); width: 150px;
  padding: 5px 8px 5px 0; vertical-align: top; }
.scan-table td { padding: 5px 8px 5px 0; vertical-align: top; }
.scan-warn { background: var(--amber); color: #7a5a16; border-radius: 4px;
  padding: 8px 10px; margin-top: 8px; font-size: 12px; }

.chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px;
  font-weight: 600; background: #eef1f5; color: var(--muted); }
.chip-ok { background: var(--green); color: #2c5b1f; }
.chip-warn { background: var(--amber); color: #7a5a16; }
.conf { font-size: 11px; color: var(--muted); }
.conf-low { color: var(--red); font-weight: 600; }
input.from-card, select.from-card { border-left: 3px solid #6aa84f; background: #fbfffa; }

/* Card-vs-271 verdict (Coverage step) */
.verdict { border-radius: 6px; padding: 10px 12px; margin: 12px 0; font-size: 13px;
  border: 1px solid var(--border); }
.verdict-confirmed { background: var(--green); border-color: #b8d4a5; color: #2c5b1f; }
.verdict-rejected, .verdict-mismatch { background: var(--amber); border-color: #e6cfa4; color: #7a5a16; }
.verdict-inconclusive { background: var(--lgrey); }
.verdict table { border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.verdict th, .verdict td { text-align: left; padding: 3px 14px 3px 0; }
.verdict .card-img { max-height: 120px; border: 1px solid var(--border);
  border-radius: 4px; margin-top: 8px; }

/* --- Patient Submissions (admin search + detail) --- */
.subs-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 4px; }
.subs-filters .subs-q { flex: 1 1 280px; min-width: 220px; }
.subs-filters select, .subs-filters input[type=text], .subs-filters input[type=date] {
  padding: 6px 8px; font-size: 13px; }
.subs-date { font-size: 12px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.subs-table td { vertical-align: top; }
.subs-row { cursor: pointer; }
.subs-row:hover { background: var(--lblue); }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 14px; }

.sd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sd-badges { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 4px; }
.sd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; margin: 6px 0 4px; }
.sd-grid > div { font-size: 13px; }
.sd-k { display: block; font-size: 11px; font-weight: 600; letter-spacing: .03em;
  text-transform: uppercase; color: var(--muted); }
.sd-card { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin: 8px 0; background: #fbfcfe; }
.sd-card-h { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
@media (max-width: 640px) { .sd-grid { grid-template-columns: 1fr; } }

/* --- Proper CPT billing box on the Medical-Necessity page --- */
.cpt-box { border: 1px solid var(--border); border-left: 3px solid var(--blue);
  border-radius: 6px; padding: 10px 12px; margin: 0 0 14px; background: #fbfcfe; }
.cpt-box .help { margin: 4px 0 0; }
.cpt-cov { margin-top: 6px; }
.cpt-cov summary { cursor: pointer; }

/* --- PGX chart screener --- */
.chart-screen { border: 1px solid var(--border); border-radius: 6px; margin: 4px 0 14px; background: #fbfcfe; }
.chart-screen > details > summary { cursor: pointer; padding: 10px 12px; font-size: 13px; list-style: none; }
.chart-screen > details > summary::-webkit-details-marker { display: none; }
.chart-screen > details[open] > summary { border-bottom: 1px solid var(--border); }
.cs-body { padding: 12px; }
.cs-body textarea { width: 100%; box-sizing: border-box; font-size: 12.5px; padding: 8px; resize: vertical; }
.cs-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.cs-result { margin-top: 12px; overflow-x: auto; }
.cs-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cs-table th, .cs-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cs-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .02em; }
.cs-table tr.cs-q { background: #f2f9f2; }
.cs-table tr.cs-n td { color: var(--muted); }
.cs-table td:nth-child(6) { color: #d19a00; white-space: nowrap; letter-spacing: 1px; }

/* --- Records queues: sortable headers + the column filter row ---
   table.grid th is the dark navy header, so these rules have to match its
   specificity (table.grid ...) to win. The filter row is deliberately light:
   it is a set of controls, not part of the heading. */
table.grid th.fm-sort { white-space: nowrap; }
table.grid th.fm-sort a { color: #fff; text-decoration: none; display: inline-block; }
table.grid th.fm-sort a:hover { text-decoration: underline; }
table.grid th.fm-sort.sorted { background: var(--blue); }
table.grid th.fm-sort .caret { font-size: 9px; margin-left: 3px; vertical-align: 1px; }

table.grid tr.fm-filter-row th { background: var(--lgrey); color: var(--text);
                                 border-bottom: 2px solid var(--border);
                                 padding: 5px 6px; font-weight: 400; vertical-align: top;
                                 position: static; }
table.grid tr.fm-filter-row select,
table.grid tr.fm-filter-row input { width: 100%; min-width: 0; font-size: 11.5px;
                                    padding: 2px 4px; margin: 0 0 3px; display: block; }
table.grid tr.fm-filter-row input[type=date] { font-size: 10.5px; }
table.grid tr.fm-filter-row button { width: 100%; }
