
:root {
  color-scheme: light;
  --text: #222;
  --text-strong: #111;
  --text-mid: #333;
  --muted: #555;
  --muted-2: #666;
  --quiet: #777;
  --faint: #888;
  --icon: #5f6368;
  --canvas: #f4f6f5;
  --surface: #fff;
  --surface-muted: #fafafa;
  --card: #fbfbfb;
  --line: #eee;
  --line-2: #e5e5e5;
  --line-3: #e0e0e0;
  --line-4: #e6e6e6;
  --border: #ddd;
  --border-strong: #ccc;
  --border-soft: #bbb;
  --border-cool: #d5dbe3;
  --brand: #1a5d3a;
  --brand-ink: #0e3d24;
  --brand-fill: #1a5d3a;
  --brand-fill-hover: #134529;
  --danger: #a33;
  --danger-deep: #822;
  --secondary: #888;
  --secondary-hover: #666;
  --disabled: #d5d5d5;
  --selected: #e7f2eb;
  --selected-2: #e7f2ea;
  --selected-3: #e5f2ea;
  --highlight: #d9e8ff;
  --input: #fff;
  --table-head: #f5f5f5;
  --table-hover: #ececec;
  --row-fold: #f7fbf8;
  --drop: #f7faf8;
  --row-new: #e5f4ea;
  --icon-hover: #e8eaed;
  --icon-hover-ink: #202124;
  --sheen: none;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --text: #e6edf3;
  --text-strong: #f0f6fc;
  --text-mid: #c9d1d9;
  --muted: #8b949e;
  --muted-2: #8b949e;
  --quiet: #6e7681;
  --faint: #8b949e;
  --icon: #8b949e;
  --canvas: #0d1117;
  --surface: #161b22;
  --surface-muted: #161b22;
  --card: #161b22;
  --line: #21262d;
  --line-2: #21262d;
  --line-3: #30363d;
  --line-4: #30363d;
  --border: #30363d;
  --border-strong: #3d444d;
  --border-soft: #3d444d;
  --border-cool: #3d444d;
  --brand: #3fb950;
  --brand-ink: #7ee787;
  --brand-fill: #238636;
  --brand-fill-hover: #2ea043;
  --danger: #da3633;
  --danger-deep: #b62324;
  --secondary: #30363d;
  --secondary-hover: #3d444d;
  --disabled: #21262d;
  --selected: #1c3a2a;
  --selected-2: #1c3a2a;
  --selected-3: #1c3a2a;
  --highlight: #1c2f4a;
  --input: #0d1117;
  --table-head: #21262d;
  --table-hover: #30363d;
  --row-fold: #12261c;
  --drop: #12261c;
  --row-new: #1c3a2a;
  --icon-hover: #30363d;
  --icon-hover-ink: #e6edf3;
  --sheen: none;
}

html[data-theme="metal"] {
  color-scheme: light;
  --text: #1c2128;
  --text-strong: #12161c;
  --text-mid: #2a3038;
  --muted: #3d4450;
  --muted-2: #4a5260;
  --quiet: #5c6570;
  --faint: #5c6570;
  --icon: #3d4450;
  --canvas: #8b929c;
  --surface: #a3aab3;
  --surface-muted: #969da6;
  --card: #b0b7c0;
  --line: #7a828c;
  --line-2: #8a919a;
  --line-3: #6e7580;
  --line-4: #6e7580;
  --border: #7d8490;
  --border-strong: #6e7580;
  --border-soft: #6a717b;
  --border-cool: #6e7580;
  --brand: #0e3d24;
  --brand-ink: #0e3d24;
  --brand-fill: #1a5d3a;
  --brand-fill-hover: #134529;
  --danger: #8f2d2d;
  --danger-deep: #6e2222;
  --secondary: #6a717b;
  --secondary-hover: #5c636c;
  --disabled: #8e959e;
  --selected: #8a9a90;
  --selected-2: #8a9a90;
  --selected-3: #9aa89a;
  --highlight: #9aa8b8;
  --input: #c5ccd4;
  --table-head: #8e959e;
  --table-hover: #b7bec6;
  --row-fold: #8a9a90;
  --drop: #b7c0b4;
  --row-new: #9aa89a;
  --icon-hover: #c5ccd4;
  --icon-hover-ink: #1c2128;
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.06) 24%, rgba(0, 0, 0, 0.1) 100%);
  --brush: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.06) 22%, rgba(0, 0, 0, 0.12) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, rgba(0, 0, 0, 0.035) 1px 2px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
}

#app {
  display: flex;
  height: 100vh;
}

#app.raster-open #map {
  display: none;
}

#raster-view {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--canvas);
  background-image: var(--sheen);
}

#raster-view.hidden {
  display: none !important;
}

.raster-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
  padding: 10px 12px;
  background-color: var(--surface);
  background-image: var(--sheen);
  border-bottom: 1px solid var(--border);
}

.raster-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
}

.raster-toolbar input {
  width: 72px;
  font: inherit;
  padding: 4px 6px;
}

.raster-toolbar-spacer {
  flex: 1;
}

.raster-hint {
  margin: 0;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
}

#raster-status {
  font-size: 13px;
  color: var(--brand);
}

#raster-board {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  padding: 8px;
}

#raster-side {
  position: sticky;
  top: 8px;
  left: 8px;
  z-index: 2;
  flex: 0 0 auto;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0 8px 0 0;
}

.raster-zoom {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.raster-zoom button {
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

#raster-legend {
  position: static;
  margin: 0 !important;
}

#raster-view.raster-saved .raster-toolbar,
#raster-view.raster-saved > .raster-hint {
  display: none;
}

#raster-view.raster-saved.raster-marking .raster-toolbar {
  display: flex;
}

#raster-view.raster-saved.raster-marking > .raster-hint {
  display: block;
}

#raster-grid {
  display: grid;
  gap: 1px;
  width: max-content;
  height: max-content;
  margin: auto;
  padding: 1px;
  background: #d5dbd7;
  user-select: none;
  touch-action: none;
}

.raster-cell {
  width: 22px;
  height: 22px;
  background: #fff;
  color: #1a5d3a;
  font-size: 10px;
  line-height: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#raster-grid .raster-cell {
  width: var(--raster-cell, 22px);
  height: var(--raster-cell, 22px);
  font-size: var(--raster-font, 10px);
}

.raster-cell.is-stand {
  background: #cfe8d8;
}

.raster-cell.is-selected,
.raster-cell.is-marked {
  box-shadow: inset 0 0 0 3px #111111;
  z-index: 1;
}

.leaflet-overlay-pane path.lot-multi-selected {
  stroke: #111111;
  stroke-width: 5px;
  filter: drop-shadow(0 0 1px #fff);
}

.raster-cell.is-saved {
  font-weight: 600;
  color: #173024;
  text-shadow: 0 0 2px #fff;
  cursor: pointer;
}

.raster-cell.is-filtered {
  background: #e6e6e6 !important;
  color: #8d8d8d !important;
  box-shadow: inset 0 0 0 1px #cfcfcf !important;
  text-shadow: none !important;
  cursor: default;
}

#raster-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: auto;
  margin: 0;
  padding: 4px 12px;
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
}

.stand-filter-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: auto;
  margin: 0;
  gap: 0;
  font-size: 9px;
  line-height: 11px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

#raster-filter-bar select {
  width: auto;
  max-width: 11rem;
  height: 30px;
  margin: 0;
  padding: 0 8px;
}

#raster-props-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2400;
  display: flex;
  align-items: center;
  justify-content: center;
}

#raster-props-panel {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

#raster-props-panel .panel-body {
  overflow: auto;
  min-height: 0;
}

#raster-accessories-list {
  max-height: none;
}

#sidebar {
  width: 320px;
  flex-shrink: 0;
  background-color: var(--surface-muted);
  background-image: var(--sheen);
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#sidebar h1 {
  font-size: 18px;
  margin: 0 0 16px 0;
}

.subtitle {
  margin: 0 0 16px 0;
  font-size: 12px;
  color: var(--quiet);
}

/* ---------- Sidebar text menu ---------- */

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.35;
}

.sidebar-user {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.sidebar-also-active {
  white-space: normal;
}

.sidebar-user a {
  color: var(--brand);
  text-decoration: underline;
  cursor: pointer;
}

.nav-branch {
  margin: 0;
}

.nav-branch > summary {
  list-style: none;
}

.nav-branch > summary::-webkit-details-marker {
  display: none;
}

.nav-item {
  display: block;
  padding: 5px 0;
  color: var(--text);
  cursor: default;
  user-select: none;
}

.nav-item.level-0 {
  font-weight: 600;
  cursor: pointer;
}

.nav-item.level-0::before {
  content: "▸ ";
  color: var(--faint);
  font-weight: 400;
}

.nav-branch[open] > .nav-item.level-0::before,
.nav-branch[open] > summary.nav-item.level-1::before {
  content: "▾ ";
}

.nav-item.level-1,
.nav-note.level-1 {
  padding-left: 1.25rem;
}

.venue-mode {
  display: flex;
  gap: 16px;
  padding: 4px 0 6px 1.25rem;
}

.venue-mode .radio-label {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.nav-item.level-1::before {
  content: "▸ ";
  color: var(--faint);
  font-weight: 400;
}

.nav-action.level-1::before,
.nav-action.nav-leaf.level-0::before {
  content: none;
}

#event-data-section > summary.nav-item::before {
  content: "▸ ";
  color: var(--faint);
  font-weight: 400;
}

#event-data-section[open] > summary.nav-item::before {
  content: "▾ ";
}

.nav-leaf.level-0 {
  padding-top: 8px;
  padding-bottom: 8px;
}

.nav-item.level-2,
.nav-note.level-2 {
  padding-left: 2.5rem;
}

.nav-branch > summary.nav-item.level-2::before {
  content: "▸ ";
  color: var(--faint);
  font-weight: 400;
}

.nav-branch[open] > summary.nav-item.level-2::before {
  content: "▾ ";
}

.nav-item.level-3,
.nav-note.level-3 {
  padding-left: 3.75rem;
}

.nav-action {
  cursor: pointer;
  color: var(--brand);
}

.nav-action:hover {
  text-decoration: underline;
}

