/* Demo Clinic EHR
   ArthiBot project theme for the Demo site.
   Distinct from ArthiBot (dark navy + mint, left admin rail),
   Old Louisville Stay (gold #a2783a, cream, Caslon/Outfit, marketing nav),
   and Doorman Norman Seaside (teal #164e63, sand, Baskerville, booking hero).
   This is a light clinical chart: wine application bar, terracotta actions,
   IBM Plex Sans, top bar + patient banner (not a left rail or a marketing header). */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
}

:root {
  --ehr-chrome: #3e1c2b;
  --ehr-chrome-ink: #ffffff;
  --ehr-chrome-muted: #f0dce4;
  --ehr-accent: #8a3518;
  --ehr-accent-hover: #6f2a12;
  --ehr-accent-soft: #f8ece6;
  --ehr-canvas: #e3e7ee;
  --ehr-card: #ffffff;
  --ehr-banner: #f7f4f1;
  --ehr-ink: #1a1f29;
  --ehr-muted: #44505e;
  --ehr-line: #cfd5df;
  --ehr-line-strong: #b3bcc8;
  --ehr-chip: #ece7dc;
  --ehr-chip-ink: #3d3830;
  --ehr-notice-bg: #f8efd9;
  --ehr-notice-ink: #5c3f0c;
  --ehr-notice-line: #e0c37a;
  --ehr-allergy-bg: #f8e8e8;
  --ehr-allergy-ink: #8b1e1e;
  --ehr-focus: #215a8f;
  --ehr-radius: 6px;
  --ehr-shadow: 0 1px 2px rgba(26, 31, 41, 0.06), 0 1px 8px rgba(26, 31, 41, 0.04);
  --ehr-font: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --ehr-top: 56px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ehr-canvas);
  color: var(--ehr-ink);
  font: 16px/1.45 var(--ehr-font);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 20;
  background: var(--ehr-card);
  color: var(--ehr-ink);
  padding: 8px 12px;
  border-radius: var(--ehr-radius);
}
.skip-link:focus { top: 8px; }

/* Application chrome: horizontal clinical bar, not a left admin rail */
.ehr-top,
header.ehr-top,
body > header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--ehr-top);
  padding: 0 20px;
  background: var(--ehr-chrome);
  color: var(--ehr-chrome-ink);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.ehr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  flex: 0 0 auto;
}
.ehr-brand:hover, .ehr-brand:focus { color: inherit; text-decoration: none; }

.ehr-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--ehr-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.ehr-brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.ehr-nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  color: var(--ehr-chrome-ink);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--ehr-radius);
  padding: 6px 10px;
  font: 600 13px/1 var(--ehr-font);
  cursor: pointer;
}

.ehr-nav {
  display: flex;
  align-items: stretch;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.ehr-nav a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  min-height: var(--ehr-top);
  color: var(--ehr-chrome-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
}
.ehr-nav a:hover,
.ehr-nav a:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.ehr-nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: #e08a5c;
}

.ehr-top-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

/* Sample / demo notices: visible, not alarm-red */
.sample-label,
.ehr-sample {
  display: inline-flex;
  align-items: center;
  background: var(--ehr-chip);
  color: var(--ehr-chip-ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 9px;
  margin: 0;
  line-height: 1.3;
  border: 1px solid #d8d0c2;
}

.demo-notice,
.ehr-notice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ehr-notice-bg);
  color: var(--ehr-notice-ink);
  border: 1px solid var(--ehr-notice-line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  margin: 0;
  line-height: 1.3;
}

.ehr-page-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}

/* Page workspace — document scroll only, no nested panes */
.ehr-main,
main,
body > main {
  max-width: none;
  margin: 0;
  padding: 24px 28px 48px;
}

.ehr-page {
  max-width: 1080px;
  margin: 0 auto;
}

.ehr-page h1,
.card h1,
main h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ehr-ink);
  line-height: 1.25;
}

.ehr-lead,
.lead {
  color: var(--ehr-muted);
  margin: 0 0 20px;
}

/* Cards & tables used by current Idea pages */
.card,
.ehr-card {
  background: var(--ehr-card);
  border: 1px solid var(--ehr-line);
  border-radius: var(--ehr-radius);
  box-shadow: var(--ehr-shadow);
  padding: 22px 24px;
  width: 100%;
  max-width: none;
  margin: 0 0 20px;
}

.patient-table,
.ehr-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.patient-table th,
.ehr-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ehr-muted);
  background: #f3f1ee;
  border-bottom: 1px solid var(--ehr-line-strong);
  padding: 9px 12px;
}

.patient-table td,
.ehr-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--ehr-line);
  color: var(--ehr-ink);
  font-size: 15px;
  background: transparent;
}

.patient-table tbody tr:hover td,
.ehr-table tbody tr:hover td {
  background: #f7f4f1;
}

.patient-table td.label,
.ehr-table td.label {
  width: 160px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ehr-muted);
  background: #f3f1ee;
  vertical-align: top;
}

.ehr-table a,
.patient-table a,
.ehr-link {
  color: var(--ehr-accent);
  font-weight: 600;
  text-decoration: none;
}
.ehr-table a:hover,
.patient-table a:hover,
.ehr-link:hover { text-decoration: underline; }

.ehr-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: var(--ehr-radius);
  border: 1px solid var(--ehr-accent);
  color: var(--ehr-accent);
  background: #fff;
  font: 600 13px/1 var(--ehr-font);
  text-decoration: none;
}
.ehr-action:hover {
  background: var(--ehr-accent-soft);
  text-decoration: none;
}

