/* ============================================================
   Modul 3: Listing — Styles
   Wegeler-Palette: Spätburgunder / Riesling-Creme / Premium-Gold / Rebhang-Grün
   ============================================================ */

/* Kanban wiederverwendet .tastings-kanban Kern-Styles, aber Listing hat 6 Spalten */
#listings-kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 12px;
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  overflow-x: auto;
}

#listings-kanban .kanban-col {
  background: var(--surface-alt, #faf8f3);
  border: 1px solid var(--border, #e5e2d9);
  border-radius: 6px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  min-width: 220px;
}

/* Farbverlauf über Kanban-Spalten: Prozessfortschritt visualisieren */
#listings-kanban .kanban-col[data-col="angebot"] {
  border-top: 3px solid rgba(66, 20, 34, 0.4);
}
#listings-kanban .kanban-col[data-col="verhandlung"] {
  border-top: 3px solid rgba(66, 20, 34, 0.6);
}
#listings-kanban .kanban-col[data-col="bestellt"] {
  border-top: 3px solid rgba(66, 20, 34, 0.8);
}
#listings-kanban .kanban-col[data-col="gelistet"] {
  border-top: 3px solid var(--spaetburgunder, #421422);
  background: linear-gradient(to bottom, rgba(212, 175, 55, 0.08), var(--surface-alt, #faf8f3) 40%);
}
#listings-kanban .kanban-col[data-col="nachbestellt"] {
  border-top: 3px solid var(--premium-gold, #d4af37);
  background: linear-gradient(to bottom, rgba(212, 175, 55, 0.12), var(--surface-alt, #faf8f3) 50%);
}
#listings-kanban .kanban-col[data-col="nachbestellt"] .kanban-col-title {
  color: var(--rebhang-gruen, #1a3b26);
}
#listings-kanban .kanban-col[data-col="abgelehnt"] {
  border-top: 3px dashed var(--text-muted, #7a7974);
  opacity: 0.75;
}
#listings-kanban .kanban-col[data-col="abgelehnt"] .kanban-col-title {
  color: var(--text-muted, #7a7974);
}

@media (max-width: 1400px) {
  #listings-kanban { grid-template-columns: repeat(6, 220px); }
}

/* ---------- Liste (alternative Ansicht) ---------- */
.listings-list {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.listing-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e2d9);
  border-radius: 4px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.listing-card:hover {
  border-color: var(--spaetburgunder, #421422);
  box-shadow: 0 2px 6px rgba(66, 20, 34, 0.08);
}
.listing-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.listing-card-name {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  color: var(--spaetburgunder, #421422);
}
.listing-card-sub {
  font-size: 12px;
  color: var(--text-muted, #7a7974);
  margin-bottom: 8px;
}
.listing-card-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted, #7a7974);
}
.listing-card-meta .meta-chip {
  padding: 2px 8px;
  border: 1px solid var(--border, #e5e2d9);
  border-radius: 3px;
  font-size: 11px;
  color: var(--spaetburgunder, #421422);
  background: var(--riesling-creme, #f5efe3);
}

/* Status-Chips für Liste */
.l-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid transparent;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.l-status-angebot      { background: rgba(66, 20, 34, 0.08);  color: var(--spaetburgunder, #421422); border-color: rgba(66, 20, 34, 0.15); }
.l-status-verhandlung  { background: rgba(66, 20, 34, 0.15);  color: var(--spaetburgunder, #421422); border-color: rgba(66, 20, 34, 0.25); }
.l-status-bestellt     { background: rgba(66, 20, 34, 0.25);  color: var(--riesling-creme, #f5efe3); border-color: rgba(66, 20, 34, 0.35); }
.l-status-gelistet     { background: var(--spaetburgunder, #421422); color: var(--riesling-creme, #f5efe3); }
.l-status-nachbestellt { background: var(--premium-gold, #d4af37); color: var(--spaetburgunder, #421422); }
.l-status-abgelehnt    { background: rgba(122, 121, 116, 0.15); color: var(--text-muted, #7a7974); }

/* ============================================================
   Detail-Panel
   ============================================================ */
.listing-detail {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.listing-detail-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border, #e5e2d9);
}
.listing-detail-title h2 {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  color: var(--spaetburgunder, #421422);
  margin: 4px 0 0 0;
}
.listing-detail-status {
  margin-left: auto;
}
.status-select {
  padding: 8px 12px;
  border: 1px solid var(--border, #e5e2d9);
  border-radius: 3px;
  font-size: 13px;
  color: var(--spaetburgunder, #421422);
  background: var(--surface, #fff);
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  min-width: 160px;
}

.listing-detail-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .listing-detail-grid { grid-template-columns: 1fr; }
}

.detail-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e2d9);
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.detail-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border, #e5e2d9);
}
.detail-card-head h3 {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  color: var(--spaetburgunder, #421422);
  margin: 0;
  font-weight: 500;
}
.detail-card-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border, #e5e2d9);
}
.field-inline {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}
.field-inline .field-label {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-muted, #7a7974);
}
.field-inline input {
  width: 140px;
  padding: 6px 10px;
  border: 1px solid var(--border, #e5e2d9);
  border-radius: 3px;
  text-align: right;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--spaetburgunder, #421422);
}

/* ---------- Wein-Positionen ---------- */
.listing-wines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.listing-wine-row {
  display: grid;
  grid-template-columns: 2.2fr 60px 70px 90px 2fr 30px;
  gap: 6px;
  align-items: center;
}
.listing-wine-row input {
  padding: 6px 8px;
  border: 1px solid var(--border, #e5e2d9);
  border-radius: 3px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--spaetburgunder, #421422);
  background: var(--surface, #fff);
}
.listing-wine-row input.wine-name {
  font-family: 'Playfair Display', serif;
  font-size: 13px;
}
.btn-icon-mini {
  background: transparent;
  border: 1px solid var(--border, #e5e2d9);
  border-radius: 3px;
  padding: 4px 8px;
  color: var(--text-muted, #7a7974);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.btn-icon-mini:hover {
  border-color: var(--spaetburgunder, #421422);
  color: var(--spaetburgunder, #421422);
}

.listing-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.listing-meta .field { grid-column: span 1; }
.listing-meta .field textarea { grid-column: span 2; }
.listing-meta textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border, #e5e2d9);
  border-radius: 3px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--spaetburgunder, #421422);
  background: var(--surface, #fff);
  resize: vertical;
}

/* ---------- Karten-Scans ---------- */
.scan-url-input {
  padding: 6px 10px;
  border: 1px solid var(--border, #e5e2d9);
  border-radius: 3px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  min-width: 260px;
}
.scan-hint {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-muted, #7a7974);
  padding: 8px 0 12px;
  line-height: 1.5;
}
.listing-scans {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.scan-entry {
  border: 1px solid var(--border, #e5e2d9);
  border-radius: 4px;
  padding: 12px 14px;
  background: var(--riesling-creme, #f5efe3);
}
.scan-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.scan-date {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--text-muted, #7a7974);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.scan-action {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.scan-action-reaktivierung { background: var(--premium-gold, #d4af37); color: var(--spaetburgunder, #421422); }
.scan-action-neues_angebot { background: var(--spaetburgunder, #421422); color: var(--riesling-creme, #f5efe3); }
.scan-action-nachlisting   { background: rgba(212, 175, 55, 0.3); color: var(--spaetburgunder, #421422); }
.scan-action-nichts        { background: var(--rebhang-gruen, #1a3b26); color: var(--riesling-creme, #f5efe3); }
.scan-action-offen         { background: rgba(122, 121, 116, 0.2); color: var(--text-muted, #7a7974); }
.scan-action-ignored       { background: rgba(122, 121, 116, 0.15); color: var(--text-muted, #7a7974); }

.scan-source {
  font-size: 11px;
  color: var(--spaetburgunder, #421422);
  text-decoration: none;
  margin-left: auto;
  border-bottom: 1px dashed var(--spaetburgunder, #421422);
}
.scan-source:hover { border-bottom-style: solid; }

.scan-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: baseline;
  padding: 4px 0;
}
.scan-label {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-muted, #7a7974);
}
.scan-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.scan-chip {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  border: 1px solid transparent;
}
.scan-chip-ok   { background: var(--spaetburgunder, #421422); color: var(--riesling-creme, #f5efe3); }
.scan-chip-comp { background: rgba(122, 121, 116, 0.15); color: var(--text-muted, #7a7974); border-color: var(--border, #e5e2d9); }
.scan-chip-miss { background: rgba(212, 175, 55, 0.25); color: var(--spaetburgunder, #421422); border-color: var(--premium-gold, #d4af37); }
.scan-chip-empty {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 11px;
  color: var(--text-muted, #7a7974);
}
.scan-findings {
  margin-top: 8px;
  padding: 10px 12px;
  border-left: 2px solid var(--spaetburgunder, #421422);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--spaetburgunder, #421422);
  line-height: 1.5;
  background: var(--surface, #fff);
}

.scan-reactivate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border, #e5e2d9);
}
.scan-reactivate-hint {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-muted, #7a7974);
}

/* Actions row */
.listing-detail-actions {
  display: flex;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e5e2d9);
  margin-top: 16px;
}
.btn-danger {
  background: transparent;
  color: var(--text-muted, #7a7974);
  border: 1px solid var(--border, #e5e2d9);
  padding: 8px 16px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
}
.btn-danger:hover {
  border-color: #a54040;
  color: #a54040;
}

.detail-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ============================================================
   Modal fuer "Neues Angebot anlegen"
   ============================================================ */
.listing-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 20, 22, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: listingModalFade 180ms ease-out;
}
@keyframes listingModalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.listing-modal-card {
  background: var(--surface, #F5EFE3);
  border: 1px solid var(--border, rgba(66, 20, 34, 0.15));
  border-radius: 4px;
  box-shadow: 0 24px 60px rgba(28, 20, 22, 0.35);
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: listingModalRise 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes listingModalRise {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.listing-modal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 22px 24px 14px;
  border-bottom: 1px solid var(--border, rgba(66, 20, 34, 0.12));
}
.listing-modal-head h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--spaetburgunder, #421422);
  margin: 0;
  letter-spacing: 0.2px;
}
.listing-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted, #7a7974);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  transition: color 120ms, background 120ms;
}
.listing-modal-close:hover {
  color: var(--spaetburgunder, #421422);
  background: rgba(66, 20, 34, 0.06);
}
.listing-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.listing-modal-body .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.listing-modal-body .field-label {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 12px;
  color: var(--spaetburgunder, #421422);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.listing-modal-body input,
.listing-modal-body select,
.listing-modal-body textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border, rgba(66, 20, 34, 0.2));
  border-radius: 3px;
  background: var(--surface-alt, #FBFBF9);
  color: var(--text, #28251D);
  transition: border-color 120ms;
}
.listing-modal-body input:focus,
.listing-modal-body select:focus,
.listing-modal-body textarea:focus {
  outline: none;
  border-color: var(--premium-gold, #d4af37);
}
.listing-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border, rgba(66, 20, 34, 0.12));
}

/* ============================================================
   Contact-Picker (Team aus Kontaktdaten uebernehmen)
   ============================================================ */
.contact-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contact-pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border, rgba(66, 20, 34, 0.15));
  border-radius: 3px;
  background: var(--surface-alt, #FBFBF9);
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.contact-pick-row:hover {
  border-color: var(--premium-gold, #d4af37);
  background: rgba(212, 175, 55, 0.06);
}
.contact-pick-row input[type="checkbox"] {
  accent-color: var(--spaetburgunder, #421422);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.contact-pick-info {
  flex: 1;
  min-width: 0;
}
.contact-pick-name {
  font-size: 14px;
  color: var(--text, #28251D);
  font-weight: 500;
}
.contact-pick-role {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-muted, #7a7974);
  margin-top: 2px;
}

/* Teilnehmer-Actions (Buttons nebeneinander im Tasting-Detail) */
.participant-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ============================================================
   Team-Sektion im Prospect-Drawer
   ============================================================ */
.team-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.team-member {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-left: 2px solid var(--premium-gold, #d4af37);
  background: rgba(212, 175, 55, 0.04);
}
.team-member-name {
  font-size: 13px;
  color: var(--text, #28251D);
}
.team-member-role {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 11px;
  color: var(--spaetburgunder, #421422);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.team-empty {
  font-size: 12px;
  color: var(--text-muted, #7a7974);
  font-style: italic;
  margin-top: 4px;
}

/* ============================================================
   Reaktivierungs-Banner im Prospect-Drawer
   ============================================================ */
.reactivation-banner {
  margin-top: 10px;
  padding: 12px 14px;
  border-left: 3px solid var(--premium-gold, #d4af37);
  background: linear-gradient(to right, rgba(212, 175, 55, 0.12), transparent 80%);
  border-radius: 3px;
}
.reactivation-title {
  font-family: 'Playfair Display', serif;
  font-size: 12px;
  color: var(--spaetburgunder, #421422);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.reactivation-body {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--spaetburgunder, #421422);
  line-height: 1.5;
  margin-bottom: 6px;
}
.reactivation-hint {
  font-size: 11px;
  color: var(--text-muted, #7a7974);
  letter-spacing: 0.3px;
}
