/* ==========================================================================
   Sara Care Diagnostic Center — staff interface prototypes
   Loaded only by the internal prototype screens (not the public pages).
   These are front-end designs only: no database, no authentication.
   ========================================================================== */

:root {
  --navy: #082A60;
  --navy-800: #06224F;
  --navy-50: #EAF1FB;
  --teal: #009F87;
  --teal-700: #00796A;
  --teal-50: #E6F7F4;
  --sky: #EAF9FC;
  --white: #FFFFFF;
  --ink: #0E1F3D;
  --ink-2: #40506B;
  --ink-3: #6B7A93;
  --line: #DDE5F0;
  --line-2: #EDF1F7;
  --orange: #D97706;
  --orange-50: #FDF3E3;
  --blue: #2563EB;
  --blue-50: #E8EFFE;
  --green: #16A34A;
  --green-50: #E7F6EC;
  --red: #B42318;
  --red-50: #FDECEA;
  --wa: #25D366;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(8, 42, 96, .06), 0 8px 20px -14px rgba(8, 42, 96, .28);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #F5F8FC;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--navy);
  line-height: 1.22;
  margin: 0 0 .5rem;
  letter-spacing: -.015em;
}
h1 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); font-weight: 800; }
h2 { font-size: clamp(1.1rem, 1.8vw, 1.25rem); font-weight: 750; }
h3 { font-size: 1rem; font-weight: 700; }
h4 { font-size: .92rem; font-weight: 700; }
p { margin: 0 0 .8rem; }
a { color: var(--teal-700); }
small { font-size: .8rem; }

/* ---------- Prototype notice ---------- */
.proto {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .7rem clamp(1rem, 2.5vw, 1.6rem);
  background: #FFF8E6;
  border-bottom: 1px solid #F2DFAF;
  color: #6B4B00;
  font-size: .8rem;
  line-height: 1.5;
}
.proto strong { font-weight: 700; }
.proto svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; }

