:root {
    --primary-color: #485a45;
    --primary-color-hover: #dff0d8;
    --secondary-color: #FFC107;
    --button-gradient: linear-gradient(145deg, #5a6a55, #3e4d3b);
    --dark-bg: #212121;
    --light-text: #f5f5f5;
    --dark-text: #333333;
    --light-gray: #e0e0e0;
    --white: #ffffff;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(33, 33, 33, 0.12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: 'Nunito Sans', 'Segoe UI', sans-serif;
    color: var(--dark-text);
    background: var(--light-gray);
    line-height: 1.6;
}

h1, h2, h3, .brand {
    font-family: 'Fraunces', Georgia, serif;
    color: var(--primary-color);
    margin: 0 0 0.5em;
}

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

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--dark-bg);
    color: var(--light-text);
    padding: 18px 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.brand {
    color: var(--light-text);
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.brand i { color: var(--secondary-color); }

.site-header nav a {
    color: var(--light-text);
    text-decoration: none;
    margin-left: 22px;
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0.9;
}

.site-header nav a:hover { color: var(--secondary-color); opacity: 1; }

/* Hero */
.hero {
    background: linear-gradient(160deg, var(--primary-color), var(--dark-bg));
    color: var(--light-text);
    padding: 70px 0 90px;
    text-align: center;
}

.hero h1 {
    color: var(--white);
    font-size: 2.6rem;
    margin-bottom: 0.3em;
}

.hero p {
    max-width: 620px;
    margin: 0 auto;
    font-size: 1.15rem;
    color: var(--light-gray);
}

.hero .accent { color: var(--secondary-color); }

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px;
}

.card-narrow {
    max-width: 640px;
    margin: -55px auto 60px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 50px 0;
}

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

.info-item i {
    font-size: 1.8rem;
    color: var(--secondary-color);
    background: var(--primary-color);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.info-item h3 { font-size: 1.1rem; }
.info-item p { margin: 0; color: var(--dark-text); font-size: 0.95rem; }

/* Form */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--primary-color);
}

input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--light-gray);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--white);
    color: var(--dark-text);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-hover);
}

textarea { resize: vertical; min-height: 90px; }

.btn {
    display: inline-block;
    background: var(--button-gradient);
    color: var(--white);
    border: none;
    padding: 13px 30px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(62, 77, 59, 0.35); }

.btn-block { width: 100%; }

.btn-secondary {
    background: var(--secondary-color);
    color: var(--dark-text);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 11px 28px;
}

.btn-small {
    padding: 7px 16px;
    font-size: 0.85rem;
}

.btn-danger { background: #b3452c; }

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
}

.alert-success { background: var(--primary-color-hover); color: #24401f; }
.alert-error { background: #f8d7da; color: #7a2530; }

/* Footer */
.site-footer {
    background: var(--dark-bg);
    color: var(--light-gray);
    text-align: center;
    padding: 28px 0;
    margin-top: 60px;
    font-size: 0.9rem;
}

.site-footer a { color: var(--secondary-color); text-decoration: none; }

/* Admin */
.admin-body { background: var(--light-gray); min-height: 100vh; }

.admin-header {
    background: var(--dark-bg);
    color: var(--light-text);
    padding: 16px 0;
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-header .container, .admin-main .container { max-width: 1500px; }

.admin-header a.brand { font-size: 1.3rem; }

.admin-main { padding: 30px 0 60px; }

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.filter-tabs a {
    display: inline-block;
    padding: 8px 16px;
    margin-right: 8px;
    border-radius: 999px;
    text-decoration: none;
    background: var(--white);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.filter-tabs a.active, .filter-tabs a:hover {
    background: var(--primary-color);
    color: var(--white);
}

.table-wrap {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; min-width: 780px; }

th, td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--light-gray);
    font-size: 0.92rem;
    vertical-align: top;
}

th { background: #f7f8f6; color: var(--primary-color); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
th[data-sort-type] { user-select: none; }
th[data-sort-type]:hover { background: var(--primary-color-hover); }
th[data-sort-dir="asc"]::after { content: ' \25B2'; }
th[data-sort-dir="desc"]::after { content: ' \25BC'; }

tr:last-child td { border-bottom: none; }

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-pending { background: #fff3cd; color: #7a5b00; }
.badge-confirmed { background: var(--primary-color-hover); color: #24401f; }
.badge-cancelled { background: #f8d7da; color: #7a2530; }

.actions-cell { display: flex; gap: 8px; flex-wrap: wrap; }

.actions-cell form { margin: 0; }

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--primary-color), var(--dark-bg));
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 380px;
}

.login-card h1 { text-align: center; font-size: 1.5rem; }

.muted { color: #777; font-size: 0.85rem; }

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #777;
}

@media (max-width: 720px) {
    .form-row { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
    .card { padding: 24px; }
    .card-narrow { margin-top: -35px; }

    /* Menü-Tabelle: Zeilen als Karten statt enger Tabelle */
    #menu-table { min-width: 0; }
    #menu-table thead { display: none; }
    #menu-table, #menu-table tbody, #menu-table tr, #menu-table td { display: block; width: 100%; }
    #menu-table tr {
        border: 1px solid var(--light-gray);
        border-radius: 12px;
        margin-bottom: 14px;
        padding: 12px;
        background: var(--white);
    }
    #menu-table td {
        border-bottom: none;
        padding: 8px 0;
    }
    #menu-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--primary-color);
        margin-bottom: 4px;
    }
    #menu-table input, #menu-table select {
        width: 100% !important;
        font-size: 1rem;
    }
    #menu-table .actions-cell { flex-direction: column; align-items: stretch; }
    #menu-table .actions-cell .btn { width: 100%; text-align: center; }
}

