/* ==========================================================================
   AtlasConnect – Kasten-Design, Mobile First
   ========================================================================== */
:root {
  /* Markenpalette – abgeleitet aus dem Atlas-Connect-Logo (#73c7d5) */
  --brand: #73c7d5; /* Logo-Teal (Akzent) */
  --brand-deep: #0f2e36; /* Dunkles Teal/Slate (Logo dunkle Balken) */

  --bg: #eef3f5;
  --surface: #ffffff;
  --surface-2: #f5f9fa;
  --border: #dde7ea;
  --text: #0f2e36;
  --muted: #5b7884;
  --primary: #1f8ea3; /* Aktionsfarbe (kräftigeres Teal) */
  --primary-dark: #176d7e;
  --primary-soft: #e4f5f8; /* Hintergrund aktiver Elemente */
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow:
    0 1px 2px rgba(15, 46, 54, 0.06), 0 10px 30px rgba(15, 46, 54, 0.08);
  --shadow-sm: 0 1px 2px rgba(15, 46, 54, 0.08);
  --ring: 0 0 0 3px rgba(31, 142, 163, 0.18);
  --header-h: 62px;
  --impersonation-offset: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: clip;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---------- Auth-Layout (gebrandeter Login) ---------- */
.auth-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 32px 20px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(
      900px 500px at 50% -10%,
      rgba(115, 199, 213, 0.28),
      transparent 60%
    ),
    radial-gradient(
      600px 500px at 110% 110%,
      rgba(115, 199, 213, 0.18),
      transparent 55%
    ),
    linear-gradient(160deg, #0b272e 0%, #103d48 55%, #0c2d35 100%);
}
/* dezente Lichtflecken */
.auth-wrap::before,
.auth-wrap::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
}
.auth-wrap::before {
  width: 280px;
  height: 280px;
  background: #73c7d5;
  top: -80px;
  left: -60px;
}
.auth-wrap::after {
  width: 320px;
  height: 320px;
  background: #1f8ea3;
  bottom: -120px;
  right: -80px;
  opacity: 0.25;
}

.auth-hero {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.auth-logo {
  width: 230px;
  max-width: 70vw;
  height: auto;
  display: block;
}
.auth-tagline {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 410px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(5, 28, 34, 0.45);
  padding: 30px 26px;
}
.auth-card h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

/* Markenkopf (App-Header & Fallback) */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.brand .mark {
  height: 30px;
  width: auto;
  display: block;
}
.brand .dot {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--brand));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
}
.brand .brand-text {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28em;
}
.brand .brand-text b {
  color: var(--brand-deep);
}
.brand .brand-text span {
  color: var(--primary);
}
.auth-sub {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 14px;
}

/* ---------- Formularelemente ---------- */
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.input,
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 15px;
  color: var(--text);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
textarea {
  resize: vertical;
  min-height: 80px;
}

/* Custom Select (Formular-Dropdown) */
.custom-select {
  position: relative;
}
.custom-select.disabled {
  opacity: 0.65;
  pointer-events: none;
}
.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}
.cs-trigger:hover:not(:disabled) {
  background: var(--surface-2);
}
.custom-select:not(.disabled) .cs-trigger[aria-expanded="true"],
.cs-trigger:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.cs-value {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-value.placeholder {
  color: var(--muted);
}
.cs-caret {
  color: var(--muted);
  font-size: 11px;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.cs-trigger[aria-expanded="true"] .cs-caret {
  transform: rotate(180deg);
}
.cs-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  max-height: 240px;
  overflow: auto;
}
.cs-menu[hidden] {
  display: none;
}
.custom-select.searchable .cs-menu {
  max-height: 280px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cs-search-wrap {
  padding: 4px 4px 8px;
  flex-shrink: 0;
}
.cs-search {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
}
.custom-select.searchable .cs-options {
  overflow: auto;
  max-height: 220px;
  flex: 1;
  min-height: 0;
}
.cs-empty {
  padding: 10px 12px;
  margin: 0;
  text-align: center;
}
.cs-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  color: var(--text);
}
.cs-option:hover {
  background: var(--surface-2);
}
.cs-option.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
}
.cs-option.active::after {
  content: "✓";
  color: var(--primary);
  font-weight: 800;
  flex-shrink: 0;
}
.cs-option[hidden] {
  display: none !important;
}

.custom-select.cs-tiles .cs-trigger {
  align-items: flex-start;
  min-height: 52px;
}
.custom-select.cs-tiles .cs-value {
  white-space: normal;
}
.custom-select.cs-tiles.searchable .cs-menu {
  max-height: none;
}
.custom-select.cs-tiles.searchable .cs-options {
  max-height: min(420px, 52vh);
  padding: 2px;
}
.cs-group {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
}
.cs-option.cs-option-rich {
  align-items: stretch;
  padding: 3px;
  margin: 0;
  background: transparent;
}
.cs-option.cs-option-rich.active {
  background: transparent;
  color: inherit;
  font-weight: inherit;
}
.cs-option.cs-option-rich.active::after {
  display: none;
}
.cs-order-tile {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--border);
  transition:
    border-color 0.12s,
    box-shadow 0.12s,
    background 0.12s;
}
.cs-order-tile.is-open {
  box-shadow: inset 3px 0 0 var(--primary);
}
.cs-order-tile.is-in_progress {
  box-shadow: inset 3px 0 0 var(--warning);
}
.cs-order-tile.is-on_hold {
  box-shadow: inset 3px 0 0 var(--muted);
}
.cs-order-tile.is-completed {
  box-shadow: inset 3px 0 0 var(--success);
}
.cs-order-tile.is-cancelled {
  box-shadow: inset 3px 0 0 var(--danger);
  opacity: 0.78;
}
.cs-order-tile.is-overdue {
  background: var(--danger-bg);
}
.cs-option:hover .cs-order-tile,
.cs-option.active .cs-order-tile {
  border-color: var(--primary);
}
.cs-option.active .cs-order-tile {
  background: var(--primary-soft);
}
.cs-option.active .cs-order-tile.is-overdue {
  background: #fde8e8;
}
.cs-order-tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.cs-order-tile-num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}
.cs-order-tile-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-top: 3px;
  line-height: 1.3;
}
.cs-order-tile-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.cs-order-tile .chips {
  margin-top: 8px;
}
.cs-order-mini {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cs-order-mini-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cs-order-mini-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}
.cs-order-mini-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.cs-order-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
}
.cs-order-open:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ord-open-selected {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  text-decoration: none;
}
.ord-open-selected:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.05s;
}
.btn:hover {
  background: var(--primary-dark);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn.secondary:hover {
  background: var(--surface-2);
}
.btn.danger {
  background: var(--danger);
}
.btn.danger:hover {
  background: #b91c1c;
}
.btn.sm {
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
}
.btn.ghost {
  background: transparent;
  color: var(--primary);
  border-color: transparent;
  width: auto;
  padding: 6px 8px;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Logo-Auswahl ---------- */
.logo-pick {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-preview {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
  text-align: center;
  padding: 4px;
}
.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.logo-preview img.logo-fallback {
  opacity: 0.55;
  padding: 12px;
}
.logo-pick-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.logo-pick-actions .btn {
  width: auto;
}

/* ---------- Meldungen ---------- */
.alert {
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14px;
  margin-bottom: 14px;
  display: none;
}
.alert.show {
  display: block;
}
.alert.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}
.alert.success {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}
.alert.info {
  background: #eff6ff;
  color: var(--primary-dark);
  border: 1px solid #bfdbfe;
}

.muted {
  color: var(--muted);
}
.text-center {
  text-align: center;
}
.mt {
  margin-top: 14px;
}
.small {
  font-size: 13px;
}

/* ==========================================================================
   App-Shell (eingeloggter Bereich)
   ========================================================================== */
.app-header {
  position: sticky;
  top: var(--impersonation-offset, 0px);
  z-index: 30;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
}
.app-header {
  border-top: 3px solid var(--brand);
}
.app-header .brand {
  font-size: 16px;
  margin: 0;
}
.app-header .brand:hover {
  text-decoration: none;
}
.app-header .brand .mark {
  height: 26px;
}
.app-header .brand .dot {
  width: 26px;
  height: 26px;
  font-size: 14px;
}
@media (max-width: 420px) {
  .app-header .brand .brand-text {
    display: none;
  }
}
.header-spacer {
  flex: 1;
}
.header-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 220px;
  height: 40px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.header-identity-avatar,
.header-identity-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}
.header-identity-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.header-identity-photo {
  object-fit: cover;
  display: block;
}
.header-identity-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 520px) {
  .header-identity {
    max-width: 148px;
    padding-right: 10px;
  }
}
.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  padding: 0;
}
.icon-btn:hover {
  background: var(--surface-2);
}
.icon-btn:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.svg-ic {
  display: block;
  flex-shrink: 0;
  color: currentColor;
}

/* Profil-Wechsler (Custom-Dropdown mit Logo) */
.profile-switch {
  position: relative;
}
.profile-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 240px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}
.profile-trigger:hover {
  background: var(--surface-2);
}
.profile-trigger .mark {
  height: 24px;
  width: auto;
  max-width: 44px;
  object-fit: contain;
  flex-shrink: 0;
}
.pt-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
  min-width: 0;
}
.pt-company {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.pt-profile {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.pt-caret {
  color: var(--muted);
  font-size: 11px;
  margin-left: 2px;
  transition: transform 0.15s;
}
.profile-trigger[aria-expanded="true"] .pt-caret {
  transform: rotate(180deg);
}

.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 45;
  width: 290px;
  max-width: 88vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  max-height: 72vh;
  overflow: auto;
}
.profile-menu[hidden] {
  display: none;
}
.pm-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 8px 10px 4px;
}
.pm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}
.pm-item:hover {
  background: var(--surface-2);
}
.pm-item.active {
  background: var(--primary-soft);
}
.pm-item .mark {
  height: 28px;
  width: auto;
  max-width: 44px;
  object-fit: contain;
  flex-shrink: 0;
}
.pm-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
  flex: 1;
}
.pm-company {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-profile {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-check {
  color: var(--primary);
  font-weight: 800;
}
.pm-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}
.pm-action {
  color: var(--primary-dark);
  font-weight: 600;
}
.pm-action .pm-ic {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .pt-text {
    display: none;
  }
  .profile-trigger {
    max-width: none;
  }
}

/* Layout: Sidebar + Content */
.layout {
  display: flex;
  min-height: calc(100dvh - var(--header-h));
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.sidebar {
  width: 230px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-h) + var(--impersonation-offset, 0px));
  align-self: flex-start;
  max-height: calc(100dvh - var(--header-h) - var(--impersonation-offset, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 3px;
}
.nav a .ic {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}
.nav a:hover .ic {
  color: var(--text);
}
.nav a:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.nav a.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.nav a.active .ic {
  color: var(--primary-dark);
}
/* Aufklappbare Gruppen: standardmäßig offen; Chevron klappt zu */
.nav-group {
  margin-bottom: 3px;
}
.nav a.nav-group-parent {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-group-parent .nav-group-label {
  flex: 1;
  min-width: 0;
}
.nav-group-parent .nav-chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  display: inline-flex;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.nav-group-parent:hover .nav-chevron {
  color: var(--text);
}
.nav-group-parent.active .nav-chevron {
  color: var(--primary-dark);
}
.nav-group:not(.open) .nav-chevron {
  transform: rotate(-90deg);
}
.nav-subs {
  display: none;
  padding-top: 2px;
}
.nav-group.open .nav-subs {
  display: block;
}
@media (hover: hover) and (pointer: fine) {
  .nav-group:hover .nav-subs {
    display: block;
  }
  .nav-group:hover .nav-chevron {
    transform: none;
  }
}

/* Unter-Navigation (z. B. Rollen & Rechte unter Benutzer) */
.nav a.sub {
  margin-left: 18px;
  padding-left: 14px;
  font-size: 13px;
  font-weight: 600;
  border-left: 2px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.nav a.sub .ic {
  width: 18px;
  height: 18px;
}
.nav a.sub.active {
  border-left-color: var(--primary);
}
.nav .sep {
  height: 1px;
  background: var(--border);
  margin: 10px 6px;
}
.nav .label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 14px 12px 5px;
  margin-top: 2px;
  user-select: none;
}
.nav .label:first-child {
  padding-top: 4px;
  margin-top: 0;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 18px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}
.page-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
}
.page-sub {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 14px;
}
.page-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head .grow {
  flex: 1;
  min-width: 0;
}

/* ---------- Karten (Kasten-Design) ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
}

.grid {
  display: grid;
  gap: 14px;
}
.grid.cols-2 {
  grid-template-columns: 1fr;
}
.grid.cols-3 {
  grid-template-columns: 1fr;
}
.grid.stats {
  grid-template-columns: repeat(2, 1fr);
}

/* ---------- Dashboard (Admin + Mitarbeiter) – mobile first ---------- */
.dash {
  --dash-gap: 14px;
  display: grid;
  gap: 22px;
  max-width: 1180px;
  min-width: 0;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

/* Kopf */
.dash-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}
.dash-hero-text {
  min-width: 0;
  flex: 1;
}
.dash-hero-eyebrow {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: capitalize;
}
.dash-hero-title {
  margin: 0;
  font-size: clamp(1.4rem, 5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--brand-deep);
  overflow-wrap: anywhere;
}
.dash-hero-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  line-height: 1.35;
}
.dash-hero-sep {
  color: var(--border);
}
.dash-hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: var(--primary-soft);
}
.dash-hero-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}
.dash-hero-chip::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.dash-hero-chip.is-ok {
  color: #166534;
  background: #ecfdf3;
  border-color: #bbf7d0;
}
.dash-hero-chip.is-warn {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fed7aa;
}
.dash-hero-chip.is-danger {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

/* Sektionen */
.dash-sec {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: start;
}
.dash-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
  min-height: 20px;
}
.dash-sec-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.dash-sec-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-deep);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.dash-sec-link {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 46, 54, 0.04);
  min-width: 0;
  overflow: hidden;
}

/* Kernzahlen („Heute“) */
.dash-pulse {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.dash-pulse-item {
  --pulse-ink: var(--brand-deep);
  --pulse-ic-bg: var(--surface-2);
  --pulse-ic: var(--muted);
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px 14px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 46, 54, 0.04);
  color: inherit;
  text-decoration: none;
  animation: dash-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 30ms);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.dash-pulse-item:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}
.dash-pulse-item.is-accent {
  --pulse-ic-bg: var(--primary-soft);
  --pulse-ic: var(--primary-dark);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}
.dash-pulse-item.is-warn {
  --pulse-ic-bg: #fff7ed;
  --pulse-ic: #c2410c;
}
.dash-pulse-item.is-danger .dash-pulse-hint {
  color: #b91c1c;
  font-weight: 600;
}
.dash-pulse-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.dash-pulse-l {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-pulse-ic {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pulse-ic-bg);
  color: var(--pulse-ic);
  flex-shrink: 0;
}
.dash-pulse-n {
  font-size: clamp(1.7rem, 7vw, 2.1rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--pulse-ink);
  margin-top: 2px;
}
.dash-pulse-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
  min-height: 1.3em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hauptbereich: Handlungsbedarf + Seitenleiste */
.dash-main {
  display: grid;
  gap: 22px;
  min-width: 0;
}
.dash-side {
  display: grid;
  gap: 22px;
  min-width: 0;
  align-content: start;
}

/* Handlungsbedarf */
.dash-ok {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 14px;
  color: #166534;
  font-size: 13.5px;
  font-weight: 600;
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.dash-ok-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  flex-shrink: 0;
}
.dash-todo {
  display: grid;
}
.dash-todo-row {
  --todo-ink: var(--primary-dark);
  --todo-bg: var(--primary-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px 10px 14px;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid var(--border);
  position: relative;
  animation: dash-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 24ms);
  transition: background 0.15s ease;
}
.dash-todo-row:first-child {
  border-top: 0;
}
.dash-todo-row:hover {
  text-decoration: none;
  background: var(--surface-2);
}
.dash-todo-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--todo-ink);
}
.dash-todo-row.is-danger {
  --todo-ink: #dc2626;
  --todo-bg: #fef2f2;
}
.dash-todo-row.is-warn {
  --todo-ink: #d97706;
  --todo-bg: #fff7ed;
}
.dash-todo-row.is-info {
  --todo-ink: var(--primary);
  --todo-bg: var(--primary-soft);
}
.dash-todo-ic {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--todo-bg);
  color: var(--todo-ink);
  flex-shrink: 0;
}
.dash-todo-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.dash-todo-l {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--brand-deep);
}
.dash-todo-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}
.dash-todo-n {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--todo-ink);
  flex-shrink: 0;
}
.dash-todo-go {
  color: var(--muted);
  opacity: 0.6;
  flex-shrink: 0;
  display: inline-flex;
}

/* Auftrags-Pipeline */
.dash-pipe {
  padding: 14px;
  display: grid;
  gap: 12px;
}
.dash-pipe-total {
  font-size: 13.5px;
  color: var(--text);
}
.dash-pipe-total strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--brand-deep);
  margin-right: 2px;
}
.dash-pipe-muted {
  color: var(--muted);
  font-size: 12.5px;
}
.dash-pipe-bar {
  display: flex;
  gap: 3px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
}
.dash-pipe-seg {
  min-width: 6px;
  border-radius: 999px;
  background: var(--border);
}
.dash-pipe-seg.is-open,
.dash-pipe-legend .is-open .dash-pipe-dot {
  background: var(--primary);
}
.dash-pipe-seg.is-in_progress,
.dash-pipe-legend .is-in_progress .dash-pipe-dot {
  background: #f59e0b;
}
.dash-pipe-seg.is-on_hold,
.dash-pipe-legend .is-on_hold .dash-pipe-dot {
  background: #94a3b8;
}
.dash-pipe-seg.is-completed,
.dash-pipe-legend .is-completed .dash-pipe-dot {
  background: #16a34a;
}
.dash-pipe-seg.is-empty {
  background: var(--surface-2);
  border: 1px dashed var(--border);
}
.dash-pipe-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}
.dash-pipe-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
}
.dash-pipe-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-pipe-lbl {
  color: var(--muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-pipe-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-deep);
}

