/* Verwaltung – schlicht und übersichtlich */
@font-face { font-family: "Inter"; src: url("../fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
    /* Farben aus dem Vereinslogo */
    --green: #1d3110;      /* dunkles Logo-Grün (Seitenleiste) */
    --green-2: #487427;    /* Logo-Grün */
    --accent: #be3a3c;     /* Logo-Rot */
    --accent-soft: #fbeaea;
    --bg: #f3f5ef;
    --card: #fff;
    --ink: #1c211d;
    --muted: #6b706a;
    --line: #e4e0d6;
    --red: #b8392b;
    --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: "Inter", system-ui, sans-serif; font-size: 15px; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--green-2); }
h1, h2 { margin: 0; line-height: 1.2; }
h2 { font-size: 1.05rem; margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* Layout */
.admin { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex: none; background: var(--green); color: #dfe7df; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; align-self: flex-start; overflow-y: auto; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 20px; color: #fff; text-decoration: none; font-weight: 700; }
.sb-brand small { display: block; font-weight: 400; font-size: .75rem; color: #a3cf72; }
.sidebar nav { padding: 0 10px; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: #dfe7df; text-decoration: none; margin-bottom: 2px; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); }
.sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar nav a.active svg { color: #a3cf72; }
.sb-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.4); margin: 18px 12px 6px; }
.sb-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; display: grid; gap: 8px; }
.sb-foot a { color: #a3cf72; text-decoration: none; }
.sb-foot button { background: none; border: 0; color: rgba(255,255,255,.6); padding: 0; text-align: left; cursor: pointer; font: inherit; }
.sb-foot button:hover { color: #fff; }
.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 22px 32px 6px; }
.topbar h1 { font-size: 1.5rem; }
.sb-toggle { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; }
.content { padding: 16px 32px 64px; max-width: 1200px; }
@media (max-width: 860px) {
    .sidebar { position: fixed; z-index: 30; left: -260px; transition: left .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .sidebar.open { left: 0; }
    .sb-toggle { display: block; }
    .topbar, .content { padding-left: 16px; padding-right: 16px; }
}

/* Elemente */
.card { background: var(--card); border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); margin-bottom: 20px; }
.card-flush { padding: 0; overflow: hidden; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--green-2); }
.btn-primary { background: var(--green-2); border-color: var(--green-2); color: #fff; }
.btn-primary:hover { background: var(--green); border-color: var(--green); }
.btn-danger { color: var(--red); border-color: #f0c9c4; background: #fff; }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-ghost { border-color: transparent; background: none; }
.btn-small { padding: 5px 11px; font-size: .85rem; }
.flash { padding: 12px 16px; border-radius: 8px; margin: 12px 32px 0; background: #e6f2e8; color: #1d5a2c; border: 1px solid #c4e1ca; }
.content .flash, .login-box .flash { margin: 0 0 16px; }
.flash-error { background: #fbeceb; color: #8d2a1f; border-color: #f0c9c4; }
@media (max-width: 860px) { .flash { margin: 12px 16px 0; } }
.pill { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: #eee; color: var(--muted); }
.pill-ok { background: #e6f2e8; color: #1d5a2c; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .btn-primary, .toolbar .btn:last-child { margin-left: auto; }
.search input { padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; min-width: 260px; background: #fff; }
.link-back { text-decoration: none; font-weight: 600; }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #faf9f6; }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-list tbody tr:hover { background: #faf9f6; }
.table .actions { text-align: right; width: 1%; }
.card:not(.card-flush) .table td { padding: 8px 0; }
.card:not(.card-flush) .table td + td { padding-left: 12px; }
.list-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
@media (max-width: 700px) {
    .table-list thead { display: none; }
    .table-list tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
    .table-list td { display: flex; gap: 10px; padding: 2px 0; border: 0; }
    .table-list td::before { content: attr(data-label); width: 100px; flex: none; color: var(--muted); font-size: .8rem; }
    .table-list td.actions { text-align: left; width: auto; padding-top: 6px; }
    .table-list td.actions::before { content: none; }
    .search input { min-width: 0; width: 100%; }
}
.pagination { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination a { padding: 6px 12px; border-radius: 6px; background: #fff; border: 1px solid var(--line); text-decoration: none; }
.pagination a.active { background: var(--green-2); color: #fff; border-color: var(--green-2); }

/* Übersicht */
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 16px 0 20px; }
.quick-item { background: var(--green-2); border-bottom: 4px solid var(--accent); color: #fff; border-radius: var(--radius); padding: 18px; text-decoration: none; display: grid; gap: 2px; }
.quick-item:hover { background: var(--green); }
.quick-item span { font-size: .85rem; color: rgba(255,255,255,.7); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); }
.stat strong { display: block; font-size: 1.6rem; }
.stat span { font-size: .8rem; color: var(--muted); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

/* Formulare */
.form { display: grid; gap: 18px; max-width: 860px; }
.field { display: grid; gap: 6px; }
.field-label { font-weight: 600; font-size: .9rem; }
.form input[type=text], .form input:not([type]), .form input[type=number], .form input[type=date], .form input[type=datetime-local],
.form input[type=password], .form select, .form textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #d6d1c5; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
.form input:focus, .form select:focus, .form textarea:focus, .editor-area:focus { outline: 2px solid var(--green-2); outline-offset: 0; border-color: var(--green-2); }
.field-number input, .field-date input, .field-datetime input { max-width: 260px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--green-2); }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 16px; padding: 12px 14px; border: 1px solid #d6d1c5; border-radius: 8px; background: #fff; }
.checkbox-grid .check { align-items: flex-start; line-height: 1.35; }
.checkbox-grid .check input { flex: none; margin: 1px 0 0; }
.help { color: var(--muted); font-size: .82rem; }
.auto-hint { color: var(--accent); font-weight: 600; }
.error { color: var(--red); font-weight: 600; font-size: .85rem; }
.has-error input, .has-error textarea, .has-error .editor { border-color: var(--red) !important; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
.upload { display: grid; gap: 8px; justify-items: start; }
.upload-preview { max-width: 220px; max-height: 160px; border-radius: 8px; border: 1px solid var(--line); }
.danger-zone { margin-top: 8px; }
.member-access { max-width: 860px; display: grid; gap: 8px; border-left: 4px solid var(--accent); }
.member-access h2 { margin-bottom: 0; }
.member-access .field-label { margin-top: 10px; }
.member-access .help { margin: 0; }
.member-access form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid #d6d1c5; border-radius: 8px; font: inherit; font-size: .88rem; background: #f8f9f5; }
.logo-setting { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 120px; height: 120px; object-fit: contain; border-radius: 50%; background: #fff; border: 1px solid var(--line); padding: 6px; }
.sb-brand img, .login-box img { border-radius: 50%; background: #fff; object-fit: contain; }
.sb-brand img { width: 36px; height: 36px; padding: 2px; }

/* Editor */
.editor { border: 1px solid #d6d1c5; border-radius: 8px; overflow: hidden; background: #fff; }
.editor-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: #faf9f6; }
.editor-bar button { border: 0; background: none; padding: 5px 9px; border-radius: 6px; cursor: pointer; font: inherit; font-size: .85rem; }
.editor-bar button:hover, .editor-bar button.on { background: #ebe7dd; }
.editor-bar .right { margin-left: auto; font-family: monospace; }
.editor-area { min-height: 180px; max-height: 60vh; overflow: auto; padding: 12px 16px; }
.editor-area img { max-width: 100%; height: auto; }
.editor-area p { margin: 0 0 .8em; }
.editor-source { width: 100%; min-height: 240px; border: 0 !important; border-radius: 0 !important; font-family: monospace !important; font-size: 13px !important; }

/* Galerie-Bilder */
.ga-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ga-head h2 { margin: 0; }
.ga-tools { display: flex; gap: 8px; }
.dropzone { border: 2px dashed #d6d1c5; border-radius: var(--radius); padding: 20px; text-align: center; color: var(--muted); margin-bottom: 14px; transition: .15s; }
.dropzone.over { border-color: var(--green-2); background: #eef4e7; color: var(--ink); }
.progress { position: relative; height: 28px; background: #eee; border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progress-bar { height: 100%; width: 0; background: var(--green-2); transition: width .2s; }
.progress-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 600; }
.ga-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ga-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #eee; cursor: grab; border: 3px solid transparent; }
.ga-item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ga-item.is-cover { border-color: var(--accent); }
.ga-item.dragging { opacity: .4; }
.ga-item.selected { border-color: var(--red); }
.ga-select { position: absolute; top: 6px; left: 6px; background: rgba(255,255,255,.9); border-radius: 4px; padding: 2px 4px; line-height: 0; }
.ga-actions { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; opacity: 0; transition: .15s; }
.ga-item:hover .ga-actions, .ga-item.is-cover .ga-actions { opacity: 1; }
.ga-actions button { width: 30px; height: 30px; border: 0; border-radius: 6px; background: rgba(255,255,255,.92); cursor: pointer; font-size: 15px; }
.ga-item.is-cover [data-cover] { background: var(--accent); color: #fff; }
@media (hover: none) { .ga-actions { opacity: 1; } }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--green-2); padding: 16px; border-top: 6px solid var(--accent); }
.login-box { background: #fff; padding: 36px; border-radius: 16px; width: 100%; max-width: 380px; display: grid; gap: 14px; justify-items: stretch; text-align: left; }
.login-box img { margin: 0 auto; }
.login-box h1 { text-align: center; font-size: 1.5rem; }
.login-box > p { text-align: center; margin: -8px 0 4px; }
.login-box label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.login-box input { padding: 11px 12px; border: 1px solid #d6d1c5; border-radius: 8px; font: inherit; }
.login-box .btn { justify-content: center; padding: 12px; }
.login-box > a { text-align: center; text-decoration: none; }

/* Liste: Aktionen und Ein/Aus-Schalter */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.row-actions form { margin: 0; }
.toggle-form { margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 2px 0; cursor: pointer; font: inherit; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.switch::before { content: ""; flex: none; width: 38px; height: 22px; border-radius: 999px; background: #d9d6cf; transition: background .15s;
    background-image: radial-gradient(circle at 11px 50%, #fff 8px, transparent 8.5px); }
.switch[aria-checked="true"] { color: var(--green-2); font-weight: 600; }
.switch[aria-checked="true"]::before { background-color: var(--green-2); background-image: radial-gradient(circle at 27px 50%, #fff 8px, transparent 8.5px); }
.switch[aria-checked="false"] { color: var(--accent); }
.switch:focus-visible { outline: 2px solid var(--green-2); outline-offset: 3px; border-radius: 4px; }
.switch.busy { opacity: .5; pointer-events: none; }
@media (max-width: 800px) { .row-actions { justify-content: flex-start; } }

/* Reiter über Listen */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text, #222); }
.tabs a.active { color: var(--green-2); border-bottom-color: var(--green-2); }
.tabs .tabs-extra { margin-left: auto; font-weight: 500; }
.list-intro { max-width: 860px; margin: -4px 0 16px; }
.series-icon { color: var(--green-2); font-weight: 700; margin-right: 4px; cursor: help; }

/* Formular: Zwischenüberschriften, halbe Breite */
.form { grid-template-columns: 1fr 1fr; column-gap: 20px; }
.form > * { grid-column: 1 / -1; }
.form > .field-half { grid-column: auto / span 1; }
.form-heading { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--green-2); margin: 10px 0 -6px; padding-top: 14px; border-top: 1px solid var(--line); }
.form-heading:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.form input[type=time] { padding: 9px 12px; border: 1px solid #d6d1c5; border-radius: 8px; font: inherit; max-width: 180px; background: #fff; }
.checkbox-row { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.field[hidden] { display: none; }
@media (max-width: 640px) { .form > .field-half { grid-column: 1 / -1; } }

/* Terminserie: Formular + Vorschau nebeneinander */
.series-layout { display: grid; grid-template-columns: minmax(0, 860px) minmax(260px, 340px); gap: 20px; align-items: start; }
.series-layout > .form { max-width: none; }
.series-preview { position: sticky; top: 20px; }
.series-preview h2 { margin: 0 0 6px; font-size: 1.05rem; }
.series-preview h3 { margin: 18px 0 6px; font-size: .9rem; }
.sp-text { margin: 0 0 4px; }
.sp-dates { list-style: none; margin: 10px 0; padding: 0; max-height: 50vh; overflow-y: auto; border-top: 1px solid var(--line); }
.sp-dates li { padding: 5px 2px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; font-size: .9rem; }
.sp-dates li.skip { color: var(--muted); text-decoration: line-through; }
.sp-dates li.skip small { display: block; text-decoration: none; color: var(--accent); font-size: .78rem; }
.sp-dates li.more { color: var(--muted); font-style: italic; }
.sp-list { list-style: none; margin: 0; padding: 0; }
.sp-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; font-size: .9rem; }
.sp-list form { margin: 0; }
@media (max-width: 1150px) { .series-layout { grid-template-columns: 1fr; } .series-preview { position: static; } }

/* Hinweis im Termin-Formular */
.series-note { border-left: 4px solid var(--green-2); max-width: 860px; }
.series-note.is-detached { border-left-color: var(--accent); }
.series-note p { margin: 0 0 8px; }
.series-note p:last-child, .series-note form { margin-bottom: 0; }

/* Protokoll */
.pill-info { background: #e8eef7; color: #2b4a75; }
.pill-danger { background: var(--accent-soft); color: var(--accent); }
.log-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.log-filter select { padding: 9px 10px; border: 1px solid #d6d1c5; border-radius: 8px; font: inherit; background: #fff; }
.log-table td { font-size: .9rem; }
.log-details { color: var(--muted); max-width: 420px; }
.log-details small { display: block; }
.card h2 .small { float: right; font-size: .8rem; font-weight: 500; }

/* Auswahl-Kästchen (z.B. Kategorien beim Musiker-Kalender) */
.choice-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.choice-card { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1.5px solid #d6d1c5; border-radius: 10px;
    background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.choice-card:hover { border-color: var(--green-2); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-check { flex: none; width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid #c9c3b6; border-radius: 6px; background: #fff; display: grid; place-items: center; transition: all .15s; }
.choice-check::after { content: ""; width: 10px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.choice-text { display: grid; gap: 2px; line-height: 1.3; }
.choice-text strong { font-weight: 600; }
.choice-text small { color: var(--muted); font-size: .8rem; }
.choice-card:has(input:checked) { border-color: var(--green-2); background: #f1f6ec; box-shadow: 0 0 0 1px var(--green-2) inset; }
.choice-card:has(input:checked) .choice-check { background: var(--green-2); border-color: var(--green-2); }
.choice-card:has(input:checked) .choice-check::after { opacity: 1; }
.choice-card:has(input:focus-visible) { outline: 2px solid var(--green-2); outline-offset: 2px; }
.choice-summary { margin: 2px 0 0; font-size: .9rem; }
.choice-summary strong { color: var(--green-2); }
