/* Hochzeitsdeko24 — Planer */

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--elfenbein);
}

/* ---------- Kopf ---------- */

#kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.2rem;
  border-bottom: 1px solid var(--linie);
  background: var(--karte);
  flex: none;
}

.marke {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--tinte);
  text-decoration: none;
}

.marke span {
  color: var(--rose);
}

.kopf-knoepfe {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.klein {
  background: transparent;
  border: 1px solid var(--linie);
  color: var(--tinte-leise);
  padding: 0.5em 0.9em;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.klein:hover:not(:disabled) {
  color: var(--rose);
  border-color: var(--rose-hell);
}

.klein:disabled {
  opacity: 0.35;
  cursor: default;
}

.klein-gold {
  padding: 0.55em 1.2em;
}

/* ---------- Hauptbereich ---------- */

main {
  flex: 1;
  display: grid;
  grid-template-columns: 296px 1fr 330px;
  min-height: 0;
}

.panel {
  background: var(--karte);
  border-right: 1px solid var(--linie);
  overflow-y: auto;
  overscroll-behavior: contain;
}

#panelListe {
  border-right: none;
  border-left: 1px solid var(--linie);
}

.panel-inhalt {
  padding: 1.1rem 1.1rem 3rem;
}

.panel h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--tinte);
  margin: 0 0 0.7rem;
}

.gruppe {
  margin-bottom: 1.7rem;
}

.gruppe h3 {
  border-bottom: 1px solid var(--linie-zart);
  padding-bottom: 0.4rem;
}

.gitter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.kachel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
  background: var(--elfenbein);
  border: 1px solid var(--linie-zart);
  border-radius: var(--r-klein);
  padding: 0.65rem 0.65rem 0.6rem;
  cursor: pointer;
  min-height: 64px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.kachel:hover {
  border-color: var(--rose-hell);
  background: var(--puder);
}

.kachel-titel {
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.3;
}

.kachel-unter {
  font-size: 0.72rem;
  color: var(--tinte-leise);
}

.alle {
  margin-top: 0.4rem;
  align-self: flex-start;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rose-hell);
  color: var(--rose);
  font-size: 0.7rem;
  padding: 0 0 1px;
  cursor: pointer;
}

/* ---------- Felder ---------- */

.feld {
  display: block;
  margin-bottom: 0.65rem;
}

.feld span {
  display: block;
  font-size: 0.73rem;
  color: var(--tinte-leise);
  margin-bottom: 0.22rem;
}

.feld input,
.feld select,
.feld textarea {
  width: 100%;
  background: var(--elfenbein);
  border: 1px solid var(--linie);
  border-radius: var(--r-klein);
  padding: 0.55em 0.65em;
}

.feld input:focus,
.feld select:focus,
.feld textarea:focus {
  border-color: var(--rose-hell);
}

.feld-paar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* ---------- Bühne ---------- */

#buehne {
  position: relative;
  background: radial-gradient(circle at 50% 42%, #fdf7f5 0%, #f3e6e3 100%);
  min-height: 0;
}

#raum {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

#raum:active {
  cursor: grabbing;
}

#werkzeuge {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--linie);
  border-radius: 999px;
  padding: 0.4rem 0.5rem;
  box-shadow: var(--schatten-zart);
  max-width: calc(100% - 2rem);
  overflow-x: auto;
}

.wz-name {
  font-size: 0.78rem;
  color: var(--tinte-leise);
  padding: 0 0.5rem 0 0.5rem;
  white-space: nowrap;
}

.wz {
  background: transparent;
  border: 1px solid var(--linie);
  color: var(--tinte);
  border-radius: 999px;
  padding: 0.35em 0.85em;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}

.wz:hover {
  border-color: var(--rose-hell);
  color: var(--rose);
}

.wz.an {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
}

.wz.gefahr:hover {
  border-color: var(--warnung);
  color: var(--warnung);
}

.wz.krone {
  border-color: var(--gold);
  color: #7c6234;
}

.wz.krone:hover {
  background: #f7f0e2;
  border-color: var(--gold);
  color: #6a5329;
}

.wz.rolle.an {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

#zoom {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

#zoom button {
  width: 38px;
  height: 38px;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--linie);
  color: var(--tinte);
  border-radius: 999px;
  cursor: pointer;
}

#zoom button:hover {
  color: var(--rose);
  border-color: var(--rose-hell);
}

#tipp {
  position: absolute;
  top: 0.9rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.76rem;
  color: var(--tinte-leise);
  background: rgba(255, 255, 255, 0.8);
  padding: 0.35em 0.9em;
  border-radius: 999px;
  pointer-events: none;
  max-width: calc(100% - 2rem);
  text-align: center;
}

/* ---------- Alarmleiste ---------- */

#alarm {
  margin: 0;
  padding: 0.7rem 1.2rem;
  background: #fbe9e3;
  border-bottom: 1px solid var(--warnung);
  color: #8f3d2a;
  font-size: 0.86rem;
  max-width: none;
  flex: none;
}

/* ---------- Tischordnung ---------- */

.abstand-oben {
  margin-top: 1.6rem !important;
}

.ordnung {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--linie-zart);
}

.ordnung-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ordnung-name {
  font-size: 0.89rem;
}

.ordnung.gesetzt .ordnung-name {
  color: var(--gold);
  font-weight: 500;
}

