.dashboard-proto {
  --dbp-bg: #f7f5f0;
  --dbp-bg-card: #ffffff;
  --dbp-bg-hover: #f2efe9;
  --dbp-bg-inset: #edeae3;
  --dbp-rule: rgba(0, 0, 0, 0.07);
  --dbp-rule-strong: rgba(0, 0, 0, 0.11);
  --dbp-ink: #1a1815;
  --dbp-ink-2: #3d3a34;
  --dbp-ink-3: #6b6458;
  --dbp-ink-4: #9a9188;
  --dbp-accent: #c49510;
  --dbp-accent-bg: rgba(196, 149, 16, 0.08);
  --dbp-accent-border: rgba(196, 149, 16, 0.2);
  --dbp-active-ink: #7a5c00;
  --dbp-active-bg: rgba(122, 92, 0, 0.1);
  --dbp-active-border: rgba(122, 92, 0, 0.22);
  --dbp-green: #1e7a45;
  --dbp-green-bg: rgba(30, 122, 69, 0.08);
  --dbp-red: #b03030;
  --dbp-red-bg: rgba(176, 48, 48, 0.07);
  --dbp-red-border: rgba(176, 48, 48, 0.18);
  --dbp-blue: #2563a8;
  --dbp-blue-bg: rgba(37, 99, 168, 0.08);
  --dbp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --dbp-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --dbp-shadow-card: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.05);
  color: var(--dbp-ink);
}

.dashboard-proto__banner {
  margin: 18px 0 16px;
}

.dashboard-proto .trial-banner {
  padding: 12px 16px;
  background: rgba(230, 86, 30, 0.1);
  border: 1px solid rgba(230, 86, 30, 0.3);
  border-radius: 10px;
}

.dashboard-proto .trial-banner--actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 12px;
  z-index: 20;
}

.dashboard-proto .trial-banner__content {
  min-width: 240px;
}

.dashboard-proto .trial-banner__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-proto .trial-banner__actions form {
  margin: 0;
  display: inline;
}

.dashboard-proto .trial-banner__actions .btn {
  min-height: 40px;
}

.dashboard-proto .trial-banner__actions .btn--compact {
  padding: 8px 12px;
}

.dashboard-proto .trial-banner__actions .btn-ghost {
  border-color: rgba(230, 86, 30, 0.35);
}

.dashboard-proto svg {
  display: block;
}

.dbp-page-header {
  padding: 22px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dbp-page-greeting {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--dbp-ink-4);
  margin-bottom: 3px;
}

.dbp-page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--dbp-ink);
  letter-spacing: -0.025em;
  margin: 0;
}

.dbp-page-header__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dbp-page-header__right .btn svg {
  width: 13px;
  height: 13px;
}

.dbp-status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 0;
}

.dbp-status-strip--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dbp-stat-card {
  background: var(--dbp-bg-card);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--dbp-shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.dbp-stat-card:hover {
  box-shadow: var(--dbp-shadow-md);
}

.dbp-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dbp-stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dbp-ink-4);
  line-height: 1.3;
}

.dbp-stat-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dbp-bg-inset);
  color: var(--dbp-ink-4);
  flex-shrink: 0;
}

.dbp-stat-icon-wrap--danger {
  background: var(--dbp-red-bg);
  color: var(--dbp-red);
}

.dbp-stat-icon-wrap--success {
  background: var(--dbp-green-bg);
  color: var(--dbp-green);
}

.dbp-stat-icon-wrap svg {
  width: 13px;
  height: 13px;
}

.dbp-stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--dbp-ink);
  letter-spacing: -0.03em;
  line-height: 1;
}

.dbp-stat-value--danger {
  color: var(--dbp-red);
}

.dbp-stat-value--success {
  color: var(--dbp-green);
}

