:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #617489;
  --line: #d9e2ec;
  --blue: #1d4ed8;
  --blue-dark: #173f9f;
  --green: #047857;
  --amber: #b45309;
  --red: #b42318;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  overflow: hidden;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 18px 28px;
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

h3 {
  color: #334e68;
  font-size: 14px;
  margin: 14px 0 8px;
}

.primary,
.secondary,
.danger,
.ghost,
.search-row button {
  background: var(--blue);
  border: 1px solid var(--blue);
  color: #ffffff;
  cursor: pointer;
  min-height: 38px;
  padding: 8px 14px;
}

.primary:hover,
.secondary:hover,
.danger:hover,
.search-row button:hover {
  background: var(--blue-dark);
}

.secondary {
  background: #ffffff;
  color: var(--blue);
}

.secondary:hover {
  color: #ffffff;
}

.danger {
  background: #ffffff;
  border-color: #f0b8b8;
  color: var(--red);
}

.danger:hover {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
}

.ghost {
  background: #ffffff;
  border-color: var(--line);
  color: #334e68;
  min-height: 44px;
  padding: 5px 8px;
}

.ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
}

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

.toast {
  background: #102a43;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(16, 42, 67, .18);
  color: #ffffff;
  opacity: 0;
  padding: 10px 14px;
  pointer-events: none;
  position: fixed;
  right: 22px;
  top: 84px;
  transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--red);
}

.workspace {
  display: grid;
  flex: 1 1 auto;
  gap: 18px;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding: 18px;
}

.side-panel,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.side-panel {
  align-self: stretch;
  -ms-overflow-style: none;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  position: static;
  scrollbar-width: none;
}

.content-grid {
  -ms-overflow-style: none;
  align-content: start;
  display: grid;
  gap: 18px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: none;
}

.side-panel::-webkit-scrollbar,
.content-grid::-webkit-scrollbar {
  display: none;
  height: 0;
  width: 0;
}

.panel {
  padding: 16px;
}

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

.status-text {
  color: var(--muted);
  font-size: 12px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.field span {
  color: #334e68;
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(29, 78, 216, .14);
}

.search-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
}

.results {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.result-btn {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  padding: 10px;
  text-align: left;
}

.result-btn:hover {
  border-color: var(--blue);
}

.vehicle-card {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.muted-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.muted {
  color: var(--muted);
}

.vehicle-title {
  font-size: 17px;
  font-weight: 800;
}

.vehicle-preview-image {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.vehicle-meta {
  color: var(--muted);
  font-size: 13px;
}

.open-box {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}

.side-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.side-heading h2 {
  font-size: 15px;
}

.side-heading-actions {
  align-items: center;
  display: flex;
  gap: 7px;
}

.live-status {
  align-items: center;
  color: #15803d;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  gap: 5px;
}

.live-dot {
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .14);
  height: 7px;
  width: 7px;
}

.live-status.offline {
  color: var(--muted);
}

.live-status.offline .live-dot {
  background: #94a3b8;
  box-shadow: none;
}

.open-list {
  display: grid;
  gap: 8px;
}

.evaluation-tabs {
  background: #eef2f6;
  border-radius: 7px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr 1fr;
  margin-bottom: 10px;
  padding: 4px;
}

.saved-search {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

.saved-search span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.saved-search input {
  font-size: 12px;
  min-height: 36px;
}

.evaluation-tab {
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  min-height: 34px;
  padding: 6px 8px;
}

.evaluation-tab.active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 42, 67, .12);
  color: var(--blue);
}

.evaluation-tab span {
  background: #d9e2ec;
  border-radius: 999px;
  display: inline-block;
  margin-left: 3px;
  min-width: 20px;
  padding: 1px 5px;
}

.evaluation-tab.active span {
  background: #dbeafe;
}

.open-item {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  display: grid;
  gap: 2px;
  grid-template-columns: minmax(0, 1fr);
  padding: 9px;
  text-align: left;
}

.open-item.has-preview {
  grid-template-columns: auto minmax(0, 1fr);
}

.open-item:hover {
  border-color: var(--blue);
}

.open-item span,
.open-item small {
  color: var(--muted);
  font-size: 12px;
}

.evaluation-preview-image {
  border-radius: 5px;
  height: 58px;
  margin-right: 7px;
  object-fit: cover;
  width: 76px;
}

.evaluation-card-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.evaluation-card-copy strong,
.evaluation-card-copy span,
.evaluation-card-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.decision-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.calc-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 330px;
}