.nav-action:focus {
  outline: none;
  text-decoration: underline;
}

.nav-blocked {
  opacity: 0.4;
  pointer-events: none;
}

.rights-off {
  display: none !important;
}

.nav-action.active {
  color: #b8860b;
  font-weight: 600;
  text-decoration: underline;
}

.nav-action.nav-danger {
  color: var(--danger);
}

.nav-action.nav-danger:hover,
.nav-action.nav-danger:focus {
  color: var(--danger-deep);
}

.nav-note {
  display: block;
  margin: 0;
  padding-top: 5px;
  padding-bottom: 5px;
  color: var(--quiet);
  font-size: 12px;
}

#lot-new-category {
  display: block;
  width: 100%;
  margin: 2px 0 6px;
  padding: 4px 6px;
  color: var(--text);
  font-size: 13px;
}

.nav-input {
  display: block;
  width: calc(100% - 1.25rem);
  margin: 2px 0 6px;
  margin-left: 1.25rem;
  padding: 4px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  font-size: 12px;
  background-color: var(--surface);
  background-image: var(--sheen);
}

.nav-children {
  display: block;
}

#map {
  flex: 1;
}

#map-selection-bar {
  position: absolute;
  top: 1px;
  left: 46px;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.leaflet-touch #map-selection-bar {
  top: 1px;
  left: 50px;
  height: auto;
}

#map-selection-bar .stand-filter-field {
  color: #222;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff;
}

#map-selection-bar button,
#map-selection-bar select {
  height: 26px;
  width: auto;
  max-width: 8.5rem;
  margin: 0;
  padding: 0 8px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #222;
  font: 12px/24px Arial, sans-serif;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.leaflet-touch #map-selection-bar button,
.leaflet-touch #map-selection-bar select {
  height: 30px;
  font-size: 12px;
  line-height: 28px;
}

#map-selection-bar button {
  max-width: none;
}

#app.raster-open #map-selection-bar {
  display: none;
}

.leaflet-top.leaflet-right {
  top: 44px;
}

#stand-multi-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2400;
  display: flex;
  align-items: center;
  justify-content: center;
}

#stand-multi-panel {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

#stand-multi-panel .panel-body {
  overflow: auto;
}

.goto-control {
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.goto-control label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin: 0;
  white-space: nowrap;
}

.goto-control input {
  width: 16rem;
  margin: 0;
}

.goto-control button {
  margin: 0;
  white-space: nowrap;
}

button {
  cursor: pointer;
  background-color: var(--brand-fill);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 42%, rgba(0, 0, 0, 0.12) 100%);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 7px 12px;
  font-size: 13px;
}

button:hover {
  background-color: var(--brand-fill-hover);
}

button:disabled {
  background-color: var(--disabled);
  background-image: none;
  color: var(--faint);
  cursor: not-allowed;
}

button:disabled:hover {
  background-color: var(--disabled);
  background-image: none;
}

button.danger {
  background-color: var(--danger);
}

button.spaced-top {
  margin-top: 10px;
}

button.danger:hover {
  background-color: var(--danger-deep);
}

button.secondary {
  background-color: var(--secondary);
}

button.active {
  background-color: #b8860b;
  box-shadow: inset 0 0 0 2px #7a5a06;
}

button.active:hover {
  background-color: #9c7209;
}

#mode-hint {
  background: #fff6e0;
  border: 1px solid #e0c56a;
  border-radius: 4px;
  padding: 6px 8px;
  margin: 0 0 8px 0;
  color: #5c4a06;
}

input, select {
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-size: 13px;
}

.hidden {
  display: none !important;
}

#login-overlay,
#danger-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

#danger-overlay { z-index: 5200; }

#danger-overlay .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#danger-overlay .panel-header h2 { margin: 0; }

#danger-overlay .danger {
  display: block;
  width: 100%;
  margin-top: 8px;
}

html.login-remembered #login-overlay:not(.login-open) { display: none !important; }

.login-card {
  width: min(360px, 92vw);
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 6px;
  padding: 20px 22px 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.login-card h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.login-card label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}

.login-card input {
  display: block;
  width: 100%;
  margin-top: 4px;
}

.login-card button {
  margin-top: 6px;
}

#document-list-panel .overview-sheet {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#lot-list {
  margin: 0;
}

.legend {
  font-size: 12px;
  margin-bottom: 8px;
  color: var(--muted);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 3px;
  margin-left: 8px;
}
.dot:first-child { margin-left: 0; }

.lot-label {
  transform: translate(-50%, -50%);
  text-align: center;
  line-height: 1.1;
  pointer-events: none;
  white-space: nowrap;
}

.lot-label-number {
  font-weight: bold;
  color: #111;
  line-height: 1;
}

.lot-label-muted .lot-label-number {
  color: #9a9a9a;
}

path.lot-filtered-out {
  pointer-events: none !important;
  cursor: default;
}

#map-flash {
  position: absolute;
  z-index: 1000;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 70%;
  padding: 8px 14px;
  background: #fff6e0;
  border: 1px solid #e0c56a;
  border-radius: 4px;
  color: #6a5200;
  font-size: 14px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#map-flash.show {
  opacity: 1;
}

.leaflet-container.placing-cross,
.leaflet-container.placing-cross .leaflet-interactive,
.leaflet-container.placing-cross .leaflet-marker-icon {
  cursor: crosshair !important;
}

.lot-tip {
  font-size: 13px;
  line-height: 1.35;
}

.rights-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 4px 0;
}

.rights-row input[type="text"] {
  flex: 1;
}

.rights-role {
  margin: 8px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ddd;
}

.rights-functions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
}

.lot-label-shop {
  font-size: 5px;
  color: #333;
}

.dot.freigeben { background: #4caf50; }
.dot.anbieten { background: #3a7bd5; }
.dot.vermieten { background: #e0912a; }
.dot.bezahlt { background: #8b1a1a; }
.dot.einladung { background: #9c27b0; }
.dot.angenommen { background: #1a5d3a; }

.party-lot-banner {
  margin: 0 0 14px;
  padding: 8px 10px;
  background: #f4eef8;
  border: 1px solid #9c27b0;
  border-radius: 4px;
  color: #6a1b9a;
  font-weight: 600;
}

.stand-wish-link,
.stand-id-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.stand-wish-link {
  color: var(--faint);
  font-style: italic;
}

.stand-id-link {
  color: var(--text-strong);
  font-style: normal;
}

#party-lot-pick {
  position: fixed;
  inset: 0;
  z-index: 2300;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#party-lot-pick.hidden { display: none; }

.party-lot-pick-panel {
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.party-lot-pick-body { overflow: auto; padding: 0 16px 8px; }

.party-lot-pick-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.party-lot-pick-table { width: 100%; border-collapse: collapse; }

.party-lot-pick-table th,
.party-lot-pick-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.party-lot-pick-table tr.selected { background-color: var(--selected-2);
  background-image: var(--sheen); }

.party-lot-pick-table .party-lot-radio-cell {
  width: 76px;
  text-align: center;
}

.party-lot-pick-table .party-lot-radio {
  width: auto;
  margin: 0;
  accent-color: var(--brand);
}

.party-lot-pick-table .lot-id-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

.lot-color-mark {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border: 3px solid var(--text-mid);
  border-radius: 2px;
  vertical-align: -3px;
  box-sizing: border-box;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.lot-border-white {
  filter: drop-shadow(0 0 1px #222);
}

.lot-color-mark-white {
  box-shadow: 0 0 0 1px #222;
}

.lot-category-value {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lot-category-value select {
  flex: 1;
  min-width: 0;
}

.map-legend {
  position: relative;
  width: max-content;
  max-width: none;
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  padding: 4px 22px 6px 8px;
  overflow: visible;
  font-size: 11px;
  color: var(--text);
  line-height: 1.15;
  box-sizing: border-box;
}

.map-legend-close {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  background-image: none;
  color: var(--text);
  font-size: 14px;
  line-height: 16px;
}

.map-legend.is-hidden {
  display: none;
}

.map-legend-toggle {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.map-legend.is-collapsed .map-legend-body {
  display: none;
}

.leaflet-top.leaflet-left .map-legend {
  margin-top: 16px !important;
}

.map-legend .lot-color-mark {
  width: 12px;
  height: 12px;
  margin-right: 0;
  border-width: 2px;
}

.map-legend-title {
  font-weight: 700;
  margin: 4px 0 2px;
}

.map-legend-title:first-child {
  margin-top: 0;
}

.map-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.map-legend .legend-border {
  background-color: var(--surface);
  background-image: var(--sheen);
}

.price-class-swatch {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.vendor-logo-preview {
  max-width: 180px;
  max-height: 72px;
  margin-top: 6px;
  object-fit: contain;
}

.vendor-logo-preview.hidden {
  display: none;
}

#offer-busy {
  position: fixed;
  left: 50%;
  bottom: 56px;
  transform: translateX(-50%);
  z-index: 4000;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 999px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  padding: 8px 14px;
  pointer-events: none;
  font-size: 14px;
}

.offer-hourglass {
  display: inline-block;
  animation: hourglass-spin 1.2s linear infinite;
}

@keyframes hourglass-spin {
  to { transform: rotate(360deg); }
}

#lot-panel, #split-panel, #import-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 280px;
  background-color: var(--surface);
  background-image: var(--sheen);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 1000;
}

#split-panel {
  width: 460px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}

#split-panel .panel-body {
  overflow: auto;
}

#lot-panel {
  width: 460px;
  height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1600;
}

#lot-panel .panel-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

#lot-panel .accessories-fieldset:has(#lot-accessories-list) {
  flex: 1 1 auto;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#lot-accessories-list {
  flex: 1 1 auto;
  min-height: 160px;
  max-height: none;
  overflow-y: auto;
}

.basis-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 8px;
}

.basis-size {
  align-items: start;
}

.basis-size > .basis-name,
.basis-size > .basis-measure > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.basis-size input.num-entry,
.basis-size .basis-bereich input {
  height: 36px;
  min-height: 36px;
  box-sizing: border-box;
}

.basis-row > label,
.basis-row > .basis-fact,
.basis-row > .basis-measure {
  flex: 1;
  min-width: 0;
}

.basis-size.with-bereich > .basis-name,
.basis-size.with-bereich > .basis-measure {
  flex: 0.72 1 0;
}

.basis-size.with-bereich > .basis-bereich {
  flex: 1.2 1 0;
}

.basis-row > label.basis-category {
  flex: 2 1 0;
}

.basis-row > label.basis-price {
  flex: 1 1 0;
}

.basis-fact {
  font-size: 13px;
  color: var(--text-mid);
  padding-bottom: 8px;
}

.basis-status-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 0;
  font-size: 13px;
  color: var(--text);
}

.basis-measure {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.basis-under {
  font-size: 12px;
  color: var(--text-mid);
  font-weight: 400;
}

.basis-hut-check {
  justify-self: start;
  white-space: nowrap;
}

.basis-hut-choice {
  min-width: 11rem;
}

.basis-status-row {
  grid-template-columns: auto auto 1fr auto;
}

.lot-status-readout {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: center;
}

#lot-basis-save {
  justify-self: end;
  width: auto;
  margin: 0;
}

.content-choice {
  border: 1px solid var(--border-cool);
  border-radius: 6px;
  margin: 0 0 8px;
  padding: 8px 10px 10px;
}

.content-choice legend {
  padding: 0 4px;
  font-size: 13px;
}

.assign-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 0;
}

.assign-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.assign-options input {
  width: auto;
  margin: 0;
  padding: 0;
}

#lot-panel .panel-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

#lot-panel .panel-actions button {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 6px;
  padding-right: 6px;
}

#assign-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
}

#assign-panel.lot-picking {
  z-index: 2550;
}

