:root {
    --blue: #00a0e4;
    --blue-dark: #0089c7;
    --ink: #2f343a;
    --muted: #6b7280;
    --line: #e3e7ec;
    --bg: #eef2f5;
    --card: #fff;
    --side: #f5f7f9;
    --green: #43a047;
    --orange: #ef8c22;
    --info: #00b4d8;
    --danger: #e14b4b;
    --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; }
a { color: #1578b8; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.site-top {
    background: #fff;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
    padding: 10px 22px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    flex-wrap: wrap;
}
.site-logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: .04em; }
.site-logo img { width: 72px; height: 10px; object-fit: cover; background: #111; }
.site-logo strong { font-weight: 500; }
.site-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { color: #3c4450; font-size: 14px; text-decoration: none; }
.site-nav a.is-active, .site-nav a:hover { color: var(--blue-dark); }
.site-user { font-weight: 650; }

.site-main { width: min(1100px, calc(100% - 32px)); margin: 22px auto 48px; }
.overview h1, .card h1 { margin: 0 0 6px; font-size: 26px; font-weight: 650; }
.overview p { margin: 0 0 16px; color: var(--muted); }
.overview-stats, .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.overview-stats article, .stats article, .card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 2px;
}
.overview-stats article, .stats article { padding: 14px 16px; }
.overview-stats strong, .stats strong { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.overview-stats span, .stats span, .muted { color: var(--muted); }
.card { padding: 16px 18px 18px; margin: 16px 0; }
.card h2 { margin: 0 0 14px; font-size: 16px; }
.card-head, .event-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.site-foot { width: min(1100px, calc(100% - 32px)); margin: 0 auto 28px; color: var(--muted); }

.bluebar {
    background: var(--blue);
    color: #fff;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 18px;
}
.bluebar-title { font-size: 16px; font-weight: 650; }
.bluebar-user { display: flex; gap: 14px; align-items: center; }
.bluebar a { color: #fff; }

.shell { display: flex; min-height: calc(100vh - 104px); }
.side {
    width: 230px;
    background: var(--side);
    border-right: 1px solid var(--line);
    padding: 10px 0 24px;
    flex: none;
}
.side a, .side-label {
    display: block;
    padding: 9px 18px;
    color: #3d4652;
    text-decoration: none;
}
.side-label { margin-top: 8px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #7b8490; }
.side-sub { padding-left: 28px; }
.side a.is-active, .side a:hover { background: #e7f2fa; color: #0b6fa8; text-decoration: none; }
.work { flex: 1; min-width: 0; }
.sheet-tabs { display: flex; gap: 0; padding: 14px 18px 0; }
.sheet-tabs a {
    background: #f7f8fa;
    border: 1px solid var(--line);
    border-bottom: 0;
    color: #445;
    padding: 8px 14px;
    margin-right: 4px;
    border-radius: 3px 3px 0 0;
    text-decoration: none;
}
.sheet-tabs a.is-active { background: var(--blue); color: #fff; border-color: var(--blue); }
.content { padding: 0 18px 36px; }

.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 8px 0 12px; }
.search-form { flex: 1; }
.search-form input, .card input, .card select, .card textarea, .form-grid input, .form-grid select, .form-grid textarea, .inline-form input, .inline-form select {
    width: 100%;
    border: 1px solid #cfd6dd;
    border-radius: 2px;
    background: #fff;
    padding: 8px 10px;
    min-height: 36px;
}
.card label, .form-grid label, .login-card label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-weight: 650; }
.search-form input { max-width: 520px; }
.btn, button {
    background: var(--blue);
    color: #fff;
    border: 0;
    border-radius: 3px;
    padding: 8px 14px;
    text-decoration: none;
    display: inline-block;
}
.btn:hover, button:hover { background: var(--blue-dark); text-decoration: none; }
.btn-save, button.btn-save { background: var(--green); }
.btn-save:hover, button.btn-save:hover { background: #368a3a; }
button.secondary, .linkish { background: transparent; color: #1578b8; padding: 0; }
.linkish:hover { background: transparent; text-decoration: underline; }
.check { flex-direction: row !important; align-items: center; font-weight: 500; }
.check input { width: auto; min-height: 0; }
.is-private { border-color: var(--danger) !important; box-shadow: inset 0 0 0 1px var(--danger); }

.year-bar { background: #d5d8dc; color: #333; font-weight: 700; padding: 6px 10px; margin-top: 8px; }
html, body { max-width: 100%; }
body { overflow-x: hidden; }
.shell, .work, .content, .site-main { min-width: 0; max-width: 100%; }
.table-wrap { overflow-x: auto; max-width: 100%; background: #fff; border: 1px solid var(--line); border-top: 0; }
.card .table-wrap, .data { border-top: 1px solid var(--line); }
.data, .grid { width: 100%; border-collapse: collapse; background: #fff; }
.data th, .data td, .grid th, .grid td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #eceff2;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}
.data th, .grid th { background: #f3f4f6; color: #5d6670; font-weight: 650; }
.data tr:hover td, .grid tr:hover td { background: #f7fbfe; }
.num { text-align: right; }
.netto { font-weight: 750; }

.sport-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: #607d8b; vertical-align: middle; }
.sport-Lauf { background: #1e88e5; }
.sport-Trail { background: #6d4c41; }
.sport-Triathlon { background: #8e24aa; }
.sport-Duathlon { background: #fb8c00; }
.sport-Rad { background: #43a047; }
.sport-Schwimmen { background: #00acc1; }
.sport-Sonstiges { background: #607d8b; }

.pill { display: inline-block; border-radius: 3px; padding: 2px 8px; font-size: 12px; font-weight: 700; color: #fff; background: #90a4ae; }
.pill-yes, .pill-live { background: var(--green); }
.pill-closed, .pill-beendet { background: var(--orange); }
.pill-no, .pill-entwurf { background: #90a4ae; }

.flash { padding: 10px 12px; border-radius: 2px; margin: 10px 0; }
.flash-ok { background: #e8f6ea; color: #1b6b32; }
.flash-error { background: #fdecea; color: #9a2a2a; }
code { font-family: ui-monospace, SFMono-Regular, monospace; }

.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr); gap: 16px; align-items: start; }
.split-side .card { margin-top: 0; }
.info-box { background: var(--info); color: #fff; padding: 14px 16px; border-radius: 2px; margin-bottom: 16px; }
.info-box p { margin: 8px 0 0; line-height: 1.45; }
.meta-line { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; margin: 0; }
.save-row { display: flex; justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-actions { display: flex; align-items: end; gap: 8px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input, .inline-form select, .sort { width: auto; }
.sort { width: 72px; }
.tabs, .filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.tabs a, .filters a {
    background: #fff;
    color: var(--ink);
    border: 1px solid #cfd6dd;
    border-radius: 3px;
    padding: 6px 10px;
    text-decoration: none;
}
.tabs a.is-active, .filters a.is-active { background: var(--blue); color: #fff; border-color: var(--blue); }
.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.login-wrap { width: min(460px, calc(100% - 32px)); margin: 36px auto 60px; }
.login-card h1 { font-size: 22px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 2px; padding: 16px 18px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 16px; }

.wand { background: #0d1114; color: #fff; }
.wand .site-top { background: #000; border-color: #222; }
.wand .site-logo, .wand .site-nav a { color: #fff; }
.wand .site-main .card { background: #111; border-color: #2a2a2a; color: #fff; }
.wand h1, .wand .result-block h3 { color: #fff; }
.wand .muted, .wand .data th, .wand .grid th { color: #c8c8c8; }
.wand .data th, .wand .data td, .wand .grid th, .wand .grid td { background: #111; border-color: #2c2c2c; color: #fff; font-size: 20px; }
.wand .filters a { background: #1b1b1b; color: #fff; border-color: #444; }
.wand .filters a.is-active { background: #fff; color: #000; }
.wand .pill-yes { background: #fff; color: #000; }

@media (max-width: 860px) {
    .site-top { height: auto; align-items: flex-start; flex-direction: column; padding: 12px 14px; }
    .shell { display: block; }
    .side { width: auto; display: flex; gap: 4px; overflow-x: auto; padding: 8px; }
    .side a, .side-label, .side-sub { padding: 8px 10px; white-space: nowrap; }
    .side-label { margin: 0; }
    .overview-stats, .stats, .split, .form-grid { grid-template-columns: 1fr 1fr; }
    .content, .site-main { width: auto; }
    .wand .data th, .wand .data td, .wand .grid th, .wand .grid td { font-size: 15px; }
}
@media (max-width: 560px) {
    .overview-stats, .stats, .split, .form-grid { grid-template-columns: 1fr; }
}
