/*
  ZulassungDigi.de Designsystem
  Bootstrap 5.3 liegt darunter. Diese Datei ist die zentrale Steuerung fuer
  Farben, Abstaende, Typografie, Karten, Tabellen, Buttons und Statusanzeigen.
*/

:root,
:root[data-theme="dark"],
body.dark {
  color-scheme: dark;
  --zp-bg: #04101d;
  --zp-surface: #081726;
  --zp-surface-2: #0d1d2e;
  --zp-surface-3: #14273b;
  --zp-text: #f8fafc;
  --zp-muted: #98a9bd;
  --zp-border: #203a55;
  --zp-input: #061320;
  --zp-primary: #0b63ce;
  --zp-primary-hover: #075dbd;
  --zp-primary-soft: rgba(8, 124, 240, .16);
  --zp-primary-text: #bfdbfe;
  --zp-success: #16a34a;
  --zp-success-action: #117a37;
  --zp-warning: #f59e0b;
  --zp-danger: #dc2626;
  --zp-info: #0891b2;
  --zp-shadow: 0 22px 58px rgba(0, 5, 12, .42);
  --zp-radius: 8px;
  --zp-radius-sm: 6px;
  --zp-sidebar-width: 292px;
  --zp-topbar-height: 64px;
  --zp-space-1: 4px;
  --zp-space-2: 8px;
  --zp-space-3: 12px;
  --zp-space-4: 16px;
  --zp-space-5: 20px;
  --zp-space-6: 24px;
  --bs-body-bg: var(--zp-bg);
  --bs-body-color: var(--zp-text);
  --bs-border-color: var(--zp-border);
  --bs-primary: var(--zp-primary);
  --bs-link-color: #93c5fd;
  --bs-link-hover-color: #bfdbfe;
}

:root[data-theme="light"],
body.light {
  color-scheme: light;
  --zp-bg: #f4f7fb;
  --zp-surface: #ffffff;
  --zp-surface-2: #f8fafc;
  --zp-surface-3: #eef2f7;
  --zp-text: #172033;
  --zp-muted: #5b6b80;
  --zp-border: #d9e2ef;
  --zp-input: #ffffff;
  --zp-primary: #1d4ed8;
  --zp-primary-hover: #1e40af;
  --zp-primary-soft: rgba(29, 78, 216, .10);
  --zp-primary-text: #1e40af;
  --zp-success: #15803d;
  --zp-success-action: #166534;
  --zp-warning: #b45309;
  --zp-danger: #b91c1c;
  --zp-info: #0e7490;
  --zp-shadow: 0 14px 34px rgba(15, 23, 42, .08);
  --bs-body-bg: var(--zp-bg);
  --bs-body-color: var(--zp-text);
  --bs-border-color: var(--zp-border);
  --bs-primary: var(--zp-primary);
  --bs-link-color: #1d4ed8;
  --bs-link-hover-color: #1e3a8a;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--zp-bg) !important;
  color: var(--zp-text) !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

.skip-link {
  position: fixed;
  z-index: 2000;
  top: var(--zp-space-3);
  left: var(--zp-space-3);
  padding: var(--zp-space-2) var(--zp-space-4);
  border: 2px solid var(--zp-primary);
  border-radius: var(--zp-radius-sm);
  background: var(--zp-surface);
  color: var(--zp-text);
  font-weight: 800;
  transform: translateY(calc(-100% - var(--zp-space-6)));
  transition: transform .15s ease;
}

.skip-link:focus {
  color: var(--zp-text);
  transform: translateY(0);
}

a {
  color: var(--bs-link-color);
}

a:hover {
  color: var(--bs-link-hover-color);
}

h1,
h2,
h3 {
  color: var(--zp-text);
  line-height: 1.2;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 800;
  margin: 0 0 var(--zp-space-2);
}

h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 var(--zp-space-4);
}

h3 {
  font-size: 16px;
  font-weight: 800;
}

.muted,
small {
  color: var(--zp-muted) !important;
}

.small {
  font-size: 12px !important;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--zp-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--zp-primary);
  color: #fff;
  font-weight: 900;
}

.topbar {
  min-height: var(--zp-topbar-height);
  height: var(--zp-topbar-height);
  padding: 0 var(--zp-space-5);
  border-bottom: 1px solid var(--zp-border);
  background: color-mix(in srgb, var(--zp-surface) 96%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1020;
  backdrop-filter: blur(12px);
}

.topbar-brand,
.login-brand {
  display: flex;
  align-items: center;
  gap: var(--zp-space-3);
  min-width: 0;
}

.topbar-brand b {
  display: block;
  font-size: 15px;
}

.topbar-brand > div {
  min-width: 0;
}

.topbar-brand .brand-mark {
  flex-shrink: 0;
}

.topbar-brand small {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--zp-space-2);
  flex-wrap: wrap;
}

.inline-action-form {
  display: inline;
  margin: 0;
}

.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

.top-action-link,
.theme-toggle {
  border: 1px solid var(--zp-border) !important;
  background: var(--zp-surface-2) !important;
  color: var(--zp-text) !important;
  border-radius: var(--zp-radius-sm) !important;
  padding: 8px 10px !important;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}

.theme-toggle:hover,
.top-action-link:hover {
  border-color: var(--zp-primary) !important;
  color: var(--zp-text) !important;
}

.app-shell {
  display: grid !important;
  grid-template-columns: var(--zp-sidebar-width) minmax(0, 1fr);
  min-height: calc(100vh - var(--zp-topbar-height));
}

.sidebar {
  width: auto !important;
  height: calc(100vh - var(--zp-topbar-height)) !important;
  position: sticky !important;
  top: var(--zp-topbar-height) !important;
  overflow: auto !important;
  padding: var(--zp-space-4) !important;
  background: var(--zp-surface) !important;
  border-right: 1px solid var(--zp-border) !important;
}

.content {
  min-width: 0;
  padding: var(--zp-space-6) !important;
  max-width: 1560px;
}

.version-badge,
.workflow-hint,
.support-banner,
.subscription-warnings {
  border-radius: var(--zp-radius) !important;
  border: 1px solid var(--zp-border) !important;
  background: var(--zp-surface-2) !important;
  color: var(--zp-text) !important;
  box-shadow: none !important;
}

.workflow-hint {
  margin-bottom: var(--zp-space-4) !important;
}

.version-badge {
  font-size: 12px;
  font-weight: 800;
  text-align: left !important;
  margin-bottom: var(--zp-space-3) !important;
}

.sep {
  background: var(--zp-border) !important;
  margin: var(--zp-space-4) 0 !important;
}

.new-btn,
.primary,
.btn-primary {
  background: var(--zp-primary) !important;
  border: 1px solid var(--zp-primary) !important;
  color: #fff !important;
  border-radius: var(--zp-radius-sm) !important;
  padding: 10px 14px !important;
  min-height: 40px;
  font-weight: 800;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.new-btn {
  width: 100%;
  margin-bottom: var(--zp-space-2);
}

.primary:hover,
.new-btn:hover,
.btn-primary:hover {
  background: var(--zp-primary-hover) !important;
  border-color: var(--zp-primary-hover) !important;
}

.secondary,
.buttonlike.secondary,
.btn-secondary {
  background: var(--zp-surface-2) !important;
  border: 1px solid var(--zp-border) !important;
  color: var(--zp-text) !important;
  border-radius: var(--zp-radius-sm) !important;
  padding: 10px 14px !important;
  min-height: 40px;
  font-weight: 800;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.btn-outline-primary {
  --bs-btn-color: var(--bs-link-color);
  --bs-btn-border-color: var(--bs-link-color);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--zp-primary);
  --bs-btn-hover-border-color: var(--zp-primary);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--zp-primary-hover);
  --bs-btn-active-border-color: var(--zp-primary-hover);
}

.secondary:hover,
.buttonlike.secondary:hover,
.pill:hover {
  border-color: var(--zp-primary) !important;
  color: var(--zp-text) !important;
}

.danger,
.btn-danger {
  background: var(--zp-danger) !important;
  border: 1px solid var(--zp-danger) !important;
  color: #fff !important;
  border-radius: var(--zp-radius-sm) !important;
  padding: 10px 14px !important;
  min-height: 40px;
  font-weight: 800;
  cursor: pointer;
}

.small,
button.small,
.primary.small,
.secondary.small,
.danger.small {
  min-height: 32px;
  padding: 6px 10px !important;
  font-size: 12px !important;
}

.huge-action {
  min-height: 46px;
  font-size: 15px !important;
}