.calc-form {
  display: grid;
  gap: 18px;
}

.form-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.form-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.form-section h3 {
  margin: 0 0 12px;
}

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

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

.with-count {
  grid-template-columns: 1fr 110px;
}

.with-count span {
  grid-column: 1 / -1;
}

.readonly-note {
  align-items: end;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  min-height: 58px;
  padding-bottom: 12px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.field-hint.hu-fresh {
  color: #157347;
  font-weight: 600;
}

.important input {
  border-color: #7aa5f8;
}

.summary {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.summary div {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 12px;
}

.summary div + div {
  border-top: 1px solid var(--line);
}

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

.summary strong {
  font-size: 17px;
}

.summary .highlight {
  background: #eff6ff;
}

.sticky-summary {
  position: sticky;
  top: 0;
}

.panel-description {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

.damage-total {
  color: var(--blue-dark);
  font-size: 20px;
  font-weight: 750;
  white-space: nowrap;
}

.damage-table-wrap {
  overflow-x: auto;
}

.damage-table {
  border-collapse: collapse;
  min-width: 840px;
  width: 100%;
}

.damage-table th,
.damage-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

.damage-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.damage-table td:first-child {
  width: 170px;
}

.damage-table td:nth-child(3) {
  width: 190px;
}

.damage-table td:last-child {
  width: 180px;
}

.damage-image {
  background: #eef2f6;
  border-radius: 6px;
  display: block;
  height: 112px;
  object-fit: cover;
  width: 150px;
}

.damage-image-button {
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: zoom-in;
  display: block;
  padding: 0;
  position: relative;
}

.damage-image-button.has-markup::after {
  background: var(--red);
  border: 2px solid #fff;
  border-radius: 50%;
  content: "";
  height: 14px;
  position: absolute;
  right: -4px;
  top: -4px;
  width: 14px;
}

.damage-image-button:focus-visible {
  outline: 3px solid rgba(29, 78, 216, .35);
  outline-offset: 2px;
}

.documents-groups {
  display: grid;
  gap: 18px;
}

.documents-group-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  margin: 0 0 9px;
  text-transform: uppercase;
}

.documents-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.document-thumb {
  display: grid;
  gap: 5px;
  justify-items: center;
  width: 150px;
}

.document-thumb-label {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.lightbox-open {
  overflow: hidden;
}

.damage-lightbox {
  align-items: center;
  background: rgba(15, 23, 42, .82);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 50;
}

.damage-lightbox-window {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
  max-height: 94vh;
  max-width: min(1100px, 96vw);
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  width: min(1100px, 96vw);
}

.damage-lightbox-media {
  align-items: center;
  background: #111827;
  display: flex;
  justify-content: center;
  min-height: 260px;
  position: relative;
}

.damage-lightbox-image-button {
  background: #111827;
  display: inline-flex;
  position: relative;
}

.damage-lightbox-image-button img {
  display: block;
  height: auto;
  max-height: 62vh;
  max-width: 92vw;
  object-fit: contain;
  width: auto;
}

.damage-markup-canvas {
  inset: 0;
  pointer-events: none;
  position: absolute;
  touch-action: none;
}

.damage-markup-canvas.markup-active {
  cursor: crosshair;
  pointer-events: auto;
}

.damage-lightbox-nav {
  align-items: center;
  background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 38px;
  height: 48px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 5px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  z-index: 2;
}

.damage-lightbox-nav.previous {
  left: 14px;
}

.damage-lightbox-nav.next {
  right: 14px;
}

.damage-lightbox-counter {
  background: rgba(15, 23, 42, .72);
  border-radius: 999px;
  bottom: 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  position: absolute;
  right: 14px;
}

.damage-lightbox-caption {
  display: grid;
  gap: 5px;
  padding: 13px 18px 15px;
}

.damage-lightbox-caption span,
.damage-lightbox-caption small {
  color: var(--muted);
}

.damage-lightbox-editor {
  align-items: start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: auto 180px minmax(260px, 1fr);
  margin-top: 8px;
  padding-top: 12px;
}

.damage-lightbox-decision {
  display: grid;
  gap: 6px;
}

.damage-lightbox-decision > span,
.damage-lightbox-editor .field > span {
  color: #334e68;
  font-size: 12px;
  font-weight: 700;
}

.damage-lightbox-editor .field {
  margin-bottom: 0;
}

.damage-lightbox-note textarea {
  min-height: 64px;
}

.damage-lightbox-close {
  align-items: center;
  background: rgba(15, 23, 42, .82);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 25px;
  height: 38px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 3px;
  position: absolute;
  right: 12px;
  top: 12px;
  width: 38px;
}

.damage-description {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.damage-note-input {
  font-size: 13px;
  margin-top: 10px;
  min-height: 58px;
  resize: vertical;
}

.damage-choice {
  display: flex;
  gap: 6px;
}

.damage-option {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #334e68;
  cursor: pointer;
  min-height: 36px;
  padding: 7px 11px;
}

.damage-option.selected.leave {
  background: #ecfdf5;
  border-color: var(--green);
  color: var(--green);
  font-weight: 700;
}

.damage-option.selected.repair {
  background: #eff6ff;
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 700;
}

.damage-lightbox-markup {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
}

.damage-lightbox-markup > span {
  color: #334e68;
  font-size: 12px;
  font-weight: 700;
}

.damage-lightbox-markup .damage-option.selected {
  background: #fef2f2;
  border-color: var(--red);
  color: var(--red);
  font-weight: 700;
}

.damage-markup-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

input[readonly] {
  background: #f3f6f9;
  color: #334e68;
}

textarea {
  resize: vertical;
}

@media (max-width: 980px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .workspace,
  .calc-layout,
  .form-grid,
  .decision-grid,
  .cost-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .workspace {
    overflow: visible;
  }

  .content-grid,
  .side-panel {
    overflow: visible;
    position: static;
  }

  .open-list {
    max-height: 360px;
    overflow-y: auto;
  }

  .sticky-summary {
    position: static;
  }

  .damage-lightbox-editor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .topbar {
    align-items: stretch;
    padding: 12px 16px;
  }

  h1 {
    font-size: 22px;
  }

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

  .top-actions button {
    min-height: 44px;
    white-space: normal;
  }

  .workspace {
    gap: 10px;
    padding: 10px;
  }

  .content-grid {
    gap: 10px;
    padding-right: 0;
  }

  .panel,
  .side-panel {
    padding: 12px;
  }

  .panel-head {
    align-items: flex-start;
    gap: 8px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
    min-height: 44px;
  }

  .saved-search input {
    font-size: 16px;
    min-height: 44px;
  }

  .search-row button,
  .evaluation-tab,
  .damage-option {
    min-height: 44px;
  }

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

  .document-thumb {
    width: 100%;
  }

  .damage-table-wrap {
    overflow-x: visible;
  }

  .damage-table {
    min-width: 0;
  }

  .damage-table thead {
    display: none;
  }

  .damage-table,
  .damage-table tbody,
  .damage-table tr,
  .damage-table td {
    display: block;
    width: 100%;
  }

  .damage-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 10px;
  }

  .damage-table td {
    border-bottom: 0;
    padding: 8px 0;
  }

  .damage-table td:first-child,
  .damage-table td:nth-child(3),
  .damage-table td:last-child {
    width: 100%;
  }

  .damage-table td::before {
    color: var(--muted);
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
  }
}

@media (max-width: 420px) {
  .top-actions {
    grid-template-columns: 1fr;
  }

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

  .documents-grid {
    grid-template-columns: 1fr;
  }
}

/* Einkaufs-Ampel im Summary-Panel */
.summary .ampel-block {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
}

.summary .ampel-title {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 6px;
  justify-content: center;
  min-height: 0;
  padding: 0;
}

.ampel-beta {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  color: #4338ca;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 1px 8px;
}

.ampel-badge {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  display: flex;
  font-size: 20px;
  font-weight: 800;
  justify-content: center;
  letter-spacing: 0.08em;
  padding: 12px 0;
}

.ampel-badge.neutral { background: #eef2f7; color: #7a8aa0; }
.ampel-badge.gruen { background: #dcfce7; border-color: #86efac; color: #047857; }
.ampel-badge.gelb { background: #fef3c7; border-color: #fcd34d; color: #b45309; }
.ampel-badge.rot { background: #fee2e2; border-color: #fca5a5; color: #b42318; }

.ampel-hint {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

/* Ausstattung fuer TwoSales */
.equipment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.equipment-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #334e68;
  font-size: 12px;
  padding: 5px 10px;
}

.equipment-chip.checked {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: var(--green);
  font-weight: 650;
}

.equipment-chip.catalog {
  border-style: dashed;
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--blue);
  cursor: pointer;
  font-size: inherit;
  font-weight: 700;
  min-height: 0;
  padding: 0;
  width: auto;
}

.text-button:hover {
  color: var(--blue-dark);
}

.equipment-raw {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfd;
  margin-top: 12px;
  overflow: hidden;
}

.equipment-raw summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #243b53;
  list-style: none;
  padding: 10px 12px;
}

.equipment-raw summary::-webkit-details-marker {
  display: none;
}

.equipment-raw summary:hover {
  background: #f2f6f9;
}

.equipment-raw > div {
  padding: 0 12px 12px;
}

.section-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

/* Strittige Ausstattungen (mehrere Varianten) – Einkaeufer entscheidet */
.equipment-contested {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #ecd3a6;
  border-radius: 10px;
  background: #fbefda;
}

.contested-note {
  margin: 0 0 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #7a4d09;
}

.equipment-chip.contested {
  cursor: pointer;
  border-color: #e0b877;
  border-style: dashed;
  background: #fff;
  color: #7a4d09;
  font: inherit;
  font-size: 12px;
  min-height: 0;
  width: auto;
}

.equipment-chip.contested:hover {
  border-color: #a9640a;
  background: #fff7ea;
}

.equipment-chip.contested.chosen {
  border-style: solid;
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: var(--green);
  font-weight: 650;
}

.equipment-chip.contested:focus-visible {
  outline: 2px solid rgba(169, 100, 10, .5);
  outline-offset: 1px;
}

/* "Ich bin"-Auswahl in der Topbar (wer arbeitet gerade am Geraet) */
.user-badge {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 7px;
  margin-right: 6px;
}

.user-badge strong {
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.user-badge .logout-link {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--blue);
  font-size: 11px;
  padding: 4px 8px;
  text-decoration: none;
  white-space: nowrap;
}

/* Status-Badges (Liste, Formular, Meta-Zeile) */
.status-badge {
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  white-space: nowrap;
}

.status-badge.st-entwurf {
  background: #e2e8f0;
  color: #334e68;
}

.status-badge.st-preis {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.st-frei {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.st-abgelehnt {
  background: #fee2e2;
  color: #991b1b;
}

/* Einkaeufer-Mappen (klickbare Filter-Chips ueber der Liste) */
.buyer-folders {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.buyer-chip {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #334e68;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  min-height: 30px;
  padding: 3px 10px;
}

.buyer-chip:hover {
  border-color: var(--blue);
}

.buyer-chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}

.buyer-chip .count {
  background: #e2e8f0;
  border-radius: 999px;
  font-size: 11px;
  min-width: 19px;
  padding: 1px 6px;
  text-align: center;
}

.buyer-chip.active .count {
  background: rgba(255, 255, 255, .25);
  color: #ffffff;
}

/* Kalkulations-Karten: Kopfzeile mit Badge + Bearbeiter-/Freigabe-Zeile */
.card-topline {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: space-between;
  min-width: 0;
}

.card-topline strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-item .evaluation-edit-info {
  color: var(--muted);
  font-size: 11px;
}

.open-item .evaluation-edit-info.other {
  color: var(--amber);
  font-weight: 700;
}

.open-item .evaluation-approved-info {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.open-item .evaluation-purchased-info {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}

/* Meta-Zeile + Verlauf im Panel "Notizen und Entscheidung" */
.evaluation-meta {
  align-items: center;
  background: #f2f6f9;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 12px;
  padding: 8px 12px;
}

.evaluation-meta .meta-item {
  color: #334e68;
  font-size: 12px;
}

.evaluation-meta .meta-highlight {
  color: var(--amber);
  font-weight: 700;
}

.evaluation-meta .meta-approved {
  color: var(--green);
  font-weight: 700;
}

.evaluation-history {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  overflow: hidden;
}

.evaluation-history summary {
  color: #243b53;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
  padding: 10px 12px;
}

.evaluation-history summary::-webkit-details-marker {
  display: none;
}

.evaluation-history summary:hover {
  background: #f2f6f9;
}

.evaluation-history ol {
  color: #334e68;
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
  padding: 0 12px 12px 28px;
}

@media (max-width: 768px) {
  .top-actions .user-badge {
    grid-column: 1 / -1;
    justify-content: space-between;
    margin-right: 0;
  }

  .buyer-chip {
    min-height: 38px;
  }
}
