/**
 * Shared styling for the staff-facing tools (login.php, staff/*.php, and
 * whatever the future staff dashboard adds) — the site's actual brand
 * palette and type system, established for thebullysden.com.
 *
 * NOT used by staff/consent-form.php on purpose: that page is the document
 * a customer actually signs, and stays a plain, neutral, printable form
 * rather than a branding moment.
 */

:root {
  --ground: #0f0f0f;
  --surface: #1d1e22;
  --surface-raised: #26262c;
  --text: #ede9e1;
  --text-muted: #a6a49c;
  --violet: #a996ff;
  --oxblood: #6e2f32;
  --oxblood-hover: #7f363a;
  --error: #ff8080;
  --status-good: #7cc48f;
  --status-warn: #e8b767;

  --font-display: "IBM Plex Sans", -apple-system, sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, sans-serif;
  /* Dashboard pages load the Oswald Google Font themselves and use this
     instead of --font-display, without changing how the existing
     login/start pages render (their --font-display stays IBM Plex Sans,
     unchanged). Was Bebas Neue — dropped 2026-09-24, Larry didn't like it. */
  --font-dash-display: "Oswald", "Arial Narrow", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--ground);
  color: var(--text);
}

/* Browser default is font-weight:bold (700) on every heading tag — too
   heavy with Oswald loaded. 500 reads as "bold enough" without it; anything
   that wants heavier (.dash-title, .card h3, etc.) already sets its own
   explicit weight and wins on specificity, so this only affects headings
   that don't override it themselves (e.g. a bare <h2> like a client's
   name). */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
}

/* ---------- shared primitives ---------- */

label {
  display: block;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

select,
input[type="text"],
input[type="password"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--surface-raised);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  margin-bottom: 4px;
}
select:focus,
input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(169, 150, 255, 0.25);
}

button.primary {
  width: 100%;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-size: 17px;
  padding: 12px;
  border: none;
  border-radius: 6px;
  background: var(--oxblood);
  color: #f4ece9;
  cursor: pointer;
}
button.primary:hover {
  background: #7f363a;
}
button.primary:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  padding: 10px;
  margin-top: 10px;
}

.error {
  color: var(--error);
  font-size: 13px;
  margin: 0 0 14px;
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- site header (staff/*.php) — logo, title, nav ----------
   Logo stays fixed at the left; everything else is two rows stacked
   vertically (title, then nav) next to it, rather than one row trying to
   fit everything. Genuinely stacked, not just wrapped-when-tight, so
   title and nav can never land on top of each other at any width — the
   previous absolute-centered version did exactly that on a Galaxy S20
   and Tab S4. */

.site-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-header .brand-logo {
  flex-shrink: 0;
  display: block;
}
.site-header .brand-logo img {
  height: 100px;
  width: auto;
  display: block;
}
.site-header .header-bars {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-header .header-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--violet);
  line-height: 1.15;
}
.site-header nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  height: 50px;
}
/* .nav-btn is the same look, usable anywhere a button (not just a header
   nav link) needs to match — e.g. the Client Info tile's Edit/Notes/Save/
   Cancel actions on staff/client-profile.php. */
.site-header nav a,
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: var(--surface-raised);
  font-family: var(--font-display);
  font-size: 13px;
  padding: 5px 8px;
  cursor: pointer;
}
.site-header nav a:hover,
.nav-btn:hover {
  border-color: var(--violet);
  background: rgba(169, 150, 255, 0.5);
}
.site-header nav a:focus-visible,
.nav-btn:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}
/* .nav-btn only, not the header's Back/Close links — those keep the
   original background. */
.nav-btn {
  background: rgba(169, 150, 255, 0.15);
}

/* A round icon-only button for expanding/collapsing a row (visit entries,
   the Contact Log card) — same visual language as .nav-btn but compact and
   square, with a chevron that flips via aria-expanded. */
.toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 24px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text-muted);
  cursor: pointer;
}
.toggle-btn:hover { border-color: var(--violet); color: var(--violet); background: rgba(169, 150, 255, 0.15); }
.toggle-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.toggle-btn svg { width: 16px; height: 16px; transition: transform 0.15s ease; }
.toggle-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

/* A generic collapsible row — a summary line (left text + .toggle-btn on
   the right) plus a body that JS shows/hides. Used for each Visit History
   entry and for the whole Contact Log card, which mimics one of these. */
