/* ============================================================
   PARCHMENT — YSPI Governance theme (ported from the design handoff)
   Warm mission-led: cream surfaces, sage accent, terracotta/ochre
   reserved for status only. Self-hosted Public Sans + JetBrains Mono.

   The accent family (--accent*) defaults to sage but is overridable
   per-request from admin Settings (inc/header.php injects :root vars).
   Surfaces and status colours are fixed for cohesion/accessibility.
   ============================================================ */

@font-face { font-family:'Public Sans'; font-style:normal; font-weight:100 900; font-display:swap; src:url(/assets/fonts/public-sans.woff2) format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:100 800; font-display:swap; src:url(/assets/fonts/jetbrains-mono.woff2) format('woff2'); }

:root {
  --parch-bg:        oklch(0.972 0.012 82);
  --parch-surface:   oklch(0.992 0.006 85);
  --parch-surface-2: oklch(0.955 0.014 80);
  --parch-sunken:    oklch(0.935 0.016 78);
  --parch-line:      oklch(0.895 0.014 80);
  --parch-line-soft: oklch(0.925 0.012 80);
  --parch-ink:       oklch(0.235 0.018 55);
  --parch-ink-2:     oklch(0.405 0.018 60);
  --parch-ink-mute:  oklch(0.555 0.014 65);

  /* Accent (default sage) — overridable from Settings */
  --accent:        oklch(0.445 0.062 152);
  --accent-deep:   oklch(0.355 0.058 152);
  --accent-tint:   oklch(0.935 0.028 152);
  --accent-tint-2: oklch(0.895 0.040 152);
  --accent-line:   oklch(0.815 0.045 152);
  --on-accent:     oklch(0.99 0.005 85);

  /* Reserved status — fixed */
  --terra:      oklch(0.560 0.130 42);
  --terra-tint: oklch(0.935 0.038 42);
  --terra-line: oklch(0.830 0.070 42);
  --ochre:      oklch(0.660 0.110 78);
  --ochre-deep: oklch(0.45 0.10 75);
  --ochre-tint: oklch(0.945 0.040 78);
  --green:      oklch(0.520 0.090 150);
  --green-tint: oklch(0.940 0.030 150);

  --shadow-xs: 0 1px 0 oklch(0.20 0.02 60 / 0.04);
  --shadow-sm: 0 1px 2px oklch(0.20 0.02 60 / 0.05), 0 1px 0 oklch(0.20 0.02 60 / 0.03);
  --shadow-md: 0 6px 18px -8px oklch(0.20 0.02 60 / 0.18), 0 2px 4px oklch(0.20 0.02 60 / 0.05);
  --shadow-lg: 0 22px 40px -22px oklch(0.20 0.02 60 / 0.28), 0 4px 10px oklch(0.20 0.02 60 / 0.06);

  --r-xs: 4px; --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;

  --font-sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Base ---------- */
body {
  background: var(--parch-bg);
  color: var(--parch-ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,h2,h3,h4,h5 { font-weight: 600; letter-spacing: -0.012em; color: var(--parch-ink); }
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-muted-2 { color: var(--parch-ink-mute) !important; }
.page-title { font-weight: 600; letter-spacing: -0.012em; }
.font-monospace, .mono { font-family: var(--font-mono) !important; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--parch-ink-mute); }

/* ---------- Bootstrap component retokenisation ---------- */
.card {
  background: var(--parch-surface);
  border: 1px solid var(--parch-line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.card .card-body { padding: 1.25rem 1.4rem; }

/* Scope note: a quiet, sunken aside (auditor-facing scope statement, CLAUDE.md §12). */
.scope-card {
  background: var(--parch-sunken);
  border-style: dashed;
  box-shadow: none;
}

.btn { font-family: var(--font-sans); font-weight: 500; border-radius: var(--r-sm); }
.btn-primary {
  --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent-deep);
  --bs-btn-color: var(--on-accent);
  --bs-btn-hover-bg: var(--accent-deep); --bs-btn-hover-border-color: var(--accent-deep); --bs-btn-hover-color: var(--on-accent);
  --bs-btn-active-bg: var(--accent-deep); --bs-btn-active-border-color: var(--accent-deep); --bs-btn-active-color: var(--on-accent);
  --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent); --bs-btn-disabled-color: var(--on-accent);
}
.btn-outline-primary {
  --bs-btn-color: var(--accent-deep); --bs-btn-border-color: var(--accent-line);
  --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent); --bs-btn-hover-color: var(--on-accent);
  --bs-btn-active-bg: var(--accent-deep); --bs-btn-active-border-color: var(--accent-deep); --bs-btn-active-color: var(--on-accent);
}
.btn-outline-secondary {
  --bs-btn-color: var(--parch-ink-2); --bs-btn-border-color: var(--parch-line);
  --bs-btn-hover-bg: var(--parch-surface-2); --bs-btn-hover-border-color: var(--parch-line); --bs-btn-hover-color: var(--parch-ink);
}
.btn-danger, .btn-outline-danger { --bs-btn-color: var(--terra); }
.btn-outline-danger { --bs-btn-border-color: var(--terra-line); --bs-btn-hover-bg: var(--terra); --bs-btn-hover-border-color: var(--terra); --bs-btn-hover-color: #fff; }
.btn-link { --bs-btn-color: var(--accent-deep); }

.text-primary { color: var(--accent-deep) !important; }
.bg-primary { background-color: var(--accent) !important; }

.form-control, .form-select { border-color: var(--parch-line); border-radius: var(--r-sm); background: var(--parch-surface); color: var(--parch-ink); }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.form-control::placeholder { color: var(--parch-ink-mute); }
.form-check-input { border: 1.5px solid oklch(0.78 0.016 78); background-color: var(--parch-surface); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.input-group-text { background: var(--parch-surface-2); border-color: var(--parch-line); color: var(--parch-ink-2); }
.input-group-text i { color: var(--parch-ink-mute); }
/* Leading-icon inputs warm up on focus (the icon picks up the accent). */
.input-group:focus-within .input-group-text { border-color: var(--accent); }
.input-group:focus-within .input-group-text i { color: var(--accent-deep); }

/* Validation states (Parchment terra/green) — for server-side field errors. */
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--terra); }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { box-shadow: 0 0 0 3px var(--terra-tint); }
.form-control.is-valid, .form-select.is-valid { border-color: var(--green); }
.invalid-feedback { color: var(--terra); font-size: 12px; }
.valid-feedback { color: var(--green); font-size: 12px; }

.table { color: var(--parch-ink); --bs-table-bg: transparent; }
.table thead th {
  text-transform: uppercase; font-weight: 500; font-size: 12px; letter-spacing: 0.04em;
  color: var(--parch-ink-mute); background: var(--parch-sunken); border-bottom: 1px solid var(--parch-line);
}
.table > tbody > tr > td { border-color: var(--parch-line-soft); }
.table-hover > tbody > tr:hover > * { background: var(--parch-surface-2); }

/* Badges — accent + reserved status */
.badge { font-weight: 600; border-radius: 999px; }
.text-bg-primary   { background-color: var(--accent-tint) !important; color: var(--accent-deep) !important; }
.text-bg-secondary { background-color: var(--parch-sunken) !important; color: var(--parch-ink-2) !important; }
.text-bg-success   { background-color: var(--green-tint) !important; color: var(--green) !important; }
.text-bg-warning   { background-color: var(--ochre-tint) !important; color: var(--ochre-deep) !important; }
.text-bg-danger    { background-color: var(--terra-tint) !important; color: var(--terra) !important; }
.text-bg-light     { background-color: var(--parch-surface-2) !important; color: var(--parch-ink-2) !important; }
.text-bg-dark      { background-color: var(--parch-ink) !important; color: var(--parch-bg) !important; }
.text-bg-info      { background-color: var(--accent-tint) !important; color: var(--accent-deep) !important; }

.alert { border-radius: var(--r-md); border: 1px solid transparent; }
.alert-success, .alert-info { background: var(--accent-tint); color: var(--accent-deep); border-color: var(--accent-line); }
.alert-warning { background: var(--ochre-tint); color: var(--ochre-deep); border-color: oklch(0.86 0.07 78); }
.alert-danger { background: var(--terra-tint); color: var(--terra); border-color: var(--terra-line); }

.progress { background: var(--parch-sunken); }
.progress-bar { background-color: var(--accent); }
.progress-bar.bg-success { background-color: var(--green) !important; }

.dropdown-menu { border-color: var(--parch-line); border-radius: var(--r-md); box-shadow: var(--shadow-md); }
.list-group-item { background: transparent; border-color: var(--parch-line-soft); }
.toast { background: var(--parch-surface); border: 1px solid var(--parch-line); box-shadow: var(--shadow-lg); border-radius: var(--r-md); }
.bg-body-secondary { background-color: var(--parch-surface-2) !important; }
.bg-warning-subtle { background-color: var(--ochre-tint) !important; }
.border-warning { border-color: var(--ochre) !important; }

/* ---------- App shell (flex + Bootstrap responsive offcanvas sidebar) ---------- */
.app-sidebar { --bs-offcanvas-width: 264px; --bs-offcanvas-bg: var(--parch-surface); }
.app-sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 0; }
.app-sidebar .brand { height: 60px; padding: 0 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--parch-line); }
.app-sidebar .brand-name { font-weight: 600; font-size: 15px; letter-spacing: -0.005em; }
.app-sidebar .brand img { max-height: 30px; width: auto; }
.app-sidebar .org { margin: 12px 12px 4px; padding: 10px 12px; background: var(--parch-surface-2); border: 1px solid var(--parch-line); border-radius: var(--r-sm); }
.app-nav { flex: 1 1 auto; overflow-y: auto; padding: 6px 12px 16px; width: 100%; }
.app-nav .sect { margin-top: 14px; }
.app-nav .sect:first-child { margin-top: 8px; }
.app-nav .eyebrow { padding: 0 10px; margin-bottom: 6px; font-size: 10px; }
.app-nav a {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px;
  border-radius: var(--r-sm); color: var(--parch-ink-2); font-size: 13.5px; font-weight: 500;
  text-decoration: none; transition: background .1s ease, color .1s ease;
}
.app-nav a:hover { background: var(--parch-surface-2); color: var(--parch-ink); }
.app-nav a.active { background: var(--accent-tint); color: var(--accent-deep); font-weight: 600; }
.app-nav a .count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--parch-sunken); color: var(--parch-ink-2); }
.app-nav a.active .count { background: var(--accent); color: var(--on-accent); }