/* Bestand */
.dash-res {
  display: grid;
}
.dash-res-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 9px 14px;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid var(--border);
  transition: background 0.15s ease;
}
.dash-res-row:first-child {
  border-top: 0;
}
.dash-res-row:hover {
  text-decoration: none;
  background: var(--surface-2);
}
.dash-res-ic {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--muted);
  flex-shrink: 0;
}
.dash-res-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0;
}
.dash-res-l {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-deep);
  line-height: 1.25;
}
.dash-res-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}
.dash-res-n {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--brand-deep);
  flex-shrink: 0;
}
.dash-res-row.is-warn .dash-res-n,
.dash-res-row.is-warn .dash-res-sub {
  color: #c2410c;
}
.dash-res-row.is-warn .dash-res-ic {
  background: #fff7ed;
  color: #c2410c;
}
.dash-res-row.is-ok .dash-res-n {
  color: #16a34a;
}

/* Listen-Panels */
.dash-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}
.dash-panels-quiet {
  display: grid;
  gap: 8px;
}
.dash-panel-empty {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 11px 14px;
  background: var(--surface-2);
  border-style: dashed;
  box-shadow: none;
}
.dash-panel-empty-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.dash-panel-empty-text {
  font-size: 12.5px;
  color: var(--muted);
}
.dash-feed {
  display: grid;
}
.dash-feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  min-height: 52px;
  border-top: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}
.dash-feed-item:first-child {
  border-top: 0;
}
.dash-feed-item:hover {
  text-decoration: none;
  background: var(--surface-2);
}
.dash-feed-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.dash-feed-name {
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--brand-deep);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-feed-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-feed-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.dash-feed-badge.is-danger {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}
.dash-feed-badge.is-warn {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}
.dash-feed-badge.is-ok {
  color: #166534;
  background: #ecfdf3;
  border-color: #bbf7d0;
}
.dash-feed-badge.is-info {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
}

/* Schnellzugriff als Chips */
.dash-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dash-quick-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 12px 7px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dash-quick-item:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  background: var(--primary-soft);
}
.dash-quick-ic {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  flex-shrink: 0;
}

@keyframes dash-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dash-pulse-item,
  .dash-todo-row {
    animation: none;
  }
}

/* Berichte-Übersicht: KPI-Kacheln (nicht mit Dashboard-Karten verwechseln) */
.dash-kpis {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.dash-kpis-alert,
.dash-kpis-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.kpi {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 46, 54, 0.04);
}
.kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  flex-shrink: 0;
}
.kpi-body {
  min-width: 0;
  flex: 1;
}
.kpi .n {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--brand-deep);
}
.kpi .l {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kpi-tone {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 3px 7px;
  white-space: nowrap;
}
.kpi-tone-empty {
  visibility: hidden;
}
.kpi.warn {
  border-color: #fde68a;
  background: #fffbeb;
}
.kpi.warn .n,
.kpi.warn .kpi-tone {
  color: #b45309;
}
.kpi.warn .kpi-icon,
.kpi.warn .kpi-tone {
  background: #fff8eb;
}
.kpi.danger {
  border-color: #fecaca;
  background: #fef2f2;
}
.kpi.danger .n,
.kpi.danger .kpi-tone {
  color: #b91c1c;
}
.kpi.accent {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  background: linear-gradient(165deg, #fff 0%, var(--primary-soft) 160%);
}

/* Legacy .stat (falls woanders genutzt) */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.stat .n {
  font-size: 28px;
  font-weight: 800;
}
.stat .l {
  color: var(--muted);
  font-size: 13px;
}

/* Listen als Karten (Mobile First) */
.list {
  display: grid;
  gap: 10px;
}
.list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}
.list-card .avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-soft), #cfeef3);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.list-card .grow {
  flex: 1;
  min-width: 0;
}
a.list-card {
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
a.list-card:hover {
  text-decoration: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.list-card .name {
  font-weight: 700;
  overflow-wrap: break-word;
  word-break: normal;
}
.list-card .sub {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: break-word;
  word-break: normal;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  max-width: 100%;
  overflow-wrap: break-word;
}
.badge.green {
  background: #f0fdf4;
  color: var(--success);
  border-color: #bbf7d0;
}
.badge.red {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #fecaca;
}
.badge.amber {
  background: #fffbeb;
  color: var(--warning);
  border-color: #fde68a;
}
.badge.blue {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: #bfe6ec;
}
.badge.teal {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: #bfe6ec;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  min-width: 0;
}

/* ---------- Modal / Dialog ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: 0;
}
.modal-backdrop.show {
  display: flex;
}
.modal {
  background: var(--surface);
  width: 100%;
  max-width: 560px;
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow);
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: slideUp 0.2s ease;
}
.modal-wide {
  max-width: 720px;
}
.modal-sm {
  max-width: 440px;
}
.modal-contract {
  max-width: min(880px, 96vw);
}
.modal-contract-preview {
  max-width: min(900px, 96vw);
}
.contract-preview-frame {
  width: 100%;
  height: min(70vh, 720px);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #e9eef2;
}
.placeholder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 10px;
}
.placeholder-chip {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
}
.placeholder-chip:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}
.contract-body-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  min-height: 240px;
  white-space: pre-wrap;
}
.modal-import {
  max-width: min(1120px, 96vw);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-import .modal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-import .modal-foot {
  flex-shrink: 0;
}
#import-step-review {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.import-review-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(340px, 1fr);
  gap: 16px;
  overflow: hidden;
}
.import-pdf-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(92dvh - 170px);
}
.import-pdf-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.import-pdf-head .grow {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.import-pdf-view {
  flex: 1;
  min-height: 0;
  background: #fff;
}
.import-pdf-frame,
.import-pdf-embed {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  border: 0;
}
.import-pdf-embed iframe {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border: 0;
}
.import-form-panel {
  min-height: 0;
  max-height: calc(92dvh - 170px);
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}
.import-form-panel .card-title {
  margin-top: 4px;
}
#import-emp-wrap,
#imp-emp-wrap {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--primary-soft);
}
.import-summary {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  margin-bottom: 14px;
  background: var(--surface-2);
}
.import-summary summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 0;
  list-style: none;
}
.import-summary summary::-webkit-details-marker {
  display: none;
}
.import-summary[open] summary {
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.import-map-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.import-map-list li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.import-map-list .k {
  color: var(--muted);
}
.import-map-list .v {
  word-break: break-word;
}
@media (max-width: 900px) {
  .import-review-layout {
    grid-template-columns: 1fr;
  }
  .import-pdf-panel,
  .import-form-panel {
    max-height: none;
  }
  .import-pdf-view {
    min-height: 240px;
  }
}
.job-kind-pick {
  display: grid;
  gap: 10px;
}
.job-kind-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.job-kind-btn:hover,
.job-kind-btn:focus-visible {
  border-color: var(--primary);
  outline: none;
}
.job-kind-btn-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.job-kind-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  flex-shrink: 0;
}
.job-kind-btn strong {
  font-size: 1.05rem;
}
.job-kind-btn span:last-child {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}
.modal-intake {
  overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.modal-intake .modal-body,
.modal-intake .intake-form {
  overscroll-behavior: contain;
}
.intake-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  min-height: 0;
  flex: 1;
}
.intake-media,
.intake-form {
  min-width: 0;
}
.intake-form {
  max-height: calc(92dvh - 170px);
  overflow-y: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}
.intake-drop {
  min-height: 200px;
  max-height: calc(92dvh - 170px);
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: auto;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.intake-drop:hover {
  border-color: var(--primary);
}
.intake-drop:focus-visible,
.intake-drop.is-over {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.intake-drop-hint {
  margin: 48px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.intake-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
}
.intake-shot {
  position: relative;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.intake-shot-open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.intake-shot img,
.intake-shot-ph {
  display: block;
  width: 160px;
  max-width: 100%;
  height: 110px;
  object-fit: cover;
  background: var(--surface-2);
}
.intake-shot figcaption {
  padding: 5px 7px 7px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.intake-shot.is-reading figcaption { color: var(--primary); }
.intake-shot.is-error figcaption { color: var(--danger); }
.intake-shot-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 46, 54, 0.62);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  touch-action: manipulation;
}
.intake-shot-del:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.intake-status,
.intake-gap {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.intake-readout {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary-dark);
  animation: intake-enter 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.intake-readout[hidden] {
  display: none;
}
.intake-readout.is-done {
  background: var(--surface-2);
  color: var(--text);
}
.intake-readout-text,
.intake-readout p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
.intake-readout-track {
  height: 3px;
  border-radius: 99px;
  overflow: hidden;
  background: color-mix(in srgb, var(--primary) 16%, #fff);
}
.intake-readout-fill {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0.12);
  transform-origin: left center;
  background: var(--primary);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.intake-shot.is-reading::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 40%;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--primary) 42%, transparent),
    transparent
  );
  animation: intake-scan 1.05s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.intake-just-filled {
  animation: intake-fill 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes intake-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
@keyframes intake-scan {
  from { transform: translateY(-110%); }
  to { transform: translateY(110%); }
}
@keyframes intake-fill {
  from {
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--primary) 55%, var(--border));
  }
  to { box-shadow: none; }
}
.tech-detail-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 650;
}
.tech-detail-list {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}
.tech-detail-list > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  align-items: baseline;
}
.tech-detail-list dt {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.tech-detail-list dd {
  margin: 0;
  font-size: 14px;
}
.intake-gap {
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.intake-num {
  font-variant-numeric: tabular-nums;
}
.intake-standard {
  margin: 14px 0;
  padding: 0;
}
.intake-exchanges {
  grid-column: 1 / -1;
}
.intake-exchange-saved {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.intake-exchange-saved li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line, rgba(0, 0, 0, 0.08));
}
.intake-exchanges-count {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 650;
}
.intake-exchange-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.intake-exchange-row + .intake-exchange-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line, rgba(0, 0, 0, 0.08));
}
.intake-exchange-del {
  grid-column: 1 / -1;
  justify-self: start;
}
.intake-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: rgba(15, 23, 32, 0.86);
}
.intake-lightbox img {
  max-width: min(960px, 100%);
  max-height: calc(100dvh - 96px);
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}
.intake-lightbox p {
  margin: 0;
  color: #fff;
  font-size: 14px;
}
.intake-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.intake-exchange-idx {
  display: none;
}
@media (min-width: 560px) {
  .intake-exchange-row {
    grid-template-columns: 1fr 1fr;
  }
  .intake-exchange-row.has-index {
    grid-template-columns: 28px 1fr 1fr;
  }
  .intake-exchange-idx {
    display: block;
    margin-top: 30px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
  }
}
.intake-unknown {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding: 12px 14px;
  border: 1px solid #f0d29a;
  border-radius: 12px;
  background: #fff7e8;
}
.intake-unknown p {
  margin: 0 0 8px;
}
.intake-missing {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text);
}
.intake-missing.is-ok {
  color: var(--muted);
}
@media (max-width: 900px) {
  .intake-layout {
    grid-template-columns: 1fr;
  }
  .intake-drop,
  .intake-form {
    max-height: none;
  }
  .intake-thumbs {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
  }
  .intake-shot {
    flex: 0 0 112px;
  }
  .intake-drop {
    min-height: 132px;
  }
  .intake-drop-hint {
    margin: 28px 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .intake-drop,
  .intake-shot-del,
  .cs-trigger,
  .input,
  .intake-readout-fill {
    transition: none;
  }
  .intake-readout,
  .intake-just-filled,
  .intake-shot.is-reading::after {
    animation: none;
    filter: none;
    transform: none;
  }
  .modal {
    animation: none;
  }
  .spinner {
    animation: none;
  }
}
@keyframes slideUp {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.modal-head {
  position: sticky;
  top: 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  margin: 0;
  font-size: 17px;
  flex: 1;
  min-width: 0;
  text-wrap: balance;
}
.modal-body {
  padding: 18px;
}
.modal-foot {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  display: flex;
  gap: 10px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
}
.modal-foot .btn {
  flex: 1;
}

/* Checkbox-Liste (Berechtigungen) */
.perm-group {
  margin-bottom: 14px;
}
.perm-group h4 {
  margin: 0 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
}
.check:hover {
  background: var(--surface-2);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 30px auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Navigation: Toggle ist auf allen Breiten sichtbar (ein-/ausklappbar) */
.mobile-nav-toggle {
  display: inline-flex;
}

@media (max-width: 860px) {
  /* Mobile: Sidebar als Off-Canvas-Panel */
  .sidebar {
    position: fixed;
    top: calc(var(--header-h) + var(--impersonation-offset, 0px));
    left: 0;
    bottom: 0;
    z-index: 25;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: 250px;
    box-shadow: var(--shadow);
  }
  .sidebar.open {
    transform: none;
  }
  .scrim {
    position: fixed;
    inset: calc(var(--header-h) + var(--impersonation-offset, 0px)) 0 0 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 20;
    display: none;
  }
  .scrim.show {
    display: block;
  }
}

@media (min-width: 640px) {
  .dash-pulse {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  /* Spaltenlayout: unterschiedlich hohe Panels füllen sich lückenlos */
  .dash-panels {
    display: block;
    columns: 2;
    column-gap: 22px;
    margin-bottom: -22px; /* gleicht margin-bottom der Panels aus */
  }
  .dash-panels > .dash-panel {
    break-inside: avoid;
    margin-bottom: 22px;
  }
  .dash-pipe-legend {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .dash-kpis-alert,
  .dash-kpis-main {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 861px) {
  /* Desktop: Sidebar einklappbar (Breite animiert), bleibt beim Scrollen sichtbar */
  .sidebar {
    width: 230px;
    overflow-x: hidden;
    overflow-y: auto;
    transition:
      width 0.2s ease,
      padding 0.2s ease,
      border-color 0.2s ease;
    white-space: nowrap;
  }
  .sidebar.collapsed {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border-right-color: transparent;
    overflow: hidden;
  }
  .grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid.stats {
    grid-template-columns: repeat(4, 1fr);
  }
  .dash-kpis-alert,
  .dash-kpis-main {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .modal-backdrop {
    align-items: center;
    padding: 28px 24px;
  }
  .modal {
    width: min(780px, calc(100vw - 48px));
    max-width: min(780px, calc(100vw - 48px));
    border-radius: 18px;
    max-height: 90dvh;
  }
  .modal-wide {
    width: min(1080px, calc(100vw - 64px));
    max-width: min(1080px, calc(100vw - 64px));
  }
  .modal-sm {
    width: min(440px, calc(100vw - 48px));
    max-width: min(440px, calc(100vw - 48px));
  }
  .modal-contract,
  .modal-contract-preview {
    width: min(1100px, calc(100vw - 64px));
    max-width: min(1100px, calc(100vw - 64px));
  }
}

@media (min-width: 1280px) {
  .modal {
    width: min(860px, calc(100vw - 80px));
    max-width: min(860px, calc(100vw - 80px));
  }
  .modal-wide {
    width: min(1200px, calc(100vw - 80px));
    max-width: min(1200px, calc(100vw - 80px));
  }
}

@media (min-width: 1000px) {
  .dash {
    gap: 26px;
  }
  .dash-main {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 22px;
    align-items: start;
  }
  .dash-main > .dash-area-todo:only-child {
    grid-column: 1 / -1;
  }
  .dash-pipe-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-pulse-item {
    padding: 16px 16px 14px;
  }
}

@media (max-width: 480px) {
  main.content:has(.dash) {
    padding: 12px 12px 20px;
  }
  .dash {
    gap: 18px;
  }
  .dash-hero {
    flex-wrap: wrap;
  }
  .dash-hero-chip {
    order: -1;
    width: 100%;
    justify-content: flex-start;
    background: transparent !important;
    border: 0;
    min-height: 0;
    padding: 0 2px 6px;
  }
  .dash-hero-chip::before {
    width: 8px;
    height: 8px;
  }
  .dash-pulse {
    gap: 8px;
  }
  .dash-pulse-item {
    padding: 12px 12px 10px;
  }
  .dash-quick {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -12px;
    padding: 0 12px 4px;
    -webkit-overflow-scrolling: touch;
  }
  .dash-quick::-webkit-scrollbar {
    display: none;
  }
  .dash-quick-item {
    flex-shrink: 0;
  }
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .form-grid.two {
    grid-template-columns: 1fr 1fr;
  }
}
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 18px 0 8px;
}
.form-section-title:first-child {
  margin-top: 0;
}

/* ==========================================================================
   Detail-Ansicht mit Tabs (z. B. Mitarbeiter)
   ========================================================================== */
.detail-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.detail-head .avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary-soft), #cfeef3);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
}
.detail-head .grow {
  flex: 1;
  min-width: 200px;
}
.detail-head .dh-name {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}
.detail-head .dh-sub {
  color: var(--muted);
  margin: 2px 0 0;
  font-size: 14px;
}
.detail-head .chips {
  margin-top: 8px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}
.back-link:hover {
  color: var(--primary);
  text-decoration: none;
}

/* Tab-Leiste */
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tabs::-webkit-scrollbar {
  height: 4px;
}
.tabs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.tab {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  border-radius: 8px 8px 0 0;
}
.tab:hover {
  color: var(--text);
  background: var(--surface-2);
}
.tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* Mandantenverwaltung – Unternehmen & Betriebe */
.tenant-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.tenant-head .btn {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tenant-explain {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(31, 142, 163, 0.08), transparent 55%),
    var(--surface-2);
  border: 1px solid var(--border);
}
@media (min-width: 640px) {
  .tenant-explain {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }
}
.tenant-explain-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.tenant-explain-item strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.tenant-explain-arrow {
  display: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 18px;
  padding: 0 4px;
}
@media (min-width: 640px) {
  .tenant-explain-arrow {
    display: block;
  }
}

.tenant-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 16px;
}
.tenant-search {
  flex: 1;
  min-width: 200px;
}
.tenant-count {
  white-space: nowrap;
}

.tenant-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .tenant-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1100px) {
  .tenant-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tenant-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}
.tenant-card:hover {
  border-color: #c5d7dd;
  box-shadow: var(--shadow);
}
.tenant-card.is-disabled {
  opacity: 0.78;
}

.tenant-card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.tenant-card-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.tenant-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}
.tenant-card-logo img.logo-fallback {
  opacity: 0.55;
  padding: 10px;
}
.tenant-card-meta {
  min-width: 0;
  flex: 1;
}
.tenant-card-name {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}
.tenant-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tenant-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.tenant-card-betriebe {
  min-height: 52px;
}
.tenant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tenant-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid #bfe6ec;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tenant-chip-muted {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--border);
  font-weight: 500;
}