.dbp-stat-footer {
  font-size: 11px;
  font-weight: 400;
  color: var(--dbp-ink-4);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dbp-stat-footer--danger {
  color: var(--dbp-red);
}

.dbp-stat-footer--success {
  color: var(--dbp-green);
}

/* Trend pill — "+N this week" indicator rendered inside a stat card's
 * footer. Hidden when the render helper returns empty. Tones:
 *   --good    — positive direction is good (e.g. clients added)
 *   --neutral — direction is neither good nor bad (e.g. active work opened)
 *   --warn    — positive direction is bad (e.g. overdue count rising) */
.dbp-stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
  white-space: nowrap;
  background: color-mix(in srgb, var(--dbp-ink-4, #6b6458) 14%, transparent);
  color: var(--dbp-ink-3);
}

.dbp-stat-trend--good {
  background: color-mix(in srgb, var(--dbp-green, #1e7a45) 15%, transparent);
  color: var(--dbp-green, #1e7a45);
}

.dbp-stat-trend--warn {
  background: color-mix(in srgb, var(--dbp-red, #b03030) 14%, transparent);
  color: var(--dbp-red, #b03030);
}

.dbp-stat-trend__arr {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.dbp-stat-trend__num {
  font-weight: 600;
}

.dbp-stat-trend__label {
  font-weight: 400;
  opacity: 0.85;
}

/* ── Compliance snapshot — collapsible strip ── */
.dbp-compliance {
  background: var(--surface-card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin-bottom: 14px;
}

.dbp-compliance__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.dbp-compliance__toggle:hover {
  background: var(--surface-subtle);
  border-radius: 10px;
}

.dbp-compliance__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.dbp-compliance__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  flex-shrink: 0;
}

.dbp-compliance__pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}

.dbp-compliance__pill--success {
  background: rgba(30, 122, 69, 0.1);
  color: var(--success);
}

.dbp-compliance__pill--warn {
  background: rgba(180, 83, 9, 0.1);
  color: #b45309;
}

.dbp-compliance__pill--danger {
  background: rgba(176, 48, 48, 0.08);
  color: var(--danger);
}

.dbp-compliance__period {
  font-size: 10px;
  color: var(--ink-4);
  margin-left: auto;
  flex-shrink: 0;
}

.dbp-compliance__chevron {
  width: 12px;
  height: 12px;
  color: var(--ink-4);
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.dbp-compliance__toggle[aria-expanded="true"] .dbp-compliance__chevron {
  transform: rotate(90deg);
}

.dbp-compliance__body {
  padding: 0 14px 12px;
}

.dbp-compliance__metrics {
  display: flex;
  gap: 20px;
}

.dbp-compliance__metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.dbp-compliance__value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.dbp-compliance__value--success { color: var(--success); }
.dbp-compliance__value--warn { color: #b45309; }
.dbp-compliance__value--danger { color: var(--danger); }

.dbp-compliance__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dbp-compliance__detail {
  font-size: 10px;
  color: var(--ink-4);
}

html[data-theme="dark"] .dbp-compliance {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(71, 85, 105, 0.58);
}

html[data-theme="dark"] .dbp-compliance__toggle:hover {
  background: rgba(15, 23, 42, 0.35);
}

html[data-theme="dark"] .dbp-compliance__pill--success {
  background: rgba(30, 122, 69, 0.18);
}

html[data-theme="dark"] .dbp-compliance__pill--warn {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

html[data-theme="dark"] .dbp-compliance__pill--danger {
  background: rgba(176, 48, 48, 0.15);
}

html[data-theme="dark"] .dbp-compliance__value--warn {
  color: #f59e0b;
}

@media (max-width: 900px) {
  .dbp-compliance__summary {
    flex-wrap: wrap;
    gap: 5px;
  }
  .dbp-compliance__metrics {
    flex-wrap: wrap;
    gap: 12px;
  }
  .dbp-compliance__metric {
    flex: 1 1 calc(50% - 6px);
    min-width: 100px;
  }
}

.dbp-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-areas:
    "field quick"
    "recent workspace";
  gap: 14px;
  padding: 0 0 28px;
}

.dbp-content-grid--compact {
  grid-template-areas:
    "field quick"
    "recent quick";
}

.dbp-card--field-work {
  grid-area: field;
}

.dbp-card--recent-inspections {
  grid-area: recent;
}

.dbp-card--quick-actions {
  grid-area: quick;
}

.dbp-card--workspace {
  grid-area: workspace;
}

.dbp-card--field-work,
.dbp-card--recent-inspections,
.dbp-card--quick-actions,
.dbp-card--workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.dbp-card {
  background: var(--dbp-bg-card);
  border-radius: 12px;
  box-shadow: var(--dbp-shadow-card);
  overflow: hidden;
}

.dbp-card-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--dbp-rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dbp-card-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dbp-accent);
  margin-bottom: 2px;
  display: block;
}

.dbp-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--dbp-ink);
  letter-spacing: -0.01em;
  margin: 0;
}

.dbp-card-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--dbp-ink-4);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--dbp-rule-strong);
  background: var(--dbp-bg-card);
  transition: all 0.15s;
  box-shadow: var(--dbp-shadow-sm);
  white-space: nowrap;
}

.dbp-card-action:hover {
  background: var(--dbp-bg-hover);
  color: var(--dbp-ink-3);
}

.dbp-card-action:focus-visible,
.dbp-fc-link:focus-visible,
.dbp-qa-item:focus-visible,
.dbp-status-strip:focus-visible {
  outline: 2px solid var(--dbp-accent);
  outline-offset: 2px;
}

.dbp-table-wrap:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--dbp-accent);
}

@media (forced-colors: active) {
  .dbp-table-wrap:focus-visible {
    outline: 2px solid Highlight;
    outline-offset: -2px;
    box-shadow: none;
  }
}

.dbp-card-action svg,
.dbp-fc-link svg,
.dbp-qa-arr svg {
  width: 9px;
  height: 9px;
}

.dbp-field-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  background: var(--dbp-rule);
}