.ordnung-ort {
  font-size: 0.74rem;
  color: var(--tinte-leise);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ordnung-knopf {
  flex: none;
  background: transparent;
  border: 1px solid var(--linie);
  color: var(--tinte-leise);
  border-radius: 999px;
  padding: 0.3em 0.85em;
  font-size: 0.76rem;
  cursor: pointer;
}

.ordnung-knopf:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.ordnung:not(.gesetzt) .ordnung-knopf {
  border-color: var(--gold);
  color: #7c6234;
}

/* ---------- Stückliste ---------- */

.liste-kopf {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--tinte-leise);
  border-bottom: 1px solid var(--linie);
  padding-bottom: 0.5rem;
  margin-bottom: 0.6rem;
}

.pos {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--linie-zart);
}

.pos-text {
  display: flex;
  flex-direction: column;
}

.pos-name {
  font-size: 0.89rem;
}

.pos-detail {
  font-size: 0.74rem;
  color: var(--tinte-leise);
}

.pos-warnung {
  font-size: 0.74rem;
  color: var(--warnung);
}

.pos-summe {
  font-variant-numeric: tabular-nums;
  font-size: 0.89rem;
  white-space: nowrap;
}

.pos.knapp .pos-name {
  color: var(--warnung);
}

.leer {
  font-size: 0.85rem;
  color: var(--tinte-leise);
  border: 1px dashed var(--linie);
  border-radius: var(--r-klein);
  padding: 0.95rem;
  background: var(--elfenbein);
}

#summe {
  margin-top: 1rem;
  border-top: 1px solid var(--linie);
  padding-top: 0.8rem;
}

.summenzeile {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.22rem 0;
  font-variant-numeric: tabular-nums;
}

.summenzeile.leise {
  color: var(--tinte-leise);
  font-size: 0.85rem;
}

.summenzeile.gross {
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 400;
  align-items: baseline;
  margin-top: 0.4rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--linie);
  color: var(--rose);
}

.warnungen {
  margin-top: 0.8rem;
  border-left: 2px solid var(--warnung);
  padding: 0.55rem 0.8rem;
  background: #fbf0ec;
}

.warnungen p {
  margin: 0;
  font-size: 0.8rem;
}

.kleingedruckt {
  font-size: 0.72rem;
  color: var(--tinte-leise);
  line-height: 1.5;
  margin-top: 1rem;
}

/* ---------- Meldung ---------- */

#meldung {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--karte);
  border: 1px solid var(--rose-hell);
  border-radius: 999px;
  padding: 0.7em 1.3em;
  font-size: 0.85rem;
  box-shadow: var(--schatten);
  z-index: 40;
  max-width: 90vw;
}

/* ---------- Dialog ---------- */

dialog {
  background: var(--karte);
  color: var(--tinte);
  border: 1px solid var(--linie);
  border-radius: var(--r-gross);
  padding: 1.8rem;
  width: min(440px, 92vw);
  box-shadow: var(--schatten);
}

dialog::backdrop {
  background: rgba(74, 58, 66, 0.35);
}

dialog h2 {
  margin-top: 0;
  font-size: 2rem;
}

.dialog-summe {
  color: var(--rose);
  font-size: 0.92rem;
  margin-bottom: 1.2rem;
}

.dialog-knoepfe {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.dialog-knoepfe .knopf {
  flex: 1;
}

/* ---------- Tabs am Handy ---------- */

#tabs {
  display: none;
  border-top: 1px solid var(--linie);
  background: var(--karte);
  flex: none;
}

#tabs button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--tinte-leise);
  padding: 0.9em 0.5em;
  cursor: pointer;
}

@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
    position: relative;
  }

  .panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 68%;
    border: none;
    border-top: 1px solid var(--linie);
    border-radius: var(--r-gross) var(--r-gross) 0 0;
    transform: translateY(101%);
    transition: transform 0.24s ease;
    z-index: 20;
    box-shadow: var(--schatten);
  }

  body.zeigt-katalog #panelKatalog,
  body.zeigt-liste #panelListe {
    transform: translateY(0);
  }

  #buehne {
    grid-column: 1;
    grid-row: 1;
  }

  #tabs {
    display: flex;
  }

  body.zeigt-katalog #tabDeko,
  body.zeigt-liste #tabListe {
    color: var(--rose);
    box-shadow: inset 0 2px 0 var(--rose);
  }

  .kopf-knoepfe {
    overflow-x: auto;
    max-width: 60vw;
  }

  #kopf {
    padding: 0.55rem 0.8rem;
  }

  #tipp {
    display: none;
  }

  #werkzeuge {
    bottom: 0.7rem;
  }

  #zoom {
    bottom: 4.2rem;
  }
}

/* ---------- Druck ---------- */

#druck {
  display: none;
}

@media print {
  body {
    overflow: visible;
    background: #fff;
    color: #000;
  }

  #kopf,
  main,
  #tabs,
  #meldung,
  dialog {
    display: none !important;
  }

  #druck {
    display: block;
    padding: 1.5cm;
  }

  #druck h1 {
    font-family: var(--serif);
    font-weight: 300;
    font-size: 30pt;
    color: #000;
  }

  #druck img {
    width: 100%;
    max-height: 12cm;
    object-fit: contain;
    border: 1px solid #ddd;
    margin: 0.6cm 0;
  }

  #druck table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
  }

  #druck th,
  #druck td {
    border-bottom: 1px solid #e0d6d4;
    text-align: left;
    padding: 5px 6px;
  }

  #druck th:last-child,
  #druck td:last-child,
  #druck th:nth-child(2),
  #druck td:nth-child(2) {
    text-align: right;
  }

  #druckSumme {
    font-size: 13pt;
    font-weight: 700;
    margin-top: 0.5cm;
  }
}
