body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: #eef2f7;
  color: #172033;
  overflow-x: hidden;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(180deg, #eef2f7 0%, #f7f9fc 100%);
}

.sidebar {
  width: 248px;
  background: #1a2233;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.sidebar-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  font-weight: 700;
}

.sidebar-brand-subtitle {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 2px;
}

.sidebar-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 10px;
}

/* Grouped role-aware nav (UI product brain Phase 1). */
.sidebar-nav-group {
  margin-bottom: 16px;
}

.sidebar-group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin: 0 0 6px 4px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #cbd5e1;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(99, 102, 241, 0.18);
  color: #fff;
  box-shadow: inset 3px 0 0 #6366f1;
}

.sidebar-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(148, 163, 184, 0.12);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
}

.sidebar-user {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #e2e8f0;
  margin-bottom: 12px;
}

.sidebar-user span {
  color: #94a3b8;
  font-size: 12px;
}

/* Trial/plan status chip in the sidebar footer (UI product brain Phase 1). */
.sidebar-tenant-status {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.sidebar-status-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.sidebar-status-value {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.content-area {
  flex: 1;
  min-width: 0;
}

.topbar-slim {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px 0;
}

.topbar-page-label {
  color: #64748b;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Platformbeheer chrome — visual separation between the SaaS admin
   surface and the tenant CRM (platform-admin vs tenant-user). */
.platform-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-section-label--platform {
  color: #a5b4fc;
}

.sidebar-platform-note {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.10);
  color: #a5b4fc;
  font-size: 11px;
  line-height: 1.5;
}

.sidebar-brand-platform .sidebar-brand-mark {
  background: linear-gradient(135deg, #4b5563 0%, #1f2937 100%);
}

/* Platform Admin shell (v1): the subtle "own company" escape link in the
   platform sidebar footer — shown only for platform admins who also own
   a tenant, kept small so it never dominates the platform UI. */
.sidebar-escape-link {
  display: block;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-escape-link:hover {
  background: rgba(99, 102, 241, 0.22);
  color: #fff;
}

.sidebar-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #fff;
  color: #1a2233;
  border: 1px solid #dbe3eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-shell {
  width: 100%;
  max-width: 520px;
}

.auth-card {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.auth-card-wide {
  max-width: 640px;
}

.auth-card h1 {
  margin-top: 0;
  margin-bottom: 8px;
}

.auth-kicker {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f766e;
}

.auth-card p {
  color: #6b7280;
  margin-bottom: 18px;
}

.auth-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.text-link {
  color: #0f4c81;
  text-decoration: none;
  font-weight: 600;
}

.text-link:hover {
  text-decoration: underline;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  background: #0f4c81;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.secondary-button {
  background: #fff;
  color: #0f4c81;
  border: 1px solid #c8d4e3;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: #1f2937;
  color: #fff;
  gap: 16px;
}

.brand {
  font-weight: 700;
  font-size: 18px;
}

.nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.nav a {
  color: #dbe4ee;
  text-decoration: none;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.userbar-name {
  font-weight: 700;
}

.userbar-role {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.logout-form {
  margin: 0;
}

.logout-button {
  background: #475569;
}

.page {
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0 0 6px 0;
}

.page-header p {
  margin: 0;
  color: #666;
}

.dashboard-period {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  padding: 14px 16px;
  border: 1px solid #dde3ea;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #f6f9fc 100%);
}

.dashboard-period-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.dashboard-period-picker {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  position: relative;
}

.dashboard-period-menu {
  position: relative;
}

.dashboard-period-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
}

.dashboard-period-menu summary::-webkit-details-marker {
  display: none;
}

.dashboard-period-menu[open] summary {
  border-color: #6366f1;
  box-shadow: 0 14px 32px rgba(99, 102, 241, 0.16);
}

.dashboard-period-caret {
  color: #64748b;
  font-size: 12px;
}

.dashboard-period-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: min(320px, 80vw);
  padding: 14px;
  border: 1px solid #d8e0ea;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.16);
}

.dashboard-period-menu-header {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.business-kpi-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.business-kpi-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dbe4ee;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.business-kpi-card:hover {
  border-color: #bfd0e8;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.09);
  transform: translateY(-1px);
}

.business-kpi-card-wide {
  grid-column: span 4;
}

.business-kpi-alert {
  border-color: #fecaca;
  background: linear-gradient(180deg, #ffffff 0%, #fff7f7 100%);
}

.business-kpi-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 700;
}

.business-kpi-value {
  font-size: 36px;
  line-height: 1;
  font-weight: 700;
  color: #0f172a;
}

.business-kpi-value-money {
  font-size: 30px;
}

.business-kpi-footnote {
  color: #64748b;
  font-size: 13px;
}

.action-center-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border-color: #d7e6f7;
}

.dashboard-briefing {
  gap: 16px;
}

.summary-highlight-subtle {
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
  border: 1px solid #dbe4ee;
}

.margin-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.margin-chip-low {
  background: #fef2f2;
  color: #b91c1c;
}

.margin-chip-mid {
  background: #fff7ed;
  color: #c2410c;
}

.margin-chip-high {
  background: #ecfdf5;
  color: #047857;
}

.quarter-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btw-rubric-grid > div {
  padding: 12px 0;
}

.btw-rubric-total {
  grid-column: 1 / -1;
  border-top: 1px solid #dbe4ee;
  padding-top: 16px;
}

.print-panel {
  break-inside: avoid;
}

@media print {
  .sidebar,
  .topbar-slim,
  .actions,
  .flash-stack,
  .sidebar-toggle {
    display: none !important;
  }

  .content-area,
  .page,
  .app-shell {
    background: #fff !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .panel,
  .business-kpi-card,
  .quarter-card {
    box-shadow: none !important;
    break-inside: avoid;
  }

  a {
    color: inherit !important;
    text-decoration: none !important;
  }
}

.dashboard-period-year + .dashboard-period-year {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eef2f7;
}

.dashboard-period-year-label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dashboard-period-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-period-link {
  display: block;
  padding: 9px 10px;
  border-radius: 10px;
  color: #1e293b;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.dashboard-period-link:hover {
  background: #f1f5f9;
}

.dashboard-period-link.active {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  font-weight: 700;
}

.split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.two-column {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 20px;
}

.stack-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.full-width {
  grid-column: 1 / -1;
}

.panel {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 18px;
}

.compact-panel {
  padding: 14px 18px;
}

.top-space {
  margin-top: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.stats-grid-dashboard {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.dashboard-stack {
  gap: 20px;
}

.bookkeeping-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.summary-block {
  padding: 14px 0;
  border-top: 1px solid #eceff3;
}

.summary-block:first-child {
  border-top: none;
  padding-top: 0;
}

.summary-block h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

.summary-highlight {
  background: #f8fafc;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.summary-highlight-purple {
  background: linear-gradient(135deg, #f7f0ff 0%, #f2f8ff 100%);
  border-color: #d9c9f8;
}

.summary-kpi {
  font-size: 32px;
  font-weight: 700;
  color: #5b21b6;
  margin: 8px 0 10px;
}

.summary-pairs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.summary-pairs div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.summary-pairs span {
  color: #6b7280;
  font-size: 13px;
}

.summary-pairs strong {
  font-size: 20px;
}

.summary-pairs-strong strong {
  color: #111827;
}

.summary-note {
  margin: 14px 0 0;
}

.stat-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 18px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  border-color: #cbd5e1;
}

.stat-label {
  color: #6b7280;
  margin-bottom: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-value-small {
  font-size: 22px;
}

.stat-card-alert {
  border-color: #fca5a5;
  background: #fef2f2;
}

.stat-card-revenue {
  border-left: 3px solid #6366f1;
}

.stat-card-cost {
  border-left: 3px solid #10b981;
}

.stat-card-profit {
  border-left: 3px solid #f59e0b;
}

.stat-trend {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

.trend-up {
  color: #15803d;
}

.trend-down {
  color: #b91c1c;
}

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

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #eceff3;
  vertical-align: top;
}

.table th {
  font-size: 13px;
  color: #5b6470;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.inline-search input,
.inline-search select {
  border: 1px solid #cfd6de;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.full {
  grid-column: 1 / -1;
}

.actions,
.status-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.compact-form {
  gap: 6px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 10px 14px;
  background: #1f5fbf;
  color: #fff;
  text-decoration: none;
}

.link-button-active {
  background: #123d7b;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}

button {
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  background: #1f5fbf;
  color: #fff;
  cursor: pointer;
  font: inherit;
}

.danger-button {
  background: #b91c1c;
}

button:disabled {
  background: #9ca3af;
  cursor: default;
}

.inline-search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  text-decoration: none;
}

.tab-link.is-active {
  background: #1f5fbf;
  color: #fff;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #e5e7eb;
}

.badge-concept,
.badge-verstuurd,
.badge-on_hold {
  background: #ede9fe;
  color: #4c1d95;
}

.badge-geaccepteerd {
  background: #dcfce7;
  color: #166534;
}

.badge-afgewezen {
  background: #fee2e2;
  color: #991b1b;
}

.badge-job-gepland {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-job-actief {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-job-afgerond {
  background: #dcfce7;
  color: #166534;
}

.badge-job-gefactureerd {
  background: #fef3c7;
  color: #92400e;
}

.badge-invoice-concept {
  background: #e5e7eb;
  color: #374151;
}

.badge-invoice-verstuurd {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-invoice-deels_betaald {
  background: #ede9fe;
  color: #6d28d9;
}

.badge-invoice-betaald {
  background: #dcfce7;
  color: #166534;
}

.badge-invoice-herinnering_1,
.badge-invoice-herinnering_2 {
  background: #ffedd5;
  color: #c2410c;
}

.badge-invoice-te_laat {
  background: #fee2e2;
  color: #991b1b;
}

/* Epic E9 — invoice/payment UX polish (private beta) */
.payment-status-panel {
  margin-bottom: 20px;
}

.payment-status-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.payment-status-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.payment-status-badge {
  font-size: 14px;
  font-weight: 700;
  padding: 8px 14px;
}

.payment-status-line {
  font-size: 15px;
}

.payment-status-note {
  margin: 0;
  padding: 12px 14px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 10px;
  color: #78350f;
  font-size: 14px;
  line-height: 1.5;
}

.invoice-list-paid-at {
  font-size: 12px;
  margin-top: 3px;
}

.invoice-empty-state {
  padding: 18px 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.invoice-empty-state p {
  margin: 0;
}


.detail-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  margin: 0;
}

.detail-list.single-column {
  grid-template-columns: 1fr;
}

.detail-list div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-list dt {
  font-size: 12px;
  color: #6b7280;
}

.detail-list dd {
  margin: 0;
}

.stack-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stack-list li {
  padding: 10px 0;
  border-bottom: 1px solid #eceff3;
}

.muted {
  color: #6b7280;
}

.text-danger {
  color: #b91c1c;
  font-weight: 700;
}

.missing-info-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 8px;
  border-radius: 999px;
  background: #b91c1c;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.placeholder-box {
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
}

.pdf-frame {
  width: 100%;
  min-height: 720px;
  border: 1px solid #dbe3eb;
  border-radius: 8px;
  background: #f8fafc;
}

.mini-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  min-height: 240px;
  padding: 12px 0 4px;
}

.mini-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mini-chart-bars {
  height: 200px;
  width: 100%;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 8px;
  padding: 0 4px;
}

.mini-bar {
  width: 24px;
  min-height: 8px;
  border-radius: 10px 10px 4px 4px;
}

.mini-bar-omzet {
  background: linear-gradient(180deg, #7c3aed 0%, #5b21b6 100%);
}

.mini-bar-kosten {
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
}

.mini-chart-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
}

.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: #475569;
  font-size: 13px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 8px;
}

.legend-dot-omzet {
  background: #6d28d9;
}

.legend-dot-kosten {
  background: #16a34a;
}

.workplan-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.progress-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar-fill {
  height: 100%;
  background: #2563eb;
}

.workplan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workplan-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #dbe3eb;
  border-radius: 8px;
  background: #fff;
}

.workplan-item.is-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.checkbox-button {
  min-width: 42px;
  background: #0f172a;
}

.workplan-toggle {
  margin: 0;
}

.workplan-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.template-block {
  padding: 16px 0;
  border-bottom: 1px solid #e5e7eb;
}

.template-block h3 {
  margin: 0 0 4px 0;
}

.flash-stack {
  margin-bottom: 16px;
}

.flash {
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.flash-success {
  background: #dcfce7;
  color: #166534;
}

.flash-error {
  background: #fee2e2;
  color: #991b1b;
}

.chart-wrap {
  position: relative;
  height: 260px;
}

.funnel-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}

.funnel-stage {
  min-width: 140px;
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
}

.funnel-stage-count {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
}

.funnel-stage-label {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
}

.funnel-arrow {
  align-self: center;
  color: #94a3b8;
  font-size: 22px;
  font-weight: 700;
}

.aging-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aging-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.aging-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.aging-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.aging-dot-ok {
  background: #16a34a;
}

.aging-dot-warn {
  background: #f59e0b;
}

.aging-dot-alert {
  background: #dc2626;
}

.aging-count {
  color: #64748b;
  font-weight: 700;
}

.aging-amount {
  font-weight: 700;
  color: #111827;
}

.dso-kpi {
  font-size: 36px;
  font-weight: 700;
  margin: 10px 0 14px;
}

.dso-kpi-ok {
  color: #15803d;
}

.dso-kpi-warn {
  color: #b45309;
}

.dso-kpi-alert {
  color: #b91c1c;
}

.qoq-panel {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.qoq-panel h3 {
  margin: 0 0 12px 0;
  font-size: 15px;
}

.qoq-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.qoq-label {
  color: #64748b;
}

.qoq-value {
  font-weight: 700;
}

.action-center-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-item {
  display: block;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  text-decoration: none;
  color: inherit;
}

.action-item:hover {
  border-color: #c7d2fe;
  background: #f8faff;
}

.action-alert {
  border-left: 4px solid #dc2626;
}

.action-warn {
  border-left: 4px solid #f59e0b;
}

.action-info {
  border-left: 4px solid #2563eb;
}

.action-item-title {
  font-weight: 700;
  color: #111827;
}

.action-item-meta {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.todo-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #dbe3eb;
  border-radius: 12px;
  background: #fff;
}

.todo-item.is-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.todo-title {
  font-weight: 700;
  color: #111827;
}

.todo-item.is-done .todo-title {
  text-decoration: line-through;
  color: #4b5563;
}

.todo-meta {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
}

.bookkeeping-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quarter-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quarter-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.quarter-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.quarter-card-label {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
}

.quarter-card-range {
  color: #64748b;
  font-size: 13px;
}

.quarter-card-link {
  text-decoration: none;
  color: #4f46e5;
  font-weight: 600;
}

.quarter-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quarter-card-metrics span,
.category-breakdown-meta {
  color: #64748b;
  font-size: 13px;
}

.quarter-card-metrics strong,
.category-breakdown-amounts strong {
  display: block;
  margin-top: 4px;
  color: #111827;
}

.category-breakdown-list,
.bookkeeping-note-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-breakdown-row,
.bookkeeping-note {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.category-breakdown-main,
.category-breakdown-amounts {
  display: flex;
  flex-direction: column;
}

.category-breakdown-title,
.bookkeeping-note strong {
  font-weight: 700;
  color: #111827;
}

.category-breakdown-amounts {
  align-items: flex-end;
  color: #64748b;
  font-size: 13px;
}

.bookkeeping-note {
  align-items: flex-start;
  flex-direction: column;
}

.bookkeeping-note span {
  color: #64748b;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.kpi-chip {
  border: 1px solid #dbe3f0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fbff;
}

.kpi-chip-label {
  display: block;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.top-space-small {
  margin-top: 12px;
}

.qoq-up {
  color: #15803d;
}

.qoq-down {
  color: #b91c1c;
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .business-kpi-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .business-kpi-card,
  .business-kpi-card-wide {
    grid-column: span 3;
  }

  .two-column,
  .bookkeeping-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .bookkeeping-kpi-grid,
  .quarter-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 30;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: inline-grid;
    place-items: center;
  }

  .topbar-slim {
    padding: 14px 16px 0;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .userbar {
    width: 100%;
    justify-content: flex-start;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .page {
    padding: 16px;
  }

  .split {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-grid,
  .form-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .summary-pairs {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .actions,
  .status-actions,
  .inline-form,
  .inline-search {
    flex-direction: column;
    align-items: stretch;
  }

  .actions > *,
  .status-actions > *,
  .inline-form > *,
  .inline-search > * {
    width: 100%;
  }

  .link-button,
  button {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .pdf-frame {
    min-height: 460px;
  }

  .workplan-item {
    flex-direction: column;
  }

  .checkbox-button {
    width: 100%;
  }

  .mini-chart {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: auto;
  }

  .mini-chart-bars {
    height: 150px;
  }

  .funnel-row {
    flex-direction: column;
  }

  .funnel-arrow {
    display: none;
  }

  .aging-row {
    grid-template-columns: 1fr;
  }

  .category-breakdown-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .category-breakdown-amounts {
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .business-kpi-grid {
    grid-template-columns: 1fr;
  }

  .business-kpi-card,
  .business-kpi-card-wide {
    grid-column: span 1;
  }

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .table thead,
  .table tbody,
  .table tr {
    white-space: nowrap;
  }

  .tab-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .tab-row::-webkit-scrollbar {
    display: none;
  }

  .tab-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .stat-value {
    font-size: 24px;
  }

  .stat-value-small {
    font-size: 20px;
  }

  .page-header h1 {
    font-size: 28px;
  }

  .mini-chart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-bar {
    width: 18px;
  }
}

/* --- UI product brain Phase 1: tenant dashboard SaaS-awareness ---------- */
/* --- Epic E2: trial journey + guided first-run (private beta) ---------- */

/* Trial banner (informational only — billing stays out of access gating). */
.trial-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border-left: 3px solid #1a56db;
  margin-bottom: 18px;
}

.trial-banner-mark {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #1a56db;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.trial-banner-body {
  min-width: 0;
}

.trial-banner-text {
  margin: 0;
  font-size: 14px;
  color: #3f4750;
}

.trial-banner-text strong {
  color: #172033;
}

.trial-banner-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: #6b7280;
}

/* First-run onboarding checklist (data-derived, success state when done). */
.onboarding-checklist {
  margin-bottom: 18px;
}

.onboarding-progress {
  height: 6px;
  margin: 4px 0 14px;
  border-radius: 999px;
  background: #eef1f5;
  overflow: hidden;
}

.onboarding-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1a56db, #0f766e);
  transition: width 0.3s ease;
}

.onboarding-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.onboarding-step:hover {
  background: #f1f5f9;
}

.onboarding-step a {
  color: #172033;
  text-decoration: none;
  font-weight: 500;
}

.onboarding-step a:hover {
  text-decoration: underline;
}

.onboarding-step-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.onboarding-step-title {
  color: #172033;
  font-weight: 600;
  font-size: 14px;
}

.onboarding-step-hint {
  color: #6b7280;
  font-size: 12px;
}

.onboarding-check {
  flex: 0 0 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef1f5;
  color: #3f4750;
  font-size: 12px;
  font-weight: 700;
}

.onboarding-step.is-done .onboarding-check {
  background: #e6f4ea;
  color: #1e7e34;
}

.onboarding-step.is-done .onboarding-step-title {
  color: #5b6470;
  text-decoration: line-through;
}

.onboarding-step-status {
  margin-left: auto;
  font-size: 12px;
  flex: 0 0 auto;
}

.onboarding-step-cta {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 5px 12px;
  border-radius: 999px;
  background: #1a56db;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.onboarding-step-cta:hover {
  background: #1747b5;
  text-decoration: none;
}

.onboarding-step-cta-placeholder {
  background: #eef1f5;
  color: #6b7280;
  font-weight: 500;
}

/* Company-setup card: which business-profile fields are still missing. */
.company-setup-card {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed #c7d2e3;
  border-radius: 10px;
  background: #f8fbff;
}

.company-setup-heading {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.company-setup-missing {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.company-setup-missing li {
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef1f5;
  color: #3f4750;
  font-size: 12px;
}

.company-setup-note {
  margin: 0;
  font-size: 12px;
}

/* Compact success state once every first-run step is done. */
.onboarding-success {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  border-left: 3px solid #1e7e34;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbf7 100%);
}

.onboarding-success h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.onboarding-success p {
  margin: 0;
  font-size: 13px;
}

.onboarding-success-mark {
  flex: 0 0 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e6f4ea;
  color: #1e7e34;
  font-size: 14px;
  font-weight: 700;
}

/* Action-centre empty state for a brand-new tenant (concrete next steps). */
.action-center-empty {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-center-empty p {
  margin: 0;
}

.action-center-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Sidebar footer note under the trial chip (where the plan will live). */
.sidebar-status-note {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: #94a3b8;
}

/* Auth pages: short benefit list under the signup intro. */
.auth-benefits {
  margin: 0 0 16px;
  padding-left: 18px;
  color: #3f4750;
  font-size: 13px;
  line-height: 1.7;
}

/* ------------------------------------------------------------------ */
/* Platform Admin shell v1 — shared styles for the SaaS owner pages.   */
/* Aggregate-only control-panel chrome (formerly scoped inside the     */
/* cockpit template; now shared by every /platform-admin HTML page).   */
/* ------------------------------------------------------------------ */
.pa-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pa-cockpit-table {
  width: 100%;
  min-width: 1020px;
  table-layout: fixed;
  display: table;
  border-collapse: collapse;
}
.pa-cockpit-table th,
.pa-cockpit-table td {
  padding: 10px 10px;
  vertical-align: top;
  overflow-wrap: break-word;
  white-space: normal;
}
.pa-cockpit-table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5b6470;
  border-bottom: 2px solid #d9e0e8;
  white-space: nowrap;
}
.pa-cockpit-table tbody tr:nth-child(even) { background: #f8fafc; }
.pa-cockpit-table tbody tr:hover { background: #eef4ff; }

.pa-c-id { width: 4.5%; }
.pa-c-tenant { width: 17%; }
.pa-c-status { width: 8%; }
.pa-c-members { width: 6.5%; }
.pa-c-roles { width: 12%; }
.pa-c-sub { width: 13%; }
.pa-c-trial { width: 8.5%; }
.pa-c-num { width: 4.5%; }
.pa-c-storage { width: 7.5%; }

.pa-id { color: #5b6470; font-size: 12px; }
.pa-tenant-name { font-weight: 600; }
.pa-tenant-links { margin-top: 2px; font-size: 12px; }
.pa-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.pa-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  background: #eef1f5;
  color: #3f4750;
}
.pa-badge-active { background: #e6f4ea; color: #1e7e34; }
.pa-badge-trial { background: #e8f0fe; color: #1a56db; }
.pa-badge-trial_expired { background: #fef3e2; color: #b45309; }
.pa-badge-suspended { background: #fde8e8; color: #b91c1c; }
/* Epic E14 — tenant-kind badges (derived from name/slug, no stored type). */
.pa-badge-bootstrap { background: #eef0f3; color: #4b5563; }
.pa-badge-demo { background: #fdf1e7; color: #9a5b13; }
.pa-badge-test { background: #f4ecfb; color: #6b21a8; }
.pa-badge-pilot { background: #e8f0fe; color: #1a56db; }

.pa-role {
  display: inline-block;
  margin: 1px 2px 1px 0;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  background: #eef1f5;
  color: #3f4750;
  white-space: nowrap;
}
.pa-role.pa-zero { opacity: 0.55; }

.pa-privacy { border-left: 3px solid #9db4d8; }
.pa-privacy-text { margin: 0; font-size: 13px; color: #3f4750; }

/* SaaS overview cards (UI product brain Phase 2a) — aggregates only. */
.pa-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.pa-summary-card {
  background: #fff;
  border: 1px solid #d9e0e8;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pa-summary-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: #172033; }
.pa-summary-label { font-size: 12px; color: #5b6470; text-transform: uppercase; letter-spacing: 0.04em; }
.pa-summary-card--warn .pa-summary-value { color: #b45309; }
.pa-summary-card--danger .pa-summary-value { color: #b91c1c; }

/* Epic E8a: config-preflight issue list on the Experimenten page. */
.pa-issue-list {
  margin: 0;
  padding-left: 18px;
  color: #b45309;
  font-size: 14px;
}
.pa-issue-list li + li {
  margin-top: 4px;
}

/* =========================================================================
   UI/UX epic E1 — platform control room: buttons, filters, detail page,
   confirm dialogs, quota meters, notices. Matches the existing pa-* look
   (same palette); no framework, no new assets.
   ========================================================================= */

/* Buttons (new .btn family — the shared chrome uses bare `button` styles;
   these let the platform pages compose variants without touching those). */
.btn {
  display: inline-block;
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  background: #1f5fbf;
  color: #fff;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn-primary { background: #1f5fbf; }
.btn-danger { background: #b91c1c; }
.btn-sm { padding: 5px 9px; font-size: 12px; border-radius: 5px; }
.btn[disabled] { background: #9ca3af; cursor: default; filter: none; }

/* Filter bar (plain GET forms on the platform list/audit pages). */
.pa-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 14px;
  background: #f4f7fb;
  border: 1px solid #e1e7ef;
  border-radius: 8px;
  margin-bottom: 14px;
}
.pa-filter-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #5b6470; }
.pa-filter-field input,
.pa-filter-field select {
  padding: 7px 9px;
  border: 1px solid #c9d3e0;
  border-radius: 6px;
  font: inherit;
  background: #fff;
  color: #172033;
}
.pa-filter-field input[type="number"] { width: 110px; }
.pa-filter-field input[type="date"] { width: 150px; }
.pa-filter-reset { align-self: center; font-size: 13px; color: #1a56db; }

/* Breadcrumb / detail-page header. */
.pa-crumbs { margin-bottom: 6px; font-size: 13px; }
.pa-crumbs a { color: #1a56db; text-decoration: none; }
.pa-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pa-detail-header h1 { margin: 0 0 2px; }
.pa-detail-badges { display: flex; gap: 6px; }

/* Access-state banner (one-line lifecycle explanation). */
.pa-banner {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  border-left: 4px solid #1e7e34;
  background: #eef7f1;
  color: #1d3b27;
}
.pa-banner-trial { border-left-color: #1a56db; background: #eef3fe; color: #16336f; }
.pa-banner-trial_expired { border-left-color: #b45309; background: #fdf4e6; color: #6b3a06; }
.pa-banner-suspended { border-left-color: #b91c1c; background: #fdeeee; color: #6f1212; }

/* Lifecycle action bar. */
.pa-action-bar { display: flex; flex-wrap: wrap; gap: 8px; }

/* Detail info grid (subscription/trial block). */
.pa-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.pa-detail-item { display: flex; flex-direction: column; gap: 2px; }
.pa-detail-label { font-size: 12px; color: #5b6470; text-transform: uppercase; letter-spacing: 0.04em; }
.pa-detail-value { font-size: 15px; font-weight: 600; color: #172033; }

/* Confirm dialogs (native <dialog>). */
.pa-dialog {
  border: none;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);
  padding: 20px 22px;
  max-width: 460px;
  width: calc(100vw - 40px);
  color: #172033;
}
.pa-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.pa-dialog h3 { margin: 0 0 8px; }
.pa-dialog-body { margin: 0 0 12px; font-size: 14px; color: #3f4750; }
.pa-dialog-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.pa-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Quota meters (usage page / detail page). */
.pa-meter {
  background: #e8edf4;
  border-radius: 999px;
  height: 8px;
  width: 120px;
  overflow: hidden;
}
.pa-meter-fill { height: 100%; border-radius: 999px; }
.pa-meter-ok { background: #1e7e34; }
.pa-meter-warn { background: #b45309; }
.pa-meter-label { font-size: 12px; color: #3f4750; margin-top: 3px; font-variant-numeric: tabular-nums; }
.pa-c-meter { width: 11%; }

/* One-time result notice (webhook plaintext / action results). */
.pa-notice {
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  background: #e6f4ea;
  border-left: 4px solid #1e7e34;
  color: #1d3b27;
  word-break: break-all;
}
.pa-notice-error { background: #fdeeee; border-left-color: #b91c1c; color: #6f1212; }
.pa-notice-warn { background: #fdf4e6; border-left-color: #b45309; color: #6b3a06; }
.pa-notice-hidden { display: none; }

/* Epic E3 — tenant "Mijn plan" page + dashboard entry card. */
.mijn-plan-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
}
.mijn-plan-main,
.mijn-plan-side {
  display: grid;
  gap: 20px;
  align-content: start;
}
.mijn-plan-countdown {
  font-size: 17px;
  line-height: 1.5;
}
.mijn-plan-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 12px;
}
.mijn-plan-cta {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
}
/* CTA placeholders: clearly visible but not clickable — the real
   surfaces (plan catalog, support channel, checkout) land in the next
   step, so no dead links and no faked checkout are ever rendered. */
.mijn-plan-cta-placeholder {
  border: 1px dashed #b6c2d1;
  color: #64748b;
  background: #f8fafc;
  cursor: default;
}
.seat-meter {
  height: 8px;
  border-radius: 999px;
  background: #e8edf3;
  overflow: hidden;
  margin: 8px 0 12px;
  max-width: 320px;
}
.seat-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: #1d4ed8;
}
.badge-plan-trial { background: #dbeafe; color: #1d4ed8; }
.badge-plan-active { background: #dcfce7; color: #166534; }
.badge-plan-past_due { background: #fee2e2; color: #991b1b; }
.badge-plan-canceled { background: #e5e7eb; color: #374151; }

/* Dashboard "Mijn plan" entry card (owner/admin only). */
.plan-card { margin-top: 20px; }
.plan-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.plan-card-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 2px;
}

/* Epic E9 — dashboard invoice-status card (distinct classes so the
   plan-card visibility contract stays unambiguous for employees). */
.invoice-status-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.invoice-status-card-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 2px;
}

/* =====================================================================
   Epic E11 — jobs/uren/receipts clarity (2026-08-15)
   ---------------------------------------------------------------------
   Presentation-only helpers: the job "Wat is de volgende stap?"
   (werkstatus) panel, its attention list, the dashboard "Werk vandaag
   & admin aandacht" card, the uren summary chips and the honest
   receipt/OCR review states. No behavior/schema change.
   ===================================================================== */

/* Job detail — werkstatus panel */
.werkstatus-panel .werkstatus-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.werkstatus-statusline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.werkstatus-next {
  color: #334155;
  font-weight: 500;
}
.werkstatus-links {
  margin-top: 2px;
}
.werkstatus-attention {
  background: var(--c-surface-2, #f8fafc);
  border: 1px solid var(--c-border, #e2e8f0);
  border-radius: var(--r-md, 10px);
  padding: 12px 14px;
}
.werkstatus-attention-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 8px;
}
.werkstatus-attention-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.attention-item {
  border-radius: var(--r-sm, 6px);
  padding: 8px 10px;
  font-size: 14px;
}
.attention-item strong { font-weight: 600; }
.attention-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.attention-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

/* Job detail — uren summary chips */
.uren-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.uren-summary-note {
  margin-left: auto;
  font-size: 13px;
}

/* Dashboard — "Werk vandaag & admin aandacht" card */
.werk-vandaag-card { margin-top: 20px; }
.werk-vandaag-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.werk-vandaag-card-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 2px;
}
.werk-vandaag-card .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Receipts — honest OCR review note + file-state labels */
.receipt-review-note { margin-top: 16px; }
.receipt-review-note-body {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 14px;
  color: #475569;
}
.receipt-review-note-body strong {
  color: #92400e;
  white-space: nowrap;
}
.receipt-state-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.receipt-state-uploaded {
  background: #dcfce7;
  color: #166534;
  text-decoration: none;
}
.receipt-state-manual {
  background: #f1f5f9;
  color: #475569;
}

/* =====================================================================
   Epic E4 — Modern SaaS visual redesign / design-system pass (2026-08-12)
   ---------------------------------------------------------------------
   A serious visual foundation on top of the existing classes: design
   tokens (colors/spacing/radius/shadows/type), a refined app shell,
   platform-vs-tenant distinction, and polished cards/tables/buttons/
   badges/meters/banners. Presentation only — no route/auth/billing/
   tenant-isolation behavior changes, no external assets, no JS.
   ===================================================================== */

/* ---- 1. Design tokens ------------------------------------------------ */
:root {
  /* neutrals (slate scale) */
  --spc-50: #f8fafc;
  --spc-100: #f1f5f9;
  --spc-200: #e2e8f0;
  --spc-300: #cbd5e1;
  --spc-400: #94a3b8;
  --spc-500: #64748b;
  --spc-600: #475569;
  --spc-700: #334155;
  --spc-800: #1e293b;
  --spc-900: #0f172a;

  /* semantic color tokens */
  --c-bg: #f2f4f8;
  --c-surface: #ffffff;
  --c-surface-2: #f8fafc;
  --c-border: #e2e8f0;
  --c-border-strong: #cbd5e1;
  --c-text: #0f172a;
  --c-text-2: #475569;
  --c-text-3: #64748b;
  --c-primary: #1d4ed8;
  --c-primary-hover: #1e40af;
  --c-primary-soft: #eff6ff;
  --c-primary-border: #bfdbfe;
  --c-accent: #6366f1;
  --c-success: #16a34a;
  --c-success-soft: #f0fdf4;
  --c-warn: #d97706;
  --c-warn-soft: #fffbeb;
  --c-danger: #dc2626;
  --c-danger-soft: #fef2f2;

  /* spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.12);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.05);

  /* typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* layout */
  --sidebar-w: 256px;
  --content-max: 1500px;
  --ease: 150ms ease;
}

/* ---- 2. Global base -------------------------------------------------- */
body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  letter-spacing: -0.015em;
  color: var(--c-text);
}

a {
  color: var(--c-primary);
}

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

::selection {
  background: rgba(99, 102, 241, 0.22);
}

/* ---- 3. App shell ---------------------------------------------------- */
.app-shell {
  background: linear-gradient(180deg, var(--c-bg) 0%, #f8fafc 100%);
}

.content-area {
  min-width: 0;
}

/* Topbar: a slim, crisp page-context bar instead of a floating label. */
.topbar-slim {
  padding: 14px 32px 14px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.topbar-page-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--c-text-3);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.topbar-page-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--c-primary);
  opacity: 0.85;
}

.platform-badge {
  padding: 5px 12px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.page {
  padding: 28px 32px 56px;
  max-width: var(--content-max);
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 6px;
}

.page-header p {
  max-width: 760px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-text-3);
}

/* ---- 4. Sidebar (tenant shell) --------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #141d31 0%, #101828 100%);
  padding: 20px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.sidebar-brand {
  margin-bottom: 26px;
  padding: 0 2px;
}

.sidebar-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  font-size: 15px;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.sidebar-brand strong {
  display: block;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  color: #f1f5f9;
}

.sidebar-brand-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--spc-400);
}

.sidebar-section-label {
  margin: 0 4px 10px;
  color: var(--spc-400);
  font-weight: 700;
}

.sidebar-nav-group {
  margin-bottom: 18px;
}

.sidebar-group-label {
  margin: 0 4px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--spc-400);
}

.sidebar-link {
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--spc-300);
  transition: background var(--ease), color var(--ease);
}

.sidebar-link:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #ffffff;
}

.sidebar-link.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.22) 0%, rgba(99, 102, 241, 0.08) 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--c-accent);
}

.sidebar-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--spc-400);
  transition: background var(--ease), color var(--ease);
}

.sidebar-link:hover .sidebar-icon {
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

.sidebar-link.active .sidebar-icon {
  background: rgba(129, 140, 248, 0.22);
  color: #c7d2fe;
}

/* Sidebar footer: separated by a hairline, user card with avatar. */
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.sidebar-user-initial {
  flex: 0 0 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.sidebar-user-meta strong {
  font-size: 13.5px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-meta > span {
  font-size: 12px;
  color: var(--spc-400);
}

.sidebar-tenant-status {
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(129, 140, 248, 0.25);
}

.sidebar-status-value {
  color: #e2e8f0;
}

.logout-button {
  border-radius: 8px;
  background: #334155;
  font-weight: 600;
}

.logout-button:hover {
  background: #3f4f66;
}

/* ---- 5. Platform shell distinction ----------------------------------- */
.app-shell--platform .sidebar {
  background: linear-gradient(180deg, #131a28 0%, #0c111c 100%);
  border-right-color: rgba(255, 255, 255, 0.04);
}

.app-shell--platform .sidebar-brand {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-shell--platform .sidebar-brand-mark {
  background: linear-gradient(135deg, #64748b 0%, #334155 100%);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.45);
}

.app-shell--platform .sidebar-section-label,
.app-shell--platform .sidebar-group-label {
  color: #8b9cbb;
}

.app-shell--platform .sidebar-link.active {
  background: linear-gradient(90deg, rgba(129, 140, 248, 0.20) 0%, rgba(129, 140, 248, 0.06) 100%);
  box-shadow: inset 3px 0 0 #818cf8;
}

.app-shell--platform .sidebar-link.active .sidebar-icon {
  background: rgba(129, 140, 248, 0.22);
  color: #c7d2fe;
}

.app-shell--platform .sidebar-platform-note {
  margin: 4px 2px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.20);
  color: #9db4dd;
  font-size: 11.5px;
  line-height: 1.55;
}

.app-shell--platform .topbar-page-label::before {
  background: #818cf8;
}

.app-shell--platform .sidebar-user {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.14);
}

.app-shell--platform .sidebar-user-initial {
  background: linear-gradient(135deg, #64748b, #334155);
}

.app-shell--platform .sidebar-escape-link {
  border-radius: 10px;
}

/* ---- 6. Panels, section headers, tables ------------------------------ */
.panel {
  border-radius: var(--r-lg);
  border-color: var(--c-border);
  box-shadow: var(--shadow-card);
  padding: 20px 22px;
  background: var(--c-surface);
}

.panel-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eef1f5;
}

.panel-header h2 {
  font-size: 16px;
  font-weight: 700;
}

.compact-panel {
  padding: 14px 18px;
}

.table {
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  vertical-align: top;
}

.table th {
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
}

.table td {
  padding: 11px 12px;
  font-size: 13.5px;
  border-bottom: 1px solid #eef1f5;
  color: var(--c-text-2);
}

.table tbody tr:hover td {
  background: #f8fafc;
}

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

/* Shared empty-state row (tables without rows). */
.table tbody td[colspan],
.pa-cockpit-table tbody td[colspan] {
  text-align: center;
  padding: 34px 16px;
  font-size: 14px;
  color: var(--c-text-3);
  background: #fbfcfe;
}

/* ---- 7. Buttons, tabs, badges ---------------------------------------- */
button,
.btn,
.link-button,
.button-link {
  border-radius: 8px;
  font-weight: 600;
  transition: background var(--ease), border-color var(--ease), box-shadow var(--ease);
}

button,
.link-button {
  background: var(--c-primary);
}

button:hover,
.link-button:hover {
  background: var(--c-primary-hover);
}

.btn-primary,
.btn {
  background: var(--c-primary);
}

.btn:hover,
.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-danger {
  background: var(--c-danger);
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* Secondary/ghost button for toolbar link rows (platform pages, dashboards). */
.btn-ghost {
  background: #ffffff;
  color: var(--c-text-2);
  border: 1px solid var(--c-border-strong);
}

.btn-ghost:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
  filter: none;
}

/* Neutral badge only gets the border — colored variants stay clean. */
.badge[class*="badge-"] {
  border-color: transparent;
}

button:disabled,
.btn[disabled] {
  background: var(--spc-400);
}

.secondary-button {
  border-color: var(--c-border-strong);
  border-radius: 8px;
}

.danger-button {
  background: var(--c-danger);
}

.tab-row {
  gap: 8px;
}

.tab-link {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
  font-weight: 600;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.tab-link:hover {
  border-color: var(--c-border-strong);
  background: var(--c-surface-2);
}

.tab-link.is-active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #ffffff;
}

.badge {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--c-surface-2);
  color: var(--c-text-2);
  border: 1px solid var(--c-border);
}

/* ---- 8. Metric cards (tenant) ---------------------------------------- */
.business-kpi-card {
  border-radius: var(--r-xl);
  border-color: var(--c-border);
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  box-shadow: var(--shadow-card);
}

.business-kpi-card:hover {
  border-color: var(--c-primary-border);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.business-kpi-eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--c-text-3);
}

.business-kpi-value {
  font-size: 34px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.business-kpi-value-money {
  font-size: 28px;
}

.business-kpi-footnote {
  font-size: 12.5px;
  color: var(--c-text-3);
}

.stat-card {
  border-radius: var(--r-lg);
  border-color: var(--c-border);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}

.stat-card:hover {
  border-color: var(--c-primary-border);
  box-shadow: var(--shadow-md);
}

.stat-label {
  color: var(--c-text-3);
  font-size: 11px;
  letter-spacing: 0.07em;
}

.stat-value {
  font-size: 26px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-value-small {
  font-size: 21px;
}

/* ---- 9. Platform admin components ------------------------------------ */
.pa-summary-grid {
  gap: 14px;
  margin-bottom: 22px;
}

.pa-summary-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  border-top: 3px solid var(--c-border-strong);
  background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.pa-summary-card:hover {
  transform: translateY(-1px);
  border-color: var(--c-border-strong);
  box-shadow: var(--shadow-md);
}

.pa-summary-card--warn {
  border-top-color: var(--c-warn);
}

.pa-summary-card--warn .pa-summary-value {
  color: #b45309;
}

.pa-summary-card--danger {
  border-top-color: var(--c-danger);
}

.pa-summary-card--danger .pa-summary-value {
  color: #b91c1c;
}

.pa-summary-value {
  font-size: 24px;
  letter-spacing: -0.02em;
}

.pa-summary-label {
  font-size: 11px;
  letter-spacing: 0.06em;
}

.pa-cockpit-table {
  border-collapse: separate;
  border-spacing: 0;
}

.pa-cockpit-table thead th {
  background: var(--c-surface-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
  border-bottom: 1px solid var(--c-border);
  padding: 10px 12px;
}

.pa-cockpit-table tbody td {
  padding: 12px;
  font-size: 13.5px;
  border-bottom: 1px solid #eef1f5;
  color: var(--c-text-2);
}

.pa-cockpit-table tbody tr:nth-child(even) {
  background: #fbfcfe;
}

.pa-cockpit-table tbody tr:hover {
  background: #f0f4ff;
}

/* Keep the platform table's blue row hover visible (the generic .table
   td hover would otherwise paint the cells gray on top of it). */
.pa-cockpit-table tbody tr:hover td {
  background: transparent;
}

.pa-cockpit-table tbody tr:last-child td {
  border-bottom: none;
}

.pa-id {
  font-variant-numeric: tabular-nums;
  color: var(--c-text-3);
}

.pa-tenant-name {
  font-weight: 600;
  color: var(--c-text);
}

.pa-tenant-links {
  display: flex;
  gap: 8px;
  margin-top: 3px;
  font-size: 12px;
}

.pa-tenant-links a {
  color: var(--c-primary);
  font-weight: 600;
  text-decoration: none;
}

.pa-tenant-links a:hover {
  text-decoration: underline;
}

.pa-badge {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  border-radius: 999px;
  border: 1px solid transparent;
}

.pa-role {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
}

.pa-privacy {
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  border-left: 3px solid #94a3b8;
  background: linear-gradient(180deg, #ffffff 0%, var(--c-surface-2) 100%);
}

/* Privacy/safety notices get an unmistakable kicker label. */
.pa-privacy::before {
  content: "Privacy & veiligheid";
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-shell--platform .pa-privacy {
  border-left-color: #818cf8;
  background: linear-gradient(180deg, #ffffff 0%, #f4f6ff 100%);
}

.pa-privacy-text {
  line-height: 1.6;
}

.pa-filter-bar {
  padding: 14px 16px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  margin-bottom: 16px;
}

.pa-filter-field input,
.pa-filter-field select {
  border-radius: 8px;
  border-color: var(--c-border-strong);
  background: #ffffff;
}

.pa-filter-field input:focus,
.pa-filter-field select:focus {
  border-color: var(--c-primary);
  outline: 2px solid rgba(29, 78, 216, 0.15);
}

.pa-crumbs {
  font-size: 13px;
}

.pa-crumbs a {
  font-weight: 600;
  text-decoration: none;
}

.pa-crumbs a:hover {
  text-decoration: underline;
}

.pa-detail-header h1 {
  font-size: 24px;
}

.pa-detail-badges {
  gap: 8px;
}

.pa-banner {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

.pa-detail-grid {
  gap: 12px;
}

.pa-detail-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
}

.pa-detail-label {
  font-size: 11px;
  letter-spacing: 0.06em;
}

.pa-detail-value {
  font-size: 14.5px;
}

.pa-meter {
  height: 6px;
  background: #e4e9f0;
}

.pa-meter-ok {
  background: var(--c-success);
}

.pa-meter-warn {
  background: var(--c-warn);
}

.pa-notice {
  border-radius: 10px;
}

.pa-dialog {
  border-radius: 16px;
  padding: 22px 24px;
}

.pa-dialog h3 {
  font-size: 17px;
}

/* ---- 10. Dashboard / onboarding / plan components -------------------- */
.dashboard-grid,
.two-column,
.bookkeeping-grid {
  gap: 22px;
}

.summary-highlight {
  border-radius: 12px;
  border: 1px solid var(--c-border);
  background: linear-gradient(180deg, #ffffff 0%, var(--c-surface-2) 100%);
}

.summary-highlight h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.experiment-offer {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--c-border);
  background: linear-gradient(135deg, #f0f7ff 0%, var(--c-surface-2) 100%);
}

.experiment-offer .experiment-price {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

.experiment-offer .experiment-price .muted {
  font-size: 14px;
  font-weight: 400;
}

.experiment-offer .experiment-label {
  margin-top: 4px;
  font-weight: 600;
  color: #1f2937;
}

.experiment-offer p.muted {
  margin-top: 6px;
  font-size: 13px;
}

.summary-pairs div {
  border-radius: 10px;
  border-color: var(--c-border);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.summary-pairs span {
  font-size: 12px;
  letter-spacing: 0.02em;
}

.summary-pairs strong {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.action-item,
.todo-item,
.workplan-item,
.category-breakdown-row,
.bookkeeping-note,
.aging-row,
.funnel-stage {
  border-radius: 12px;
  border-color: var(--c-border);
}

.action-item:hover {
  border-color: #c7d2fe;
  background: #f8faff;
}

.action-center-panel {
  border-color: var(--c-border);
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}

.action-center-panel .panel-header {
  border-bottom-color: #e9edf5;
}

.todo-item {
  border-color: var(--c-border);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.detail-list dt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
}

.detail-list dd {
  color: var(--c-text);
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.inline-search input,
.inline-search select {
  border-radius: 8px;
  border-color: var(--c-border-strong);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.inline-search input:focus,
.inline-search select:focus {
  border-color: var(--c-primary);
  outline: 2px solid rgba(29, 78, 216, 0.15);
}

.flash {
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid transparent;
}

.flash-success {
  background: var(--c-success-soft);
  border-color: #bbf7d0;
  color: #166534;
}

.flash-error {
  background: var(--c-danger-soft);
  border-color: #fecaca;
  color: #991b1b;
}

.progress-bar {
  height: 8px;
  background: var(--c-border);
}

.progress-bar-fill {
  background: linear-gradient(90deg, #2563eb 0%, var(--c-accent) 100%);
}

.placeholder-box {
  border-radius: 10px;
}

.trial-banner {
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-primary);
  box-shadow: var(--shadow-card);
}

.trial-banner-mark {
  padding: 4px 11px;
  background: var(--c-primary-soft);
  border: 1px solid var(--c-primary-border);
  color: var(--c-primary);
}

.onboarding-progress {
  background: var(--c-border);
}

.onboarding-step {
  padding: 9px 10px;
  border-radius: 10px;
}

.onboarding-check {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.onboarding-step-cta {
  background: var(--c-primary);
  border-radius: 999px;
  padding: 5px 13px;
}

.onboarding-step-cta:hover {
  background: var(--c-primary-hover);
}

.onboarding-success {
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  border-left: 3px solid #1e7e34;
  box-shadow: var(--shadow-card);
}

.company-setup-card {
  border-radius: 12px;
  background: var(--c-primary-soft);
  border-color: var(--c-primary-border);
}

.plan-card {
  border-top: 3px solid var(--c-primary);
  border-radius: var(--r-lg);
}

.plan-card-body {
  align-items: center;
}

.plan-card-eyebrow {
  color: var(--c-text-3);
  font-size: 11px;
  letter-spacing: 0.07em;
}

.mijn-plan-countdown {
  font-size: 16px;
  line-height: 1.55;
}

.mijn-plan-cta {
  border-radius: 8px;
}

.mijn-plan-cta-placeholder {
  background: var(--c-surface-2);
  border: 1px dashed var(--c-border-strong);
  color: var(--c-text-3);
}

.seat-meter {
  height: 7px;
  background: var(--c-border);
}

.seat-meter-fill {
  background: linear-gradient(90deg, #1d4ed8 0%, var(--c-accent) 100%);
}

.kpi-chip,
.quarter-card {
  border-radius: 12px;
  border-color: var(--c-border);
}

.margin-chip,
.progress-chip {
  font-weight: 700;
}

/* Auth pages: softer, more premium card. */
.auth-card {
  border-radius: 16px;
  border-color: var(--c-border);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.10);
  padding: 28px;
}

.auth-card h1 {
  font-size: 24px;
}

.dashboard-period-menu summary {
  border-radius: 12px;
}

.dashboard-period-popover {
  border-radius: 16px;
}

/* ---- 11. Responsive re-assertions (this block sits after the older
   media queries, so the refinements above re-apply their tuned values
   on small screens). -------------------------------------------------- */
@media (max-width: 1100px) {
  .sidebar {
    width: 236px;
  }

  .pa-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 264px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 30;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: inline-grid;
    place-items: center;
    background: #ffffff;
    border: 1px solid var(--c-border-strong);
    color: var(--c-text);
  }

  .topbar-slim {
    padding: 12px 16px;
  }

  .page {
    padding: 16px 16px 40px;
  }

  .panel {
    padding: 16px;
  }

  .pa-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .pa-detail-header {
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .business-kpi-value {
    font-size: 27px;
  }

  .business-kpi-value-money {
    font-size: 23px;
  }

  .page-header h1 {
    font-size: 22px;
  }
}

/* ------------------------------------------------------------------ */
/* Epic E5 — beachhead activation engine (ZZP schilders first-run).    */
/* Presentation only, built on the E4 design tokens above.             */
/* ------------------------------------------------------------------ */

/* Fresh-tenant hero: headline + next action + quote-to-paid loop. */
.activation-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 18px;
  border: 1px solid var(--c-primary-border);
  background: linear-gradient(180deg, var(--c-primary-soft) 0%, var(--c-surface) 55%);
}

.activation-hero-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.activation-hero-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-primary);
}

.activation-hero h2 {
  margin: 0;
  font-size: 22px;
  color: var(--c-text);
}

.activation-hero-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--c-text-2);
  max-width: 52ch;
}

.activation-hero-cta {
  margin-top: 6px;
  font-weight: 700;
}

/* Quote-to-paid loop: Klant → Offerte → Klus → Factuur → Betaald. */
.activation-loop {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-card);
}

.activation-loop-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
}

.activation-loop-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.activation-loop-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.activation-loop-step:hover {
  border-color: var(--c-primary-border);
  color: var(--c-primary);
}

.activation-loop-step.is-done {
  background: var(--c-success-soft);
  border-color: #bbf7d0;
  color: #15803d;
}

.activation-loop-check {
  flex: 0 0 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--c-border);
  color: var(--c-text-3);
  font-size: 12px;
  font-weight: 700;
}

.activation-loop-step.is-done .activation-loop-check {
  background: var(--c-success);
  color: #ffffff;
}

.activation-loop-status {
  font-size: 12px;
  color: var(--c-text-3);
}

/* Checklist: highlighted next best action for partial progress. */
.onboarding-next-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--c-primary-border);
  border-radius: 10px;
  background: var(--c-primary-soft);
}

.onboarding-next-step-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.onboarding-next-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-primary);
}

.onboarding-next-step strong {
  font-size: 14px;
  color: var(--c-text);
}

/* Checklist: compact quote-to-paid loop line (partial progress). */
.onboarding-loop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  font-size: 12px;
  color: var(--c-text-3);
}

.onboarding-loop-step {
  font-weight: 600;
  color: var(--c-text-3);
}

.onboarding-loop-step.is-done {
  color: #15803d;
}

.onboarding-loop-arrow {
  color: var(--c-border-strong);
}

/* List-page guided empty states (owner/admin only). */
.activation-empty {
  margin-bottom: 18px;
  border-left: 3px solid var(--c-primary);
  background: linear-gradient(180deg, var(--c-primary-soft) 0%, var(--c-surface) 60%);
}

.activation-empty-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.activation-empty-body h2 {
  margin: 0;
  font-size: 18px;
  color: var(--c-text);
}

.activation-empty-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-text-2);
  max-width: 62ch;
}

.activation-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* First-offer guidance list (offers page, empty state). */
.activation-help-steps {
  margin: 0 0 10px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--c-text-2);
}

.activation-help-steps a {
  color: var(--c-primary);
}

.activation-help-note {
  margin: 0 0 12px;
  font-size: 12px;
}

@media (max-width: 860px) {
  .activation-hero {
    grid-template-columns: 1fr;
  }
}



/* ---------------------------------------------------------------------------
   Epic E6 — tenant Bedrijfsinstellingen + onboarding company-setup step
   (painter-first private beta; data-driven grouped form, preset-ready).
--------------------------------------------------------------------------- */
.settings-form .settings-group + .settings-group {
  margin-top: 16px;
}

.settings-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.settings-logo-preview {
  max-height: 56px;
  max-width: 180px;
  border: 1px solid #cfd6de;
  border-radius: 6px;
  padding: 4px;
  background: #fff;
}

.settings-logo-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #8a3440;
}

.settings-logo-remove input {
  margin: 0;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
}

.auth-note {
  font-size: 13px;
  line-height: 1.5;
}

/* =====================================================================
   Epic E7 — Pilot feedback system (2026-08-14)
   ---------------------------------------------------------------------
   Tenant feedback form + platform-admin triage page. Reuses the E4
   design-system classes (.panel, .btn, .table, .pa-*) — these rules
   only add the E7-specific bits (badges, filter row, inline status
   form, feedback card spacing). Presentation only.
   ===================================================================== */
.feedback-card { margin-top: 20px; }
.feedback-contact-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.feedback-contact-option input[type="checkbox"] {
  width: auto;
  margin: 0;
}
.badge-feedback-new { background: #dbeafe; color: #1d4ed8; }
.badge-feedback-reviewed { background: #fef3c7; color: #92400e; }
.badge-feedback-closed { background: #e5e7eb; color: #374151; }
.pa-filter-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.pa-filter-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
}
.pa-inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pa-inline-form select {
  max-width: 170px;
}
.pa-feedback-message {
  max-width: 380px;
  white-space: normal;
  line-height: 1.45;
}
/* Epic E10 — support/help/contact surface (tenant FAQ + form, platform
   triage table). Reuses the feedback/pa-* component classes above. */
.pa-support-subject {
  max-width: 240px;
  white-space: normal;
  line-height: 1.45;
  font-weight: 600;
}
.badge-support-urgency-laag { background: #dcfce7; color: #15803d; }
.badge-support-urgency-normaal { background: #dbeafe; color: #1d4ed8; }
.badge-support-urgency-hoog { background: #fee2e2; color: #b91c1c; }
.support-intro-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  line-height: 1.5;
}
.faq-list {
  display: grid;
  gap: 10px;
}
.faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px 16px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
}
.faq-item p {
  margin: 8px 0 0;
  line-height: 1.5;
  color: #475569;
}

/* Epic E12 — private-beta expectations + launch checklist */
.beta-expectation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.beta-expectation-list li {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px 16px;
  line-height: 1.5;
  color: #334155;
}
.beta-expectation-list li strong {
  color: #0f172a;
}
.beta-expectation-list a {
  color: #1d4ed8;
  text-decoration: underline;
}
.beta-acknowledge {
  margin-top: 16px;
  border-top: 1px dashed #cbd5e1;
  padding-top: 16px;
}
.beta-acknowledge-form {
  display: grid;
  gap: 10px;
}
.beta-acknowledged-note {
  margin-top: 14px;
  color: #0f766e;
  font-weight: 600;
}
.beta-checklist-verdict {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  color: #0f766e;
  font-weight: 600;
}

/* =====================================================================
   Epic E13 — Legal/privacy/trust pages (2026-08-15)
   ---------------------------------------------------------------------
   Public trust pages (/privacy, /voorwaarden, /veiligheid) reuse the
   auth-shell/auth-card layout; these rules add the concept banner, the
   trust-page typography and the footer link rows on auth + trust pages
   and the platform sidebar. Presentation only.
   ===================================================================== */
.trust-concept-banner {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 14px;
  line-height: 1.5;
}
.trust-page h2 {
  margin: 22px 0 8px;
  font-size: 17px;
  color: #0f172a;
}
.trust-page ul {
  margin: 8px 0;
  padding-left: 20px;
  line-height: 1.6;
}
.trust-page li {
  margin: 4px 0;
}
.auth-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 13px;
}
.auth-footer a,
.trust-footer a {
  color: #1d4ed8;
  text-decoration: none;
}
.auth-footer a:hover,
.trust-footer a:hover {
  text-decoration: underline;
}
.trust-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 13px;
}
.sidebar-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}
.sidebar-footer-links a {
  color: #94a3b8;
  text-decoration: none;
}
.sidebar-footer-links a:hover {
  color: #e2e8f0;
  text-decoration: underline;
}

/* =====================================================================
   Epic E21 — mobile field polish (2026-08-15)
   ---------------------------------------------------------------------
   Field-use improvements for phones (bon foto, uren, klussen, facturen,
   dashboard). Desktop layout is untouched: every rule here either sits
   inside a max-width media query or is inert on desktop. No PWA, no
   native app, no JS frameworks — presentation only.
   ===================================================================== */

/* Remove the mobile double-tap zoom delay on interactive elements. */
.sidebar-toggle,
.link-button,
button,
input[type="submit"],
input[type="button"],
.tab-link {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Drawer backdrop: hidden on desktop, fades in under the mobile drawer. */
.sidebar-backdrop {
  display: none;
}

@media (max-width: 860px) {
  /* Tapping outside the open drawer closes it (visual affordance only —
     the backdrop is a tap target, never interactive content). */
  .app-shell.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 20;
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
  }

  .sidebar {
    z-index: 40;
  }

  .sidebar-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .topbar-slim {
    gap: 10px;
  }

  .topbar-page-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Field flows: keep primary actions one-thumb reachable. */
  .status-actions button,
  .actions .link-button,
  .actions button {
    min-height: 44px;
  }
}

@media (max-width: 720px) {
  /* 16px form controls stop iOS Safari auto-zooming into inputs on
     focus — a core field-use annoyance (bon foto / uren / factuur). */
  .form-grid input,
  .form-grid select,
  .form-grid textarea,
  .inline-search input,
  .inline-search select,
  .inline-form input,
  .inline-form select,
  input[type="date"],
  input[type="text"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px;
  }

  .form-grid {
    gap: 12px;
  }

  .form-grid input,
  .form-grid select,
  .form-grid textarea {
    min-height: 44px;
  }

  button,
  .link-button,
  .logout-button,
  .danger-button {
    min-height: 44px;
  }

  /* Tighter table density so wide field tables stay readable without
     horizontal panning on small phones. */
  .table th,
  .table td {
    padding: 10px 6px;
    font-size: 13px;
  }

  .panel {
    padding: 14px;
  }

  .page {
    padding: 14px 14px 32px;
  }

  .placeholder-box {
    padding: 14px;
  }

  .detail-list {
    gap: 12px;
  }

  .detail-list dd {
    font-size: 15px;
  }

  /* Dashboard: KPI cards breathe on small screens. */
  .business-kpi-card {
    padding: 14px;
  }

  .action-item {
    padding: 12px 14px;
  }

  /* Werkstatus / betaalstatus lines wrap instead of overflowing. */
  .werkstatus-statusline {
    align-items: flex-start;
  }

  .payment-status-line {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 480px) {
  .page {
    padding: 12px 12px 28px;
  }

  .panel {
    padding: 12px;
  }

  .page-header h1 {
    font-size: 20px;
  }

  .table th,
  .table td {
    padding: 9px 5px;
  }

  .flash {
    padding: 12px 14px;
    font-size: 14px;
  }

  .business-kpi-value {
    font-size: 24px;
  }

  .business-kpi-value-money {
    font-size: 21px;
  }

  .status-actions button,
  .actions .link-button,
  .actions button {
    min-height: 48px;
  }
}

