/* Verwaltung */
body.admin { background: var(--bg-soft); }
.admin-header { background: var(--dark); border-bottom: 3px solid var(--red); color: #fff; }
.admin-header-inner { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.admin-header .brand img { width: 46px; }
.admin-nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.admin-nav a { color: #e9eaee; text-decoration: none; padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a[aria-current="page"] { background: var(--red); color: #fff; }
.logout { display: flex; align-items: center; gap: 10px; color: #b9bcc4; font-size: .9rem; }
.logout button { background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; padding: 5px 12px; cursor: pointer; font: inherit; }
.admin-main { padding-top: 30px; padding-bottom: 60px; max-width: 980px; }
.admin-main h1 { font-size: 1.9rem; }
.admin-main h2 { font-size: 1.3rem; }

.notice { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-weight: 600; }
.notice ul { margin: 0; padding-left: 1.1em; }
.notice.ok { background: #e6f5ea; color: #1e6b35; border: 1px solid #b9e2c4; }
.notice.error { background: #fdf0f2; color: var(--red-dark); border: 1px solid #f5c2cb; }

.admin-form { display: grid; gap: 16px; }
.admin-form label, .images-box .label { display: grid; gap: 6px; font-weight: 700; font-size: .95rem; color: var(--ink); }
.admin-form input:not([type="checkbox"]):not([type="file"]), .admin-form select, .admin-form textarea, .search input {
  font: inherit; font-weight: 400; padding: 10px 12px; border: 1.5px solid #cfd3da; border-radius: 8px; background: #fff; width: 100%; color: var(--text);
}
.admin-form textarea { resize: vertical; line-height: 1.5; }
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus { border-color: var(--red); outline: none; box-shadow: 0 0 0 3px rgba(220,5,45,.12); }
.narrow-form { max-width: 420px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > label { flex: 0 0 auto; }
.form-row > .grow { flex: 1 1 220px; }
.w-date { width: 190px; }
.w-time { width: 140px; }
.w-score { width: 110px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-status { color: var(--muted); font-weight: 600; }
.check { display: flex !important; grid-template-columns: none; align-items: center; gap: 10px; font-weight: 700; }
.check input { width: 20px; height: 20px; accent-color: var(--red); }

.match-box { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0; background: #fff; display: grid; gap: 14px; }
#match-fields { display: grid; gap: 14px; }
#match-fields[hidden] { display: none; }
.match-lookup { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 12px; display: grid; gap: 8px; }
#match-results { display: grid; gap: 6px; }
.match-pick { text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 8px; padding: 9px 12px; cursor: pointer; font: inherit; font-size: .93rem; }
.match-pick:hover { border-color: var(--red); }
.ok-text { color: #1e6b35; font-weight: 700; }

.images-box { display: grid; gap: 10px; }
.img-list { display: flex; flex-wrap: wrap; gap: 10px; }
.img-list:empty { display: none; }
.img-item { position: relative; width: 140px; height: 105px; border-radius: 8px; overflow: hidden; background: #ddd; box-shadow: var(--shadow); }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item:first-child::before { content: "Titelbild"; position: absolute; left: 6px; top: 6px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.img-item.new { outline: 3px solid var(--gold); }
#img-new .img-item:first-child::before { content: "neu"; background: var(--gold); color: var(--ink); }
.img-tools { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 3px; }
.img-tools button { width: 28px; height: 28px; border: 0; border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; font-size: .85rem; }
.img-tools button:hover { background: var(--red); }
.file-drop { border: 2px dashed #cfd3da; border-radius: var(--radius); padding: 18px; text-align: center; cursor: pointer; background: #fff; font-weight: 600 !important; color: var(--muted) !important; }
.file-drop:hover { border-color: var(--red); }
.file-drop input { margin: 0 auto; }

.danger-zone { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
.btn-danger { background: #fff; color: var(--red-dark); border-color: #f5c2cb; }
.btn-danger:hover { background: var(--red-dark); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: .88rem; }

.toolbar { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search { display: flex; gap: 8px; }
.search input { width: 240px; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr.past { opacity: .6; }
.admin-table a { text-decoration: none; color: var(--ink); }
.admin-table a:hover { color: var(--red); }
.t-img { width: 84px; }
.t-img img, .t-img .no-img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; display: block; background: var(--bg-soft); }
.t-actions { text-align: right; white-space: nowrap; }
.t-actions form { display: inline; }
.t-actions > a:not(.btn) { margin-right: 10px; font-size: .9rem; color: var(--muted); }
@media (max-width: 600px) { .t-img { display: none; } .t-actions > a:not(.btn) { display: none; } }

.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.dash-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; text-decoration: none; color: var(--ink); display: grid; gap: 4px; border-top: 4px solid var(--red); transition: transform .12s; }
.dash-card:hover { transform: translateY(-2px); color: var(--ink); }
.dash-card span:last-child { color: var(--muted); font-size: .92rem; }
.dash-icon { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--red); line-height: 1; }
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.panel h2 { margin-top: 0; }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }

.theme-options { display: grid; gap: 8px; }
.theme-option { display: flex !important; align-items: center; gap: 10px; font-weight: 600 !important; }
.theme-option input { width: 18px; height: 18px; accent-color: var(--red); }
.theme-option a { font-size: .85rem; font-weight: 600; margin-left: 6px; }
.swatch { width: 44px; height: 22px; border-radius: 6px; border: 1px solid var(--line); }
.sw-schwarz { background: #16181d; }
.sw-blau { background: #0066b2; }
.sw-grau { background: #363c46; }
.sw-hell { background: linear-gradient(#fff 50%, #0066b2 50%); }
.sw-graublau { background: linear-gradient(#363c46 50%, #0066b2 50%); }

.nav-warn { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: var(--red); font-weight: 800; font-size: .75rem; margin-left: 2px; }
.st { --st-farbe: var(--red); }
.st h2, .sz h2 { margin-top: 0; }

.notice.warn { background: #fff8e6; color: #7a5300; border: 1px solid #f0d99a; }
.ds { --ds-farbe: var(--red); }
.ds h2 { margin-top: 0; }