/* Kalender */
.cal { background: linear-gradient(180deg, #f7f9f5, #eef3ea); border: 1px solid #dfe7da; border-radius: 18px; padding: 18px 16px 14px; width: 100%; max-width: 420px; margin: 0 auto; box-shadow: 0 6px 18px rgba(62, 77, 59, 0.08); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head strong { font-family: 'Fraunces', Georgia, serif; font-size: 1.2rem; color: var(--primary-color); letter-spacing: 0.01em; }
.cal-nav { width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--white); color: var(--primary-color); font-size: 1.4rem; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); transition: background .15s, color .15s; padding: 0; }
.cal-nav:hover { background: var(--primary-color); color: var(--white); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 4px; }
.cal-wd { text-align: center; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #8a9787; padding-bottom: 4px; }
.cal-day { position: relative; width: 100%; max-width: 46px; aspect-ratio: 1; margin: 0 auto; border: 2px solid transparent; background: transparent; border-radius: 50%; font: inherit; font-size: 0.95rem; color: #b5bdb2; cursor: default; padding: 0; transition: transform .12s, background .15s, box-shadow .15s; }
.cal-day:not(:disabled) { cursor: pointer; }
.cal-today { color: var(--primary-color); font-weight: 800; }
.cal-today::after { content: ''; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #b5bdb2; }
.cal-event { background: var(--white); border-color: var(--primary-color); color: var(--primary-color); font-weight: 800; box-shadow: 0 2px 6px rgba(72, 90, 69, 0.18); }
.cal-event::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--secondary-color); }
.cal-event:not(:disabled):hover { background: var(--primary-color-hover); transform: translateY(-2px); }
.cal-full { color: #c38a91; text-decoration: line-through; background: #fbeeee; }
.cal-selected, .cal-selected:not(:disabled):hover { background: var(--button-gradient); background: linear-gradient(145deg, #5a6a55, #3e4d3b); border-color: var(--secondary-color); color: var(--white); box-shadow: 0 4px 12px rgba(62, 77, 59, 0.4); transform: none; }
.cal-selected::after { background: var(--secondary-color); }
.cal-badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--secondary-color); color: var(--dark-text); font-size: 0.65rem; line-height: 17px; font-weight: 800; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-size: 0.8rem; color: #6d7a6a; margin: 12px 0 0; }
.cal-legend .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 2px solid var(--primary-color); background: var(--white); }
.cal-legend .dot.sel { background: var(--primary-color); border-color: var(--secondary-color); }
.cal-legend .dot.full { background: #fbeeee; border-color: #e0b4b9; }

/* Zeit-Auswahl */
.time-panel { max-width: 420px; margin: 18px auto 0; padding: 16px; border-radius: 16px; background: #f7f9f5; border: 1px solid #dfe7da; }
.time-panel h4 { margin: 0 0 4px; font-family: 'Fraunces', Georgia, serif; color: var(--primary-color); font-size: 1.05rem; }
.time-panel .hint { margin: 0 0 12px; font-size: 0.85rem; color: #6d7a6a; }
.time-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.time-chip { padding: 10px 6px; border-radius: 999px; border: 2px solid #cfd9ca; background: var(--white); color: var(--primary-color); font: inherit; font-weight: 800; cursor: pointer; transition: all .15s; }
.time-chip:hover:not(:disabled) { border-color: var(--primary-color); background: var(--primary-color-hover); }
.time-chip.active { background: linear-gradient(145deg, #5a6a55, #3e4d3b); border-color: var(--secondary-color); color: var(--white); }
.time-chip:disabled { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.cal-legend[hidden], #time-wrap[hidden] { display: none; }
#group-hint[hidden]{display:none;}
.site-footer a[href^="mailto"], .site-footer a[href^="tel"] { color: var(--secondary-color); }
.alert a { color: inherit; font-weight: 800; }
