/* BS Panel · Verwaltung für Kundenseiten */

@font-face { font-family: 'Marcellus'; src: url('/fonts/marcellus-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/fonts/figtree-latin-wght-normal.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }

:root {
  --bg: #F6F3EE;
  --card: #FFFFFF;
  --line: #E8E1D6;
  --ink: #221A15;
  --ink-2: #6B5D52;
  --acento: #2D4CF0;                /* wird je Kundenseite gesetzt */
  --acento-soft: color-mix(in srgb, var(--acento) 11%, white);
  --acento-hover: color-mix(in srgb, var(--acento) 82%, black);
  --oro: #C8A24E;
  --ok: #1E9E5A;
  --ok-soft: #E3F5EB;
  --warn: #B45309;
  --warn-soft: #FDF0DD;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(34,26,21,.05), 0 8px 24px -12px rgba(34,26,21,.12);
  --sans: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Marcellus', Georgia, serif;
  --nav-h: 68px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; flex: none; }

/* Laden */
.loading { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-primary { background: var(--acento); color: #fff; }
.btn-primary:hover { background: var(--acento-hover); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: #fff; }
.btn-soft { background: var(--acento-soft); color: var(--acento); }
.btn-wa { background: #1A9E50; color: #fff; }
.btn-danger-ghost { background: transparent; color: #B42318; }
.btn-small { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--card); }

/* Anmeldung */
.login { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 50% 0%, #FFF 0%, var(--bg) 60%); }
.login-card { width: min(420px, 100%); background: var(--card); border-radius: 24px; padding: 32px 26px; box-shadow: var(--shadow); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.login-bs { width: 150px; height: auto; margin-bottom: 6px; }
.login-step { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.login h1 { margin: 0; font: 700 26px/1.2 var(--sans); }
.login-step > p, .login-card > p { margin: 0; color: var(--ink-2); }
.login .field { text-align: left; }
.login-card form { margin: 0; width: 100%; }
.login-card form .btn { margin-top: 4px; }
.sent-icon { width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.sent-icon svg { width: 28px; height: 28px; }
.login-debug { font-size: 13px; background: var(--warn-soft); color: var(--warn); padding: 10px; border-radius: 10px; word-break: break-all; }
.login-debug a { color: inherit; font-weight: 700; }
.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg); gap: 2px; }
.lang-switch button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.lang-switch button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.form-error { margin: 0; color: #B42318; font-weight: 600; font-size: 14px; text-align: left; }

/* Grundgerüst */
.app { min-height: 100svh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 16px; height: 62px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 28px; height: 35px; object-fit: contain; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand strong { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.site-select { min-height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); padding: 4px 8px; font-size: 14px; max-width: 180px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--card); border-top: 1px solid var(--line);
}
.tabs a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; color: var(--ink-2); font-size: 11.5px; font-weight: 600;
}
.tabs a svg { width: 22px; height: 22px; }
.tabs a[aria-current="page"] { color: var(--acento); }
.tabs a[aria-current="page"] svg { background: var(--acento-soft); border-radius: 10px; box-sizing: content-box; padding: 3px 10px; margin: -3px 0; }
.tab-badge {
  position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #D92D20; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center;
}

.view { padding: 20px 16px 120px; max-width: 880px; margin: 0 auto; outline: none; }
.view-head { margin-bottom: 18px; }
.view-head h1 { margin: 0; font: 700 28px/1.15 var(--sans); letter-spacing: -.01em; }
.view-head p { margin: 6px 0 0; color: var(--ink-2); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card-link { text-decoration: none; color: inherit; }
.card-link > svg { margin-left: auto; color: #B9AEA2; }
.card h2 { margin: 0 0 4px; font: 700 17px/1.3 var(--sans); }
.card .sub, .sub { margin: 0; color: var(--ink-2); font-size: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid2 > .card { margin-bottom: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.section-title { margin: 26px 0 10px; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.sheet .section-title { margin-top: 18px; }

/* Status */
.status-card { display: flex; align-items: center; gap: 14px; }
.status-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); flex: none; }
.status-icon.open { background: var(--ok-soft); color: var(--ok); }
.status-icon.news { background: var(--acento-soft); color: var(--acento); }
.status-card strong { display: block; font-size: 18px; }
.status-card span { color: var(--ink-2); font-size: 14px; }
.status-card .btn { margin-left: auto; }
.thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; }

/* Schalter-Zeilen */
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row:first-child { padding-top: 0; }
.row-text { flex: 1 1 auto; min-width: 0; }
.row-text strong { display: block; font-weight: 700; }
.row-text span { color: var(--ink-2); font-size: 14px; }
.switch {
  position: relative; width: 52px; height: 32px; border-radius: 999px; border: 0; cursor: pointer; flex: none;
  background: #D9D2C7; transition: background .2s ease;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s ease;
}
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch.danger[aria-checked="true"] { background: #D92D20; }

/* Felder */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field label, .field .label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: #FDFCFA;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--oro); outline-offset: 0; border-color: var(--oro); background: #fff; }
.prefix { position: relative; }
.prefix span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.prefix input { padding-left: 42px; }
details.translate { margin-top: 4px; }
details.translate summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--acento); padding: 6px 0; list-style: none; display: flex; align-items: center; gap: 6px; }
details.translate summary::-webkit-details-marker { display: none; }
details.translate summary::before { content: "＋"; font-weight: 800; }
details.translate[open] summary::before { content: "−"; }

/* Mittagstisch */
.day-card { display: grid; grid-template-columns: 120px 1fr; gap: 16px; }
.day-label { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.day-label strong { font-size: 16px; text-transform: capitalize; }
.tag { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--acento-soft); color: var(--acento); white-space: nowrap; }
.tag.muted { background: var(--bg); color: var(--ink-2); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.photo {
  position: relative; width: 120px; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--bg);
  border: 1.5px dashed var(--line); display: grid; place-items: center; color: var(--ink-2); cursor: pointer;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .photo-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; text-align: center; padding: 6px; }
.photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo.busy::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.7); }
.photo.busy .spinner { position: absolute; z-index: 1; width: 26px; height: 26px; }
.photo-actions { display: flex; gap: 6px; margin-top: 8px; }
.photo-actions button { border: 0; background: transparent; color: var(--acento); font-size: 13px; font-weight: 700; cursor: pointer; padding: 2px 0; }

/* Pizzas */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 220px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }
.search input { width: 100%; min-height: 46px; padding: 10px 12px 10px 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pizza-list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.pizza-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.pizza-row:last-child { border-bottom: 0; }
.pizza-main { flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; cursor: pointer; padding: 4px 0; display: flex; align-items: center; gap: 8px; }
.pizza-main .txt { min-width: 0; flex: 1; }
.pizza-main strong { display: block; font-weight: 700; }
.pizza-main span { display: block; color: var(--ink-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pizza-main svg { color: #B9AEA2; }
.pizza-row.off strong { color: var(--ink-2); text-decoration: line-through; }
.pizza-row .state { font-size: 12px; font-weight: 700; color: var(--ok); min-width: 76px; text-align: right; }
.pizza-row.off .state { color: #B42318; }
.carta-head { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.carta-head .section-title { margin: 0; }
.carta-head .btn { margin-left: auto; }
.list-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.empty { padding: 28px; text-align: center; color: var(--ink-2); }

/* Postfach */
.msg { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 12px; border-left: 4px solid transparent; }
.msg.nuevo { border-left-color: var(--acento); }
.msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.msg-head time { margin-left: auto; font-size: 13px; color: var(--ink-2); }
.msg h3 { margin: 0; font-size: 17px; }
.msg-when { margin: 2px 0 10px; font-weight: 700; color: var(--acento); }
.msg ul { margin: 0 0 8px; padding-left: 18px; }
.msg dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0 0 8px; font-size: 14.5px; }
.msg dt { color: var(--ink-2); }
.msg dd { margin: 0; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Öffnungszeiten */
.day-row { display: grid; grid-template-columns: 110px auto 1fr; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.day-row:last-child { border-bottom: 0; }
.day-row strong { text-transform: capitalize; }
.shifts { display: flex; flex-direction: column; gap: 8px; }
.shift { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.shift .who { width: 74px; font-weight: 700; }
.shift input, .row input[type="time"] { min-height: 40px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: #FDFCFA; width: 108px; }
.closed-text { color: var(--ink-2); font-size: 14px; }
.special-list { list-style: none; padding: 0; margin: 0 0 12px; }
.special-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.special-list li div { flex: 1; }
.special-list strong { display: block; }
.special-list span { color: var(--ink-2); font-size: 14px; }
.add-special { display: grid; grid-template-columns: 170px 1fr auto; gap: 10px; align-items: end; margin-top: 12px; }

/* Hinweis-Vorschau */
.preview { background: #1A2620; border-radius: var(--radius); padding: 28px 18px; display: grid; place-items: center; }
.preview-box { width: min(360px, 100%); background: #FAF5EC; border-radius: 18px; padding: 24px 22px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); }
.preview-box .k { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--acento); display: flex; align-items: center; gap: 8px; }
.preview-box .k::before { content: ""; width: 24px; height: 2px; background: var(--oro); }
.preview-box h3 { margin: 8px 0 6px; font: 400 26px/1.15 var(--serif); color: var(--acento); }
.preview-box p { margin: 0; color: #5E4E43; font-size: 15px; }
.preview.off .preview-box { opacity: .4; }

/* Menü und Versionen */
.menu-user { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.versions { list-style: none; margin: 10px 0 0; padding: 0; }
.versions li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.versions li div { flex: 1; min-width: 0; }
.versions strong { display: block; font-size: 15px; }
.versions span { color: var(--ink-2); font-size: 13px; }

/* Speichern-Leiste und Hinweise */
.savebar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); z-index: 45;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px;
  background: var(--ink); color: #fff; border-radius: 16px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.45);
  max-width: 856px; margin: 0 auto; font-weight: 600; font-size: 14px;
}
.savebar > span { display: flex; align-items: center; gap: 8px; }
.savebar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--oro); }
.savebar div { display: flex; gap: 6px; }
.savebar .btn-ghost { color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.savebar .btn-ghost:hover { background: rgba(255,255,255,.08); }
.toast {
  position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 60; width: max-content; max-width: calc(100% - 32px);
  background: var(--ok); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
}
.toast.error { background: #B42318; }
.toast a { color: #fff; }

/* Fenster */
.sheet { border: 0; padding: 0; width: min(560px, 100%); max-height: 92svh; border-radius: 22px; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.sheet::backdrop { background: rgba(34,26,21,.45); }
.sheet form { display: flex; flex-direction: column; max-height: 92svh; margin: 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 8px 20px; }
.sheet-head h2 { margin: 0; font: 700 20px/1.2 var(--sans); }
.sheet-body { padding: 8px 20px; overflow: auto; }
.sheet-foot { display: flex; justify-content: space-between; gap: 10px; padding: 14px 20px 20px; border-top: 1px solid var(--line); }

/* Desktop: Navigation links */
@media (min-width: 900px) {
  .app { padding-bottom: 0; padding-left: 232px; }
  .topbar { margin-left: -232px; padding: 10px 24px; }
  .tabs {
    top: 62px; bottom: 0; right: auto; width: 232px; height: auto; grid-auto-flow: row; grid-auto-rows: min-content; grid-auto-columns: auto;
    padding: 18px 14px 14px; border-top: 0; border-right: 1px solid var(--line); gap: 4px; z-index: 20;
  }
  .tabs a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: 15px; }
  .tabs a:hover { background: var(--card); }
  .tabs a[aria-current="page"] { background: var(--acento-soft); }
  .tabs a[aria-current="page"] svg { background: none; padding: 0; margin: 0; }
  .tab-badge { position: static; margin-left: auto; }
  .view { padding: 32px 28px 120px; }
  .savebar { left: calc(232px + 28px); right: 28px; bottom: 20px; }
}

@media (max-width: 560px) {
  .topbar #view-site span { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .day-card { grid-template-columns: 96px 1fr; gap: 12px; }
  .photo { width: 96px; }
  .day-row { grid-template-columns: 1fr auto; }
  .day-row .shifts { grid-column: 1 / -1; }
  .shift .who { width: 100%; }
  .add-special { grid-template-columns: 1fr; }
  .pizza-row .state { display: none; }
  .site-select { max-width: 120px; }
  .status-card { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .switch, .switch::after, .btn { transition: none; }
  .spinner { animation-duration: 2s; }
}
