/* Inhaber-Ansicht: für das Tablet im Laden gemacht, geht auch am Handy und am Rechner.
   Links eine Leiste mit den Bereichen (Heute, Bestellungen, Chats, Laden, Testchat), rechts der Bereich.
   Chats wie bei WhatsApp: links die Liste, rechts das Gespräch. Am Handy: Leiste unten.
   Farben und Schrift kommen aus design.css, das Grundgerüst (Leiste, Kopf, Kacheln) aus shell.css. */

/* Status einer Bestellung */
.st { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.st.neu { background: #DBEAFE; color: #1D4ED8; }
.st.zubereitung { background: var(--warn-soft); color: #92400E; }
.st.fertig { background: var(--accent-soft); color: #14532D; }
.st.abgeholt { background: var(--surface-2); color: var(--muted); }
.st.nicht_abgeholt, .st.storniert { background: var(--danger-soft); color: var(--danger); }
.st.test { background: #F3E8FF; color: #7E22CE; }

/* ---------- Bestellungen ---------- */
.ih-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.seg { display: inline-flex; }
.ih-card .seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ih-card .seg button { padding: 8px 4px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.ih-slot { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 0 4px; }
.ih-slot b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ih-slot span { font-size: 13px; color: var(--muted); }
.ih-slot.voll span { color: var(--danger); font-weight: 600; }
.ih-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.ih-orders .ih-slot { grid-column: 1 / -1; }
.order { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.order.frisch { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.order.st-storniert { opacity: 0.75; }
.o-head { display: flex; align-items: flex-start; gap: 12px; }
.o-zeit { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.o-zeit small { display: block; font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.o-wer { flex: 1 1 auto; min-width: 0; }
.o-wer b { font-size: 16px; font-weight: 650; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-wer span { font-size: 13px; color: var(--muted); }
.o-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.o-lines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.o-lines li { display: flex; gap: 8px; }
.o-lines li em { color: var(--warn); font-style: normal; font-weight: 600; }
.o-note { background: var(--surface-2); border-radius: 8px; padding: 7px 10px; font-size: 13px; color: var(--ink); }
.o-note.warn { background: var(--warn-soft); color: #92400E; font-weight: 600; }
.o-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); padding-top: 10px; border-top: 1px solid var(--line); }
.o-meta b { font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.druck.ok { color: var(--accent); }
.druck.warn { color: var(--warn); font-weight: 600; }
.druck.err { color: var(--danger); font-weight: 600; }
.o-status { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.o-status button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 9px 6px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.o-status button:hover { border-color: var(--muted); color: var(--ink); }
.o-status button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.o-mehr { display: flex; flex-wrap: wrap; gap: 6px; }
.storno-box { display: flex; flex-wrap: wrap; gap: 8px; }
.storno-box input { flex: 1 1 200px; min-width: 0; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 12px; background: var(--surface); }
.bon-box { background: var(--surface-2); border-radius: 10px; padding: 12px; overflow-x: auto; display: flex; flex-direction: column; gap: 10px; }
.bon { font-family: var(--font-mono); font-size: 12px; line-height: 1.35; background: #fff; color: #111; padding: 12px; border-radius: 4px; width: max-content; max-width: 100%; box-shadow: var(--shadow-sm); }
.bon-zeile { white-space: pre; min-height: 1.35em; }
.bon-zeile.fett { font-weight: 700; }
.bon-zeile.gross { font-size: 1.6em; font-weight: 700; }
.bon-zeile.mitte { text-align: center; }
.bon-zeile.klein { font-size: 0.85em; }
.bon-zeile.schnitt { color: #999; text-align: center; }
#druckbereich { display: none; }

/* ---------- Chats ---------- */
.ih-page.chats { padding: 0; gap: 0; flex: 1 1 auto; min-height: 0; }
.ih-chats { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); height: calc(100dvh - 72px); min-height: 480px; border-top: 1px solid var(--line); }
.ih-chatliste { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.ih-suche { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ih-suche input { width: 100%; border: 0; background: var(--surface-2); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.ih-suche input:focus { outline: 2px solid var(--accent-soft); }
.ih-chatliste-inhalt { overflow-y: auto; flex: 1 1 auto; }
.ih-chat-gruppe { padding: 10px 16px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.ih-chat-gruppe.warn { color: #B45309; }
.ih-chatzeile { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 10px 16px; border: 0; background: transparent; text-align: left; cursor: pointer; border-bottom: 1px solid var(--line); }
.ih-chatzeile:hover { background: var(--surface-2); }
.ih-chatzeile[aria-current="true"] { background: #F0FDF4; }
.ih-avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 16px; color: #fff; flex: 0 0 auto; }
.ih-avatar.klein { width: 40px; height: 40px; font-size: 15px; }
.ih-chat-mitte { min-width: 0; }
.ih-chat-mitte b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ih-chat-mitte div { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ih-chat-rechts { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ih-chat-rechts .ih-badge { height: 20px; min-width: 20px; font-size: 11px; }
.ih-gespraech { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--chat-bg); }
.ih-gespraech-kopf { display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ih-gespraech-kopf .ih-wer b { font-size: 16px; }
.ih-zurueck { border: 0; background: transparent; font-size: 22px; line-height: 1; padding: 6px 8px 6px 0; cursor: pointer; color: var(--accent); display: none; }
.ih-gespraech-aktionen { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ih-mehr { position: relative; }
.ih-mehr > summary { list-style: none; cursor: pointer; }
.ih-mehr > summary::-webkit-details-marker { display: none; }
.ih-mehr-menue { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; gap: 2px; min-width: 240px; }
.ih-mehr-menue .btn { border: 0; text-align: left; justify-content: flex-start; width: 100%; background: transparent; }
.ih-mehr-menue .btn:hover:not(:disabled) { background: var(--surface-2); }
.ih-mehr-menue .ih-hinweis-zeile { font-size: 13px; color: var(--danger); padding: 6px 12px; font-weight: 600; }
.thread { flex: 1 1 auto; overflow-y: auto; padding: 18px 6% 12px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.msg { display: flex; flex-direction: column; max-width: min(72%, 560px); }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.them { align-self: flex-start; align-items: flex-start; }
.bubble { padding: 7px 11px 6px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .meta { font-size: 11px; color: #667781; margin: 2px 6px 4px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.opt { border-radius: 10px; padding: 8px 14px; cursor: pointer; font-size: 14px; }
.opt:disabled { opacity: 0.6; cursor: default; }
.opt small { display: block; color: var(--muted); font-weight: 400; }
.ih-systemzeile { align-self: center; background: #FFF7ED; color: #9A3412; font-size: 12.5px; padding: 6px 12px; border-radius: 8px; box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13); max-width: 90%; text-align: center; }
.ih-tag-trenner { align-self: center; background: #fff; color: #54656F; font-size: 12px; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13); margin: 6px 0; }
.typing { align-self: flex-start; background: #fff; border-radius: 12px; padding: 8px 14px; font-size: 13px; color: var(--muted); }
.composer { display: flex; gap: 10px; padding: 10px 16px; background: #F0F2F5; border-top: 1px solid var(--line); }
.composer input { flex: 1 1 auto; min-width: 0; border: 0; border-radius: 22px; padding: 11px 18px; font-size: 15px; background: #fff; }
.composer input:focus { outline: 2px solid var(--accent-soft); }
.composer .btn { border-radius: 22px; }
.ih-gespraech-bestellungen { background: var(--surface); border-top: 1px solid var(--line); }
.ih-gespraech-bestellungen > summary { padding: 10px 18px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.ih-gespraech-bestellungen .ih-orders { padding: 0 18px 16px; max-height: 45vh; overflow-y: auto; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ih-gespraech-leer { flex: 1 1 auto; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.ih-gespraech-leer div { max-width: 340px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ih-gespraech-leer svg { width: 56px; height: 56px; color: var(--line-strong); }

/* ---------- Laden heute ---------- */
.ih-laden { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ih-laden .breit { grid-column: 1 / -1; }
.ih-card.ih-mein-laden { flex-direction: row; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: linear-gradient(135deg, #F0FDF4, #FFFFFF 60%); }
.ih-mein-laden > div { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; }
.ih-ausverkauft { display: flex; flex-direction: column; gap: 12px; }
.ih-ausverkauft-kat { font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ih-chips-wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.ih-wahl { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 14px; font-size: 14px; cursor: pointer; background: var(--surface); user-select: none; }
.ih-wahl input { position: absolute; opacity: 0; pointer-events: none; }
.ih-wahl:hover { border-color: var(--muted); }
.ih-wahl.an { background: var(--danger-soft); border-color: #FCA5A5; color: var(--danger); font-weight: 600; text-decoration: line-through; }
.ih-wahl.arten.an { background: var(--accent-soft); border-color: #86EFAC; color: #14532D; text-decoration: none; }
.ih-wahl:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.check input { width: 18px; height: 18px; }
.einst-feld { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.einst-feld input { width: 120px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 12px; background: var(--surface); color: var(--ink); }
.sect { font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }

/* ---------- Testchat ---------- */
.ih-testchat { max-width: 720px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; height: calc(100dvh - 140px); min-height: 480px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.ih-testchat .ih-gespraech-kopf .tb-field { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ih-testchat .ih-gespraech-kopf input { width: 120px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; background: var(--surface); }
.ih-testchat .leer { align-self: center; color: #54656F; background: #fff; padding: 8px 14px; border-radius: 10px; font-size: 13px; margin-top: 12px; }

@media (max-width: 900px) {
  .ih-chats { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); }
  .ih-laden { grid-template-columns: minmax(0, 1fr); }
  .msg { max-width: 86%; }
  .thread { padding-inline: 4%; }
}
/* Handy: Leiste unten, Chats als Liste oder Gespräch */
@media (max-width: 700px) {
  .ih-chats { grid-template-columns: minmax(0, 1fr); }
  .ih-chats.offen .ih-chatliste { display: none; }
  .ih-chats:not(.offen) .ih-gespraech { display: none; }
  .ih-zurueck { display: inline-block; }
  .ih-orders { grid-template-columns: minmax(0, 1fr); }
  .ih-chats { height: calc(100dvh - 68px - 62px); }
  .ih-testchat { height: calc(100dvh - 68px - 120px); }
  .o-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Vollbild für neue Bestellungen (Laden ohne Küchendrucker) ----------
   Liegt über allem, bis jemand „OK" tippt. Farbe oben: grün = Neue Bestellung (laut),
   blau = Vorbestellung (leise), orange = Jetzt zubereiten (Erinnerung, laut). */
.ih-vollbild { position: fixed; inset: 0; z-index: 1000; display: flex; padding: 16px; background: rgba(15, 23, 42, 0.55); }
.ih-vollbild[hidden] { display: none; }
.vb-karte { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; background: var(--surface); border-radius: 20px; border-top: 14px solid var(--accent); box-shadow: var(--shadow); padding: 24px 28px; }
.vb-karte.vor { border-top-color: var(--info); }
.vb-karte.erinnerung { border-top-color: var(--warn); }
.vb-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.vb-titel { font-size: 24px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.vb-karte.vor .vb-titel { color: var(--info); }
.vb-karte.erinnerung .vb-titel { color: var(--warn); }
.vb-nr { font-size: 24px; font-weight: 700; color: var(--muted); }
.vb-weitere { margin-left: auto; padding: 6px 14px; border-radius: 999px; background: var(--danger-soft); color: var(--danger); font-size: 16px; font-weight: 700; }
.vb-haupt { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 36px; }
.vb-zeit b { font-size: clamp(56px, 9vw, 96px); font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.vb-zeit span { margin-left: 8px; font-size: 24px; font-weight: 600; color: var(--muted); }
.vb-wer { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vb-bestellart { align-self: flex-start; padding: 4px 12px; border-radius: 8px; background: var(--surface-2); font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.vb-wer b { font-size: clamp(26px, 3.5vw, 38px); font-weight: 750; overflow-wrap: anywhere; }
.vb-zeilen { margin: 0; padding: 16px 0; list-style: none; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: clamp(22px, 2.8vw, 30px); font-weight: 600; }
.vb-zeilen li { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.vb-zeilen em { color: var(--warn); font-style: normal; font-weight: 700; }
.vb-notiz { padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-size: 20px; }
.vb-notiz.warn { background: var(--warn-soft); color: #92400E; font-weight: 700; }
.vb-fuss { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; font-size: 18px; color: var(--muted); }
.vb-fuss b { font-size: 28px; color: var(--ink); font-variant-numeric: tabular-nums; }
.vb-ok { margin-top: auto; min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 18px; border: 0; border-radius: 16px; background: var(--accent); color: #fff; cursor: pointer; }
.vb-ok:hover, .vb-ok:focus-visible { background: var(--accent-hover); }
.vb-ok-gross { font-size: 44px; font-weight: 800; line-height: 1.1; }
.vb-ok-klein { font-size: 18px; font-weight: 600; opacity: 0.9; }
@media (max-width: 700px) {
  .ih-vollbild { padding: 8px; }
  .vb-karte { padding: 18px; gap: 14px; }
}

/* Bon im Browser drucken: nur der Bon */
@media print {
  body.drucken > *:not(#druckbereich) { display: none !important; }
  body.drucken #druckbereich { display: block !important; }
  body.drucken .bon { box-shadow: none; padding: 0; }
}