.app-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.app-topbar {
  height: 60px; border-bottom: 1px solid var(--parch-line); background: var(--parch-bg);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px;
  position: sticky; top: 0; z-index: 5;
}
.app-content { flex: 1; padding: 24px; }
.app-content-inner { margin: 0 auto; }
.app-footer { padding: 16px 24px 28px; color: var(--parch-ink-mute); font-size: 13px; }

.profile-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; background: var(--parch-surface); border: 1px solid var(--parch-line); border-radius: 999px; cursor: pointer; }
.pavatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 999px; background: var(--accent-tint-2); color: var(--accent-deep); font-weight: 600; font-size: 12px; border: 1px solid var(--accent-line); }


/* ---------- Auth split layout ---------- */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-brand-panel {
  background: linear-gradient(150deg, var(--accent-deep), var(--accent));
  color: var(--on-accent); padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-brand-panel::after {
  content: ""; position: absolute; right: -10%; top: -10%; width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%); pointer-events: none;
}
.auth-brand-panel .logo-badge { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.auth-brand-panel img { max-height: 64px; width: auto; background: #fff; border-radius: 12px; padding: 8px 12px; }
.auth-brand-panel .pillars { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.auth-brand-panel .pillars li { display: flex; gap: .75rem; align-items: flex-start; }
.auth-brand-panel .pillars .num { font-family: var(--font-mono); opacity: .7; font-size: .8rem; }
.auth-form-panel { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--parch-bg); }
.auth-form-panel .inner { width: 100%; max-width: 380px; }
.pin-input { letter-spacing: .5em; font-size: 1.4rem; text-align: center; }

/* ---------- Responsive ---------- */
/* lg+ : the offcanvas-lg sidebar is static; give it a fixed width, full-height
   sticky column and the Parchment surface (Bootstrap forces transparent at lg). */
@media (min-width: 992px) {
  .app-sidebar { width: 248px; height: 100vh; position: sticky; top: 0; background: var(--parch-surface) !important; border-right: 1px solid var(--parch-line); }
  .app-sidebar .offcanvas-body { overflow: hidden; height: 100%; }
}
@media (max-width: 991.98px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
}

/* ============================================================
   PARCHMENT COMPONENT LAYER (ported from the design handoff)
   The design's bespoke component vocabulary, mapped to the
   admin-overridable --accent family. Use these (.p* + the
   inc/ui.php helpers) on every page, list and form so the look
   stays consistent — including pages built in future.
   ============================================================ */

/* Subtle warm atmosphere behind the whole app (design body::before). */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60vmax 50vmax at 90% -10%, oklch(0.88 0.04 78 / 0.16), transparent 60%),
    radial-gradient(50vmax 50vmax at -10% 110%, var(--accent-tint) 0%, transparent 60%);
  opacity: .6;
}
.d-flex, .auth-split { position: relative; z-index: 1; }