.tenant-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.tenant-card-actions .btn {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tenant-empty {
  text-align: center;
  padding: 36px 18px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}
.tenant-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.tenant-empty-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
}
.tenant-empty .btn {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tenant-modal-lead {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}
.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.tenant-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tenant-logo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.tenant-edit-grid {
  display: grid;
  gap: 20px;
}
@media (min-width: 700px) {
  .tenant-edit-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
.tenant-betriebe-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 14px;
}
.tenant-betriebe-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.tenant-betriebe-head .btn {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tenant-betriebe-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tenant-betriebe-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.tenant-betrieb-name {
  font-weight: 600;
  font-size: 14px;
  word-break: break-word;
}
.tenant-betriebe-empty {
  justify-content: center !important;
  color: var(--muted);
  font-size: 13px;
  border-style: dashed !important;
  background: transparent !important;
}

/* Übersicht-Kacheln (Label über Wert, container-responsiv) */
.kv-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.kv {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kv .k {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
}
.kv .v {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text, inherit);
  overflow-wrap: break-word;
  word-break: normal;
  min-width: 0;
}

.emp-equipment-grid {
  display: grid;
  gap: 16px;
}
@media (min-width: 760px) {
  .emp-equipment-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
.emp-vehicles-current {
  display: grid;
  gap: 10px;
}
.emp-vehicle-card {
  align-items: center;
  gap: 12px;
}
.emp-vehicle-card .veh-photo {
  flex-shrink: 0;
}

/* Urlaubskontingent */
.vac-balance-wrap {
  margin-top: 20px;
}
.vac-balance-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}
.vac-balance-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 14px;
}
.vac-balance-title {
  font-size: 15px;
  font-weight: 700;
}
.vac-balance-hero {
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.vac-balance-hero.vac-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.vac-balance-hero.vac-warn {
  background: #fffbeb;
  border-color: #fcd34d;
}
.vac-balance-hero.vac-danger {
  background: var(--danger-bg);
  border-color: #fca5a5;
}
.vac-balance-hero-k {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.vac-balance-hero-v {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 4px;
}
.vac-balance-unit {
  font-size: 1rem;
  font-weight: 600;
  margin-left: 6px;
  color: var(--muted);
}
.vac-balance-hero-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
.vac-balance-formula {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px dashed var(--border);
}
.vac-balance-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}
@media (min-width: 640px) {
  .vac-balance-metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}
.vac-balance-metrics.compact {
  grid-template-columns: repeat(2, 1fr);
}
.vac-metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.vac-metric-k {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.vac-metric-v {
  display: block;
  font-size: 15px;
  font-weight: 700;
  margin-top: 2px;
}

.vac-check-panel {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.vac-check-panel.vac-ok {
  border-color: #a7f3d0;
  background: #ecfdf5;
}
.vac-check-panel.vac-warn {
  border-color: #fcd34d;
  background: #fffbeb;
}
.vac-check-panel.vac-danger {
  border-color: #fca5a5;
  background: var(--danger-bg);
}
.vac-check-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 10px;
}
@media (max-width: 520px) {
  .vac-check-grid {
    grid-template-columns: 1fr;
  }
}
.vac-check-val {
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
}
.vac-check-warn {
  margin: 10px 0 0;
  font-weight: 600;
  color: var(--danger);
  font-size: 13px;
}

.vac-period-card {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.vac-period-head {
  margin-bottom: 8px;
}
.vac-period-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.vac-period-hol-count {
  color: #7c3aed;
  font-weight: 600;
}
.vac-period-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.vac-day-chip {
  min-width: 52px;
  padding: 6px 8px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.2;
}
.vac-day-biz {
  background: #ecfdf5;
  border-color: #6ee7b7;
}
.vac-day-we {
  background: var(--surface-2);
  color: var(--muted);
}
.vac-day-chip.vac-day-hol {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}
.vac-day-wd {
  display: block;
  font-weight: 700;
}
.vac-day-num {
  display: block;
  font-size: 15px;
  font-weight: 800;
}
.vac-day-hol-name {
  display: block;
  font-size: 9px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
}
.vac-period-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.vac-leg {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.vac-period-region {
  margin: 0;
}

.vac-suggestions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.vac-suggestions-head {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}
.vac-suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vac-suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.vac-suggestion-range {
  font-weight: 700;
  font-size: 14px;
}

.alt-picker {
  margin-top: 14px;
}
.alt-selected {
  margin-bottom: 10px;
}
.alt-selected-head,
.alt-offer-head,
.alt-fold-title {
  font-weight: 700;
}
.alt-selected-head {
  font-size: 13px;
  margin-bottom: 8px;
}
.alt-selected-list,
.alt-offer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.alt-chip,
.alt-offer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #9ad7e2;
  border-radius: 12px;
  background: var(--primary-soft);
}
.alt-chip strong,
.alt-offer-range {
  display: block;
  font-size: 14px;
}
.alt-chip .muted,
.alt-offer-item .muted {
  font-size: 12px;
}
.alt-chip-x {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.alt-fold {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.alt-fold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, var(--primary-soft), var(--surface));
}
.alt-fold > summary::-webkit-details-marker {
  display: none;
}
.alt-fold-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.alt-fold-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
}
.alt-fold-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--primary-dark);
  border-bottom: 2px solid var(--primary-dark);
  transform: rotate(45deg);
  flex: 0 0 auto;
  margin-top: -4px;
}
.alt-fold[open] .alt-fold-chevron {
  transform: rotate(225deg);
  margin-top: 4px;
}
.alt-fold-body {
  padding: 0 14px 14px;
}
.alt-hint-stack {
  display: none;
}
.alt-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 10px;
}
.alt-nav strong {
  font-size: 14px;
  text-align: center;
}
.alt-nav-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}
.alt-draft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  font-size: 13px;
}
.alt-matrix {
  min-width: 0;
  max-width: 100%;
}
.alt-cal-scroll {
  overflow-x: scroll;
  overflow-y: auto;
  max-width: 100%;
  max-height: min(380px, 52vh);
  border: 1px solid var(--border);
  border-radius: 12px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #9db4bc transparent;
}
.alt-cal-scroll::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}
.alt-cal-scroll::-webkit-scrollbar-thumb {
  background: #9db4bc;
  border-radius: 999px;
  border: 2px solid var(--surface);
}
.alt-grid {
  display: grid;
  grid-template-columns: 156px repeat(var(--days), 52px);
  width: max-content;
}
.alt-corner,
.alt-hday,
.alt-name {
  position: sticky;
  background: var(--surface);
}
.alt-corner,
.alt-hday {
  top: 0;
  z-index: 3;
  background: var(--surface-2);
}
.alt-corner,
.alt-name {
  left: 0;
  z-index: 4;
}
.alt-corner {
  z-index: 5;
  display: flex;
  align-items: flex-end;
  padding: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.alt-hday {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  font-size: 11px;
  color: var(--muted);
}
.alt-hday strong {
  color: var(--text);
  font-size: 14px;
}
.alt-hday.is-weekend,
.alt-cell.is-weekend {
  background: #f7fafb;
}
.alt-hday.is-holiday strong {
  color: #6d28d9;
}
.alt-name {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-top: 1px solid var(--border);
  min-width: 0;
}
.alt-name span {
  min-width: 0;
}
.alt-name strong,
.alt-name em {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alt-name strong {
  font-size: 13px;
}
.alt-name em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
}
.alt-name.is-target {
  background: #f3fbfd;
  box-shadow: inset 3px 0 0 var(--primary);
}
.alt-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid #eef3f5;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}
.alt-cell.is-readonly {
  cursor: default;
}
.alt-cell.is-request span {
  font-size: 9px;
  letter-spacing: -0.02em;
}
.alt-cell.is-request,
.alt-day.is-request {
  background: #fffbeb;
  color: #92400e;
  box-shadow: inset 0 0 0 1.5px #f59e0b;
}
.alt-cell.is-mark,
.alt-day.is-mark {
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: inset 0 0 0 2px var(--primary);
}
.alt-cell.is-draft,
.alt-day.is-draft {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: inset 0 0 0 2px var(--primary);
}
.alt-cell:focus-visible,
.alt-day:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.alt-stack {
  display: none;
}
.alt-day {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 8px 10px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.alt-day-date {
  flex: 0 0 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.alt-day-date strong {
  font-size: 18px;
  color: var(--text);
  line-height: 1.1;
}
.alt-day-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.alt-day-you {
  font-weight: 700;
  font-size: 14px;
}
.alt-day-team {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alt-day.is-weekend {
  background: #f7fafb;
}
.alt-day.is-busy {
  background: var(--surface-2);
}
.alt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.alt-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: -1px;
}
.alt-swatch.is-request {
  background: #fffbeb;
  box-shadow: inset 0 0 0 1.5px #f59e0b;
}
.alt-swatch.is-mark {
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1.5px var(--primary);
}
.alt-swatch.is-off {
  background: #dbeafe;
}
.alt-offer-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #9ad7e2;
  border-radius: 14px;
  background: #f8fcfd;
}
.alt-offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.alt-hint {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
}
@media (max-width: 760px) {
  .alt-hint-grid,
  .alt-matrix {
    display: none;
  }
  .alt-hint-stack,
  .alt-stack {
    display: flex;
  }
  .alt-stack {
    flex-direction: column;
    gap: 6px;
  }
  .alt-offer-item,
  .alt-draft {
    flex-wrap: wrap;
  }
  .alt-offer-actions,
  .alt-offer-actions .btn,
  .alt-draft .btn {
    width: 100%;
  }
}

.cal-hol-pill {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #5b21b6;
  background: #ede9fe;
  border-radius: 6px;
  padding: 2px 6px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Mehrfach-Checkbox-Dropdown (Fähigkeiten) */
.multi-cs {
  position: relative;
}
.multi-cs.disabled {
  opacity: 0.65;
  pointer-events: none;
}
.multi-cs.searchable .multi-cs-menu {
  max-height: 280px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.multi-cs.searchable .multi-cs-options {
  overflow: auto;
  max-height: 220px;
  flex: 1;
  min-height: 0;
}
.multi-cs-option[hidden] {
  display: none !important;
}
.multi-cs-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}
.multi-cs-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  margin: 0;
}
.multi-cs-option:hover {
  background: var(--surface-2);
}
.multi-cs-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--primary);
}
.multi-cs-option-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.multi-cs-option-label {
  font-weight: 600;
  font-size: 14px;
}
.multi-cs-option-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.multi-cs-empty {
  padding: 12px;
  text-align: center;
}
.multi-cs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.skill-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-soft);
  border: 1px solid rgba(31, 142, 163, 0.25);
  color: var(--primary-dark);
}
.skill-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.skill-def-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skill-def-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.skill-def-item.inactive {
  opacity: 0.65;
}
.skill-def-main {
  min-width: 0;
}
.skill-def-name {
  font-weight: 700;
  font-size: 15px;
}
.skill-def-actions {
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
}

/* Einsatzgebiete */
.area-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in srgb, var(--area-color, #64748b) 14%, transparent);
  border: 1px solid
    color-mix(in srgb, var(--area-color, #64748b) 35%, transparent);
  color: var(--text);
}
.area-chip.sm {
  font-size: 11px;
  padding: 3px 8px;
}
.area-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.area-overview-stats {
  margin-bottom: 14px;
}
.area-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
}
.area-stat-row--overview {
  margin-bottom: 0;
}
.area-stat-card {
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  text-align: center;
}
.area-stat-card.warn {
  border-color: var(--amber);
  background: var(--amber-bg, rgba(245, 158, 11, 0.08));
}
.area-stat-val {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}
.area-stat-lbl {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.area-list .area-card {
  display: flex;
  align-items: stretch;
  gap: 14px;
  cursor: pointer;
}
.area-card-color {
  width: 5px;
  border-radius: 999px;
  flex-shrink: 0;
  align-self: stretch;
}
.area-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.area-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.area-card-desc {
  margin-top: 4px;
}
.area-card-actions {
  flex-shrink: 0;
  align-self: center;
}
.area-detail-head {
  margin-bottom: 14px;
}
.area-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.area-detail-section {
  margin-top: 18px;
}
.area-detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.area-detail-section-head h4 {
  margin: 0;
  font-size: 15px;
}
.area-emp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.area-emp-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.area-quick-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.action-menu {
  position: relative;
}
.action-menu-trigger {
  min-width: 36px;
  padding: 6px 8px !important;
}
.action-menu-pop {
  left: auto;
  right: 0;
  width: max-content;
  min-width: 196px;
  max-width: min(280px, calc(100vw - 24px));
  max-height: none;
}
.action-menu-pop.is-up {
  top: auto;
  bottom: calc(100% + 6px);
}
.action-menu-option {
  justify-content: flex-start;
  gap: 10px;
  white-space: nowrap;
}
.action-menu-option .svg-ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
}
.action-menu-option.danger-text .svg-ic {
  color: var(--danger);
}
.action-menu-option.danger-text:hover {
  background: var(--danger-bg);
}
.list-card:has(.action-menu-trigger[aria-expanded="true"]) {
  position: relative;
  z-index: 20;
}

.mat-holdings-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}

/* Sticky Aktionsleiste der Detailansicht */
.detail-actions {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin: 18px -18px -18px;
  padding: 14px 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-radius: 0 0 var(--radius) var(--radius);
}
.detail-actions .grow {
  flex: 1;
}

/* ---------- Zeitsperren (Time Locks) ---------- */
.tl-status-card {
  padding: 0;
  overflow: hidden;
}
.tl-status-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}
.tl-status-inner.ok {
  background: #ecfdf5;
  border-left: 4px solid var(--success);
}
.tl-status-inner.blocked {
  background: var(--danger-bg);
  border-left: 4px solid var(--danger);
}
.tl-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tl-status-inner.ok .tl-status-dot {
  background: var(--success);
}
.tl-status-inner.blocked .tl-status-dot {
  background: var(--danger);
}

.tl-master {
  display: grid;
  gap: 16px;
  margin: 16px 0;
}
@media (min-width: 700px) {
  .tl-master {
    grid-template-columns: 1fr 280px;
    align-items: start;
  }
}
.tl-toggle {
  align-items: flex-start;
  gap: 12px;
  max-width: none;
}
.tl-tz-field {
  margin: 0;
}

.tl-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.tl-week {
  display: grid;
  gap: 10px;
}
@media (min-width: 700px) {
  .tl-week {
    grid-template-columns: 1fr 1fr;
  }
}

.tl-day {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
}
.tl-day.is-custom {
  background: var(--surface);
}
.tl-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.tl-day-name {
  font-weight: 700;
  min-width: 90px;
}
.tl-mode.custom-select {
  min-width: 160px;
  flex: 1;
}
.tl-mode .cs-trigger {
  padding: 8px 10px;
  font-size: 13px;
}

