/* admin/admin.css – Layout und Komponenten für den RegioLog Admin-Bereich */

:root {
    --primary: #2c6b3e;
    --primary-dark: #1e4227;
    --primary-soft: #e6f0e8;
    --accent: #d4af37;
    --text: #2b2b2b;
    --muted: #6b7280;
    --bg: #f4f7f5;
    --card: #ffffff;
    --border: #e5e7eb;
    --danger: #c0392b;
    --warn: #e0a526;
    --ok: #27ae60;
    --sidebar-w: 248px;
    --radius: 10px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    line-height: 1.5;
}

a { color: var(--primary); }

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--primary-dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 30;
}
.brand {
    font-size: 19px;
    font-weight: 700;
    padding: 22px 20px 18px;
    color: var(--accent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.brand span { color: rgba(255, 255, 255, 0.6); font-weight: 400; font-size: 14px; }

.nav-group { padding: 14px 0 4px; }
.nav-group-label {
    padding: 0 20px 6px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #cfd8d2;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border-left: 4px solid transparent;
    transition: background 0.15s, color 0.15s;
}
.nav-list a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-list a.active { background: var(--primary); color: #fff; border-left-color: var(--accent); }
.nav-icon { width: 22px; text-align: center; }
.nav-ext { margin-left: auto; opacity: 0.5; font-size: 12px; }

.sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-footer a { color: #cfd8d2; text-decoration: none; font-size: 14px; }
.sidebar-footer a:hover { color: #fff; }

/* ---------- Hauptbereich ---------- */
.main-content {
    margin-left: var(--sidebar-w);
    padding: 28px 32px 48px;
    max-width: calc(1100px + var(--sidebar-w));
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 12px;
    margin-bottom: 24px;
}
.farm-name { margin: 0; color: var(--muted); font-size: 14px; }
.header-bar h1 { margin: 2px 0 0; color: var(--primary); font-size: 26px; }

.delivery-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 8px 6px 14px;
    font-size: 14px;
}
.badge { border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.badge-open { background: #dcfce7; color: #166534; }
.badge-closed { background: #fde2e1; color: #9b1c1c; }

.section-box {
    background: var(--card);
    padding: 22px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.section-box h2 { margin: 0 0 14px; font-size: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.empty { color: var(--muted); text-align: center; padding: 16px 0; margin: 0; }
.hint { color: var(--muted); font-size: 14px; margin: -6px 0 14px; }
.more-link { margin: 14px 0 0; font-size: 14px; }

.notice { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-weight: 600; font-size: 15px; }
.notice-open { background: #e2f0d9; color: #1e5a2c; }
.notice-closed { background: #fdecea; color: #8a1f17; }

/* ---------- Kennzahlen ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card);
    padding: 18px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary);
}
.stat-card h3 { margin: 0 0 6px; color: var(--muted); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; }
.stat-card .number { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat-card-highlight { background: var(--primary); color: #fff; border-top-color: var(--accent); }
.stat-card-highlight h3, .stat-card-highlight .stat-sub { color: rgba(255, 255, 255, 0.75); }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.dash-grid .section-box { margin-bottom: 0; }
.dash-grid + .section-box { margin-top: 24px; }

/* Fortschritt */
.progress { height: 14px; background: #edf1ee; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--ok); border-radius: 999px; }
.progress-label { margin: 10px 0 14px; }
.status-list { list-style: none; padding: 0; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.status-list strong { margin-left: 4px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot-offen { background: #c4c9c6; }
.dot-unterwegs { background: var(--warn); }
.dot-geliefert { background: var(--ok); }

/* Balkenliste */
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bar-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.bar { height: 8px; background: #edf1ee; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 999px; }

/* Schnellzugriff */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.quick-tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.quick-tile:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.quick-tile span:last-child { color: var(--muted); font-size: 13px; }
.quick-icon { font-size: 24px; margin-bottom: 4px; }

/* ---------- Rüstliste / Packliste ---------- */
.rust-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.rust-item:last-child { border-bottom: none; }
.rust-item small { color: var(--muted); }
.quantity { background: var(--primary); color: #fff; padding: 3px 12px; border-radius: 999px; font-weight: 700; white-space: nowrap; }

.check {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #b8c2bc;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: -2px;
}

.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 10px; }
.pack-card { position: relative; background: #fafbfa; border: 1px solid var(--border); padding: 16px; border-radius: 8px; break-inside: avoid; }
.pack-nr { position: absolute; top: 12px; right: 14px; color: var(--muted); font-weight: 700; font-size: 13px; }
.pack-card h4 { margin: 0 0 2px; color: var(--primary); padding-right: 34px; }
.pack-address { font-size: 13px; color: var(--muted); }
.pack-items-list { list-style: none; padding: 8px 0 0; margin: 10px 0 0; border-top: 1px solid var(--border); font-size: 14px; }
.pack-items-list li { padding: 4px 0; display: flex; justify-content: space-between; gap: 10px; }

/* ---------- Formulare & Tabellen ---------- */
.admin-flex { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.form-group { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14px; }
input[type="text"], input[type="number"] { padding: 9px 10px; border: 1px solid #cbd2ce; border-radius: 6px; font-size: 15px; min-width: 150px; }
input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.btn-add, .btn-secondary, .btn-delete { border: none; border-radius: 6px; font-weight: 700; cursor: pointer; font-size: 14px; }
.btn-add { background: var(--primary); color: #fff; padding: 10px 20px; }
.btn-add:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--primary-soft); color: var(--primary); padding: 8px 14px; }
.btn-secondary:hover { background: #d5e6d9; }
.btn-delete { background: var(--danger); color: #fff; padding: 6px 12px; }

.zone-table { width: 100%; border-collapse: collapse; }
.zone-table th, .zone-table td { padding: 11px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.zone-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.zone-table form { margin: 0; }
.cell-right { text-align: right !important; }

/* ---------- Hofprofil / Formulare ---------- */
.notice-warn { background: #fff4d6; color: #7a5300; }
.notice a { color: inherit; font-weight: 700; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.span-2 { grid-column: span 2; }
.form-grid .form-group input, .form-grid .form-group select { width: 100%; min-width: 0; }
.form-group small { font-weight: 400; color: var(--muted); }
input[type="email"], input[type="tel"], input[type="time"], select {
    padding: 9px 10px; border: 1px solid #cbd2ce; border-radius: 6px; font-size: 15px; background: #fff; font-family: inherit;
}
select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
input.is-invalid { border-color: var(--danger); background: #fff7f6; }
.field-error { color: var(--danger); font-size: 13px; font-weight: 600; }

.map-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 10px; }
.map-status { color: var(--muted); font-size: 14px; }
.farm-map { height: 340px; border-radius: 8px; border: 1px solid var(--border); z-index: 0; }
.farm-pin { font-size: 30px; line-height: 40px; text-align: center; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35)); cursor: grab; }
.coords { margin-top: 10px; font-size: 13px; color: var(--muted); }
.coords label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.coords input { width: 130px; min-width: 0; padding: 6px 8px; font-size: 13px; }

.slug-row { display: flex; align-items: stretch; }
.slug-prefix { display: flex; align-items: center; padding: 0 10px; background: #f1f3f2; border: 1px solid #cbd2ce; border-right: none; border-radius: 6px 0 0 6px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.slug-row input { border-radius: 0 6px 6px 0; flex: 1; }
.check-row { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.shop-link { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding: 12px 14px; background: var(--primary-soft); border-radius: 8px; font-size: 14px; }
.shop-link a { word-break: break-all; font-weight: 600; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.preview { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.form-actions { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 5; }
.btn-large { padding: 13px 28px; font-size: 16px; }

/* ---------- Mobile ---------- */
.mobile-bar, .sidebar-backdrop { display: none; }

@media (max-width: 860px) {
    .mobile-bar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 20;
        background: var(--primary-dark);
        color: #fff;
        padding: 10px 16px;
    }
    .menu-toggle { background: none; border: none; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 6px; }
    .mobile-title { font-weight: 700; }

    .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2); }
    .nav-open .sidebar { transform: translateX(0); }
    .nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 25; }

    .main-content { margin-left: 0; padding: 18px 16px 40px; }
    .header-bar h1 { font-size: 22px; }
    .section-box { padding: 18px 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card .number { font-size: 20px; }
    .dash-grid { grid-template-columns: 1fr; }
    .admin-flex > * { flex: 1 1 140px; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .farm-map { height: 280px; }
    .slug-prefix { display: none; }
    .slug-row input { border-radius: 6px; }
    .btn-large { width: 100%; }
}

/* ---------- Drucken (Rüst- und Packliste) ---------- */
@media print {
    .sidebar, .mobile-bar, .sidebar-backdrop, .no-print { display: none !important; }
    body { background: #fff; }
    .main-content { margin: 0; padding: 0; max-width: none; }
    .section-box { box-shadow: none; padding: 0; }
    .pack-card { background: #fff; }
    .quantity { background: none; color: #000; border: 1px solid #000; }
}

/* ---------- Abholung & Lieferung im Hofprofil ---------- */
.option-panel { border: 1px solid var(--border); border-radius: 10px; margin-top: 14px; overflow: hidden; }
.option-head { padding: 14px 16px; background: #fafbfa; font-size: 16px; }
.option-body { padding: 16px; border-top: 1px solid var(--border); }
.option-panel.is-off .option-body { display: none; }
.option-panel.is-off .option-head { color: var(--muted); }
.hours-list { display: grid; gap: 8px; margin-bottom: 10px; }
.hours-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hours-row select { min-width: 130px; }
.hours-row input[type="time"] { width: 120px; }
.hours-row span { color: var(--muted); font-size: 14px; }
.btn-icon { background: none; border: 1px solid var(--border); border-radius: 6px; width: 34px; height: 34px; cursor: pointer; color: var(--muted); }
.btn-icon:hover { color: var(--danger); border-color: var(--danger); }
textarea { width: 100%; padding: 9px 10px; border: 1px solid #cbd2ce; border-radius: 6px; font-size: 15px; font-family: inherit; resize: vertical; }
textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.preview strong { color: var(--text); }

/* ---------- Tagesauswahl ---------- */
.day-picker { display: flex; align-items: center; gap: 6px; margin: 0; }
.day-picker select { font-weight: 600; padding: 8px 10px; }
.day-step { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 38px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--primary); text-decoration: none; font-size: 20px; font-weight: 700; }
.day-step:hover { border-color: var(--primary); }
.day-step.is-off { color: #c9cfcb; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Dashboard ---------- */
.shop-status { display: grid; gap: 8px; margin-bottom: 20px; }
.shop-status-item { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; background: var(--card); border-left: 4px solid var(--ok); box-shadow: var(--shadow); }
.shop-status-item.is-closed { border-left-color: var(--danger); }
.shop-status-item strong { margin-right: 6px; }
.progress-block + .progress-block { margin-top: 20px; }
.progress-block .bar-head { margin-bottom: 6px; }
.progress-block .more-link { margin-top: 6px; }
tr.is-current td { background: var(--primary-soft); }

/* ---------- Packliste / Abholliste ---------- */
.group-title { font-size: 15px; margin: 22px 0 4px; color: var(--muted); }
.pack-card.is-done { opacity: 0.55; }
.status-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #edf1ee; color: var(--muted); margin-left: 4px; white-space: nowrap; }
.status-pill.status-bereit { background: #fff4d6; color: #7a5300; }
.status-pill.status-unterwegs { background: #fff4d6; color: #7a5300; }
.status-pill.status-erledigt { background: #dcfce7; color: #166534; }
.muted { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 6px; }
.counter { font-weight: 700; color: var(--primary); white-space: nowrap; }

.list-search { width: 100%; padding: 11px 12px; border: 1px solid #cbd2ce; border-radius: 8px; font-size: 16px; margin: 6px 0 12px; }
.pickup-list { list-style: none; margin: 0; padding: 0; }
.pickup-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.pickup-row[hidden] { display: none; }
.pickup-row.status-erledigt .pickup-main { opacity: 0.5; }
.pickup-name { font-size: 16px; display: block; }
.pickup-meta { font-size: 13px; color: var(--muted); }
.pickup-meta a { color: inherit; }
.pickup-actions { display: flex; align-items: center; gap: 8px; }
.pickup-actions form { margin: 0; }
.btn-link { background: none; border: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; padding: 6px; }

@media (max-width: 860px) {
    .header-bar { align-items: stretch; }
    .day-picker { width: 100%; }
    .day-picker select { flex: 1; min-width: 0; }
    .pickup-actions { width: 100%; justify-content: flex-end; }
}
.form-group > .btn-small { align-self: flex-start; }

/* ---------- Produkte ---------- */
.list-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.list-toolbar .btn-add { text-decoration: none; display: inline-block; }
.back-link { margin: 0 0 16px; }
.product-list { list-style: none; margin: 0; padding: 0; }
.product-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 80px; }
.product-row:last-child { border-bottom: none; }
.product-row.is-hidden .product-thumb, .product-row.is-hidden .product-info { opacity: 0.5; }
.product-row:target { background: var(--primary-soft); border-radius: 8px; }
.product-thumb { flex: 0 0 56px; height: 56px; border-radius: 8px; overflow: hidden; background: #f1f3f2; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 20px; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info { flex: 1; min-width: 0; }
.product-title { font-weight: 700; color: var(--text); text-decoration: none; display: block; }
.product-title:hover { color: var(--primary); }
.product-meta { font-size: 13px; color: var(--muted); }
.stock { font-weight: 600; color: var(--primary); }
.stock.is-low { color: #a86b00; }
.stock.is-out { color: var(--danger); }
.product-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.inline-form { display: inline; margin: 0; }
.toggle-pill { border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.toggle-pill.is-on { background: #dcfce7; border-color: #b7e4c7; color: #166534; }
.btn-link.danger { color: var(--danger); }
a.btn-link { text-decoration: underline; padding: 6px; font-size: 14px; color: var(--muted); }

.new-category { margin-top: 8px; }
.field-hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.image-field { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.image-preview { width: 180px; height: 180px; border-radius: 10px; background: #f1f3f2; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); font-size: 14px; border: 1px solid var(--border); }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-controls { flex: 1; min-width: 200px; }
.file-button { display: inline-block; position: relative; overflow: hidden; cursor: pointer; padding: 10px 16px; }
.file-button input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.check-row.small { font-size: 14px; font-weight: 400; }
.form-actions .btn-link { margin-left: 12px; }

.category-list { list-style: none; margin: 0; padding: 0; }
.category-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.move-buttons { display: flex; gap: 4px; }
.btn-icon:disabled { opacity: 0.3; cursor: default; }
.category-rename { display: flex; gap: 8px; flex: 1; min-width: 220px; margin: 0; }
.category-rename input { flex: 1; min-width: 0; }

@media (max-width: 860px) {
    .product-row { flex-wrap: wrap; }
    .product-actions { width: 100%; justify-content: flex-start; padding-left: 70px; }
    .image-preview { width: 140px; height: 140px; }
}

/* ---------- Titelbild im Hofprofil (Vorschau wie im Shop) ---------- */
.cover-preview { position: relative; aspect-ratio: 16 / 7; max-width: 640px; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #e6f0e8, #f6efd9); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; border: 1px solid var(--border); }
.cover-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-preview-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 14px; color: #fff; font-weight: 800; font-size: 22px; background: linear-gradient(to top, rgba(0,0,0,.6), transparent); text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.cover-preview span { position: relative; top: -18px; }

/* ---------- Hintergrund-Auswahl im Hofprofil ---------- */
.sub-title { font-size: 16px; margin: 26px 0 4px; }
.bg-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.bg-choice { position: relative; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.bg-choice input { position: absolute; opacity: 0; pointer-events: none; }
.bg-swatch { position: relative; display: block; height: 96px; border-radius: 10px; overflow: hidden; border: 2px solid var(--border); background: #f3f5f1; }
.bg-swatch-layer { position: absolute; inset: 0; }
.bg-swatch-sheet { position: absolute; left: 22%; right: 22%; top: 14px; bottom: 0; background: #fff; border-radius: 6px 6px 0 0; box-shadow: 0 4px 14px rgba(30,60,35,.15); }
.bg-label { font-size: 14px; font-weight: 600; }
.bg-label small { display: block; font-weight: 400; color: var(--muted); }
.bg-choice input:checked + .bg-swatch { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.bg-choice input:focus-visible + .bg-swatch { outline: 3px solid var(--accent); outline-offset: 2px; }
.bg-choice.is-disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Anmelden, Registrieren, Passwort ---------- */
.auth-body { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 40px;
             background-color: #eef2ea;
             background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='44' viewBox='0 0 180 44'%3E%3Cpath d='M0 11 Q45 3 90 11 T180 11 M0 33 Q45 25 90 33 T180 33' fill='none' stroke='%232c6b3e' stroke-opacity='.11' stroke-width='2.2'/%3E%3C/svg%3E"); }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 20px; padding: 32px 30px 28px; box-shadow: 0 24px 60px rgba(30, 60, 35, 0.14); }
.auth-card.is-wide { max-width: 560px; }
.auth-brand { margin: 0 0 18px; font-weight: 800; color: var(--primary); font-size: 17px; }
.auth-card h1 { margin: 0 0 18px; font-size: 26px; letter-spacing: -0.01em; line-height: 1.2; }
.auth-card p { margin: 0 0 14px; }
.auth-card .form-group { margin-bottom: 14px; }
.auth-card .form-group input { width: 100%; min-width: 0; padding: 11px 12px; font-size: 16px; }
.auth-card input[type="password"] { padding: 11px 12px; border: 1px solid #cbd2ce; border-radius: 6px; font-size: 16px; font-family: inherit; }
.auth-card input[type="password"]:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.auth-btn { display: block; width: 100%; text-align: center; text-decoration: none; padding: 13px 18px; font-size: 16px; border-radius: 10px; margin-top: 6px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin: 20px 0 0 !important; font-size: 14px; }
.auth-hint { color: var(--muted); font-size: 14px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.farm-pick { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.farm-pick button { width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 10px;
                    padding: 14px 16px; border: 2px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; }
.farm-pick button:hover { border-color: var(--primary); background: var(--primary-soft); }
.farm-pick strong { font-size: 16px; }
.farm-pick small { color: var(--muted); }

/* Benutzer-Bereich unten in der Seitenleiste */
.sidebar-user { padding: 14px 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 14px; color: #cfd8d2; }
.sidebar-user strong { display: block; color: #fff; }
.sidebar-user a { color: #cfd8d2; text-decoration: none; display: inline-block; margin: 6px 12px 0 0; }
.sidebar-user a:hover { color: #fff; text-decoration: underline; }
.sidebar-footer { margin-top: auto; }
.preview-banner { background: var(--warn); color: #3b2a00; text-align: center; padding: 8px 12px; font-weight: 700; font-size: 14px; }

/* ---------- Betreiber-Bereich ---------- */
.operator-body { background: var(--bg); }
.operator-page { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; }
.operator-nav { display: flex; gap: 16px; }
.operator-nav a { font-weight: 600; }
.operator-list { list-style: none; margin: 0; padding: 0; }
.operator-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.operator-list li.is-pending { background: #fffaf0; margin: 0 -24px; padding: 14px 24px; }
.operator-farm strong { font-size: 16px; margin-right: 6px; }
.btn-add.btn-small { padding: 7px 14px; font-size: 14px; }
@media (max-width: 860px) { .operator-list li.is-pending { margin: 0 -16px; padding: 14px 16px; } }

/* ---------- Postversand & Bezahlung ---------- */
.weekday-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 6px; }
.rate-row input.input-short, input.input-short { width: 90px; min-width: 0; }
.payment-grid { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 24px 32px; align-items: start; }
.payment-grid .form-group input { width: 100%; min-width: 0; }
.qr-preview { width: 200px; height: 200px; border: 1px solid var(--border); border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); font-size: 14px; }
.qr-preview img { width: 100%; height: 100%; object-fit: contain; }
.ship-list { list-style: none; margin: 0; padding: 0; }
.ship-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; padding: 14px 4px; border-bottom: 1px solid var(--border); align-items: start; }
.ship-row:last-child { border-bottom: none; }
.ship-title { font-weight: 700; }
.ship-meta { color: var(--muted); font-size: 14px; display: block; margin-top: 2px; }
.ship-address { font-size: 14px; margin-top: 6px; line-height: 1.45; }
.ship-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.ship-actions form { margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ship-actions input[type="text"] { min-width: 0; width: 190px; }
.amount { font-weight: 800; font-size: 16px; white-space: nowrap; }
.status-pill.status-zahlung { background: #fde2e1; color: #9b1c1c; }
.status-pill.status-storniert { background: #edf1ee; color: var(--muted); text-decoration: line-through; }
@media (max-width: 720px) {
    .payment-grid { grid-template-columns: 1fr; }
    .ship-row { grid-template-columns: 1fr; }
    .ship-actions { justify-content: flex-start; }
}

/* ---------- Freie Seiten ---------- */
.page-list .product-title { text-decoration: none; }
.page-list .product-title:hover { text-decoration: underline; }
.page-list code { font-size: 12px; background: #f1f3f2; padding: 1px 5px; border-radius: 4px; }
.page-legal-hint { font-size: 13px; }
.placement-choice { border: none; padding: 0; margin: 18px 0 0; }
.placement-choice legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.placement-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.placement-choice legend { grid-column: 1 / -1; }
.placement-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: #fff; }
.placement-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.placement-option input { margin-top: 3px; accent-color: var(--primary); }
.placement-option span { display: flex; flex-direction: column; gap: 2px; }
.placement-option small { color: var(--muted); font-size: 13px; }
.note-editor.note-frame { border-color: var(--border); border-radius: 8px; background: #fff; }
.note-editor .note-editable { font-size: 16px; line-height: 1.6; }
.note-editor .note-editable img { max-width: 100%; height: auto; }
.note-editor .note-editable table td, .note-editor .note-editable table th { border: 1px solid var(--border); padding: 6px 8px; }
@media (max-width: 720px) {
    .placement-choice { grid-template-columns: 1fr; }
}

/* ---------- Geschenkkörbe ---------- */
.basket-suggest { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 24px; }
.basket-suggest li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.basket-suggest label { font-size: 15px; }
.basket-suggest small { color: var(--muted); }
.basket-suggest input { width: 70px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 15px; text-align: center; }
.allow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 20px; }
.gift-flag { display: inline-block; background: #fff4d6; color: #7a5300; border-radius: 6px; padding: 1px 7px; font-size: 13px; font-weight: 700; }
.pack-basket { margin: 6px 0; padding: 8px 10px; border: 1px dashed #d8c47a; background: #fffbea; border-radius: 8px; }
.pack-basket-title { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.pack-basket ul { list-style: none; margin: 4px 0 0; padding: 0; }
.pack-basket li { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 2px 0; }
.pack-card-text { margin: 6px 0 0; font-size: 14px; font-style: italic; white-space: pre-line; }
@media print { .pack-basket { background: none; } }

/* Häkchen und Optionsknöpfe in Formular-Rastern: nicht auf volle Breite ziehen */
.form-group .check-row { display: flex; margin: 6px 0; }
.form-grid .form-group .check-row input,
.form-group .check-row input[type="radio"],
.form-group .check-row input[type="checkbox"] { width: 18px; min-width: 18px; flex: none; margin: 0; }
/* Editor und Hinweise in Formularfeldern: normale Schrift (nicht fett wie die Beschriftung) */
.form-group .note-editor, .form-group .note-editable, .form-group .hint { font-weight: 400; }
