:root {
  --brand: #ff6a00;
  --brand-dark: #d95700;
  --ink: #1d1d1f;
  --muted: #6b6b70;
  --line: #e7e5e2;
  --bg: #f7f5f2;
  --card: #fff;
  --ok: #1f9d55;
  --warn: #c98a00;
  --bad: #d23b3b;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: inherit; }
h1 { font-size: 1.6rem; margin: 0 0 .75rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1.25rem; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.25rem; text-decoration: none; }
.logo-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); box-shadow: inset -5px -5px 0 rgba(0,0,0,.12); }
#nav { display: flex; gap: .25rem; margin-left: auto; flex-wrap: wrap; align-items: center; }
#nav a { text-decoration: none; padding: .45rem .75rem; border-radius: 999px; font-size: .92rem; }
#nav a:hover { background: var(--bg); }
#nav a.active { background: var(--ink); color: #fff; }
.cart-badge { background: var(--brand); color: #fff; border-radius: 999px; padding: 0 .45rem; margin-left: .3rem; font-size: .78rem; }

main { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.loader { padding: 3rem; text-align: center; color: var(--muted); }

/* Elemente */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.stack > * + * { margin-top: .75rem; }
.two-col { display: grid; grid-template-columns: 1fr 340px; gap: 1.25rem; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

button, .btn { font: inherit; border: 0; border-radius: 10px; padding: .6rem 1rem; cursor: pointer;
  background: var(--brand); color: #fff; font-weight: 600; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: var(--brand-dark); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary, .btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.secondary:hover { background: var(--bg); }
button.danger { background: var(--bad); }
button.ok { background: var(--ok); }
button.small { padding: .35rem .65rem; font-size: .85rem; }
button.icon { padding: .2rem .6rem; background: var(--bg); color: var(--ink); border: 1px solid var(--line); }

input, select, textarea { font: inherit; width: 100%; padding: .6rem .7rem; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .25rem; }
.field { margin-bottom: .8rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 .8rem; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; }
.check input { width: auto; }

/* Hero */
.hero { background: linear-gradient(120deg, var(--brand), #ff9a3c); color: #fff; border-radius: 22px;
  padding: 2.2rem 1.6rem; margin-bottom: 1.5rem; }
.hero h1 { font-size: 2rem; }
.hero form { display: flex; gap: .5rem; max-width: 420px; margin-top: 1rem; }
.hero input { border: 0; }
.hero button { background: var(--ink); }

/* Restaurantkarte */
.rest { overflow: hidden; padding: 0; text-decoration: none; display: block; transition: transform .12s; }
.rest:hover { transform: translateY(-2px); }
.rest-img { height: 130px; background: #ffd9bd center/cover; display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem; font-weight: 800; color: rgba(0,0,0,.18); }
.rest-body { padding: .9rem 1rem; }
.rest.closed { opacity: .6; }
.pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; background: var(--bg); border: 1px solid var(--line); }
.pill.ok { background: #e6f6ec; border-color: #bfe6cd; color: var(--ok); }
.pill.warn { background: #fff5dc; border-color: #f2dc9b; color: #8a5f00; }
.pill.bad { background: #fde8e8; border-color: #f4c2c2; color: var(--bad); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: .75rem 0 1rem; }
.chips button { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem; font-weight: 500; }
.chips button.on { background: var(--ink); color: #fff; }

/* Speisekarte */
.menu-item { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.menu-item:last-child { border-bottom: 0; }
.cart { position: sticky; top: 80px; }
.cart-line { display: flex; justify-content: space-between; gap: .5rem; align-items: center; padding: .35rem 0; }
.sum { display: flex; justify-content: space-between; padding: .2rem 0; }
.sum.total { font-weight: 800; font-size: 1.1rem; border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .6rem; }

/* Status-Tracker */
.steps { display: flex; gap: .4rem; margin: 1rem 0; }
.steps div { flex: 1; text-align: center; font-size: .8rem; color: var(--muted); }
.steps div::before { content: ""; display: block; height: 6px; border-radius: 3px; background: var(--line); margin-bottom: .4rem; }
.steps div.done { color: var(--ink); font-weight: 600; }
.steps div.done::before { background: var(--brand); }

/* Tabellen */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table-wrap { overflow-x: auto; }

.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button { background: none; color: var(--muted); border-radius: 0; border-bottom: 3px solid transparent; padding: .6rem .9rem; }
.tabs button.on { color: var(--ink); border-color: var(--brand); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.kpi .v { font-size: 1.5rem; font-weight: 800; }
.kpi .l { font-size: .8rem; color: var(--muted); }

.order-card { border-left: 5px solid var(--line); }
.order-card.s-placed { border-left-color: var(--bad); animation: pulse 1.6s infinite; }
.order-card.s-accepted, .order-card.s-preparing { border-left-color: var(--warn); }
.order-card.s-ready, .order-card.s-picked_up { border-left-color: var(--ok); }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(210,59,59,.15); } }

.stars button { background: none; color: #d0cdc8; font-size: 1.8rem; padding: 0 .1rem; }
.stars button.on { color: #f5a623; }

#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 50; }
#toast div { background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 10px; margin-top: .5rem; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
#toast div.err { background: var(--bad); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }

/* Kontotyp-Auswahl bei der Registrierung */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.choice label { margin: 0; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: block; border: 2px solid var(--line); border-radius: 12px; padding: .75rem; height: 100%; font-weight: 500; }
.choice span strong { display: block; }
.choice span small { color: var(--muted); }
.choice input:checked + span { border-color: var(--brand); background: #fff4ec; }
.choice input:focus-visible + span { outline: 2px solid var(--brand); }
.restfields { border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem .2rem; margin: 0 0 .9rem; }
.restfields legend { font-weight: 700; padding: 0 .3rem; }

/* Gewerbeanmeldung */
.doc-previews { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.doc-previews img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.doc-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.doc-gallery figure { margin: 0; }
.doc-gallery img { width: 100%; height: 160px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; background: #fff; }
.doc-gallery figcaption { font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.doc-gallery .missing { height: 160px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: .8rem; }
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow-y: auto; }
.modal-box { background: #fff; border-radius: 16px; padding: 1.1rem; width: min(900px, 100%); }
.modal-body { margin-top: .8rem; }