.tl-day-windows {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.tl-window {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tl-time {
  width: 120px;
  padding: 8px 10px;
}
.tl-window-sep {
  color: var(--muted);
  font-weight: 600;
}

.tl-exc-list {
  margin-top: 12px;
}
.tl-exc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.tl-exc-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn.small {
  padding: 6px 10px;
  font-size: 13px;
}
.mt {
  margin-top: 14px;
}

/* ---------- Mitarbeiter-Historie (Gehalt & Feedback) ---------- */
.emp-section {
  margin-bottom: 24px;
}
.emp-section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.emp-section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.emp-lager-table-wrap {
  overflow-x: auto;
}
.emp-lager-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.emp-lager-table th,
.emp-lager-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.emp-lager-table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.emp-lager-table tr.is-low td {
  background: color-mix(in srgb, #f59e0b 10%, transparent);
}
.emp-lager-table .name { font-weight: 600; }
.emp-lager-table .sub { color: var(--muted); font-size: 12px; }
.emp-stock-card { margin-bottom: 14px; }
.emp-stock-card.has-low { border-color: #f0d29a; }
.emp-stock-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.emp-stock-head .name { font-weight: 700; color: inherit; text-decoration: none; }
.emp-stock-head .name:hover { text-decoration: underline; }

.stock-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.stock-kpis.is-own {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.stock-kpi {
  padding: 14px 16px;
  display: grid;
  gap: 2px;
}
.stock-kpi-l {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.stock-kpi-n {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--brand-deep);
}
.stock-table-card { padding: 4px 8px 8px; }
.stock-table,
.stock-emp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.stock-table th,
.stock-table td,
.stock-emp-table th,
.stock-emp-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.stock-table th,
.stock-emp-table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.stock-table th.num,
.stock-table td.num,
.stock-emp-table th.num,
.stock-emp-table td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stock-table .name { font-weight: 600; }
.stock-table .sub,
.stock-emp-table .sub { color: var(--muted); font-size: 12px; }
.stock-table tr.is-low td { background: color-mix(in srgb, #f59e0b 8%, transparent); }
.stock-table tr.is-open td { background: var(--surface-2); border-bottom-color: transparent; }
.stock-toggle-col { width: 36px; padding-right: 0; }
.stock-toggle {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.stock-toggle:hover { background: var(--surface-2); color: var(--brand-deep); }
.stock-detail td {
  background: var(--surface-2);
  padding-top: 0;
  padding-bottom: 14px;
}
.stock-emp-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.stock-emp-table th,
.stock-emp-table td { padding: 8px 12px; }
.stock-emp-table tr:last-child td { border-bottom: 0; }
.stock-emp-table .name { font-weight: 600; color: inherit; text-decoration: none; }
.stock-emp-table .name:hover { text-decoration: underline; }
.stock-table td.num .badge { margin-left: 6px; }
@media (max-width: 720px) {
  .stock-kpis,
  .stock-kpis.is-own { grid-template-columns: 1fr; }
}
.career-section {
  margin-top: 28px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.career-role-change {
  margin: 6px 0;
}
.career-role-line {
  display: block;
  font-size: 13px;
}
.hist-item-promo .hist-body {
  border-color: rgba(59, 130, 246, 0.25);
}
.hist-dot--promo {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px #dbeafe;
  background: #3b82f6;
}
.hist-item-hire .hist-dot {
  border-color: var(--success);
  background: var(--success);
}

.hist-panel {
  padding-bottom: 8px;
}
.hist-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 16px;
}
.hist-summary-item {
  background: var(--primary-soft);
  border: 1px solid rgba(31, 142, 163, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hist-summary-item .k {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  line-height: 1.3;
}
.hist-summary-item .v {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: normal;
}

.hist-form.card-inner {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
}
.hist-form .card-title {
  margin-bottom: 12px;
  font-size: 15px;
}
.hist-form-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.hist-empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
  background: var(--surface-2);
  border-radius: 12px;
  border: 1px dashed var(--border);
}

.hist-timeline {
  position: relative;
  padding-left: 28px;
}
.hist-timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
.hist-item {
  position: relative;
  margin-bottom: 16px;
}
.hist-item:last-child {
  margin-bottom: 0;
}
.hist-dot {
  position: absolute;
  left: -24px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.hist-dot--create {
  border-color: var(--success);
  box-shadow: 0 0 0 3px #ecfdf5;
}
.hist-dot--comment {
  border-color: var(--primary);
}
.hist-dot--status {
  border-color: var(--warning);
  box-shadow: 0 0 0 3px #fffbeb;
}
.hist-dot--update {
  border-color: var(--muted);
  box-shadow: 0 0 0 3px var(--surface-2);
}
.hist-dot--in {
  border-color: var(--success);
  box-shadow: 0 0 0 3px #ecfdf5;
}
.hist-dot--out {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}
.hist-dot--adjust {
  border-color: var(--warning);
  box-shadow: 0 0 0 3px #fffbeb;
}
.hist-dot--key {
  border-color: var(--primary-dark);
}
.hist-dot--assign {
  border-color: var(--primary);
}
.hist-dot--service {
  border-color: var(--warning);
  box-shadow: 0 0 0 3px #fffbeb;
}
.hist-dot--damage {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}
.hist-dot--default {
  border-color: var(--primary);
}
.hist-item.current .hist-dot {
  background: var(--primary);
}
.hist-body {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.hist-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.hist-top .grow {
  flex: 1;
}
.hist-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
  color: var(--muted);
}
.hist-reason,
.hist-text {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.45;
}
.hist-foot {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.hist-change {
  font-size: 13px;
  font-weight: 700;
}
.hist-change.up {
  color: var(--success);
}
.hist-change.down {
  color: var(--danger);
}

.hist-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.hist-cat-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition:
    background 0.12s,
    border-color 0.12s;
}
.hist-cat-btn:hover {
  background: var(--surface-2);
}
.hist-cat-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.hist-history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 12px;
}
.hist-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hist-filter-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}
.hist-filter-chip:hover {
  background: var(--surface-2);
  color: var(--text);
}
.hist-filter-chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}
.hist-item-internal .hist-body {
  border-color: rgba(100, 116, 139, 0.35);
}
.hist-dot--internal {
  border-color: #64748b;
  background: #64748b;
  box-shadow: 0 0 0 3px var(--surface-2);
}
.hist-internal-field textarea {
  min-height: 96px;
}

.hist-rating-pick {
  margin-bottom: 12px;
}
.hist-rating-mode {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.hist-mode-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.hist-mode-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.hist-thumbs-pick,
.hist-stars-pick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hist-star {
  display: inline-flex;
  color: var(--border);
}
.hist-star.on {
  color: var(--primary);
}
.hist-star .svg-ic {
  width: 14px;
  height: 14px;
}
.hist-thumb-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.hist-thumb-btn:hover {
  background: var(--surface-2);
}
.hist-thumb-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.hist-star-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.hist-star-btn:hover {
  background: var(--surface-2);
}
.hist-star-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.hist-rating.stars .hist-star {
  font-size: 15px;
}
.hist-rating.thumbs {
  font-size: 13px;
  font-weight: 700;
}
.hist-rating.thumbs.up {
  color: var(--success);
}
.hist-rating.thumbs.down {
  color: var(--danger);
}

.hist-item.note-praise .hist-dot {
  border-color: var(--success);
  box-shadow: 0 0 0 3px #ecfdf5;
}
.hist-item.note-late .hist-dot,
.hist-item.note-warning .hist-dot,
.hist-item.note-improvement .hist-dot {
  border-color: var(--warning);
  box-shadow: 0 0 0 3px #fffbeb;
}
.hist-item.note-task_lost .hist-dot {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}

.hist-del {
  margin-left: auto;
  padding: 2px 6px !important;
  font-size: 12px;
  color: var(--muted);
}
.hist-del:hover {
  color: var(--danger);
}

.hidden {
  display: none !important;
}

/* ---------- Zeitsperren-Kalender ---------- */
.tl-cal {
  margin: 16px 0;
}
.tl-cal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tl-cal-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  text-transform: capitalize;
  min-width: 160px;
}
.tl-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.tl-cal-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.tl-cal-dot.closed {
  background: var(--danger);
}
.tl-cal-dot.open {
  background: var(--success);
}
.tl-cal-dot.custom {
  background: var(--warning);
}

.tl-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.tl-cal-wd {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tl-cal-day {
  position: relative;
  aspect-ratio: 1;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: var(--text);
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.12s,
    background 0.12s,
    transform 0.08s;
}
.tl-cal-day:hover:not(.muted) {
  border-color: var(--primary);
  background: var(--surface-2);
}
.tl-cal-day.muted {
  opacity: 0.35;
  cursor: default;
  background: var(--surface-2);
}
.tl-cal-day.today {
  box-shadow: inset 0 0 0 2px var(--primary);
}
.tl-cal-day.has-exc.closed {
  background: var(--danger-bg);
  border-color: #fecaca;
}
.tl-cal-day.has-exc.open {
  background: #ecfdf5;
  border-color: #bbf7d0;
}
.tl-cal-day.has-exc.custom {
  background: #fffbeb;
  border-color: #fde68a;
}
.tl-cal-num {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.tl-cal-mark {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
}
.tl-cal-hint {
  margin-top: 10px;
}

/* ---------- Aufträge: Ansichten (Liste / Kanban / Kalender) ---------- */
.view-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.view-tabs .tab {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.view-tabs .tab:hover {
  background: var(--surface-2);
  color: var(--text);
}
.view-tabs .tab.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.kanban-board {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}
.kanban-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  min-height: 120px;
}
.kanban-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  padding: 0 4px;
}
.kanban-items {
  display: grid;
  gap: 8px;
}
.ord-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
.ord-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.ord-card.overdue {
  border-color: #fecaca;
  background: var(--danger-bg);
}
.ord-card .chips {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ff-bar {
  padding: 10px 12px;
}
.ff-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.ff-search {
  flex: 1 1 180px;
  min-width: 160px;
  margin: 0;
  position: relative;
  display: block;
}
.ff-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.ff-search .input {
  width: 100%;
  height: 40px;
  padding-left: 36px;
  margin: 0;
}
.ff-search .input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}
.ff-search .input[type="search"]::-webkit-search-decoration,
.ff-search .input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.ff-search-spacer {
  flex: 1;
}
.ff-tools {
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 280px;
}
.ff-sort-field {
  width: 100%;
  min-width: 0;
  margin: 0;
}
.ff-sort .cs-trigger {
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
}
.ff-sort .cs-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .ff-tools {
    flex: 1 1 100%;
    max-width: none;
  }
}
.ff-toggle {
  width: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
}
.ff-toggle .svg-ic:last-child {
  transition: transform 0.15s ease;
}
.ff-bar.is-open .ff-toggle .svg-ic:last-child,
.ff-toggle[aria-expanded="true"] .svg-ic:last-child {
  transform: rotate(180deg);
}
.ff-toggle.is-active {
  border-color: var(--primary);
  color: var(--primary);
}
.ff-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ff-extras {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.ff-extras[hidden] {
  display: none;
}

.ord-filter-card {
  padding-bottom: 14px;
}
.ord-filter-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .ord-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1180px) {
  .ord-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.ord-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.ord-chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}
.ord-chip:hover {
  border-color: var(--primary);
}
.ord-chip.is-on {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.ord-tile-list {
  display: grid;
  gap: 10px;
}
.ord-tile {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  padding: 14px 16px 14px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 4px 0 0 var(--border);
  cursor: pointer;
  transition:
    border-color 0.12s,
    box-shadow 0.12s,
    background 0.12s;
}
.ord-tile {
  --tile-accent: var(--border);
}
.ord-tile:hover {
  border-color: var(--primary);
  box-shadow:
    inset 4px 0 0 var(--tile-accent),
    0 4px 14px rgba(13, 92, 99, 0.08);
}
.ord-tile.is-open {
  --tile-accent: var(--primary);
  box-shadow: inset 4px 0 0 var(--tile-accent);
}
.ord-tile.is-in_progress {
  --tile-accent: var(--warning);
  box-shadow: inset 4px 0 0 var(--tile-accent);
}
.ord-tile.is-on_hold {
  --tile-accent: var(--muted);
  box-shadow: inset 4px 0 0 var(--tile-accent);
}
.ord-tile.is-completed {
  --tile-accent: var(--success);
  box-shadow: inset 4px 0 0 var(--tile-accent);
}
.ord-tile.is-cancelled {
  --tile-accent: var(--danger);
  box-shadow: inset 4px 0 0 var(--tile-accent);
  opacity: 0.82;
}
.ord-tile.is-overdue {
  background: var(--danger-bg);
}
.ord-tile-body {
  flex: 1;
  min-width: 0;
}
.ord-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 22px;
}
.ord-tile-num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
  min-width: 0;
}
.ord-tile-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
  word-break: normal;
}
.ord-tile-sub {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: normal;
}
.ord-tile-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
}
.ord-date {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.ord-date.is-fresh {
  color: var(--primary-dark);
}
.ord-date.is-overdue {
  color: var(--danger);
  font-weight: 700;
}
.ord-date.is-muted {
  color: var(--muted);
  font-weight: 600;
}
.ord-tile-devices {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: normal;
}
.ord-tile .chips {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ord-tile-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
  flex-shrink: 0;
  min-width: 8.25rem;
}
.ord-tile-status {
  white-space: nowrap;
  line-height: 1.2;
}
.ord-tile-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
.ord-tile-actions .btn {
  width: 100%;
  min-width: 8.25rem;
}
@media (max-width: 760px) {
  .content {
    padding: 12px 12px 24px;
  }
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .page-head .row-actions {
    width: 100%;
  }
  .card,
  .list,
  .list-card,
  .ord-tile-list {
    min-width: 0;
    max-width: 100%;
  }
  .list-card {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .list-card .grow {
    flex: 1 1 140px;
  }
  .list-card > .row-actions,
  .list-card > .btn.sm,
  .list-card > a.btn {
    flex: 1 1 100%;
    width: 100%;
  }
  .ord-tile {
    flex-direction: column;
    gap: 12px;
    padding: 12px 12px 12px 14px;
  }
  .ord-tile-aside {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
  }
  .ord-tile-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    width: auto;
  }
  .ord-tile-actions .btn {
    width: auto;
    min-width: 0;
  }
}
.kanban-items .ord-tile,
.ord-week-board .ord-tile,
.plan-day-list .ord-tile {
  flex-direction: column;
  padding: 10px 12px 10px 14px;
}
.kanban-items .ord-tile-aside,
.ord-week-board .ord-tile-aside,
.plan-day-list .ord-tile-aside {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
}
.kanban-items .ord-tile-title,
.ord-week-board .ord-tile-title {
  font-size: 14px;
}

.ord-cal {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.ord-cal-day {
  padding: 12px;
}
.ord-cal-day .card-title {
  font-size: 13px;
  margin-bottom: 8px;
}
.ord-cal-items {
  display: grid;
  gap: 8px;
}

.ord-modal-tabs {
  margin-bottom: 14px;
}

.ord-assignee-jump {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.ord-assignee-jump .ord-assignee-card {
  flex: 1;
  min-width: 0;
}
.ord-assignee-jump-hint {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
}
.ord-assignee-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.ord-assignee-card .name {
  font-weight: 700;
}
.ord-assignee-card .sub {
  font-size: 13px;
  color: var(--muted);
}
.ord-assignee-card.is-empty {
  background: var(--surface);
}
.ord-deploy-list {
  display: grid;
  gap: 8px;
}
.ord-deploy-card {
  text-decoration: none;
  color: inherit;
}

.ne3-panel {
  display: grid;
  gap: 12px;
}
.ne3-preview-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  max-height: 360px;
}
.ne3-preview {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}
.ne3-sync {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
}
.ne3-sync input {
  margin-top: 2px;
}

/* Material-Abschluss: Automatisch / Manuell */
.comp-mat-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 0 12px;
  margin-top: 10px;
}
.comp-mat-section summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 0;
  list-style: none;
}
.comp-mat-section summary::-webkit-details-marker {
  display: none;
}
.comp-mat-section summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.15s ease;
}
.comp-mat-section[open] summary::before {
  transform: rotate(90deg);
}
.comp-mat-section[open] summary {
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.comp-mat-section-body {
  padding-bottom: 12px;
}
.comp-mat-red {
  color: #c62828;
}
.comp-mat-green {
  color: #2e7d32;
}
.comp-mat-ocr-result {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
}
.comp-mat-ocr-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.comp-mat-ocr-row:last-of-type {
  border-bottom: none;
}
.comp-mat-ocr-row .name {
  display: block;
  font-weight: 600;
}
.comp-mat-ocr-row input {
  margin-top: 4px;
}

/* ---------- Einsatzplanung Wochenansicht ---------- */
.plan-week-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.plan-week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(152px, 1fr));
  gap: 10px;
  min-width: min(100%, 1060px);
}
@media (max-width: 900px) {
  .plan-week-board {
    min-width: 980px;
  }
}

.plan-week-col {
  display: flex;
  flex-direction: column;
  min-height: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.plan-week-col.is-today {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(31, 142, 163, 0.25);
}
.plan-week-col.is-weekend {
  background: var(--surface-2);
}

.plan-week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.plan-week-col.is-today .plan-week-head {
  background: var(--primary-soft);
}
.plan-week-date {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.plan-week-wd {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.plan-week-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.plan-week-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.plan-week-add {
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.plan-week-add:hover {
  background: rgba(31, 142, 163, 0.15);
}

.plan-week-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}
.plan-week-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 20px 10px;
  min-height: 96px;
}

.plan-dep-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 10px 10px 10px 11px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition:
    border-color 0.12s,
    box-shadow 0.12s,
    transform 0.08s;
}
.plan-week-col.is-weekend .plan-dep-card {
  background: var(--surface);
}
.plan-dep-card:hover:not(:disabled) {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.plan-dep-card:disabled {
  cursor: default;
}
.plan-dep-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}
.plan-dep-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}
.plan-dep-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-dep-person {
  font-weight: 600;
  color: var(--text);
}
.plan-dep-badge {
  align-self: flex-start;
  font-size: 10px;
  padding: 2px 7px;
}

.plan-dep-planned {
  border-left-color: #60a5fa;
}
.plan-dep-confirmed {
  border-left-color: var(--primary);
}
.plan-dep-in_progress {
  border-left-color: #f59e0b;
}
.plan-dep-completed {
  border-left-color: var(--success);
}
.plan-dep-cancelled {
  border-left-color: #94a3b8;
  opacity: 0.75;
}

.plan-month-list {
  gap: 12px;
}
.plan-month-list-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: start;
}
@media (max-width: 560px) {
  .plan-month-list-row {
    grid-template-columns: 1fr;
  }
}
.plan-month-list-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding-top: 10px;
}

