:root {
  --bg: #070b14;
  --header: #020617;
  --panel: #101827;
  --panel-strong: #162033;
  --panel-soft: #0b1220;
  --border: #2b3a50;
  --border-soft: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --green: #86efac;
  --green-bg: #063f31;
  --red: #fca5a5;
  --red-bg: #681a1a;
  --yellow: #fde68a;
  --yellow-bg: #4a3511;
  --blue: #93c5fd;
  --blue-bg: #1d3f7a;
  --gray-bg: #2b3443;
  --shadow: rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.17), transparent 34%),
    radial-gradient(circle at 85% 15%, rgba(14, 165, 233, 0.10), transparent 28%),
    var(--bg);
  color: var(--text);
}

button,
select,
input {
  font: inherit;
}

button,
select,
input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-weight: 700;
  outline: none;
}

button {
  cursor: pointer;
  background: var(--blue-bg);
  color: var(--text);
  border-color: #3156a3;
}

button:hover {
  filter: brightness(1.12);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

button.secondary {
  background: var(--panel-soft);
  border-color: var(--border);
  color: var(--text);
}

input,
select {
  background: #020617;
  color: var(--text);
}

input {
  min-width: 220px;
  flex: 1;
}

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

h1 {
  margin-bottom: 6px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.03em;
}

h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: 16px 0;
}

.app-header {
  padding: 18px 22px;
  background: rgba(2, 6, 23, 0.92);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.layout {
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.left-column,
.right-column {
  display: grid;
  gap: 14px;
}

@media (max-width: 1050px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    justify-content: flex-start;
  }
}

.card {
  background: rgba(16, 24, 39, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 14px 36px var(--shadow);
}

.sticky-panel {
  position: sticky;
  top: 106px;
}

@media (max-width: 1050px) {
  .sticky-panel {
    position: static;
  }
}

.section-title {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.section-title p {
  margin-bottom: 0;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}

@media (max-width: 720px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat {
  background: var(--panel-soft);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 12px;
  text-align: left;
  color: inherit;
}

button.stat {
  cursor: pointer;
}

.stat.active {
  border-color: var(--blue);
  background: linear-gradient(180deg, rgba(29, 63, 122, 0.55), rgba(11, 18, 32, 0.96));
}

.stat-value {
  font-size: 24px;
  font-weight: 900;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.auction-list {
  display: grid;
  gap: 12px;
}

.auction-card {
  background: linear-gradient(180deg, rgba(22, 32, 51, 0.98), rgba(9, 15, 27, 0.98));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, background 120ms ease;
}

.auction-card:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}

.auction-card.selected {
  border-color: var(--yellow);
  box-shadow: 0 0 0 1px rgba(253, 230, 138, 0.22);
}

.auction-card.stale-active {
  border-color: var(--red);
}

.auction-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.auction-title {
  font-weight: 900;
  font-size: 16px;
  line-height: 1.35;
}

.auction-id {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.auction-desc {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.35;
}

.auction-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 760px) {
  .auction-meta {
    grid-template-columns: repeat(2, 1fr);
  }
}

.meta-box {
  background: rgba(2, 6, 23, 0.58);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 10px;
  min-width: 0;
}

.meta-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.meta-value {
  font-weight: 900;
  word-break: break-word;
}

.detail-line {
  margin: 8px 0;
  line-height: 1.35;
}

.detail-section {
  background: rgba(2, 6, 23, 0.38);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 12px;
  margin-top: 12px;
}

.detail-section h3 {
  margin-bottom: 12px;
}

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

@media (max-width: 620px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.kv {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 8px;
  margin: 8px 0;
  font-size: 14px;
}

@media (max-width: 560px) {
  .kv {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

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

.kv-value {
  word-break: break-word;
}

.status,
.pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status-active {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(134, 239, 172, 0.22);
}

.status-ended {
  background: var(--gray-bg);
  color: #d1d5db;
  border-color: rgba(209, 213, 219, 0.16);
}

.status-cancelled {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(252, 165, 165, 0.22);
}

.status-warning {
  background: var(--yellow-bg);
  color: var(--yellow);
  border-color: rgba(253, 230, 138, 0.24);
}

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

.ok {
  color: var(--green);
}

.bad {
  color: var(--red);
}

.warn {
  color: var(--yellow);
}

.price {
  color: var(--yellow);
  font-weight: 900;
}

.price-big {
  color: var(--yellow);
  font-size: 34px;
  font-weight: 900;
  margin: 10px 0 4px;
  letter-spacing: -0.02em;
}

.small {
  font-size: 13px;
}

.time-good {
  color: var(--green);
  font-weight: 900;
}

.time-ended {
  color: var(--muted);
  font-weight: 900;
}

.time-bad {
  color: var(--red);
  font-weight: 900;
}

.image-placeholder {
  margin-top: 12px;
  min-height: 120px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.42);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
}

.image-placeholder strong {
  display: block;
  margin-bottom: 6px;
}

details {
  margin-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 900;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #020617;
  padding: 12px;
  border-radius: 12px;
  overflow: auto;
  border: 1px solid var(--border-soft);
  max-height: 420px;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(2, 6, 23, 0.35);
}

.notice {
  padding: 12px;
  border-radius: 14px;
  background: rgba(253, 230, 138, 0.08);
  border: 1px solid rgba(253, 230, 138, 0.24);
  color: var(--yellow);
}

.error-box {
  padding: 12px;
  border-radius: 14px;
  background: rgba(127, 29, 29, 0.26);
  border: 1px solid rgba(252, 165, 165, 0.26);
  color: var(--red);
}


/* v3 UX refinements */
.list-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.inline-action {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.empty strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}

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

.selected-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(147, 197, 253, 0.08);
  border: 1px solid rgba(147, 197, 253, 0.20);
  color: var(--blue);
}

.filter-hidden-note {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(253, 230, 138, 0.08);
  border: 1px solid rgba(253, 230, 138, 0.24);
  color: var(--yellow);
}

.auction-card.selected::before {
  content: "Ausgewählt";
  display: inline-block;
  margin-bottom: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(253, 230, 138, 0.12);
  color: var(--yellow);
  border: 1px solid rgba(253, 230, 138, 0.24);
  font-size: 11px;
  font-weight: 900;
}

.status-filter-hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}


/* image delivery patch v1 */
.card-thumb-wrap {
  margin-top: 12px;
  width: 100%;
  max-height: 190px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: rgba(2, 6, 23, 0.45);
}

.card-thumb {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.product-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.product-image-frame {
  min-height: 150px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: rgba(2, 6, 23, 0.46);
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
}

.product-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.image-fallback {
  display: none;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.product-image-frame.image-unavailable .image-fallback {
  display: block;
}


/* system status patch v1 */
.system-status-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

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

.doctor-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.doctor-list li {
  margin: 6px 0;
}
