:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --color-bg: #f5f7fb;
  --color-surface: #ffffff;
  --color-surface-soft: #f8fafc;
  --color-border: #d1d9e4;
  --color-border-strong: #c1c9d6;
  --color-text: #0f172a;
  --color-muted: #64748b;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-soft: #eff6ff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 22px 55px rgba(15, 23, 42, 0.12);
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}
* {
  box-sizing: border-box;
  font-family: var(--font-sans);
}
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}
svg {
  shape-rendering: geometricPrecision;
}
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  overflow-y: scroll;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}
.app { padding: 18px; max-width: 1200px; margin: 0 auto; overflow-x: hidden; }
.app.app--session {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}
.app.app--tourenplanung .main-layout {
  width: 100%;
  max-width: none;
  margin: 0;
}
.app.app--tourenplanung .main-workspace {
  max-width: min(1880px, 100%);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 56px);
}
html.tp-view-expanded .app.app--tourenplanung,
html.tp-view-expanded .app.app--tourenplanung .main-workspace {
  max-width: none;
  width: 100%;
}
html.tp-view-expanded .app.app--tourenplanung {
  padding: 8px 12px 12px;
}
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
}
.narrow { max-width: 420px; margin: 40px auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.logo-btn { display: inline-flex; align-items: center; gap: 8px; background: transparent; color: #0b3b94; font-size: 28px; font-weight: 700; padding: 0; border: 0; max-width: min(100%, 320px); }
.logo-brand-inner { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; }
.logo-mark { color: #0ea5e9; font-size: 24px; flex-shrink: 0; }
.topbar-company-logo-wrap {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  height: 40px;
  max-width: min(240px, 42vw);
}
.topbar-company-logo-img {
  display: block;
  max-height: 40px;
  max-width: min(240px, 42vw);
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
}
.company-logo-fields { margin-top: 12px; display: grid; gap: 8px; max-width: 520px; }
.company-logo-file-label input[type="file"] { display: block; margin-top: 4px; font-size: 13px; }
.company-logo-hint { margin: 0; max-width: 520px; }
.company-logo-preview-wrap { display: grid; gap: 6px; }
.company-logo-preview-box {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 72px;
  max-width: 280px;
}
.stock-inquiry-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  max-width: 640px;
}
.stock-article-search-wrap {
  position: relative;
  max-width: 420px;
}
.stock-article-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stock-article-suggestions.hidden {
  display: none !important;
}
.stock-article-suggestion-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: #f8fafc;
  font: inherit;
  cursor: pointer;
  color: #0f172a;
}
.stock-article-suggestion-btn:hover,
.stock-article-suggestion-btn:focus-visible {
  background: #e0e7ff;
  outline: none;
}
.stock-article-label input {
  width: 100%;
  max-width: 420px;
}
.stock-article-meta {
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 6px;
}
.stock-article-designation {
  font-weight: 600;
  color: #0f172a;
}
.stock-article-total {
  font-size: 15px;
  color: #1e40af;
}
.stock-article-hint {
  margin: 0;
  min-height: 1em;
}
.stock-article-locations-heading {
  margin: 12px 0 4px;
}
#stock-explorer-dialog {
  width: min(1100px, 96vw);
  min-height: min(880px, 88vh);
  padding: 16px;
  border: 0;
  border-radius: 12px;
  box-sizing: border-box;
}
#stock-explorer-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.stock-explorer-dialog-inner {
  min-height: min(780px, 80vh);
  max-height: 82vh;
  overflow: auto;
  gap: 12px;
  box-sizing: border-box;
  /* Ohne das verteilt Grid bei großem min-height den Platz zwischen den Zeilen — Inhalt rutscht nach unten. */
  align-content: start;
  justify-items: stretch;
}
#overview-locations {
  align-self: start;
  width: 100%;
}
.stock-history-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.stock-history-view.hidden {
  display: none !important;
}
#stock-main-view.hidden {
  display: none !important;
}
.stock-history-table-wrap {
  flex: 1 1 auto;
  max-height: calc(100dvh - 280px);
  min-height: 320px;
}
#module-stock:has(#stock-history-view:not(.hidden)) {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 120px);
}
#stock-article-locations-dialog {
  width: min(760px, 96vw);
  padding: 16px;
  border: 0;
  border-radius: 12px;
}
#stock-article-locations-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
#location-edit-dialog {
  width: min(520px, 96vw);
  padding: 16px;
  border: 0;
  border-radius: 12px;
  box-sizing: border-box;
}
#location-edit-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}
.location-edit-dialog-inner {
  max-height: 86vh;
  overflow: auto;
  gap: 12px;
}
.locations-drill-toolbar {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.locations-drill-breadcrumb {
  flex: 1 1 200px;
  min-width: 0;
}
.locations-drill-location-meta {
  margin: 4px 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  line-height: 1.45;
}
.locations-drill-location-meta.hidden {
  display: none;
}
.locations-drill-meta-code {
  font-family: ui-monospace, monospace;
  font-weight: 600;
  color: #0f172a;
}
.locations-drill-meta-disp {
  margin-top: 4px;
  color: #1e3a5f;
  font-weight: 500;
}
.locations-drill-meta-note {
  margin-top: 6px;
  color: #334155;
  white-space: pre-wrap;
}
.stock-article-locations-dialog-inner {
  max-height: 78vh;
  overflow: auto;
  gap: 12px;
}
#stock-lgt-search-dialog {
  width: min(440px, 96vw);
  padding: 16px;
  border: 0;
  border-radius: 12px;
}
#stock-lgt-search-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.stock-lgt-search-dialog-inner {
  gap: 12px;
}
.stock-lgt-search-field input {
  width: 100%;
}
.stock-explorer-search-toolbar {
  margin-bottom: 8px;
}
.stock-footer-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}
.stock-footer-toolbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.stock-history-icon-btn {
  padding: 8px 10px;
}

.company-logo-preview-box img {
  display: block;
  max-height: 72px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
}
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-scope-wrap {
  position: relative;
  flex-shrink: 0;
}
.topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(240px, 36vw);
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.topbar-pill:hover:not(:disabled) {
  border-color: var(--color-border-strong);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.topbar-pill:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.topbar-pill[aria-expanded="true"] {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}
.topbar-pill[aria-expanded="true"] .topbar-pill-ico {
  color: var(--color-primary);
}
.topbar-pill[aria-expanded="true"] .topbar-pill-chevron {
  color: var(--color-primary);
  transform: rotate(180deg);
}
.topbar-pill-ico {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--color-primary);
}
.topbar-pill-svg {
  width: 18px;
  height: 18px;
  display: block;
}
.topbar-pill-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  color: var(--color-text);
}
.topbar-pill-label--muted {
  color: var(--color-muted);
  font-weight: 500;
}
.topbar-pill--branch .topbar-pill-label:not(.topbar-pill-label--muted) {
  color: var(--color-primary);
}
.topbar-pill[aria-expanded="true"] .topbar-pill-label {
  color: inherit;
}
.topbar-pill-chevron {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--color-muted);
  transition: transform 0.18s ease;
}
.topbar-pill-chevron-svg {
  width: 14px;
  height: 14px;
  display: block;
}
.topbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  min-width: min(100vw - 32px, 280px);
  max-width: min(100vw - 24px, 320px);
  padding: 6px;
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}
.topbar-dropdown::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 22px;
  width: 9px;
  height: 9px;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
  transform: rotate(45deg);
}
.topbar-dropdown-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 2px 8px;
  padding: 0 10px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}
.topbar-dropdown-search-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-muted);
}
.topbar-dropdown-search-ico circle,
.topbar-dropdown-search-ico path {
  stroke: currentColor;
  fill: none;
}
.topbar-dropdown-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--color-text);
  outline: none;
}
.topbar-dropdown-search-input::placeholder {
  color: var(--color-muted);
}
.topbar-dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(60vh, 320px);
  overflow-y: auto;
}
.topbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.12s ease;
}
.topbar-dropdown-item:hover {
  background: var(--color-primary-soft);
}
.topbar-dropdown-item-ico {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--color-muted);
}
.topbar-dropdown-item--selected .topbar-dropdown-item-ico {
  color: var(--color-primary);
}
.topbar-dropdown-ico-svg {
  width: 18px;
  height: 18px;
  display: block;
}
.topbar-dropdown-item-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-dropdown-item-check {
  flex-shrink: 0;
  width: 1.1rem;
  text-align: center;
  font-size: 14px;
  color: var(--color-primary);
  opacity: 0;
}
.topbar-dropdown-item--selected {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.topbar-dropdown-item--selected .topbar-dropdown-item-check {
  opacity: 1;
}
.topbar-dropdown-item.hidden {
  display: none;
}
.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;
}

/* ——— App-Shell: Sidebar + Arbeitsbereich ——— */
#main-view:not(.hidden) {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main-layout {
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  min-height: 0;
  width: 100%;
}
.sidebar-dock {
  display: flex;
  flex-direction: row;
  flex: 0 0 auto;
  align-items: stretch;
  /* Lange Module (z. B. Tourenplanung, Etiketten) würden die Zeile sonst sehr hoch ziehen;
     die Leiste würde mitstrecken → Footer/Theme weit unterhalb des Viewports. */
  align-self: flex-start;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  z-index: 30;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  width: 72px;
}
.sidebar-dock.is-open {
  width: 232px;
}
.sidebar-expand-hit {
  width: 0;
  min-width: 0;
  flex-shrink: 0;
  overflow: hidden;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  pointer-events: none;
  cursor: default;
}
.app-sidebar {
  width: 72px;
  flex-shrink: 0;
  min-height: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.sidebar-dock.is-open .app-sidebar {
  width: 232px;
}
.app-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px 16px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.app-sidebar-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-theme-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.sidebar-theme-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sidebar-theme-btn:hover {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
.sidebar-theme-btn.is-active {
  background: var(--color-primary-soft);
  border-color: #bfdbfe;
  color: var(--color-primary);
}
html[data-theme="dark"] .sidebar-theme-btn.is-active {
  border-color: rgba(96, 165, 250, 0.35);
}
.sidebar-theme-btn svg {
  flex-shrink: 0;
}
.sidebar-dock:not(.is-open) .sidebar-theme-label {
  display: none;
}
.sidebar-dock:not(.is-open) .sidebar-theme-btn {
  justify-content: center;
  padding: 8px;
}
.app-sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  min-height: 44px;
}
.sidebar-dock:not(.is-open) .app-sidebar-top {
  justify-content: center;
}
.sidebar-dock:not(.is-open) #home-logo {
  display: none !important;
}
/* Eingeklappt: nur Icon — Label aus dem Flex nehmen und zentrieren (wie Pin & Theme) */
.sidebar-dock:not(.is-open) .module-btn--nav {
  justify-content: center;
  gap: 0;
}
.sidebar-dock:not(.is-open) .module-btn--nav .module-btn-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  flex: 0 0 0;
  min-width: 0;
  max-width: 0;
  opacity: 0;
  pointer-events: none;
}
.sidebar-logo-btn {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}
.sidebar-dock.is-open .sidebar-logo-btn {
  justify-content: flex-start;
}
.sidebar-pin-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sidebar-pin-btn:hover {
  color: var(--color-primary);
  border-color: #bfdbfe;
  background: var(--color-primary-soft);
}
.sidebar-pin-svg {
  width: 20px;
  height: 20px;
}
.sidebar-pin-svg--closed {
  display: none;
}
.app-sidebar.is-pinned .sidebar-pin-svg--open {
  display: none;
}
.app-sidebar.is-pinned .sidebar-pin-svg--closed {
  display: block;
}