.dbp-field-col {
  background: var(--dbp-bg-card);
  padding: 18px 20px;
  min-width: 0;
}

.dbp-field-col--divided {
  border-left: 1px solid var(--dbp-rule);
}

.dbp-field-col-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dbp-ink-4);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dbp-fc-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 100px;
  flex-shrink: 0;
}

.dbp-fc-zero {
  background: var(--dbp-bg-inset);
  color: var(--dbp-ink-4);
}

.dbp-fc-warn {
  background: var(--dbp-red-bg);
  color: var(--dbp-red);
}

.dbp-fc-ok {
  background: var(--dbp-green-bg);
  color: var(--dbp-green);
}

.dbp-fc-num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--dbp-ink);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
}

.dbp-fc-num--red {
  color: var(--dbp-red);
}

.dbp-fc-main {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--dbp-ink-2);
  margin-bottom: 3px;
}

.dbp-fc-hint {
  font-size: 11.5px;
  font-weight: 300;
  color: var(--dbp-ink-4);
  margin-bottom: 14px;
  line-height: 1.4;
}

/* Hint becomes clickable when a specific job is surfaced. Pointed at the
 * fire-door job detail page. Inherits hint size/weight but tones to the
 * ink text so the job reference reads as a live reference, not decoration. */
.dbp-fc-hint-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--dbp-ink-3);
  text-decoration: none;
  font-weight: 400;
  transition: color 140ms ease, gap 160ms ease;
}

.dbp-fc-hint-link:hover,
.dbp-fc-hint-link:focus-visible {
  color: var(--dbp-accent, #c49510);
  gap: 6px;
  outline: none;
}

.dbp-fc-hint-link-arr {
  display: inline-flex;
  align-items: center;
  opacity: 0.65;
  transition: opacity 140ms ease;
}

.dbp-fc-hint-link:hover .dbp-fc-hint-link-arr,
.dbp-fc-hint-link:focus-visible .dbp-fc-hint-link-arr {
  opacity: 1;
}

.dbp-fc-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--dbp-accent);
  text-decoration: none;
}

.dbp-fc-link:focus-visible {
  border-radius: 6px;
}

.dbp-fu-card {
  background: var(--dbp-bg);
  border: 1px solid var(--dbp-red-border);
  border-radius: 8px;
  padding: 12px;
  transition: background 0.14s ease, border-color 0.14s ease;
}

/* Clickable overdue follow-up card — the whole card navigates to the
 * overdue inspection, matching the recent-inspections row-click pattern.
 * The internal `Follow up →` button still works and is skipped by the
 * row-link JS (button → closer target wins). */
.dbp-fu-card--clickable {
  cursor: pointer;
}