.lot-pick-column,
.lot-pick-cell {
  width: 76px;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

.lot-pick-radio {
  width: auto;
  margin: 0;
  accent-color: var(--brand);
}

#lot-list tr.lot-pick-selected td {
  background-color: var(--highlight);
  background-image: var(--sheen);
}

#assign-panel-card {
  width: 94vw;
  height: 90vh;
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

#assign-panel-card .panel-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#assign-panel-card .table-scroll {
  flex: 1;
  overflow: auto;
}

.lot-list-table td {
  vertical-align: top;
}

.lot-doc-link {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}

.lot-doc-link:hover {
  background: transparent;
  color: var(--brand-ink);
}

.lot-list-table .lot-status-cell {
  white-space: nowrap;
}

.lot-list-link {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.lot-list-link:hover {
  background: transparent;
  color: var(--brand-ink);
}

.lot-list-link-text {
  text-decoration: underline;
}

.lot-list-table .dot {
  margin-left: 0;
  margin-right: 6px;
}

.lot-list-row {
  cursor: default;
}

#lot-map-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2400;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lot-map-card {
  width: 94vw;
  height: 90vh;
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#lot-map {
  flex: 1;
  min-height: 0;
}

#lot-map.lot-map-raster {
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  overflow: auto;
  background: #eef1ef;
  padding: 8px;
}

#lot-map .raster-grid-preview {
  position: relative;
  display: grid;
  gap: 1px;
  width: max-content;
  height: max-content;
  margin: auto;
  padding: 72px 8px 8px;
  background: #d5dbd7;
  pointer-events: none;
}

.stand-pin {
  width: 36px;
  height: 72px;
  line-height: 0;
  pointer-events: none;
}

#lot-map .raster-grid-preview > .stand-pin {
  position: absolute;
  z-index: 4;
}

.stand-pin svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.leaflet-div-icon.stand-pin-marker {
  background: transparent;
  border: none;
  overflow: visible;
  width: 36px;
  height: 72px;
}

.leaflet-div-icon.stand-pin-marker .stand-pin {
  position: static;
  transform: none;
}

.lot-list-row:hover td {
  background: #eef4ee;
}

.lot-shop-open {
  width: 100%;
  text-align: left;
  background-color: var(--surface);
  background-image: var(--sheen);
  color: var(--text-strong);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 6px 8px;
  font: inherit;
  cursor: pointer;
}

.lot-shop-open:hover {
  background: #f4f7f5;
  color: var(--text-strong);
}

#import-panel {
  top: auto;
  left: 336px;
  right: 16px;
  bottom: 16px;
  width: auto;
  max-height: 34vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#import-panel.hidden {
  display: none !important;
}

#import-panel .panel-header {
  flex-shrink: 0;
  padding: 6px 10px;
}

#import-panel .panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px;
}

#import-panel .panel-body label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

#import-panel .panel-actions {
  flex-shrink: 0;
  margin: 0;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}

#import-panel input[type="range"] {
  width: 100%;
}

#import-temp-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

#import-temp-list button,
#import-panel .panel-body > button {
  margin: 0 6px 8px 0;
}

.import-note {
  margin: 0 0 8px 0;
  font-size: 12px;
  color: var(--muted);
}

.plan-import-draggable,
.plan-import-handle {
  cursor: move !important;
}

.leaflet-container.plan-import-moving,
.leaflet-container.plan-import-moving.leaflet-grab,
.leaflet-container.plan-import-moving.leaflet-dragging {
  cursor: move !important;
}

.plan-import-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background-color: var(--surface);
  background-image: var(--sheen);
  border: 2px solid var(--brand);
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  font-size: 22px;
  line-height: 1;
  color: var(--brand);
}

.hint {
  font-size: 12px;
  color: var(--quiet);
  margin-top: 0;
}

#cash-hint.cash-over {
  font-size: 18px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 4px;
}

.radio-label input[type="radio"],
.radio-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.panel-header h3 {
  margin: 0;
  font-size: 14px;
}

#dashboard-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-header button {
  background: none;
  color: var(--faint);
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}

.panel-header button.list-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0 2px;
  padding: 0;
  background: transparent;
  color: var(--icon);
  border: none;
  border-radius: 50%;
  font-size: 0;
  line-height: 0;
}

.panel-header button.list-refresh svg {
  display: block;
}

.panel-header button.list-refresh:hover {
  background-color: var(--icon-hover);
  color: var(--icon-hover-ink);
}

.panel-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

#free-invoice-open.header-action,
#free-offer-open.header-action {
  background: var(--brand-fill);
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
}

#free-invoice-open.header-action:hover,
#free-offer-open.header-action:hover,
#free-invoice-create:hover {
  background: var(--brand-fill-hover);
}

#free-invoice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2400;
  display: flex;
  align-items: center;
  justify-content: center;
}

#free-invoice-panel.free-invoice-wide {
  width: min(1200px, 96vw);
}

#free-invoice-panel {
  width: min(980px, 96vw);
  max-width: 96vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.free-invoice-body {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}

#free-invoice-add {
  display: inline-block;
  margin: 8px 0 4px;
  position: relative;
  z-index: 1;
}

#free-invoice-lines .free-line-qty,
#free-invoice-lines .free-line-price {
  width: 4.5rem;
  height: 26px;
  margin: 0;
  padding: 2px 4px;
  box-sizing: border-box;
}

#free-invoice-offers {
  margin-bottom: 12px;
}

#free-invoice-offers h4 {
  margin: 0 0 6px;
}

.free-invoice-buyer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.free-invoice-buyer label {
  flex: 0 0 auto;
  margin: 0;
}

.free-invoice-buyer select {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
}

.free-invoice-buyer button {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

#party-details-overlay.stack-top {
  z-index: 2500;
}

#party-lot-pick.stack-top {
  z-index: 2600;
}

#lot-map-overlay.stack-top {
  z-index: 2700;
}

.free-invoice-discount {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 12px 0 4px 4px;
}

.discount-block-title {
  font-size: 13px;
  line-height: 1.2;
  color: var(--text);
}

#free-invoice-overlay .document-totals td:first-child {
  padding-left: 4px;
}

#free-invoice-overlay .document-totals tr.discount-row td {
  padding-left: 0;
}

#free-invoice-overlay .document-totals tr.discount-row td:first-child {
  padding-left: 4px;
}

.free-invoice-actions {
  margin-top: 12px;
  text-align: right;
}

#free-invoice-create {
  background: var(--brand-fill);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 14px;
}

.panel-body {
  padding: 12px;
}

.panel-body label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.panel-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.panel-actions button,
.panel-actions a#document-ok-btn {
  flex: 1;
}

a#document-ok-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  background: var(--brand-fill);
  color: white;
  border-radius: 4px;
  padding: 7px 12px;
  font-size: 13px;
}

a#document-ok-btn:hover {
  background: var(--brand-fill-hover);
}

.accessories-fieldset {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
  margin: 0 0 8px 0;
}

.accessories-fieldset legend {
  font-size: 12px;
  color: var(--muted);
  padding: 0 4px;
}

.accessories-list {
  max-height: 140px;
  overflow-y: auto;
}

.accessory-option {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--text-mid);
  margin-bottom: 4px;
  cursor: pointer;
}

.accessory-option input {
  width: auto;
  margin: 2px 0 0 0;
}

.accessory-option input.num-entry,
.accessory-option input[type="number"] {
  width: 64px;
  flex: 0 0 64px;
  margin: 0;
  padding: 3px 6px;
}

#party-accessories,
#extra-accessories {
  max-height: none;
}

#party-details-panel .bewerbung-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#party-details-form {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

#party-details-form .form-panel[data-panel="accessories"]:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#party-details-form .form-panel[data-panel="accessories"] .accessories-fieldset {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#party-details-panel #party-accessories {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.accessories-subgroup {
  border: 1px solid #e4e4e4;
  border-radius: 4px;
  margin: 4px 0 8px;
  padding: 4px 8px 2px;
}

.accessories-subgroup legend {
  font-size: 12px;
  font-weight: 600;
  padding: 0 4px;
}

#extra-accessories .accessory-option input.num-entry,
#extra-accessories .accessory-option input[type="number"] {
  width: 64px;
}

.stand-fact {
  margin: 0 0 12px;
}

.stand-fact-label {
  font-size: 13px;
  color: var(--muted);
}

.stand-fact-value {
  margin-top: 2px;
  font-size: 15px;
  color: var(--text);
}

#stand-pick-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2300;
  display: flex;
  align-items: center;
  justify-content: center;
}

#stand-pick-panel {
  width: min(420px, calc(100vw - 32px));
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.stand-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.stand-pick-list button {
  text-align: left;
}

