/* =========================================================
   Vespa Club Neulengbach – Admin-Bereich (baut auf style.css auf)
   ========================================================= */
body.admin { background: #f4f2ee; font-size: 16px; }
.admin h1 { font-size: 1.8rem; margin: .2em 0 .6em; }
.admin h2 { font-size: 1.15rem; margin: 0 0 .7em; }
.admin a { color: inherit; }
.admin code { background: var(--cream); padding: 0 .3em; border-radius: 4px; }

.admin-header { background: #fff; border-bottom: 3px solid var(--accent); padding: 10px 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; position: sticky; top: 0; z-index: 10; }
.admin-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.admin-brand img { border-radius: 50%; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.admin-nav a { text-decoration: none; padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.admin-nav a:hover { background: var(--cream); }
.admin-nav a.active { background: var(--ink); color: #fff; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: .95rem; padding: 7px 10px; }
.inline { display: inline; }
.admin-main { max-width: 1000px; margin: 0 auto; padding: 24px 16px 60px; }

.hint { color: var(--muted); margin-top: -6px; }
.small { font-size: .85em; }
.crumbs { color: var(--muted); margin-bottom: .3em; }
.flash { background: #e3f1d9; color: #2f5f14; border-radius: 10px; padding: 10px 16px; margin-bottom: 18px; font-weight: 700; }
.flash.error { background: var(--accent-soft); color: var(--accent-dark); }

.panel { background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 18px 22px; margin-bottom: 20px; }
.panel h2 + .hint { margin-top: -4px; }
.item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.item:first-of-type { padding-top: 0; }
.item:last-child { border-bottom: 0; padding-bottom: 0; }
details summary { cursor: pointer; font-weight: 700; }
details[open] summary { margin-bottom: 12px; }

/* Formulare */
.row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.row.compact { gap: 8px; align-items: center; }
.row label, .stack > label, .field { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .9em; }
.field-label { font-weight: 700; }
.grow { flex: 1 1 220px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.compact { gap: 8px; }
.row .check, .stack > .check, .check { flex-direction: row; align-items: center; gap: 6px; font-weight: 600; }
.admin input[type=text], .admin input:not([type]), .admin input[type=password], .admin input[type=number], .admin input[type=date],
.admin input[type=time], .admin input[type=url], .admin select, .admin textarea {
  font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid #d6cfc2; border-radius: 8px; background: #fff; width: 100%; color: var(--ink); }
.admin input.short { width: 110px; }
.admin textarea { resize: vertical; line-height: 1.45; }
.admin input:focus, .admin select:focus, .admin textarea:focus, .editor-area:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.admin input[type=checkbox] { width: 1.1em; height: 1.1em; accent-color: var(--accent); }
input[type=file] { font: inherit; }

/* Buttons */
.admin .btn { padding: .55rem 1.15rem; background: var(--accent); color: #fff; border: 1px solid var(--accent); cursor: pointer; font: inherit; font-weight: 600; font-size: .95rem; }
.admin .btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.admin .btn.small { padding: .35rem .85rem; font-size: .88rem; }
.admin .btn.secondary { background: #fff; color: var(--ink); border-color: var(--ink); }
.admin .btn.secondary:hover { background: var(--ink); color: #fff; }
.admin .btn.danger { background: #fff; color: var(--accent-dark); border-color: #e6b8bf; }
.admin .btn.danger:hover { background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); }

.table { width: 100%; border-collapse: collapse; }
.table td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td:last-child { text-align: right; white-space: nowrap; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 7px 16px; border-radius: 999px; background: #fff; text-decoration: none; font-weight: 600; border: 1px solid var(--line); }
.tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Editor */
.editor { border: 1px solid #d6cfc2; border-radius: 10px; overflow: hidden; background: #fff; font-weight: 400; font-size: 1rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: var(--cream); border-bottom: 1px solid var(--line); }
.toolbar button { font: inherit; font-size: .85em; padding: 4px 9px; border: 1px solid #d6cfc2; background: #fff; border-radius: 6px; cursor: pointer; }
.toolbar button:hover { background: var(--cream-deep); }
.editor-area { padding: 12px 14px; line-height: 1.5; }
.editor-area:empty::before { content: 'Hier tippen …'; color: #aaa; }
.editor-area h2, .editor-area h3 { font-size: 1.2rem; margin: .5em 0 .2em; }
.editor-area p { margin: .3em 0; }

/* Karten */
.karte-edit { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.bild-feld { display: flex; flex-direction: column; gap: 8px; width: 220px; max-width: 100%; }
.bild-vorschau { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--cream); }
.admin .file-btn { justify-content: center; font-size: .88rem; }

/* Fotos */
.admin-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.admin-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.admin-photo input { font-size: .9rem !important; padding: 6px 8px !important; }
.admin-photo input.short { width: 70px; }
.progress { margin-top: 12px; background: var(--cream); border-radius: 8px; height: 26px; position: relative; overflow: hidden; }
.progress .bar { background: var(--accent); height: 100%; width: 0; transition: width .2s; }
.progress .label { position: absolute; inset: 0; display: grid; place-items: center; font-size: .85em; font-weight: 700; }

/* Statistik */
.stats-filter { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 18px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg a { text-decoration: none; color: var(--ink); padding: 5px 12px; border-radius: 7px; font-weight: 600; font-size: .92em; }
.seg a:hover { background: var(--cream); }
.seg a.active { background: var(--ink); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--cream); border-radius: 999px; padding: 4px 4px 4px 12px; font-weight: 600; font-size: .92em; }
.chip a { text-decoration: none; color: var(--muted); padding: 0 8px; }
.chip a:hover { color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 14px 18px; }
.kpi-label { color: var(--muted); font-size: .85em; font-weight: 700; }
.kpi-value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: .85em; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 0 20px; }
.chart { margin: 0; }
.chart-plot { position: relative; height: 160px; margin-top: 22px; border-top: 1px dashed var(--line); border-bottom: 1px solid var(--line); }
.chart-max { position: absolute; top: -1.5em; left: 0; font-size: .75em; color: var(--muted); }
.chart-bars { display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.chart-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; cursor: default; outline: none; }
.chart-bar { position: relative; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; }
.chart-col:hover .chart-bar, .chart-col:focus-visible .chart-bar { background: var(--accent-dark); }
.chart-col:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.chart-col:hover .chart-bar::after, .chart-col:focus .chart-bar::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: .8rem; font-weight: 600; padding: 5px 9px; border-radius: 6px; white-space: nowrap; z-index: 3; pointer-events: none; }
.chart-bar.tip-l::after { left: 0 !important; transform: none !important; }
.chart-bar.tip-r::after { left: auto !important; right: 0; transform: none !important; }
.chart-x { display: flex; gap: 2px; margin-top: 4px; }
.chart-x span { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; font-size: .72em; color: var(--muted); white-space: nowrap; }
.stats-details { margin-top: 14px; }
.stats-details summary { cursor: pointer; color: var(--accent-dark); font-weight: 600; font-size: .92em; }
.stats-table th { text-align: left; font-size: .85em; color: var(--muted); padding: 6px; border-bottom: 2px solid var(--line); }
.stats-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; width: 6em; }
.stats-table a { text-decoration: none; color: var(--ink); font-weight: 700; }
.stats-table a:hover { color: var(--accent-dark); text-decoration: underline; }
.stats-table tr.selected td { background: var(--accent-soft); }
.stats-table .stat-track { margin-top: 5px; height: 6px; }
.stat-track { display: block; height: 10px; background: var(--cream-deep); border-radius: 999px; overflow: hidden; }
.stat-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.stat-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; }
.stat-list li { display: grid; grid-template-columns: 7.5em 1fr 3.5em; gap: 10px; align-items: center; font-weight: 600; }
.stat-list .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Login */
.login-body { display: grid; place-items: center; min-height: 100vh; margin: 0; padding: 16px; }
.login-card { background: #fff; padding: 30px 34px; border-radius: var(--radius); box-shadow: var(--shadow); width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-logo { border-radius: 50%; margin: 0 auto; }
.login-card h1 { margin: 0 0 6px; font-size: 1.5rem; text-align: center; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .9em; }
.login-card .btn { justify-content: center; }

@media (max-width: 640px) {
  .admin-header { position: static; }
  .panel { padding: 14px 14px; }
}
