/* TravelSuites-App – Farben und Schriften der Website travelsuites.de (Navy, Gold, Sora, DM Sans);
   Lampen für Zustände, Schilder für Vorschläge, Not-Aus als Kill-Switch */

/* Schriften wie auf der Website, selbst ausgeliefert (SIL OFL 1.1, siehe schriften-OFL.txt) */
@font-face {
  font-family: "Sora";
  src: url("/app/sora-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/app/dm-sans-latin.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --pult: #f0f4f8;
  --tafel: #ffffff;
  --tafel-2: #f0f4f8;
  --tinte: #1c2e4a;
  --tinte-2: #3b547a;
  --linie: #d9e2ee;
  --gruen: #1e7a4c;
  --gruen-hell: #e3f4ea;
  --rot: #b3261e;
  --rot-hell: #fef2f2;
  --gelb: #d4af37;
  --gelb-hell: #faeec8;
  --marke: #1c2e4a;
  --marke-hell: #d9e2ee;
  --marke-auf: #ffffff;
  --gold: #d4af37;
  --gold-schrift: #c69a28;
  --seite-grund: #1c2e4a;
  --schatten: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --radius-gross: 18px;
  --radius: 12px;
  --radius-klein: 8px;
  --schrift: "DM Sans", system-ui, "Roboto", "Segoe UI", sans-serif;
  --schrift-titel: "Sora", "DM Sans", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --pult: #131e32;
    --tafel: #1c2e4a;
    --tafel-2: #2c3a53;
    --tinte: #f0f4f8;
    --tinte-2: #8aa7c6;
    --linie: #334564;
    --gruen: #4fbf86;
    --gruen-hell: #17332a;
    --rot: #ef6b5f;
    --rot-hell: #3d1f26;
    --gelb: #efc94d;
    --gelb-hell: #382010;
    --marke: #efc94d;
    --marke-hell: #382010;
    --marke-auf: #131e32;
    --gold-schrift: #d4af37;
    --seite-grund: #0e1728;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--pult);
  color: var(--tinte);
  font: 16px/1.5 var(--schrift);
  min-height: 100dvh;
}
#cockpit { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--marke); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Wortmarke wie auf der Website: „Travel“ in Schriftfarbe, „Suites“ in Gold */
.wortmarke { font-family: var(--schrift-titel); font-weight: 700; letter-spacing: -0.02em; }
.wortmarke span { color: var(--gold-schrift); }

/* Zustandsleiste oben: Logo, Wortmarke, Lampe (grün = Betrieb frei, rot = gesperrt) */
.leiste {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--tafel);
  border-bottom: 1px solid var(--linie);
}
.leiste-logo { width: 30px; height: 30px; flex: none; }
.leiste h1 { font-size: 1.1rem; margin: 0; flex: 1; }
.leiste.gesperrt { background: var(--rot); color: #fff; border-color: var(--rot); }
.leiste.gesperrt .wortmarke span { color: #fff; }
.leiste.gesperrt .leiste-logo { background: #fff; border-radius: 50%; padding: 2px; }
.lampe {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: var(--gruen); box-shadow: 0 0 0 3px var(--gruen-hell);
}
.lampe.gelb { background: var(--gelb); box-shadow: 0 0 0 3px var(--gelb-hell); }
.lampe.rot { background: var(--rot); box-shadow: 0 0 0 3px var(--rot-hell); }
.lampe.aus { background: var(--linie); box-shadow: none; }
.leiste.gesperrt .lampe { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); }
.leiste-text { font-size: 0.85rem; color: var(--tinte-2); }
.leiste.gesperrt .leiste-text { color: #fff; }

main { max-width: 640px; margin: 0 auto; padding: 16px; }
h2, h3 { font-family: var(--schrift-titel); letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 700; margin: 8px 0 4px; }
.unter { color: var(--tinte-2); margin: 0 0 16px; }
h3 { font-size: 1rem; font-weight: 700; margin: 24px 0 8px; }

/* Vorschlag: Nummernschild links, Inhalt rechts */
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vorschlag {
  display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start;
  width: 100%; text-align: left;
  background: var(--tafel); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--schatten);
}
.schild {
  display: flex; align-items: center; justify-content: center;
  height: 64px; border-radius: var(--radius-klein);
  background: var(--tinte); color: var(--tafel);
  font-family: var(--schrift-titel); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.03em;
  border-bottom: 6px solid var(--gruen);
}
.schild.mittel { border-bottom-color: var(--gelb); }
.schild.hoch { border-bottom-color: var(--rot); }
.schild::before { content: "#"; font-size: 0.85rem; font-weight: 600; opacity: 0.6; margin-right: 1px; }
.vorschlag-titel { font-weight: 650; margin: 0 0 4px; line-height: 1.35; }
.vorschlag-meta { font-size: 0.85rem; color: var(--tinte-2); margin: 0; }
.marke {
  display: inline-block; font-size: 0.78rem; font-weight: 650;
  padding: 1px 8px; border-radius: 999px; margin: 6px 6px 0 0;
  background: var(--tafel-2); color: var(--tinte-2);
}
.marke.dringend { background: var(--rot-hell); color: var(--rot); }
.marke.wartet { background: var(--marke-hell); color: var(--marke); }
.marke.ok { background: var(--gruen-hell); color: var(--gruen); }
.marke.warn { background: var(--gelb-hell); color: var(--tinte); }
.leer {
  background: var(--tafel); border: 1px dashed var(--linie); border-radius: var(--radius);
  padding: 24px 16px; color: var(--tinte-2); text-align: center;
}

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: var(--radius);
  border: 1px solid var(--linie); background: var(--tafel); font-weight: 650;
}
.knopf.voll { width: 100%; }
.knopf.gruen { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.knopf.rot { background: var(--rot); border-color: var(--rot); color: #fff; }
.knopf.blau { background: var(--marke); border-color: var(--marke); color: var(--marke-auf); }
/* Hauptaktion wie die Gold-Knöpfe der Website; Navy auf Gold 6,5 : 1 */
.knopf.gold { background: var(--gold); border-color: var(--gold); color: #1c2e4a; font-weight: 700; }
.knopf:disabled { opacity: 0.55; cursor: progress; }
@media (prefers-color-scheme: dark) {
  .knopf.gruen, .knopf.rot { color: #131e32; }
}
.knopfreihe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Bottom-Sheet für Entscheidungen */
dialog.blatt {
  margin: auto auto 0; width: 100%; max-width: 640px; max-height: 92dvh;
  border: 0; border-radius: var(--radius-gross) var(--radius-gross) 0 0;
  background: var(--tafel); color: var(--tinte);
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom, 0px));
}
dialog.blatt::backdrop { background: rgba(19, 30, 50, 0.6); }
.griff { width: 44px; height: 5px; border-radius: 3px; background: var(--linie); margin: 4px auto 14px; }
.blatt-kopf { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; }
.blatt-kopf .schild { height: 72px; font-size: 1.9rem; }
.blatt h2 { font-size: 1.2rem; line-height: 1.3; margin: 0 0 4px; }
.feld { display: grid; gap: 4px; margin: 16px 0; }
.feld span { font-size: 0.85rem; color: var(--tinte-2); }
.blatt p.begruendung { margin: 14px 0 0; }
.parameter {
  display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px;
  margin: 14px 0 6px; padding: 12px 14px; border-radius: var(--radius-klein);
  background: var(--tafel-2); border: 1px solid var(--linie); font-size: 0.92rem;
}
.parameter dt { color: var(--tinte-2); }
.parameter dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
textarea, input[type="text"] {
  width: 100%; border: 1px solid var(--linie); border-radius: var(--radius-klein);
  padding: 10px 12px; background: var(--tafel-2); resize: vertical;
}
.bestaetigung {
  margin: 16px 0; padding: 14px; border-radius: var(--radius);
  background: var(--tafel-2); border: 1px solid var(--linie);
}
.bestaetigung strong { display: block; font-size: 1.05rem; margin-top: 2px; }
.bestaetigung.rot { background: var(--rot-hell); border-color: var(--rot); }
.bestaetigung.gruen { background: var(--gruen-hell); border-color: var(--gruen); }

/* Lage: Melder mit Lampen */
.melder { list-style: none; margin: 0; padding: 0; background: var(--tafel); border: 1px solid var(--linie); border-radius: var(--radius); }
.melder li { display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--linie); }
.melder li:first-child { border-top: 0; }
.melder .wert { color: var(--tinte-2); font-size: 0.9rem; text-align: right; font-variant-numeric: tabular-nums; }
.pips { display: inline-flex; gap: 4px; vertical-align: middle; }
.pips i { width: 14px; height: 14px; border-radius: 4px; background: var(--linie); }
.pips i.an { background: var(--marke); }

/* Not-Aus: roter Pilz auf gelber Platte – das eine laute Element */
.notaus-feld { display: grid; justify-items: center; gap: 10px; margin: 8px 0 24px; text-align: center; }
.notaus {
  width: 168px; height: 168px; border-radius: 28px; border: 0; padding: 0;
  background: var(--gelb);
  display: grid; place-items: center;
}
.notaus span {
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--rot); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; line-height: 1.15;
  border: 6px solid rgba(0, 0, 0, 0.18);
}
.notaus:active span { transform: scale(0.96); }
.notaus.gesperrt { background: var(--tafel-2); outline: 3px solid var(--rot); outline-offset: -3px; }
.notaus.gesperrt span { background: var(--tafel); color: var(--rot); border-color: var(--rot); }
.notaus-text { color: var(--tinte-2); max-width: 32ch; margin: 0; }

/* Protokoll */
.filter { display: flex; gap: 8px; margin: 0 0 12px; overflow-x: auto; scrollbar-width: none; }
.filter button { border: 1px solid var(--linie); background: var(--tafel); border-radius: 999px; padding: 6px 14px; white-space: nowrap; }
.filter button[aria-pressed="true"] { background: var(--marke); border-color: var(--marke); color: var(--marke-auf); }
.eintrag { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--linie); }
.eintrag time { font-size: 0.85rem; color: var(--tinte-2); font-variant-numeric: tabular-nums; padding-top: 2px; }
.eintrag p { margin: 0; }
.eintrag .was { font-weight: 600; }
.eintrag .warum { font-size: 0.88rem; color: var(--tinte-2); overflow-wrap: anywhere; }
.eintrag.auffaellig .was { color: var(--rot); }