.menu.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}
.module-btn--nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.module-btn--nav::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}
.module-btn--nav:hover {
  background: var(--color-surface-soft);
  border-color: #e2e8f0;
}
.module-btn--nav.active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: #dbeafe;
}
.module-btn--nav.active::before {
  background: var(--color-primary);
}
.module-btn-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #f1f5f9;
  color: #64748b;
  position: relative;
  z-index: 1;
}
.module-btn--nav.active .module-btn-icon {
  background: #dbeafe;
  color: var(--color-primary);
}
.module-btn-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}
/* Sidebar-Icons: leichte Farbakzente (Hellmodus pastell, Dunkelmodus unten getönt) */
.module-btn-icon--sky {
  background: #eff6ff;
  color: #1d4ed8;
}
.module-btn-icon--rose {
  background: #fce7f3;
  color: #be185d;
}
.module-btn-icon--green {
  background: #ecfdf5;
  color: #047857;
}
.module-btn-icon--amber {
  background: #fffbeb;
  color: #b45309;
}
.module-btn-icon--violet {
  background: #f5f3ff;
  color: #6d28d9;
}
.module-btn-icon--cyan {
  background: #ecfeff;
  color: #0e7490;
}
.module-btn-icon--indigo {
  background: #e0e7ff;
  color: #4338ca;
}
.module-btn-icon--teal {
  background: #f0fdfa;
  color: #0f766e;
}
.module-btn-icon--orange {
  background: #ffedd5;
  color: #c2410c;
}
.module-btn-icon--admin {
  background: #fef2f2;
  color: #b91c1c;
}
.module-btn-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  max-width: 0;
  transition: opacity 0.18s ease, max-width 0.28s ease;
}
.sidebar-dock.is-open .module-btn-label {
  opacity: 1;
  max-width: 200px;
}
.module-btn:not(.module-btn--nav) {
  background: #e2e8f0;
  color: #111827;
  border: 1px solid #cbd5e1;
}
.module-btn:not(.module-btn--nav).active {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}
.module-btn:not(.module-btn--nav)[data-module="administration"] {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.module-btn:not(.module-btn--nav)[data-module="administration"].active {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.main-workspace {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  padding: 0 20px 28px;
}
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  margin: 0 -20px 16px;
  padding: 12px 20px;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 280px;
  min-width: 0;
}
.app-topbar .topbar-left {
  flex: 0 1 min(720px, 100%);
  max-width: min(720px, 100%);
}
.topbar-fill {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
}
.topbar-square-btn {
  border-radius: 12px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.topbar-square-btn svg {
  fill: none;
  stroke: currentColor;
}
.topbar-left .topbar-search {
  flex: 1 1 320px;
  min-width: 0;
}
.app-topbar .topbar-left .topbar-search {
  width: 100%;
  max-width: 100%;
}
.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 14px;
  height: 42px;
  border-radius: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.topbar-search-ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-muted);
}
.topbar-search-ico circle,
.topbar-search-ico path {
  stroke: currentColor;
  fill: none;
}
.topbar-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--color-text);
  outline: none;
}
.topbar-search-input::placeholder {
  color: #94a3b8;
}
.topbar-user-wrap {
  position: relative;
  flex-shrink: 0;
}
.topbar-user-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  min-width: 11rem;
  padding: 6px;
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}
.topbar-user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}
.topbar-user-menu-item:hover {
  background: var(--color-surface-soft);
}
.topbar-user-menu-item--logout {
  color: #b91c1c;
}
.topbar-user-menu-item--logout:hover {
  background: #fef2f2;
}

.dashboard-page {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  background: var(--color-surface);
}
.dashboard-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.dashboard-welcome-hint {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-muted);
  max-width: 56rem;
}
.dashboard-welcome-hint kbd {
  font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-text);
}
.dashboard-page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
}
.dashboard-scope-select {
  min-width: 160px;
}
.dashboard-recent-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.dashboard-recent-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  flex: 1 1 auto;
  min-width: 0;
}
.dashboard-recent-scroll::-webkit-scrollbar {
  height: 6px;
}
.dashboard-recent-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
.dashboard-recent-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 76px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  border-radius: 14px;
  color: var(--color-text);
  transition: background 0.15s ease;
}
.dashboard-recent-chip:hover {
  background: var(--color-surface-soft);
}
.dashboard-recent-ico {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}
.dashboard-recent-ico svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dashboard-recent-ico svg circle {
  fill: none;
}
.dashboard-recent-txt {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  text-align: center;
  line-height: 1.2;
  max-width: 76px;
}
.dashboard-recent-next {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--color-primary);
}
.dashboard-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 720px) {
  .dashboard-kpi-row {
    grid-template-columns: 1fr;
  }
}
.dashboard-kpi-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.dashboard-kpi-card--accent {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #1e40af;
  color: #fff;
}
.dashboard-kpi-card--accent .dashboard-kpi-label {
  color: rgba(255, 255, 255, 0.85);
}
.dashboard-kpi-card--accent .dashboard-kpi-value {
  color: #fff;
}
.dashboard-kpi-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 6px;
}
.dashboard-kpi-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--color-text);
}
.dashboard-kpi-ico {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
}
.dashboard-kpi-ico--warn {
  background: #fef2f2;
  color: #dc2626;
}
.dashboard-kpi-ico--pending {
  background: #fffbeb;
  color: #d97706;
}
.dashboard-kpi-ico--ok {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.dashboard-tiles-heading {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-surface-soft: #273549;
  --color-border: #475569;
  --color-border-strong: #64748b;
  --color-text: #f8fafc;
  --color-muted: #b6c4d3;
  --color-primary: #60a5fa;
  --color-primary-dark: #3b82f6;
  --color-primary-soft: rgba(96, 165, 250, 0.18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 22px 55px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] body {
  background: var(--color-bg);
  color: var(--color-text);
}
html[data-theme="dark"] .module-btn-icon {
  background: #334155;
  color: #cbd5e1;
}
html[data-theme="dark"] .module-btn-icon--sky {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}
html[data-theme="dark"] .module-btn-icon--rose {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
}
html[data-theme="dark"] .module-btn-icon--green {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}
html[data-theme="dark"] .module-btn-icon--amber {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
}
html[data-theme="dark"] .module-btn-icon--violet {
  background: rgba(139, 92, 246, 0.22);
  color: #c4b5fd;
}
html[data-theme="dark"] .module-btn-icon--cyan {
  background: rgba(6, 182, 212, 0.2);
  color: #67e8f9;
}
html[data-theme="dark"] .module-btn-icon--indigo {
  background: rgba(99, 102, 241, 0.24);
  color: #a5b4fc;
}
html[data-theme="dark"] .module-btn-icon--teal {
  background: rgba(20, 184, 166, 0.2);
  color: #5eead4;
}
html[data-theme="dark"] .module-btn-icon--orange {
  background: rgba(249, 115, 22, 0.22);
  color: #fdba74;
}
html[data-theme="dark"] .module-btn-icon--admin {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
}
html[data-theme="dark"] .dashboard-page,
html[data-theme="dark"] .card {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
  box-shadow: var(--shadow-md);
}

/* ——— Dark: App-Chrome (Sidebar + Topbar) und Arbeitsbereich ——— */
html[data-theme="dark"] .app-sidebar {
  background: #0b1120;
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 4px 0 28px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .app-topbar {
  background: #0b1120;
  border-bottom-color: rgba(148, 163, 184, 0.28);
}
html[data-theme="dark"] .main-workspace {
  background: var(--color-bg);
}
html[data-theme="dark"] .topbar-search {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
html[data-theme="dark"] .topbar-search-ico {
  color: var(--color-muted);
}
html[data-theme="dark"] .topbar-search-input {
  color: var(--color-text);
}
html[data-theme="dark"] .topbar-search-input::placeholder {
  color: #64748b;
}
html[data-theme="dark"] .app-topbar .topbar-pill {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(148, 163, 184, 0.32);
  color: #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
html[data-theme="dark"] .app-topbar .topbar-pill:hover:not(:disabled) {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(51, 65, 85, 0.55);
}
html[data-theme="dark"] .app-topbar .topbar-pill .topbar-pill-label {
  color: #e2e8f0;
}
html[data-theme="dark"] .app-topbar .topbar-pill .topbar-pill-label--muted {
  color: #94a3b8;
}
html[data-theme="dark"] .app-topbar .topbar-pill--branch .topbar-pill-label:not(.topbar-pill-label--muted) {
  color: var(--color-primary);
}
html[data-theme="dark"] .app-topbar .topbar-pill[aria-expanded="true"] {
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35);
}
html[data-theme="dark"] .app-topbar .topbar-dropdown-item {
  background: transparent;
  color: var(--color-text);
}
html[data-theme="dark"] .app-topbar .topbar-dropdown {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-md);
}
html[data-theme="dark"] .app-topbar .topbar-dropdown::before {
  background: var(--color-surface);
  border-color: var(--color-border);
}
html[data-theme="dark"] .app-topbar .topbar-dropdown-search {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.28);
}
html[data-theme="dark"] .app-topbar .topbar-dropdown-item:hover {
  background: rgba(96, 165, 250, 0.14);
}
html[data-theme="dark"] .app-topbar .topbar-dropdown-item--selected {
  background: rgba(96, 165, 250, 0.22);
  color: var(--color-text);
}
html[data-theme="dark"] .app-topbar .topbar-dropdown-item--selected .topbar-dropdown-item-text {
  color: var(--color-primary);
}
html[data-theme="dark"] .topbar-user-menu {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-md);
}
html[data-theme="dark"] .topbar-user-menu-item:hover {
  background: var(--color-surface-soft);
}
html[data-theme="dark"] .topbar-user-menu-item--logout:hover {
  background: rgba(127, 29, 29, 0.25);
}
html[data-theme="dark"] .app-topbar .ghost {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.32);
  color: #e2e8f0;
}
html[data-theme="dark"] .app-topbar .ghost:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(148, 163, 184, 0.4);
  color: #fff;
}
html[data-theme="dark"] .sidebar-pin-btn {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(148, 163, 184, 0.32);
  color: #94a3b8;
}
html[data-theme="dark"] .sidebar-theme-bar {
  border-top-color: rgba(148, 163, 184, 0.28);
}

