/* =============================================================================
   LUP Reservierung - Dashboard
   Gebaut fuer ein iPad im Service: grosse Flaechen, hoher Kontrast, nichts,
   was man mit dem Finger verfehlt. Dunkel, weil es abends im Lokal steht.
   ========================================================================== */

:root {
  --grund:     #10151A;
  --flaeche:   #172029;
  --flaeche-2: #1E2A35;
  --linie:     #2C3B49;
  --schrift:   #E8EDF2;
  --leise:     #93A3B3;

  --gold:      #D3AA63;
  --frei:      #2F4A3A;
  --frei-rand: #4C7A5E;
  --belegt:    #4A3A2A;
  --belegt-rand:#9A7440;
  --da:        #2A4256;
  --da-rand:   #4B7FA8;
  --warnung:   #6B3535;
  --warnung-rand: #A85555;

  --tipp: 3rem;              /* Mindestgroesse fuer Fingerziele */
}

* { box-sizing: border-box; }

body {
  margin: 0; background: var(--grund); color: var(--schrift);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--gold); }
button, input, select, textarea { font: inherit; }

/* --- Kopf ----------------------------------------------------------------- */
.kopf {
  position: sticky; top: 0; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem;
  padding: .8rem 1rem; background: var(--flaeche); border-bottom: 1px solid var(--linie);
}
.kopf h1 { font-size: 1.05rem; margin: 0; font-weight: 600; }
.kopf .datum { color: var(--leise); font-size: .9rem; }
.schub { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: var(--tipp); padding: 0 1.1rem;
  background: var(--flaeche-2); color: var(--schrift);
  border: 1px solid var(--linie); border-radius: 6px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.knopf:hover { border-color: var(--gold); }
.knopf.wichtig { background: var(--gold); color: #16120A; border-color: var(--gold); font-weight: 600; }
.knopf.stumm { background: transparent; color: var(--leise); }
.knopf.klein { min-height: 2.25rem; padding: 0 .7rem; font-size: .85rem; }

/* --- Kennzahlen ----------------------------------------------------------- */
.zahlen { display: flex; gap: 1.75rem; flex-wrap: wrap; padding: .9rem 1rem; border-bottom: 1px solid var(--linie); }
.zahl .wert { font-size: 1.5rem; font-weight: 600; line-height: 1; }
.zahl .was { color: var(--leise); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; margin-top: .3rem; }
.zahl.warnt .wert { color: var(--gold); }

/* --- Umschalter ----------------------------------------------------------- */
.reiter { display: flex; gap: .35rem; padding: .75rem 1rem 0; }
.reiter button {
  min-height: 2.6rem; padding: 0 1.1rem; border-radius: 6px 6px 0 0;
  background: transparent; color: var(--leise); border: 1px solid transparent; border-bottom: none; cursor: pointer;
}
.reiter button[aria-selected="true"] { background: var(--flaeche); color: var(--schrift); border-color: var(--linie); }

.tafel { display: none; padding: 1rem; }
.tafel.aktiv { display: block; }

/* --- Raumplan ------------------------------------------------------------- */
.zeitregler {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px;
  padding: .75rem 1rem; margin-bottom: 1rem;
}
.zeitregler input[type=range] { flex: 1; min-width: 12rem; accent-color: var(--gold); height: var(--tipp); }
.zeitregler .uhr { font-size: 1.6rem; font-weight: 600; min-width: 4.5em; font-variant-numeric: tabular-nums; }

.bereich-titel { color: var(--leise); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: 1.25rem 0 .6rem; }
.raum { position: relative; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; overflow: auto; }
.raum-inner { position: relative; }

.tisch {
  position: absolute; border: 2px solid var(--frei-rand); background: var(--frei);
  border-radius: 6px; padding: .35rem; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; line-height: 1.15; overflow: hidden;
}
.tisch.rund { border-radius: 50%; }
.tisch .nr { font-weight: 700; font-size: 1rem; }
.tisch .info { font-size: .68rem; color: var(--leise); }
.tisch.belegt { background: var(--belegt); border-color: var(--belegt-rand); }
.tisch.belegt .info { color: #E0C79B; }
.tisch.da { background: var(--da); border-color: var(--da-rand); }
/* Gast ueber die Zeit hinaus noch da (nicht als gegangen markiert) */
.tisch.ueberzogen { background: var(--belegt); border: 2px dashed #E0A040; }
.tisch.ueberzogen .info { color: #F2C27A; }
/* ...und die naechste Reservation ist fuer diesen Tisch schon dran */
.tisch.konflikt { background: #4A2622; border: 2px solid #E0604A; box-shadow: 0 0 0 3px rgba(224,96,74,.25); }
.tisch.konflikt .info { color: #FFB4A6; font-weight: 600; }
.tisch.da .info { color: #BBD8EE; }
.tisch.ziel { outline: 3px dashed var(--gold); outline-offset: 2px; }
.tisch.gewaehlt { outline: 3px solid var(--gold); outline-offset: 2px; }

/* --- Zeitachse ------------------------------------------------------------ */
.achse { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; }
.achse table { border-collapse: collapse; min-width: 55rem; width: 100%; }
.achse th, .achse td { border-bottom: 1px solid var(--linie); }
.achse th.tischspalte {
  position: sticky; left: 0; z-index: 2; background: var(--flaeche);
  text-align: left; padding: .5rem .75rem; font-weight: 600; width: 7.5rem; min-width: 7.5rem;
}
.achse .stunden td { color: var(--leise); font-size: .75rem; padding: .4rem 0; text-align: left; }
.achse .spur { position: relative; height: 2.9rem; }
.achse .raster { position: absolute; inset: 0; }
.achse .raster span { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--linie); }
.balken {
  position: absolute; top: .3rem; bottom: .3rem;
  background: var(--belegt); border: 1px solid var(--belegt-rand); border-radius: 4px;
  padding: .15rem .45rem; font-size: .78rem; overflow: hidden; white-space: nowrap;
  cursor: pointer; text-overflow: ellipsis;
}
.balken.da { background: var(--da); border-color: var(--da-rand); }
.balken.ueberschrieben { background: var(--warnung); border-color: var(--warnung-rand); }

/* --- Liste ---------------------------------------------------------------- */
.liste { display: grid; gap: .6rem; }
.eintrag {
  display: grid; gap: .25rem 1rem; align-items: center;
  grid-template-columns: 4.5rem 1fr auto;
  background: var(--flaeche); border: 1px solid var(--linie); border-left-width: 4px;
  border-radius: 8px; padding: .8rem 1rem; cursor: pointer;
}
.eintrag.da { border-left-color: var(--da-rand); }
.eintrag.no_show { border-left-color: var(--warnung-rand); opacity: .6; }
.eintrag.ueberschrieben { border-left-color: var(--gold); }
.eintrag .zeit { font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.eintrag .wer { font-weight: 600; }
.eintrag .dazu { color: var(--leise); font-size: .85rem; grid-column: 2; }
.eintrag .merk { color: var(--gold); font-size: .85rem; grid-column: 2; }
.marke.gold { border-color: var(--gold); color: var(--gold); }
.marke { display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
         border: 1px solid var(--linie); border-radius: 999px; padding: .1rem .5rem; color: var(--leise); }

/* --- Panel rechts --------------------------------------------------------- */
.panel {
  position: fixed; inset: 0 0 0 auto; width: min(26rem, 100%); z-index: 50;
  background: var(--flaeche); border-left: 1px solid var(--linie);
  transform: translateX(100%); transition: transform .22s ease;
  display: flex; flex-direction: column; overflow-y: auto; padding: 1.25rem;
}
.panel.offen { transform: none; }
.panel h2 { margin: 0 0 .25rem; font-size: 1.25rem; }
.panel .zeile { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--linie); }
.panel .zeile span:first-child { color: var(--leise); }
.panel .knopfreihe { display: grid; gap: .5rem; margin-top: 1.25rem; }
@media (min-width: 30rem) { .panel .knopfreihe.zweispaltig { grid-template-columns: 1fr 1fr; } }

.dunkler { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; display: none; }
.dunkler.offen { display: block; }

/* --- Formular im Panel ---------------------------------------------------- */
.feld { margin-bottom: .9rem; }
.feld label { display: block; font-size: .75rem; color: var(--leise); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .3rem; }
.feld input, .feld select, .feld textarea {
  width: 100%; min-height: var(--tipp); padding: .6rem .75rem;
  background: var(--grund); color: var(--schrift);
  border: 1px solid var(--linie); border-radius: 6px;
}
.feld textarea { min-height: 5rem; }
.feld input:focus, .feld select:focus, .feld textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.zweierreihe { display: grid; gap: .9rem; grid-template-columns: 1fr 1fr; }

.meldung { padding: .8rem 1rem; border-radius: 6px; margin: .75rem 0; font-size: .9rem; }
.meldung.warnt { background: var(--warnung); border: 1px solid var(--warnung-rand); }
.meldung.gut { background: var(--frei); border: 1px solid var(--frei-rand); }

.leerhinweis { color: var(--leise); padding: 2.5rem 1rem; text-align: center; }

/* --- Anmelden ------------------------------------------------------------- */
.anmeldung { max-width: 22rem; margin: 12vh auto; padding: 2rem; background: var(--flaeche);
             border: 1px solid var(--linie); border-radius: 10px; }
.anmeldung h1 { margin-top: 0; font-size: 1.2rem; }

/* --- Drucken -------------------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .kopf, .reiter, .schub, .panel, .dunkler { display: none !important; }
  .druck table { width: 100%; border-collapse: collapse; }
  .druck th, .druck td { border-bottom: 1px solid #999; padding: .35rem .4rem; text-align: left; }
}

/* --- Als App auf dem iPad -------------------------------------------------
   Im Vollbild-Modus fehlt die Safari-Leiste; die Statusleiste des iPads legt
   sich sonst ueber unsere Kopfzeile. viewport-fit=cover + diese Polster
   halten alles frei - auch links/rechts im Querformat mit Kamera-Aussparung. */
.kopf {
  padding-top: calc(1.15rem + env(safe-area-inset-top));
  padding-left: calc(var(--rand, 1rem) + env(safe-area-inset-left));
  padding-right: calc(var(--rand, 1rem) + env(safe-area-inset-right));
}
.zahlen, .reiter, .tafel {
  padding-left: calc(1rem + env(safe-area-inset-left));
  padding-right: calc(1rem + env(safe-area-inset-right));
}
.panel { padding-top: calc(1.25rem + env(safe-area-inset-top)); padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }

/* Finger statt Maus: kein Zoom beim Antippen eines Feldes (iOS zoomt bei
   Schriftgroessen unter 16px hinein und kommt nicht mehr zurueck). */
.feld input, .feld select, .feld textarea, .anmeldung input { font-size: 16px; }

/* Lange Listen mit dem Finger schwungvoll scrollen */
.achse, .raum, .panel { -webkit-overflow-scrolling: touch; }

/* Kein blaues Aufblitzen beim Tippen */
.tisch, .balken, .eintrag, .knopf { -webkit-tap-highlight-color: transparent; }

/* --- Auswertung ------------------------------------------------------------ */
.zahlen.gross { gap: 2.5rem; padding: 1.5rem 1rem; }
.zahlen.gross .wert { font-size: 2.4rem; }
.trend { font-size: .78rem; color: var(--leise); margin-top: .35rem; }
.trend.auf { color: var(--frei-rand); }
.trend.ab { color: var(--warnung-rand); }

.balkenliste { display: grid; gap: .5rem; margin-bottom: .5rem; }
.balkenzeile {
  display: grid; align-items: center; gap: .75rem;
  grid-template-columns: 6.5rem 1fr auto auto;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 6px; padding: .55rem .9rem;
}
@media (max-width: 40rem) {
  .balkenzeile { grid-template-columns: 5rem 1fr; }
  .balkenzeile .zahl-rechts, .balkenzeile .zusatz { grid-column: 2; text-align: left; }
}
.balkenzeile .beschriftung { font-weight: 600; }
.balken-spur { height: .65rem; background: var(--grund); border-radius: 999px; overflow: hidden; }
.balken-fuell { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.balkenzeile .zahl-rechts { font-variant-numeric: tabular-nums; white-space: nowrap; }
.balkenzeile .zusatz { color: var(--leise); font-size: .82rem; white-space: nowrap; min-width: 8rem; text-align: right; }

.spalten { display: grid; gap: 1.5rem 2.5rem; margin-top: 1.5rem; }
@media (min-width: 48rem) { .spalten { grid-template-columns: 1fr 1fr; } }

.tabelle { width: 100%; border-collapse: collapse; }
.tabelle td { padding: .5rem .25rem; border-bottom: 1px solid var(--linie); }
.tabelle td.rechts { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabelle td.leise { color: var(--leise); font-size: .85rem; }

.fussnote { color: var(--leise); font-size: .8rem; margin: .5rem 0 1.5rem; max-width: 46em; }

@media print {
  .zahlen.gross { gap: 1.5rem; }
  .balken-fuell { background: #666 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .balkenzeile, .tabelle td { border-color: #999 !important; }
}

/* --- Einstellungen --------------------------------------------------------- */
.einstellblock {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px;
  padding: 1.25rem; margin-bottom: 1rem;
}
.einstellzeile {
  display: grid; align-items: center; gap: .5rem 1rem;
  grid-template-columns: 11rem minmax(12rem, 22rem) 1fr;
  padding: .45rem 0;
}
@media (max-width: 44rem) { .einstellzeile { grid-template-columns: 1fr; } }
.einstellzeile label { color: var(--leise); font-size: .9rem; }
.einstellzeile input, .einstellzeile select {
  width: 100%; min-height: var(--tipp); padding: .6rem .75rem;
  background: var(--grund); color: var(--schrift);
  border: 1px solid var(--linie); border-radius: 6px; font-size: 16px;
}
.einstellzeile input:focus, .einstellzeile select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.einstellzeile .hilfe { color: var(--leise); font-size: .8rem; }
.mitEinheit { display: flex; align-items: center; gap: .6rem; }
.mitEinheit input { max-width: 7rem; }
.mitEinheit .einheit { color: var(--leise); font-size: .85rem; white-space: nowrap; }
.einstellfuss { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--linie); }

.dauerraster { display: grid; gap: .5rem; }
@media (min-width: 52rem) { .dauerraster { grid-template-columns: 1fr 1fr; gap: .5rem 2rem; } }
.dauerpaar { display: flex; align-items: center; gap: .5rem; color: var(--leise); font-size: .9rem; }
.dauerpaar input {
  width: 5rem; min-height: 2.75rem; padding: .5rem .6rem; font-size: 16px;
  background: var(--grund); color: var(--schrift); border: 1px solid var(--linie); border-radius: 6px;
}
code { background: var(--grund); padding: .1rem .35rem; border-radius: 3px; font-size: .9em; }

/* --- Gaesteliste ----------------------------------------------------------- */
.res-suchleiste { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.res-suchleiste input[name=suche] {
  flex: 1; min-width: 14rem; min-height: var(--tipp); padding: .6rem .9rem; font-size: 16px;
  background: var(--flaeche); color: var(--schrift); border: 1px solid var(--linie); border-radius: 6px;
}
.kaestchen { display: flex; align-items: center; gap: .5rem; color: var(--leise); font-size: .9rem; white-space: nowrap; }
.kaestchen input { width: 1.2rem; height: 1.2rem; accent-color: var(--gold); }

.eintrag.gastzeile { grid-template-columns: 1fr auto; text-decoration: none; color: inherit; }
.gastzahlen { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; font-size: .85rem; }
.gastzahlen .warn { color: var(--warnung-rand); }
.gastzahlen .leise { color: var(--leise); }

/* --- Hauptnavigation ------------------------------------------------------- */
.kopf-marke { min-width: 0; }
.hauptnavi { display: flex; gap: .25rem; flex-wrap: wrap; }
.hauptnavi a {
  display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 .95rem;
  color: var(--leise); text-decoration: none; border-radius: 6px;
  border: 1px solid transparent; white-space: nowrap;
}
.hauptnavi a:hover { color: var(--schrift); background: var(--flaeche-2); }
.hauptnavi a.hier {
  color: var(--gold); background: var(--flaeche-2); border-color: var(--gold);
  font-weight: 600;
}
@media (max-width: 52rem) {
  .kopf { gap: .5rem .75rem; }
  .hauptnavi { order: 3; width: 100%; }
  .hauptnavi a { flex: 1; justify-content: center; padding: 0 .5rem; font-size: .9rem; }
}