/* Navigation unten */
nav.unten {
  position: fixed; inset: auto 0 0 0; z-index: 5;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--tafel); border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
nav.unten a {
  display: grid; justify-items: center; gap: 2px; padding: 10px 0 12px;
  color: var(--tinte-2); text-decoration: none; font-size: 0.82rem; font-weight: 600;
}
nav.unten a svg { width: 24px; height: 24px; }
nav.unten a[aria-current="page"] { color: var(--marke); box-shadow: inset 0 3px 0 var(--gold); }
.zahl {
  min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--rot); color: #fff;
  font-size: 0.72rem; line-height: 18px; text-align: center; margin-left: 4px;
}

/* Anmeldung */
.tor { min-height: 100dvh; display: grid; align-content: center; gap: 18px; max-width: 420px; margin: 0 auto; padding: 24px; }
.tor-logo { width: 112px; height: 112px; }
.tor h1 { font-size: 2.4rem; line-height: 1.05; margin: 0; }
.tor p { margin: 0; color: var(--tinte-2); }
.hinweis-fehler { color: var(--rot); font-weight: 600; }

/* Meldungen */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  max-width: 608px; margin: 0 auto; padding: 12px 16px; border-radius: var(--radius);
  background: var(--tinte); color: var(--tafel); font-weight: 600;
}
.toast.fehler { background: var(--rot); color: #fff; }
.band {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--marke-hell); color: var(--tinte); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px;
}
.band .knopf { min-height: 40px; padding: 0 14px; }