.side-link.big,
.order-card,
.dash-card {
  border-radius: var(--zp-radius) !important;
  border: 1px solid var(--zp-border) !important;
  background: var(--zp-surface-2) !important;
  color: var(--zp-text) !important;
  text-decoration: none;
}

.side-link.big {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: var(--zp-space-2);
  min-height: 40px;
  padding: 9px 10px !important;
  margin: 6px 0 !important;
  font-weight: 700;
}

.sidebar-action {
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  appearance: none;
}

.side-link.big:hover,
.order-card:hover,
.dash-card:hover {
  border-color: var(--zp-primary) !important;
  background: color-mix(in srgb, var(--zp-surface-2) 84%, var(--zp-primary) 16%) !important;
}

.side-link.big.active {
  border-color: var(--zp-primary) !important;
  background: var(--zp-primary-soft) !important;
  color: var(--zp-primary-text) !important;
}

.invoice-menu {
  background: var(--zp-primary-soft) !important;
  border-color: color-mix(in srgb, var(--zp-primary) 60%, var(--zp-border)) !important;
}

.invoice-menu b {
  background: var(--zp-warning) !important;
  color: #111827 !important;
  border-radius: 999px;
  padding: 2px 8px;
}

.order-card {
  margin: var(--zp-space-2) 0 !important;
  padding: var(--zp-space-3) !important;
}

.order-card,
.dash-card {
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-card.active {
  border-color: var(--zp-primary) !important;
  box-shadow: 0 0 0 2px var(--zp-primary-soft) !important;
}

.card,
.panel,
.pretty-panel,
.kanban-col,
.bundle-card,
.kpi,
.user-card,
.tenant-card,
.business-client-card,
.mobile-card,
.mobile-scan-card {
  background: var(--zp-surface) !important;
  border: 1px solid var(--zp-border) !important;
  border-radius: var(--zp-radius) !important;
  box-shadow: none !important;
}

.card {
  padding: var(--zp-space-5) !important;
  margin-bottom: var(--zp-space-4) !important;
}

.panel,
.pretty-panel {
  padding: var(--zp-space-5) !important;
  margin-top: var(--zp-space-4) !important;
}

.big-form {
  max-width: 1320px;
}

.topline {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: var(--zp-space-4) !important;
  margin-bottom: var(--zp-space-4);
}

.topline.compact {
  align-items: flex-end !important;
}

.inline-actions,
.doc-buttons,
.statusbar,
.datefilter,
.scan-actions,
.user-card-actions,
.user-card-secondary-actions {
  display: flex !important;
  align-items: center;
  gap: var(--zp-space-2) !important;
  flex-wrap: wrap;
}

.doc-buttons {
  padding: var(--zp-space-3);
  border: 1px solid var(--zp-border);
  background: var(--zp-surface-2);
  border-radius: var(--zp-radius);
}

.pill,
.buttonlike {
  background: var(--zp-surface-2) !important;
  border: 1px solid var(--zp-border) !important;
  color: var(--zp-text) !important;
  border-radius: var(--zp-radius-sm) !important;
  padding: 8px 11px !important;
  min-height: 36px;
  font-weight: 800;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pill.blue,
.pill.invoice-hot,
.invoice-hot,
.scan-cta,
.scan-start,
.huge-scan-button {
  background: var(--zp-primary) !important;
  border-color: var(--zp-primary) !important;
  color: #fff !important;
}

.pill.whatsapp {
  background: var(--zp-success-action) !important;
  border-color: var(--zp-success-action) !important;
  color: #fff !important;
}

.abmeldung-hot {
  background: var(--zp-danger) !important;
  border-color: var(--zp-danger) !important;
  color: #fff !important;
}

label,
.form-label {
  color: var(--zp-text) !important;
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 0;
}

input,
select,
textarea,
.form-control,
.form-select {
  display: block;
  width: 100%;
  min-height: 40px;
  margin-top: 6px;
  border: 1px solid var(--zp-border) !important;
  border-radius: var(--zp-radius-sm) !important;
  background-color: var(--zp-input) !important;
  color: var(--zp-text) !important;
  padding: 9px 11px !important;
  font-size: 14px !important;
  box-shadow: none !important;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--zp-primary) !important;
  box-shadow: 0 0 0 3px var(--zp-primary-soft) !important;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--zp-muted) 80%, transparent);
}

input[readonly],
textarea[readonly] {
  background: var(--zp-surface-2) !important;
  color: var(--zp-muted) !important;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin: 0 !important;
  accent-color: var(--zp-primary);
  flex: 0 0 auto;
}

input[type="file"] {
  padding: 10px !important;
}

.grid2,
.grid3,
.grid,
.form-grid {
  gap: var(--zp-space-4) !important;
}

.grid2 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.grid3 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.item-row {
  grid-template-columns: minmax(220px, 1.5fr) 90px 120px 90px 38px !important;
  gap: var(--zp-space-2) !important;
}

.item-row button {
  min-height: 40px;
  border-radius: var(--zp-radius-sm);
  border: 1px solid var(--zp-border);
  background: var(--zp-surface-2);
  color: var(--zp-text);
}

.checkline {
  display: flex !important;
  align-items: center;
  gap: var(--zp-space-2);
  padding: 0 !important;
}

.fine-dust-field {
  position: relative;
}

.fine-dust-heading {
  display: flex;
  align-items: center;
  gap: var(--zp-space-3);
  margin-top: var(--zp-space-2);
  min-height: 74px;
}

.fine-dust-copy {
  color: var(--zp-muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.fine-dust-plaque-icon {
  display: grid;
  grid-template-columns: 26px 1fr;
  grid-template-rows: 1fr 15px 16px;
  align-items: center;
  justify-items: center;
  flex: 0 0 auto;
  width: 74px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid #111827;
  background: #10a84a;
  color: #111827;
  padding: 12px 11px 8px;
  box-shadow:
    inset 0 0 0 4px #f8fafc,
    inset 0 0 0 7px #111827,
    0 8px 18px rgba(0, 0, 0, .16);
  overflow: hidden;
}

.fine-dust-plaque-icon.is-active {
  background: #12b052;
}

.fine-dust-number {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  font-size: 39px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
}

.fine-dust-zone {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  width: 24px;
  height: 24px;
  border: 1px solid #111827;
  border-radius: 3px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 5px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.fine-dust-zone::before {
  content: "";
  position: absolute;
  top: 4px;
  width: 14px;
  height: 14px;
  border: 2px solid #dc2626;
  border-radius: 50%;
}

.fine-dust-zone span,
.fine-dust-zone b {
  position: relative;
  z-index: 1;
  display: block;
}

.fine-dust-zone b {
  margin-top: 9px;
  font-size: 6px;
}

.fine-dust-plate-line {
  grid-column: 1 / 3;
  grid-row: 2;
  width: 44px;
  height: 13px;
  border: 2px solid #111827;
  background: #fff;
}

.fine-dust-seal {
  grid-column: 1 / 3;
  grid-row: 3;
  width: 19px;
  height: 19px;
  margin-top: -3px;
  border: 2px solid #111827;
  border-radius: 50%;
  background: #10a84a;
}

.bottom-savebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zp-space-4);
  margin-top: var(--zp-space-5);
  padding: var(--zp-space-4);
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius);
  background: var(--zp-surface-2);
}

.bottom-savebar div {
  display: grid;
  gap: 2px;
}

.bottom-savebar b {
  font-weight: 950;
}

.bottom-savebar span {
  color: var(--zp-muted);
  font-size: 13px;
}

.bottom-savebar .primary {
  min-width: 190px;
}

@media (max-width: 720px) {
  .bottom-savebar {
    align-items: stretch;
    flex-direction: column;
  }

  .bottom-savebar .primary {
    width: 100%;
  }
}

.feature-toggle-box {
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius-md);
  background: var(--zp-surface-2);
  padding: var(--zp-space-4);
}

.feature-toggle-box legend {
  float: none;
  width: auto;
  padding: 0 var(--zp-space-2);
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  color: var(--zp-text);
}

.feature-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--zp-space-3);
  margin-top: var(--zp-space-3);
}

.feature-toggle-card {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: var(--zp-space-3);
  align-items: start;
  padding: var(--zp-space-3);
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius-sm);
  background: var(--zp-surface);
}

.feature-toggle-card b,
.feature-toggle-card small {
  display: block;
}

.feature-toggle-card small {
  margin-top: 3px;
  color: var(--zp-muted);
  line-height: 1.35;
}

.checkgrid,
.pretty-check-grid,
.permission-matrix,
.validation-grid.two,
.docs-grid,
.reject-grid {
  display: grid !important;
  gap: var(--zp-space-3) !important;
}