.stand-context {
  margin: 0 0 4px;
  color: var(--muted-2);
  font-size: 12px;
}

#document-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
}

#document-panel {
  width: min(980px, 96vw);
  max-width: 96vw;
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

#document-panel > .panel-header,
#document-panel .panel-actions {
  flex: 0 0 auto;
}

#document-panel .panel-actions {
  flex-wrap: wrap;
}

#document-panel > .panel-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#document-panel #document-sheet {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#document-panel .document-scroll {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 72px;
}

#document-panel .document-lines {
  flex: 0 0 auto;
  max-height: 46%;
  overflow: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background-color: var(--surface);
  background-image: var(--sheen);
}

#document-panel .document-summary {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid var(--line-2);
  padding-top: 8px;
  background-color: var(--surface);
  background-image: var(--sheen);
}

.document-section {
  margin-bottom: 14px;
}

.document-section h4 {
  margin: 0 0 6px 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.document-details {
  margin: 0 0 4px 0;
}

.document-details dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--quiet);
  margin-top: 6px;
}

.document-details dt:first-child {
  margin-top: 0;
}

.document-details dd {
  margin: 2px 0 0 0;
  font-size: 13px;
  color: var(--text);
}

.document-line-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.document-line-table th,
.document-line-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px 4px;
  text-align: left;
  vertical-align: bottom;
}

.document-line-table th:nth-child(2),
.document-line-table th:nth-child(3),
.document-line-table th:nth-child(4),
.document-line-table td:nth-child(2),
.document-line-table td:nth-child(3),
.document-line-table td:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

.document-line-table {
  table-layout: fixed;
}

#free-invoice-lines .col-desc { width: 26%; }
#free-invoice-lines .col-discount { width: 42%; }
#free-invoice-lines .col-qty,
#free-invoice-lines .col-price { width: 13%; }
#free-invoice-lines .col-remove { width: 6%; }

.document-line-table th.line-discount-head,
.document-line-table td.line-discount {
  text-align: left;
  white-space: normal;
}

.document-line-table input.num-entry,
.document-line-table input[type="number"] {
  width: 72px;
  margin: 0;
  padding: 3px 4px;
  text-align: right;
}

.document-line-table input.line-total {
  width: 100%;
}

.document-total {
  margin: 10px 0 0 0;
  text-align: right;
  font-size: 13px;
}

/* ---------- Anbieterliste / Bewerberliste overlays ---------- */

#shop-table-overlay,
#shop-history-overlay,
#applicant-table-overlay,
#applicant-pick-overlay,
#document-list-overlay,
#document-details-overlay,
#event-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#shop-table-panel,
#shop-history-panel,
#applicant-table-panel,
#applicant-pick-panel,
#document-list-panel,
#document-details-panel,
#event-picker-panel {
  width: 90vw;
  height: 90vh;
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

#applicant-pick-panel,
#event-picker-panel {
  height: auto;
  max-height: 80vh;
}

#shop-table-panel .panel-body,
#shop-history-panel .panel-body,
#applicant-table-panel .panel-body,
#applicant-pick-panel .panel-body,
#document-list-panel .panel-body,
#document-details-panel .panel-body,
#event-picker-panel .panel-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#btn-add-applicant,
#event-create {
  width: auto;
  margin-bottom: 12px;
}

.shop-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.shop-toolbar button {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  background-color: var(--secondary);
}

.shop-toolbar button:hover {
  background-color: var(--secondary-hover);
}

.shop-match-bar {
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
}

.shop-match-bar button {
  width: auto;
  margin: 0;
}

#shop-match-overlay {
  position: fixed;
  inset: 0;
  z-index: 2800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
}

#shop-match-panel {
  width: min(480px, 92vw);
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

#shop-match-panel .panel-body label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0;
}

#shop-match-panel .panel-body input {
  width: auto;
  margin: 2px 0 0;
}

.leaflet-container.boundary-moving,
.leaflet-container.boundary-moving.leaflet-grab,
.leaflet-container.boundary-moving.leaflet-dragging {
  cursor: crosshair !important;
}

.leaflet-marker-icon.marker-icon {
  width: 36px !important;
  height: 36px !important;
  margin: -18px 0 0 -18px !important;
  background: transparent !important;
  border: none !important;
  opacity: 1 !important;
  cursor: crosshair !important;
}

.leaflet-marker-icon.marker-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  box-sizing: border-box;
  background-color: var(--surface);
  background-image: var(--sheen);
  border: 2px solid var(--brand);
  pointer-events: none;
}

.leaflet-marker-icon.marker-icon-middle::after {
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: var(--brand-fill);
  border-radius: 50%;
}

#btn-shop-invitations {
  margin-left: auto;
}

#event-picker-panel {
  width: min(720px, calc(100vw - 32px));
}

.event-actions {
  white-space: nowrap;
}

.event-actions button {
  width: auto;
  margin: 0 4px 0 0;
}

.event-row-current {
  background-color: var(--selected);
  background-image: var(--sheen);
}

#events-table tr.event-row-selected td {
  box-shadow: inset 0 -2px 0 var(--brand);
}

#events-panel .bewerbung-main {
  display: flex;
  flex-direction: column;
}

#events-panel .form-panel[data-panel="edit"]:not(.hidden) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

#events-panel h2 {
  margin: 0 0 12px 0;
}

#event-create,
#event-close,
#event-archive,
#event-delete {
  width: auto;
  margin-bottom: 12px;
}

#events-table select {
  max-width: none;
  min-width: 7.5rem;
  width: auto;
}

#events-table td.event-actions {
  white-space: nowrap;
}

#events-table .event-actions button {
  width: auto;
  background: transparent;
  color: var(--text);
  padding: 0;
  font-weight: 600;
  white-space: nowrap;
}

#events-table .event-actions button.event-chosen {
  color: var(--brand);
}

#events-table .event-actions button:hover {
  background: transparent;
  text-decoration: underline;
}

#events-panel .event-create-actions {
  align-items: stretch;
}

#events-panel .event-create-actions button {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  height: auto;
  min-height: 36px;
  margin: 0;
}

#events-panel .event-series-action {
  display: flex;
  flex: 1 1 0;
  flex-direction: row;
  gap: 6px;
  min-width: 0;
  align-items: stretch;
}

#events-panel .event-series-action.event-series-pick {
  flex: 1.6 1 0;
}

#events-panel .event-series-action select {
  flex: 1 1 7.5rem;
  width: auto;
  max-width: none;
  min-width: 7.5rem;
  height: auto;
  min-height: 36px;
  margin: 0;
}

#events-panel .event-create-actions .event-series-action button {
  flex: 1 1 auto;
  width: auto;
  white-space: nowrap;
}

#events-panel .event-create-actions .event-series-action.event-series-pick button {
  flex: 0 0 auto;
}

#events-panel .events-ok-bar {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
}

#events-table .events-pick-column,
#events-table td.event-pick-cell {
  width: 76px;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

#events-table .event-pick-radio {
  width: auto;
  margin: 0;
  accent-color: var(--brand);
}

#events-panel .events-ok-bar button {
  width: auto;
  min-width: 8rem;
}

#events-panel.event-pick-mode .bewerbung-nav,
#events-panel.event-pick-mode #events-edit-title {
  display: none;
}

#accounting-panel .menu-sub {
  padding-left: 22px;
  font-size: 13px;
}

.table-scroll {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--line-3);
  border-radius: 4px;
}

.party-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.party-table th, .party-table td,
#applicant-pick-table th, #applicant-pick-table td {
  border-bottom: 1px solid var(--line);
  padding: 4px 6px;
  text-align: left;
}

.party-table .name-col,
.party-table td.name-cell {
  width: 28%;
  min-width: 240px;
}

.party-table td.name-cell input {
  width: 100%;
  min-width: 220px;
}

.party-table select,
.party-table td:nth-child(4) input,
#shop-table td.product-cell input {
  max-width: 180px;
}

#shop-table tr.shop-group:not(.shop-group-last) > td:not([rowspan]) {
  border-bottom-color: transparent;
}

.shop-name-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.shop-name-link:hover {
  text-decoration: underline;
}

#invoice-overview-table .shop-name-link {
  text-decoration: underline;
}

.shop-fold {
  width: 22px;
  height: 22px;
  margin-right: 6px;
  padding: 0;
  border: 1px solid var(--brand);
  border-radius: 3px;
  background-color: var(--surface);
  background-image: var(--sheen);
  color: var(--brand);
  font-weight: 700;
  line-height: 20px;
  vertical-align: middle;
}

#shop-table tr.shop-folded > td.lot-label-cell,
#shop-table tr.shop-folded > td.shop-fold-mid,
#shop-table tr.shop-folded > td.shop-status-cell {
  border-top: 1px solid var(--brand);
  border-bottom: 1px solid var(--brand);
  background-color: var(--row-fold);
  background-image: var(--sheen);
}

#shop-table tr.shop-folded > td.lot-label-cell {
  border-left: 1px solid var(--brand);
  white-space: normal;
}

#shop-table tr.shop-folded > td.shop-status-cell {
  border-right: 1px solid var(--brand);
}

#shop-table td.lot-label-cell {
  white-space: nowrap;
}

#applicant-table td:nth-child(7) {
  min-width: 9rem;
  white-space: nowrap;
}

.party-table th,
#applicant-pick-table th {
  position: relative;
}

.col-resize {
  position: absolute;
  top: 0;
  right: -3px;
  z-index: 4;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.col-resize:hover,
table.col-resizing .col-resize {
  background: rgba(26, 93, 58, 0.35);
}

.party-table th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.changed-at-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.changed-at-col {
  white-space: normal;
  line-height: 1.15;
  text-align: center;
  min-width: 5.6rem;
}

#shop-table th.changed-at-col {
  text-transform: none;
  letter-spacing: 0;
}

#lot-list th.category-col,
#lot-list td.category-cell,
#document-list-table th.category-col,
#document-list-table td.category-cell {
  width: 9.5rem;
  min-width: 9.5rem;
  max-width: 11rem;
  white-space: normal;
  line-height: 1.15;
}