/* Search form */
.ehr-search,
main form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin: 0 0 20px;
}

.ehr-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ehr-field label,
main form label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ehr-muted);
}

input[type="text"],
input[type="search"],
.ehr-input {
  font: 16px/1.3 var(--ehr-font);
  color: var(--ehr-ink);
  background: #fff;
  border: 1px solid var(--ehr-line-strong);
  border-radius: var(--ehr-radius);
  padding: 8px 12px;
  min-width: 260px;
  width: min(360px, 100%);
  margin: 0;
}
input[type="text"]:focus,
input[type="search"]:focus,
.ehr-input:focus {
  outline: 2px solid var(--ehr-focus);
  outline-offset: 1px;
  border-color: var(--ehr-focus);
}

button[type="submit"],
.ehr-btn {
  font: 600 14px/1 var(--ehr-font);
  color: #fff;
  background: var(--ehr-accent);
  border: 0;
  border-radius: var(--ehr-radius);
  padding: 10px 16px;
  min-height: 40px;
  cursor: pointer;
}
button[type="submit"]:hover,
.ehr-btn:hover { background: var(--ehr-accent-hover); }
button[type="submit"]:focus-visible,
.ehr-btn:focus-visible,
.ehr-action:focus-visible,
.ehr-nav a:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ehr-focus);
  outline-offset: 2px;
}

/* Patient chart banner */
.ehr-banner {
  background: var(--ehr-banner);
  border: 1px solid var(--ehr-line);
  border-radius: var(--ehr-radius);
  padding: 16px 20px;
  margin: 0 0 20px;
  box-shadow: var(--ehr-shadow);
}

.ehr-banner-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.ehr-patient-name {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.ehr-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
}

.ehr-fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ehr-fact dt {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ehr-muted);
}
.ehr-fact dd {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.ehr-chip-allergy {
  display: inline-flex;
  align-items: center;
  background: var(--ehr-allergy-bg);
  color: var(--ehr-allergy-ink);
  border: 1px solid #e3bcbc;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
}

/* Coming soon */
.ehr-soon {
  text-align: left;
  padding: 28px 8px 8px;
}
.ehr-soon h1 { margin-bottom: 8px; }
.ehr-soon p { color: var(--ehr-muted); max-width: 42rem; }

/* Welcome cards on the home page, if present */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 0 0 20px;
}
.cards .card { margin: 0; }
.cards .card h2 { font-size: 16px; margin: 0 0 6px; }
.cards .card p { margin: 0; color: var(--ehr-muted); }

footer, .ehr-foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 0 8px;
  color: var(--ehr-muted);
  font-size: 12px;
}

/* Neutralize the starter purple bar when this theme is linked after site.css */
body { background: var(--ehr-canvas); color: var(--ehr-ink); font-family: var(--ehr-font); }
body > header { background: var(--ehr-chrome); color: var(--ehr-chrome-ink); }
body > header a { color: inherit; text-decoration: none; }

@media (max-width: 800px) {
  .ehr-top, header.ehr-top, body > header {
    flex-wrap: wrap;
    padding: 8px 14px;
    gap: 8px 12px;
  }
  .ehr-nav-toggle { display: inline-flex; }
  .ehr-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    flex-basis: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }
  .ehr-top.is-open .ehr-nav,
  header.ehr-top.is-open .ehr-nav {
    display: flex;
  }
  .ehr-nav a {
    min-height: 44px;
    border-bottom: 0;
    border-left: 3px solid transparent;
  }
  .ehr-nav a[aria-current="page"] {
    border-left-color: #e08a5c;
    border-bottom-color: transparent;
  }
  .ehr-top-meta {
    width: 100%;
    margin: 0;
    flex-wrap: wrap;
  }
  .ehr-main, main, body > main { padding: 16px 14px 36px; }
  .card, .ehr-card { padding: 16px; }
  input[type="text"], input[type="search"], .ehr-input {
    min-width: 0;
    width: 100%;
  }
  main form, .ehr-search { flex-direction: column; align-items: stretch; }
  button[type="submit"], .ehr-btn { width: 100%; }

  /* Stack tables instead of a sideways scroll pane */
  .patient-table thead,
  .ehr-table.responsive thead { display: none; }
  .patient-table, .patient-table tbody, .patient-table tr, .patient-table td,
  .ehr-table.responsive, .ehr-table.responsive tbody, .ehr-table.responsive tr, .ehr-table.responsive td {
    display: block;
    width: 100%;
  }
  .patient-table tr, .ehr-table.responsive tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--ehr-line-strong);
  }
  .patient-table td, .ehr-table.responsive td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    padding: 4px 0;
  }
  .patient-table td::before,
  .ehr-table.responsive td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ehr-muted);
    flex: 0 0 40%;
  }
  .patient-table td.label,
  .ehr-table td.label {
    width: auto;
    background: transparent;
    padding-bottom: 0;
  }
  .patient-table td.label::before,
  .ehr-table.responsive td.label::before { content: none; }
}

.ehr-nav-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 800px) {
  .ehr-top:has(.ehr-nav-checkbox:checked) .ehr-nav,
  header.ehr-top:has(.ehr-nav-checkbox:checked) .ehr-nav {
    display: flex;
  }
  .ehr-top:has(.ehr-nav-checkbox:checked) .ehr-nav-toggle,
  header.ehr-top:has(.ehr-nav-checkbox:checked) .ehr-nav-toggle {
    background: rgba(255, 255, 255, 0.1);
  }
}

.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}

.ehr-section-label{font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--ehr-muted);margin:0 0 12px;}
