/* ============================================================
   AKTUELLE PREISE — Variablen-/Editiermodus
   Macht Preise und Datum als benannte Variablen eingebbar,
   speichert sie lokal und erlaubt Export/Import (JSON).
   ============================================================ */

/* ---- Floating action button (Editiermodus starten) ---- */
.pe-fab {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 20px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--paper);
  background: var(--navy);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(20, 45, 86, 0.22);
  transition: transform 0.18s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.pe-fab:hover {
  background: #0f244a;
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(20, 45, 86, 0.28);
}
.pe-fab .pe-fab-ico {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
body.pe-editing .pe-fab { display: none; }

/* ---- Bottom toolbar (während des Editierens) ---- */
.pe-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px clamp(16px, 4vw, 40px);
  background: var(--navy);
  color: var(--paper);
  box-shadow: 0 -8px 28px rgba(20, 45, 86, 0.2);
}
body.pe-editing .pe-bar { display: flex; }

.pe-bar-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.pe-bar-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.pe-bar-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
.pe-field {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}
.pe-field label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.pe-field input {
  font-family: var(--font);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
  background: var(--paper);
  border: 0;
  border-radius: 7px;
  padding: 8px 12px;
  width: 130px;
}
.pe-field input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.pe-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pe-btn {
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 9px 15px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.pe-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}
.pe-btn.is-primary {
  color: var(--navy);
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 600;
}
.pe-btn.is-primary:hover {
  background: #ffad1f;
}
.pe-btn.is-danger:hover {
  background: rgba(220, 80, 80, 0.25);
  border-color: rgba(220, 80, 80, 0.5);
}

/* saved flash */
.pe-flash {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.pe-flash.show { opacity: 1; }

/* ---- Editable cells ---- */
body.pe-editing {
  padding-bottom: 92px; /* room for toolbar */
}
body.pe-editing .pt-price,
body.pe-editing .pt-date {
  cursor: text;
  border-radius: 6px;
  box-shadow: inset 0 -1px 0 rgba(246, 159, 0, 0.55);
  transition: background 0.15s ease, box-shadow 0.15s ease;
  padding: 2px 6px;
  margin: -2px -6px;
}
body.pe-editing .pt-price:hover,
body.pe-editing .pt-date:hover {
  background: rgba(246, 159, 0, 0.08);
}
body.pe-editing .pt-price:focus,
body.pe-editing .pt-date:focus {
  outline: none;
  background: rgba(246, 159, 0, 0.12);
  box-shadow: inset 0 0 0 2px var(--gold);
}
/* date cells are driven by the toolbar field — show as read-only-ish */
body.pe-editing .pt-date {
  cursor: default;
  box-shadow: inset 0 -1px 0 rgba(20, 45, 86, 0.18);
}
body.pe-editing .pt-date:hover { background: transparent; }

/* ---- Export / Import modal ---- */
.pe-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 30, 60, 0.45);
}
.pe-modal.open { display: flex; }
.pe-modal-card {
  width: min(620px, 100%);
  background: var(--paper);
  border-radius: 16px;
  padding: clamp(24px, 4vw, 36px);
  box-shadow: 0 30px 80px rgba(20, 45, 86, 0.35);
}
.pe-modal-card h3 {
  font-family: var(--font);
  font-weight: 600;
  font-size: 20px;
  color: var(--navy);
  margin: 0 0 6px;
}
.pe-modal-card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 0 0 16px;
}
.pe-modal-card textarea {
  width: 100%;
  height: 220px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--navy);
  background: var(--bg-soft);
  border: 1px solid rgba(20, 45, 86, 0.15);
  border-radius: 10px;
  padding: 14px;
  resize: vertical;
}
.pe-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.pe-modal-actions .pe-btn {
  color: var(--navy);
  background: var(--bg-soft);
  border-color: rgba(20, 45, 86, 0.15);
}
.pe-modal-actions .pe-btn:hover {
  background: rgba(20, 45, 86, 0.06);
}
.pe-modal-actions .pe-btn.is-primary {
  color: var(--navy);
  background: var(--gold);
  border-color: var(--gold);
}

@media (max-width: 720px) {
  .pe-bar { gap: 12px; padding: 12px 16px; }
  .pe-bar-left { gap: 12px; width: 100%; justify-content: space-between; }
  .pe-bar-right { width: 100%; }
  .pe-btn { flex: 1; text-align: center; }
}

@media print {
  .pe-fab, .pe-bar, .pe-modal { display: none !important; }
}