#lot-list th.bereich-col,
#lot-list td.bereich-cell,
#shop-table th.bereich-col,
#shop-table td.bereich-cell,
#document-list-table th.bereich-col,
#document-list-table td.bereich-cell {
  width: 5.5rem;
  min-width: 5.5rem;
  max-width: 8rem;
  white-space: normal;
}

#document-list-table th.buyer-col,
#document-list-table td.buyer-cell {
  width: 8rem;
  min-width: 8rem;
  max-width: 9.5rem;
  white-space: normal;
  line-height: 1.15;
}

#document-list-table th {
  vertical-align: top;
}

#lot-list th.tenant-col,
#lot-list td.tenant-cell {
  width: 4.2rem;
  max-width: 4.8rem;
  min-width: 0;
  white-space: normal;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.party-table th[data-sort]::after {
  content: " ↕";
  color: var(--border-soft);
}

.party-table th[data-sort]:hover {
  background-color: var(--table-hover);
  background-image: var(--sheen);
  color: var(--text);
}

.status-col {
  position: relative;
  white-space: nowrap;
}

.status-funnel {
  margin-left: 4px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  vertical-align: middle;
}

.status-funnel.active {
  color: var(--brand);
}

.status-funnel:hover,
.status-funnel.active:hover {
  background: transparent;
  color: var(--brand);
}

.status-filter {
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  z-index: 6;
  min-width: 150px;
  padding: 8px 10px;
  background-color: var(--surface);
  background-image: var(--sheen);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: normal;
  color: var(--text);
  text-align: left;
}

.status-filter label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
  cursor: pointer;
}

.status-filter input {
  width: auto;
  margin: 0;
}

.party-details-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.party-details-actions button {
  width: auto;
}

.party-table th.sort-asc::after {
  content: " ▲";
  color: var(--brand);
}

.party-table th.sort-desc::after {
  content: " ▼";
  color: var(--brand);
}

.party-table td.money-cell,
.party-table td.count-cell,
.party-table td.rating-cell {
  text-align: right;
  white-space: nowrap;
}

.history-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.history-filter-group,
.invite-template-pick {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px 10px;
  background-color: var(--surface-muted);
  background-image: var(--sheen);
}

.history-filter-group {
  flex: 0 1 auto;
}

.invite-template-pick {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 14rem;
}

.history-filter-parts {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px 20px;
  align-items: flex-start;
}

.history-filter-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.history-filter-field {
  flex: 0 0 auto;
  min-width: 15rem;
}

.history-filter-field > span {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.history-check-list {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
  background-color: var(--surface);
  background-image: var(--sheen);
}

.history-table .name-col,
.history-table td.history-name {
  width: 9rem;
  min-width: 7rem;
  max-width: 11rem;
}

.history-check-list label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 3px 0;
  font-size: 13px;
  color: var(--text);
}

.history-check-list input {
  width: auto;
  margin: 0;
}

#shop-table th,
#applicant-table th,
#document-list-table th,
#applicant-pick-table th {
  background-color: var(--table-head);
  background-image: var(--sheen);
  position: sticky;
  top: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.party-table td.id-cell {
  color: var(--faint);
  white-space: nowrap;
}

#shop-table td.id-cell,
#applicant-table td.id-cell {
  width: 48px;
}

.party-table input, .party-table select {
  margin-bottom: 0;
  border: 1px solid transparent;
  background: transparent;
  padding: 5px 6px;
}

.party-table input:hover, .party-table select:hover,
.party-table input:focus, .party-table select:focus {
  border-color: var(--border-strong);
  background-color: var(--surface);
  background-image: var(--sheen);
}

.details-cell {
  cursor: pointer;
  color: var(--brand);
  white-space: nowrap;
}

.details-cell:hover {
  text-decoration: underline;
}

.details-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-fill);
  margin-left: 5px;
}

.shop-row-delete-btn {
  background: none;
  color: var(--danger);
  padding: 2px 6px;
  font-size: 14px;
}

.party-reject-btn {
  background: none;
  color: var(--danger);
  padding: 2px 0;
  font-size: 12px;
  white-space: nowrap;
}

.party-reject-btn:hover {
  background: none;
  color: var(--danger-deep);
  text-decoration: underline;
}

.party-reject-btn:disabled,
.party-reject-btn:disabled:hover {
  background: none;
  color: var(--border-soft);
  text-decoration: none;
  cursor: not-allowed;
}

#shop-table tr.row-just-added td {
  background-color: var(--row-new);
  background-image: var(--sheen);
}

#shop-table tr.shop-pick-selected td {
  background-color: var(--highlight);
  background-image: var(--sheen);
}

#shop-table .shop-pick-column,
#shop-table td.shop-pick-cell {
  width: 76px;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

#shop-table .shop-pick-radio {
  width: auto;
  margin: 0;
  accent-color: var(--brand);
}

#shop-table.shop-picking input[data-field="notes"] {
  max-width: none;
}

.shop-pick-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  padding: 12px;
  border-top: 1px solid var(--line-3);
  background-color: var(--surface);
  background-image: var(--sheen);
}

#shop-pick-ok {
  width: auto;
  min-width: 88px;
}

#shop-table tr.party-struck td,
#shop-table tr.party-struck input,
#shop-table tr.party-struck select {
  color: var(--text-strong);
  text-decoration: line-through;
}

#shop-table tr.party-struck button,
#shop-table tr.party-struck .details-cell {
  text-decoration: none;
}

#shop-table tr.party-struck .shop-name-link {
  text-decoration: line-through;
}

.history-table .select-cell {
  width: 1%;
  white-space: nowrap;
  text-align: center;
}

.history-table tr.history-blocked td {
  text-decoration: line-through;
  color: var(--muted-2);
}

.history-table tr.history-blocked .select-cell,
.history-table tr.history-blocked .history-block-btn {
  text-decoration: none;
}

.history-block-btn {
  background: none;
  border: none;
  color: var(--danger-deep);
  font: inherit;
  cursor: pointer;
  padding: 0 4px;
}

#applicant-table tr.applicant-promoted td,
#applicant-table tr.applicant-promoted input,
#applicant-table tr.applicant-promoted select {
  color: var(--brand);
}

#applicant-table tr.applicant-rejected td,
#applicant-table tr.applicant-rejected input,
#applicant-table tr.applicant-rejected select {
  color: var(--text-strong);
  text-decoration: line-through;
}

#applicant-table tr.applicant-rejected button,
#applicant-table tr.applicant-rejected .details-cell {
  text-decoration: none;
}

#party-details-overlay,
#accounting-overlay,
#payments-overlay,
#dunning-overlay,
#invitation-overlay,
#events-overlay {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  padding: 24px;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2100;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

#events-overlay {
  z-index: 2160;
  left: 320px;
}

.submenu-frame {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.submenu-frame .bewerbung-window {
  flex: 1;
  min-height: 0;
  height: auto;
}

.submenu-frame .bewerbung-nav {
  width: 220px;
  padding: 12px;
}

#accounting-panel.solo .bewerbung-nav {
  display: none;
}

.submenu-frame .bewerbung-main {
  min-width: 0;
  min-height: 0;
  padding: 16px 20px 16px;
}

#payments-panel .bewerbung-main,
#dunning-panel .bewerbung-main,
#invitation-panel .bewerbung-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#dunning-panel .bewerbung-nav,
#invitation-panel .bewerbung-nav {
  width: 280px;
}

#invitation-panel > .panel-header {
  justify-content: flex-end;
}

#invite-sent-table .invite-status {
  display: inline-block;
  vertical-align: top;
}

#invitation-panel .overview-sheet > h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

#invitation-panel .overview-sheet > .hint {
  margin: 0 0 6px;
}

#invitation-panel .payment-sheet-body.overview-sheet {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#invitation-panel .overview-sheet > h2,
#invitation-panel .overview-sheet > .hint,
#invitation-panel .history-filter {
  flex-shrink: 0;
}

#invitation-panel .invite-filter-pair {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  align-items: flex-start;
}

#invitation-panel .invite-filter-pair .history-filter-field {
  min-width: 11rem;
}

#invitation-panel .overview-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#invitation-panel .history-filter-field > span {
  cursor: pointer;
}

#invitation-panel .history-filter-field > span::after {
  content: " ▸";
  color: var(--brand);
}

#invitation-panel .history-filter-field.is-open > span::after {
  content: " ▾";
}

#invitation-panel .history-filter-field:not(.is-open) .history-check-list,
#invitation-panel .invite-template-pick:not(.is-open) .history-check-list {
  max-height: 28px;
  overflow: hidden;
  cursor: pointer;
}

#invitation-panel .invite-template-pick > .history-filter-label {
  cursor: pointer;
}

#invitation-panel .invite-template-pick > .history-filter-label::after {
  content: " ▸";
  color: var(--brand);
  font-weight: 400;
}

#invitation-panel .invite-template-pick.is-open > .history-filter-label::after {
  content: " ▾";
}

#dunning-panel .menu-item,
#invitation-panel .menu-item {
  white-space: normal;
  line-height: 1.35;
}

#payments-panel .payment-sheet,
#dunning-panel .payment-sheet,
#invitation-panel .payment-sheet {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.payment-sheet-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.payment-sheet-actions {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
}

.payment-sheet-actions .hint,
.payment-sheet-actions .invite-selection-summary {
  margin: 0;
  margin-right: auto;
}

.cash-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 8px 0 12px;
}

.cash-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  flex: 1;
}

.cash-invoice-choice {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cash-invoice-choice select {
  flex: 1;
  min-width: 0;
}

.cash-total {
  margin: 0 0 8px;
  font-weight: 600;
}

.cash-dues {
  margin: 0 0 12px;
  padding-left: 18px;
}

.invite-selection-summary {
  color: var(--text);
  font-size: 14px;
}

.turnover-role-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.import-select-links {
  display: block;
  margin-top: 2px;
}

.import-select-link {
  background: none;
  color: var(--brand);
  padding: 0 3px;
  font-size: 12px;
  font-weight: 600;
}

.import-select-link:hover {
  background: none;
  color: var(--brand-ink);
  text-decoration: underline;
}

#import-table input[type="text"],
#import-table select.import-id {
  width: 16rem;
  padding: 4px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font: inherit;
}

.import-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.import-files-wrap {
  min-height: 140px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line-3);
  border-radius: 6px;
}

