:root {
    --primary: #1d4e89;
    --primary-dark: #123a66;
    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --border: #dde3ea;
    --text: #1f2937;
    --muted: #6b7280;
    --success-bg: #e6f6ec;
    --success-text: #1a7f3c;
    --error-bg: #fdecec;
    --error-text: #b3261e;
}

* { box-sizing: border-box; }

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

.topbar {
    background: var(--primary);
    color: #fff;
}
.topbar-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}
.topbar nav a {
    color: #eaf0fb;
    text-decoration: none;
    margin-left: 16px;
    font-size: 0.95rem;
}
.topbar nav a:hover { text-decoration: underline; }

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

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
}
.card-narrow { max-width: 400px; margin-left: auto; margin-right: auto; }

h1 { margin-top: 0; font-size: 1.5rem; }
h2 { font-size: 1.2rem; }

label {
    display: block;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 0.92rem;
}
label.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.checkbox input { width: auto; }

input[type=text], input[type=password], input[type=number], textarea, select {
    width: 100%;
    padding: 9px 10px;
    margin-top: 5px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

.btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.btn:hover { background: var(--primary-dark); }
.btn-secondary { background: #9aa5b1; margin-left: 8px; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-size: 0.88rem;
    margin-left: 10px;
}

.alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.92rem;
}
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error { background: var(--error-bg); color: var(--error-text); }

.hint { color: var(--muted); font-size: 0.88rem; font-weight: 400; display: block; margin-top: 4px; }
.muted { color: var(--muted); font-size: 0.88rem; }
.beschreibung { white-space: pre-wrap; display: inline-block; }
code {
    background: #eef1f5;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.85em;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
}
.table th, .table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}
.table th { color: var(--muted); font-weight: 600; }

.order-block {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.order-head { margin-bottom: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-offen { background: #fff3cd; color: #92700a; }
.badge-bezahlt { background: #d9edf7; color: #205e78; }
.badge-abgeschlossen { background: var(--success-bg); color: var(--success-text); }
.badge-storniert { background: var(--error-bg); color: var(--error-text); }

.filter-bar { margin-bottom: 12px; }
.filter-bar a {
    display: inline-block;
    padding: 6px 12px;
    margin-right: 6px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    background: #eef1f5;
    font-size: 0.88rem;
}
.filter-bar a.active { background: var(--primary); color: #fff; }

.inline-form { display: inline-block; margin-top: 8px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin: 18px 0;
}
.stat {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-num { font-size: 1.6rem; font-weight: 700; color: var(--primary); }

.thumb {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.bild-galerie {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.bild-galerie-shop .thumb {
    width: 64px;
    height: 64px;
}
.bild-kachel {
    position: relative;
    text-align: center;
}
.bild-kachel img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
}
.bild-kachel .link-btn {
    display: block;
    margin: 4px 0 0;
    font-size: 0.78rem;
}

.bild-galerie-shop .thumb {
    cursor: zoom-in;
}

.bild-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.bild-modal-overlay.sichtbar { display: flex; }

.bild-modal {
    position: relative;
    /* ~70vw x 70vh entspricht rechnerisch ca. 50% der Bildschirmfläche */
    max-width: 70vw;
    max-height: 70vh;
}
.bild-modal img {
    display: block;
    max-width: 70vw;
    max-height: 70vh;
    width: auto;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    background: #fff;
}
.bild-modal-schliessen {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--text);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pw-anzeige {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.pw-anzeige label {
    margin-bottom: 8px;
    font-size: 0.88rem;
}
.pw-anzeige-zeile {
    display: flex;
    gap: 8px;
}
.pw-anzeige-zeile input {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: #fff;
}

.filter-form { margin-bottom: 14px; }

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
    padding: 20px;
}