.expandable-row { background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.expandable-row:last-child { margin-bottom: 0; }
.expandable-summary { padding: 5px 10px; display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.expandable-body { padding: 0 14px 14px; display: none; }
.expandable-row.open > .expandable-body { display: block; }
.expandable-date { font-family: var(--font-dash-display); font-size: 13px; letter-spacing: 0.08em; }
.expandable-desc { margin-left: 10px; font-size: 13px; color: var(--text-muted); }
/* An .expandable-row nested inside another one's body (each visit row
   inside the collapsible Visit History card) gets a slightly raised shade
   so it reads as distinct from its parent, which shares the same base
   background otherwise. */
.expandable-body .expandable-row { background: var(--surface-raised); }

/* Visit row — two-line summary: date + section buttons (Notes/Ink/Tools/
   Photos) + chevron on line 1, free-text description on line 2. Same
   layout at every width — on narrow phones the buttons just lose their
   padding to fit. */
.visit-summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-areas: "date btns chev" "desc desc desc";
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  padding: 6px 10px;
}
.visit-summary .expandable-date { grid-area: date; }
.visit-summary .expandable-desc { grid-area: desc; margin-left: 0; }
.visit-summary .visit-toggle { grid-area: chev; }
.visit-section-btns { grid-area: btns; display: flex; gap: 6px; flex-wrap: nowrap; }
@media (max-width: 520px) {
  /* Drop .nav-btn's padding back to the browser's default button padding. */
  .visit-section-btn { padding: revert; }
}
/* Section button whose section is currently open — highlighted. Tapping
   it again closes the section, same as the section's own Close button. */
.visit-section-btn.is-active,
.visit-section-btn.is-active:hover { border-color: var(--violet); background: rgba(169, 150, 255, 0.45); }
/* Touch screens keep :hover stuck on the last-tapped element, so a button
   just tapped to close its section would still look highlighted. On
   touch-only devices, show a non-active button's normal look even while
   "hovered". */
@media (hover: none) {
  .visit-section-btn:hover:not(.is-active) { border-color: rgba(255, 255, 255, 0.14); background: rgba(169, 150, 255, 0.15); }
}

/* Visit body — the open sections, always in Notes/Ink/Tools/Photos order
   (DOM order) regardless of which was opened first; divider only between
   two open sections. */
.visit-row > .expandable-body { background: #363636; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 12px; }
.visit-section { display: none; }
.visit-section.open { display: block; }
.visit-section.open ~ .visit-section.open { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.visit-section-actions { display: flex; gap: 8px; }
.visit-section .notes-view { white-space: pre-line; }
.notes-view.is-empty { color: var(--text-muted); font-style: italic; }
/* Link to the visit's signed consent PDF, under the visit's Notes. */
.visit-consent { margin: 10px 0 0; font-size: 13px; }
.visit-consent a { color: var(--violet); }
.visit-section .notes-edit { display: none; }
.visit-section.editing .notes-edit { display: block; }
.visit-section.editing .notes-view { display: none; }

/* Photos section */
/* Scoped to .visit-section: the dashboard's own .photo-grid (further down,
   160px) would otherwise win. */
.visit-section .photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #34343d, #1d1e22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}
.photo-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-tile .chip { position: absolute; top: 6px; left: 6px; font-size: 10px; padding: 2px 8px; background: var(--violet); color: var(--ground); }
/* Edit mode only: Remove in the top-right corner, Portfolio toggle in a
   bar along the bottom. Dark backing so both stay readable over a photo. */
.photo-tile .photo-remove { position: absolute; top: 6px; right: 6px; font-size: 11px; padding: 2px 6px; background: rgba(0, 0, 0, 0.7); }
.photo-tile-edit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 0 6px;
  background: rgba(0, 0, 0, 0.7);
}
.photo-tile-edit .toggle { padding: 5px 0; font-size: 11px; color: var(--text); gap: 6px; }
/* Edit mode: photo marked for removal (deleted only on Save) — darkened,
   with a "Removed" label and an Undo button. */
.photo-removed-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.photo-removed-overlay .nav-btn { text-transform: none; letter-spacing: normal; }
.photo-empty { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--text-muted); font-style: italic; }
/* Take Photo / Choose Photos — edit mode only, left-aligned above the grid. */
.photo-add { display: none; gap: 8px; margin-bottom: 10px; }
.visit-section.editing .photo-add { display: flex; }
/* Take Photo only makes sense on a phone/tablet camera — hide it on
   mouse-driven computers, where it would just open the file browser. */
@media (hover: hover) and (pointer: fine) {
  .photo-add .photo-take { display: none; }
}
.photo-add input { display: none; }

/* client-profile.php: each photo is a card — the square photo, then its
   private note and (Portfolio only) public caption. Edit mode adds the
   Note box, the Portfolio switch and the Caption box, so cards get wider. */
.visit-section .photo-grid.is-editing { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.visit-photo { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.visit-photo .photo-tile img { cursor: zoom-in; }
.visit-photo .photo-removed-overlay { z-index: 2; border-radius: 6px; }
.photo-tile.is-uploading { font-style: italic; }
.photo-note, .photo-caption { margin: 0; font-size: 12.5px; line-height: 1.35; white-space: pre-line; overflow-wrap: anywhere; }
.photo-note { color: var(--text-muted); }
.photo-caption { color: var(--violet); }
.photo-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text-muted); }
.photo-field[hidden] { display: none; }
/* 16px text, so an iPhone doesn't zoom in when the box is tapped. */
.visit-photo .photo-field textarea,
.pv-panel .photo-field textarea {
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  resize: vertical;
}
.visit-photo .photo-field textarea:focus,
.pv-panel .photo-field textarea:focus { outline: none; border-color: var(--violet); box-shadow: none; }
.visit-photo .toggle { padding: 4px 0; color: var(--text); }

/* Full-size photo viewer (tap a photo). */
html.pv-open { overflow: hidden; }
.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #000; /* solid: the page behind showed through the edit fields */
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
.photo-viewer[hidden] { display: none; }
.pv-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 0 16px; }
.pv-count { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pv-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; }
.pv-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.pv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
}
.pv-btn:hover { border-color: var(--violet); color: var(--violet); }
.pv-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.pv-btn[hidden] { display: none; }
.pv-prev, .pv-next { position: absolute; top: 50%; transform: translateY(-50%); font-size: 30px; padding-bottom: 4px; }
.pv-prev { left: 10px; }
.pv-next { right: 10px; }
.pv-top-btns { display: flex; align-items: center; gap: 10px; }
.pv-top-btns .nav-btn[hidden] { display: none; }
/* Under the photo: the note/caption text, or (Edit) the fields. The photo
   above shrinks to make room. */