/* ---------- App shell ---------- */
.staff-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.staff-side {
  background: var(--navy);
  color: #C9D8EE;
  padding: 1rem 1rem 1.2rem;
}
.staff-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .2rem .3rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .13);
  margin-bottom: .8rem;
}
.staff-brand img {
  width: 40px; height: 40px;
  object-fit: contain;
  background: #fff;
  border-radius: 9px;
  padding: 3px;
  flex: 0 0 auto;
}
.staff-brand span {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: .9rem;
  color: #fff;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.staff-brand em {
  display: block;
  font-style: normal;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .68rem;
  color: #8FB4E0;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.staff-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.staff-nav a {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .7rem;
  border-radius: 9px;
  color: #C9D8EE;
  text-decoration: none;
  font-size: .86rem;
  font-weight: 500;
  min-height: 40px;
}
.staff-nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.staff-nav a.is-active { background: var(--teal); color: #fff; font-weight: 650; }
.staff-nav svg { width: 17px; height: 17px; flex: 0 0 auto; }
.staff-nav .nav-label {
  display: block;
  font-size: .66rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #7C9DCB;
  margin: 1rem .3rem .35rem;
  width: 100%;
}

.staff-user {
  margin-top: 1.2rem;
  padding: .75rem .8rem;
  background: rgba(255, 255, 255, .07);
  border-radius: 10px;
  font-size: .8rem;
  line-height: 1.45;
}
.staff-user strong { color: #fff; display: block; font-size: .85rem; }
.staff-user span { color: #9CB8DB; }

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

.staff-top {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  align-items: center;
  justify-content: space-between;
  padding: .9rem clamp(1rem, 2.5vw, 1.8rem);
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.staff-top h1 { margin: 0; }
.staff-top p { margin: .15rem 0 0; font-size: .78rem; color: var(--ink-3); }
.staff-top .top-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.staff-content { padding: clamp(1rem, 2.5vw, 1.8rem); display: grid; gap: 1.1rem; }
.staff-content > .panel, .staff-content > .stat-grid, .staff-content > .split { min-width: 0; }

@media (min-width: 1000px) {
  .staff-shell { grid-template-columns: 250px minmax(0, 1fr); }
  .staff-side {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 1.2rem 1rem 1.5rem;
  }
  .staff-nav { flex-direction: column; flex-wrap: nowrap; }
  .staff-nav a { width: 100%; }
}

/* ---------- Summary cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: .8rem;
}
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: .2rem;
  text-decoration: none;
  color: inherit;
}
.stat .stat-label {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
  font-weight: 650;
}
.stat .stat-value {
  font-family: var(--font-head);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}
.stat .stat-note { font-size: .74rem; color: var(--ink-3); }
.stat--orange { border-left: 4px solid var(--orange); }
.stat--blue { border-left: 4px solid var(--blue); }
.stat--green { border-left: 4px solid var(--green); }
.stat--teal { border-left: 4px solid var(--teal); }

/* ---------- Panels ---------- */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--line-2);
}
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-head p { margin: .15rem 0 0; font-size: .78rem; color: var(--ink-3); }
.panel-body { padding: 1.1rem; }
.panel-body > :last-child { margin-bottom: 0; }
.panel-foot {
  padding: .8rem 1.1rem;
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
  background: #FBFCFE;
}

.split { display: grid; gap: 1.1rem; }
@media (min-width: 860px) {
  .split--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split--wide { grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); }
}

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip--orange { background: var(--orange-50); color: #8A4B00; border-color: #F2D4A2; }
.chip--blue { background: var(--blue-50); color: #1D4ED8; border-color: #BFD3FB; }
.chip--green { background: var(--green-50); color: #15803D; border-color: #B6E3C6; }
.chip--red { background: var(--red-50); color: var(--red); border-color: #F5C6C0; }
.chip--grey { background: #F2F5FA; color: var(--ink-2); border-color: var(--line); }
.chip--navy { background: var(--navy-50); color: var(--navy); border-color: #C6D7F2; }
.chip--teal { background: var(--teal-50); color: var(--teal-700); border-color: #BFE6DF; }
.chip::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.chip--plain::before { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 40px;
  padding: .5rem .95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: .84rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: #F3F7FC; border-color: #C8D6E8; }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-700); border-color: var(--teal-700); }
.btn--navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--navy-800); border-color: var(--navy-800); }
.btn--wa { background: var(--wa); border-color: var(--wa); color: #06331D; }
.btn--wa:hover { background: #1EBB59; border-color: #1EBB59; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn--danger { background: var(--red-50); border-color: #F1C3BC; color: var(--red); }
.btn--sm { min-height: 32px; padding: .28rem .6rem; font-size: .76rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  min-width: 880px;
}
table.data th, table.data td {
  text-align: left;
  padding: .7rem .8rem;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
table.data thead th {
  background: #F7FAFE;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-3);
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.data tbody tr:hover { background: #FAFCFF; }
table.data td .ref { font-family: var(--mono); font-size: .78rem; color: var(--navy); white-space: nowrap; }
table.data td .sub { display: block; font-size: .74rem; color: var(--ink-3); }
table.data .actions { display: flex; flex-wrap: wrap; gap: .3rem; }
table.data .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data--compact { min-width: 560px; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: grid;
  gap: .6rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--line-2);
  background: #FBFCFE;
}
@media (min-width: 760px) {
  .toolbar { grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(130px, .6fr)); align-items: end; }
}
.tabs { display: flex; flex-wrap: wrap; gap: .35rem; padding: .8rem 1.1rem 0; border-bottom: 1px solid var(--line-2); }
.tabs a, .tabs span {
  padding: .45rem .8rem;
  border-radius: 9px 9px 0 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
}
.tabs a:hover { background: #F4F8FD; }
.tabs .is-active { color: var(--navy); border-bottom-color: var(--teal); background: #fff; }

/* ---------- Form controls (prototype markup) ---------- */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .8rem; }
.field > label, .field-label {
  font-size: .78rem;
  font-weight: 650;
  color: var(--ink-2);
}
.field .req { color: var(--red); }
.field .hint { font-size: .74rem; color: var(--ink-3); }
.field input, .field select, .field textarea {
  font: inherit;
  font-size: .86rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  width: 100%;
  min-height: 40px;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}
.field input[disabled], .field select[disabled] {
  background: #F2F5FA;
  color: var(--ink-3);
  cursor: not-allowed;
}
.field-grid { display: grid; gap: 0 .9rem; }
@media (min-width: 700px) { .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field-grid--3 { }
@media (min-width: 800px) { .field-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.checks { display: grid; gap: .45rem; }
.check { display: flex; gap: .5rem; align-items: flex-start; font-size: .85rem; color: var(--ink-2); }
.check input { margin-top: .25rem; accent-color: var(--teal); width: 16px; height: 16px; flex: 0 0 auto; min-height: 0; }

/* ---------- Notes, callouts, timelines ---------- */
.note {
  font-size: .8rem;
  color: var(--ink-2);
  background: #F7FAFE;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  padding: .7rem .85rem;
}
.note strong { color: var(--navy); }
.note p:last-child { margin-bottom: 0; }
.note--warn { background: #FFF9EC; border-left-color: var(--orange); }

.legend { display: flex; flex-wrap: wrap; gap: .5rem; }

.timeline { list-style: none; margin: .2rem 0 0; padding: 0; display: grid; gap: .9rem; }
.timeline li {
  position: relative;
  padding-left: 1.4rem;
  font-size: .82rem;
  color: var(--ink-2);
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 0; top: .42rem;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--teal);
}
.timeline li::after {
  content: "";
  position: absolute;
  left: 3.5px; top: 1.2rem; bottom: -.9rem;
  width: 1px;
  background: var(--line);
}
.timeline li:last-child::after { display: none; }
.timeline strong { color: var(--navy); display: block; }
.timeline time { font-size: .74rem; color: var(--ink-3); }

.kv { display: grid; gap: .45rem; margin: 0; font-size: .84rem; }
.kv > div { display: flex; gap: .6rem; justify-content: space-between; border-bottom: 1px dashed var(--line-2); padding-bottom: .4rem; }
.kv dt { color: var(--ink-3); font-size: .78rem; margin: 0; }
.kv dd { margin: 0; color: var(--navy); font-weight: 600; text-align: right; }

.doc-links { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.doc-links a {
  display: flex;
  gap: .6rem;
  align-items: center;
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-decoration: none;
  color: var(--navy);
  font-size: .84rem;
  font-weight: 600;
  background: #fff;
}
.doc-links a:hover { border-color: var(--teal); background: var(--teal-50); }
.doc-links span { display: block; font-weight: 500; font-size: .75rem; color: var(--ink-3); }

.status-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .75rem .85rem;
  background: #fff;
}
.status-card strong { display: block; font-size: .86rem; color: var(--navy); }
.status-card span { font-size: .75rem; color: var(--ink-3); }

.stack { display: grid; gap: 1rem; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: .8rem; }
.tag-mini {
  font-family: var(--mono);
  font-size: .72rem;
  background: #F2F5FA;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .05rem .3rem;
  color: var(--ink-2);
}
ul.plain { margin: 0 0 .8rem; padding-left: 1.15rem; font-size: .85rem; color: var(--ink-2); }
ul.plain li { margin-bottom: .35rem; }