.checkgrid,
.pretty-check-grid,
.docs-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
}

.permission-matrix {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
}

.validation-grid.two,
.reject-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.pretty-check,
.perm-row,
.needed,
.onboarding-card,
.billing-summary div,
.scan-card,
.extracted-chip {
  min-height: 58px;
  border: 1px solid var(--zp-border) !important;
  border-radius: var(--zp-radius) !important;
  background: var(--zp-surface-2) !important;
  color: var(--zp-text) !important;
}

.pretty-check,
.perm-row {
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: var(--zp-space-3) !important;
  padding: var(--zp-space-3) !important;
}

.pretty-check:hover,
.perm-row:hover {
  border-color: var(--zp-primary) !important;
}

.pretty-check:has(input:checked),
.perm-row:has(input:checked) {
  border-color: var(--zp-primary) !important;
  background: var(--zp-primary-soft) !important;
}

.search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: var(--zp-space-2);
  margin-top: var(--zp-space-2);
}

.search-controls input {
  min-width: 0;
  margin-top: 0;
}

.sidebar-search {
  margin-bottom: var(--zp-space-5);
}

.search-page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  align-items: end;
  gap: var(--zp-space-6);
  margin-bottom: var(--zp-space-6);
}

.search-page-header > *,
.search-wide {
  min-width: 0;
}

.search-reset {
  display: inline-block;
  padding: var(--zp-space-2) 0;
  margin-top: var(--zp-space-1);
}

.search-result-summary,
.search-name-cell {
  overflow-wrap: anywhere;
}

.search-name-cell {
  min-width: 160px;
  max-width: 260px;
}

.search-order-link {
  font-weight: 800;
}

.search-result-cards {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-result-card {
  display: grid;
  justify-items: start;
  gap: var(--zp-space-2);
  padding: var(--zp-space-4);
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius);
  background: var(--zp-surface);
  color: var(--zp-text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.search-result-card:hover {
  border-color: var(--zp-primary);
  background: var(--zp-surface-2);
  color: var(--zp-text);
}

.search-result-card > * {
  min-width: 0;
  max-width: 100%;
}

.search-result-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--zp-space-2);
  width: 100%;
}

.search-open {
  color: var(--bs-link-color);
  font-size: 13px;
  font-weight: 750;
}

.search-results-desktop:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.search-page .empty-state {
  display: grid;
  gap: var(--zp-space-2);
  padding: var(--zp-space-6);
  border: 1px dashed var(--zp-border);
  border-radius: var(--zp-radius);
  background: var(--zp-surface);
}

.search-page .empty-state span {
  color: var(--zp-muted);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius);
  background: var(--zp-surface);
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin: 0;
  color: var(--zp-text);
}

th,
td {
  padding: 11px 12px !important;
  border-bottom: 1px solid var(--zp-border) !important;
  vertical-align: top !important;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--zp-surface-2) !important;
  color: var(--zp-text);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 900;
}

tr:last-child td {
  border-bottom: 0 !important;
}

.kanban {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)) !important;
  gap: var(--zp-space-4) !important;
}

.kanban-col {
  min-width: 0;
  min-height: 240px;
  padding: var(--zp-space-4) !important;
}

.kanban-col h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zp-space-2);
}

.workflow-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--zp-space-3);
  margin-bottom: var(--zp-space-5);
}

.workflow-summary > div {
  min-width: 0;
  padding: var(--zp-space-4);
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius);
  background: linear-gradient(145deg, var(--zp-surface-2), var(--zp-surface));
}

.workflow-summary span,
.workflow-summary small,
.workflow-summary b {
  display: block;
}

.workflow-summary span {
  color: var(--zp-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.workflow-summary b {
  margin: 5px 0 2px;
  color: var(--zp-text);
  font-size: 28px;
  line-height: 1;
}

.kanban-col h2 span,
.badge,
.role-badge,
.status-badge {
  border-radius: 999px !important;
  padding: 4px 9px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  border: 1px solid var(--zp-border);
  background: var(--zp-surface-3);
  color: var(--zp-text);
}

.status-badge.green,
.badge.green,
.validation-badge.ok {
  background: color-mix(in srgb, var(--zp-success) 20%, var(--zp-surface)) !important;
  border-color: color-mix(in srgb, var(--zp-success) 60%, var(--zp-border)) !important;
  color: #bbf7d0 !important;
  box-shadow: none !important;
}

.status-badge.red,
.badge.red,
.validation-badge.bad {
  background: color-mix(in srgb, var(--zp-danger) 20%, var(--zp-surface)) !important;
  border-color: color-mix(in srgb, var(--zp-danger) 60%, var(--zp-border)) !important;
  color: #fecaca !important;
  box-shadow: none !important;
}

.status-badge.yellow {
  background: color-mix(in srgb, var(--zp-warning) 24%, var(--zp-surface)) !important;
  border-color: color-mix(in srgb, var(--zp-warning) 65%, var(--zp-border)) !important;
  color: #fde68a !important;
  box-shadow: none !important;
}

:root[data-theme="light"] .status-badge.green,
body.light .status-badge.green,
:root[data-theme="light"] .badge.green,
body.light .badge.green,
:root[data-theme="light"] .validation-badge.ok,
body.light .validation-badge.ok {
  color: #14532d !important;
}

:root[data-theme="light"] .status-badge.red,
body.light .status-badge.red,
:root[data-theme="light"] .badge.red,
body.light .badge.red,
:root[data-theme="light"] .validation-badge.bad,
body.light .validation-badge.bad {
  color: #7f1d1d !important;
}

:root[data-theme="light"] .status-badge.yellow,
body.light .status-badge.yellow {
  color: #713f12 !important;
}

.status {
  border: 1px solid var(--zp-border) !important;
  background: var(--zp-surface-2) !important;
  color: var(--zp-text) !important;
  border-radius: 999px !important;
  padding: 8px 12px !important;
  font-weight: 800;
  white-space: nowrap;
}

.status.on,
.status:hover {
  border-color: var(--zp-primary) !important;
  background: var(--zp-primary) !important;
  color: #fff !important;
  filter: none !important;
}

.flash,
.alert,
.warnbox,
.invoice-alert,
.status-yellow-block,
.office-reject-alert,
.readiness-panel,
.client-panel,
.invoice-workflow,
.invoice-price-panel {
  border-radius: var(--zp-radius) !important;
  box-shadow: none !important;
  background-image: none !important;
}

.flash.success,
.alert.success {
  border: 1px solid color-mix(in srgb, var(--zp-success) 55%, var(--zp-border));
  background: color-mix(in srgb, var(--zp-success) 15%, var(--zp-surface)) !important;
  color: var(--zp-text) !important;
}

.flash.error,
.alert.error {
  border: 1px solid color-mix(in srgb, var(--zp-danger) 55%, var(--zp-border));
  background: color-mix(in srgb, var(--zp-danger) 15%, var(--zp-surface)) !important;
  color: var(--zp-text) !important;
}

.warnbox,
.invoice-alert,
.status-yellow-block,
.readiness-panel {
  border-color: color-mix(in srgb, var(--zp-warning) 55%, var(--zp-border)) !important;
  background: color-mix(in srgb, var(--zp-warning) 10%, var(--zp-surface)) !important;
}

.office-reject-alert {
  border-color: color-mix(in srgb, var(--zp-danger) 55%, var(--zp-border)) !important;
  background: color-mix(in srgb, var(--zp-danger) 10%, var(--zp-surface)) !important;
}

.invoice-workflow,
.invoice-price-panel,
.client-panel {
  border-color: color-mix(in srgb, var(--zp-primary) 45%, var(--zp-border)) !important;
  background: color-mix(in srgb, var(--zp-primary) 8%, var(--zp-surface)) !important;
}

.ai-check-panel {
  border-color: color-mix(in srgb, var(--zp-primary) 45%, var(--zp-border)) !important;
  background: color-mix(in srgb, var(--zp-primary) 7%, var(--zp-surface)) !important;
}

.ai-check-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--zp-space-3);
  margin-bottom: var(--zp-space-3);
}

.ai-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--zp-border);
  background: var(--zp-surface-2);
  color: var(--zp-text);
  font-weight: 900;
  white-space: nowrap;
}

.ai-status-badge.green {
  border-color: color-mix(in srgb, var(--zp-success) 65%, var(--zp-border));
  background: color-mix(in srgb, var(--zp-success) 18%, var(--zp-surface));
}