.import-top .turnover-drop {
  height: 100%;
  margin: 0;
}

.import-summary {
  margin: 10px 0 0;
  font-weight: 600;
}

#date-filter input[type="date"] {
  display: block;
  width: 11rem;
  margin-top: 4px;
}

.payment-overview th,
.payment-overview td {
  vertical-align: top;
}

.payment-overview .select-cell {
  text-align: center;
  white-space: normal;
}

.dunning-editor {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.dunning-template-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#dunning-template-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dunning-template-pick {
  text-align: left;
  background-color: var(--surface);
  background-image: var(--sheen);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.dunning-template-pick.active,
.dunning-template-pick:hover,
.dunning-token-remove:hover {
  border-color: var(--brand);
  background-color: var(--selected);
  background-image: var(--sheen);
  color: var(--brand);
}

.invite-field-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
}

.invite-field-list textarea,
.invite-field-list input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

.invite-field-bulk {
  display: flex;
  gap: 8px;
}

.invite-field-caption {
  margin: 8px 0 0;
  font-weight: 600;
}

#invite-template-editor .invite-price-choices,
#default-invite-editor .invite-price-choices {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-left: 36px;
}

#invite-template-editor .invite-price-choices .invite-field-check,
#default-invite-editor .invite-price-choices .invite-field-check {
  margin-left: 0;
  white-space: nowrap;
}

.bewerbung-form .invite-field-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  color: var(--text);
  font-size: 14px;
}

.bewerbung-form .invite-field-check input {
  width: auto;
  margin: 0;
}

.invite-field-check {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dunning-body {
  width: 100%;
  min-height: 8.2em;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background-color: var(--surface);
  background-image: var(--sheen);
  line-height: 1.5;
  white-space: pre-wrap;
}

.dunning-field-groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.dunning-field-groups div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.dunning-field-groups span {
  min-width: 9rem;
  font-weight: 600;
}

.dunning-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.dunning-token {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 2px;
  padding: 0 4px;
  background-color: var(--selected);
  background-image: var(--sheen);
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 4px;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
}

.dunning-token-remove {
  margin: 0;
  padding: 0 2px;
  background: transparent;
  color: var(--brand);
  font-size: 14px;
  line-height: 1;
}

.payment-overview select.dunning-template-choice {
  max-width: 14rem;
  padding: 4px 6px;
}

.payment-overview .dunning-stack {
  white-space: pre-line;
}

.payment-overview a.dunning-pdf-link,
a.document-pdf-link {
  color: var(--brand);
  font-weight: 600;
}

.payment-overview .due-label {
  font-weight: 600;
}

.payment-overview tr.overview-follow td {
  border-top: 0;
}

.turnover-drop {
  border: 2px dashed var(--brand);
  border-radius: 6px;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  background-color: var(--drop);
  background-image: var(--sheen);
  text-align: center;
  box-sizing: border-box;
}

.config-top {
  display: grid;
  grid-template-columns: 3fr 1fr;
  grid-template-rows: minmax(160px, 220px);
  gap: 16px;
  align-items: stretch;
}

.config-drop-stack {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-drop-stack .turnover-drop {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  padding-top: 8px;
  padding-bottom: 8px;
}

.config-drop-stack .turnover-filename {
  margin: 0;
  min-height: 1.25em;
  line-height: 1.25em;
  flex: 0 0 auto;
}

.config-file-pane {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-3);
  border-radius: 4px;
  background: var(--surface);
}

.config-role-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.config-role-row .turnover-field {
  margin-bottom: 0;
}

.extra-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 8px;
}

.extra-columns label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.turnover-drop p {
  margin: 0;
}

.turnover-drop.dragover {
  background-color: var(--selected-3);
  background-image: var(--sheen);
  border-color: var(--brand-ink);
}

.turnover-filename {
  margin: 14px 0 8px;
  font-weight: 600;
}

#turnover-result h3 {
  margin: 16px 0 8px;
  font-size: 14px;
}

.turnover-lines {
  position: relative;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: auto;
  border: 1px solid var(--line-3);
  border-radius: 4px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  margin: 0;
}

.turnover-line {
  display: flex;
  gap: 8px;
  padding: 3px 6px;
  cursor: pointer;
  white-space: pre;
}

.turnover-line:hover {
  background: #f3f7f4;
}

.turnover-line.selected {
  background-color: var(--selected-3);
  background-image: var(--sheen);
  font-weight: 600;
}

.turnover-line-no {
  color: var(--faint);
  width: 2.6em;
  flex-shrink: 0;
  text-align: right;
}

.turnover-field {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.turnover-field input,
.turnover-field select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background-color: var(--surface);
  background-image: var(--sheen);
  color: var(--text);
}

.payment-sheet-body.overview-sheet {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.overview-sheet > :not(.overview-table-scroll) {
  flex-shrink: 0;
}

.overview-table-scroll {
  flex: 1;
  min-height: 0;
}

.turnover-table-scroll {
  max-height: 280px;
  flex: none;
}

#turnover-result {
  position: relative;
}

#turnover-table th,
#turnover-table td {
  white-space: nowrap;
}

#turnover-filter,
#import-filter,
#overview-filter,
#invoice-overview-filter,
#dunning-filter,
#history-column-filter,
#lot-list-filter,
#shop-column-filter {
  position: fixed;
  z-index: 30;
  min-width: 220px;
  max-height: 280px;
  overflow: auto;
}

#history-column-filter,
#lot-list-filter,
#shop-column-filter,
#invoice-overview-filter {
  z-index: 4000;
}

.turnover-filter-modes {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.turnover-filter-modes label {
  margin: 0;
}

#turnover-filter .turnover-prefix-field,
#import-filter .turnover-prefix-field,
#overview-filter .turnover-prefix-field,
#dunning-filter .turnover-prefix-field,
#history-column-filter .turnover-prefix-field,
#lot-list-filter .turnover-prefix-field {
  display: block;
  margin-bottom: 8px;
}

#turnover-filter .turnover-prefix-field input,
#import-filter .turnover-prefix-field input,
#overview-filter .turnover-prefix-field input,
#overview-filter input[type="text"],
#dunning-filter .turnover-prefix-field input,
#dunning-filter input[type="text"],
#history-column-filter .turnover-prefix-field input,
#history-column-filter input[type="text"],
#lot-list-filter .turnover-prefix-field input,
#lot-list-filter input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 6px 8px;
}

.turnover-value-list {
  max-height: 200px;
  overflow: auto;
}

.installment {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 8px;
}

.installment h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
}

.menu-group-label {
  display: block;
  margin: 4px 0 0;
  padding: 8px 4px 2px;
  font-weight: 600;
  color: var(--text);
}

.menu-group .menu-item {
  padding-left: 16px;
}

.defaults-group {
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 12px 0;
  padding: 8px 12px 4px;
}

.defaults-group legend {
  padding: 0 6px;
  font-weight: 600;
}

.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 28px;
  row-gap: 4px;
}

.price-grid label {
  margin-bottom: 0;
}

.default-pay-row,
.final-when-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.final-when-modes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.final-when-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 0 auto;
  flex: 0 0 9rem;
}

.final-when-field input {
  width: 8rem;
}

.import-map-file {
  display: block;
  width: 100%;
  margin: 0 0 6px 0;
  text-align: left;
}

.bewerbung-form .default-pay-row .radio-label {
  margin-bottom: 0;
}

.bewerbung-form .default-pay-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.bewerbung-form .default-pay-field input {
  width: 7rem;
  margin-top: 0;
}

.pay-mode-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.pay-mode-row > div {
  flex: 1;
  min-width: 0;
}

.inst-due-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}

.bewerbung-form .inst-due-row input {
  width: 5rem;
  margin-top: 0;
}

.payment-date-input {
  width: 6.2rem;
  margin: 0 0.2rem;
  padding: 1px 4px;
  font: inherit;
}

.payment-date-input {
  width: 6.2rem;
  margin: 0 0.2rem;
  padding: 1px 4px;
  font: inherit;
}

.payment-term-list {
  margin: 0;
  padding-left: 1.2rem;
}

#document-details-panel {
  height: auto;
  max-height: 80vh;
}

#document-details-panel .panel-body {
  overflow: auto;
  display: block;
}

.document-date {
  margin: 0 0 14px 0;
}

.document-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 16px;
}

.document-party h4 {
  margin: 0 0 6px 0;
  font-size: 13px;
}

.document-party p {
  margin: 0;
  line-height: 1.45;
}

.document-line-table .num {
  text-align: right;
  white-space: nowrap;
}

.document-line-table input.line-price,
.document-line-table input.line-qty {
  width: 4.5rem;
  height: 26px;
  margin: 0;
  padding: 2px 4px;
  box-sizing: border-box;
  text-align: right;
}

.line-desc {
  vertical-align: bottom;
}

.document-line-table th.line-desc-head,
.document-line-table td.line-desc {
  text-align: left;
  white-space: normal;
  border-bottom: 1px solid var(--line);
}

.line-desc .line-desc-text {
  flex: 1 1 6rem;
  min-width: 4.5rem;
  padding-bottom: 5px;
}

.line-desc .line-desc-note {
  flex: 0 1 auto;
  color: var(--muted);
  font-size: 12px;
  padding-bottom: 5px;
}

.line-desc .free-line-label,
#free-invoice-lines .line-desc .free-line-label,
.line-desc .line-desc-text {
  margin-bottom: 1mm;
}

.line-desc .free-line-label,
#free-invoice-lines .line-desc .free-line-label {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 26px;
  margin-top: 0;
  margin-bottom: 1mm;
  padding: 2px 6px;
  box-sizing: border-box;
}

td.line-discount {
  overflow: visible;
}

td.line-discount .discount-group {
  width: max-content;
  max-width: none;
  box-sizing: border-box;
}

.discount-group {
  display: inline-flex;
  align-items: flex-end;
  flex: 0 0 auto;
  gap: 6px;
  margin: 1mm 0 0;
  padding: 2px 10px 1mm;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  min-inline-size: 0;
}

.discount-group .discount-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 2px;
  margin: 0;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--muted);
  text-transform: none;
}

.discount-field > span {
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
}