/* ---------- Einsatzplanung Monatsansicht ---------- */
.plan-view-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.plan-view-tabs .tab {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}
.plan-view-tabs .tab.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.plan-month-cal {
  margin-top: 4px;
}
.plan-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.plan-month-wd {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 0;
  text-transform: uppercase;
}
.plan-month-day {
  min-height: 88px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  transition:
    border-color 0.12s,
    background 0.12s;
}
.plan-month-day:hover:not(.muted) {
  border-color: var(--primary);
  background: var(--surface-2);
}
.plan-month-day.muted {
  opacity: 0.35;
  cursor: default;
  background: var(--surface-2);
}
.plan-month-day.today {
  box-shadow: inset 0 0 0 2px var(--primary);
}
.plan-month-num {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.plan-month-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 2px 6px;
  align-self: flex-start;
}
.plan-month-pills {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}
.plan-month-pill {
  font-size: 10px;
  line-height: 1.2;
  padding: 3px 5px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-month-day.is-clickable {
  cursor: pointer;
}

/* ---------- Kalender Tagesansicht (einheitlich) ---------- */
.plan-day-view {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.plan-day-view.is-today {
  box-shadow: inset 0 0 0 2px var(--primary);
}
.plan-day-view.is-weekend {
  background: var(--surface-2);
}
.plan-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.plan-day-view.is-today .plan-day-head {
  background: var(--primary-soft);
}
.plan-day-date {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.plan-day-wd {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.plan-day-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.plan-day-long {
  font-size: 14px;
  color: var(--muted);
}
.plan-day-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.plan-day-body {
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
}
.plan-day-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.cal-view-tabs {
  margin-top: 2px;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cal-nav-label {
  min-width: 140px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.tl-cal-grid .plan-month-day {
  min-height: 88px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.tl-cal-grid .plan-month-wd {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 0;
  text-transform: uppercase;
}
.tl-cal-grid .plan-month-day.muted {
  opacity: 0.35;
  cursor: default;
  background: var(--surface-2);
}
.tl-cal-grid .plan-month-day.today {
  box-shadow: inset 0 0 0 2px var(--primary);
}
.tl-cal-grid .plan-month-day.has-exc.closed {
  background: var(--danger-bg);
  border-color: #fecaca;
}
.tl-cal-grid .plan-month-day.has-exc.open {
  background: #ecfdf5;
  border-color: #bbf7d0;
}
.tl-cal-grid .plan-month-day.has-exc.custom {
  background: #fffbeb;
  border-color: #fde68a;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.grid.stats.warn .stat {
  border-color: #fde68a;
}
.stat.danger {
  background: var(--danger-bg);
  border-color: #fecaca;
}
.stat.danger .n {
  color: var(--danger);
}
.stat.warn {
  background: #fffbeb;
  border-color: #fde68a;
}

/* ---------- Mitarbeiterberichte ---------- */
.reports-tabs {
  margin-top: 4px;
}
.reports-list {
  display: grid;
  gap: 12px;
}
.reports-list.tight {
  gap: 8px;
}
.report-sub-card .name,
.report-tpl-card .name {
  font-weight: 750;
  font-size: 15px;
}
.report-sub-card .sub,
.report-tpl-card .sub {
  color: var(--muted);
  font-size: 13px;
}
.report-sub-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.report-value-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.report-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text);
}
.report-chip b {
  font-weight: 700;
}
.report-kpi-card {
  overflow: hidden;
}
.report-kpi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.report-metric-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .report-metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.report-metric {
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(165deg, #fff, var(--surface-2));
  border: 1px solid var(--border);
}
.report-metric-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.report-metric-sum {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
  font-variant-numeric: tabular-nums;
}
.report-metric-meta {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}
.report-pending-card {
  border-color: #fde68a;
  background: linear-gradient(165deg, #fffdf8, #fff8eb);
}
.report-pending-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #fde68a;
}
.report-export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.report-export-bar p { margin: 0; }
.report-history-card { margin-top: 12px; }
.report-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.report-history-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-history-nav strong { min-width: 9.5rem; text-align: center; }
.report-day {
  display: grid;
  grid-template-columns: minmax(168px, 210px) minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.report-day.is-missing,
.report-day.is-draft {
  border-color: #fde68a;
  background: #fffdf8;
}
.report-day.is-submitted { border-color: #bbf7d0; }
.report-day.is-off,
.report-day.is-not_due { background: var(--surface-2); }
.report-day-date,
.report-day-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.report-day-body { min-width: 0; }
.report-day-sub { justify-content: space-between; margin-top: 4px; }
@media (max-width: 800px) {
  .report-day { grid-template-columns: 1fr; }
}
.report-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.report-file {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
}
.empty-state {
  text-align: center;
  padding: 36px 22px;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.row-actions.spread {
  justify-content: space-between;
  width: 100%;
}
.card.nested {
  margin: 0 0 10px;
  padding: 12px;
  background: var(--surface-2);
  box-shadow: none;
}

/* Legacy aliases → neue Feed-Komponenten */
.dash-overdue-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.dash-overdue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: inherit;
  text-decoration: none;
}
.dash-overdue-item:hover {
  border-color: var(--primary);
}
.dash-overdue-item .grow {
  flex: 1;
  min-width: 140px;
}
.dash-overdue-item .name {
  font-weight: 700;
  font-size: 14px;
}
.dash-overdue-item .sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Kanban Drag & Drop */
.ord-card.dragging {
  opacity: 0.45;
  transform: rotate(1deg);
}
.kanban-col.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 2px var(--primary);
}
.kanban-empty {
  padding: 8px 4px;
  text-align: center;
}

/* Modul-Platzhalter (WIP) */
.module-wip {
  max-width: 520px;
  margin: 24px auto;
  text-align: center;
  padding: 40px 28px;
}
.module-wip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.quick-link .svg-ic {
  opacity: 0.75;
}

.btn-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px !important;
  min-width: 32px;
}
.btn-ic .svg-ic {
  width: 14px;
  height: 14px;
}

.pt-caret,
.cs-caret {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}
.pm-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.nav-wip .badge {
  font-size: 10px;
  vertical-align: middle;
  margin-left: 4px;
}

/* Fahrzeuge */
.veh-filters {
  margin-bottom: 14px;
}
.veh-card {
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 14px;
  padding: 10px;
}
.veh-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 4px 4px 0;
}
.veh-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.veh-card .name {
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  min-width: 0;
}
.veh-card .sub {
  margin-top: 3px;
  line-height: 1.35;
}
.veh-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.veh-card-actions .btn.sm {
  height: 34px;
}
.veh-card-actions .btn.secondary.sm {
  gap: 6px;
  padding: 0 12px !important;
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.veh-card-actions .btn.secondary.sm:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}
.veh-card-actions .action-menu-trigger {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
.veh-card-actions .action-menu-trigger:hover,
.veh-card-actions .action-menu-trigger[aria-expanded="true"] {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
}
.veh-card .chips {
  margin-top: 0;
}
.veh-photo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(160deg, #eef3f6 0%, #e2e9ef 100%);
  border: 1px solid var(--border);
  color: #7a8b98;
}
.veh-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.veh-photo-sm {
  width: 72px;
  height: 54px;
}
.veh-photo-md {
  width: 120px;
  height: 90px;
}
.veh-photo-lg {
  width: 160px;
  height: 120px;
}
.veh-card .veh-photo-row {
  position: relative;
  width: 188px;
  min-height: 118px;
  height: auto;
  align-self: stretch;
  border-radius: 12px;
}
.veh-card .veh-photo-row img {
  position: absolute;
  inset: 0;
}
.veh-photo-empty {
  flex-direction: column;
  gap: 4px;
  padding: 6px;
}
.veh-photo-icon {
  width: 28px;
  height: 28px;
  opacity: 0.85;
}
.veh-photo-lg .veh-photo-icon,
.veh-photo-row .veh-photo-icon {
  width: 40px;
  height: 40px;
}
.veh-photo-row .veh-photo-caption {
  display: none;
}
.veh-photo-caption {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #8a97a3;
  line-height: 1.1;
  text-align: center;
}
.veh-photo-sm .veh-photo-caption {
  display: none;
}
.veh-form-photo {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.veh-form-photo-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.veh-detail-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}
.veh-detail-plate {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.veh-key-chips {
  margin-top: 4px;
}
@media (max-width: 760px) {
  .list-card.veh-card {
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
    padding: 10px;
  }
  .veh-card .veh-photo-row {
    width: 148px;
    min-height: 112px;
  }
}
@media (max-width: 520px) {
  .veh-photo-sm {
    width: 56px;
    height: 42px;
    border-radius: 10px;
  }
  .veh-card .veh-photo-row {
    width: 132px;
    min-height: 108px;
    border-radius: 10px;
  }
  .veh-card-top {
    gap: 8px;
  }
  .veh-card-actions {
    margin-left: auto;
  }
  .veh-card-actions .btn.secondary.sm span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .veh-card-actions .btn.secondary.sm {
    width: 34px;
    padding: 0 !important;
  }
  .veh-form-photo {
    flex-direction: column;
    align-items: flex-start;
  }
  .veh-detail-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}
.veh-keys-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.veh-key-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface-2);
  text-align: center;
}
.veh-key-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
.veh-key-holder {
  font-size: 15px;
  font-weight: 700;
  margin: 8px 0 10px;
  min-height: 1.2em;
}
.veh-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  margin: 18px 0 10px;
  letter-spacing: 0.04em;
}
.veh-service-head {
  margin-bottom: 8px;
}
.veh-damage-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--surface-2);
}
.veh-damage-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.veh-damage-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.veh-damage-thumb {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.veh-damage-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.veh-damage-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.veh-damage-preview-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.alert.show.warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 10px 12px;
  border-radius: 10px;
}

/* Termine */
.appt-week-board .appt-card {
  border-left: 3px solid var(--primary);
}
.appt-card.appt-completed {
  border-left-color: var(--success);
  opacity: 0.85;
}
.appt-card.appt-cancelled {
  border-left-color: #94a3b8;
  opacity: 0.7;
}
.appt-card.appt-no_show {
  border-left-color: var(--danger);
}
.appt-type {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
}
.appt-participants {
  margin: 12px 0;
}
.appt-participant-list {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: var(--surface-2);
}
.appt-participant-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 4px;
  font-size: 14px;
  cursor: pointer;
}
.appt-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
}
.appt-list-card {
  cursor: pointer;
}

/* Profil & Avatare */
.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}
.avatar-img {
  padding: 0;
  overflow: hidden;
  background: var(--surface-2);
}
.avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-card .profile-edit {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.profile-fields {
  flex: 1;
  min-width: 240px;
}
.profile-upload-btn {
  cursor: pointer;
}

/* Einsatzplanung erweitert */
.plan-filters {
  margin-bottom: 12px;
}
.plan-person-scroll {
  overflow: auto;
}
.plan-person-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.plan-person-table th,
.plan-person-table td {
  border: 1px solid var(--border);
  padding: 5px 6px;
  vertical-align: middle;
}
.plan-person-table th {
  background: var(--surface-2);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}
.plan-person-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 148px;
  white-space: nowrap;
}
.plan-person-name-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.2;
}
.plan-person-name-text strong {
  font-size: 13px;
  font-weight: 600;
}
.plan-person-cell {
  min-width: 132px;
  vertical-align: top;
}
.plan-cell-deps {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}
.plan-person-grid-day .plan-cell-deps {
  max-height: none;
}
.plan-person-cell .plan-dep-compact {
  width: 100%;
  text-align: left;
}
.plan-cell-empty {
  display: block;
  padding: 0;
  text-align: center;
  line-height: 1;
}
.plan-cell-addable {
  cursor: pointer;
}
.plan-cell-addable:hover {
  background: var(--primary-soft);
}
.plan-drop-zone.drag-over {
  background: var(--primary-soft);
  outline: 2px dashed var(--primary);
}
.plan-dep-compact {
  padding: 6px 8px 6px 9px;
  border-radius: 8px;
  gap: 2px;
}
.plan-dep-compact-title {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  display: block;
  word-break: break-word;
}
.plan-dep-compact-time {
  font-size: 10px;
  color: var(--muted);
  display: block;
}
.plan-dep-card.is-dragging {
  opacity: 0.5;
}
.plan-person-grid-day th:not(:first-child),
.plan-person-grid-day td:not(:first-child) {
  min-width: 280px;
}
.plan-list-group {
  margin-bottom: 20px;
}
.plan-list-group:last-child {
  margin-bottom: 0;
}
.plan-list-date {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px;
  padding: 0 4px;
}
.plan-list-row {
  align-items: center;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
}
.plan-list-row:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.plan-list-avatar {
  flex-shrink: 0;
}

/* Schichtpläne */
.shift-cell {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
}
.shift-editable {
  cursor: pointer;
}
.shift-editable:hover {
  filter: brightness(0.95);
}
.shift-day {
  background: #ecfdf5;
  color: #065f46;
}
.shift-early {
  background: #eff6ff;
  color: #1d4ed8;
}
.shift-late {
  background: #fef3c7;
  color: #92400e;
}
.shift-night {
  background: #ede9fe;
  color: #5b21b6;
}
.shift-office {
  background: var(--surface-2);
}
.shift-off {
  background: #f1f5f9;
  color: var(--muted);
}
.shift-empty {
  color: var(--muted);
}
.shift-absent {
  background: #fee2e2;
  color: #991b1b;
}
.shift-vacation {
  background: #ffe4e6;
  color: #9f1239;
}
.shift-holiday {
  background: #e0e7ff;
  color: #3730a3;
}
.shift-closure {
  background: #f3e8ff;
  color: #6b21a8;
}
.sp-emp-reports {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  font-size: 13px;
}
.sp-emp-reports ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.sp-emp-reports li {
  margin: 6px 0;
}

.shift-table-month th:not(:first-child),
.shift-table-month td:not(:first-child) {
  min-width: 48px;
  max-width: 48px;
  padding: 6px 2px;
  font-size: 10px;
  white-space: nowrap;
}
.shift-table-month th:first-child,
.shift-table-month td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: 2px 0 4px rgba(15, 23, 42, 0.06);
}
.shift-table-month thead th:first-child {
  background: var(--surface-2);
}
.shift-table-month .shift-cell {
  padding: 10px 2px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.15;
}
.shift-table-month .shift-weekend-col {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}
.shift-month-scroll {
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-gutter: stable;
}
.shift-month-scroll::-webkit-scrollbar {
  height: 10px;
}
.shift-month-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}
.shift-month-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}

/* Einsatzplanung Monat: ganzer Monat ohne inneren Horizontalsroll */
.plan-person-scroll.plan-month-fit {
  overflow: visible;
  max-width: 100%;
}
.plan-month-fit .plan-person-table {
  table-layout: fixed;
  width: 100%;
}
.plan-month-fit .plan-person-table th:first-child,
.plan-month-fit .plan-person-table td.plan-person-name {
  width: 128px;
  min-width: 128px;
  max-width: 128px;
  padding: 4px 6px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
}
.plan-month-fit .plan-person-table thead th:first-child {
  background: var(--surface-2);
}
.plan-month-fit .plan-person-table th:not(:first-child),
.plan-month-fit .plan-person-table td:not(:first-child) {
  min-width: 0;
  max-width: none;
  width: auto;
  padding: 2px;
  font-size: 10px;
  white-space: pre-line;
  overflow: hidden;
  text-align: center;
  line-height: 1.15;
}
.plan-month-fit .plan-person-name {
  min-width: 0;
  gap: 6px;
}
.plan-month-fit .avatar-sm {
  width: 22px;
  height: 22px;
  font-size: 9px;
  flex-shrink: 0;
}
.plan-month-fit .plan-person-name-text strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-month-fit .plan-cell-deps {
  gap: 2px;
  max-height: none;
  overflow: visible;
}
.plan-month-fit .plan-dep-compact {
  padding: 3px 3px 3px 5px;
  border-radius: 5px;
  gap: 0;
}
.plan-month-fit .plan-dep-compact-title,
.plan-month-fit .plan-dep-compact-time {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-month-fit .plan-dep-compact-title {
  font-size: 10px;
}
.plan-month-fit .plan-dep-compact-time {
  font-size: 9px;
}
.plan-month-fit .shift-weekend-col {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.shift-proposal {
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
  position: relative;
  cursor: default;
}
.shift-proposal-mark {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 8px;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1;
  pointer-events: none;
}

.sp-plan-simple {
  display: grid;
  gap: 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
@media (min-width: 900px) {
  .sp-plan-simple {
    grid-template-columns: 1fr 1.2fr auto;
    align-items: start;
  }
}
.sp-simple-step {
  min-width: 0;
}
.sp-simple-run {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.sp-step-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 0 0 8px;
}
.sp-rule-hint {
  margin: 6px 0 0;
}
.sp-emp-picker {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  overflow: hidden;
}
.sp-emp-picker-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.sp-emp-picker-list {
  max-height: 180px;
  overflow: auto;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sp-emp-item {
  padding: 6px 4px;
  border-radius: 6px;
}
.sp-emp-item:hover {
  background: var(--surface);
}
.sp-rule-simple {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.sp-rule-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.sp-advanced {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
}
.sp-advanced summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.sp-shift-toggles {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.sp-shift-toggles .check-row input:disabled + span {
  opacity: 0.55;
}
.sp-rule-card {
  margin-bottom: 8px;
}
.sp-draft-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.sp-draft-warn-compact {
  font-size: 12px;
  color: #92400e;
  margin-top: 6px;
}

.sp-plan-bar {
  margin-bottom: 14px;
}
.sp-plan-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.sp-plan-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  min-width: 180px;
  flex: 1;
}
.sp-plan-toggle:hover .card-title {
  color: var(--primary-dark);
}
.sp-plan-chevron {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.sp-plan-bar.is-compact .sp-plan-chevron {
  transform: rotate(-90deg);
}
.sp-plan-bar.is-compact .sp-plan-body {
  display: none;
}
.sp-plan-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.sp-plan-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.sp-plan-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sp-plan-stat .k {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
}
.sp-plan-stat .v {
  display: block;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: normal;
}
.sp-plan-warnings {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  font-size: 13px;
}
.sp-plan-warnings ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.sp-plan-day {
  margin-bottom: 12px;
}
.sp-plan-day-head {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
}
.sp-plan-day-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sp-plan-assign {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.sp-plan-assign.is-existing {
  opacity: 0.85;
}
.sp-rule-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  margin-bottom: 10px;
}
.sp-rule-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}
.sp-rule-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}
.sp-rule-list li {
  margin: 2px 0;
}

/* Abwesenheiten Raster */
.abs-table {
  font-size: 12px;
}
.abs-cell {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  min-height: 28px;
}
.abs-editable {
  cursor: pointer;
}
.abs-editable:hover {
  filter: brightness(0.95);
}
.abs-empty {
  color: var(--muted);
}
.abs-vacation.abs-status-approved {
  background: #dbeafe;
  color: #1e40af;
}
.abs-vacation.abs-status-requested {
  background: #fef3c7;
  color: #92400e;
  outline: 1px dashed #f59e0b;
}
.abs-vacation.abs-status-rejected {
  background: #f1f5f9;
  color: #64748b;
  text-decoration: line-through;
}
.abs-sick.abs-status-approved {
  background: #fee2e2;
  color: #991b1b;
}
.abs-sick.abs-status-requested {
  background: #fef3c7;
  color: #92400e;
}
.abs-sick.abs-status-rejected {
  background: #f1f5f9;
  color: #64748b;
}
.abs-other.abs-status-approved {
  background: #ede9fe;
  color: #5b21b6;
}
.abs-other.abs-status-requested {
  background: #fef3c7;
  color: #92400e;
}
.abs-other.abs-status-rejected {
  background: #f1f5f9;
  color: #64748b;
}

.abs-cell-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 28px;
  line-height: 1.15;
}
.abs-cell-type {
  font-size: 11px;
  font-weight: 700;
}
.abs-cell-status {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0.92;
}
.abs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.abs-leg {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.abs-card.abs-status-requested {
  outline: 1px dashed #f59e0b;
}
.abs-card.abs-status-rejected {
  opacity: 0.85;
}

/* Dokumentenablage */
.doc-filters {
  margin-bottom: 12px;
}
.doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.doc-toolbar-select.custom-select {
  min-width: 140px;
  flex: 0 1 180px;
}
.doc-toolbar-select .cs-trigger {
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
}
.doc-toolbar-search {
  flex: 1;
  min-width: 180px;
  height: 34px;
  padding: 0 10px;
  margin: 0;
  font-size: 13px;
}
.doc-browser {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.doc-browser--flat {
  display: block;
}
.doc-tree-panel {
  padding: 10px;
  max-height: 70vh;
  overflow: auto;
}
.doc-tree-head {
  margin-bottom: 8px;
  font-weight: 600;
}
.doc-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.doc-tree-node {
  display: flex;
  flex-direction: column;
}
.doc-tree-children {
  margin-left: 12px;
}
.doc-tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.doc-tree-item:hover {
  background: var(--surface-2);
}
.doc-tree-item.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
}
.doc-tree-icon {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}
.doc-tree-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-browser-main {
  min-width: 0;
}
.doc-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 13px;
}
.doc-crumb {
  border: none;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
}
.doc-crumb:hover {
  background: var(--primary-soft);
}
.doc-crumb.active {
  color: var(--text);
  cursor: default;
  font-weight: 500;
}
.doc-crumb-sep {
  color: var(--muted);
  user-select: none;
}
.doc-row--folder {
  cursor: pointer;
}
.doc-row--folder:hover {
  border-color: var(--primary);
  background: var(--surface-2);
}
.doc-upload-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.doc-upload-bar .doc-drop-zone {
  flex: 1 1 200px;
  margin-bottom: 0;
}
.doc-upload-btn {
  cursor: pointer;
}
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon content"
    "actions actions";
  align-items: start;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.doc-row .grow {
  grid-area: content;
  min-width: 0;
}
.doc-row .name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}
.doc-row .sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
  margin-top: 2px;
}
.doc-row--compact {
  padding: 8px 10px;
}
.doc-row--compact .doc-row-actions {
  gap: 4px;
}
.doc-icon {
  grid-area: icon;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.danger-text {
  color: var(--danger);
}
.empty-inline {
  padding: 8px 0;
  margin: 0;
}
.sig-pad-wrap {
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fff;
  touch-action: none;
  margin: 8px 0;
  max-width: 100%;
  overflow: hidden;
}
.sig-pad-wrap canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 140px;
  cursor: crosshair;
  touch-action: none;
}
.order-complete-page .order-complete-shell {
  padding: 16px;
}
.order-complete-page .sig-pad-wrap canvas {
  height: 200px;
  min-height: 200px;
}
@media (min-width: 760px) {
  .order-complete-page .sig-pad-wrap canvas {
    height: 240px;
  }
}
.sig-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.sig-status-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.sig-status-item.done {
  border-color: #86efac;
  background: #ecfdf5;
}
.comp-invoice-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  margin: 12px 0;
  border-radius: 10px;
  background: var(--primary-soft);
  font-size: 16px;
}
.comp-invoice-total strong {
  font-size: 20px;
  color: var(--primary-dark);
}
.comp-done-banner {
  border-color: #86efac;
  background: #ecfdf5;
}
.comp-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.comp-steps + .chips {
  margin-top: 16px;
  margin-bottom: 18px;
}
.comp-step {
  flex: 1;
  min-width: 72px;
  text-align: center;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.comp-step:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}
