/* Owner admin. The fixed platform shell follows demos/showcase/styles/workspace.css (copied, since
   demos do not import each other) on top of packages/ui/web/platform.css tokens. Tenant previews use
   components.css under a business theme. */

:root {
  --p-ok: #1b4332;
  --p-warn: #8b6422;
  --p-danger: #7a2e2e;
  --p-info: #0b2545;
}

/* ---------- shell ---------- */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { min-height: 100vh; position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; padding: 28px 20px 20px; border-right: 1px solid var(--p-border); background: var(--p-surface); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 19px; font-weight: 600; letter-spacing: -.045em; line-height: 1; color: var(--p-navy); }
.brand small { display: block; margin-top: 4px; color: var(--p-muted); font-size: 10px; font-weight: 500; letter-spacing: .01em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; background: var(--p-navy); color: var(--p-canvas); font-size: 21px; font-weight: 500; }
.workspace-switch { display: grid; gap: 7px; margin: 36px 0 26px; padding: 14px 13px; background: var(--p-canvas); border: 1px solid var(--p-border); border-radius: var(--p-radius); }
.workspace-switch .platform-input { font-weight: 600; color: var(--p-navy); }
.workspace-switch small { color: var(--p-muted); font-size: 11px; text-transform: capitalize; }
.eyebrow { color: var(--p-forest); font: 600 10px/1.4 var(--p-font); letter-spacing: .14em; text-transform: uppercase; }
.primary-nav { display: grid; gap: 3px; }
.primary-nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 4px; color: var(--p-muted); text-decoration: none; font-size: 13px; }
.primary-nav a:hover { background: var(--p-recessed); color: var(--p-navy); }
.primary-nav a.active { background: var(--p-recessed); color: var(--p-navy); font-weight: 600; box-shadow: inset 2px 0 var(--p-forest); }
.nav-count:empty { display: none; }
.nav-count { min-width: 18px; padding: 1px 6px; border-radius: 9px; background: var(--p-ochre); color: #fff; font: 600 10px/16px var(--p-font); text-align: center; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--p-ochre); }
.sidebar-foot { display: flex; gap: 10px; align-items: flex-start; margin-top: auto; padding: 18px 10px 2px; border-top: 1px solid var(--p-border); color: var(--p-body); font-size: 11px; line-height: 1.5; }
.sidebar-foot small { color: var(--p-muted); }
.sidebar-dot { flex: 0 0 7px; margin-top: 5px; height: 7px; border-radius: 50%; background: var(--p-muted); }
.sidebar-dot[data-source="supabase"] { background: var(--p-forest); }
.sidebar-dot[data-source="local"] { background: var(--p-ochre); }
.main-column { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; min-height: 62px; padding: 0 42px; border-bottom: 1px solid var(--p-border); }
.breadcrumb { margin-right: auto; color: var(--p-muted); font-size: 12px; }
.breadcrumb span { padding: 0 6px; color: #98a1ad; }
.breadcrumb strong { color: var(--p-navy); font-weight: 500; }
.source-badge { padding: 4px 9px; border: 1px solid var(--p-border); border-radius: 12px; color: var(--p-muted); font-size: 11px; white-space: nowrap; }
.source-badge[data-source="supabase"] { border-color: var(--p-forest); color: var(--p-forest); }
.source-badge[data-source="local"] { border-color: var(--p-ochre); color: var(--p-warn); }
.signed-in { color: var(--p-muted); font-size: 11px; white-space: nowrap; }
.avatar { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border: 1px solid var(--p-border); border-radius: 50%; color: var(--p-navy); font-size: 10px; font-weight: 600; }
main { max-width: 1320px; margin: 0 auto; padding: 42px 42px 80px; }
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 30px; }
.page-heading h1 { max-width: 820px; margin: 10px 0 12px; color: var(--p-navy); font-size: clamp(34px, 3.8vw, 54px); font-weight: 500; line-height: 1.08; letter-spacing: -.05em; text-wrap: balance; }
.page-heading p { max-width: 700px; margin: 0; color: var(--p-body); font-size: 15px; line-height: 1.65; }
.page-heading a { color: var(--p-forest); font-weight: 600; text-underline-offset: 3px; }
.edition { padding-top: 10px; color: var(--p-muted); font: 11px var(--p-mono); white-space: nowrap; }

/* ---------- platform components ---------- */
h2, h3 { color: var(--p-navy); font-weight: 500; letter-spacing: -.02em; }
.panel { min-width: 0; padding: 22px; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); }
.panel h2 { margin: 6px 0 14px; font-size: 21px; }
.panel h3 { margin: 6px 0 4px; font-size: 19px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.panel-head h2 { margin-bottom: 14px; }
.panel-head p { margin: 0 0 12px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.summary-card { display: block; min-height: 140px; padding: 20px 22px; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); text-decoration: none; }
.summary-card strong { display: block; margin: 12px 0 7px; color: var(--p-navy); font: 400 34px/1 var(--p-mono); }
.summary-card p { margin: 0; color: var(--p-muted); font-size: 12px; line-height: 1.55; }
.link-card:hover { border-color: var(--p-navy); }
.section-title-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 40px 0 14px; }
.section-title-row h2 { margin: 6px 0 0; font-size: 23px; }
.note-panel { margin-top: 20px; padding: 22px; background: var(--p-recessed); border: 1px solid var(--p-border); border-radius: var(--p-radius); }
.note-panel p { max-width: 720px; margin: 8px 0 0; color: var(--p-body); font-size: 13px; line-height: 1.6; }
.notice { margin: 0 0 18px; padding: 12px 14px; border-left: 3px solid var(--p-ochre); background: var(--p-surface); color: var(--p-body); font-size: 13px; }
.notice-danger { border-left-color: var(--p-danger); color: var(--p-danger); }
.muted { color: var(--p-muted); font-size: 13px; }
.mono { font-family: var(--p-mono); font-size: 12px; }
.helper { margin: 10px 0 0; color: var(--p-muted); font-size: 11px; line-height: 1.55; }
.helper a, .text-link { color: var(--p-forest); font-weight: 600; text-underline-offset: 3px; }
.text-link { padding: 0; background: none; border: 0; text-decoration: underline; font-size: 12px; cursor: pointer; white-space: nowrap; }
.text-link:hover { color: var(--p-navy); }
.text-link.danger { color: var(--p-danger); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.platform-input { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--p-border); border-radius: 4px; background: var(--p-canvas); color: var(--p-text); font-size: 13px; }
.platform-input:focus { border-color: var(--p-navy); outline: none; box-shadow: 0 0 0 2px #0b254520; }
.platform-input.compact { width: auto; min-height: 30px; padding: 4px 8px; font-size: 12px; }
.platform-input.invalid { border-color: var(--p-danger); background: #7a2e2e0d; }
.platform-input:disabled { opacity: .55; }
.platform-button { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 8px 14px; border: 1px solid var(--p-navy); border-radius: 4px; background: var(--p-navy); color: var(--p-canvas); text-decoration: none; font-size: 12px; font-weight: 600; white-space: nowrap; }
.platform-button:hover:not(:disabled) { background: #061a35; }
.platform-button:disabled { opacity: .45; cursor: not-allowed; }
.platform-button-secondary { background: transparent; color: var(--p-navy); }
.platform-button-secondary:hover:not(:disabled) { background: var(--p-recessed); }
.platform-button.small { min-height: 30px; padding: 5px 10px; font-size: 11px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.button-row.tight { margin-top: 0; }
.icon-button { flex: 0 0 auto; width: 28px; height: 28px; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--p-muted); font-size: 17px; line-height: 1; }
.icon-button:hover { border-color: var(--p-border); color: var(--p-danger); }

.p-badge { display: inline-flex; align-items: center; padding: 3px 8px; border: 1px solid var(--p-border); border-radius: 3px; color: var(--p-muted); font-size: 11px; white-space: nowrap; }
.p-badge-ok { border-color: var(--p-ok); color: var(--p-ok); }
.p-badge-warn { border-color: var(--p-warn); color: var(--p-warn); }
.p-badge-info { border-color: var(--p-info); color: var(--p-info); }
.p-badge-muted { background: var(--p-recessed); }

/* relative: keeps absolutely positioned visually-hidden labels inside the scroll box */
.table-scroll { position: relative; overflow-x: auto; }
.p-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.p-table th { padding: 8px 10px; border-bottom: 1px solid var(--p-border); color: var(--p-muted); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.p-table td { padding: 10px; border-bottom: 1px solid var(--p-border); vertical-align: middle; white-space: nowrap; }
.p-table td.wrap { white-space: normal; min-width: 240px; }
.p-table tbody tr:last-child td { border-bottom: 0; }
.p-table tfoot td { border-top: 1px solid var(--p-navy); border-bottom: 0; font-weight: 600; }
.p-table td strong { display: block; color: var(--p-text); font-weight: 600; }
.p-table td small { display: block; color: var(--p-muted); font-size: 11px; }
.p-table .num { text-align: right; font-family: var(--p-mono); font-size: 12px; }
.p-table .actions { text-align: right; }
.p-table .row-muted td { color: var(--p-muted); }
.p-table .row-new td { background: #b08b3a12; }

.form-errors { margin: 10px 0 0; padding: 8px 10px; border-left: 2px solid var(--p-danger); background: #7a2e2e0d; color: var(--p-danger); font-size: 12px; }
.hint { margin: 10px 0 0; font-size: 12px; line-height: 1.5; }
.hint.warn { padding: 8px 10px; border-left: 2px solid var(--p-ochre); background: #b08b3a14; color: var(--p-warn); }

.toast { position: fixed; bottom: 20px; right: 20px; max-width: min(380px, calc(100vw - 40px)); padding: 12px 16px; background: var(--p-navy); color: var(--p-canvas); border-radius: 4px; box-shadow: 0 10px 25px #0b254526; font-size: 12px; line-height: 1.5; z-index: 20; }

/* ---------- overview ---------- */
.overview-tenant { margin-bottom: 4px; }
.admin-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 0; }
.admin-metrics .t-metric strong { font-size: 26px; }
.attention-list, .recent-list { margin: 0; padding: 0; list-style: none; }
.attention-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 11px 0; border-top: 1px solid var(--p-border); color: var(--p-body); font-size: 13px; line-height: 1.5; }
.recent-list li { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--p-border); font-size: 13px; }
.recent-list time { color: var(--p-muted); font: 11px var(--p-mono); }
.recent-list small { grid-column: 2; color: var(--p-muted); font-size: 11px; }
.quick-grid .summary-card strong { font-size: 30px; }

/* ---------- users ---------- */
.users-layout { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.invite-form label { display: block; margin: 12px 0 6px; color: var(--p-body); font-size: 12px; font-weight: 600; }
.invite-form label small { color: var(--p-muted); font-weight: 400; }
.invite-form .platform-button { width: 100%; margin-top: 14px; }
.role-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.role-card { padding: 16px 18px; border: 1px solid var(--p-border); border-radius: var(--p-radius); }
.role-card strong { display: block; margin: 8px 0 4px; color: var(--p-navy); font: 400 24px/1 var(--p-mono); }
.role-card p { margin: 0; color: var(--p-muted); font-size: 12px; }

/* ---------- access ---------- */
.access-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.app-list { display: grid; gap: 6px; padding: 16px; }
.app-list > .eyebrow { margin: 0 4px 4px; }
.app-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--p-text); text-align: left; }
.app-row:hover { background: var(--p-recessed); }
.app-row.active { border-color: var(--p-navy); background: var(--p-canvas); }
.app-row > span:first-child { display: grid; gap: 2px; min-width: 0; }
.app-row strong { font-size: 13px; font-weight: 600; }
.app-row small { overflow: hidden; color: var(--p-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.app-row-meta { display: grid; justify-items: end; gap: 4px; }
.mode-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 16px; padding: 0; border: 0; }
.mode-picker legend { margin-bottom: 8px; color: var(--p-body); font-size: 12px; font-weight: 600; }
.mode-option { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--p-border); border-radius: 4px; background: var(--p-canvas); cursor: pointer; }
.mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.mode-option strong { color: var(--p-navy); font-size: 13px; }
.mode-option small { color: var(--p-muted); font-size: 11px; line-height: 1.45; }
.mode-option.active { border-color: var(--p-navy); box-shadow: inset 0 0 0 1px var(--p-navy); background: var(--p-surface); }
.mode-option:focus-within { outline: 2px solid var(--p-forest); outline-offset: 2px; }
.field-row { margin-bottom: 12px; }
.field-row > label { display: block; margin-bottom: 6px; color: var(--p-body); font-size: 12px; font-weight: 600; }
.field-row > label small { color: var(--p-muted); font-weight: 400; }
.input-with-button { display: flex; gap: 8px; }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--p-border); border-radius: 4px; background: var(--p-canvas); }
.input-prefix span { padding: 0 2px 0 10px; color: var(--p-muted); font-family: var(--p-mono); }
.input-prefix .platform-input { border: 0; background: transparent; }
.effect { margin: 4px 0 0; padding: 10px 12px; background: var(--p-canvas); border-left: 2px solid var(--p-navy); color: var(--p-body); font-size: 13px; line-height: 1.5; }
.code-panel { margin-top: 18px; }
.code-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.code-head small { color: var(--p-muted); font-size: 11px; }
.code-block { max-height: 420px; margin: 0; padding: 14px; overflow: auto; background: #0f1a2a; color: #e6e9ee; border-radius: 4px; font: 11.5px/1.55 var(--p-mono); white-space: pre; }
.code-panel.sent .code-block { background: var(--p-recessed); color: var(--p-body); max-height: 200px; }

/* ---------- settings ---------- */
.settings-toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 14px; background: var(--p-canvas); border: 1px solid var(--p-border); border-radius: var(--p-radius); box-shadow: 0 6px 18px #0b25450d; }
.settings-toolbar .platform-input { flex: 1; min-width: 160px; }
.status-line { flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--p-muted); }
.status-line[data-state="valid"] { color: var(--p-ok); }
.status-line[data-state="invalid"] { color: var(--p-danger); }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; }
.editor-column { display: grid; gap: 16px; min-width: 0; }
.side-column { position: sticky; top: 76px; display: grid; gap: 14px; max-height: calc(100vh - 92px); overflow: auto; }
.side-column .panel h2 { margin-bottom: 10px; }
.editor-block { padding: 14px 0; border-top: 1px solid var(--p-border); }
.editor-block:last-child { padding-bottom: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.block-head .field { flex: 1; }
.weekly-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.weekly-row > .platform-input { width: auto; }
.time-range { display: inline-flex; align-items: center; gap: 6px; color: var(--p-muted); }
.time-range .platform-input { width: 112px; }
.day-chips, .member-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.day-chip { position: relative; }
.day-chip input { position: absolute; opacity: 0; }
.day-chip span { display: inline-block; min-width: 40px; padding: 5px 7px; border: 1px solid var(--p-border); border-radius: 3px; background: var(--p-canvas); color: var(--p-muted); font-size: 11px; text-align: center; cursor: pointer; user-select: none; }
.day-chip.wide span { min-width: 0; padding: 5px 9px; }
.day-chip input:checked + span { border-color: var(--p-navy); background: var(--p-navy); color: var(--p-canvas); }
.day-chip input:focus-visible + span { outline: 2px solid var(--p-forest); outline-offset: 2px; }
.exceptions, .times { margin: 10px 0 6px; }
.mini-label { display: block; margin-bottom: 6px; color: var(--p-muted); font-size: 11px; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--p-body); font-size: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; margin-bottom: 8px; }
.field { display: grid; gap: 5px; color: var(--p-body); font-size: 11px; font-weight: 600; }
.field.check { display: flex; align-self: end; min-height: 36px; font-weight: 400; }
.span-2 { grid-column: span 2; }
.editor-table td { padding: 6px; }
.editor-table .platform-input { min-width: 90px; }
.issue-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.issue-list + .issue-list { margin-top: 10px; }
.issue-list li { padding: 7px 9px; font-size: 12px; line-height: 1.45; border-left: 2px solid; }
.issue-error { border-color: var(--p-danger); background: #7a2e2e0d; color: var(--p-danger); }
.issue-warning { border-color: var(--p-ochre); background: #b08b3a14; color: var(--p-warn); }
.ok-line { margin: 0; padding: 7px 9px; border-left: 2px solid var(--p-ok); color: var(--p-ok); font-size: 12px; }
.diff-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.diff-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; padding: 6px 0; border-top: 1px solid var(--p-border); font-size: 12px; }
.diff-list li:first-child { border-top: 0; }
.diff-list strong { display: block; font-weight: 600; color: var(--p-text); }
.diff-list small { display: block; margin-top: 2px; color: var(--p-muted); font-family: var(--p-mono); font-size: 11px; overflow-wrap: anywhere; }
.diff-mark { font: 600 13px var(--p-mono); text-align: center; }
.diff-added .diff-mark, .diff-list ins { color: var(--p-ok); text-decoration: none; }
.diff-removed .diff-mark, .diff-list del { color: var(--p-danger); }
.diff-changed .diff-mark { color: var(--p-warn); }
.customer-preview .plugin-mount { padding: 20px; }
.customer-preview .tenant-section-head { margin-bottom: 14px; }
.customer-preview .tenant-section-head h3 { font-size: 20px; }
.customer-preview .tenant-section-head p { font-size: 11px; }
.customer-preview .t-panel { padding: 4px 16px 14px; }
.customer-preview .slot-list > div { flex-wrap: wrap; gap: 6px 12px; }
.customer-preview .slot-list > div > span:first-child { flex-basis: 100%; }
.customer-preview .slot-list time { margin-right: auto; font-size: 13px; color: var(--color-foreground); }
.editor-block > .text-link { margin-right: 18px; }
.history-panel { margin-top: 16px; }
.history-list { margin: 0; padding: 0; list-style: none; }
.history-list li { border-top: 1px solid var(--p-border); }
.history-list summary { display: flex; align-items: center; gap: 12px; padding: 11px 0; cursor: pointer; list-style: none; }
.history-list summary::-webkit-details-marker { display: none; }
.history-list summary strong { display: block; font-size: 13px; font-weight: 600; }
.history-list summary small { color: var(--p-muted); font-size: 11px; }
.history-list details[open] { padding-bottom: 12px; }
.history-list details > .diff-list, .history-list details > p { margin: 0 0 8px 42px; }
.history-list details > .text-link { margin-left: 42px; }
.rev-number { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border: 1px solid var(--p-navy); border-radius: 50%; color: var(--p-navy); font: 600 12px var(--p-mono); }

/* ---------- apps ---------- */
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.app-card .panel-head p { margin-bottom: 10px; }
.mini-preview { margin: 4px 0 14px; }
.mini-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.mini-bar .tenant-mark { flex-basis: 30px; height: 30px; font-size: 11px; }
.mini-bar strong { margin-right: auto; font: 500 15px var(--font-display); }
.mini-preview[data-mini-theme="own"] { --color-background: #ffffff; --color-foreground: #1f2937; --color-border: #d1d5db; --color-primary: #6d28d9; --color-primary-foreground: #ffffff; --font-sans: system-ui, sans-serif; --font-display: Georgia, serif; --radius: 12px; }
.facts { display: grid; gap: 8px; margin: 0; }
.facts div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; font-size: 12px; }
.facts dt { color: var(--p-muted); }
.facts dd { margin: 0; color: var(--p-body); line-height: 1.5; }
.integration-list { display: grid; gap: 10px; }
.integration { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 20px; }
.integration strong { color: var(--p-navy); font-size: 14px; }
.integration p { margin: 4px 0 0; color: var(--p-body); font-size: 12px; line-height: 1.5; }

/* ---------- billing ---------- */
.cap { margin-bottom: 16px; }
.cap-text { display: grid; gap: 3px; margin-bottom: 8px; font-size: 13px; }
.cap-text small { color: var(--p-muted); font-size: 11px; }
.cap-bar { height: 8px; overflow: hidden; border-radius: 4px; background: var(--p-recessed); }
.cap-bar span { display: block; height: 100%; background: var(--p-forest); }

/* ---------- audit ---------- */
.inline-filter { display: inline-flex; align-items: center; gap: 8px; color: var(--p-muted); font-size: 12px; }
.audit-table td { vertical-align: top; }

/* ---------- responsive ---------- */
@media (max-width: 1150px) {
  .settings-layout { grid-template-columns: 1fr; }
  .side-column { position: static; max-height: none; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: static; min-height: auto; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--p-border); }
  .workspace-switch { margin: 14px 0 10px; }
  .sidebar-foot { display: none; }
  .primary-nav { display: flex; overflow-x: auto; }
  .primary-nav a { white-space: nowrap; }
  .topbar { padding: 0 16px; flex-wrap: wrap; }
  .signed-in { min-width: 0; white-space: normal; }
  .signed-in .auth-badge-text small { display: none; }
  main { padding: 26px 16px 60px; }
  .users-layout, .access-layout, .two-col, .card-grid { grid-template-columns: 1fr; }
  .mode-picker { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page-heading { display: block; }
  .edition { display: block; margin-top: 12px; }
  .summary-grid, .role-grid, .admin-metrics { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .settings-toolbar { flex-wrap: wrap; }
  .input-with-button { flex-direction: column; }
  .integration { flex-direction: column; align-items: flex-start; }
  .panel-head { flex-wrap: wrap; }
  .tenant-header { padding: 20px; }
}

/* Staff sign-in: badge in the top bar, setup link after an invite (packages/ui/web/auth.css). */
.signed-in .auth-badge { color: var(--p-text); }
.setup-link-panel { display: grid; gap: 8px; margin-bottom: 20px; border-color: var(--p-forest); }
.setup-link-panel h2 { margin: 2px 0 0; overflow-wrap: anywhere; }
.setup-link-panel p { margin: 0; color: var(--p-body); }
.setup-link-panel .text-link { justify-self: start; }
.confirm-existing { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 8px; font-size: 13px; }
.confirm-existing[hidden] { display: none; }
.confirm-existing input { margin-top: 3px; }