.discount-group .discount-name,
.discount-group .discount-mode,
.discount-group .discount-value,
#free-invoice-lines .discount-group input,
#free-invoice-lines .discount-group select,
.document-line-table .discount-group input,
.document-line-table .discount-group select,
.free-invoice-discount .discount-group input,
.free-invoice-discount .discount-group select {
  height: 26px;
  margin: 0;
  padding: 2px 4px;
  box-sizing: border-box;
  font-size: 13px;
}

.discount-group .discount-name,
#free-invoice-lines .discount-group .discount-name,
.document-line-table .discount-group .discount-name,
td.line-discount .discount-group .discount-name {
  width: auto;
  flex: 1 1 auto;
  min-width: 4.5rem;
}

.discount-group .discount-mode,
#free-invoice-lines .discount-group .discount-mode,
.document-line-table .discount-group .discount-mode {
  width: 3.5rem;
}

.discount-group .discount-value,
#free-invoice-lines .discount-group .discount-value,
.document-line-table .discount-group .discount-value {
  width: 2.8rem;
  text-align: right;
}

.discount-group .discount-visible {
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
}

.discount-check-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 26px;
}

.discount-group .discount-check,
.discount-group .discount-visible input,
#free-invoice-lines .discount-group .discount-check {
  width: auto;
  height: auto;
  margin: 0;
}

.document-totals {
  width: 100%;
  margin: 12px 0 16px 0;
  border-collapse: collapse;
  font-size: 13px;
}

.document-totals td {
  padding: 2px 0;
}

.document-totals td:first-child {
  padding-left: calc(6% + 4px);
}

.document-totals td:last-child {
  text-align: right;
  white-space: nowrap;
}

.document-totals tr.discount-row td {
  padding-left: calc(6% + 4px);
}

.document-totals .discount-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
}

.document-totals .discount-label {
  flex: 0 0 auto;
  padding-bottom: 6px;
}

.document-footer {
  margin-top: 20px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
}

.document-footer p {
  margin: 0;
}

#document-details-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 14px;
  line-height: 1.5;
}

#shop-details-panel,
#applicant-address-panel,
#applicant-accessories-panel,
#applicant-stand-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 360px;
  max-height: 90vh;
  overflow-y: auto;
  background-color: var(--surface);
  background-image: var(--sheen);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  z-index: 2100;
}

#shop-details-panel textarea,
#applicant-address-panel textarea,
#applicant-accessories-panel textarea,
#applicant-stand-panel textarea {
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

#applicant-table input,
#applicant-table select {
  margin-bottom: 0;
  border: 1px solid transparent;
  background: transparent;
  padding: 5px 6px;
}

#applicant-table input:hover,
#applicant-table select:hover,
#applicant-table input:focus,
#applicant-table select:focus {
  border-color: var(--border-strong);
  background-color: var(--surface);
  background-image: var(--sheen);
}

#applicant-table .click-cell {
  cursor: pointer;
  color: var(--brand);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#applicant-table .click-cell:hover {
  text-decoration: underline;
}

#applicant-table .click-cell.empty {
  color: #999;
  font-style: italic;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.event-when-row {
  display: grid;
  grid-template-columns: 9rem 6.5rem 1fr;
  gap: 8px;
}

.anrede-row {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 8px;
}

#dashboard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#dashboard-panel {
  width: min(1680px, 98vw);
  height: 92vh;
  background-color: var(--surface);
  background-image: var(--sheen);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.dash-status {
  margin: 0;
  padding: 0 12px;
  color: #8a2a2a;
  font-size: 13px;
}

.dash-status:empty {
  display: none;
}

#dashboard-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  padding: 0;
}

.dash-nav {
  width: 280px;
  flex: 0 0 280px;
  border-right: 1px solid var(--line-4);
  padding: 12px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-nav h4 {
  margin: 0;
  font-size: 14px;
}

.dash-page-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dash-page-item button.menu-item {
  flex: 1;
  text-align: left;
}

.dash-page-remove {
  width: 28px;
  padding: 4px;
}

.dash-page-contents {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 8px 12px;
}

.dash-content-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-mid);
}

.dash-content-item span {
  flex: 1;
  min-width: 0;
}

.dash-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.dash-add select {
  flex: 1 1 140px;
  min-width: 0;
  font: inherit;
  font-size: 12px;
  padding: 3px 6px;
}

#dashboard-body.panel-body label.dash-add {
  white-space: normal;
}

.dash-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 12px;
  overflow: auto;
}

.dash-main.dash-count-0,
.dash-main.dash-count-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.dash-main.dash-count-2 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
}

.dash-main.dash-count-3,
.dash-main.dash-count-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.dash-quadrant {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.dash-quadrant-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 6px;
}

.dash-quadrant-head label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.dash-slot-empty {
  margin: 12px 0;
  color: var(--quiet);
  font-size: 13px;
}

.dash-slot-host {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#dashboard-body.panel-body label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  white-space: nowrap;
}

.dash-card {
  border: 1px solid var(--line-4);
  border-radius: 6px;
  padding: 10px 12px 12px;
  background-color: var(--card);
  background-image: var(--sheen);
  min-width: 0;
}

.dash-quadrant .dash-card {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.dash-quadrant:has(.dash-card-table) {
  overflow: hidden;
}

.dash-slot-host > .dash-card-table {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dash-card-table .dash-table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.dash-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: var(--table-head, #f4f6f8);
  background-image: var(--sheen);
  white-space: nowrap;
}

html[data-theme="dark"] .dash-table thead th {
  background-color: #161b22;
  background-image: none;
}

.dash-table th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.dash-table th[data-sort]::after {
  content: " ↕";
  color: var(--border-soft);
}

.dash-table th.sort-asc::after {
  content: " ▲";
  color: var(--brand);
}

.dash-table th.sort-desc::after {
  content: " ▼";
  color: var(--brand);
}

.dash-summary {
  flex: 0 0 auto;
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
}

.dash-column-filter {
  position: fixed;
  z-index: 4000;
  min-width: 220px;
  max-height: 280px;
  overflow: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dash-table th,
.dash-table td {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line, #ddd);
}
.dash-table .num {
  text-align: right;
  white-space: nowrap;
}
.dash-as-table,
.dash-pdf {
  margin-left: 8px;
}
.named-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  position: relative;
}
.named-file .file-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.file-chosen {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.dash-card h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.dash-help,
.dash-caption {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.dash-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 6px;
}

.dash-tools select {
  font: inherit;
  font-size: 12px;
  padding: 3px 6px;
}

.dash-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: 12px;
  color: var(--muted-2);
}

.dash-crumb button {
  background: none;
  color: var(--brand);
  padding: 0;
  text-decoration: underline;
}

.dash-up {
  padding: 4px 8px;
}

.dash-plot {
  overflow-x: auto;
  background-color: var(--surface);
  background-image: var(--sheen);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.dash-plot p {
  margin: 12px;
  color: var(--quiet);
  font-size: 13px;
}

.dash-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 6px;
  font-size: 12px;
}

.dash-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dash-key i {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.dash-bar-hot {
  cursor: pointer;
}

@media (max-width: 980px) {
  .dash-main.dash-count-3,
  .dash-main.dash-count-4 {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
}

.named-percent-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px;
}

.named-percent-table th,
.named-percent-table td {
  text-align: left;
  padding: 4px 6px 4px 0;
}

.factor-name-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.named-percent-table input[type="text"] {
  width: 100%;
}

.factor-name-cell input[type="text"] {
  flex: 1;
  min-width: 0;
  width: auto;
}

.named-percent-table input.num-entry,
.named-percent-table input[type="number"] {
  width: 7em;
}

.named-percent-table .category-id,
.named-percent-table .category-color,
.named-percent-table .factor-delete {
  width: 1%;
  white-space: nowrap;
}

.named-percent-table .category-color {
  text-align: center;
}

button.lot-color-mark,
button.lot-color-mark:hover {
  width: 22px;
  height: 22px;
  padding: 0;
  margin-right: 0;
  background-image: none;
  cursor: pointer;
  vertical-align: middle;
}

.offer-expired {
  display: block;
  margin-top: 2px;
  color: #e0912a;
  font-weight: 600;
}

.category-color-picker {
  position: fixed;
  z-index: 2800;
  display: grid;
  grid-template-columns: repeat(6, 22px);
  gap: 4px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border, #c5c5c5);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.category-color-picker button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 3px;
  cursor: pointer;
}

.category-color-picker button[aria-pressed="true"] {
  outline: 2px solid var(--text, #111);
  outline-offset: 1px;
}

#category-column-filter,
#class-column-filter {
  position: fixed;
  z-index: 30;
}

.price-matrix-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.price-matrix {
  border-collapse: collapse;
  font-size: 13px;
}

.price-matrix th,
.price-matrix td {
  border-bottom: 1px solid var(--border);
  padding: 4px 6px;
  vertical-align: middle;
}

.price-matrix th:first-child {
  position: sticky;
  left: 0;
  background-color: var(--surface);
  background-image: var(--sheen);
  text-align: left;
  min-width: 12em;
  max-width: 18em;
}

.price-matrix input.num-entry,
.price-matrix input[type="number"] {
  width: 6.5em;
}

html[data-theme="dark"] body {
  background-color: var(--canvas);
  background-image: var(--sheen);
}

html[data-theme="dark"] #split-panel {
  background-color: #161b22;
  background-image: none;
  color: #e6edf3;
}

html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background-color: var(--input);
  background-image: var(--sheen);
  color: var(--text);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .map-legend {
  background-color: rgba(13, 17, 23, 0.94);
  background-image: none;
  color: #e6edf3;
}

html[data-theme="dark"] .map-legend .legend-border {
  background-color: #0d1117;
  background-image: none;
}

html[data-theme="dark"] .dash-chart text {
  fill: #8b949e;
}

html[data-theme="dark"] .dash-chart line {
  stroke: #30363d;
}

html[data-theme="dark"] #map-selection-bar button,
html[data-theme="dark"] #map-selection-bar select {
  background-color: #fff;
  background-image: none;
  color: #222;
  border-color: #ccc;
  margin: 0;
  height: 30px;
  width: auto;
}

html[data-theme="dark"] #raster-filter-bar .stand-filter-field {
  color: #e6edf3;
}