.ai-status-badge.yellow {
  border-color: color-mix(in srgb, var(--zp-warning) 70%, var(--zp-border));
  background: color-mix(in srgb, var(--zp-warning) 18%, var(--zp-surface));
}

.ai-status-badge.red {
  border-color: color-mix(in srgb, var(--zp-danger) 70%, var(--zp-border));
  background: color-mix(in srgb, var(--zp-danger) 18%, var(--zp-surface));
}

.ai-loading {
  padding: var(--zp-space-3);
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius-sm);
  background: var(--zp-surface-2);
  font-weight: 800;
}

.ai-result-grid,
.ai-message-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--zp-space-3);
  margin-top: var(--zp-space-3);
}

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

.ai-result-list {
  margin: 0;
  padding-left: 18px;
}

.ai-result-list li {
  margin: 5px 0;
}

.ai-message-grid textarea {
  min-height: 120px;
}

.ai-actions {
  margin-top: var(--zp-space-3);
}

/* Rechnungsarbeitsplatz: dieselben Formulare auf Desktop und Mobil. */
.invoice-page,
.invoice-page-header > *,
.invoice-page form,
.invoice-form-field,
.invoice-item-field {
  min-width: 0;
}

.invoice-page-header .eyebrow,
.invoice-editor-eyebrow {
  margin-bottom: var(--zp-space-2);
  font-weight: 750;
}

.invoice-page-actions {
  max-width: 600px;
  justify-content: flex-end;
}

.invoice-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) repeat(2, minmax(140px, 1fr));
  align-items: end;
  gap: var(--zp-space-3);
}

.invoice-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--zp-space-2);
}

.invoice-filter-hint {
  margin: var(--zp-space-3) 0 0;
}

.invoice-section-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zp-space-3);
  margin: var(--zp-space-5) 0;
}

.invoice-section-links a {
  display: inline-flex;
  gap: var(--zp-space-3);
  padding: var(--zp-space-3) var(--zp-space-4);
  background: var(--zp-surface);
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius);
  font-weight: 750;
}

.invoice-pending-section,
.invoice-issued-section {
  margin: var(--zp-space-6) 0;
  scroll-margin-top: calc(var(--zp-topbar-height) + var(--zp-space-4));
}

.invoice-pending-list,
.invoice-record-list {
  display: grid;
  gap: var(--zp-space-4);
}

.invoice-pending-card,
.invoice-record,
.invoice-empty-state {
  min-width: 0;
  padding: var(--zp-space-5);
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius);
  background: var(--zp-surface);
  overflow-wrap: anywhere;
}

.invoice-pending-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, auto);
  gap: var(--zp-space-4);
  border-left: 4px solid var(--zp-warning);
}

.invoice-pending-card h3,
.invoice-record h3 {
  margin-bottom: var(--zp-space-2);
}

.invoice-pending-card p {
  margin: var(--zp-space-2) 0;
}

.invoice-pending-actions {
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: var(--zp-space-2);
}

.invoice-pending-actions .status-badge {
  justify-self: start;
}

.invoice-pending-total {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.invoice-pending-actions button {
  width: 100%;
}

.invoice-record-paid { border-left: 4px solid var(--zp-success); }
.invoice-record-open { border-left: 4px solid var(--zp-danger); }
.invoice-record-cancelled { border-left: 4px solid var(--zp-muted); }

.invoice-record-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--zp-space-4);
}

.invoice-record-header > * { min-width: 0; }
.invoice-record-header p { margin: 0 0 var(--zp-space-1); }

.invoice-record-primary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--zp-space-2);
}

.invoice-amounts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--zp-space-3);
  padding: var(--zp-space-4) 0;
  margin: var(--zp-space-4) 0 0;
  border-top: 1px solid var(--zp-border);
}

.invoice-amounts dt {
  color: var(--zp-muted);
  font-size: 12px;
  font-weight: 650;
}

.invoice-amounts dd {
  margin: var(--zp-space-1) 0 0;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.invoice-amounts .invoice-due-date { font-size: 16px; }
.invoice-order-links { margin-bottom: var(--zp-space-4); }

.invoice-bundles,
.invoice-profile {
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius);
  background: var(--zp-surface);
  margin-bottom: var(--zp-space-4);
  padding: var(--zp-space-4);
  overflow-wrap: anywhere;
}

.invoice-page summary {
  padding: var(--zp-space-2) 0;
  cursor: pointer;
  font-weight: 750;
  color: var(--bs-link-color);
}

.invoice-page summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--zp-radius-sm);
}

.invoice-record-details { border-top: 1px solid var(--zp-border); }
.invoice-profile p { margin: var(--zp-space-3) 0 0; }

.invoice-record-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: var(--zp-space-4);
  margin-top: var(--zp-space-4);
}

.invoice-record-content h4 {
  font-size: 16px;
  font-weight: 750;
}

.invoice-record-actions { grid-column: 2; grid-row: 1 / span 2; }
.invoice-record-actions .invoice-action-group { margin-bottom: var(--zp-space-3); }
.invoice-record-actions .invoice-action-title { color: var(--zp-muted); }
.invoice-record-actions .invoice-action-buttons form { grid-column: 1 / -1; }

.invoice-record .email-send-form,
.invoice-record .payment-mini-form,
.invoice-record .invoice-action-buttons form {
  display: grid;
  min-width: 0;
  gap: var(--zp-space-2);
}

.invoice-record .email-small { width: 100%; margin-top: 6px; }
.invoice-record .invoice-form-field { display: block; }
.invoice-record .email-send-form + small { display: block; margin-top: var(--zp-space-2); }
.invoice-record .invoice-action-buttons .small { font-size: 13px !important; }

.invoice-bundle-orders {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--zp-space-2);
}

.invoice-bundle-option {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--zp-space-3);
  padding: var(--zp-space-3);
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius-sm);
  cursor: pointer;
}

.invoice-bundle-description { min-width: 0; }
.invoice-bundle-description > b,
.invoice-bundle-description > span:not(.euro-plate) { display: block; }
.invoice-bundle-footer { margin-top: var(--zp-space-4); }
.invoice-empty-state p { margin: var(--zp-space-2) 0 0; }

.invoice-editor-notice {
  padding: var(--zp-space-4);
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius);
  background: var(--zp-surface-2);
  margin-bottom: var(--zp-space-4);
}

.invoice-editor-notice p { margin: var(--zp-space-2) 0 0; }
.invoice-items-heading { margin-top: var(--zp-space-5); }

.invoice-item-row {
  grid-template-columns: minmax(0, 2fr) minmax(60px, .6fr) minmax(90px, .9fr) minmax(70px, .7fr) auto !important;
  align-items: end;
  padding: var(--zp-space-3);
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius-sm);
  background: var(--zp-surface-2);
}

.invoice-item-heading { grid-column: 1 / -1; }
.invoice-item-field { display: block; }
.invoice-item-label { display: block; font-size: 12px; }
.invoice-item-remove { min-height: 40px; border-radius: var(--zp-radius-sm); }
.invoice-edit-form .invoice-edit-order { min-width: 0; overflow-wrap: anywhere; }
.invoice-issued-fields .invoice-edit-calculator { grid-template-columns: minmax(0, 1fr) !important; }

