/* elfino Einkaufsliste – dunkles CI wie die Landingpage */
@font-face {
  font-family: 'Vonique 43';
  src: url('/fonts/vonique43.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050505;
  --bg-2: #101010;
  --bg-3: #181818;
  --line: #262626;
  --text: #f1eee8;
  --dim: #b5b0a6;
  --gold: #b97f24;
  --gold-soft: #d29b3f;
  --pink: #ff007b;
  --ok: #4caf7d;
  --error: #e5484d;
  --warn: #e0a83a;
  --radius: 12px;
  --head: 'Vonique 43', 'Julius Sans One', sans-serif;
  --body: 'Jost', system-ui, sans-serif;
  --topbar: 56px;
  --bottomnav: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--head); font-weight: normal; letter-spacing: .04em; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; color: var(--gold-soft); }
h2 { font-size: 1.25rem; color: var(--gold-soft); }
h3 { font-size: 1rem; color: var(--text); letter-spacing: .08em; text-transform: uppercase; }
p { margin: 0 0 1em; }
a { color: var(--gold-soft); }
.dim { color: var(--dim); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.hidden { display: none !important; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: .75rem; }
.mt { margin-top: 1.5rem; }

/* Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: rgba(5, 5, 5, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: .5rem; text-decoration: none; }
.brand-main { font-family: var(--head); font-size: 1.4rem; color: var(--gold); letter-spacing: .08em; }
.brand-sub { font-family: var(--body); font-weight: 300; color: var(--dim); letter-spacing: .12em; text-transform: uppercase; font-size: .75rem; }
.topnav { display: flex; gap: .25rem; align-items: center; }
.topnav a, .topnav button {
  color: var(--dim); text-decoration: none; padding: .4rem .7rem; border-radius: 8px; font-size: .9rem;
  background: none; border: 0; font-family: inherit; cursor: pointer;
}
.topnav a.active, .topnav a:hover, .topnav button:hover { color: var(--text); background: var(--bg-3); }
.topnav .user { color: var(--gold-soft); }

/* Inhalt */
.app {
  max-width: 960px; margin: 0 auto;
  padding: 20px 16px calc(var(--bottomnav) + 96px);
}
@media (min-width: 720px) { .app { padding-bottom: 120px; } }

/* Fußnavigation (Handy) */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  height: calc(var(--bottomnav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: rgba(5, 5, 5, .96); border-top: 1px solid var(--line);
}
.bottomnav:empty { display: none; }
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--dim); text-decoration: none; font-size: .72rem; letter-spacing: .04em;
}
.bottomnav a svg { width: 22px; height: 22px; }
.bottomnav a.active { color: var(--gold-soft); }
@media (min-width: 720px) { .bottomnav { display: none; } }
@media (max-width: 719px) { .topnav .desktop-only { display: none; } }

