/**
 * 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; }
.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; }
.visit-section .notes-view.is-empty { color: var(--text-muted); font-style: italic; }
.visit-section .notes-edit { display: none; }
.visit-section.editing .notes-edit { display: block; }
.visit-section.editing .notes-view { display: none; }

/* Photos 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 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-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. */
.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; }
.stats-tile summary::after {
  content: "▾";
  transition: transform 0.15s ease;
  color: var(--text-muted);
}
.stats-tile[open] summary::after { 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;
}

.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); }

.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: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0 14px 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
table.dash-table td { padding: 15px 14px 15px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
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; }