@media (max-width: 1180px) {
  .invoice-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice-filter-query { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .invoice-page-actions { max-width: none; justify-content: flex-start; margin-top: var(--zp-space-4); }
  .invoice-pending-card,
  .invoice-record-content { grid-template-columns: minmax(0, 1fr); }
  .invoice-record-actions { grid-column: auto; grid-row: auto; }
  .invoice-record-header { flex-direction: column; }
  .invoice-record-primary { justify-content: flex-start; }
  .invoice-amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice-item-row { grid-template-columns: minmax(0, 1fr) !important; }
  .invoice-item-remove { justify-self: start; padding: 8px 12px; }
}

@media (max-width: 620px) {
  .invoice-page-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice-page-actions form { grid-column: 1 / -1; }
  .invoice-page-actions form button { width: 100%; }
  .invoice-filters { grid-template-columns: minmax(0, 1fr); }
  .invoice-pending-card,
  .invoice-record { padding: var(--zp-space-4); }
  .invoice-bundles .bundle-card { padding: var(--zp-space-3); }
  .invoice-bundle-option { grid-template-columns: 24px minmax(0, 1fr); }
  .invoice-bundle-option > strong { grid-column: 2; }
  .invoice-bundle-description .euro-plate--compact { min-width: 0; width: 100%; }
  .invoice-bundle-footer button { width: 100%; }
  .invoice-record .invoice-action-buttons { grid-template-columns: minmax(0, 1fr); }
}

.invoice-row-paid,
.invoice-row-unpaid,
.invoice-row-yellow {
  border-left: 4px solid transparent;
}

.invoice-row-paid {
  background: color-mix(in srgb, var(--zp-success) 9%, var(--zp-surface)) !important;
  border-left-color: var(--zp-success);
}

.invoice-row-unpaid {
  background: color-mix(in srgb, var(--zp-danger) 9%, var(--zp-surface)) !important;
  border-left-color: var(--zp-danger);
}

.invoice-row-yellow {
  background: color-mix(in srgb, var(--zp-warning) 10%, var(--zp-surface)) !important;
  border-left-color: var(--zp-warning);
}

.kpi-grid,
.sales-kpi-grid,
.plan-grid,
.billing-summary {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  gap: var(--zp-space-3) !important;
}

.kpi {
  padding: var(--zp-space-4) !important;
}

.kpi span,
.billing-summary span {
  color: var(--zp-muted) !important;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi b {
  display: block;
  margin: 5px 0;
  font-size: 24px;
  color: var(--zp-text);
}

.kpi.important {
  border-color: color-mix(in srgb, var(--zp-warning) 55%, var(--zp-border)) !important;
}

.stats-layout {
  display: grid !important;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: var(--zp-space-6) !important;
  align-items: center;
}

.pie {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  margin: 0 auto;
}

.pie span {
  background: var(--zp-surface) !important;
  border: 1px solid var(--zp-border);
}

.login-body {
  min-height: 100vh;
  display: grid !important;
  place-items: center !important;
  padding: clamp(16px, 3vw, 40px);
  background:
    radial-gradient(circle at 78% 28%, rgba(8, 124, 240, .13), transparent 32%),
    var(--zp-bg) !important;
}

.login-shell {
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: minmax(360px, .82fr) minmax(480px, 1.18fr);
  overflow: hidden;
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius);
  background: var(--zp-surface);
  box-shadow: var(--zp-shadow);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 64px);
}

.login-home-link {
  align-self: flex-start;
  margin-bottom: auto;
  color: var(--zp-muted);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.login-home-link:hover {
  color: #dff2ff;
}

.login-brand {
  margin: var(--zp-space-6) 0;
}

.login-brand b {
  font-size: 16px;
}

.login-brand p {
  margin: 0;
}

.login-heading {
  margin-bottom: var(--zp-space-5);
}

.login-heading h1 {
  max-width: 12ch;
  font-size: clamp(34px, 4vw, 52px);
}

.login-heading > .muted {
  max-width: 48ch;
  margin: 0;
}

.login-eyebrow {
  margin: 0 0 8px;
  color: #55b4ff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-form-card {
  display: grid !important;
  gap: var(--zp-space-3);
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.login-form-card label {
  margin: 0;
}

.login-form-card .form-control {
  min-height: 48px;
}

.login-support {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zp-space-3);
  margin-top: var(--zp-space-3);
}

.login-support p {
  margin: 0;
}

.login-visual {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background: #030b14;
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(2, 9, 17, .92) 100%);
  pointer-events: none;
}

.login-visual > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% center;
}

.login-visual-copy {
  position: absolute;
  z-index: 1;
  right: clamp(24px, 4vw, 52px);
  bottom: clamp(24px, 4vw, 52px);
  left: clamp(24px, 4vw, 52px);
}

.login-visual-copy h2 {
  max-width: 19ch;
  margin-bottom: var(--zp-space-5);
  font-size: clamp(24px, 3vw, 38px);
}

.login-visual-points {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zp-space-2);
}

.login-visual-points span {
  padding: 7px 9px;
  border: 1px solid rgba(85, 180, 255, .32);
  border-radius: var(--zp-radius-sm);
  background: rgba(6, 19, 32, .72);
  color: #dff2ff;
  font-size: 12px;
  font-weight: 750;
  backdrop-filter: blur(8px);
}

.login-box {
  width: min(440px, 94vw) !important;
}

.login-brand {
  margin-bottom: var(--zp-space-4);
}

.login-brand h1 {
  margin-bottom: 2px;
}

.login-box .card {
  display: grid !important;
  gap: var(--zp-space-3);
  padding: var(--zp-space-5) !important;
}

.login-body.mfa-enroll-body {
  padding: clamp(16px, 3vw, 40px);
}

.login-box.mfa-enroll-box {
  width: min(640px, 100%) !important;
  min-width: 0;
}

.mfa-enroll-box .login-brand h1 {
  font-size: clamp(24px, 4vw, 34px);
  overflow-wrap: anywhere;
}

.mfa-enroll-box .card {
  min-width: 0;
  padding: clamp(16px, 3vw, 28px) !important;
}

.mfa-enroll-box h2 {
  margin: 0;
  font-size: 18px;
}

.mfa-setup-steps {
  margin: 0;
  padding-left: 1.4rem;
}

.mfa-setup-steps > li {
  padding-left: 6px;
  min-width: 0;
}

.mfa-setup-steps > li + li {
  margin-top: var(--zp-space-5);
}

.mfa-setup-steps > li::marker {
  color: var(--zp-text);
  font-weight: 800;
}

.mfa-setup-steps h3 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.4;
}

.mfa-setup-steps p {
  margin: 0 0 12px;
  line-height: 1.55;
}

.mfa-app-downloads p {
  margin-bottom: 6px;
}

.mfa-app-downloads a {
  text-underline-offset: 3px;
}

.mfa-qr {
  margin: 16px 0;
  text-align: center;
}

.mfa-qr img {
  display: block;
  width: min(280px, 100%);
  height: auto;
  margin: 0 auto;
  background: #fff;
  image-rendering: pixelated;
}

.mfa-qr figcaption {
  margin-top: 10px;
  font-size: 13px;
}

.mfa-manual-setup {
  padding: 12px;
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius-sm);
}

.mfa-manual-setup summary {
  cursor: pointer;
  font-weight: 700;
}

.mfa-manual-setup summary:focus-visible {
  outline: 2px solid var(--zp-primary);
  outline-offset: 4px;
}

.mfa-manual-setup[open] > summary {
  margin-bottom: 12px;
}

.mfa-manual-setup dl {
  margin: 0 0 12px;
}

.mfa-manual-setup dd {
  margin: 4px 0 12px;
  overflow-wrap: anywhere;
}

.mfa-manual-setup code {
  display: block;
  overflow-wrap: anywhere;
  white-space: normal;
  user-select: all;
}

.mfa-uri-details[open] > summary {
  margin-bottom: 10px;
}

.mfa-confirm-form {
  display: grid;
  gap: 10px;
}

.mfa-confirm-form .form-label,
.mfa-confirm-form .form-control {
  margin: 0;
}

.mfa-confirm-form .form-control {
  max-width: 260px;
  letter-spacing: .15em;
}

.mfa-confirm-form .btn {
  justify-self: start;
  max-width: 100%;
  white-space: normal;
}

.logo-settings {
  grid-template-columns: 240px minmax(0, 1fr) !important;
  gap: var(--zp-space-4) !important;
}

.logo-preview-box,
.logo-placeholder {
  border-radius: var(--zp-radius) !important;
  border-color: var(--zp-border) !important;
  background: var(--zp-surface-2) !important;
}

.logo-preview {
  background: #fff;
  border-radius: var(--zp-radius-sm);
}

.field-needed,
label.region-required {
  outline: 0 !important;
  border: 1px solid color-mix(in srgb, var(--zp-warning) 55%, var(--zp-border));
  border-radius: var(--zp-radius);
  background: color-mix(in srgb, var(--zp-warning) 8%, transparent);
  padding: var(--zp-space-2);
}

input.valid {
  border-color: var(--zp-success) !important;
}

input.invalid {
  border-color: var(--zp-danger) !important;
}

input.warning {
  border-color: var(--zp-warning) !important;
}

.oktext {
  color: #86efac !important;
}

.badtext {
  color: #fca5a5 !important;
}

:root[data-theme="light"] .oktext,
body.light .oktext {
  color: #166534 !important;
}

:root[data-theme="light"] .badtext,
body.light .badtext {
  color: #991b1b !important;
}