.dbp-fu-card--clickable:hover,
.dbp-fu-card--clickable:focus-within {
  background: color-mix(in srgb, var(--dbp-red-border, #f0c1b5) 10%, var(--dbp-bg));
  border-color: color-mix(in srgb, var(--dbp-red, #b03030) 30%, var(--dbp-red-border, #f0c1b5));
}

.dbp-fu-address {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dbp-ink);
  margin-bottom: 2px;
}

.dbp-fu-sub {
  font-size: 11px;
  color: var(--dbp-ink-4);
  margin-bottom: 8px;
  line-height: 1.4;
}

.dbp-fu-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.dbp-fu-tag {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.dbp-fu-tag--overdue {
  background: var(--dbp-red-bg);
  color: var(--dbp-red);
  border: 1px solid var(--dbp-red-border);
}

.dbp-fu-tag--sched {
  background: var(--dbp-blue-bg);
  color: var(--dbp-blue);
  border: 1px solid rgba(37, 99, 168, 0.15);
}

.dbp-fu-tag--active {
  background: var(--dbp-active-bg);
  color: var(--dbp-active-ink);
  border: 1px solid var(--dbp-active-border);
}

.dbp-fu-tag--done {
  background: var(--dbp-green-bg);
  color: var(--dbp-green);
  border: 1px solid rgba(30, 122, 69, 0.15);
}

.dbp-fu-tag--cancelled {
  background: var(--dbp-bg-inset);
  color: var(--dbp-ink-3);
  border: 1px solid var(--dbp-rule-strong);
}

.dbp-fu-tag--id {
  background: var(--dbp-bg-inset);
  color: var(--dbp-ink-4);
  border: 1px solid var(--dbp-rule-strong);
}

.dbp-fu-btn {
  width: 100%;
  justify-content: center;
}

.dbp-fu-btn:hover {
  text-decoration: none;
}

.dbp-table {
  width: 100%;
  border-collapse: collapse;
}

.dbp-table thead th {
  padding: 10px 20px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dbp-ink-4);
  border-bottom: 1px solid var(--dbp-rule);
  white-space: nowrap;
}

.dbp-table tbody tr {
  border-bottom: 1px solid var(--dbp-rule);
  transition: background 0.1s;
}

.dbp-table tbody tr:last-child {
  border-bottom: none;
}

.dbp-table tbody tr:hover {
  background: var(--dbp-bg-hover);
}

/* Clickable rows — recent inspections on the dashboard. Row carries the
 * `data-dbp-row-link` attribute and the JS handler widens the click target
 * to the full row. The Property cell also contains a real anchor for
 * keyboard / right-click / middle-click support. */
.dbp-table-row--clickable {
  cursor: pointer;
}

.dbp-td-prop-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.dbp-td-prop-link:focus-visible {
  outline: 2px solid var(--dbp-accent, #c49510);
  outline-offset: 2px;
  border-radius: 4px;
}

.dbp-table tbody td {
  padding: 11px 20px;
  color: var(--dbp-ink-3);
  font-size: 13px;
  font-weight: 300;
  vertical-align: middle;
}

.dbp-td-prop-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--dbp-ink);
  display: block;
}

.dbp-td-prop-sub {
  font-size: 11px;
  color: var(--dbp-ink-4);
  display: block;
}

.dbp-date-chip {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 400;
  background: var(--dbp-bg-inset);
  color: var(--dbp-ink-3);
  border: 1px solid var(--dbp-rule-strong);
  white-space: nowrap;
}

.dbp-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.dbp-status-chip--sched {
  background: var(--dbp-blue-bg);
  color: var(--dbp-blue);
  border: 1px solid rgba(37, 99, 168, 0.15);
}

.dbp-status-chip--active {
  background: var(--dbp-active-bg);
  color: var(--dbp-active-ink);
  border: 1px solid var(--dbp-active-border);
}

.dbp-status-chip--overdue {
  background: var(--dbp-red-bg);
  color: var(--dbp-red);
  border: 1px solid var(--dbp-red-border);
}

.dbp-status-chip--done {
  background: var(--dbp-green-bg);
  color: var(--dbp-green);
  border: 1px solid rgba(30, 122, 69, 0.15);
}

.dbp-status-chip--cancelled {
  background: var(--dbp-bg-inset);
  color: var(--dbp-ink-3);
  border: 1px solid var(--dbp-rule-strong);
}

.dbp-table-label {
  display: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dbp-ink-4);
}

.dbp-table-scroll-hint,
.dbp-status-strip-hint {
  display: none;
}

.dbp-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.dbp-client-pill {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 11.5px;
  background: rgba(26, 24, 21, 0.035);
  color: var(--dbp-ink-3);
  border: 1px solid var(--dbp-rule);
}

.dbp-client-pill--unassigned {
  background: var(--dbp-bg-inset);
  color: var(--dbp-ink-4);
  border: 1px solid var(--dbp-rule-strong);
}

.dbp-empty {
  color: var(--dbp-ink-4);
}

.dbp-qa-list {
  display: flex;
  flex-direction: column;
  padding: 0 0 4px;
}

.dbp-qa-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--dbp-rule);
  text-decoration: none;
  transition: background 0.12s;
}

.dbp-qa-item:last-child {
  border-bottom: none;
}

.dbp-qa-item:hover {
  background: var(--dbp-bg-hover);
}

.dbp-qa-item:focus-visible {
  position: relative;
  z-index: 1;
  background: var(--dbp-bg-hover);
}