html[data-theme="dark"] .leaflet-bar a,
html[data-theme="dark"] .leaflet-bar a:hover {
  background-color: #fff;
  background-image: none;
  color: #000;
  border-bottom-color: #ccc;
}

html[data-theme="dark"][data-app-bg="1"] {
  --canvas: transparent;
  --surface: transparent;
  --surface-muted: transparent;
  --card: transparent;
  --input: rgba(13, 17, 23, 0.72);
  --table-head: rgba(33, 38, 45, 0.55);
  --app-wash: linear-gradient(rgba(13, 17, 23, 0.88), rgba(13, 17, 23, 0.88));
}

html[data-theme="dark"][data-app-bg="1"] body {
  background-color: #0d1117;
  background-image: var(--app-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

html[data-theme="dark"][data-app-bg="1"] :is(
  #sidebar,
  .submenu-frame,
  .login-card,
  #dashboard-panel,
  #raster-props-panel,
  #lot-panel,
  #import-panel,
  #assign-panel-card,
  #lot-map-card,
  #document-panel,
  #stand-pick-panel,
  #events-panel,
  #shop-table-panel,
  #shop-match-panel,
  #shop-history-panel,
  #invitation-panel,
  #party-details-panel,
  #applicant-table-panel,
  #document-list-panel,
  #free-invoice-panel,
  #document-details-panel,
  #applicant-pick-panel,
  #event-picker-panel,
  #payments-panel,
  #dunning-panel,
  #accounting-panel
) {
  background-color: transparent;
  background-image: var(--app-wash), var(--app-bg);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
}

html[data-theme="dark"][data-app-bg="1"] :is(
  .dash-card,
  #dashboard-body,
  .bewerbung-nav,
  .bewerbung-main,
  .panel-body,
  .panel-header
) {
  background-color: transparent;
  background-image: none;
}

#app-background-preview {
  max-width: 280px;
  max-height: 160px;
}

html[data-theme="dark"][data-app-bg="1"] #login-overlay,
html[data-theme="dark"][data-app-bg="1"] #raster-props-overlay,
html[data-theme="dark"][data-app-bg="1"] #party-lot-pick,
html[data-theme="dark"][data-app-bg="1"] #assign-panel,
html[data-theme="dark"][data-app-bg="1"] #lot-map-overlay,
html[data-theme="dark"][data-app-bg="1"] #free-invoice-overlay,
html[data-theme="dark"][data-app-bg="1"] #stand-pick-overlay,
html[data-theme="dark"][data-app-bg="1"] #document-overlay,
html[data-theme="dark"][data-app-bg="1"] #shop-table-overlay,
html[data-theme="dark"][data-app-bg="1"] #shop-history-overlay,
html[data-theme="dark"][data-app-bg="1"] #applicant-table-overlay,
html[data-theme="dark"][data-app-bg="1"] #applicant-pick-overlay,
html[data-theme="dark"][data-app-bg="1"] #document-list-overlay,
html[data-theme="dark"][data-app-bg="1"] #document-details-overlay,
html[data-theme="dark"][data-app-bg="1"] #event-picker-overlay,
html[data-theme="dark"][data-app-bg="1"] #shop-match-overlay,
html[data-theme="dark"][data-app-bg="1"] #party-details-overlay,
html[data-theme="dark"][data-app-bg="1"] #accounting-overlay,
html[data-theme="dark"][data-app-bg="1"] #payments-overlay,
html[data-theme="dark"][data-app-bg="1"] #dunning-overlay,
html[data-theme="dark"][data-app-bg="1"] #invitation-overlay,
html[data-theme="dark"][data-app-bg="1"] #events-overlay,
html[data-theme="dark"][data-app-bg="1"] #dashboard-overlay {
  background-color: #0d1117;
  background-image: var(--app-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

html[data-theme="dark"] #stand-multi-panel,
html[data-theme="dark"] #raster-props-panel,
html[data-theme="dark"][data-app-bg="1"] #stand-multi-panel,
html[data-theme="dark"][data-app-bg="1"] #raster-props-panel {
  background-color: #161b22;
  background-image: none;
  color: #e6edf3;
}

html[data-theme="dark"] #stand-multi-panel :is(.panel-header, .panel-body, fieldset, .accessories-subgroup),
html[data-theme="dark"] #raster-props-panel :is(.panel-header, .panel-body, fieldset, .accessories-subgroup),
html[data-theme="dark"][data-app-bg="1"] #stand-multi-panel :is(.panel-header, .panel-body, fieldset, .accessories-subgroup),
html[data-theme="dark"][data-app-bg="1"] #raster-props-panel :is(.panel-header, .panel-body, fieldset, .accessories-subgroup) {
  background-color: #161b22;
  background-image: none;
  color: #e6edf3;
}

html[data-theme="dark"] #raster-grid,
html[data-theme="dark"] #lot-map .raster-grid-preview,
html[data-theme="dark"] .raster-grid-preview {
  background: #c9d1d9;
}

html[data-theme="dark"] .raster-cell {
  background: #1c2330;
  color: #e6edf3;
}

html[data-theme="dark"] .raster-cell.is-saved {
  color: #f0f6fc;
  text-shadow: 0 0 2px #0d1117;
}

html[data-theme="dark"] #raster-view,
html[data-theme="dark"] #raster-board,
html[data-theme="dark"] #lot-map.lot-map-raster,
html[data-theme="dark"] #lot-map-canvas.lot-map-raster {
  background: transparent;
  background-image: none;
}

html[data-theme="dark"] .leaflet-control-attribution {
  background: rgba(13, 17, 23, 0.88);
  color: #8b949e;
}

html[data-theme="dark"] .dot.angenommen {
  background: #3fb950;
}

html[data-theme="dark"] .dot.bezahlt {
  background: #f85149;
}

html[data-theme="dark"] .party-table input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] .party-table select,
html[data-theme="dark"] #applicant-table input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] #applicant-table select {
  background: transparent;
  color: var(--text);
  border-color: transparent;
}

html[data-theme="dark"] .party-table input:hover,
html[data-theme="dark"] .party-table input:focus,
html[data-theme="dark"] .party-table select:hover,
html[data-theme="dark"] .party-table select:focus,
html[data-theme="dark"] #applicant-table input:hover,
html[data-theme="dark"] #applicant-table input:focus,
html[data-theme="dark"] #applicant-table select:hover,
html[data-theme="dark"] #applicant-table select:focus {
  background-color: var(--input);
  background-image: var(--sheen);
  border-color: var(--border-strong);
}

html[data-theme="metal"] body {
  background-color: var(--canvas);
  background-image: var(--brush);
}

html[data-theme="metal"] :is(
  #sidebar,
  #raster-view,
  #raster-props-panel,
  #lot-panel,
  #split-panel,
  #import-panel,
  #assign-panel-card,
  #lot-map-card,
  #document-panel,
  #stand-pick-panel,
  #events-panel,
  #dashboard-panel,
  #shop-table-panel,
  #shop-match-panel,
  #shop-history-panel,
  #invitation-panel,
  #party-details-panel,
  #applicant-table-panel,
  #document-list-panel,
  #free-invoice-panel,
  #document-details-panel,
  #applicant-pick-panel,
  #event-picker-panel,
  #payments-panel,
  #dunning-panel,
  #accounting-panel,
  .login-card,
  .submenu-frame,
  .raster-toolbar,
  .legend,
  .map-legend,
  .dash-card,
  .turnover-drop
) {
  background-image: var(--brush);
}

html[data-theme="metal"] button {
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 1px 1px rgba(0, 0, 0, 0.22);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.05) 42%, rgba(0, 0, 0, 0.28) 100%);
}

html[data-theme="metal"] button:disabled,
html[data-theme="metal"] button:disabled:hover {
  background-image: none;
  box-shadow: none;
  border-color: transparent;
}

html[data-theme="metal"] :is(
  .panel-header button,
  .shop-name-link,
  .shop-row-delete-btn,
  .party-reject-btn,
  .history-block-btn,
  .import-select-link,
  .dash-crumb button
) {
  background-color: transparent;
  background-image: none;
  box-shadow: none;
  border-color: transparent;
}

html[data-theme="metal"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="metal"] select,
html[data-theme="metal"] textarea {
  background-color: var(--input);
  background-image: var(--sheen);
  color: var(--text);
  border-color: var(--border-strong);
}

html[data-theme="metal"] .party-table input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="metal"] .party-table select,
html[data-theme="metal"] #applicant-table input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="metal"] #applicant-table select {
  background-color: transparent;
  background-image: none;
  color: var(--text);
  border-color: transparent;
}

html[data-theme="metal"] .party-table input:hover,
html[data-theme="metal"] .party-table input:focus,
html[data-theme="metal"] .party-table select:hover,
html[data-theme="metal"] .party-table select:focus,
html[data-theme="metal"] #applicant-table input:hover,
html[data-theme="metal"] #applicant-table input:focus,
html[data-theme="metal"] #applicant-table select:hover,
html[data-theme="metal"] #applicant-table select:focus {
  background-color: var(--input);
  background-image: var(--sheen);
  border-color: var(--border-strong);
}

html[data-theme="metal"] .dash-chart text {
  fill: #3d4450;
}

html[data-theme="metal"] .dash-chart line {
  stroke: #6e7580;
}

html[data-theme="metal"] .leaflet-bar a,
html[data-theme="metal"] .leaflet-bar a:hover {
  background-color: var(--surface);
  background-image: var(--sheen);
  color: var(--text);
  border-color: var(--border-strong);
}

html[data-theme="metal"] .leaflet-control-attribution {
  background: rgba(163, 170, 179, 0.92);
  color: #3d4450;
}

html[data-theme="metal"] #raster-grid,
html[data-theme="metal"] #lot-map .raster-grid-preview {
  background-color: #6e7580;
}

html[data-theme="metal"] #lot-map.lot-map-raster {
  background-color: var(--canvas);
  background-image: var(--brush);
}

html[data-theme="metal"] .lot-list-row:hover td,
html[data-theme="metal"] .lot-shop-open:hover,
html[data-theme="metal"] .turnover-line:hover {
  background-color: #b7c0b8;
  background-image: var(--sheen);
  color: var(--text-strong);
}