.op-hidden,
.person-hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  :root {
    --zp-sidebar-width: 260px;
  }

  .content {
    padding: var(--zp-space-5) !important;
  }

  .grid3,
  .validation-grid.two,
  .reject-grid,
  .stats-layout,
  .invoice-calculator,
  .auto-scan-grid,
  .doc-assistant-layout {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 900px) {
  .topbar {
    height: auto !important;
    min-height: var(--zp-topbar-height);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: var(--zp-space-3) var(--zp-space-4);
    gap: var(--zp-space-3);
  }

  .topbar-brand small {
    max-width: 100%;
  }

  .app-shell {
    display: block !important;
  }

  .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: min(86vw, 330px) !important;
    height: 100dvh !important;
    max-height: none !important;
    border-right: 1px solid var(--zp-border) !important;
    border-bottom: 0 !important;
    box-shadow: var(--zp-shadow);
    transform: translateX(-105%);
    transition: transform .2s ease;
    z-index: 1040;
    overscroll-behavior: contain;
  }

  body.sidebar-open {
    overflow: hidden;
  }

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

  .top-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .content {
    padding: var(--zp-space-4) !important;
  }

  .topline,
  .topline.compact,
  .bundle-head,
  .user-card-head,
  .support-banner,
  .onboarding-head {
    display: block !important;
  }

  .grid2,
  .grid3,
  .grid2.mini,
  .logo-settings {
    grid-template-columns: 1fr !important;
  }

  .item-row {
    grid-template-columns: 1fr !important;
  }

  table {
    min-width: 760px;
  }

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

  .kanban-col {
    min-height: 0;
  }

  .kanban-col > .muted:last-child {
    margin-bottom: 0;
  }

  .search-page-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .search-result-cards {
    display: grid;
    gap: var(--zp-space-3);
  }

  .search-results-desktop {
    display: none;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 430px;
  }
}

.mobile-menu-toggle,
.mobile-menu-close,
.mobile-sidebar-head,
.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .mobile-menu-toggle {
    min-width: 68px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid var(--zp-border);
    border-radius: var(--zp-radius-sm);
    background: var(--zp-surface-2);
    color: var(--zp-text);
  }

  .mobile-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--zp-space-3);
    margin-bottom: var(--zp-space-3);
    padding-bottom: var(--zp-space-3);
    border-bottom: 1px solid var(--zp-border);
  }

  .mobile-menu-close {
    width: auto;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid var(--zp-border);
    border-radius: var(--zp-radius-sm);
    background: var(--zp-surface-2);
    color: var(--zp-text);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1030;
    border: 0;
    background: rgba(2, 6, 23, .66);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

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

@media (max-width: 620px) {
  .login-body {
    padding: 0;
  }

  .login-shell {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .login-panel {
    padding: 24px 20px 28px;
  }

  .login-home-link {
    margin-bottom: 28px;
  }

  .login-visual {
    min-height: 360px;
  }

  .login-support {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 13px;
  }

  h1 {
    font-size: 24px;
  }

  .card,
  .panel,
  .pretty-panel {
    padding: var(--zp-space-4) !important;
  }

  .top-actions,
  .inline-actions,
  .doc-buttons,
  .datefilter {
    align-items: stretch;
  }

  .top-actions > *,
  .inline-actions > *,
  .doc-buttons > *,
  .datefilter > *,
  .datefilter label,
  .datefilter input,
  .datefilter select,
  .datefilter button {
    width: 100%;
  }

  .role-badge {
    display: none !important;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--zp-space-2);
  }

  .top-actions > * {
    width: auto;
    min-width: 0;
    padding: 8px 5px !important;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
  }
}

/* Euro-Kennzeichen-Optik fuer Auftrags- und Kennzeichenlisten */
.euro-plate {
  --plate-height: 40px;
  --plate-band: 34px;
  --plate-expiry: 0px;
  display: inline-grid;
  grid-template-columns: var(--plate-band) minmax(0, 1fr);
  align-items: stretch;
  width: auto;
  min-width: 214px;
  max-width: 100%;
  height: var(--plate-height);
  border: 2px solid #0f172a;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px #f8fafc,
    inset 0 0 0 3px #0f172a,
    0 1px 0 rgba(0,0,0,.14);
  vertical-align: middle;
  margin: 6px 0 2px;
}

.euro-plate--compact {
  --plate-height: 34px;
  --plate-band: 32px;
  min-width: 180px;
  max-width: 224px;
  margin: 5px 0 1px;
}

.euro-plate--large {
  --plate-height: 70px;
  --plate-band: 54px;
  min-width: 440px;
  border-width: 3px;
  border-radius: 8px;
}

.euro-plate--export,
.euro-plate--shortterm {
  --plate-expiry: 48px;
  grid-template-columns: var(--plate-band) minmax(0, 1fr) var(--plate-expiry);
}

.euro-plate--compact.euro-plate--export,
.euro-plate--compact.euro-plate--shortterm {
  --plate-expiry: 40px;
  min-width: 194px;
}

.euro-plate--large.euro-plate--export,
.euro-plate--large.euro-plate--shortterm {
  --plate-expiry: 66px;
}

.euro-plate__band {
  width: var(--plate-band);
  flex: 0 0 var(--plate-band);
  background: linear-gradient(180deg, #064aa5 0%, #0758b8 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  padding: 0;
  border-right: 2px solid #0f172a;
  box-sizing: border-box;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.28);
}

.euro-plate__stars {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  align-self: center;
}

.euro-plate__stars i {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #ffdf00;
  display: block;
  transform: translate(-50%, -50%);
}

.euro-plate__stars i:nth-child(1) { left: 50%; top: 0; }
.euro-plate__stars i:nth-child(2) { left: 68%; top: 6%; }
.euro-plate__stars i:nth-child(3) { left: 82%; top: 22%; }
.euro-plate__stars i:nth-child(4) { left: 88%; top: 50%; }
.euro-plate__stars i:nth-child(5) { left: 82%; top: 78%; }
.euro-plate__stars i:nth-child(6) { left: 68%; top: 94%; }
.euro-plate__stars i:nth-child(7) { left: 50%; top: 100%; }
.euro-plate__stars i:nth-child(8) { left: 32%; top: 94%; }
.euro-plate__stars i:nth-child(9) { left: 18%; top: 78%; }
.euro-plate__stars i:nth-child(10) { left: 12%; top: 50%; }
.euro-plate__stars i:nth-child(11) { left: 18%; top: 22%; }
.euro-plate__stars i:nth-child(12) { left: 32%; top: 6%; }

.euro-plate__country {
  font-size: 13px;
  font-weight: 900;
  line-height: .9;
  letter-spacing: 0;
  text-align: center;
  width: 100%;
}

.euro-plate__text {
  min-width: 0;
  max-width: none;
  flex: 1 1 auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 14px 0;
  box-sizing: border-box;
  font-family: "DIN 1451 Mittelschrift", "Bahnschrift Condensed", "Arial Narrow", "DIN Alternate", "Segoe UI", Arial, sans-serif;
  font-size: 22px;
  font-weight: 900;
  font-stretch: condensed;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
}

.euro-plate--large .euro-plate__text {
  max-width: none;
  font-size: 42px;
  padding: 4px 22px 0;
  letter-spacing: 0;
}

.euro-plate--large .euro-plate__country {
  font-size: 17px;
}

.euro-plate--large .euro-plate__stars {
  width: 24px;
  height: 18px;
  flex-basis: 18px;
}

.euro-plate--large .euro-plate__stars i {
  width: 2.4px;
  height: 2.4px;
}

.euro-plate__expiry {
  display: none;
  width: var(--plate-expiry);
  flex: 0 0 var(--plate-expiry);
  align-self: stretch;
  border-left: 2px solid #0f172a;
  color: #0b0f19;
  font-family: "DIN 1451 Mittelschrift", "Bahnschrift Condensed", "Arial Narrow", "DIN Alternate", "Segoe UI", Arial, sans-serif;
  font-size: 23px;
  font-weight: 900;
  line-height: .92;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  letter-spacing: 0;
}

.euro-plate:not(.euro-plate--export):not(.euro-plate--shortterm) .euro-plate__expiry {
  display: none !important;
}

.euro-plate--export .euro-plate__expiry,
.euro-plate--shortterm .euro-plate__expiry {
  display: flex;
}

.euro-plate--export .euro-plate__expiry {
  background: #ef1d25;
}

.euro-plate--shortterm .euro-plate__expiry {
  background: #f4c928;
}

.euro-plate--export {
  box-shadow:
    inset 0 0 0 1px #f8fafc,
    inset 0 0 0 3px #0f172a,
    0 0 0 2px rgba(239,29,37,.38),
    0 1px 0 rgba(0,0,0,.14);
}

.euro-plate--shortterm {
  box-shadow:
    inset 0 0 0 1px #f8fafc,
    inset 0 0 0 3px #0f172a,
    0 0 0 2px rgba(244,201,40,.55),
    0 1px 0 rgba(0,0,0,.14);
}

.euro-plate--compact .euro-plate__text {
  font-size: 20px;
  padding: 2px 10px 0;
  max-width: none;
}

.euro-plate--compact.euro-plate--export .euro-plate__text,
.euro-plate--compact.euro-plate--shortterm .euro-plate__text {
  font-size: 18px;
  padding-left: 8px;
  padding-right: 8px;
}

.euro-plate--compact .euro-plate__expiry {
  font-size: 18px;
}

.euro-plate--compact .euro-plate__band {
  gap: 2px;
  padding: 0;
}

.euro-plate--compact .euro-plate__stars {
  width: 17px;
  height: 13px;
  flex-basis: 13px;
}

.euro-plate--compact .euro-plate__stars i {
  width: 1.8px;
  height: 1.8px;
}

.euro-plate--compact .euro-plate__country {
  font-size: 12px;
}

.euro-plate--empty {
  min-width: 160px;
  opacity: 1;
}

.euro-plate--empty .euro-plate__text {
  color: transparent;
}

.dash-card .euro-plate,
.order-card .euro-plate {
  display: inline-flex;
}

.dash-card .euro-plate span,
.order-card .euro-plate span {
  margin-top: 0;
}

.order-card .euro-plate {
  max-width: 100%;
}

.euro-plate > .euro-plate__band {
  display: flex;
}

.euro-plate > .euro-plate__text {
  display: flex;
}

.euro-plate > .euro-plate__band > .euro-plate__stars {
  display: block;
}

td .euro-plate {
  margin-top: 0;
  margin-bottom: 0;
}

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

.stat-card {
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: 14px;
  padding: 13px 14px;
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.stat-card b {
  display: block;
  margin: 4px 0;
  font-size: 24px;
  line-height: 1;
}

.plate-bag-card {
  display: grid;
  gap: 6px;
}

.plate-bag-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 6px;
}

.plate-bag-actions .btn {
  width: 100%;
  min-height: 34px;
}

.plate-order-actions {
  min-width: 270px;
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.plate-order-actions label {
  margin: 0;
  font-weight: 800;
}

.plate-order-actions .inline-actions {
  gap: 6px;
}

.plate-order-actions .btn {
  white-space: nowrap;
}

.plate-preview-card {
  border: 1px solid rgba(56,189,248,.35);
  border-radius: 16px;
  background: rgba(56,189,248,.06);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.plate-preview-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

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

.plate-owner-badge {
  min-width: 220px;
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: 14px;
  padding: 12px 14px;
}

.plate-owner-badge span,
.plate-owner-badge b {
  display: block;
}

.plate-owner-badge span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.plate-owner-badge b {
  margin-top: 4px;
  font-size: 18px;
}

.plate-owner-badge.is-hidden {
  display: none;
}

@media(max-width:700px){
  .ai-check-head{display:grid}
  .ai-result-grid,
  .ai-message-grid{grid-template-columns:1fr}
  .euro-plate{max-width:100%}
  .euro-plate__text{max-width:none}
  .euro-plate--large{min-width:0;width:100%;--plate-height:58px;--plate-band:46px}
  .euro-plate--large.euro-plate--export,
  .euro-plate--large.euro-plate--shortterm{--plate-expiry:54px}
  .euro-plate--large .euro-plate__text{font-size:30px;padding-left:10px;padding-right:10px}
  .euro-plate--export .euro-plate__expiry,
  .euro-plate--shortterm .euro-plate__expiry{font-size:20px}
  .plate-owner-badge{width:100%}
}

/* Kundenstamm, Kundenakte und Stammdatenformular. */
.customer-master,
.customer-file,
.customer-editor {
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-workspace-header > div,
.customer-editor-header > div {
  min-width: 0;
}

.customer-workspace-header h1,
.customer-editor-header h1 {
  margin-bottom: 8px;
}

.customer-workspace-header p,
.customer-editor-header p,
.customer-section-heading p {
  margin-bottom: 0;
}

.customer-eyebrow,
.customer-editor-eyebrow {
  display: block;
  margin: 0 0 6px;
  color: var(--zp-muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .03em;
}

.customer-actions,
.customer-editor-actions {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.customer-actions form {
  margin: 0;
}

.customer-actions :is(button, a),
.customer-editor-actions :is(button, a) {
  min-height: 42px;
  white-space: normal;
}

.customer-file-actions,
.customer-editor-header .customer-editor-actions {
  flex: 0 0 auto;
  max-width: 380px;
  justify-content: flex-end;
}

.customer-master-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px 16px;
  padding: 18px;
  margin: 24px 0;
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius);
  background: var(--zp-surface-2);
}

.customer-master-search input {
  min-height: 44px;
}

.customer-master-search > p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
}

.customer-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 16px;
}

.customer-section-heading :is(h2, h3) {
  margin: 0;
}

.customer-section-heading > p {
  font-size: 12px;
}

.customer-search-query {
  margin-bottom: 16px;
}

.customer-record-list,
.customer-history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.customer-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, .85fr);
  gap: 16px 24px;
  padding: 20px;
  background: var(--zp-surface-2);
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius);
}