.dbp-qa-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--dbp-rule-strong);
  background: var(--dbp-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: var(--dbp-ink-3);
}

.dbp-qa-item:hover .dbp-qa-icon {
  border-color: var(--dbp-accent-border);
  background: var(--dbp-accent-bg);
  color: var(--dbp-accent);
}

.dbp-qa-item:focus-visible .dbp-qa-icon {
  border-color: var(--dbp-accent-border);
  background: var(--dbp-accent-bg);
  color: var(--dbp-accent);
}

.dbp-qa-icon svg {
  width: 15px;
  height: 15px;
}

.dbp-qa-body {
  flex: 1;
  min-width: 0;
}

.dbp-qa-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--dbp-ink);
  margin-bottom: 1px;
}

.dbp-qa-sub {
  font-size: 11.5px;
  font-weight: 300;
  color: var(--dbp-ink-4);
}

.dbp-qa-arr {
  width: 14px;
  height: 14px;
  color: var(--dbp-ink-4);
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}

.dbp-qa-item:hover .dbp-qa-arr {
  color: var(--dbp-accent);
  transform: translateX(2px);
}

.dbp-team-list {
  padding: 4px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dbp-team-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 7px;
  transition: background 0.12s;
}

.dbp-team-member:hover {
  background: var(--dbp-bg-hover);
}

.dbp-team-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.dbp-team-avatar--gold {
  background: #c49510;
}

.dbp-team-avatar--blue {
  background: #2563a8;
}

.dbp-team-avatar--green {
  background: #1e7a45;
}

.dbp-team-avatar--stone {
  background: #9a9188;
}

.dbp-team-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--dbp-ink-2);
  flex: 1;
  min-width: 0;
}

.dbp-team-role {
  font-size: 11px;
  color: var(--dbp-ink-4);
  white-space: nowrap;
}

.dbp-team-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--dbp-rule-strong);
  background: var(--dbp-bg-inset);
  color: var(--dbp-ink-3);
}

.dbp-team-status-text {
  color: var(--dbp-ink-4);
}

.dbp-team-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
  opacity: 0.65;
}

.dbp-team-status--recent {
  background: rgba(26, 24, 21, 0.035);
  color: var(--dbp-ink-2);
  border-color: rgba(26, 24, 21, 0.08);
}

.dbp-team-status--recent .dbp-team-dot {
  opacity: 0.75;
}

.dbp-team-status--stale {
  color: var(--dbp-ink-3);
}

.dbp-team-status--unknown,
.dbp-team-status--inactive {
  color: var(--dbp-ink-4);
  opacity: 0.92;
}

.dbp-team-status--inactive .dbp-team-dot,
.dbp-team-status--unknown .dbp-team-dot,
.dbp-team-status--stale .dbp-team-dot {
  opacity: 0.5;
}

.dbp-team-empty {
  padding: 12px 8px 4px;
  color: var(--dbp-ink-4);
  font-size: 12px;
}

@media (max-width: 1366px) {
  .dbp-status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dbp-content-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "quick"
      "field"
      "workspace"
      "recent";
  }

  .dbp-content-grid--compact {
    grid-template-areas:
      "quick"
      "field"
      "recent";
  }

  .dbp-card--quick-actions {
    order: 1;
  }

  .dbp-card--field-work {
    order: 2;
  }

  .dbp-card--workspace {
    order: 3;
  }

  .dbp-card--recent-inspections {
    order: 4;
  }
}

@media (max-width: 1024px) {
  .dbp-field-cols {
    grid-template-columns: 1fr;
  }

  .dbp-field-col--divided {
    border-left: none;
    border-top: 1px solid var(--dbp-rule);
  }

  .dbp-table-wrap {
    overflow-x: auto;
  }

  .dbp-table-scroll-hint {
    display: block;
    margin: 0 0 10px;
    font-size: 11px;
    color: var(--dbp-ink-4);
  }
}