.pv-panel { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px 14px; text-align: center; font-size: 14px; }
.pv-panel > p { margin: 4px 0 0; overflow-wrap: anywhere; }
.pv-note { color: var(--text-muted); white-space: pre-line; }
.pv-caption { color: var(--violet); }
/* "NOTE" / "PORTFOLIO" in front of the text — small caps in the plain
   text color, so neither label takes the color of what follows it. */
.pv-label { margin-right: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.photo-viewer.is-editing .pv-panel { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.pv-panel .toggle { padding: 4px 0; color: var(--text); }
.pv-edit-btns { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
/* Remove Picture sits apart on the left, in red — it deletes the photo. */
.pv-edit-btns .pv-remove { margin-right: auto; color: var(--error); border-color: rgba(255, 128, 128, 0.45); }

/* Ink / Tools pick lists — no Edit mode, autosave. Header: label, search
   box (where Edit/Close used to be), Close. Each entry is one line; tapping
   it opens a name box, ✓ and a remove button in place. */
.pick-actions { flex: 1; min-width: 0; justify-content: flex-end; }
.pick-search { position: relative; flex: 1; min-width: 0; max-width: 320px; }
.visit-section .pick-search input[type="text"] { padding: 6px 10px; margin: 0; }
.pick-menu {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface-raised);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.pick-menu li { padding: 8px 10px; border-radius: 4px; font-size: 14px; cursor: pointer; }
.pick-menu li:hover,
.pick-menu li.is-active { background: rgba(169, 150, 255, 0.25); }
.pick-menu li.pick-new { color: var(--violet); }

/* Town / State suggestions on the profile's Edit form (js/place-fields.js) —
   same look as .pick-menu. The consent form has its own light version. */
.place-menu {
  position: absolute; z-index: 20; margin: 0; padding: 4px; list-style: none;
  max-height: 240px; overflow-y: auto;
  background: var(--surface-raised); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.place-menu li { padding: 8px 10px; border-radius: 4px; font-size: 14px; color: var(--text); cursor: pointer; white-space: nowrap; }
.place-menu li:hover, .place-menu li.is-active { background: rgba(169, 150, 255, 0.25); }
.place-hint {
  position: absolute; z-index: 20; width: max-content; max-width: 320px; padding: 8px 10px; font-size: 13px; color: var(--text);
  background: var(--surface-raised); border: 1px solid var(--status-warn); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.place-hint-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.place-hint-btns button {
  font-family: var(--font-display); font-size: 13px; padding: 6px 10px; border-radius: 6px; cursor: pointer;
  color: var(--text); background: rgba(169, 150, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.14);
}
.place-hint-btns button:first-child { background: var(--violet); border-color: var(--violet); color: var(--ground); }
.client-facts .fact-edit.place-invalid { border-color: var(--error); }
.pick-items { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.pick-item { padding: 3px 0; cursor: pointer; border-radius: 4px; }
.pick-item:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.pick-item.is-editing { display: flex; align-items: center; gap: 8px; margin: 2px -6px; padding: 4px 6px; background: var(--surface-raised); cursor: default; }
.pick-name { position: relative; flex: 1; min-width: 0; }
.visit-section .pick-name input[type="text"] { padding: 4px 8px; margin: 0; }
.pick-done,
.pick-remove { flex-shrink: 0; font-size: 16px; line-height: 1; padding: 4px 10px; }
.pick-remove { background: var(--oxblood); border-color: var(--oxblood); }
.pick-remove:hover { background: var(--oxblood-hover); border-color: var(--error); }
.pick-remove svg { width: 16px; height: 16px; }
.pick-empty { color: var(--text-muted); font-style: italic; }
/* Notes label on the left, box to its right. */
.pick-note { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; }
.pick-note > span { padding-top: 8px; font-family: var(--font-display); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.pick-note textarea {
  flex: 1;
  min-width: 0;
  min-height: 60px;
  resize: vertical;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--surface-raised);
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}
.pick-note textarea:focus { outline: none; border-color: var(--violet); }
/* "Saving…" / "Saved" under the Notes label while a note autosaves. */
.pick-note .pick-status { display: block; margin-top: 4px; font-family: var(--font-body); font-size: 10px; letter-spacing: 0; text-transform: none; color: var(--status-good); }

/* Visit Notes edit: description box above the notes; Delete Visit only on
   visits added by hand (never on one from a signed consent form). */
.visit-notes-edit { display: none; }
.visit-section.editing .visit-notes-edit { display: block; }
.visit-section.editing .visit-notes-view { display: none; }
.visit-field { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.visit-field > span { width: 84px; flex-shrink: 0; font-size: 12px; color: var(--text-muted); }
.visit-field input[type="text"],
.visit-field input[type="date"] {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color-scheme: dark;
}
.visit-delete { margin-top: 10px; background: var(--oxblood); border-color: var(--oxblood); }
.visit-delete:hover { background: var(--oxblood-hover); border-color: var(--error); }

/* + Add Visit form, at the top of Visit History. */
.add-visit-form { display: none; margin-bottom: 12px; padding: 12px; border: 1px solid rgba(169, 150, 255, 0.35); border-radius: 8px; }
.add-visit-form.open { display: block; }
.add-visit-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Client Info tile — deliberately NOT .card: same background as the page,
   not a boxed panel, per the mockup's design. */
.client-info { padding: 6px 0 24px; }
.client-info-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.client-info-head > div:first-child { flex: 1; min-width: 0; }
.client-info-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.client-facts { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 0; font-size: 13px; }
.client-facts li { display: flex; align-items: center; gap: 6px; }
.client-facts span { color: var(--text-muted); margin-right: 6px; }
.client-facts .fact-view { color: var(--text); }
/* Fixed label width so every row's input starts at the same x position
   instead of drifting with label length ("DOB" vs "Guardian Phone"). */
.client-facts li > span:first-child { width: 110px; flex-shrink: 0; margin-right: 0; }
@media (max-width: 480px) {
  /* Not enough row width on a phone for a long label AND a full-length
     input side by side — while editing, stack label above input so the
     input gets the whole row regardless of label length. View mode stays
     one line per fact (plain text fits fine). */
  .client-facts.editing li { flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: 6px; }
  .client-facts.editing li > span:first-child { width: auto; }
  .client-facts .fact-edit { width: 100%; max-width: none; }
}
.client-facts li.fact-extra { display: none; }
.client-facts.details-open li.fact-extra { display: flex; }
/* Guardian fields: only relevant for a minor client, and only once Show
   Details is open — needs both .details-open (Show Details) and .minor
   (the client's actual form_type on the real page). */
.client-facts li.fact-guardian { display: none; }
.client-facts.details-open.minor li.fact-guardian { display: flex; }
.client-facts .fact-edit {
  display: none;
  flex: 1;
  max-width: 420px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-raised);
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.client-facts.editing .fact-view { display: none; }
.client-facts.editing .fact-edit { display: inline-block; }
.client-facts input[type="date"].fact-edit { color-scheme: dark; font-family: var(--font-body); }
/* Rows that exist in only one mode: First/Last Name and the separate
   Address/City/State/Zip boxes only while editing; the combined Address /
   Guardian lines only while viewing. !important because the guardian rows'
   own show rule (.details-open.minor) is more specific. */
.client-facts:not(.editing) li.fact-editonly { display: none !important; }
.client-facts.editing li.fact-viewonly { display: none !important; }
.client-notes { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: none; }
.client-notes.open { display: block; }
.client-notes-head,
.visit-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.client-notes-head h4,
.visit-section-head h4 { margin: 0; font-family: var(--font-display); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.notes-edit { width: 100%; min-height: 80px; resize: vertical; font-family: var(--font-body); font-size: 14px; color: var(--text); background: var(--surface-raised); padding: 10px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 6px; }
.notes-view { margin: 0; font-size: 13px; }

@media (max-width: 500px) {
  .site-header nav { justify-content: flex-start; }
}

@media (max-width: 480px) {
  .site-header .header-title { font-size: 17px; }
}

/* ---------- login.php ---------- */

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.box {
  width: 100%;
  max-width: 320px;
  text-align: center;
}
.box img {
  width: 100px;
  margin-bottom: 16px;
}
.box h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--violet);
  margin: 0 0 20px;
}
.box input[type="password"] {
  font-size: 22px;
  letter-spacing: 0.3em;
  text-align: center;
}
.box input[type="password"]::placeholder {
  color: var(--text-muted);
  letter-spacing: normal;
}

/* ---------- staff/start.php ---------- */

.wrap {
  max-width: 480px;
  margin: 24px auto;
  padding: 0 16px;
}
.wrap .card {
  margin-bottom: 16px;
}

/* Same centered column as .wrap, just wider — for pages with a data table
   (client directory, supplies, etc.) where 480px feels cramped, especially
   on a tablet where there's width to spare now that there's no sidebar. */
.wrap-wide {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 16px;
}

/* A collapsible <details class="card stats-tile"> — used for the empty
   Statistics placeholder on staff/dashboard.php for now, reusable for any
   future collapsible card. */
/* "> summary" so these don't also hit the state rows' own <summary>s inside. */
.stats-tile { margin-bottom: 16px; }
.stats-tile > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--violet);
}
.stats-tile > summary::-webkit-details-marker { display: none; }
/* Same chevron box as the client profile's .toggle-btn (a span here, since
   the whole summary line is what's tapped). */
.stats-tile > summary:hover .toggle-btn { border-color: var(--violet); color: var(--violet); background: rgba(169, 150, 255, 0.15); }
.stats-tile[open] > summary .toggle-btn svg { transform: rotate(180deg); }
.stats-tile > summary:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}
.stats-tile-body {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---- Statistics tile contents (staff/dashboard.php) ---- */
/* Totals: two boxes side by side, label and number on one line each. */
.stat-totals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.stat-total { display: flex; align-items: center; gap: 8px; background: var(--surface-raised); border-radius: 8px; padding: 3px 14px; }
.stat-total span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-total strong { font-family: var(--font-dash-display); font-size: 14px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }

/* Clients by State / Visits are .expandable-rows (the client profile's
   Visit History look); the tile body's muted text color shouldn't reach
   their titles. */
.stats-tile .expandable-summary h3 { color: var(--text); font-size: 16px; }
.stats-tile .expandable-row:last-child { margin-bottom: 0; }
/* Week/Month/Year on the left, Graph/Table on the right, inside Visits. */
.stat-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

/* Clients by State: one row per state, tap to show its towns. */
.state-list { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.state-row { border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.state-row summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 2px 4px; font-size: 14px; color: var(--text); }
.state-row summary::-webkit-details-marker { display: none; }
.state-row summary::before { content: "▸"; display: inline-block; width: 14px; font-size: 20px; line-height: 1; color: var(--text-muted); transition: transform 0.15s ease; }
.state-row[open] summary::before { transform: rotate(90deg); }
.state-row summary:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.stat-name { flex: 1; }
.stat-count { font-variant-numeric: tabular-nums; color: var(--text); min-width: 2.5em; text-align: right; }
.town-list { list-style: none; margin: 0 0 6px; padding: 0 4px 0 26px; font-size: 13.5px; }
.town-list li { display: flex; justify-content: space-between; padding: 0px 0px 0px 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.town-list .stat-count { color: var(--text-muted); }
/* Each town is a link to the client list filtered to that town. */
.town-list li a { flex: 1; display: flex; justify-content: space-between; color: inherit; text-decoration: none; }
.town-list li a:hover, .town-list li a:hover .stat-count { color: var(--violet); }
.town-list li a:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }

/* "Showing clients from: X  ✕" above the client list while a town filter is on. */
.filter-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 420px; margin-bottom: 10px; padding: 6px 6px 6px 12px; border: 1px solid rgba(169, 150, 255, 0.4); border-radius: 6px; background: rgba(169, 150, 255, 0.08); font-size: 14px; color: var(--text-muted); }
.filter-banner strong { color: var(--text); font-weight: 500; }
.search-bar + .filter-banner { margin-top: -8px; }

/* Paging line at the top of the client list card (staff/dashboard.php):
   "Items per page 10 25 50 All … Showing 26–50 of 152 ‹ ›". Page sizes
   are plain text links with a ~32px-tall tap area; the current one is
   violet, bold and underlined. On a phone, "Items" and "Showing" drop. */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.2); font-size: 13px; color: var(--text-muted); }
.pager-group { display: flex; align-items: center; gap: 2px; }
.pager-label { margin-right: 2px; white-space: nowrap; }
.pager .short { display: none; }
.pager-size { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 32px; padding: 0 4px; color: var(--text); text-decoration: none; border-radius: 4px; }
.pager-size:hover { color: var(--violet); }
.pager-size:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.pager-size.is-active { color: var(--violet); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.pager-count { white-space: nowrap; margin-right: 4px; }
.pager .nav-btn { min-width: 30px; min-height: 30px; padding: 2px 6px; font-size: 12px; }
.pager .nav-btn[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }
@media (max-width: 520px) {
  .pager .long { display: none; }
  .pager .short { display: inline; }
}
.filter-banner .nav-btn { min-width: 32px; min-height: 32px; flex-shrink: 0; }

/* Week / Month / Year and Graph / Table switches. */
.seg { display: inline-flex; gap: 4px; }
/* Graph/Table ends where the Visits chevron button above it begins:
   summary padding 10px + button 34px − body padding 14px = 30px. */
#viewSeg { margin-right: 30px; }
.seg .nav-btn { min-height: 36px; padding: 5px 12px; }
.seg .nav-btn.is-active { background: var(--violet); border-color: var(--violet); color: var(--ground); }
/* Phone: tighter buttons so all five fit on one line. */
@media (max-width: 520px) {
  .seg { gap: 3px; }
  .seg .nav-btn { min-height: 32px; padding: 3px 7px; font-size: 12px; }
}

/* Visits bar chart: plain HTML bars, one per period, height = share of the
   tallest. Each bar's number sits just above it (padding-top leaves room
   for the tallest one's). */
.bar-chart { position: relative; }
.bar-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.25); }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; }
.bar-col:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }
.bar { position: relative; width: 100%; max-width: 44px; background: var(--violet); border-radius: 4px 4px 0 0; }
.bar-val { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 2px; font-size: 11px; color: var(--text); font-variant-numeric: tabular-nums; }
.bar-col:hover .bar, .bar-col.is-active .bar { background: #c5b8ff; }
/* The bar the client list is filtered to: lighter fill + an outline. */
.bar-col.is-selected .bar { background: #c5b8ff; box-shadow: 0 0 0 2px var(--text); }
.bar-col[data-href] { cursor: pointer; }
.bar-labels { display: flex; gap: 2px; margin-top: 4px; }
.bar-labels span { flex: 1; text-align: center; font-size: 11px; white-space: nowrap; overflow: hidden; }
@media (max-width: 520px) {
  .bar-labels.dense span:nth-child(even) { visibility: hidden; }
}
.bar-tip { position: absolute; z-index: 2; transform: translate(-50%, -100%); margin-top: -6px; padding: 4px 8px; border-radius: 6px; background: var(--ground); border: 1px solid rgba(255, 255, 255, 0.2); color: var(--text); font-size: 12px; white-space: nowrap; pointer-events: none; }
.visit-table td:last-child, .visit-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
/* Rows look like the town rows in Clients by State (.town-list li). */
table.dash-table.visit-table td { padding: 0 0 0 10px; border-bottom: none; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 13.5px; color: var(--text-muted); }
table.dash-table.visit-table td:last-child { padding: 0 4px 0 10px; }
table.dash-table.visit-table tbody tr:hover td { background: none; }
/* Rows with visits filter the client list when tapped, like the bars. */
table.dash-table.visit-table tr.visit-link { cursor: pointer; }
table.dash-table.visit-table tr.visit-link:hover td { color: var(--violet); }
table.dash-table.visit-table tr.visit-link.is-selected td { color: var(--text); font-weight: 600; }
table.dash-table.visit-table tr.visit-link:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.filter-banner small { font-size: 12px; }

/* ---- Contact Log rows (staff/client-profile.php) ---- */
.contact-date { vertical-align: top; text-align: left; padding: 6px 16px 6px 0; white-space: nowrap; color: var(--text-muted); font-size: 13px; }
.contact-text { vertical-align: top; text-align: left; padding: 6px 0; font-size: 14px; white-space: pre-line; width: 100%; }
.contact-del { vertical-align: top; padding: 4px 0 4px 10px; }
.contact-delete { min-height: 34px; }

.modebtns {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.modebtns button {
  flex: 1;
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  font-size: 16px;
  padding: 14px 10px;
  border: 1px solid var(--oxblood);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
}
.modebtns button:hover:not(.active):not(:disabled) {
  /*border-color: var(--violet);*/
  background: rgba(110, 47, 50, 0.5);
}
.modebtns button.active {
  background: var(--oxblood);
  border-color: var(--oxblood);
  color: #f4ece9;
}
.modebtns button.active:hover {
  background: #7f363a;
  border-color: #7f363a;
}
.modebtns button:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}
.modebtns button:disabled {
  opacity: 0.6;
  cursor: default;
}

#returningPanel {
  display: none;
  margin-top: 16px;
}
#results {
  margin-top: 10px;
}
.result {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface-raised);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
}
.result:hover {
  border-color: var(--violet);
}
.result:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}
.result .name {
  font-weight: 600;
}
.result .meta {
  color: var(--text-muted);
  font-size: 12px;
}