.customer-record h3,
.customer-file h3 {
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 6px;
}

.customer-record-identity > p:last-of-type {
  margin-bottom: 4px;
  font-size: 12px;
}

.customer-record-contact,
.customer-data-grid,
.customer-history-data {
  display: grid;
  gap: 16px;
  margin: 0;
}

.customer-record dt,
.customer-file dt {
  font-size: 12px;
  color: var(--zp-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.customer-record dd,
.customer-file dd {
  margin: 0;
  font-size: 14px;
}

.customer-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.customer-counts span,
.customer-status {
  display: inline-block;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--zp-border);
  border-radius: 6px;
  background: var(--zp-surface-3);
  color: var(--zp-text);
}

.customer-record-activity p {
  font-size: 12px;
  line-height: 1.8;
  margin: 0;
}

.customer-record-actions {
  grid-column: 1 / -1;
  padding-top: 14px;
  border-top: 1px solid var(--zp-border);
}

.customer-record-actions > a:first-child {
  color: var(--zp-primary-text) !important;
  background: var(--zp-primary-soft) !important;
}

.customer-empty-state {
  padding: 36px 20px;
  border: 1px dashed var(--zp-border);
  border-radius: var(--zp-radius);
  text-align: center;
}

.customer-empty-state p {
  max-width: 560px;
  margin: 10px auto 20px;
}

.customer-back-link {
  display: inline-block;
  padding: 4px 0;
  margin-bottom: 18px;
}

.customer-file-nav,
.customer-editor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
  margin-bottom: 8px;
  border-top: 1px solid var(--zp-border);
}

.customer-file-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius-sm);
  background: var(--zp-surface-2);
  text-decoration: none;
}

.customer-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}

.customer-summary > a {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius);
  background: var(--zp-surface-2);
  color: var(--zp-text);
  text-decoration: none;
}

.customer-summary > a:hover,
.customer-file-nav a:hover {
  border-color: var(--zp-primary);
  background: var(--zp-primary-soft);
}

.customer-summary strong {
  font-size: 28px;
  line-height: 1.3;
}

.customer-summary span,
.customer-summary small {
  color: var(--zp-muted);
  font-size: 12px;
}

.customer-file-section,
.customer-editor-section {
  scroll-margin-top: calc(var(--zp-topbar-height) + 24px);
}

.customer-data-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-data-grid > div {
  padding: 12px 0;
}

.customer-data-wide {
  grid-column: span 2;
}

.customer-data-grid dd small {
  display: block;
  font-size: 12px;
  color: var(--zp-muted);
  margin-top: 6px;
}

.customer-notes {
  white-space: pre-wrap;
}

.customer-details {
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius-sm);
  background: var(--zp-surface-2);
}

.customer-details > summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 14px;
  color: var(--zp-text);
  font-weight: 600;
}

.customer-details > summary:hover {
  background: var(--zp-primary-soft);
}

.customer-details > form,
.customer-details > dl {
  padding: 16px;
  margin: 0;
  border-top: 1px solid var(--zp-border);
}

.customer-profile-details {
  margin-top: 16px;
}

.customer-file .customer-doc-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.customer-file .customer-doc-card {
  padding: 18px;
  gap: 10px;
  background: var(--zp-surface-2);
  border-color: var(--zp-border);
  border-radius: var(--zp-radius);
}

.customer-doc-card > p,
.customer-doc-card h3 {
  margin-bottom: 0;
}

.customer-doc-card > .muted {
  font-size: 12px;
}