.comp-wiz-hint {
  margin: 8px 0 0;
}
.comp-pane {
  display: none;
}
.comp-pane.is-on {
  display: block;
}
.comp-wiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.lex-copy-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.lex-copy-meta {
  min-width: 0;
  flex: 1;
}
.lex-copy-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.lex-copy-value {
  display: block;
  margin: 2px 0 0;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
pre.lex-copy-value {
  font-family: inherit;
  margin: 2px 0 0;
}
.lex-pack-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.lex-pack-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}
.lex-legacy {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.lex-legacy summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.92rem;
}
.lex-compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 10px 0;
}
.lex-compact-cell {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.lex-compact-cell .lex-copy-label {
  grid-column: 1 / -1;
}
.lex-compact-value {
  min-width: 0;
  font-size: 13px;
  word-break: break-word;
}
.lex-compact-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 640px) {
  .lex-compact-grid {
    grid-template-columns: 1fr;
  }
}
.lex-item-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0;
  background: var(--surface-2);
}
.lex-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.lex-item-grid .lex-copy-row:last-child {
  border-bottom: 0;
}
.comp-step span {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: var(--border);
  margin-right: 6px;
  font-weight: 700;
  font-size: 11px;
}
.comp-step.active {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
}
.comp-step.active span {
  background: var(--primary);
  color: #fff;
}
.comp-step.done {
  border-color: #86efac;
  background: #ecfdf5;
  color: #065f46;
}
.comp-step.done span {
  background: #10b981;
  color: #fff;
}

/* OpenStreetMap Adress-Autocomplete */
.addr-ac {
  position: relative;
}
.addr-ac .input {
  width: 100%;
}
.addr-ac-hint {
  margin: 4px 0 0;
  font-size: 11px;
}
.addr-ac-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 80;
  max-height: 260px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}
.addr-ac-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.addr-ac-item:hover,
.addr-ac-item.active {
  background: var(--primary-soft);
}
.addr-ac-label {
  font-size: 14px;
  font-weight: 600;
}
.addr-ac-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}
.addr-ac-empty {
  padding: 10px 12px;
  margin: 0;
}
.addr-missing .input {
  border-color: #f59e0b;
}
.addr-missing-hint {
  margin: 6px 0 0;
  color: #b45309;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-size: 14px;
  cursor: pointer;
}
.check-row input {
  width: 18px;
  height: 18px;
}
.ho-detail-meta {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}
.ho-list-card {
  cursor: pointer;
}
.ho-mat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.ho-mat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.ho-mat-row .name {
  font-weight: 600;
  font-size: 14px;
}
.ho-mat-row .sub {
  font-size: 12px;
  color: var(--muted);
}
.ho-mat-add {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}
.ho-mat-add-actions {
  display: flex;
  justify-content: flex-start;
}
.ho-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.ho-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 108px;
  padding: 12px 12px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.ho-tile:hover { border-color: var(--primary); }
.ho-tile.is-on {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--primary);
}
.ho-tile-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
}
.ho-tile.is-on .ho-tile-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.ho-tile-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  padding-right: 26px;
}
.ho-tile-avail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.ho-tile-foot {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.ho-tile-qty {
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.ho-tile-unit { color: var(--muted); font-size: 12px; }
.ho-tile-minus {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}
.ho-freetext {
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
}
.ho-freetext summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.ho-freetext[open] summary { margin-bottom: 10px; }
.ho-mat-add-actions .btn {
  width: auto;
}
.ho-pdf-link {
  margin-top: 10px;
  display: inline-flex;
}
.doc-stats-grid {
  margin-bottom: 12px;
}
.doc-module-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.doc-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.doc-chip:hover {
  border-color: var(--primary);
}
.doc-chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 600;
}
/* Medien-Picker (Datei / Galerie / Kamera) – über Modals */
.media-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 46, 54, 0.45);
  opacity: 0;
  transition: opacity 0.18s ease;
  padding: 0;
}
.media-picker-backdrop.show {
  opacity: 1;
}
.media-picker-sheet {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(12px);
  transition: transform 0.18s ease;
}
.media-picker-backdrop.show .media-picker-sheet {
  transform: translateY(0);
}
.media-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.media-picker-head h3 {
  margin: 0;
  font-size: 17px;
}
.media-picker-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.media-picker-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.media-picker-option:hover,
.media-picker-option:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
  outline: none;
}
.media-picker-option-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--surface);
  color: var(--primary-dark);
  border: 1px solid var(--border);
}
.media-picker-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.media-picker-option-text strong {
  font-size: 15px;
  font-weight: 600;
}
.media-picker-cancel {
  width: 100%;
}
@media (min-width: 720px) {
  .media-picker-backdrop {
    align-items: center;
    padding: 24px;
  }
  .media-picker-sheet {
    border-radius: 16px;
    padding: 18px;
  }
}

.doc-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  background: var(--surface-2);
  transition:
    border-color 0.15s,
    background 0.15s;
  cursor: pointer;
}
.doc-drop-zone--inline {
  padding: 12px;
  margin-bottom: 12px;
}
.doc-drop-zone.doc-drop-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.doc-drop-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.doc-page-drop {
  margin-bottom: 12px;
}
.doc-panel-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.doc-archive-link {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}
.doc-archive-link:hover {
  text-decoration: underline;
}
.doc-entity-link {
  display: inline-block;
  margin-top: 4px;
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}
.doc-entity-link:hover {
  text-decoration: underline;
}
.doc-row-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  padding-left: 32px;
}
.doc-preview-html {
  width: 100%;
  height: 65vh;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.doc-preview-img {
  max-width: 100%;
  max-height: 60vh;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}
.ocr-shot-block { margin-top: 14px; }
.ocr-shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}
.ocr-shot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.ocr-shot:hover { border-color: var(--primary); }
.ocr-shot img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  object-position: top;
  display: block;
  background: var(--surface-2);
}
.ocr-shot span {
  font-size: 12px;
  line-height: 1.3;
  padding: 0 8px 8px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.doc-preview-pdf {
  width: 100%;
  height: 65vh;
  border: none;
  border-radius: 8px;
}
.doc-load-more {
  text-align: center;
  padding: 12px 0 4px;
}
.doc-selected-file {
  margin: 8px 0;
  min-height: 18px;
}
.doc-filter-hint {
  margin: 10px 0 0;
}
.doc-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.doc-row--note {
  border-left: 3px solid var(--primary);
}
.doc-open-title {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.doc-snippet mark {
  background: #fde68a;
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}
.modal-note .modal-body {
  padding-bottom: 96px;
}
.note-body {
  min-height: min(32vh, 280px);
  font-size: 16px;
  line-height: 1.55;
  resize: vertical;
}
.note-reader {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
  max-height: 60vh;
  overflow: auto;
}
.note-share {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0 0;
}
.note-share legend {
  font-weight: 700;
  padding: 0 6px;
}
.note-vis-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 15px;
}
.note-vis-option input {
  margin-top: 3px;
  width: auto;
}
.note-share-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.note-share-author,
.note-share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.note-share-name {
  display: block;
  font-weight: 600;
}
.note-share-access {
  width: auto;
  flex: 0 0 auto;
  min-width: 8.5rem;
  font-size: 16px;
  padding: 8px 10px;
}
.note-share-list {
  max-height: 240px;
  overflow: auto;
}
.note-version-excerpt {
  margin: 6px 0 0;
  white-space: pre-wrap;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
@media (max-width: 800px) {
  .doc-browser {
    grid-template-columns: 1fr;
  }
  .doc-tree-panel {
    max-height: 200px;
  }
}
@media (min-width: 960px) {
  .doc-row {
    grid-template-columns: auto minmax(0, 1fr) minmax(180px, max-content);
    grid-template-areas: "icon content actions";
    align-items: center;
  }
  .doc-row-actions {
    padding-left: 0;
    justify-content: flex-end;
    max-width: 460px;
  }
}
.doc-version-badge {
  vertical-align: middle;
  margin-right: 4px;
}
.doc-row--trash {
  opacity: 0.92;
  background: var(--surface-2);
}
.doc-version-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow: auto;
}
.doc-version-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.doc-version-row--current {
  border-color: #86efac;
  background: #ecfdf5;
}
.link-btn {
  background: none;
  border: none;
  color: var(--primary-dark);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}
.min-w-0 {
  min-width: 0;
}

/* Material-Kategorien */
.mat-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cat-color, #64748b) 15%, transparent);
  color: var(--cat-color, #64748b);
  border: 1px solid
    color-mix(in srgb, var(--cat-color, #64748b) 35%, transparent);
}
.mat-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.mat-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mat-cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat-color, #64748b);
  flex-shrink: 0;
}
.mat-cat-count {
  font-size: 11px;
  opacity: 0.75;
  margin-left: 2px;
}
.mat-cat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 50vh;
  overflow: auto;
}
.mat-cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.mat-cat-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.mat-cat-color {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.mat-cat-color.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--surface);
}
.mat-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: end;
  margin: 0 0 14px;
}
.mat-toolbar-low {
  margin: 0 0 2px;
  white-space: nowrap;
}
.mat-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.mat-section-sub {
  margin: -4px 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.mat-stock {
  margin: 22px 0 0;
}
.mat-group {
  margin: 0 0 22px;
}
.mat-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 650;
}
.mat-group-count {
  margin-left: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.mat-group-title .mat-group-add {
  margin-left: auto;
}
.price-list summary .price-list-add,
.mat-group-title .mat-group-add {
  min-width: 2rem;
  padding: 4px 8px;
  font-size: 18px;
  line-height: 1;
  font-weight: 650;
}
@media (max-width: 640px) {
  .mat-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}
.price-lists {
  margin: 8px 0 0;
}
.price-lists-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.price-lists-title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  text-wrap: balance;
}
.price-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 8px;
}
.price-list summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
}
.price-list summary .btn {
  width: auto;
  flex: 0 0 auto;
}
.price-list summary::-webkit-details-marker {
  display: none;
}
.price-list[open] summary {
  border-bottom: 1px solid var(--border);
}
.price-list-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}
.price-list-price {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.price-list-meta {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.price-list-item-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px 8px;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
  text-align: left;
}
.price-list-stock {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.price-list-stock.low {
  color: #b45309;
}
.price-list.is-unassigned {
  border-style: dashed;
}
.price-list-item-price {
  margin: 0;
  justify-self: start;
  text-align: left;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}
.price-list-item-price em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
}
.price-list-item-price.is-own em {
  color: #0f766e;
}
.input-static {
  margin: 0;
  padding: 10px 0 0;
  font-weight: 650;
}
.price-list-body {
  padding: 4px 14px 12px;
}
.price-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  justify-items: start;
  gap: 4px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
  min-width: 0;
  text-align: left;
}
.price-list-item:first-child {
  border-top: 0;
}
.price-list-item-main {
  min-width: 0;
  text-align: left;
}
.price-list-item .name {
  min-width: 0;
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
}
.price-list-item .row-actions {
  justify-self: end;
  flex-wrap: nowrap;
}
@media (max-width: 720px) {
  .price-list-item {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }
  .price-list-item-price,
  .price-list-item .row-actions {
    grid-column: 2;
    justify-self: start;
  }
  .price-list-item-price {
    white-space: normal;
  }
  .price-list summary {
    align-items: flex-start;
  }
  .price-list-name {
    flex: 1 1 100%;
  }
}
.mat-photo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(160deg, #eef3f6 0%, #e2e9ef 100%);
  border: 1px solid var(--border);
  color: #7a8b98;
}
.mat-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mat-photo-sm {
  width: 52px;
  height: 52px;
}
.mat-photo-lg {
  width: 120px;
  height: 120px;
}
.mat-photo-empty {
  flex-direction: column;
}
.mat-photo-icon {
  width: 26px;
  height: 26px;
}
.mat-photo-lg .mat-photo-icon {
  width: 40px;
  height: 40px;
}