.no-results {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--surface-raised);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--violet);
}

/* ---------- dashboard (staff/dashboard.php and beyond) ----------
   Promoted from dashboard-mockup.html, same class names. Touch targets
   (.side-nav-list a, .btn, .btn-sm) are bumped to a ~48px min-height —
   the mockup's own values ran a little under Apple/Android's touch-target
   guidelines, and the dashboard's primary device is Chris's Android tablet.
   Calendar/Payments/Analytics/Settings-only rules from the mockup
   (.schedule-list, .bar-chart, .settings-grid, .field-row, .email-chip)
   are intentionally not promoted — those features weren't picked. */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 236px;
  background: var(--surface);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 20px; }
.sidebar-brand img { height: 40px; width: auto; }
.sidebar-brand .name { font-family: var(--font-dash-display); font-weight: 600; font-size: 15px; letter-spacing: 0.08em; line-height: 1.2; }
.sidebar-brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
  margin-top: 2px;
}

.side-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav-list a {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 9px 10px;
  min-height: 48px;
  border-radius: 7px;
}
.side-nav-list a svg { width: 17px; height: 17px; flex-shrink: 0; }
.side-nav-list a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.side-nav-list a.active { background: rgba(169, 150, 255, 0.14); color: var(--violet); }
.side-nav-list a:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

.sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 14px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--oxblood);
  color: #f4ece9;
  font-family: var(--font-dash-display);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-foot .who { min-width: 0; }
.sidebar-foot .who strong { display: block; font-size: 13px; font-weight: 500; }
.sidebar-foot .who a { font-size: 12px; color: var(--text-muted); text-decoration: underline; }
.sidebar-foot .who a:hover { color: var(--violet); }

@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 12px;
  }
  .sidebar-brand { padding: 0 14px 0 0; flex-shrink: 0; }
  .side-nav-list { flex-direction: row; flex: none; }
  .side-nav-list a { white-space: nowrap; }
  .sidebar-foot { display: none; }
  .main { margin-left: 0 !important; }
}

.main { margin-left: 236px; padding: 36px 40px 100px; max-width: 1240px; }

.dash-section { margin-bottom: 48px; }
.dash-section-head { margin-bottom: 22px; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; }
.dash-eyebrow { font-family: var(--font-dash-display); font-weight: 600; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--violet); margin: 0 0 6px; }
.dash-title { font-family: var(--font-dash-display); font-weight: 600; font-size: 28px; letter-spacing: 0.08em; margin: 0 0 6px; }
.dash-sub { color: var(--text-muted); font-size: 14px; max-width: 62ch; margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-dash-display);
  letter-spacing: 0.08em;
  font-size: 14.5px;
  padding: 10px 18px;
  /* min-height: 48px; */
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--oxblood); color: #f4ece9; }
.btn-primary:hover { background: var(--oxblood-hover); }
.btn-outline { background: transparent; color: var(--text); border-color: rgba(255, 255, 255, 0.16); }
.btn-outline:hover { border-color: var(--violet); color: var(--violet); }
.btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.btn-sm { font-size: 13px; padding: 5px 10px; /* min-height: 44px; */ }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip-neutral { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.chip-violet { background: rgba(169, 150, 255, 0.16); color: var(--violet); }
.chip-oxblood { background: rgba(110, 47, 50, 0.4); color: #f0b9bc; }
.chip-good { background: rgba(124, 196, 143, 0.16); color: var(--status-good); }
.chip-warn { background: rgba(232, 183, 103, 0.16); color: var(--status-warn); }
/* "Minor" badge after a client's name in the Client Directory (under 18 today). */
.chip-minor { margin-left: 8px; font-size: 10.5px; padding: 2px 8px; vertical-align: 1px; }

.table-wrap { overflow-x: auto; }
table.dash-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.dash-table th {
  text-align: left;
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  padding: 10px 14px 10px 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
/* Phone-sized screens: smaller headings so the table fits without scrolling sideways. */
@media (max-width: 480px) {
  table.dash-table th { font-size: 12px; padding-right: 5px; }
}
/* Sortable column headings (Client Directory). */
table.dash-table th a.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
table.dash-table th a.sort-link:hover,
table.dash-table th a.sort-link.is-active { color: var(--violet); }
table.dash-table td { padding: 5px 5px 5px 5px; border-bottom: 1px solid rgba(255, 255, 255, 0.2); vertical-align: middle; }
/* Client Directory columns: Visits shrinks to its content (up to 3 digits),
   Phone and Last Visit never wrap, so the Name column takes what's left. */
table.dash-table .col-visits { width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: center; }
table.dash-table .col-nowrap { white-space: nowrap; }
table.dash-table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
table.dash-table td.muted { color: var(--text-muted); }
table.dash-table a.row-link { color: var(--text); text-decoration: none; font-weight: 500; }
table.dash-table a.row-link:hover { color: var(--violet); }

.search-bar { display: flex; gap: 10px; margin-bottom: 18px; max-width: 420px; }
.search-bar input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--surface-raised);
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}
.search-bar input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(169, 150, 255, 0.25); }