@media (max-width: 900px) {
  .dbp-page-header {
    padding-top: 18px;
    flex-direction: column;
    align-items: stretch;
  }

  .dbp-page-header__right {
    justify-content: flex-start;
  }

  .dbp-status-strip {
    display: flex;
    gap: 12px;
    padding: 18px 0 20px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--dbp-rule-strong) transparent;
    scroll-snap-type: x proximity;
  }

  .dbp-status-strip::-webkit-scrollbar {
    height: 7px;
  }

  .dbp-status-strip::-webkit-scrollbar-thumb {
    background: var(--dbp-rule-strong);
    border-radius: 999px;
  }

  .dbp-status-strip::-webkit-scrollbar-track {
    background: transparent;
  }

  .dbp-status-strip .dbp-stat-card {
    flex: 0 0 min(240px, 76vw);
    scroll-snap-align: start;
  }

  .dbp-status-strip-hint {
    display: block;
    margin: -8px 0 18px;
    font-size: 11px;
    color: var(--dbp-ink-4);
  }

  .dbp-content-grid {
    display: flex;
    flex-direction: column;
  }

  .dbp-card--quick-actions {
    order: 1;
  }

  .dbp-card--field-work {
    order: 2;
  }

  .dbp-card--workspace {
    order: 3;
  }

  .dbp-card--recent-inspections {
    order: 4;
  }

  .dbp-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dbp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dbp-table thead {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    border: 0;
  }

  .dbp-table {
    min-width: 640px;
    table-layout: auto;
  }

  .dbp-table tbody {
    display: table-row-group;
  }

  .dbp-table tbody tr {
    display: table-row;
  }

  .dbp-table tbody td {
    display: table-cell;
    width: auto;
    padding-top: 10px;
    padding-bottom: 10px;
    vertical-align: top;
  }

  .dbp-table-label {
    display: none;
  }

  .dbp-team-member {
    flex-wrap: wrap;
    align-items: center;
  }

  .dbp-team-name {
    flex: 1 1 auto;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .dashboard-proto .trial-banner--actions {
    flex-direction: column;
    align-items: stretch;
    position: static;
  }

  .dashboard-proto .trial-banner__content {
    min-width: 0;
    width: 100%;
  }

  .dashboard-proto .trial-banner__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .dashboard-proto .trial-banner__actions form {
    display: block;
    width: 100%;
  }

  .dashboard-proto .trial-banner__actions .btn,
  .dashboard-proto .trial-banner__actions > .btn {
    width: 100%;
    justify-content: center;
  }
}

/* --- Inspector subtitle --- */
.dbp-page-sub {
  font-size: 13px;
  color: var(--dbp-ink-4);
  margin: 4px 0 0;
}

/* --- Clickable stat cards (inspector links) --- */
a.dbp-stat-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

a.dbp-stat-card:hover {
  box-shadow: var(--dbp-shadow-md);
  border-color: var(--dbp-rule-strong);
}

/* --- Inspector mobile card order: field work first --- */
@media (max-width: 900px) {
  .dbp-content-grid--compact .dbp-card--field-work { order: 1; }
  .dbp-content-grid--compact .dbp-card--quick-actions { order: 2; }
  .dbp-content-grid--compact .dbp-card--recent-inspections { order: 3; }
}

/* --- Recent inspections: card-ify on phones --- */
@media (max-width: 600px) {
  .dbp-table {
    min-width: 0;
    table-layout: auto;
  }

  .dbp-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  .dbp-table tbody {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .dbp-table tbody tr {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--dbp-rule);
    border-radius: 10px;
    padding: 12px 14px;
    background: var(--dbp-bg-card);
  }

  .dbp-table tbody td {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    border: none;
    width: auto;
  }

  .dbp-table-label {
    display: inline;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dbp-ink-4);
    min-width: 70px;
    flex-shrink: 0;
  }

  .dbp-table-scroll-hint {
    display: none;
  }

  .dbp-td-prop-name {
    font-weight: 600;
  }

  .dbp-td-prop-sub {
    display: block;
    font-size: 12px;
    color: var(--dbp-ink-4);
  }
}

/* --- Dark mode: phone table cards --- */
@media (max-width: 600px) {
  html[data-theme="dark"] .dbp-table tbody tr {
    background: var(--card);
    border-color: var(--border);
  }

  html[data-theme="dark"] .dbp-table tbody td {
    border: none;
    color: var(--text);
  }

  html[data-theme="dark"] a.dbp-stat-card:hover {
    border-color: var(--border-strong, var(--border));
  }
}

/* --- Dark mode: dashboard table cards on mobile --- */
@media (max-width: 900px) {
  html[data-theme="dark"] .dbp-table-wrap {
    scrollbar-color: var(--border) transparent;
  }

  html[data-theme="dark"] .dbp-status-strip {
    scrollbar-color: var(--border-strong, var(--border)) transparent;
  }

  html[data-theme="dark"] .dbp-table tbody td {
    border-bottom-color: rgba(71, 85, 105, 0.4);
    color: var(--text);
  }
}