/* Karten, Listen */
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.section { margin-top: 1.5rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 500; }
.list .meta { color: var(--dim); font-size: .875rem; }
.empty { color: var(--dim); text-align: center; padding: 2rem 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: 0 18px; border-radius: 10px;
  font-family: inherit; font-size: 1rem; font-weight: 500; letter-spacing: .02em;
  border: 1px solid var(--gold); background: var(--gold); color: #0b0b0b; cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--gold-soft); border-color: var(--gold-soft); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--dim); background: var(--bg-3); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--gold-soft); padding: 0 10px; }
.btn.ghost:hover { background: var(--bg-3); }
.btn.danger { background: transparent; color: var(--error); border-color: transparent; }
.btn.danger:hover { background: rgba(229, 72, 77, .12); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn.icon { width: 44px; padding: 0; }

/* Formulare */
label { display: block; font-size: .85rem; color: var(--dim); margin-bottom: 4px; letter-spacing: .03em; }
.field { margin-bottom: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--bg-3); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 1rem;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold-soft); outline-offset: 2px;
}
input::placeholder { color: #6f6a62; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 1rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }
.form-error { color: var(--error); font-size: .9rem; margin: 6px 0 0; }
.form-hint { color: var(--dim); font-size: .85rem; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 540px) { .grid2 { grid-template-columns: 1fr; } }

/* Anmeldung */
.auth { max-width: 420px; margin: 8vh auto 0; }
.auth h1 { margin-bottom: .25em; }

/* Suche und Chips */
.search { position: sticky; top: var(--topbar); z-index: 10; background: var(--bg); padding: 4px 0 8px; margin: -8px 0 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; min-height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--bg-3); color: var(--dim); border: 1px solid var(--line); font-family: inherit; font-size: .9rem; cursor: pointer;
}
.chip.active { background: var(--gold); color: #0b0b0b; border-color: var(--gold); }

/* Produktzeile mit Stepper */
.product { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.product:last-child { border-bottom: 0; }
.product .info { flex: 1; min-width: 0; }
.product .name { font-weight: 500; }
.product .meta { color: var(--dim); font-size: .875rem; }
.product.in-cart .name { color: var(--gold-soft); }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-3); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; color: var(--text); font-size: 1.4rem; cursor: pointer; border-radius: 10px; }
.stepper button:hover { background: #222; }
.stepper button:disabled { color: #555; cursor: default; }
.stepper input { width: 48px; height: 44px; min-height: 0; text-align: center; border: 0; background: none; padding: 0; font-size: 1.05rem; font-weight: 500; border-radius: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper.active { border-color: var(--gold); }

/* Klebrige Zusammenfassung */
.summary {
  position: fixed; left: 0; right: 0; bottom: calc(var(--bottomnav) + env(safe-area-inset-bottom)); z-index: 15;
  padding: 10px 16px; background: rgba(16, 16, 16, .97); border-top: 1px solid var(--line);
}
@media (min-width: 720px) { .summary { bottom: 0; } }
.summary-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.summary .total { font-weight: 500; }
.summary .total .num { color: var(--gold-soft); margin-left: .35rem; }

/* Status */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--line); color: var(--dim); }
.badge.ok { color: var(--ok); border-color: rgba(76, 175, 125, .5); }
.badge.err { color: var(--error); border-color: rgba(229, 72, 77, .5); }
.badge.warn { color: var(--warn); border-color: rgba(224, 168, 58, .5); }
.badge.gold { color: var(--gold-soft); border-color: var(--gold); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); flex: 0 0 auto; }
.status-dot.ok { background: var(--ok); }
.status-dot.err { background: var(--error); }
.status-dot.warn { background: var(--warn); }

/* Tabellen */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--dim); font-weight: 500; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
td.actions { white-space: nowrap; text-align: right; }
tr:hover td { background: rgba(255, 255, 255, .02); }

/* Dialog */
.dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); color: var(--text); padding: 0; width: min(520px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(0, 0, 0, .7); }
.dialog form, .dialog .dialog-body { padding: 20px; }
.dialog h2 { margin-bottom: 1rem; }
.dialog .buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* Toasts */
.toasts { position: fixed; left: 16px; right: 16px; bottom: calc(var(--bottomnav) + 80px); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 720px) { .toasts { bottom: 90px; } }
.toast { pointer-events: auto; background: #1d1d1d; border: 1px solid var(--line); color: var(--text); padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); display: flex; gap: 12px; align-items: center; max-width: 520px; }
.toast.ok { border-color: rgba(76, 175, 125, .5); }
.toast.err { border-color: rgba(229, 72, 77, .6); }
.toast button { background: none; border: 0; color: var(--gold-soft); font-family: inherit; font-size: 1rem; cursor: pointer; }

/* Admin-Untermenü */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1rem; }
.subnav a { color: var(--dim); text-decoration: none; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: .9rem; }
.subnav a.active { color: #0b0b0b; background: var(--gold); border-color: var(--gold); }

.done-icon { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--gold); color: var(--gold-soft); display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 1rem; }
.center { text-align: center; }
code { background: var(--bg-3); padding: 2px 6px; border-radius: 6px; font-size: .9em; word-break: break-all; }
pre { background: var(--bg-3); padding: 12px; border-radius: 10px; overflow: auto; font-size: .85rem; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Erklärkästen */
.hint { border: 1px solid rgba(185, 127, 36, .45); border-radius: var(--radius); background: rgba(185, 127, 36, .07); margin: 0 0 14px; }
.hint summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--text); font-weight: 500; }
.hint summary::-webkit-details-marker { display: none; }
.hint .hint-icon { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold-soft); display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; flex: 0 0 auto; }
.hint .hint-toggle { margin-left: auto; font-weight: 400; }
.hint-body { padding: 0 14px 12px 48px; }
.hint-body p { color: var(--dim); margin: 0 0 10px; font-size: .95rem; }
.hint-body b { color: var(--text); font-weight: 500; }
.steps { margin: 0; padding-left: 1.3rem; }
.steps li { margin-bottom: .6rem; }
ul.plain { margin: 0; padding-left: 1.2rem; }
ul.plain li { margin-bottom: .5rem; }
