:root {
    --primary:       #7d1515;
    --primary-light: #9b1e1e;
    --primary-dark:  #5a0e0e;
    --accent:        #c44b4b;
    --bg:            #f7f4f4;
    --card:          #ffffff;
    --text:          #1a1a1a;
    --text-muted:    #6c757d;
    --border:        #e2d8d8;
    --danger:        #dc3545;
    --success:       #28a745;
    --radius:        12px;
    --shadow:        0 2px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.5;
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px 48px;
}

.header {
    text-align: center;
    padding: 40px 0 28px;
}

.header .icon { font-size: 3rem; margin-bottom: 12px; }

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.header p {
    color: var(--text-muted);
    margin-top: 6px;
    font-size: 0.95rem;
}

/* ── Card ────────────────────────────────────────────────────────────────────── */

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    font-size: 0.8rem;
}

/* ── Forms ───────────────────────────────────────────────────────────────────── */

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1.05rem;
    background: white;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group .hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s;
    -webkit-appearance: none;
}

.btn:hover  { background: var(--primary-light); }
.btn:active { background: var(--primary-dark); transform: scale(0.99); }

.btn-outline {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover { background: #f0f7f4; }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #c82333; }

.btn-sm {
    display: inline-block;
    width: auto;
    padding: 7px 14px;
    font-size: 0.85rem;
}

.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.btn-row .btn { flex: 1; }

/* ── Alert ───────────────────────────────────────────────────────────────────── */

.alert {
    padding: 13px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
    font-size: 0.95rem;
}
.alert-error   { background: #fde8ea; color: #721c24; border-left: 4px solid var(--danger); }
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.alert-info    { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }

/* ── Produkt-Liste (Gästeseite) ──────────────────────────────────────────────── */

.produkt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.produkt-item:last-child { border-bottom: none; }

.produkt-info h3 { font-size: 1rem; font-weight: 600; }
.produkt-info .preis { color: var(--text-muted); font-size: 0.88rem; margin-top: 2px; }

.qty-control { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.qty-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
    padding: 0;
}
.qty-btn:hover { background: var(--primary); color: white; }

.qty-value {
    font-size: 1.3rem;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
}

/* ── Zusammenfassung ─────────────────────────────────────────────────────────── */

.summe-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.95rem;
}
.summe-row.total {
    font-size: 1.1rem;
    font-weight: 700;
    padding-top: 12px;
    border-top: 2px solid var(--border);
    margin-top: 6px;
}

/* ── Logo ────────────────────────────────────────────────────────────────────── */

.logo {
    display: block;
    max-width: 200px;
    width: 100%;
    margin: 0 auto 20px;
}

.logo-sm {
    display: block;
    max-height: 36px;
    width: auto;
}

/* ── Success Page ────────────────────────────────────────────────────────────── */

.success-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 16px;
}

/* ── Admin Layout ────────────────────────────────────────────────────────────── */

.admin-topbar {
    background: var(--primary-dark);
    color: white;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-topbar .app-name { font-weight: 700; font-size: 1.05rem; }

.admin-topbar a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem; }
.admin-topbar a:hover { color: white; }

.admin-nav {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-nav a {
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    font-size: 0.95rem;
}

.admin-nav a.active,
.admin-nav a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.admin-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

/* ── Table ───────────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
    text-align: left;
    padding: 10px 14px;
    background: var(--bg);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
}

td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

/* ── Badge ───────────────────────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-green { background: #d4edda; color: #155724; }
.badge-gray  { background: #e9ecef; color: #495057; }
.badge-blue  { background: #cce5ff; color: #004085; }

/* ── Stat Cards ──────────────────────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
}

.stat-card .value { font-size: 1.8rem; font-weight: 700; color: var(--primary-dark); }
.stat-card .label { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

/* ── Drag & Drop ─────────────────────────────────────────────────────────────── */

.drag-handle {
    cursor: grab;
    color: #ccc;
    font-size: 1.3rem;
    user-select: none;
    text-align: center;
    width: 36px;
    padding: 0 6px !important;
}
.drag-handle:active { cursor: grabbing; }
.drag-handle-col { width: 36px; }

tr[draggable]:hover .drag-handle { color: var(--primary); }
tr.dragging { opacity: 0.35; }
tr.drag-over td:first-child { border-top: 2px solid var(--primary); }
tr.drag-over td { border-top: 2px solid var(--primary); }

.sort-saved {
    color: var(--success);
    font-size: 0.82rem;
    font-weight: 500;
    margin-left: 10px;
    display: none;
    text-transform: none;
    letter-spacing: 0;
}

/* ── Utility ─────────────────────────────────────────────────────────────────── */

.text-muted   { color: var(--text-muted); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.fw-bold      { font-weight: 700; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 16px; }
.d-flex       { display: flex; }
.gap-2        { gap: 8px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap    { flex-wrap: wrap; }