/* Page-entry animation */
@keyframes parch-pop { from { opacity: 0; transform: translateY(6px) scale(0.99); } to { opacity: 1; transform: none; } }
.view-enter { animation: parch-pop 220ms cubic-bezier(.2,.8,.2,1); }

/* ---------- Page header (eyebrow + title + sub + actions) ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .ph-text { min-width: 0; }
.page-head .ph-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .ph-title-row h1 { margin: 0; }

/* Diary day cells are links into the day view */
a.diary-day { text-decoration: none; color: inherit; display: block; transition: border-color .12s ease, box-shadow .12s ease; }
a.diary-day:hover { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent) inset; }

/* Admin "view as trustee" preview bar + read-only enforcement */
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--ochre-deep); color: #fff; padding: 8px 16px; font-size: 13px; position: sticky; top: 0; z-index: 1031; }
.preview-bar .preview-exit-btn { background: #fff; color: var(--ochre-deep); border: none; font-weight: 600; white-space: nowrap; }
.preview-bar .preview-exit-btn:hover { background: #fff; color: var(--ochre-deep); opacity: .9; }
/* Disable action (POST) form controls in the page body; keep the topbar (logout, notifications) live. */
body.is-preview .app-main form[method="post" i] :is(button, [type=submit], input:not([type=hidden]), select, textarea) { pointer-events: none !important; opacity: .5 !important; cursor: not-allowed !important; }
body.is-preview .app-topbar :is(button, [type=submit], input, select, textarea, a) { pointer-events: auto !important; opacity: 1 !important; cursor: auto !important; }

/* Diary toolbar (view toggle + period nav) — responsive so it never overflows mobile */
.diary-period { min-width: 160px; text-align: center; }
@media (max-width: 575.98px) {
    .page-head .ph-actions { width: 100%; }
    .diary-toggle, .diary-nav { width: 100%; display: flex; }
    .diary-toggle .btn { flex: 1 1 0; padding-left: 0; padding-right: 0; }
    .diary-nav .diary-period { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.page-head h1 { font-size: 27px; letter-spacing: -0.022em; line-height: 1.2; color: var(--accent-deep); }
.page-head .ph-sub { margin-top: 6px; font-size: 14px; line-height: 1.55; max-width: 680px; color: var(--parch-ink-2); }
.page-head .ph-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ---------- Stat chips (mini stats atop a module) ---------- */
.stat-chips { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-chip { flex: 1; min-width: 150px; padding: 12px 14px; background: var(--parch-surface); border: 1px solid var(--parch-line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
/* sc-label / sc-value are global so they style consistently inside stat-chips
   AND standalone in card columns (e.g. the monitoring overview, month summary). */
.sc-label { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--parch-ink-mute); margin-bottom: 6px; }
.sc-value { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; color: var(--parch-ink); font-variant-numeric: tabular-nums; }
.sc-value.accent { color: var(--accent-deep); }
.sc-value.up     { color: var(--ochre-deep); }
.sc-value.down   { color: var(--green); }
.stat-chip.sage  .sc-value { color: var(--accent-deep); }
.stat-chip.terra .sc-value { color: var(--terra); }
.stat-chip.ochre .sc-value { color: var(--ochre-deep); }
/* Hero metric (e.g. the Administrative Overhead headline) — Public Sans with
   tabular numerals; mono is reserved for IDs/hashes/timestamps (§9). */
.metric-hero { font-size: 2.4rem; line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
/* Tabular (aligned) numerals for figures — keeps currency columns lined up
   without resorting to the monospace font. */
.tnum { font-variant-numeric: tabular-nums; }
/* Legend dot for category breakdowns. */
.legend-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .5rem; vertical-align: middle; }

/* ---------- Parchment card (header / body / foot) ---------- */
.pcard { background: var(--parch-surface); border: 1px solid var(--parch-line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.pcard-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--accent-deep); }
.pcard-head h2, .pcard-head h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; margin: 0; color: var(--accent-deep); }
.pcard-body { padding: 18px; }
.pcard-foot { padding: 12px 18px; border-top: 1px solid var(--parch-line-soft); background: var(--parch-surface-2); border-radius: 0 0 var(--r-md) var(--r-md); font-size: 13px; color: var(--parch-ink-2); }

/* ---------- Parchment table (rich rows) ---------- */
.ptable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.ptable thead th { text-align: left; font-weight: 500; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--parch-ink-mute); padding: 10px 14px; background: var(--parch-sunken); border-bottom: 1px solid var(--parch-line); }
.ptable tbody td { padding: 12px 14px; border-bottom: 1px solid var(--parch-line-soft); vertical-align: middle; }
.ptable tbody tr:last-child td { border-bottom: none; }
.ptable tbody tr.is-clickable { cursor: pointer; }
.ptable tbody tr:hover td { background: var(--parch-surface-2); }
.ptable tfoot td { padding: 12px 14px; vertical-align: middle; }
.ptable .row-primary { font-size: 13.5px; font-weight: 600; line-height: 1.2; color: var(--parch-ink); }
.ptable .row-secondary { font-size: 11.5px; color: var(--parch-ink-mute); }
.ptable .cell-person { display: flex; align-items: center; gap: 10px; }

/* ---------- Parchment badge (status pill with dot) ---------- */
.pbadge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; letter-spacing: 0.005em; border: 1px solid transparent; background: var(--parch-surface-2); color: var(--parch-ink-2); white-space: nowrap; }
.pbadge .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex-shrink: 0; }
.pbadge.sage  { background: var(--accent-tint); color: var(--accent-deep); border-color: var(--accent-line); }
.pbadge.terra { background: var(--terra-tint); color: var(--terra); border-color: var(--terra-line); }
.pbadge.ochre { background: var(--ochre-tint); color: var(--ochre-deep); }
.pbadge.green { background: var(--green-tint); color: var(--green); }
.pbadge.ink   { background: var(--parch-ink); color: var(--parch-bg); }

/* ---------- Parchment form field ---------- */
.pfield { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.pfield-label { font-size: 13px; font-weight: 500; color: var(--parch-ink); letter-spacing: -0.003em; }
.pfield-label .req { color: var(--terra); margin-left: 2px; }
.pfield-hint { font-size: 12px; color: var(--parch-ink-mute); }

/* Bordered checkbox / radio option — a selectable panel that pops from the page.
   Highlights with the accent when its input is checked (:has, modern browsers). */
.pcheck { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; background: var(--parch-surface); border: 1px solid var(--parch-line); border-radius: var(--r-sm); cursor: pointer; transition: background 120ms ease, border-color 120ms ease; margin-bottom: 8px; }
.pcheck:hover { background: var(--parch-surface-2); }
.pcheck:has(.form-check-input:checked) { border-color: var(--accent-line); background: var(--accent-tint); }
.pcheck .form-check-input { margin-top: 2px; flex-shrink: 0; }
.pcheck .pcheck-text { line-height: 1.35; }
.pcheck .pcheck-title { font-size: 14px; font-weight: 500; color: var(--parch-ink); }
.pcheck .pcheck-hint { font-size: 12px; color: var(--parch-ink-mute); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--parch-ink-mute); }
.empty-state .es-icon { font-size: 1.9rem; display: block; margin-bottom: 12px; color: var(--accent); opacity: .8; }
.empty-state .es-title { font-weight: 600; color: var(--parch-ink-2); margin-bottom: 4px; }

/* ---------- Key/value detail rows ---------- */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--parch-line-soft); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv .kv-key { color: var(--parch-ink-mute); }
.kv .kv-val { color: var(--parch-ink); font-weight: 500; }
.kv .kv-val.mono { font-family: var(--font-mono); font-weight: 400; }

/* Icon-in-button consistent gap (the design's pbtn gap) */
.btn i.fa-light, .btn i.fa-regular, .btn i.fa-solid { margin-right: .4em; }
.btn.btn-icon-only i { margin-right: 0; }

/* ---------- Activity feed (audit-log timeline) ---------- */
.activity-feed { display: flex; flex-direction: column; }
.af-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--parch-line-soft); }
.af-item:last-child { border-bottom: none; }
.af-icon { flex-shrink: 0; width: 30px; height: 30px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-tint); color: var(--accent-deep); border: 1px solid var(--accent-line); font-size: 13px; }
.af-icon i { margin: 0; }
.af-body { min-width: 0; flex: 1; }
.af-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.af-action { font-size: 13.5px; font-weight: 600; color: var(--parch-ink); }
.af-actor { font-size: 12px; color: var(--parch-ink-mute); }
.af-detail { font-size: 12.5px; color: var(--parch-ink-2); margin-top: 2px; word-break: break-word; }
.af-when { font-size: 11px; color: var(--parch-ink-mute); margin-top: 3px; }

/* Quick-preset date buttons */
.date-presets { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
