/* Seald tenant administration — the clinic owner's page.
   No web font, no remote asset, no url() with a scheme: the CSP forbids all three and
   test_static.py asserts this file carries no absolute URL. System fonts only. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #5c5c5c;
  --line: #e2e2e2;
  --card: #fafafa;
  --ok: #1b7f4b;
  --error: #b3261e;
  --warn: #8a6d1f;
  --accent: #1f5fbf;
  --accent-fg: #ffffff;
  --code-bg: #f0f0f2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e; --fg: #f2f2f2; --muted: #a8a8a8; --line: #333336;
    --card: #252528; --ok: #4fc98a; --error: #ff8a80; --warn: #e0bc5a;
    --accent: #5b9bff; --accent-fg: #10131a; --code-bg: #16161a;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.shell { max-width: 62rem; margin: 0 auto; padding: 2rem 1.5rem 3rem; display: flex; flex-direction: column; gap: 2rem; }
h1 { margin: 0 0 .4rem; font-size: 1.5rem; font-weight: 600; }
h2 { margin: 0 0 .3rem; font-size: 1.1rem; font-weight: 600; }
h3 { margin: 0 0 .3rem; font-size: 1rem; font-weight: 600; }
.sub { margin: 0 0 .3rem; color: var(--muted); max-width: 52rem; }
.warn {
  margin: .9rem 0 0; padding: .7rem .9rem; max-width: 52rem;
  border: 1px solid var(--warn); border-radius: .5rem; color: var(--warn);
}
.fatal {
  margin: 0; padding: .8rem 1rem;
  border: 1px solid var(--error); border-radius: .5rem; color: var(--error);
}
.session { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; }
.stage { display: flex; flex-direction: column; gap: .7rem; }
.rows { display: flex; flex-direction: column; gap: .7rem; }

.row {
  background: var(--card); border: 1px solid var(--line); border-radius: .6rem;
  padding: .9rem 1rem; display: flex; flex-direction: column; gap: .6rem;
}
.cells { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.cell { display: flex; flex-direction: column; gap: .15rem; min-width: 10rem; }
/* THE LABEL IS LOAD-BEARING. A reference rendered without one reads as a name. */
.cell-label {
  font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted);
}
.cell-ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem;
  background: var(--code-bg); border-radius: .3rem; padding: .1rem .4rem;
  overflow-wrap: anywhere;
}
.cell-value { font-size: .93rem; overflow-wrap: anywhere; }
.cell-pii { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.pii-masked { color: var(--muted); font-style: italic; font-size: .93rem; }
.pii-shown { font-size: .93rem; overflow-wrap: anywhere; }

.field { display: flex; flex-direction: column; gap: .25rem; max-width: 32rem; }
.field-label { font-size: .9rem; font-weight: 600; }
.input {
  font: inherit; font-size: .95rem; padding: .45rem .6rem;
  border: 1px solid var(--line); border-radius: .35rem;
  background: var(--bg); color: var(--fg);
}
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.input.is-empty { border-color: var(--error); }
.form {
  display: flex; flex-direction: column; gap: .7rem;
  background: var(--card); border: 1px solid var(--line); border-radius: .6rem; padding: 1rem;
}

.card-actions { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.btn {
  font: inherit; padding: .4rem .9rem; border-radius: .4rem;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-small { font-size: .82rem; padding: .2rem .55rem; }
.state { margin: 0; font-size: .9rem; color: var(--muted); }
.state.is-ok { color: var(--ok); }
.state.is-error { color: var(--error); }
.foot { border-top: 1px solid var(--line); padding-top: 1rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