/* Kalender */
.cal-board .cal-event {
  border-left: 3px solid var(--primary);
  background: var(--surface-2);
  color: inherit;
  text-decoration: none;
}
.cal-event:hover {
  background: var(--surface);
}
.cal-event-title {
  font-weight: 700;
  font-size: 13px;
}
.cal-event-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.cal-legend-item {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.cal-deployment.sp-chip,
.cal-deployment.sp-legend-dot,
.cal-deployment.sp-shift-card {
  --sc-bg: #e8f1ff;
  --sc-fg: #1e4fb8;
  --sc-dot: #3b82f6;
}
.cal-appointment.sp-chip,
.cal-appointment.sp-legend-dot,
.cal-appointment.sp-shift-card {
  --sc-bg: #ece8fd;
  --sc-fg: #5228b6;
  --sc-dot: #7c3aed;
}
.cal-absence.sp-chip,
.cal-absence.sp-legend-dot,
.cal-absence.sp-shift-card {
  --sc-bg: #fde4e4;
  --sc-fg: #9b1c1c;
  --sc-dot: #ef4444;
}
.cal-shift.sp-chip,
.cal-shift.sp-legend-dot,
.cal-shift.sp-shift-card {
  --sc-bg: #fff2d6;
  --sc-fg: #9a4b00;
  --sc-dot: #f59e0b;
}

.plan-month-cal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 12px;
}
.plan-month-day.is-weekend {
  background: var(--surface-2);
}
.plan-month-day.today .plan-month-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-deep);
  color: #fff;
}
.plan-month-pills .sp-chip {
  width: 100%;
  justify-content: flex-start;
  min-height: 22px;
  padding: 0 6px;
  font-size: 10px;
  text-decoration: none;
}
.plan-week-head {
  cursor: pointer;
}
.cal-board .plan-week-body {
  gap: 6px;
}
.cal-board .sp-chip {
  width: 100%;
  justify-content: flex-start;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-day-hour-slot .sp-shift-card,
.sp-list-items .sp-shift-card {
  text-decoration: none;
}
@media (max-width: 760px) {
  .plan-month-day {
    min-height: 72px;
    padding: 5px 4px;
    border-radius: 8px;
  }
  .plan-month-pills .sp-chip {
    font-size: 9px;
  }
  .plan-week-col {
    min-width: 148px;
  }
}

/* Impersonation: immer sichtbar, solange die Fremdanmeldung läuft */
.impersonation-banner {
  position: sticky;
  top: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: #fef3c7;
  color: #92400e;
  border-bottom: 1px solid #fcd34d;
  font-size: 14px;
  text-align: center;
}
.impersonation-banner .btn {
  width: auto;
}

/* Mitarbeiter-Login */
.emp-login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* Kunden-Unterschrift (Tablet-Übergabe) */
.customer-handoff {
  border: 1px solid #c5e4e7;
  background: linear-gradient(180deg, #f3fbfb 0%, #e8f4f5 100%);
}
.customer-handoff-btn {
  width: 100%;
  font-size: 17px;
  padding: 16px 18px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(13, 92, 99, 0.18);
}
.customer-sign-page {
  margin: 0;
  min-height: 100dvh;
  background: #dfe7ec;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}
.csign {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 920px;
  margin: 0 auto;
  background: #e9eef2;
}
.csign--done {
  background: #fff;
}
.csign--handoff {
  background: #e9eef2;
}
.csign-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px calc(14px + env(safe-area-inset-top));
  background: #14212b;
  color: #fff;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}
.csign-brand {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.csign-head-sub,
.csign-head-meta {
  font-size: 13px;
  color: #9aadc0;
  margin-top: 4px;
  line-height: 1.4;
}
.csign-head-right {
  text-align: right;
}
.csign-invoice-no {
  font-size: 12px;
  color: #9aadc0;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}
.csign-total {
  font-size: 22px;
  font-weight: 700;
  color: #7ddecb;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}
.csign-scroll {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.csign-doc-wrap {
  position: relative;
  min-height: 320px;
  background: #e9eef2;
  padding: 12px 10px 0;
}
.csign-doc-frame {
  display: block;
  width: 100%;
  min-height: 480px;
  border: 0;
  background: transparent;
  border-radius: 4px;
}
.csign-doc-loading {
  display: grid;
  place-content: center;
  gap: 12px;
  min-height: 280px;
  text-align: center;
  color: #5b6b76;
  font-size: 14px;
  padding: 40px 16px;
}
.csign-sign-dock {
  margin: 8px 10px 0;
  background: #fff;
  border: 1px solid #c9d4dc;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(20, 33, 43, 0.08);
}
.csign-sign-dock-inner {
  padding: 18px 16px 20px;
}
.csign-sign-heading {
  margin: 0 0 6px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 22px;
  color: #14212b;
  letter-spacing: -0.02em;
}
.csign-sign-lead {
  margin: 0 0 14px;
  font-size: 14px;
  color: #5b6b76;
  line-height: 1.45;
}
.csign-tech-only {
  margin-top: 12px;
  width: 100%;
  color: #8a97a3;
}
.csign-name {
  font-size: 17px;
  padding: 14px 12px;
}
.csign-pad-label {
  margin: 12px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #5b6b76;
}
.csign-pad {
  border: 2px solid #0d5c63;
  border-radius: 12px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(0deg, transparent, transparent 27px, #eef2f5 28px)
      border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.csign-pad canvas {
  height: 200px;
  min-height: 200px;
}
.csign-sign-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.csign-sign-actions .btn {
  flex: 1;
  padding: 15px 16px;
  font-size: 15px;
  font-weight: 700;
}
.csign-sign-actions .btn.ghost {
  flex: 0 0 auto;
  font-weight: 600;
}
.csign-mail-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: #5b6b76;
  line-height: 1.45;
}
.csign-mail-note--warn {
  color: #92400e;
}
.csign-state,
.csign-success {
  margin: auto;
  padding: 28px 22px;
  max-width: 480px;
  text-align: center;
}
.csign-success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  font-size: 34px;
  line-height: 72px;
  font-weight: 700;
  box-shadow: 0 0 0 8px #f0fdf4;
}
.csign-success h1 {
  margin: 0 0 8px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 32px;
  letter-spacing: -0.02em;
}
.csign-success-lead {
  margin: 0 0 18px;
  color: #5b6b76;
  font-size: 15px;
}
.csign-success-card {
  text-align: left;
  background: #f4f7f9;
  border: 1px solid #d7dee5;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.csign-success-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e4eaef;
  font-size: 14px;
}
.csign-success-row:last-child {
  border-bottom: 0;
}
.csign-success-row span {
  color: #5b6b76;
}
.csign-mail-ok {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 18px;
}
.csign-mail-warn {
  background: #fff7e8;
  color: #7a4a00;
  border: 1px solid #f0d29a;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 18px;
}
.csign-success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.csign-success-actions .btn {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
}
@media (min-width: 768px) {
  .csign {
    border-left: 1px solid #c9d4dc;
    border-right: 1px solid #c9d4dc;
  }
  .csign-pad canvas {
    height: 220px;
  }
  .csign-doc-wrap {
    padding: 16px 16px 0;
  }
  .csign-sign-dock {
    margin: 12px 16px 0;
  }
  .csign-sign-dock-inner {
    padding: 22px 22px 24px;
  }
  .csign-success-actions {
    flex-direction: row;
  }
}
@media print {
  .csign-head,
  .csign-sign-dock {
    display: none !important;
  }
  .csign-doc-wrap {
    padding: 0;
  }
  .csign-doc-frame {
    min-height: 0 !important;
    height: auto !important;
  }
}

/* ==========================================================================
   Schichtpläne – modernes Raster, Chips, Mobile-Karten
   ========================================================================== */
.sp-page-head {
  margin-bottom: 10px;
}
.sp-page-head .page-sub {
  margin-bottom: 0;
}
.sp-page-head .row-actions {
  align-self: center;
}
.sp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}
.sp-toolbar .plan-view-tabs {
  margin: 0;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  gap: 2px;
}
.sp-toolbar .plan-view-tabs .tab {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  border-radius: 999px;
  transition:
    background 0.15s,
    color 0.15s;
}
.sp-toolbar .plan-view-tabs .tab.active {
  background: var(--brand-deep);
  color: #fff;
  box-shadow: 0 1px 2px rgba(15, 46, 54, 0.25);
}
.sp-toolbar .cal-nav {
  flex-wrap: nowrap;
  gap: 4px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.sp-toolbar .cal-nav .btn.ghost {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  color: var(--text);
}
.sp-toolbar .cal-nav .btn.ghost:hover {
  background: var(--surface-2);
}
.sp-toolbar .cal-nav-label {
  min-width: 0;
  padding: 0 6px;
  font-size: 14px;
}
.sp-toolbar .cal-nav .btn.secondary.sm {
  border-radius: 999px;
  padding: 6px 12px;
}
.sp-draft-hint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

/* ---- Farbschema pro Schichttyp (Chips, Legende, Mini-Kalender) ---- */
.sp-chip,
.sp-mcell,
.sp-legend-dot,
.sp-shift-card {
  --sc-bg: var(--surface-2);
  --sc-fg: var(--muted);
  --sc-dot: #94a3b8;
}
.shift-early.sp-chip,
.shift-early.sp-mcell,
.shift-early.sp-legend-dot,
.shift-early.sp-shift-card {
  --sc-bg: #e8f1ff;
  --sc-fg: #1e4fb8;
  --sc-dot: #3b82f6;
}
.shift-late.sp-chip,
.shift-late.sp-mcell,
.shift-late.sp-legend-dot,
.shift-late.sp-shift-card {
  --sc-bg: #fff2d6;
  --sc-fg: #9a4b00;
  --sc-dot: #f59e0b;
}
.shift-day.sp-chip,
.shift-day.sp-mcell,
.shift-day.sp-legend-dot,
.shift-day.sp-shift-card {
  --sc-bg: #e3f8ee;
  --sc-fg: #0b6b45;
  --sc-dot: #10b981;
}
.shift-night.sp-chip,
.shift-night.sp-mcell,
.shift-night.sp-legend-dot,
.shift-night.sp-shift-card {
  --sc-bg: #ece8fd;
  --sc-fg: #5228b6;
  --sc-dot: #7c3aed;
}
.shift-office.sp-chip,
.shift-office.sp-mcell,
.shift-office.sp-legend-dot,
.shift-office.sp-shift-card {
  --sc-bg: #e4f5f8;
  --sc-fg: #176d7e;
  --sc-dot: #1f8ea3;
}
.shift-off.sp-chip,
.shift-off.sp-mcell,
.shift-off.sp-legend-dot,
.shift-off.sp-shift-card {
  --sc-bg: #f1f5f7;
  --sc-fg: #64748b;
  --sc-dot: #cbd5e1;
}
.shift-vacation.sp-chip,
.shift-vacation.sp-mcell,
.shift-vacation.sp-legend-dot {
  --sc-bg: #ffe6ea;
  --sc-fg: #a5183a;
  --sc-dot: #f43f5e;
}
.shift-absent.sp-chip,
.shift-absent.sp-mcell,
.shift-absent.sp-legend-dot {
  --sc-bg: #fde4e4;
  --sc-fg: #9b1c1c;
  --sc-dot: #ef4444;
}
.shift-holiday.sp-chip,
.shift-holiday.sp-mcell,
.shift-holiday.sp-legend-dot {
  --sc-bg: #e5e9ff;
  --sc-fg: #3730a3;
  --sc-dot: #6366f1;
}
.shift-closure.sp-chip,
.shift-closure.sp-mcell,
.shift-closure.sp-legend-dot {
  --sc-bg: #f3e8ff;
  --sc-fg: #6b21a8;
  --sc-dot: #a855f7;
}

/* ---- Chip ---- */
.sp-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
  min-height: 26px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--sc-bg);
  color: var(--sc-fg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1;
}
.sp-chip-lg {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
}
.sp-chip-empty {
  background: transparent;
  color: var(--border);
}
.sp-chip-empty::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
}
.sp-chip-empty.sp-chip-lg::before {
  display: none;
}
.sp-chip-proposal {
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 6px,
      rgba(255, 255, 255, 0.45) 6px 9px
    ),
    var(--sc-bg);
  outline: 1.5px dashed var(--sc-fg);
  outline-offset: -1.5px;
}
.sp-chip-mark {
  position: absolute;
  top: -5px;
  right: -4px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--brand-deep);
  color: #fff;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  line-height: 13px;
  text-align: center;
  pointer-events: none;
}

/* ---- Desktop-Raster ---- */
.sp-board-desktop {
  display: block;
}
.sp-board-mobile {
  display: none;
}
.sp-grid-wrap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: auto;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #c3d3d9 transparent;
}
.sp-grid-wrap::-webkit-scrollbar {
  height: 10px;
}
.sp-grid-wrap::-webkit-scrollbar-thumb {
  background: #c3d3d9;
  border-radius: 999px;
  border: 2px solid var(--surface);
}
/* Rechter Fade-Rand als Scroll-Hinweis (per JS ein-/ausgeblendet) */
.sp-board-desktop {
  position: relative;
}
.sp-board-desktop::after {
  content: "";
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 56px;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95));
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s;
}
.sp-board-desktop:has(.sp-grid-wrap.at-end)::after,
.sp-board-desktop:has(.sp-grid-wrap-week)::after {
  opacity: 0;
}
.sp-grid {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: 13px;
}
.sp-grid-week {
  table-layout: fixed;
  width: 100%;
}
.sp-grid-week .sp-grid-day {
  width: auto;
  min-width: 0;
}
.sp-grid-week .sp-cell {
  padding: 4px 3px !important;
}
.sp-chip-wide {
  flex-direction: column;
  gap: 2px;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 10px;
  white-space: normal;
}
.sp-emp-name-btn {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.sp-emp-name-btn:hover { text-decoration: underline; }
.sp-focus-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.sp-chip-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
}
.sp-chip-sub {
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.8;
  line-height: 1.1;
}
.sp-grid-week .sp-chip-empty {
  min-height: 44px;
}
.sp-grid th,
.sp-grid td {
  padding: 0;
  border: 0;
  text-align: center;
  vertical-align: middle;
}
.sp-grid thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.sp-grid-day {
  min-width: 46px;
  width: 46px;
  padding: 10px 2px 8px !important;
  font-weight: 600;
  color: var(--muted);
}
.sp-grid-wd {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
  color: var(--muted);
}
.sp-grid-num {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
.sp-grid-day.is-weekend .sp-grid-num,
.sp-grid-day.is-weekend .sp-grid-wd {
  color: var(--muted);
}
.sp-grid-day.is-today .sp-grid-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--brand-deep);
  color: #fff;
  font-size: 12px;
}
.sp-grid-day.is-today .sp-grid-wd {
  color: var(--primary-dark);
  font-weight: 700;
}
.sp-grid-emp {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 190px;
  width: 190px;
  padding: 6px 12px 6px 14px !important;
  text-align: left !important;
  background: var(--surface);
  border-right: 1px solid var(--border);
  font-weight: 600;
}
.sp-grid-wrap:not(.at-start) .sp-grid-emp {
  box-shadow: 6px 0 10px -6px rgba(15, 46, 54, 0.22);
}
.sp-emp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sp-grid tbody .sp-grid-emp {
  border-bottom: 1px solid var(--border);
}
.sp-grid thead .sp-grid-emp {
  z-index: 4;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  vertical-align: bottom;
  padding-bottom: 10px !important;
}
.sp-grid tbody tr {
  transition: background 0.12s;
}
.sp-grid tbody tr:hover > td {
  background: color-mix(in srgb, var(--primary-soft) 40%, transparent);
}
.sp-grid tbody tr:hover > .sp-grid-emp {
  background: color-mix(in srgb, var(--primary-soft) 40%, var(--surface));
}
.sp-grid tbody tr:last-child .sp-grid-emp,
.sp-grid tbody tr:last-child .sp-cell {
  border-bottom: 0;
}
.sp-cell {
  padding: 3px 2px !important;
  border-bottom: 1px solid var(--border);
}
.sp-cell.is-weekend {
  background: color-mix(in srgb, var(--surface-2) 85%, transparent);
}
.sp-cell.is-today {
  background: color-mix(in srgb, var(--primary-soft) 55%, transparent);
  box-shadow: inset 1px 0 0 color-mix(in srgb, var(--primary) 30%, transparent),
    inset -1px 0 0 color-mix(in srgb, var(--primary) 30%, transparent);
}
.sp-cell .sp-chip {
  width: 100%;
  min-height: 30px;
}
.sp-cell.shift-editable {
  cursor: pointer;
}
.sp-cell.shift-editable:hover .sp-chip {
  filter: brightness(0.94);
  transform: translateY(-1px);
}
.sp-cell.shift-editable:hover .sp-chip-empty {
  background: var(--surface-2);
  color: var(--primary);
}
.sp-cell.shift-editable:hover .sp-chip-empty::before {
  background: var(--primary);
}
.sp-cell .sp-chip {
  transition:
    transform 0.12s,
    filter 0.12s,
    background 0.12s;
}

/* Mitarbeiter-Kopf (Raster + Karten) */
.sp-emp-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  line-height: 1.2;
}
.sp-emp-text strong {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.sp-emp-load {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.sp-emp-bar {
  display: block;
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  position: relative;
}
.sp-emp-bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 0%);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--brand));
}
.sp-grid .avatar-sm,
.sp-emp-card-head .avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-soft), #cfeef3);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---- Legende ---- */
.sp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 12px 4px 0;
  font-size: 12px;
  color: var(--muted);
}
.sp-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sp-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--sc-dot);
  flex-shrink: 0;
}
.sp-legend-dot-draft {
  background: transparent;
  outline: 1.5px dashed var(--brand-deep);
  outline-offset: -1px;
}

/* ---- Karten (Mobile & Einzelansicht) ---- */
.sp-cards {
  display: grid;
  gap: 12px;
}
.sp-emp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.sp-emp-card-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
summary.sp-emp-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
summary.sp-emp-card-head::-webkit-details-marker {
  display: none;
}
summary.sp-emp-card-head .sp-emp-head {
  flex: 1;
  min-width: 0;
}
.sp-emp-card-chevron {
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  transition: transform 0.15s ease;
}
details.sp-emp-card:not([open]) .sp-emp-card-chevron {
  transform: rotate(-90deg);
}
details.sp-emp-card:not([open]) > summary.sp-emp-card-head {
  border-bottom: 0;
  background: var(--surface);
}
.sp-emp-card-head .sp-emp-text strong {
  max-width: none;
  font-size: 14px;
}
.sp-board-single .sp-emp-card-head {
  display: none;
}

/* Mini-Kalender (Monat) */
.sp-mini-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  padding: 10px;
}
.sp-mini-wd {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 2px 0 4px;
}
.sp-mini-wd:nth-child(6),
.sp-mini-wd:nth-child(7) {
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}
.sp-mcell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  min-height: 54px;
  padding: 6px 2px 5px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--sc-bg);
  color: var(--sc-fg);
  font: inherit;
  cursor: default;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}
.sp-mcell.is-empty {
  background: var(--surface);
  border-color: var(--border);
  color: var(--muted);
}
.sp-mcell.is-empty.is-weekend {
  background: var(--surface-2);
  border-color: transparent;
}
.sp-mcell-pad {
  background: transparent;
  border: 0;
  min-height: 0;
}
.sp-mcell-num {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: inherit;
}
.sp-mcell.is-empty .sp-mcell-num {
  color: var(--text);
  font-weight: 600;
}
.sp-mcell-lbl {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.sp-lbl-full,
.sp-mcell-time {
  display: none;
}
.sp-mcell-time {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.8;
  line-height: 1.1;
  white-space: nowrap;
}
.sp-mcell.is-today {
  box-shadow: 0 0 0 2px var(--brand-deep);
}
.sp-mcell.is-today .sp-mcell-num {
  color: var(--brand-deep);
}
.sp-mcell.is-today.is-empty .sp-mcell-num,
.sp-mcell.is-today:not(.is-empty) .sp-mcell-num {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}
.sp-mcell.shift-editable {
  cursor: pointer;
}
.sp-mcell.shift-editable:active {
  transform: scale(0.96);
}
.sp-mcell.sp-chip-proposal {
  outline-offset: -1.5px;
}
.sp-mcell .sp-chip-mark {
  top: 3px;
  right: 3px;
}

/* Tageszeilen (Woche) */
.sp-day-rows {
  display: flex;
  flex-direction: column;
}
.sp-day-row {
  display: grid;
  grid-template-columns: 44px auto 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.sp-day-row:last-child {
  border-bottom: 0;
}
.sp-day-row.is-weekend {
  background: var(--surface-2);
}
.sp-day-row.is-today {
  box-shadow: inset 3px 0 0 var(--brand-deep);
}
.sp-day-row.shift-editable {
  cursor: pointer;
}
.sp-day-row.shift-editable:hover {
  background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface));
}
.sp-day-row-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.sp-day-row.is-today .sp-day-row-date .sp-grid-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-deep);
  color: #fff;
  font-size: 13px;
}
.sp-day-row-meta {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Schicht-Karte (Tag & Liste) ---- */
.sp-shift-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px 10px 10px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--sc-dot);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: default;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.1s;
}
.sp-shift-card.shift-editable {
  cursor: pointer;
}
.sp-shift-card.shift-editable:hover {
  border-color: var(--primary);
  border-left-color: var(--sc-dot);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.sp-shift-card .avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-soft), #cfeef3);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.sp-shift-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}