.customer-document-edit {
  margin-top: 4px;
}

.customer-document-edit h4 {
  margin: 0;
  font-size: 14px;
}

.customer-file .grid3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 16px;
}

.customer-document-edit .grid3,
.customer-document-edit .grid2 {
  margin: 12px 0 16px;
}

.customer-file .grid2,
.customer-editor .grid2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.customer-file label,
.customer-editor label,
.customer-file input,
.customer-editor input {
  min-width: 0;
}

.customer-file input[type="file"] {
  max-width: 100%;
  font-size: 12px;
}

.customer-file input[type="file"]::file-selector-button {
  max-width: 100%;
}

.customer-history-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.customer-history-record {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius-sm);
  background: var(--zp-surface-2);
}

.customer-history-data {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.customer-section-empty {
  padding: 12px 0;
  margin: 0;
}

.customer-editor-section-heading p,
.customer-editor-help {
  font-size: 13px;
}

.customer-editor-savebar {
  gap: 16px;
}

@media (max-width: 1200px) {
  .customer-record {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .customer-record-activity {
    grid-column: 1 / -1;
  }

  .customer-file-actions,
  .customer-editor-header .customer-editor-actions {
    max-width: 220px;
  }
}

@media (max-width: 900px) {
  .customer-workspace-header,
  .customer-editor-header {
    flex-direction: column;
  }

  .customer-file-actions,
  .customer-editor-header .customer-editor-actions {
    max-width: none;
    justify-content: flex-start;
  }

  .customer-file .grid3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .customer-master-search {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

  .customer-record {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }

  .customer-record-contact,
  .customer-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-record-actions > *,
  .customer-record-actions button {
    flex: 1 1 auto;
  }

  .customer-record-actions form button {
    width: 100%;
  }

  .customer-data-grid,
  .customer-history-list,
  .customer-file .grid2,
  .customer-editor .grid2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-data-wide {
    grid-column: auto;
  }

  .customer-data-grid > div {
    padding: 4px 0;
  }

  .customer-editor-actions {
    width: 100%;
  }

  .customer-editor-actions > * {
    flex: 1 1 auto;
  }
}

@media (max-width: 480px) {
  .customer-record-contact,
  .customer-history-data {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-summary > a {
    padding: 12px;
  }
}

/* Workflow: Auftragsstand, Suche und getrennte Abrechnungsübersicht. */
.workflow-workspace {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workflow-header,
.workflow-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 20px;
}

.workflow-header > div {
  min-width: 0;
}

.workflow-header h1 {
  margin-bottom: 8px;
}

.workflow-header p,
.workflow-section-heading p {
  margin-bottom: 0;
}

.workflow-eyebrow {
  color: var(--zp-muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .03em;
  margin: 0 0 6px !important;
}

.workflow-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.workflow-header > .workflow-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  max-width: 380px;
}

.workflow-actions :is(a, button) {
  min-height: 44px;
  white-space: normal;
}

.workflow-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px 16px;
  padding: 18px;
  margin: 24px 0;
  background: var(--zp-surface);
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius);
}

.workflow-search > p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
}

.workflow-search label {
  min-width: 0;
}

.workflow-section-heading {
  flex-wrap: wrap;
  align-items: baseline;
  margin-bottom: 14px;
}

.workflow-section-heading h2 {
  margin: 0;
}

.workflow-section-heading p {
  font-size: 12px;
}

.workflow-workspace .workflow-summary > div {
  padding: 0;
}

.workflow-summary a {
  display: block;
  height: 100%;
  padding: 16px;
  border-radius: var(--zp-radius);
  color: var(--zp-text);
  text-decoration: none;
}

.workflow-summary a:hover {
  background: var(--zp-primary-soft);
}

.workflow-workspace .workflow-summary span {
  text-transform: none;
  font-weight: 600;
}

.workflow-workspace .workflow-summary b {
  margin: 8px 0;
}

.workflow-summary small {
  color: var(--zp-muted);
  font-size: 12px;
}

.workflow-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}

.workflow-section-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius-sm);
  background: var(--zp-surface);
  text-decoration: none;
}

.workflow-section-nav a:hover {
  border-color: var(--zp-primary);
}

.workflow-section,
.workflow-lane {
  scroll-margin-top: calc(var(--zp-topbar-height) + 28px);
}

.workflow-section {
  margin: 28px 0;
}

.workflow-workspace .kanban {
  align-items: start;
}

.workflow-workspace .workflow-active-board {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.workflow-workspace .workflow-lane {
  padding: 14px !important;
  min-height: 160px;
  border-top: 3px solid var(--zp-border) !important;
}

.workflow-workspace .workflow-lane--offen {
  border-top-color: var(--zp-primary) !important;
}

.workflow-workspace .workflow-lane--amt {
  border-top-color: var(--zp-info) !important;
}

.workflow-workspace .workflow-lane--abholung {
  border-top-color: var(--zp-warning) !important;
}

.workflow-workspace .workflow-lane--fertig {
  border-top-color: var(--zp-success) !important;
}

.workflow-lane-heading {
  margin-bottom: 16px;
}

.workflow-lane-heading h3 {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 4px;
}

.workflow-lane-heading p {
  font-size: 12px;
  margin: 0;
}

.workflow-count {
  display: inline-block;
  flex: 0 0 auto;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 650;
  border: 1px solid var(--zp-border);
  border-radius: 6px;
  color: var(--zp-text);
  background: var(--zp-surface-3);
}

.workflow-order-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.workflow-order-list > li {
  min-width: 0;
}

.workflow-workspace .workflow-order {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 14px;
  height: 100%;
}

.workflow-order-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

.workflow-order-heading :is(h3, h4) {
  font-size: 14px;
  font-weight: 750;
  margin: 0;
  line-height: 1.5;
}

.workflow-order .workflow-status {
  display: inline-block;
  padding: 3px 7px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--zp-text);
  background: var(--zp-surface-3);
  border: 1px solid var(--zp-border);
  border-radius: 6px;
}

.workflow-order p {
  margin: 0;
}

.workflow-order-customer {
  font-weight: 650;
  line-height: 1.5;
}

.workflow-order-meta,
.workflow-order-invoice {
  font-size: 12px;
  line-height: 1.6;
  color: var(--zp-muted);
}

.workflow-workspace .workflow-order .euro-plate {
  max-width: 100%;
  margin: 0;
}

.workflow-order .workflow-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  width: 100%;
  padding: 10px 0 0;
  margin-top: auto;
  border-top: 1px solid var(--zp-border);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.workflow-order .workflow-open:hover {
  text-decoration: underline;
}

.workflow-lane-empty {
  padding: 12px 0 4px;
  margin: 0;
  font-size: 13px;
}

.workflow-overview-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workflow-details {
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-radius);
  background: var(--zp-surface);
}

.workflow-details > summary {
  min-height: 52px;
  padding: 16px;
  color: var(--zp-text);
  cursor: pointer;
  font-weight: 650;
}

.workflow-details > summary > span {
  margin-inline-end: 10px;
}

.workflow-details > summary > .muted {
  font-size: 12px;
  font-weight: 400;
}

.workflow-details > summary:hover {
  background: var(--zp-primary-soft);
}

.workflow-details > .kanban,
.workflow-details > .workflow-order-list {
  padding: 0 16px 16px;
}

.workflow-workspace :is(.workflow-history-board, .workflow-billing-board) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.workflow-details > .workflow-billing-help {
  margin: 0;
  padding: 0 16px 16px;
  font-size: 12px;
}

.workflow-billing-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--zp-border);
  border-left: 3px solid var(--zp-warning);
  border-radius: var(--zp-radius);
  background: var(--zp-surface);
}

.workflow-billing-notice h3 {
  font-size: 16px;
  margin: 0 0 6px;
}

.workflow-billing-notice p {
  color: var(--zp-muted);
  font-size: 13px;
  margin: 0;
}

.workflow-billing-notice > a {
  flex: 0 0 auto;
}

.workflow-empty-state {
  text-align: center;
}

@media (max-width: 1300px) {
  .workflow-workspace .workflow-active-board {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .workflow-overview-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .workflow-header {
    flex-direction: column;
  }

  .workflow-header > .workflow-actions {
    max-width: none;
    justify-content: flex-start;
  }

  .workflow-billing-notice {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .workflow-search {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }

  .workflow-workspace :is(.workflow-active-board, .workflow-history-board, .workflow-billing-board),
  .workflow-overview-list {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .workflow-workspace .workflow-lane {
    min-height: 0;
  }

  .workflow-summary a {
    padding: 14px;
  }
}