/* ——— Dark: allgemeine Modul-Inhalte ——— */
html[data-theme="dark"] .card-soft {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .module-head h2,
html[data-theme="dark"] .module-head h3 {
  color: var(--color-text);
}
html[data-theme="dark"] .main-workspace .hint {
  color: var(--color-muted);
}
html[data-theme="dark"] .main-workspace table {
  color: var(--color-text);
}
html[data-theme="dark"] .main-workspace thead {
  background: var(--color-surface-soft);
}
html[data-theme="dark"] .main-workspace th,
html[data-theme="dark"] .main-workspace td {
  border-color: var(--color-border);
}
html[data-theme="dark"] .main-workspace input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.topbar-search-input),
html[data-theme="dark"] .main-workspace select,
html[data-theme="dark"] .main-workspace textarea {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .main-workspace input:not(.topbar-search-input)::placeholder,
html[data-theme="dark"] .main-workspace textarea::placeholder {
  color: #64748b;
}
html[data-theme="dark"] .dashboard-kpi-card {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
}
html[data-theme="dark"] .dashboard-kpi-label {
  color: var(--color-muted);
}
html[data-theme="dark"] .dashboard-kpi-value {
  color: var(--color-text);
}
html[data-theme="dark"] .dashboard-kpi-ico--warn {
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
}
html[data-theme="dark"] .dashboard-kpi-ico--pending {
  background: rgba(120, 53, 15, 0.35);
  color: #fde68a;
}

/* ——— Dark: Tourenplanung / Leitstand-Panels ——— */
html[data-theme="dark"] .tp-sticky-head {
  background: linear-gradient(180deg, var(--color-surface) 82%, rgba(30, 41, 59, 0.92) 100%);
}
html[data-theme="dark"] .tp-toolbar-grid {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
}
html[data-theme="dark"] .tp-date-label,
html[data-theme="dark"] .tp-search-label,
html[data-theme="dark"] .tp-filter-label {
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-date-input-toolbar {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .tp-search-label input,
html[data-theme="dark"] .tp-view-range-label .tp-view-hour-select {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .tp-view-range-label {
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-view-range-dash {
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-pane {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-md);
}
html[data-theme="dark"] .tp-section-title {
  color: var(--color-text);
}
html[data-theme="dark"] .tp-pill {
  background: var(--color-surface-soft);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
html[data-theme="dark"] .tp-orders-count-badge {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(96, 165, 250, 0.35);
}
html[data-theme="dark"] .tp-orders-count-badge[data-count="0"] {
  color: var(--color-muted);
  background: var(--color-surface-soft);
  border-color: var(--color-border);
}
html[data-theme="dark"] .tp-orders-panel-head-actions {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
}
html[data-theme="dark"] .tp-orders-head-btn {
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-orders-head-btn:hover:not(:disabled) {
  background: var(--color-surface);
  color: var(--color-primary);
}
html[data-theme="dark"] .tp-order-card {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .tp-order-card:hover {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .tp-order-card.tp-order-selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}
html[data-theme="dark"] .tp-order-number {
  color: var(--color-text);
}
html[data-theme="dark"] .tp-order-meta {
  color: var(--color-muted);
}
html[data-theme="dark"] .ao-dispatch-bubble--ungeplant {
  background: rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
}
html[data-theme="dark"] .ao-dispatch-bubble--verplant {
  background: rgba(14, 165, 233, 0.2);
  color: #7dd3fc;
}
html[data-theme="dark"] .ao-dispatch-bubble--offen {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}
html[data-theme="dark"] .ao-dispatch-bubble--in_arbeit {
  background: rgba(139, 92, 246, 0.22);
  color: #ddd6fe;
}
html[data-theme="dark"] .ao-dispatch-bubble--bereitgestellt {
  background: rgba(6, 182, 212, 0.2);
  color: #67e8f9;
}
html[data-theme="dark"] .ao-dispatch-bubble--verladen {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}
html[data-theme="dark"] .ao-dispatch-bubble--abgeschlossen {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}
html[data-theme="dark"] .ao-dispatch-bubble--unknown {
  background: rgba(148, 163, 184, 0.18);
  color: #94a3b8;
}
html[data-theme="dark"] .ao-dispatch-tournr {
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-unplan-dropzone {
  background: var(--color-surface-soft);
  border-color: rgba(148, 163, 184, 0.35);
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-unplan-dropzone.tp-drop-target {
  background: rgba(127, 29, 29, 0.25);
  border-color: #f87171;
  color: #fecaca;
}
html[data-theme="dark"] .tp-undated-details {
  border-top-color: var(--color-border);
}
html[data-theme="dark"] .tp-undated-details summary {
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-undated-count {
  background: var(--color-surface-soft);
  color: var(--color-text);
}
html[data-theme="dark"] .tp-toolbar-toggle {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .tp-toolbar-toggle:hover {
  background: var(--color-surface);
  border-color: rgba(96, 165, 250, 0.45);
  color: #f8fafc;
}
html[data-theme="dark"] .tp-toolbar-toggle-chevron {
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-orders-panel-head {
  border-bottom-color: var(--color-border);
}
html[data-theme="dark"] .tp-orders-panel-title {
  color: var(--color-text);
}
html[data-theme="dark"] .tp-order-line {
  color: var(--color-text);
}
html[data-theme="dark"] .tp-order-col {
  color: #e2e8f0;
  border-left-color: rgba(148, 163, 184, 0.28);
}
html[data-theme="dark"] .tp-order-col--street {
  border-left-color: rgba(148, 163, 184, 0.28);
}
html[data-theme="dark"] .tp-orders-list-head {
  color: var(--color-muted);
  border-bottom-color: var(--color-border);
}
html[data-theme="dark"] .tp-order-date-divider {
  background: rgba(30, 41, 59, 0.75);
  border-bottom-color: var(--color-border);
  color: #cbd5e1;
}
html[data-theme="dark"] .tp-order-date-divider:hover {
  background: rgba(51, 65, 85, 0.9);
}
html[data-theme="dark"] .tp-order-date-chevron,
html[data-theme="dark"] .tp-order-date-count {
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-pane-left--drop-target {
  background: rgba(96, 165, 250, 0.1);
  outline-color: var(--color-primary);
}
html[data-theme="dark"] .tp-order-card.tp-order-selected {
  background: rgba(37, 99, 235, 0.22);
}
html[data-theme="dark"] .tp-view-range-display {
  color: var(--color-text);
}
html[data-theme="dark"] #tp-expand-view-btn[aria-pressed="true"] {
  background: rgba(37, 99, 235, 0.25);
  border-color: var(--color-primary);
  color: #93c5fd;
}
html[data-theme="dark"] .tp-inline-check {
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-order-filter-dialog-foot {
  border-top-color: var(--color-border);
}
html[data-theme="dark"] .tp-order-filter-terms-list {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
}
html[data-theme="dark"] .tp-order-filter-terms-item,
html[data-theme="dark"] .tp-order-filter-terms-empty {
  border-bottom-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .tp-address-merge-group {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
}
html[data-theme="dark"] .tp-address-merge-row {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .tp-address-merge-row:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(96, 165, 250, 0.4);
}
html[data-theme="dark"] .tp-address-merge-ls {
  color: var(--color-text);
}
html[data-theme="dark"] .tp-ls-tour-reorder-wrap {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
}
html[data-theme="dark"] .tp-ls-tour-reorder-hint,
html[data-theme="dark"] .tp-ls-dialog-meta,
html[data-theme="dark"] .tp-ls-pick-hint {
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-ls-tour-reorder-grip {
  color: #64748b;
}
html[data-theme="dark"] .tp-ls-tour-reorder-item {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .tp-ls-tour-reorder-item.tp-ls-tour-reorder-item--current {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--color-primary);
}
html[data-theme="dark"] .tp-edit-tour-stops-list {
  border-color: #334155;
  background: #0f172a;
}
html[data-theme="dark"] .tp-edit-tour-stop-item {
  border-color: #334155;
  background: #1e293b;
}
html[data-theme="dark"] .tp-edit-tour-stop-item.tp-edit-tour-stop-item--drag-over {
  border-color: #3b82f6;
  background: #172554;
}
html[data-theme="dark"] .tp-ls-tour-reorder-item.tp-ls-tour-reorder-item--drag-over {
  background: rgba(96, 165, 250, 0.15);
}
html[data-theme="dark"] .tp-ls-date-change-btn {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .tp-ls-date-change-btn:hover:not(:disabled) {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(96, 165, 250, 0.45);
}
html[data-theme="dark"] .tp-ls-date-picker-popover {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .tp-tl-grid.tp-tl-header {
  background: var(--color-surface);
  color: var(--color-muted);
  border-bottom-color: var(--color-border);
}
html[data-theme="dark"] .tp-tl-sticky-chrome {
  background: var(--color-surface);
  box-shadow: 0 1px 0 var(--color-border);
}
html[data-theme="dark"] .tp-tl-pan-row {
  border-bottom-color: var(--color-border);
}
html[data-theme="dark"] .tp-time-rail-track {
  background: var(--color-surface-soft);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
}
html[data-theme="dark"] .tp-time-rail-thumb--locked {
  background: #475569;
}
html[data-theme="dark"] .tp-tl-hour-top {
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-tl-hour-half {
  color: #64748b;
}
html[data-theme="dark"] .tp-tl-vehicle-cell {
  border-right-color: var(--color-border);
}
html[data-theme="dark"] .tp-tl-vehicle-plate {
  color: var(--color-text);
}
html[data-theme="dark"] .tp-tl-vehicle-type {
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-tl-track-inner {
  background-color: var(--color-surface-soft);
  border-color: var(--color-border);
}
html[data-theme="dark"] .tp-tl-header-time-inner {
  border-color: transparent;
}
html[data-theme="dark"] .tp-composer-order-zone {
  background: var(--color-surface-soft);
  border-color: rgba(148, 163, 184, 0.35);
}
html[data-theme="dark"] .tp-composer-order-zone.tp-drop-target {
  background: rgba(30, 58, 138, 0.35);
  border-color: var(--color-primary);
}
html[data-theme="dark"] .tp-composer-chip {
  background: rgba(49, 46, 129, 0.45);
  border-color: rgba(129, 140, 248, 0.5);
  color: #e0e7ff;
}
html[data-theme="dark"] .tp-composer-remove-zone {
  background: rgba(127, 29, 29, 0.25);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}
html[data-theme="dark"] .tp-tl-bar {
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .tp-tl-bar-head,
html[data-theme="dark"] .tp-tl-tour-group-head {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(15, 23, 42, 0.12);
}
html[data-theme="dark"] .tp-tl-tour-group--planned {
  background: rgba(30, 58, 138, 0.35);
}
html[data-theme="dark"] .tp-tl-tour-group--reported {
  background: rgba(20, 83, 45, 0.35);
}
html[data-theme="dark"] .tp-tl-stop-chip {
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.12);
}
html[data-theme="dark"] .tp-detail-meta {
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-live-card {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .tp-live-label {
  color: var(--color-muted);
}
html[data-theme="dark"] .tp-map-card {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
}
html[data-theme="dark"] .tp-map-preview {
  border-color: var(--color-border);
  background: #0f172a;
}
html[data-theme="dark"] .tp-table-wrap {
  border-color: var(--color-border);
  background: var(--color-surface-soft);
}
html[data-theme="dark"] .tp-vehicle-add-form {
  border-bottom-color: var(--color-border);
}
html[data-theme="dark"] .tp-order-selected {
  background: rgba(37, 99, 235, 0.18);
  outline-color: var(--color-primary);
}
html[data-theme="dark"] .leaflet-container {
  background: #0f172a !important;
}
html[data-theme="dark"] .sidebar-logo-btn {
  color: #93c5fd;
}
html[data-theme="dark"] .sidebar-logo-btn .logo-mark {
  color: #38bdf8;
}
html[data-theme="dark"] .module-btn--nav {
  color: #e2e8f0;
}
html[data-theme="dark"] .module-btn--nav:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.18);
}
html[data-theme="dark"] .module-btn--nav.active {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(96, 165, 250, 0.35);
  color: #dbeafe;
}
html[data-theme="dark"] .module-btn--nav.active .module-btn-icon {
  background: rgba(30, 58, 138, 0.55);
  color: #93c5fd;
}
html[data-theme="dark"] .main-workspace .ghost {
  background: var(--color-surface-soft);
  border-color: rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
}
html[data-theme="dark"] .main-workspace .ghost:hover {
  background: #334155;
  border-color: rgba(148, 163, 184, 0.5);
  color: #fff;
}
html[data-theme="dark"] .main-workspace .primary {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}
html[data-theme="dark"] .main-workspace .primary:hover {
  background: #2563eb;
  border-color: #2563eb;
}
html[data-theme="dark"] .tp-priority-chip--normal {
  background: var(--color-surface-soft);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
}
html[data-theme="dark"] .tp-priority-chip--high {
  background: rgba(127, 29, 29, 0.4);
  color: #fecaca;
}
html[data-theme="dark"] .tp-priority-chip--low {
  background: rgba(20, 83, 45, 0.4);
  color: #bbf7d0;
}
html[data-theme="dark"] dialog {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
html[data-theme="dark"] #stock-explorer-dialog,
html[data-theme="dark"] #stock-article-locations-dialog,
html[data-theme="dark"] #location-edit-dialog,
html[data-theme="dark"] #stock-lgt-search-dialog {
  background: var(--color-surface);
  color: var(--color-text);
}
html[data-theme="dark"] .locations-drill-location-meta {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
}
html[data-theme="dark"] .locations-drill-meta-code {
  color: var(--color-text);
}
html[data-theme="dark"] .locations-drill-meta-disp {
  color: var(--color-muted);
}
html[data-theme="dark"] .locations-drill-meta-note {
  color: var(--color-muted);
}
html[data-theme="dark"] .stock-footer-toolbar {
  border-top-color: var(--color-border);
}
html[data-theme="dark"] .main-workspace table {
  background: var(--color-surface);
}
html[data-theme="dark"] .main-workspace #we-receipts-body tr.we-gr-row:hover {
  background: rgba(148, 163, 184, 0.14);
}

.inventur-lead-wizard-body {
  min-height: 4.5rem;
  font-size: 14px;
  line-height: 1.55;
}
.inventur-lead-wizard-body .inv-lead-scan {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.12rem;
  font-weight: 700;
  margin: 10px 0;
  word-break: break-all;
  color: #1d4ed8;
}
html[data-theme="dark"] .inventur-lead-wizard-body .inv-lead-scan {
  color: #93c5fd;
}
.inv-lead-barcode-host {
  margin-top: 14px;
  padding: 12px 12px 10px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  /* Fest hell: Strichcode wie auf gedrucktem Label (funktioniert in Hell- und Dunkelmodus mit Scannern). */
  background: #ffffff;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}
.inv-lead-barcode-caption {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}
.install-panel {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 320px);
  gap: 20px;
  align-items: start;
  margin-top: 12px;
}
@media (max-width: 900px) {
  .install-panel {
    grid-template-columns: 1fr;
  }
}
.install-codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .install-codes {
    grid-template-columns: 1fr;
  }
}
.install-code-card {
  padding: 16px;
  text-align: center;
}
.install-code-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.install-qr-host {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 220px;
  margin-top: 8px;
}
.install-qr-host img {
  display: block;
}
.install-barcode-host {
  margin-top: 8px;
  padding: 8px 4px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}
.install-barcode-caption {
  font-size: 0.8rem;
  color: var(--color-muted, #64748b);
  margin-bottom: 6px;
}
.install-barcode-svg {
  width: 100%;
  max-width: 100%;
  height: auto;
}
.install-meta {
  padding: 16px;
  font-size: 0.95rem;
}
.install-meta p {
  margin: 0 0 10px;
}
.install-server-url code {
  display: block;
  word-break: break-all;
  padding: 8px;
  background: var(--color-bg-soft, #f1f5f9);
  border-radius: 6px;
  margin-top: 4px;
}
.install-steps {
  margin-top: 20px;
  padding: 16px 20px;
}
.install-steps-list {
  margin: 12px 0 0;
  padding-left: 1.25rem;
  line-height: 1.55;
}
.install-steps-list li {
  margin-bottom: 8px;
}
.install-release-missing {
  margin-top: 12px;
  padding: 12px 14px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  color: #92400e;
}

.inv-lead-barcode-svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

/* ——— Dark: Inventur (feste Hell-Flächen in Basisspezifität) ——— */
html[data-theme="dark"] .main-workspace .inventur-tabs .inventur-tab-btn:not(.active) {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-muted);
}
html[data-theme="dark"] .main-workspace .inventur-tabs .inventur-tab-btn.active {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}
html[data-theme="dark"] .main-workspace .inventur-create-task-bar {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
}
html[data-theme="dark"] .main-workspace .inventur-pick-table-scroll {
  background: var(--color-surface);
  border-color: var(--color-border);
}
html[data-theme="dark"] .main-workspace .inventur-pick-table-scroll thead th {
  background: var(--color-surface-soft);
  box-shadow: 0 1px 0 var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .main-workspace .inventur-dialog-filter-row {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
}
html[data-theme="dark"] .main-workspace .inventur-loc-card {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .main-workspace .inventur-loc-card h4 {
  color: var(--color-text);
}
html[data-theme="dark"] .main-workspace .inventur-rec-loc-name {
  color: var(--color-muted);
}
html[data-theme="dark"] .main-workspace .inventur-rec-loc-code--closed:hover {
  background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .main-workspace .inventur-wizard-idle {
  color: var(--color-muted);
}
html[data-theme="dark"] .main-workspace .inv-rec-ersl {
  color: var(--color-muted);
}
html[data-theme="dark"] .main-workspace .inventur-auto-summary-dialog {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .main-workspace .inventur-auto-summary-task:hover {
  background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .main-workspace .inventur-stats-pie-caption {
  color: var(--color-text);
}
html[data-theme="dark"] .main-workspace .inventur-stats-pie-wrap {
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
}
html[data-theme="dark"] .main-workspace .inventur-stat-label {
  color: var(--color-muted);
}
html[data-theme="dark"] .main-workspace .inventur-stat-value {
  color: var(--color-text);
}
html[data-theme="dark"] .main-workspace .inventur-stats-legend {
  color: var(--color-text);
}
html[data-theme="dark"] .main-workspace .inventur-stats-dot--open {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
}
html[data-theme="dark"] .main-workspace .data-table.selectable-table tbody tr.row-selected {
  background: rgba(37, 99, 235, 0.22);
}
html[data-theme="dark"] .main-workspace .data-table.selectable-table tbody tr.row-range-active {
  background: rgba(37, 99, 235, 0.32);
}
html[data-theme="dark"] #inventur-task-detail-dialog,
html[data-theme="dark"] #inventur-add-locations-dialog {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
html[data-theme="dark"] #inventur-task-detail-dialog table,
html[data-theme="dark"] #inventur-add-locations-dialog table {
  background: var(--color-surface);
}
html[data-theme="dark"] #inventur-task-detail-dialog thead th,
html[data-theme="dark"] #inventur-add-locations-dialog thead th {
  background: var(--color-surface-soft);
  color: var(--color-text);
}

html[data-theme="dark"] .main-workspace .list-item {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .main-workspace .form-section {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .main-workspace .toolbar-menu-body {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .main-workspace .toolbar-menu summary {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .main-workspace .designer-ribbon {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
}
html[data-theme="dark"] .main-workspace .designer-ribbon-tabs button {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-muted);
}
html[data-theme="dark"] .main-workspace .designer-ribbon-tabs button.active {
  background: var(--color-surface);
  border-bottom-color: var(--color-surface);
  color: var(--color-primary);
}
html[data-theme="dark"] .dashboard-shell {
  border-color: var(--color-border);
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.12), transparent 32%),
    var(--color-surface);
}
html[data-theme="dark"] .main-workspace .admin-btn:not(.active) {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] .main-workspace .labels-subtab-btn:not(.active) {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-muted);
}
html[data-theme="dark"] .dashboard-kpi-card--accent {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
  border-color: #2563eb;
}

.dashboard-shell {
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid rgba(226, 232, 240, 0.74);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 34%),
    var(--color-surface);
}
.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dashboard-hero h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  color: var(--color-text);
}
.dashboard-subtitle {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--color-muted);
  font-size: 15px;
  line-height: 1.6;
}
.dashboard-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.kpi-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(226, 232, 240, 0.86);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.86);
  box-shadow: var(--shadow-sm);
}
.kpi-label,
.kpi-trend {
  display: block;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.35;
}
.kpi-card strong {
  display: block;
  margin: 8px 0 3px;
  color: var(--color-text);
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.04em;
}
.kpi-card--warning strong { color: #b45309; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 4px; }
.dashboard-tile {
  min-height: 112px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 0;
  border-radius: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 14px;
  padding: 18px;
  justify-items: start;
  align-items: start;
  text-align: left;
  color: var(--color-text);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08), inset 0 0 0 1px rgba(226, 232, 240, 0.82);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}
.dashboard-tile:hover {
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(191, 219, 254, 0.95);
}
.dashboard-tile:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 3px;
}
.dashboard-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}
.dashboard-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dashboard-icon--green { background: #ecfdf5; color: #059669; }
.dashboard-icon--amber { background: #fffbeb; color: #d97706; }
.dashboard-icon--violet { background: #f5f3ff; color: #7c3aed; }
.dashboard-icon--cyan { background: #ecfeff; color: #0891b2; }
.dashboard-icon--teal { background: #f0fdfa; color: #0d9488; }
.dashboard-tile-content { display: grid; gap: 6px; min-width: 0; }
.dashboard-tile-label { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; color: var(--color-text); }
.dashboard-tile-desc { color: var(--color-muted); font-size: 13px; line-height: 1.45; }
.dashboard-tile.dashboard-tile--inactive:disabled {
  cursor: not-allowed;
  border-style: dashed;
  border-width: 1px;
  border-color: #b8c4d4;
  background: #eef2f7;
  color: #64748b;
  box-shadow: inset 0 0 0 1px rgba(203, 213, 225, 0.9);
}
.dashboard-tile.dashboard-tile--inactive:disabled img {
  opacity: 0.88;
}
.dashboard-tile.dashboard-tile--inactive:disabled .dashboard-tile-label {
  color: #475569;
  font-weight: 600;
}
.dashboard-tile-note {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.01em;
  margin-top: -4px;
}
@media (min-width: 1280px) {
  .dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1500px) {
  .dashboard-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .topbar-right { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .app:not(.app--session) {
    padding: 14px;
  }
  .topbar-pill { max-width: min(100%, 280px); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .dashboard-tile { grid-template-columns: 1fr; min-height: auto; }
}
.tp-dashboard-settings {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}
.tp-dashboard-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.admin-btn { background: #e2e8f0; color: #111827; border: 1px solid #cbd5e1; }
.admin-btn.active { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.form-grid { display: grid; gap: 10px; }
.three-cols { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
label { display: grid; gap: 4px; font-size: 13px; }
input, select, textarea, button { padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; }
button {
  background: #1769e0;
  color: #fff;
  border: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}
input[type="button"],
input[type="submit"],
input[type="reset"],
[role="button"] {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}
.app-topbar .topbar-pill {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
}
.app-topbar .topbar-dropdown-item {
  background: transparent;
  color: var(--color-text);
  border: 0;
  border-radius: 10px;
  padding: 10px;
}
.ghost { background: #fff; color: #1769e0; border: 1px solid #1769e0; }
.table-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  line-height: 0;
}
.icon-action-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.icon-action-btn:focus-visible {
  outline: 2px solid #1769e0;
  outline-offset: 2px;
}
.icon-action-btn--danger {
  color: #9f1239;
  border-color: #fecdd3;
}
.icon-action-btn--danger:hover {
  background: #fff1f2;
  border-color: #fb7185;
}

.toolbar { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.toolbar-spacer { flex: 1 1 auto; }
.ao-address-label {
  position: relative;
  min-width: 320px;
  flex: 1 1 360px;
}
.ao-address-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 60;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  display: grid;
  gap: 4px;
}
.ao-address-suggestion-btn {
  border: 0;
  text-align: left;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}
.ao-address-suggestion-btn:hover,
.ao-address-suggestion-btn:focus-visible {
  background: #e2e8f0;
  outline: none;
}
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.module-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.action-btn, .overview-btn { background: #e2e8f0; color: #111827; border: 1px solid #cbd5e1; }
.action-btn.active, .overview-btn.active { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.action-panel { margin: 10px 0; }
.compact-form { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 8px; border-bottom: 1px solid #edf2f7; text-align: left; font-size: 13px; }
.data-table.selectable-table tbody tr { user-select: none; cursor: pointer; }
.data-table.selectable-table tbody tr.row-selected { background: #eff6ff; }
.data-table.selectable-table tbody tr.row-range-active { background: #dbeafe; }
td.history-time-cell {
  white-space: nowrap;
  vertical-align: top;
}
th.history-col-change,
td.history-change {
  max-width: 22rem;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
  color: #334155;
  vertical-align: top;
}
.hidden { display: none; }
/* Modul-Sektionen mit eigenem display (z. B. Tourenplanung .tp-dispatch-shell) sonst trotz .hidden sichtbar */
section.module.hidden {
  display: none !important;
}
.hint { color: #64748b; font-size: 12px; font-weight: 500; }

.login-remember {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  line-height: 1.35;
}
.login-remember input {
  margin-top: 0.2em;
  flex-shrink: 0;
}

.location-page-nav {
  margin: 0 0 12px;
}
.location-back-link {
  font-size: 14px;
  font-weight: 600;
  color: #1769e0;
  text-decoration: none;
}
.location-back-link:hover {
  text-decoration: underline;
}
.global-message {
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 8px;
  min-height: 0;
  padding: 0;
}
.global-message:empty {
  display: none;
  margin: 0;
}
/* Zentrales Meldungsfenster (Windows-ähnlich) */
.app-message-dialog {
  padding: 0;
  border: none;
  background: transparent;
  max-width: calc(100vw - 24px);
}
.app-message-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.app-message-shell {
  min-width: min(320px, 92vw);
  max-width: min(440px, 94vw);
  border: 1px solid #767676;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  background: #fff;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
.app-message-titlebar {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 2px 0 12px;
  background: #0078d4;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}
.app-message-titlebar-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 0;
}
.app-message-titlebar-close {
  flex-shrink: 0;
  width: 40px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.app-message-titlebar-close:hover {
  background: #e81123;
  color: #fff;
}
.app-message-titlebar-close:active {
  opacity: 0.9;
}
.app-message-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px 16px;
  background: #fff;
}
.app-message-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  background: transparent !important;
}
.app-message-dialog[data-variant="error"] .app-message-icon {
  color: #c50505;
}
.app-message-dialog[data-variant="info"] .app-message-icon {
  color: #0078d4;
}
.app-message-dialog[data-variant="question"] .app-message-icon {
  color: #0078d4;
  font-weight: 700;
}
.app-message-text {
  margin: 0;
  flex: 1;
  font-size: 13px;
  line-height: 1.45;
  color: #202020;
  word-break: break-word;
}
.app-message-footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 16px 14px;
  background: #f0f0f0;
  border-top: 1px solid #e5e5e5;
}
.app-message-footer--split {
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.app-message-btn-secondary {
  min-width: 88px;
  padding: 6px 18px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid #767676;
  border-radius: 4px;
  background: #f0f0f0;
  color: #202020;
  cursor: pointer;
}
.app-message-btn-secondary:hover {
  background: #e5e5e5;
}
.app-message-btn-secondary:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: 2px;
}
.app-message-ok {
  min-width: 88px;
  padding: 6px 18px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid #0078d4;
  border-radius: 4px;
  background: #0078d4;
  color: #fff;
  cursor: pointer;
}
.app-message-ok:hover {
  background: #0a6ecc;
  border-color: #0a6ecc;
}
.app-message-ok:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: 2px;
}
.users-grid { display: grid; grid-template-columns: 320px 1fr; gap: 14px; }
.card-soft { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; }
.form-max { max-width: 820px; margin-top: 12px; }
.users-list { display: grid; gap: 8px; align-content: start; }
#users-list, #roles-list { display: grid; gap: 6px; max-height: 520px; overflow: auto; }
.list-item { text-align: left; background: #fff; color: #0f172a; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px; display: grid; gap: 4px; }
.list-item.active { border-color: #1d4ed8; box-shadow: 0 0 0 2px rgba(29,78,216,0.15); }
.list-item span { color: #334155; font-size: 12px; }
.list-item small { color: #64748b; font-size: 11px; font-weight: 500; }
.users-subtab-btn { background: #e2e8f0; color: #111827; border: 1px solid #cbd5e1; }
.users-subtab-btn.active { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.form-section { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; display: grid; gap: 8px; background: #fff; }
.form-section h3 { margin: 0; font-size: 15px; }
.toggle-row { align-content: center; }
.toggle-input { width: 46px; height: 24px; appearance: none; background: #cbd5e1; border-radius: 999px; position: relative; cursor: pointer; border: 0; }
.toggle-input::before { content: ""; width: 20px; height: 20px; background: #fff; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: left 0.2s; }
.toggle-input:checked { background: #22c55e; }
.toggle-input:checked::before { left: 24px; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.permission-item { display: flex; align-items: center; gap: 6px; font-size: 13px; }
select[multiple] { min-height: 120px; }
dialog { border: 0; border-radius: 10px; padding: 0; box-shadow: 0 20px 45px rgba(15,23,42,0.25); }
dialog::backdrop { background: rgba(15,23,42,0.45); }
#password-form { padding: 16px; min-width: 320px; }
#articles-add-dialog { border: 1px solid #d4d8e0; border-radius: 12px; padding: 1rem; width: min(900px, 94vw); }
#articles-add-dialog::backdrop { background: rgba(10, 14, 23, 0.45); }
#articles-manual-add-dialog {
  border: 1px solid #d4d8e0;
  border-radius: 12px;
  padding: 1rem;
  width: min(520px, 94vw);
  box-sizing: border-box;
}
#articles-manual-add-dialog::backdrop {
  background: rgba(10, 14, 23, 0.45);
}
.articles-manual-add-dialog-inner {
  max-height: 85vh;
  overflow: auto;
  gap: 12px;
}
#article-details-dialog { border: 1px solid #d4d8e0; border-radius: 12px; padding: 1rem; width: min(980px, 95vw); }
#article-details-dialog::backdrop { background: rgba(10, 14, 23, 0.45); }
.article-details-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.article-details-grid > div { border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; background: #fff; }
.article-details-grid strong { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; }
.labels-subtab-btn { background: #e2e8f0; color: #111827; border: 1px solid #cbd5e1; }
.labels-subtab-btn.active { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.labels-preview-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  min-width: 0;
}
#designer-preview {
  background-color: #fff;
  background-image:
    linear-gradient(to right, rgba(148,163,184,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148,163,184,0.06) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  position: relative;
  overflow: visible;
  max-width: 100%;
}
.designer-el { position: absolute; overflow: visible; display: flex; align-items: center; cursor: move; transition: box-shadow 120ms ease, outline-color 120ms ease; }
.designer-el.selected { outline: 2px solid #2563eb; outline-offset: 1px; box-shadow: 0 0 0 4px rgba(37,99,235,0.12); }
.designer-el.text { white-space: nowrap; }
.designer-el.center { justify-content: center; text-align: center; }
.designer-el.left { justify-content: flex-start; text-align: left; }
.designer-el.right { justify-content: flex-end; text-align: right; }
.designer-el.arrow { font-size: 24px; justify-content: center; width: 100%; }
.designer-resize-handle { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; background: #2563eb; cursor: se-resize; }
.designer-rotate-handle { position: absolute; top: -26px; left: calc(50% - 8px); width: 16px; height: 16px; background: #fff; border: 2px solid #2563eb; border-radius: 50%; cursor: grab; z-index: 3; }
.designer-rotate-handle::before { content: ""; position: absolute; left: 50%; transform: translateX(-50%); top: 14px; width: 2px; height: 10px; background: #2563eb; }
.designer-resize-handle.nw { left: -6px; top: -6px; right: auto; bottom: auto; cursor: nwse-resize; }
.designer-resize-handle.ne { right: -6px; top: -6px; left: auto; bottom: auto; cursor: nesw-resize; }
.designer-resize-handle.sw { left: -6px; bottom: -6px; right: auto; top: auto; cursor: nesw-resize; }
.designer-resize-handle.se { right: -6px; bottom: -6px; left: auto; top: auto; cursor: nwse-resize; }
.designer-resize-handle.n { left: calc(50% - 8px); top: -18px; width: 16px; height: 10px; right: auto; bottom: auto; cursor: ns-resize; border-radius: 8px; }
.designer-resize-handle.s { left: calc(50% - 8px); bottom: -18px; width: 16px; height: 10px; right: auto; top: auto; cursor: ns-resize; border-radius: 8px; }
.designer-resize-handle.w { left: -18px; top: calc(50% - 8px); width: 10px; height: 16px; right: auto; bottom: auto; cursor: ew-resize; border-radius: 8px; }
.designer-resize-handle.e { right: -18px; top: calc(50% - 8px); width: 10px; height: 16px; left: auto; bottom: auto; cursor: ew-resize; border-radius: 8px; }
.designer-rotation-guide { position: absolute; height: 1px; border-top: 1px dashed #2563eb; transform-origin: 0 0; pointer-events: none; z-index: 1; }
.designer-ribbon-tabs { display: flex; gap: 6px; margin-top: 8px; }
.designer-ribbon-tabs button { border: 1px solid #d1d9e6; background: #f8fafc; color: #334155; }
.designer-ribbon-tabs button.active { background: #fff; border-bottom-color: #fff; color: #1e40af; font-weight: 700; }
.designer-ribbon { display: flex; gap: 10px; flex-wrap: wrap; border: 1px solid #d1d9e6; border-radius: 10px; padding: 10px; background: #fff; }
.designer-ribbon { margin-bottom: 12px; }
.ribbon-group { border-right: 1px solid #e2e8f0; padding-right: 10px; min-height: 66px; display: grid; align-content: space-between; }
.ribbon-group:last-child { border-right: 0; }
.ribbon-row { display: inline-flex; gap: 8px; align-items: center; }
.ribbon-row-view { align-items: stretch; gap: 10px; }
.view-cluster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-right: 10px;
  border-right: 1px solid #e2e8f0;
}
.view-cluster:last-child { border-right: 0; padding-right: 0; }
.ribbon-grid-control { display: inline-flex; align-items: center; gap: 6px; }
.ribbon-grid-control input[type="range"] { width: 90px; }
.ribbon-group small { color: #64748b; font-size: 11px; text-align: center; }
.designer-toolbar { justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-block { display: inline-flex; gap: 8px; align-items: center; }
.icon-btn { min-width: 34px; min-height: 34px; padding: 6px 8px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.toolbar-menu { position: relative; }
.toolbar-menu summary { list-style: none; cursor: pointer; border: 1px solid #cbd5e1; border-radius: 8px; padding: 5px 9px; background: #f8fafc; display: inline-flex; align-items: center; justify-content: center; }
.toolbar-menu summary svg { width: 16px; height: 16px; fill: currentColor; }
.toolbar-menu summary::-webkit-details-marker { display: none; }
.toolbar-menu-body { position: absolute; right: 0; top: 32px; z-index: 5; display: grid; gap: 6px; background: #fff; border: 1px solid #dbe2ea; border-radius: 10px; padding: 8px; min-width: 190px; max-height: 360px; overflow: auto; box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12); }
#designer-create-modal { border: 1px solid #d4d8e0; border-radius: 12px; padding: 1rem; width: min(460px, 92vw); }
#designer-create-modal::backdrop { background: rgba(10, 14, 23, 0.45); }
.layout-list-toolbar { justify-content: flex-start; gap: 10px; margin-bottom: 10px; }
.layout-list-toolbar input,
.layout-list-toolbar select { min-width: 180px; }
.designer-layout-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.designer-layout-card {
  border: 1px solid #dbe4f3;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  padding: 12px;
  display: grid;
  gap: 8px;
}
.designer-layout-card h4 { margin: 0; font-size: 15px; color: #0f172a; }
.designer-layout-meta { font-size: 12px; color: #475569; display: grid; gap: 2px; }
.designer-layout-mini {
  position: relative;
  border: 1px solid #dbe4f3;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(to right, rgba(148,163,184,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148,163,184,0.06) 1px, transparent 1px),
    #fff;
  background-size: 8px 8px;
}
.designer-layout-mini-stage {
  position: absolute;
  left: 0;
  top: 0;
}
.designer-layout-mini .designer-el { overflow: hidden; }
.designer-layout-mini-el {
  position: absolute;
  border-radius: 2px;
  opacity: 0.85;
  transform-origin: center center;
}
.designer-layout-mini-el.text { background: #2563eb; }
.designer-layout-mini-el.code { background: #0f172a; }
.designer-layout-mini-el.arrow { background: #7c3aed; }
.designer-layout-chip {
  display: inline-flex;
  width: fit-content;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}
.designer-layout-chip.system { background: #dbeafe; color: #1e3a8a; }
.designer-layout-actions { display: flex; gap: 8px; justify-content: flex-end; }
.designer-layout-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  color: #64748b;
}
#designer-object-list button { text-align: left; }
.danger-action { color: #b91c1c; border-color: #b91c1c; }
.danger-action:hover { background: #fee2e2; }
html[data-theme="dark"] .danger-action:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.toolbar-group-title { font-size: 12px; font-weight: 700; color: #475569; margin-right: 4px; }
.split { margin-top: 10px; }
.designer-object-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px; align-items: center; }
.designer-object-select {
  width: 100%;
  text-align: left;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
}
.designer-object-select:hover { background: #dbeafe; border-color: #60a5fa; }
.designer-object-select.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.designer-object-visibility {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
  background: #fff;
}
.designer-object-visibility:hover { background: #eff6ff; border-color: #60a5fa; }
.designer-object-visibility svg { width: 14px; height: 14px; fill: #1d4ed8; }
.designer-object-lock {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #0f766e;
  border: 1px solid #99f6e4;
  background: #fff;
}
.designer-object-lock:hover { background: #f0fdfa; border-color: #5eead4; }
.designer-object-lock svg { width: 14px; height: 14px; color: #0f766e; fill: none; }
.designer-object-delete {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  background: #fff;
}
.designer-object-delete:hover { background: #fee2e2; border-color: #ef4444; }
.designer-object-delete svg { width: 14px; height: 14px; fill: #b91c1c; }
.designer-hover-target { box-shadow: 0 0 0 3px rgba(14,165,233,0.2); }
.collapsed-panel { display: none; }

.inventur-fiscal-toolbar {
  margin: 0 0 12px;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.inventur-fiscal-label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  white-space: nowrap;
}
.inventur-fiscal-year-text {
  font-weight: 600;
}
.inventur-fiscal-label select {
  min-width: 100px;
}
.inventur-dialog-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  margin: 8px 0 12px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.inventur-tabs .inventur-tab-btn { background: #e2e8f0; color: #111827; border: 1px solid #cbd5e1; }
.inventur-tabs .inventur-tab-btn.active { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.inventur-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 960px) { .inventur-split { grid-template-columns: 1fr; } }
.inventur-panel-title { margin: 0 0 8px; font-size: 15px; }
.inventur-panel-title-inline { margin: 0; font-size: 15px; align-self: center; font-weight: 600; }
.inventur-locations-toolbar { flex-wrap: wrap; gap: 8px; align-items: center; }
.inventur-create-task-bar {
  margin: 10px 0 8px;
  padding: 10px 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.inventur-task-name-field {
  display: grid;
  gap: 4px;
  min-width: min(100%, 220px);
  flex: 1 1 260px;
  max-width: 400px;
  margin: 0;
  font-size: 13px;
}
.inventur-locations-hint { margin: 0 0 10px; }
.inventur-pick-table-scroll {
  max-height: min(52vh, 560px);
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.inventur-pick-table-scroll .inventur-pick-table {
  margin: 0;
}
.inventur-pick-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  box-shadow: 0 1px 0 #e2e8f0;
}
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.inv-diff { color: #b91c1c; font-weight: 700; }
.inv-diff-pos { color: #15803d; font-weight: 700; }
.inv-booking { color: #15803d; }
.inventur-task-status {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
}
.inventur-task-status--open {
  background: #bbf7d0;
  color: #14532d;
}
.inventur-task-status--progress {
  background: #fef08a;
  color: #713f12;
}
.inventur-task-status--done {
  background: #fecaca;
  color: #991b1b;
}
.inventur-task-status--unknown {
  background: #e2e8f0;
  color: #334155;
}

.inventur-reconcile-wrap { display: grid; gap: 14px; }
.inventur-reconcile-toolbar { flex-wrap: wrap; gap: 10px; align-items: center; }
.inventur-auto-scope-label { font-weight: 600; margin-right: 4px; }
.inventur-auto-scope-opt { margin-right: 10px; }
.inventur-wizard-panel { max-width: 960px; }
.inventur-wizard-idle {
  padding: 20px 8px;
  font-size: 15px;
  color: #475569;
  line-height: 1.5;
}
.inventur-wizard-head { margin-bottom: 8px; }
.inventur-wizard-taskline { font-size: 15px; margin-bottom: 4px; }
.inventur-wizard-prog { margin: 0; }
.inventur-wizard-nav { margin-bottom: 10px; }
.inventur-wizard-loc-hint { margin: 8px 0 0; }
.inv-rec-ersl {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.inventur-wizard-loc-title { cursor: default; }
.inventur-wizard-loc-title[title^="Doppelklick"] { cursor: pointer; }
.inventur-auto-summary-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 520px;
  width: calc(100vw - 32px);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}
.inventur-auto-summary-inner {
  padding: 20px 22px 16px;
}
.inventur-auto-summary-inner h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}
.inventur-auto-summary-inner h4 {
  margin: 16px 0 8px;
  font-size: 14px;
}
.inventur-auto-summary-body p {
  margin: 0 0 8px;
  line-height: 1.45;
}
.inventur-auto-summary-actions {
  justify-content: flex-end;
  margin-top: 12px;
}
.inventur-auto-summary-tasks {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.6;
}
.inventur-auto-summary-task {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 0;
}
.inventur-auto-summary-task:hover {
  background: #f1f5f9;
}
.inventur-loc-card { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; background: #fff; }
.inventur-loc-card h4 { margin: 0 0 8px; font-size: 14px; }
.inventur-rec-card-toolbar { flex-wrap: wrap; gap: 8px; align-items: center; }
.inventur-rec-loc-code { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; }
.inventur-rec-loc-code--closed {
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 6px;
  margin: -2px -6px;
  outline-offset: 2px;
}
.inventur-rec-loc-code--closed:hover { background: #f1f5f9; }
.inventur-rec-loc-name { font-weight: 400; color: #475569; }
.inventur-rec-badge-abgeglichen {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #14532d;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 999px;
}
.inventur-rec-badge-applied {
  font-size: 11px;
  font-weight: 600;
  color: #1e3a8a;
  background: #dbeafe;
  padding: 2px 8px;
  border-radius: 999px;
}
.inventur-shift-hint { align-self: center; }
.inventur-detail-excluded-heading { margin-top: 18px; }

.inventur-stats-body { margin-top: 4px; }
.inventur-stats-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 960px) {
  .inventur-stats-layout {
    grid-template-columns: minmax(280px, 1fr) minmax(260px, 1fr);
  }
}
.inventur-stats-chart-card {
  padding: 14px;
}
.inventur-stats-chart-title {
  margin: 0 0 6px;
  font-size: 16px;
}
.inventur-stats-chart-sub {
  margin: 0 0 4px;
}
.inventur-stats-chart-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  margin-top: 12px;
}
.inventur-stats-pie-column {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 200px;
}
.inventur-stats-pie-wrap {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.inventur-stats-pie-svg {
  width: 100%;
  height: 100%;
  display: block;
  vertical-align: middle;
}
.inventur-stats-pie-caption {
  margin: 0;
  font-weight: 700;
  font-size: 16px;
  color: #0f172a;
}
.inventur-stats-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 14px;
  flex: 1;
  min-width: 200px;
}
.inventur-stats-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.inventur-stats-dot--done {
  background: #15803d;
}
.inventur-stats-dot--open {
  background: #e5e7eb;
  border: 1px solid #cbd5e1;
}
.inventur-stats-cards {
  display: grid;
  gap: 12px;
}
.inventur-stat-card {
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}
.inventur-stat-label {
  font-size: 13px;
  color: #64748b;
}
.inventur-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.inventur-stat-sub {
  font-size: 12px;
  line-height: 1.35;
}
#inventur-task-detail-dialog { width: min(920px, 96vw); padding: 16px; border: 0; border-radius: 12px; }
#inventur-task-detail-dialog::backdrop { background: rgba(15,23,42,0.45); }
.inventur-detail-dialog-inner { max-height: 78vh; overflow: auto; }

#inventur-add-locations-dialog { width: min(720px, 96vw); padding: 16px; border: 0; border-radius: 12px; }
#inventur-add-locations-dialog::backdrop { background: rgba(15,23,42,0.45); }
.inventur-add-dialog-inner { max-height: 78vh; overflow: auto; gap: 12px; }
.inventur-dialog-search-input { flex: 1 1 160px; min-width: 140px; }

#we-detail-dialog { width: min(960px, 96vw); max-height: 92vh; padding: 0; border: 0; border-radius: 12px; }
#we-detail-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.we-detail-dialog-inner { padding: 16px; max-height: 88vh; overflow: auto; display: grid; gap: 12px; }
.we-detail-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; font-size: 13px; }
/* Feldbezeichnungen: genug Kontrast auf hellem Dialog, nicht reines Schwarz */
.we-detail-summary strong { color: #475569; }
.we-detail-table-wrap { overflow: auto; max-height: 36vh; border: 1px solid #e2e8f0; border-radius: 8px; }
.we-detail-xml-details summary { cursor: pointer; font-weight: 600; color: #1e40af; margin-top: 8px; }
.we-detail-xml-details summary:hover {
  color: #1e3a8a;
}
.we-detail-dialog .data-table tbody tr:hover {
  background: #f1f5f9;
}
.we-detail-xml-pre {
  margin: 8px 0 0;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.35;
  max-height: 280px;
  overflow: auto;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
html[data-theme="dark"] .we-detail-dialog .we-detail-summary strong {
  color: var(--color-muted);
}
html[data-theme="dark"] .we-detail-dialog .we-detail-xml-details summary {
  color: var(--color-primary);
}
html[data-theme="dark"] .we-detail-dialog .we-detail-xml-details summary:hover {
  color: #bfdbfe;
}
html[data-theme="dark"] .we-detail-dialog .we-detail-table-wrap {
  border-color: var(--color-border);
}
html[data-theme="dark"] .we-detail-dialog .data-table tbody tr:hover {
  background: rgba(148, 163, 184, 0.14);
}
html[data-theme="dark"] .we-detail-dialog .data-table small {
  color: var(--color-muted);
}
html[data-theme="dark"] .we-detail-dialog h4 {
  color: var(--color-text);
}
#we-receipts-body tr.we-gr-row { cursor: pointer; }
#we-receipts-body tr.we-gr-row:hover { background: #f8fafc; }
.we-gr-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.we-gr-status--open { background: #e0f2fe; color: #0369a1; }
.we-gr-status--in_progress { background: #fef3c7; color: #b45309; }
.we-gr-status--paused { background: #ede9fe; color: #5b21b6; }
.we-gr-status--completed { background: #d1fae5; color: #047857; }
.we-gr-status--cancelled { background: #f1f5f9; color: #64748b; }

/* Auftrags-Dispositionsstatus (LKW) — Pill wie WE, nur Modul Aufträge / Tourenplanung */
.ao-dispatch-td { white-space: normal; vertical-align: middle; }
.ao-dispatch-detail { display: inline-block; margin-left: 6px; vertical-align: middle; }
.ao-dispatch-tournr {
  display: inline-block;
  margin-left: 4px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #334155;
  vertical-align: middle;
}
.ao-dispatch-bubble {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  vertical-align: middle;
}
.ao-dispatch-bubble--ungeplant { background: #f1f5f9; color: #475569; }
.ao-dispatch-bubble--verplant { background: #e0f2fe; color: #0369a1; }
.ao-dispatch-bubble--offen { background: #fef3c7; color: #b45309; }
.ao-dispatch-bubble--in_arbeit { background: #ede9fe; color: #5b21b6; }
.ao-dispatch-bubble--bereitgestellt { background: #cffafe; color: #0e7490; }
.ao-dispatch-bubble--verladen { background: #dbeafe; color: #1d4ed8; }
.ao-dispatch-bubble--abgeschlossen { background: #d1fae5; color: #047857; }
.ao-dispatch-bubble--unknown { background: #f1f5f9; color: #64748b; }

.tp-dispatch-shell {
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
}
.app.app--tourenplanung #module-tourenplanung:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
}
.tp-sticky-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, #ffffff 84%, rgba(255, 255, 255, 0.92) 100%);
  padding: 14px 0 10px;
}
.tp-toolbar-row {
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.tp-toolbar-grid {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  margin-top: 0;
}
.tp-toolbar-shell {
  margin-bottom: 8px;
}
.tp-toolbar-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-weight: 700;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}
.tp-toolbar-shell--collapsed #tp-toolbar-panel {
  display: none;
}
.tp-pane-left--drop-target {
  outline: 2px dashed #94a3b8;
  outline-offset: -3px;
  background: #f8fafc;
}
.tp-orders-panel-head {
  flex-shrink: 0;
  padding-bottom: 6px;
  margin-bottom: 2px;
  border-bottom: 1px solid #e2e8f0;
}
.tp-orders-panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.tp-orders-panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.tp-orders-panel-head-title-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}
.tp-orders-panel-head-title-group .tp-orders-panel-title {
  flex-shrink: 0;
}
.tp-orders-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.4rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  box-shadow: none;
  flex-shrink: 0;
}
.tp-orders-count-badge:empty,
.tp-orders-count-badge[data-count="0"] {
  color: #64748b;
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.tp-orders-panel-head-actions {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  margin-left: auto;
  padding: 2px;
  gap: 2px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.tp-orders-head-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.tp-orders-head-btn:hover:not(:disabled) {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.tp-orders-head-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}
.tp-orders-head-btn--icon-only {
  width: 30px;
  padding: 0;
}
.tp-orders-head-btn-icon {
  display: block;
  flex-shrink: 0;
}
.tp-orders-head-btn-text {
  white-space: nowrap;
}
.tp-orders-head-btn.tp-orders-head-btn--spin .tp-orders-head-btn-icon {
  animation: tp-spin 0.7s linear infinite;
}
.tp-date-toolbar-wrap {
  display: inline-flex;
  align-items: center;
}
.tp-date-input-toolbar {
  min-height: 36px;
  padding: 6px 10px;
}
.tp-toolbar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  min-height: 36px;
  padding: 6px;
  line-height: 0;
}
.tp-toolbar-icon-btn svg {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.tp-icon-btn {
  padding: 4px 8px;
  min-width: 32px;
  line-height: 1;
}
.tp-icon-btn-glyph {
  display: inline-block;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}
.tp-icon-btn.tp-icon-btn--spin .tp-icon-btn-glyph {
  animation: tp-spin 0.7s linear infinite;
}
@keyframes tp-spin {
  to { transform: rotate(360deg); }
}
.tp-order-marked {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}
.tp-merge-colored {
  box-shadow: inset 4px 0 0 hsl(var(--tp-merge-hue, 210) 68% 42%);
}
.tp-order-card.tp-merge-colored {
  border-left: 4px solid hsl(var(--tp-merge-hue, 210) 68% 42%);
}
.tp-tl-bar.tp-merge-colored {
  box-shadow: inset 4px 0 0 hsl(var(--tp-merge-hue, 210) 68% 42%);
}
.tp-address-merge-dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  max-width: min(520px, calc(100vw - 24px));
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}
.tp-address-merge-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.tp-address-merge-dialog-inner {
  padding: 16px 18px 14px;
}
.tp-address-merge-hint {
  margin: 0 0 10px;
  font-size: 12px;
}
.tp-address-merge-body {
  max-height: min(52vh, 420px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.tp-address-merge-group {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
}
.tp-address-merge-group-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}
.tp-address-merge-group-head strong {
  font-size: 13px;
  color: #0f172a;
}
.tp-address-merge-quick {
  font-size: 12px;
  margin-bottom: 6px;
  padding: 4px 8px;
}
.tp-address-merge-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tp-address-merge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  cursor: pointer;
  font: inherit;
}
.tp-address-merge-row:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}
.tp-address-merge-ls {
  font-weight: 700;
  font-size: 12px;
  color: #0f172a;
}
.tp-address-merge-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.tp-ls-pick-dialog,
.tp-ls-dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  max-width: min(720px, calc(100vw - 24px));
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  overflow: visible;
}
.tp-ls-dialog-map-card {
  margin-bottom: 12px;
}
.tp-ls-dialog-map-card .tp-ls-map-preview {
  height: 200px;
  min-height: 200px;
}
.tp-ls-tour-reorder-wrap {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.tp-ls-tour-reorder-title {
  margin: 0 0 4px;
  font-size: 13px;
}
.tp-ls-tour-reorder-hint {
  margin: 0 0 8px;
  font-size: 11px;
}
.tp-ls-tour-reorder-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tp-ls-tour-reorder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  cursor: grab;
  font-size: 12px;
}
.tp-ls-tour-reorder-item:active {
  cursor: grabbing;
}
.tp-ls-tour-reorder-item.tp-ls-tour-reorder-item--drag-over {
  border-color: #2563eb;
  background: #eff6ff;
}
.tp-ls-tour-reorder-item.tp-ls-tour-reorder-item--current {
  border-color: #0f766e;
  box-shadow: 0 0 0 1px #0f766e;
}
.tp-ls-tour-reorder-grip {
  color: #94a3b8;
  font-weight: 700;
  user-select: none;
}
.tp-ls-pick-dialog::backdrop,
.tp-ls-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.tp-ls-pick-dialog-inner,
.tp-ls-dialog-inner {
  padding: 16px 18px 14px;
  overflow: visible;
}
.tp-ls-pick-hint,
.tp-ls-dialog-meta {
  margin: 0 0 10px;
  font-size: 12px;
}
.tp-ls-dialog-date-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.tp-ls-dialog-date-display {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.tp-ls-date-change-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
}
.tp-ls-date-change-btn:hover:not(:disabled) {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}
.tp-ls-date-change-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.tp-ls-date-btn-icon {
  display: inline-flex;
  color: #2563eb;
}
.tp-ls-date-picker-popover {
  flex-basis: 100%;
  width: 100%;
  order: 3;
  margin-top: 4px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #93c5fd;
  background: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
}
.tp-ls-date-picker-popover.hidden {
  display: none;
}
.tp-ls-date-picker-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: #1e40af;
}
.tp-ls-date-picker-field {
  display: block;
  margin-bottom: 10px;
}
.tp-ls-dialog-date-input {
  width: 100%;
  max-width: 220px;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color-scheme: light;
}
.tp-ls-dialog-date-input:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}
.tp-ls-date-picker-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tp-ls-pick-list {
  max-height: min(40vh, 320px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.tp-ls-pick-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  cursor: pointer;
  font: inherit;
}
.tp-ls-pick-row:hover {
  border-color: #2563eb;
  background: #eff6ff;
}
.tp-ls-pick-row--preferred {
  border-color: #93c5fd;
  background: #f0f9ff;
}
.tp-ls-pick-ls {
  font-weight: 800;
  font-size: 13px;
  color: #0f172a;
}
.tp-ls-pick-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.tp-ls-dialog-lines-scroll {
  max-height: min(52vh, 420px);
  overflow: auto;
  margin-bottom: 12px;
}
.tp-ls-dialog-lines-table {
  font-size: 12px;
}
.tp-order-filter-dialog,
.tp-order-filter-terms-dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  max-width: min(440px, calc(100vw - 24px));
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}
.tp-order-filter-dialog::backdrop,
.tp-order-filter-terms-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.tp-order-filter-dialog-inner,
.tp-order-filter-terms-inner {
  padding: 16px 18px 14px;
}
.tp-order-filter-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.tp-order-filter-dialog-head h2,
.tp-order-filter-dialog-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}
.tp-order-filter-dialog-hint {
  margin: 0 0 12px;
  font-size: 12px;
}
.tp-filter-slider-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tp-filter-slider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  cursor: default;
  user-select: none;
}
.tp-filter-slider-row[data-tp-filter-terms] {
  cursor: pointer;
}
.tp-filter-slider-row[data-tp-filter-terms]:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}
.tp-filter-slider-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tp-filter-slider-text strong {
  font-size: 13px;
  color: #0f172a;
}
.tp-filter-slider-meta {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}
.tp-filter-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  cursor: pointer;
}
.tp-filter-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.tp-filter-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s;
}
.tp-filter-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}
.tp-filter-switch input:checked + .tp-filter-switch-track {
  background: #22c55e;
}
.tp-filter-switch input:checked + .tp-filter-switch-track::after {
  transform: translateX(18px);
}
.tp-filter-switch input:focus-visible + .tp-filter-switch-track {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.tp-order-filter-dialog-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}
.tp-order-filter-terms-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  max-height: 220px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.tp-order-filter-terms-item,
.tp-order-filter-terms-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.tp-order-filter-terms-item:last-child {
  border-bottom: 0;
}
.tp-order-filter-terms-del {
  font-size: 11px;
  padding: 3px 8px;
}
.tp-order-filter-terms-add {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.tp-order-filter-terms-add input {
  flex: 1;
  min-width: 0;
}
.tp-orders-panel--hide-pos .tp-orders-list-head,
.tp-orders-panel--hide-pos .tp-order-line {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
}
.tp-orders-panel--hide-pos .tp-orders-col-pos,
.tp-orders-panel--hide-pos .tp-order-col--pos {
  display: none;
}
.tp-pill--count {
  font-size: 11px;
  padding: 2px 8px;
  min-width: 1.5rem;
  text-align: center;
}
.tp-order-date-divider {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 4px 0 0;
  padding: 6px 8px;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 6px 6px 0 0;
  background: #f1f5f9;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #475569;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}
.tp-order-date-divider:hover {
  background: #e2e8f0;
}
.tp-order-date-divider--collapsed {
  border-radius: 6px;
  margin-bottom: 2px;
}
.tp-order-date-divider:first-child {
  margin-top: 0;
}
.tp-order-date-chevron {
  flex-shrink: 0;
  width: 12px;
  font-size: 9px;
  color: #64748b;
}
.tp-order-date-label {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.tp-order-date-count {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.history-filters-toolbar {
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.history-filters-toolbar input[type="date"],
.history-filters-toolbar input[type="text"] {
  min-width: 120px;
  max-width: 200px;
}
.history-table-wrap {
  max-height: min(70vh, 640px);
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}
.history-table {
  width: 100%;
  margin: 0;
}
.history-table .history-col-change {
  min-width: 220px;
  max-width: 420px;
  white-space: normal;
  word-break: break-word;
}
.history-table .history-time-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.history-empty {
  text-align: center;
  color: var(--color-muted);
  padding: 20px;
}
.history-module-hint {
  margin: 0 0 12px;
}
html[data-theme="dark"] .history-table-wrap {
  border-color: var(--color-border);
  background: var(--color-surface-soft);
}
.tp-order-line {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 3.4rem;
  align-items: center;
  font-size: 12px;
  line-height: 1.35;
  color: #1e293b;
}
.tp-order-col {
  min-width: 0;
  padding: 0 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 1px solid #e2e8f0;
}
.tp-order-col--company {
  padding-left: 0;
  border-left: none;
}
.tp-order-col--pos {
  padding-right: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tp-order-col--street {
  border-left-color: #cbd5e1;
}
.tp-orders-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 3.4rem;
  align-items: center;
  margin: 0 0 4px;
  padding: 0 0 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.tp-orders-list-head span {
  min-width: 0;
  padding: 0 7px;
  border-left: 1px solid transparent;
}
.tp-orders-list-head span:first-child {
  padding-left: 0;
}
.tp-orders-list-head span:last-child {
  padding-right: 0;
  text-align: right;
}
.tp-date-label,
.tp-search-label,
.tp-filter-label {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}
.tp-search-label input {
  min-width: 250px;
}
.tp-inline-check {
  margin-left: auto;
  font-weight: 700;
}
.tp-dispatch-layout {
  margin-top: 6px;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(480px, 520px) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  max-height: calc(100dvh - 168px);
}
html.tp-view-expanded .tp-dispatch-layout {
  grid-template-columns: minmax(280px, 22vw) minmax(0, 1fr);
  align-items: stretch;
  min-height: calc(100vh - 200px);
  gap: 14px;
}
.tp-pane-center {
  min-width: 0;
  overflow: hidden;
  min-height: 0;
}
.tp-pane-center-stack {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
}
.tp-timeline-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  min-height: 0;
  height: 100%;
}
.tp-timeline-view.tp-timeline-view--hidden {
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
}
.tp-order-detail-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  height: 100%;
  z-index: 2;
  position: relative;
  background: #fff;
}
.tp-order-detail-panel.hidden {
  display: none !important;
}
.tp-order-detail-close {
  position: absolute;
  top: 2px;
  right: 4px;
  z-index: 6;
  width: 2rem;
  height: 2rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.tp-order-detail-close:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.tp-order-detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 12px;
  align-items: start;
  padding: 4px 2.5rem 0 0;
}
.tp-order-detail-name {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}
.tp-order-detail-address-line {
  margin: 0;
  font-size: 13px;
  color: #334155;
  line-height: 1.35;
}
.tp-order-detail-meta {
  margin: 6px 0 0;
}
.tp-order-detail-map-card {
  margin: 0;
}
.tp-order-detail-map-card .tp-map-preview {
  height: 150px;
  min-height: 150px;
}
.tp-order-detail-divider {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 8px 0 6px;
}
.tp-order-detail-lines-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.tp-order-detail-lines-table {
  font-size: 12px;
}
.tp-order-detail-lines-table th,
.tp-order-detail-lines-table td {
  padding: 5px 8px;
  vertical-align: middle;
}
.tp-order-detail-line-actions {
  white-space: nowrap;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.tp-order-detail-line-actions .ghost {
  font-size: 11px;
  padding: 2px 6px;
}
tr.tp-line-cancelled td {
  opacity: 0.55;
  text-decoration: line-through;
}
.tp-pane {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  padding: 8px 10px;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
}
html.tp-view-expanded .tp-pane {
  min-height: 0;
  height: 100%;
}
/** Linke Spalte: Kopf + scrollbarer Auftragsbereich (Tour ablegen = gesamte Pane). */
.tp-pane-left {
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  max-height: 100%;
}
html.tp-view-expanded .tp-pane-left {
  min-height: 0;
}
.tp-pane-left #tp-orders-body.tp-scroll-area {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
.tp-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.tp-pill {
  border-radius: 999px;
  background: #e2e8f0;
  color: #1e293b;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
}
.tp-section-title { margin: 0; font-size: 16px; color: #0f172a; }
.tp-scroll-area {
  overflow: auto;
}
.tp-orders-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-content: flex-start;
  padding-right: 2px;
}
.tp-unplan-dropzone {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  margin-bottom: 8px;
}
.tp-unplan-dropzone.tp-drop-target {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}
.tp-order-card {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  padding: 5px 8px;
  min-height: 1.65rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 100ms ease, background-color 100ms ease;
}
.tp-order-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.tp-order-card.tp-order-selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #2563eb;
}
.tp-order-card[draggable="true"] {
  cursor: grab;
}
.tp-order-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.tp-order-number {
  font-size: 14px;
  font-weight: 700;
}
.tp-priority-chip {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f1f5f9;
  color: #334155;
}
.tp-priority-chip--high { background: #fee2e2; color: #991b1b; }
.tp-priority-chip--normal { background: #e2e8f0; color: #334155; }
.tp-priority-chip--low { background: #dcfce7; color: #166534; }
.tp-order-meta {
  font-size: 12px;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.tp-undated-details {
  margin-top: 4px;
  border-top: 1px solid #eef2f7;
  padding-top: 8px;
}
.tp-undated-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #334155;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.tp-undated-details summary::-webkit-details-marker {
  display: none;
}
.tp-undated-details summary::before {
  content: "▸";
  color: #94a3b8;
  font-size: 12px;
  transition: transform 140ms ease;
}
.tp-undated-details[open] summary::before {
  transform: rotate(90deg);
}
.tp-undated-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 700;
  background: #e2e8f0;
  color: #475569;
}
.tp-orders-list-undated { max-height: 220px; overflow: auto; margin-top: 10px; }
.tp-timeline-root { display: grid; gap: 10px; min-width: 0; padding-bottom: 2px; }
.tp-pane-center .tp-timeline-view .tp-timeline-root.tp-scroll-area {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}
html.tp-view-expanded .tp-map-preview {
  min-height: 200px;
  height: 200px;
}
html.tp-view-expanded .tp-table-wrap {
  max-height: 240px;
}
#tp-expand-view-btn[aria-pressed="true"] {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}
.tp-tl-sticky-chrome {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}
.tp-tl-pan-row {
  display: grid;
  grid-template-columns: var(--tp-tl-vehicle-col, 116px) 1fr;
  gap: 8px;
  align-items: center;
  padding: 0 0 8px;
  border-bottom: 1px solid #e2e8f0;
}
.tp-tl-pan-spacer {
  min-width: 0;
}
.tp-tl-pan-rail-wrap {
  min-width: 0;
}
.tp-time-rail-track {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: #e2e8f0;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}
.tp-time-rail-thumb {
  position: absolute;
  top: 1px;
  bottom: 1px;
  min-width: 18px;
  border-radius: 6px;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  cursor: grab;
  touch-action: none;
}
.tp-time-rail-thumb:active {
  cursor: grabbing;
}
.tp-time-rail-thumb--locked {
  cursor: default;
  background: #94a3b8;
  box-shadow: none;
}
.tp-time-rail-thumb:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.tp-view-range-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #334155;
  font-size: 13px;
}
.tp-view-range-label .tp-view-hour-select,
.tp-settings-timeline-label .tp-view-hour-select {
  min-width: 78px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-weight: 600;
}
.tp-view-range-display {
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.tp-settings-timeline-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 700;
  font-size: 13px;
}
.ao-seed-test-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: flex-end;
}
.ao-seed-test-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 700;
  font-size: 13px;
}
.ao-seed-test-fields input[type="number"] {
  width: 6rem;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}
.tp-view-range-dash { color: #94a3b8; }
.tp-view-range-hint { font-weight: 600; margin-left: 2px; }
.tp-tl-grid.tp-tl-header {
  display: grid;
  /* grid-template-columns wird in JS gesetzt (Fahrzeugspalte + Zeitbereich) */
  grid-template-columns: 116px 1fr;
  gap: 8px;
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
  padding: 4px 0 8px;
}
.tp-tl-hour-cell {
  text-align: center;
  padding: 2px 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  z-index: 1;
}
.tp-tl-hour-top {
  font-weight: 700;
  color: #475569;
  font-size: 11px;
}
.tp-tl-hour-half {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  line-height: 1;
}
.tp-tl-snap-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  z-index: 8;
  pointer-events: none;
}
.tp-tl-snap-guide--hidden {
  opacity: 0;
  visibility: hidden;
}
.tp-tl-snap-line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-left: 2px dashed #2563eb;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.25);
}
.tp-tl-snap-label {
  position: absolute;
  left: 0;
  top: 3px;
  transform: translateX(-50%);
  background: rgba(37, 99, 235, 0.94);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}
.tp-tl-vehicle-head { padding-right: 8px; }
.tp-tl-row {
  display: grid;
  grid-template-columns: var(--tp-tl-vehicle-col, 116px) 1fr;
  gap: 8px;
  align-items: stretch;
  min-height: 66px;
}
.tp-tl-vehicle-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px 8px 0;
  border-right: 1px solid #e2e8f0;
  min-width: 0;
}
.tp-tl-vehicle-plate {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  word-break: break-word;
}
.tp-tl-vehicle-type {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
  word-break: break-word;
}
.tp-tl-track-wrap { min-width: 0; }
.tp-tl-header-time-scroll.tp-tl-track-scroll--master {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.tp-tl-header-time-scroll.tp-tl-track-scroll--master::-webkit-scrollbar {
  display: none;
}
.tp-tl-track-wrap.tp-tl-track-scroll--slave {
  overflow-x: hidden;
  overflow-y: hidden;
  scrollbar-width: none;
}
.tp-tl-track-wrap.tp-tl-track-scroll--slave::-webkit-scrollbar {
  display: none;
}
.tp-tl-header-time-inner,
.tp-tl-track-inner {
  width: calc(var(--tp-tl-zoom-mag, 1) * 100%);
  min-width: 100%;
  box-sizing: border-box;
  background-origin: padding-box;
  background-clip: padding-box;
}
.tp-tl-header-time-inner {
  gap: 0;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  box-sizing: border-box;
}
.tp-tl-track-inner {
  position: relative;
  border-radius: 10px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  /* Rasterlinien setzt main.js (gleich wie Kopfzeile) */
}
.tp-tl-track-inner .tp-tl-track {
  width: 100%;
}
.tp-tl-track {
  position: relative;
  height: 108px;
  background: transparent;
  border: none;
  border-radius: 0;
}
.tp-tl-track.tp-drop-target {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.tp-composer-order-zone {
  min-height: 72px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  align-content: flex-start;
  padding: 10px;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}
.tp-composer-order-zone.tp-drop-target {
  border-color: #2563eb;
  background: #eff6ff;
}
.tp-composer-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e0e7ff;
  border: 1px solid #a5b4fc;
  font-size: 13px;
  cursor: grab;
  max-width: 100%;
}
.tp-composer-remove-zone {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed #fca5a5;
  background: #fef2f2;
  font-size: 12px;
  color: #991b1b;
}
.tp-composer-remove-zone.tp-drop-target {
  border-color: #dc2626;
  background: #fee2e2;
}

.tp-create-tour-stops-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.tp-create-tour-stops-hint,
.tp-edit-tour-stops-hint {
  margin: 0 0 8px;
}
.tp-edit-tour-stops-wrap {
  margin-top: 4px;
}
.tp-edit-tour-stops-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 48px;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 8px;
  background: #f8fafc;
}
.tp-edit-tour-stops-list.tp-drop-target {
  border-color: #2563eb;
  background: #eff6ff;
}
.tp-edit-tour-stop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: grab;
}
.tp-edit-tour-stop-item:active {
  cursor: grabbing;
}
.tp-edit-tour-stop-item.tp-edit-tour-stop-item--drag-over {
  border-color: #2563eb;
  background: #eff6ff;
}
.tp-edit-tour-stop-grip {
  color: #94a3b8;
  flex-shrink: 0;
  user-select: none;
}
.tp-edit-tour-stop-body {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}
.tp-edit-tour-stop-remove {
  flex-shrink: 0;
  font-size: 12px;
  padding: 4px 10px;
}
.tp-tl-tour-group {
  position: absolute;
  top: 6px;
  bottom: 6px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 52px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}
.tp-tl-tour-group--planned {
  background: rgba(219, 234, 254, 0.45);
}
.tp-tl-tour-group--reported {
  background: rgba(220, 252, 231, 0.45);
}
.tp-tl-tour-group--conflict {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.45), 0 4px 14px rgba(15, 23, 42, 0.1);
}
.tp-tl-tour-group--drop-target {
  box-shadow: 0 0 0 2px #2563eb, 0 4px 14px rgba(37, 99, 235, 0.2);
  border-color: #2563eb;
}
.tp-tl-tour-group--selected {
  box-shadow: 0 0 0 2px #2563eb, 0 4px 14px rgba(37, 99, 235, 0.25);
}
.tp-tl-bar--tour-selected {
  box-shadow: 0 0 0 2px #2563eb;
}
.tp-tl-tour-group-head {
  cursor: grab;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  padding: 5px 8px;
  min-height: 32px;
}
.tp-tl-tour-group--planned .tp-tl-tour-group-head {
  background: rgba(255, 255, 255, 0.9);
}
.tp-tl-tour-group--reported .tp-tl-tour-group-head {
  background: rgba(255, 255, 255, 0.88);
}
.tp-tl-tour-group-body {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
  flex: 1;
  min-height: 30px;
  cursor: grab;
}
.tp-tl-tour-group-body .tp-tl-bar--segment {
  position: relative;
  top: auto;
  bottom: auto;
  left: auto;
  width: auto;
  height: auto;
  align-self: stretch;
  border-radius: 0;
  box-shadow: none;
  border: none;
  border-left: 2px solid rgba(15, 23, 42, 0.14);
  padding: 4px 5px;
  justify-content: center;
  gap: 2px;
}
.tp-tl-tour-group-body .tp-tl-bar--segment:first-child {
  border-left: none;
}
.tp-tl-bar--segment .tp-tl-bar-footer {
  flex: 1;
  justify-content: center;
  text-align: center;
}
.tp-tl-bar--segment .tp-tl-bar-customer,
.tp-tl-bar--segment .tp-tl-bar-delivery-no {
  max-width: 100%;
  text-align: center;
}
.tp-tl-bar--segment .tp-tl-bar-actions {
  display: none;
}
.tp-tl-bar--segment.tp-tl-bar--drop-target {
  box-shadow: none;
  outline: none;
}
.tp-tl-bar {
  position: absolute;
  top: 6px;
  bottom: 6px;
  z-index: 5;
  border-radius: 8px;
  padding: 5px 6px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 5px;
  line-height: 1.2;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #0f172a;
  font-size: 11px;
  font-weight: 500;
  transition: box-shadow 120ms ease;
  cursor: grab;
}
.tp-tl-bar-head {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 6px;
  padding: 5px 7px;
  cursor: grab;
}
.tp-tl-bar-head-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  width: 100%;
}
.tp-tl-bar-designation {
  font-weight: 800;
  font-size: 11px;
  line-height: 1.25;
  color: #0f172a;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-tl-bar-tour-no {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  line-height: 1.2;
  letter-spacing: 0.01em;
}
.tp-tl-bar-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-top: auto;
  min-width: 0;
  width: 100%;
  padding-top: 2px;
}
.tp-tl-bar-customer {
  font-size: 10px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-tl-bar-delivery-no {
  font-size: 10px;
  font-weight: 600;
  color: #334155;
  line-height: 1.2;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-tl-bar--reported .tp-tl-bar-head,
.tp-tl-bar--reported .tp-tl-bar-footer {
  background: rgba(255, 255, 255, 0.75);
}
.tp-tl-bar:hover {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}
.tp-tl-bar--drop-target {
  box-shadow: 0 0 0 2px #2563eb, 0 6px 18px rgba(37, 99, 235, 0.28);
  outline: 2px dashed #1d4ed8;
  outline-offset: 1px;
}
.tp-tl-bar--time-drag,
.tp-tl-tour-group.tp-tl-bar--time-drag {
  cursor: grabbing;
  touch-action: none;
  z-index: 6;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
}
.tp-tl-bar--time-drag .tp-tl-bar-head,
.tp-tl-tour-group.tp-tl-bar--time-drag .tp-tl-tour-group-head {
  cursor: grabbing;
}
.tp-tl-bar--planned { background: linear-gradient(135deg, #dbeafe, #93c5fd); }
.tp-tl-bar--reported { background: linear-gradient(135deg, #dcfce7, #86efac); }
.tp-tl-bar--conflict { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.45), 0 5px 16px rgba(15, 23, 42, 0.14); }
.tp-tl-bar-actions {
  margin-top: 4px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.tp-tl-bar-actions button { font-size: 10px; padding: 2px 6px; }
.tp-status-badge {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
}
.tp-status-ok { background: #dcfce7; color: #166534; }
.tp-status-alert { background: #fee2e2; color: #991b1b; }
.tp-detail-panel {
  display: grid;
  gap: 10px;
}
.tp-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.tp-detail-meta { display: block; font-size: 13px; color: #64748b; margin-top: 4px; }
.tp-detail-actions { flex-shrink: 0; }
.tp-live-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tp-live-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px;
  display: grid;
  gap: 3px;
}
.tp-live-label {
  font-size: 11px;
  color: #64748b;
}
.tp-map-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 8px;
}
.tp-map-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tp-map-head-title {
  font-size: 13px;
  color: #0f172a;
}
.tp-map-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}
.tp-map-mode-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.tp-map-mode-slider {
  position: relative;
  width: 38px;
  height: 20px;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.tp-map-mode-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}
.tp-map-mode-toggle input:checked + .tp-map-mode-slider {
  background: #2563eb;
}
.tp-map-mode-toggle input:checked + .tp-map-mode-slider::after {
  transform: translateX(18px);
}
.tp-map-mode-toggle:has(input:checked) > .tp-map-mode-label:last-of-type {
  color: #1d4ed8;
}
.tp-map-mode-toggle:has(input:not(:checked)) > .tp-map-mode-label:first-of-type {
  color: #1d4ed8;
}
.tp-order-detail-route-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 6px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 11px;
}
.tp-order-detail-route-stats.hidden {
  display: none !important;
}
.tp-route-stat {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.tp-route-stat span {
  color: #64748b;
}
.tp-route-stat strong {
  color: #0f172a;
  font-size: 12px;
}
.tp-route-stat--total {
  grid-column: 1 / -1;
  padding-top: 4px;
  border-top: 1px dashed #cbd5e1;
  margin-top: 2px;
}
.tp-route-stat--total strong {
  color: #1d4ed8;
  font-size: 13px;
}
.tp-map-preview {
  min-height: 190px;
  height: 190px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  overflow: hidden;
}
.tp-map-preview .leaflet-control-attribution {
  font-size: 10px;
}
.tp-table-wrap { overflow: auto; max-height: 230px; border: 1px solid #e2e8f0; border-radius: 8px; }
.tp-order-selected { outline: none; }
@media (max-width: 1280px) {
  .tp-dispatch-layout {
    grid-template-columns: minmax(400px, 46%) minmax(0, 1fr);
  }
}
@media (max-width: 960px) {
  .tp-dispatch-layout {
    grid-template-columns: 1fr;
    max-height: none;
  }
  .tp-pane-left {
    max-height: min(48vh, 420px);
  }
  .tp-search-label input {
    min-width: 180px;
  }
}
.tp-vehicle-add-form {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.tp-order-selected { outline: 2px solid #2563eb; outline-offset: -2px; background: #eff6ff; }

@media print {
  .inv-print-toolbar { display: none; }
  .inv-print-page { page-break-after: always; }
}

.xml-tree-host {
  max-height: 420px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.35;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}
.xml-tree-ul {
  list-style: none;
  margin: 0 0 0 10px;
  padding: 0 0 0 10px;
  border-left: 1px solid #cbd5e1;
}
.xml-tree-root.xml-tree-ul {
  margin: 0;
  padding: 0;
  border-left: none;
}
.xml-tree-host details {
  margin: 2px 0;
}
.xml-tree-host summary {
  cursor: pointer;
  user-select: none;
}
.xml-tree-host .xml-an {
  color: #0369a1;
}
.xml-tree-host .xml-av {
  color: #64748b;
}
.xml-tree-host .xml-txt {
  color: #0f172a;
}

.delvry-route-block {
  line-height: 1.45;
  margin-top: 4px;
}