/* Heute und Agenten: Kacheln, Karten, Spalten (schmal untereinander, breit nebeneinander) */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 18px; }
.kachel {
  display: grid; gap: 2px; padding: 12px 14px;
  background: var(--tafel); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten);
}
.kachel span { font-size: 0.85rem; color: var(--tinte-2); }
.kachel strong {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--schrift-titel); font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere;
}
.spalten { display: grid; gap: 0 28px; }
.nur-breit { display: none; }
.karte {
  margin: 0 0 14px; padding: 14px 16px;
  background: var(--tafel); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten);
}
.karte h3 { margin: 0 0 10px; }
.karte h4 { margin: 16px 0 6px; font-size: 0.88rem; font-weight: 650; color: var(--tinte-2); }
.karte .liste { gap: 8px; }
.karte .eintrag:first-of-type { border-top: 0; }
.karte h3 ~ h3 { margin: 12px 0 2px; font-size: 0.85rem; font-weight: 650; color: var(--tinte-2); }
.punkte { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.agent-marken { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.agent-marken .marke { margin: 0; }
.agent-karte {
  display: grid; grid-template-columns: 12px 1fr; gap: 2px 10px; align-items: center;
  padding: 12px 14px; color: inherit; text-decoration: none;
  background: var(--tafel); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten);
}
.agent-karte strong { font-family: var(--schrift-titel); }
.agent-karte p { grid-column: 2; margin: 0; font-size: 0.9rem; color: var(--tinte-2); }
.hinweis {
  margin: 18px 0 0; padding: 12px 14px; font-size: 0.9rem; color: var(--tinte-2);
  border: 1px dashed var(--linie); border-radius: var(--radius);
}

/* Seitenleiste: nur breit (Desktop), Farben wie der dunkle Kopf der Website */
.seitenleiste { display: none; }
.seitenleiste :focus-visible { outline-color: var(--gold); }
.marke-kopf { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.marke-kopf .wortmarke { font-size: 1.25rem; color: #fff; }
.marke-kopf .wortmarke span { color: var(--gold); }
.seiten-zustand {
  display: flex; align-items: center; gap: 8px; margin: 0 4px 14px; padding: 8px 10px;
  border-radius: var(--radius-klein); background: rgba(255, 255, 255, 0.07); font-size: 0.85rem;
}
.seiten-zustand.gesperrt { background: #b3261e; color: #fff; }
.seiten-zustand.gesperrt .lampe { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); }
.seitennav { display: grid; gap: 2px; }
.seitennav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-klein);
  color: #d9e2ee; text-decoration: none; font-weight: 550;
}
.seitennav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.seitennav a[aria-current="page"] { background: #2c3a53; color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.seitennav svg { width: 20px; height: 20px; flex: none; }
.seitennav .zahl { margin-left: auto; }
.seitennav .lampe { width: 9px; height: 9px; margin: 0 5px; box-shadow: none; }
.seitennav .lampe.aus { background: #6384ab; }
.nav-titel { margin: 18px 10px 4px; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: #8aa7c6; }
.nav-leer { margin: 4px 10px; font-size: 0.85rem; color: #8aa7c6; }
.notaus-klein {
  margin-top: auto; min-height: 48px; border: 0; border-radius: var(--radius);
  background: #b3261e; color: #fff; font-weight: 700; box-shadow: inset 0 0 0 4px var(--gold);
}
.notaus-klein.gesperrt { background: transparent; box-shadow: inset 0 0 0 2px #ef6b5f; }

@media (min-width: 900px) {
  #cockpit { display: grid; grid-template-columns: 252px minmax(0, 1fr); padding-bottom: 0; }
  .seitenleiste {
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: 18px 12px; background: var(--seite-grund); color: #d9e2ee;
  }
  .leiste, nav.unten { display: none; }
  main { grid-column: 2; width: 100%; max-width: 1180px; margin: 0; padding: 28px 40px 48px; }
  h2 { font-size: 1.85rem; }
  .spalten { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .nur-breit { display: block; }
  .spalten > div > h3:first-child { margin-top: 0; }
  .notaus-feld { margin-top: 0; }
  .band { max-width: 760px; }
  dialog.blatt { margin: auto; max-width: 560px; border-radius: var(--radius-gross); padding: 20px 24px 24px; }
  .griff { display: none; }
  .toast { left: auto; right: 24px; bottom: 24px; max-width: 420px; }
}

@media (prefers-reduced-motion: no-preference) {
  dialog.blatt[open] { animation: hoch 180ms ease-out; }
  @keyframes hoch { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
}