.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); cursor: pointer; padding: 10px 0; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track {
  width: 34px;
  height: 19px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.toggle .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--text);
  transition: left 0.15s ease;
}
.toggle input:checked + .track { background: var(--violet); }
.toggle input:checked + .track::after { left: 17px; background: var(--ground); }
.toggle input:focus-visible + .track { outline: 2px solid var(--violet); outline-offset: 2px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat-tile { background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 10px; padding: 18px 20px; }
.stat-tile .label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 8px; }
.stat-tile .value { font-family: var(--font-dash-display); font-weight: 600; font-size: 34px; line-height: 1; margin: 0 0 6px; }
.stat-tile .delta { font-size: 12.5px; color: var(--status-good); }
.stat-tile .delta.flat { color: var(--text-muted); }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }
.card h3, .expandable-summary h3 { font-family: var(--font-dash-display); font-weight: 400; font-size: 19px; letter-spacing: 0.08em; margin: 0; }

.activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.activity-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-bottom: 12px; }
.activity-list li:last-child { border-bottom: none; padding-bottom: 0; }
.activity-list .who { font-weight: 500; }
.activity-list .meta { color: var(--text-muted); font-size: 12px; }

.profile-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; /* margin-bottom: 24px; */ }
.profile-facts { list-style: none; margin: 0px; padding: 0; /* display: grid; */ grid-template-columns: repeat(2, auto); gap: 6px 32px; font-size: 13.5px; }
.profile-facts span { color: var(--text-muted); margin-right: 6px; }
.profile-stats { display: flex; gap: 24px; }
.profile-stats div { text-align: right; }
.profile-stats .value { font-family: var(--font-dash-display); font-weight: 600; font-size: 26px; }
.profile-stats .label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }

details.visit-card {
  background: #2f2f31;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  margin-top: 10px;
  margin-left: 12px;
  overflow: hidden;
}
details.visit-card summary {
  list-style: none;
  cursor: pointer;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
details.visit-card summary::-webkit-details-marker { display: none; }
details.visit-card summary:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.visit-summary-main { display: flex; align-items: center; gap: 14px; min-width: 0; flex-wrap: wrap; }
.visit-date { font-family: var(--font-dash-display); font-size: 13px; letter-spacing: 0.08em; color: var(--text); white-space: nowrap; }
.visit-desc { color: var(--text-muted); font-size: 13.5px; }
.visit-chevron { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-muted); transition: transform 0.15s ease; }
details[open] .visit-chevron { transform: rotate(180deg); }

.visit-body { padding: 4px 20px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 780px) { .visit-body { grid-template-columns: 1fr; } }
.visit-field h4 {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 6px;
  font-weight: 500;
}
.visit-field p { margin: 0; font-size: 14px; }
.visit-photos { display: flex; gap: 8px; flex-wrap: wrap; }
.visit-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.1); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.photo-card { background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 10px; overflow: hidden; }
.photo-card .thumb { aspect-ratio: 1 / 1; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.photo-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-card .meta { padding: 10px 12px; }
.photo-card .meta .client { font-size: 13px; font-weight: 500; margin: 0 0 6px; }