.sp-shift-card-text strong {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-shift-card-meta {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-shift-card .sp-chip {
  flex-shrink: 0;
}

/* ---- Liste, nach Tagen gruppiert ---- */
.sp-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sp-list-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.sp-list-group.is-today {
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
}
.sp-list-date {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.sp-list-group.is-today .sp-list-date {
  background: var(--primary-soft);
}
.sp-list-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.sp-list-group.is-today .sp-list-date-badge {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}
.sp-list-group.is-today .sp-list-date-badge .sp-grid-wd,
.sp-list-group.is-today .sp-list-date-badge .sp-grid-num {
  color: #fff;
}
.sp-list-date-long {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-list-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.sp-list-items {
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px;
}
@media (min-width: 760px) {
  .sp-list-items {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

/* ---- Mobile ---- */
@media (max-width: 760px) {
  .sp-page-head {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
  }
  .sp-page-head .row-actions {
    width: auto;
    align-self: flex-start;
  }
  .sp-page-head .page-title {
    font-size: 20px;
  }
  .sp-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .sp-toolbar .plan-view-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }
  .sp-toolbar .plan-view-tabs .tab {
    padding: 8px 4px;
    text-align: center;
  }
  .sp-toolbar .cal-nav {
    justify-content: space-between;
  }
  .sp-toolbar .cal-nav-label {
    flex: 1;
    text-align: center;
  }
  .sp-board-desktop {
    display: none;
  }
  .sp-board-mobile {
    display: block;
  }
  .sp-mini-cal {
    gap: 3px;
    padding: 8px;
  }
  .sp-mcell {
    min-height: 50px;
    border-radius: 8px;
  }
  .sp-mcell-lbl {
    font-size: 9px;
  }
  .sp-day-row {
    grid-template-columns: 40px auto 1fr;
    gap: 10px;
    padding: 10px 12px;
  }
  .sp-legend {
    gap: 6px 12px;
    font-size: 11px;
  }
  .sp-list-items {
    padding: 10px 10px 12px;
  }
  .sp-shift-card {
    padding: 8px 10px 8px 8px;
  }
  .sp-shift-card .avatar-sm {
    width: 32px;
    height: 32px;
  }
  .sp-plan-bar .sp-plan-bar-inner .row-actions {
    display: none;
  }
}
@media (min-width: 761px) {
  .sp-board-single .sp-mini-cal {
    gap: 6px;
    padding: 14px;
  }
  .sp-board-single .sp-mcell {
    min-height: 72px;
    padding: 8px 4px 6px;
    border-radius: 12px;
  }
  .sp-board-single .sp-mcell-num {
    font-size: 14px;
  }
  .sp-board-single .sp-mcell-lbl {
    font-size: 12px;
  }
  .sp-board-single .sp-lbl-short {
    display: none;
  }
  .sp-board-single .sp-lbl-full,
  .sp-board-single .sp-mcell-time {
    display: inline;
  }
  .sp-board-single .sp-mcell {
    gap: 3px;
  }
  .sp-board-single .sp-day-row {
    padding: 14px 18px;
    grid-template-columns: 52px auto 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sp-cell .sp-chip,
  .sp-shift-card,
  .sp-toolbar .plan-view-tabs .tab {
    transition: none;
  }
  .sp-cell.shift-editable:hover .sp-chip,
  .sp-shift-card.shift-editable:hover,
  .sp-mcell.shift-editable:active {
    transform: none;
  }
}

/* ==========================================================================
   Abwesenheiten – gleiche Raster-/Karten-UI wie Schichtpläne
   ========================================================================== */
.abs-vacation.sp-chip,
.abs-vacation.sp-mcell,
.abs-vacation.sp-legend-dot,
.abs-vacation.sp-shift-card {
  --sc-bg: #e8f1ff;
  --sc-fg: #1e4fb8;
  --sc-dot: #3b82f6;
}
.abs-sick.sp-chip,
.abs-sick.sp-mcell,
.abs-sick.sp-legend-dot,
.abs-sick.sp-shift-card {
  --sc-bg: #fde4e4;
  --sc-fg: #9b1c1c;
  --sc-dot: #ef4444;
}
.abs-other.sp-chip,
.abs-other.sp-mcell,
.abs-other.sp-legend-dot,
.abs-other.sp-shift-card {
  --sc-bg: #ece8fd;
  --sc-fg: #5228b6;
  --sc-dot: #7c3aed;
}
.abs-holiday.sp-chip,
.abs-holiday.sp-mcell,
.abs-holiday.sp-legend-dot {
  --sc-bg: #e5e9ff;
  --sc-fg: #3730a3;
  --sc-dot: #6366f1;
}
.abs-status-rejected.sp-chip,
.abs-status-rejected.sp-mcell,
.abs-status-rejected.sp-legend-dot,
.sp-chip.is-rejected,
.sp-mcell.is-rejected {
  --sc-bg: #f1f5f7;
  --sc-fg: #64748b;
  --sc-dot: #94a3b8;
  text-decoration: line-through;
  opacity: 0.78;
}
.sp-grid-day.is-holiday .sp-grid-num {
  color: #3730a3;
}
.sp-shift-card .row-actions {
  flex-shrink: 0;
  margin-left: auto;
}
/* Listen- und Tageskarten: Name und Zeitraum lesbar, nicht als gelber Status-Chip. */
.sp-shift-card.abs-vacation,
.sp-shift-card.abs-sick,
.sp-shift-card.abs-other {
  background: var(--surface);
  color: var(--text);
  outline: none;
  text-decoration: none;
  opacity: 1;
}
.sp-chip.abs-vacation,
.sp-chip.abs-sick,
.sp-chip.abs-other {
  background: var(--sc-bg);
  color: var(--sc-fg);
}
.sp-chip.abs-status-requested {
  outline: 1.5px dashed var(--sc-fg);
  outline-offset: -1.5px;
}
#abs-view .sp-list-items {
  grid-template-columns: 1fr;
}
.sp-shift-card.abs-list-card {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.abs-list-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  width: 100%;
}
.abs-list-card .sp-shift-card-text strong {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font-size: 15px;
  color: var(--text);
}
.abs-list-range {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: normal;
}
.abs-list-card .sp-chip {
  margin-left: auto;
  margin-top: 2px;
}
.sp-shift-card.abs-list-card .row-actions {
  flex: 0 0 auto;
  width: auto;
  margin: 6px 0 0;
  justify-content: flex-start;
}
.sp-shift-card.abs-list-card .row-actions .btn {
  width: auto;
  flex: 0 0 auto;
  padding: 6px 12px;
  font-size: 13px;
}
.sp-page-head + .ff-bar {
  margin-bottom: 10px;
}
.stock-gap-banner {
  margin-bottom: 14px;
}
.stock-gap-set {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 8px;
}
.stock-gap-set .input {
  width: 96px;
  margin: 0;
}
.dash-gap {
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.dash-gap:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}
.abs-list-caption {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.abs-work-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.abs-work-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.abs-work-table th,
.abs-work-table td {
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.abs-work-table th {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  white-space: nowrap;
}
.abs-work-table tbody tr {
  cursor: pointer;
}
.abs-work-table tbody tr:hover td {
  background: var(--surface-2);
}
.abs-work-table tr.is-rejected td:first-child {
  box-shadow: inset 3px 0 0 #ef4444;
}
.abs-work-table tr.is-requested td:first-child {
  box-shadow: inset 3px 0 0 #d97706;
}
.abs-work-table tr.is-approved td:first-child {
  box-shadow: inset 3px 0 0 #16a34a;
}
.abs-work-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  font-weight: 650;
}
.abs-work-range {
  white-space: normal;
  min-width: 140px;
}
.abs-work-time,
.abs-work-sub {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.abs-work-sub {
  margin-top: 4px;
}
.abs-work-actions {
  text-align: right;
}
.abs-work-table .row-actions {
  justify-content: flex-end;
  margin: 0;
}
@media (max-width: 760px) {
  .sp-shift-card {
    flex-wrap: wrap;
  }
  .sp-shift-card .row-actions {
    flex: 1 1 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}

/* ==========================================================================
   Einsatzplanung – gleiche Raster-/Karten-UI wie Schichtpläne
   ========================================================================== */
.plan-dep-planned.sp-chip,
.plan-dep-planned.sp-mcell,
.plan-dep-planned.sp-legend-dot,
.plan-dep-planned.sp-shift-card,
.plan-dep-planned.sp-day-event {
  --sc-bg: #e8f1ff;
  --sc-fg: #1e4fb8;
  --sc-dot: #3b82f6;
}
.plan-dep-confirmed.sp-chip,
.plan-dep-confirmed.sp-mcell,
.plan-dep-confirmed.sp-legend-dot,
.plan-dep-confirmed.sp-shift-card,
.plan-dep-confirmed.sp-day-event {
  --sc-bg: #e4f5f8;
  --sc-fg: #176d7e;
  --sc-dot: #1f8ea3;
}
.plan-dep-in_progress.sp-chip,
.plan-dep-in_progress.sp-mcell,
.plan-dep-in_progress.sp-legend-dot,
.plan-dep-in_progress.sp-shift-card,
.plan-dep-in_progress.sp-day-event {
  --sc-bg: #fff2d6;
  --sc-fg: #9a4b00;
  --sc-dot: #f59e0b;
}
.plan-dep-completed.sp-chip,
.plan-dep-completed.sp-mcell,
.plan-dep-completed.sp-legend-dot,
.plan-dep-completed.sp-shift-card,
.plan-dep-completed.sp-day-event {
  --sc-bg: #e3f8ee;
  --sc-fg: #0b6b45;
  --sc-dot: #10b981;
}
.plan-dep-cancelled.sp-chip,
.plan-dep-cancelled.sp-mcell,
.plan-dep-cancelled.sp-legend-dot,
.plan-dep-cancelled.sp-shift-card,
.plan-dep-cancelled.sp-day-event {
  --sc-bg: #f1f5f7;
  --sc-fg: #64748b;
  --sc-dot: #94a3b8;
  text-decoration: line-through;
  opacity: 0.78;
}
.sp-cell-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-height: 30px;
  padding: 2px;
}
.sp-cell-stack .sp-chip {
  width: 100%;
  cursor: grab;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-cell-stack .sp-chip:active {
  cursor: grabbing;
}
.sp-chip-more {
  display: block;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.2;
  padding-bottom: 2px;
}
.sp-grid-week .sp-cell-stack,
.sp-day-row .sp-cell-stack {
  gap: 4px;
  padding: 4px 2px;
}
.sp-day-row .sp-cell-stack {
  grid-column: 2 / -1;
}
.sp-mcell.plan-drop-zone.drag-over,
.sp-cell.plan-drop-zone.drag-over,
.sp-day-row.plan-drop-zone.drag-over,
.sp-day-hour-slot.plan-drop-zone.drag-over {
  background: var(--primary-soft);
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
}

.sp-day-sched-wrap {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  scrollbar-width: thin;
}
.sp-day-sched {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.sp-day-sched-wrap .sp-day-sched {
  border: 0;
  border-radius: 0;
  min-width: max-content;
}
.sp-day-sched-grid {
  --emp-count: 1;
}
.sp-day-sched-head,
.sp-day-sched-grid .sp-day-hour-row {
  display: grid;
  grid-template-columns: 56px repeat(var(--emp-count), minmax(148px, 1fr));
}
.sp-day-sched-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.sp-day-emp-head {
  padding: 8px 10px;
  border-left: 1px solid var(--border);
  min-width: 0;
}
.sp-day-hour-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  min-height: 56px;
  border-bottom: 1px solid var(--border);
}
.sp-day-hour-row:last-child {
  border-bottom: 0;
}
.sp-day-hour-row.is-now .sp-day-hour-label {
  color: var(--brand-deep);
  font-weight: 750;
}
.sp-day-hour-row.is-now .sp-day-hour-slot {
  background: color-mix(in srgb, var(--primary-soft) 40%, var(--surface));
}
.sp-day-hour-label {
  position: sticky;
  left: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 8px 8px 0 6px;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--surface);
}
.sp-day-hour-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 6px 8px;
  border-left: 1px solid var(--border);
}
.sp-day-hour-slot.shift-editable {
  cursor: pointer;
}
.sp-day-hour-slot.shift-editable:hover {
  background: color-mix(in srgb, var(--primary-soft) 50%, var(--surface));
}
.sp-day-event {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-left: 3px solid var(--sc-dot, var(--primary));
  border-radius: 10px;
  background: var(--sc-bg, var(--surface-2));
  color: var(--sc-fg, var(--text));
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sp-day-event-time {
  font-size: 11px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.sp-day-event-title {
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.sp-day-event-emp,
.sp-day-event-loc {
  font-size: 12px;
  opacity: 0.78;
  overflow-wrap: anywhere;
}
.sp-day-event[draggable="true"] {
  cursor: grab;
}
.sp-day-event.is-dragging {
  opacity: 0.45;
}

.plan-dep-mixed.sp-chip,
.plan-dep-mixed.sp-mcell {
  --sc-bg: var(--primary-soft);
  --sc-fg: var(--brand-deep, var(--primary));
  --sc-dot: var(--primary);
}
.sp-cell {
  text-align: center;
  vertical-align: middle;
}
.sp-count {
  width: 100%;
  min-height: 34px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
}
.sp-count:hover {
  filter: brightness(0.96);
}
.sp-mcell-lbl {
  font-size: 14px;
  font-weight: 800;
}
.plan-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-pick-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.plan-pick-time {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.plan-pick-body {
  min-width: 0;
}
.sp-real-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sp-real-table-wrap {
  overflow-x: auto;
}
.sp-real-table {
  width: 100%;
  border-collapse: collapse;
}
.sp-real-table th,
.sp-real-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.sp-real-table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
}
.sp-real-table tr:last-child td {
  border-bottom: 0;
}
.sp-real-row {
  cursor: pointer;
}
.sp-real-row:hover td {
  background: color-mix(in srgb, var(--primary-soft) 65%, transparent);
}
.sp-real-time {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sp-select-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.sp-cell.is-selected,
.sp-mcell.is-selected,
.sp-day-row.is-selected,
.sp-shift-card.is-selected,
.sp-real-row.is-selected td {
  box-shadow: inset 0 0 0 2px var(--primary);
}
.sp-cell.is-selected {
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
}
.sp-mcell.is-selected,
.sp-day-row.is-selected,
.sp-shift-card.is-selected {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
body.sp-selecting .content {
  padding-bottom: 128px;
}
.sp-select-bar {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 24px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(15, 46, 54, 0.16);
}
.sp-select-bar[hidden] {
  display: none;
}
.sp-select-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}
.sp-select-meta strong {
  font-size: 14px;
}
.sp-select-types,
.sp-select-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sp-type-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
}
.sp-type-btn:hover { filter: brightness(0.95); }
.sp-type-btn:disabled { opacity: 0.45; cursor: default; }
.sp-type-btn.shift-early { background: #e8f1ff; color: #1e4fb8; }
.sp-type-btn.shift-late { background: #fff2d6; color: #9a4b00; }
.sp-type-btn.shift-day { background: #e3f8ee; color: #0b6b45; }
.sp-type-btn.shift-night { background: #ece8fd; color: #5228b6; }
.sp-type-btn.shift-office { background: #e4f5f8; color: #176d7e; }
.sp-type-btn.shift-off { background: var(--surface-2); color: var(--muted); }
.sp-select-bar .btn.is-on {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.sp-delete-scopes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sp-delete-scopes .check-row {
  align-items: flex-start;
  margin: 0;
}

.ha-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
}
.ha-year {
  min-width: 4.5ch;
  text-align: center;
  font-weight: 700;
}
.ha-month {
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.ha-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ha-item .ha-date {
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
}
.ha-item.is-suppressed .ha-date,
.ha-item.is-suppressed .ha-name {
  text-decoration: line-through;
}
.ha-edit,
.ha-confirm {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
}
.ha-confirm {
  margin-bottom: 12px;
}
.ha-states {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 2px 12px;
  margin-top: 8px;
}
.ha-section {
  margin-top: 22px;
}
.ha-modal .modal-body {
  max-height: min(72vh, 760px);
  overflow: auto;
}

.inv-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.inv-open-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}
.inv-open-card {
  display: block;
  color: inherit;
  text-decoration: none;
}
.inv-open-card:hover { border-color: var(--primary); }
.inv-open-top,
.inv-line-head,
.inv-line-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.inv-how {
  margin: -8px 0 8px;
  max-width: 62ch;
}
.inv-open-title { font-weight: 650; margin: 8px 0 4px; }
.inv-open-progress { margin: 10px 0 0; font-weight: 650; }
.inv-history-title { margin-top: 8px; }
.inv-history tbody tr { cursor: pointer; }
.inv-filters {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}
.inv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-line { margin-bottom: 12px; }
.inv-line-name { min-width: 0; flex: 1; }
.inv-line-name strong,
.inv-line-name .sub { overflow-wrap: anywhere; }
.inv-soll {
  flex: none;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.inv-soll strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.15;
}
.inv-count {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}
.inv-count > span {
  font-size: 13px;
  font-weight: 650;
}
.inv-qty {
  width: 100%;
  min-height: 48px;
  font-size: 18px;
}
.inv-line-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.inv-line-actions .btn {
  width: auto;
  flex: 1 1 180px;
}
.inv-line-foot { margin-top: 10px; align-items: center; }
.inv-line-foot .btn { width: auto; flex: none; }
.inv-note { flex: 1 1 160px; min-width: 0; width: auto; }
.inv-fb {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 650;
}
.inv-fb.is-match { background: #ecfdf3; color: #166534; }
.inv-fb.is-shortage { background: #fef2f2; color: #991b1b; }
.inv-fb.is-surplus { background: #fffbeb; color: #92400e; }
.inv-drift {
  margin: 8px 0 0;
  color: #92400e;
  font-size: 13px;
}
.inv-dock {
  position: static;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.inv-dock-copy { min-width: 0; }
.inv-dock-copy strong { white-space: nowrap; }
.inv-dock-btn {
  width: auto;
  white-space: nowrap;
}
.inv-progress {
  height: 8px;
  margin-top: 6px;
  border-radius: 99px;
  background: var(--surface-2, #eef2f6);
  overflow: hidden;
}
.inv-progress > span {
  display: block;
  height: 100%;
  background: #16a34a;
}
.inv-mode {
  border: 0;
  margin: 14px 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.inv-mode legend { font-weight: 650; margin-bottom: 4px; }
.inv-mat-results { display: grid; gap: 8px; margin-top: 12px; }
.inv-mat-hit {
  display: grid;
  text-align: left;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}
.inv-watch { margin-bottom: 14px; }
.inv-protocol-lead p { margin: 0 0 8px; }
.inv-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
  margin: 12px 0 0;
}
.inv-meta div { margin: 0; }
.inv-meta dt { color: var(--muted); font-size: 12px; font-weight: 650; }
.inv-meta dd { margin: 2px 0 0; }
.inv-note-read { margin: 12px 0 0; }
.inv-diff-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.inv-diff-list li.is-shortage::marker { color: #991b1b; }
.inv-diff-list li.is-surplus::marker { color: #92400e; }
.inv-table-card,
.inv-match-block,
.inv-diff-card { margin-top: 12px; }
.inv-match-block summary { cursor: pointer; font-weight: 650; }
.inv-apply { margin-top: 12px; }
@media (max-width: 720px) {
  .inv-kpis { grid-template-columns: 1fr 1fr; }
  .inv-line-head,
  .inv-line-foot,
  .inv-dock { grid-template-columns: 1fr; }
  .inv-line-head { flex-direction: column; }
  .inv-soll { text-align: left; }
  .inv-dock-btn { width: 100%; }
}
