/* Suisse Dance Festival 2026 – Teilnehmer-Auswertung */
:root {
    --bg: #0f1226;
    --bg2: #161a35;
    --card: #1c2142;
    --card2: #232a52;
    --line: #303870;
    --txt: #e9ecff;
    --muted: #9aa3d4;
    --accent: #ff4d8d;
    --accent2: #5b8cff;
    --green: #2ecc8f;
    --amber: #ffb84d;
    --red: #ff6b6b;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: radial-gradient(1200px 600px at 80% -10%, #2a2060 0%, transparent 60%),
                radial-gradient(900px 500px at -10% 10%, #1a3a6b 0%, transparent 55%),
                var(--bg);
    color: var(--txt);
    line-height: 1.5;
    min-height: 100vh;
}

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

.wrap { width: 90%; max-width: none; margin: 0 auto; padding: 28px 0 60px; }

/* Header */
.site-head {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    margin-bottom: 22px;
}
.logo {
    width: 58px; height: 58px; border-radius: 16px; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: grid; place-items: center; font-weight: 800; font-size: 20px;
    color: #fff; box-shadow: var(--shadow); letter-spacing: 1px;
}
.site-head h1 { margin: 0; font-size: 26px; }
.site-head .sub { color: var(--muted); font-size: 14px; }

/* Tabs */
.tabs {
    display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 22px;
    border-bottom: 1px solid var(--line); padding-bottom: 12px;
}
.tab-btn {
    background: var(--card); color: var(--txt); border: 1px solid var(--line);
    padding: 9px 14px; border-radius: 999px; cursor: pointer; font-size: 14px;
    transition: .15s; white-space: nowrap;
}
.tab-btn:hover { border-color: var(--accent2); }
.tab-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-color: transparent; color: #fff; font-weight: 600;
}
.panel { display: none; animation: fade .2s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* Cards / KPI */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi {
    background: linear-gradient(180deg, var(--card2), var(--card));
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px; box-shadow: var(--shadow);
}
.kpi .num { font-size: 32px; font-weight: 800; line-height: 1; }
.kpi .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; }
.kpi.accent .num { color: var(--accent); }
.kpi.blue .num { color: var(--accent2); }
.kpi.green .num { color: var(--green); }
.kpi.amber .num { color: var(--amber); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }

/* Geografie: zwei feste Spalten, Boxen darin vertikal gestapelt */
.geo-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.geo-col { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 820px) { .geo-cols { grid-template-columns: 1fr; } }

.box {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.box h2, .box h3 { margin: 0 0 14px; font-size: 17px; }
.box h2 .count { color: var(--muted); font-weight: 500; font-size: 14px; }

/* Balken-Chart */
.bar-row { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 10px; margin: 7px 0; font-size: 14px; }
.bar-row .name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 16px; border-radius: 8px; background: linear-gradient(90deg, var(--accent2), var(--accent)); min-width: 3px; }
.bar.green { background: linear-gradient(90deg, #27e0a0, #1f9d76); }
.bar.amber { background: linear-gradient(90deg, #ffce7a, #ff9d3c); }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; }

/* Tabellen */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.search {
    flex: 1; min-width: 200px; background: var(--bg2); border: 1px solid var(--line);
    color: var(--txt); border-radius: 10px; padding: 9px 12px; font-size: 14px;
}
.btn {
    display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
    background: var(--card2); border: 1px solid var(--line); color: var(--txt);
    padding: 9px 13px; border-radius: 10px; font-size: 13px; cursor: pointer;
}
.btn:hover { border-color: var(--accent2); }
.btn.print { background: linear-gradient(135deg, var(--accent2), #3b6fe0); border-color: transparent; color: #fff; }

.table-scroll { overflow-x: hidden; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
thead th {
    text-align: left; background: var(--bg2); color: var(--muted); font-weight: 600;
    padding: 11px 12px; position: sticky; top: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
tbody td {
    padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
tbody td.idx, tbody td.col-geschl, tbody td.col-name { border-top: 0; }
tbody td a { overflow: hidden; text-overflow: ellipsis; }
tbody td .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody tr:hover { background: rgba(91, 140, 255, .07); }
tbody tr.is-test { opacity: .6; }
th.idx, td.idx {
    color: var(--muted); text-align: right; width: 46px;
    padding-left: 6px; padding-right: 12px;
}
th.col-name, td.col-name { width: 205px; white-space: nowrap; }
th.col-ort, td.col-ort { width: 200px; white-space: nowrap; }
td.col-name .muted { white-space: nowrap; }
th.col-clip, td.col-clip { white-space: nowrap; }
th.col-plz, td.col-plz { width: 52px; white-space: nowrap; padding-left: 6px; padding-right: 6px; }
th.col-geschl, td.col-geschl { width: 96px; white-space: nowrap; overflow: visible; text-overflow: clip; }
th.col-land, td.col-land { width: 78px; white-space: nowrap; }
th.col-email, td.col-email { width: 230px; white-space: nowrap; }
th.col-tel, td.col-tel { width: 120px; white-space: nowrap; }
th.col-begl, td.col-begl { width: 110px; white-space: nowrap; }
th.col-datum, td.col-datum { width: 95px; white-space: nowrap; }
th.col-aktion, td.col-aktion {
    width: 54px; overflow: visible; text-overflow: clip;
    padding-left: 6px; padding-right: 6px;
}
th.col-strasse, td.col-strasse { width: 170px; white-space: nowrap; }

.group-title {
    margin: 64px 0 0; font-size: 17px; font-weight: 700;
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: 12px 12px 0 0;
    background: var(--bg2); border: 1px solid var(--line); border-bottom: 0;
    border-left: 5px solid var(--accent2);
}
.group-title:first-of-type { margin-top: 16px; }
.group-title, .group-title + .table-scroll { margin-left: 28px; }
.group-title + .table-scroll { border-radius: 0 0 var(--radius) var(--radius); border-top: 0; }
.group-title .pill { font-size: 13px; }
.group-title .count { color: var(--muted); font-weight: 500; }
.group-title:has(.pill.anf) { border-left-color: var(--green); }
.group-title:has(.pill.fort) { border-left-color: var(--accent2); }

thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--txt); }
thead th.sortable::after { content: '⇅'; margin-left: 6px; font-size: 11px; opacity: .35; }
thead th.sorted-asc::after { content: '↑'; opacity: 1; color: var(--accent2); }
thead th.sorted-desc::after { content: '↓'; opacity: 1; color: var(--accent2); }

.del-cell { text-align: center; white-space: nowrap; }
.btn-cancel, .btn-reaktiv {
    border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 600;
    line-height: 1.4; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s;
}
.btn-cancel {
    background: rgba(255, 107, 107, .14); border: 1px solid rgba(255, 107, 107, .35); color: #ffb3b3;
}
.btn-cancel:hover { background: rgba(255, 107, 107, .28); border-color: rgba(255, 107, 107, .6); }
.btn-reaktiv {
    background: rgba(46, 204, 143, .16); border: 1px solid rgba(46, 204, 143, .4); color: #6ff0bd;
}
.btn-reaktiv:hover { background: rgba(46, 204, 143, .3); border-color: rgba(46, 204, 143, .65); }
.btn-cancel:disabled, .btn-reaktiv:disabled { opacity: .6; cursor: default; }
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; padding: 0; font-size: 14px;
}

/* Dance-App-/Video-Button (Check-in-Liste) */
th.col-dance, td.col-dance { width: 168px; overflow: visible; text-overflow: clip; }
.dance-cell { text-align: center; white-space: nowrap; }
.btn-dance {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 600;
    line-height: 1.3; cursor: pointer; white-space: nowrap; width: 100%;
    transition: background .15s, border-color .15s;
    background: var(--card2); border: 1px solid var(--line); color: var(--txt);
}
.btn-dance:hover { border-color: var(--accent2); }
.btn-dance.state-neu {
    background: rgba(91, 140, 255, .14); border-color: rgba(91, 140, 255, .4); color: #c2d3ff;
}
.btn-dance.state-kontakt {
    background: rgba(255, 184, 77, .14); border-color: rgba(255, 184, 77, .4); color: #ffd699;
}
.btn-dance.state-aktiv {
    background: rgba(46, 204, 143, .16); border-color: rgba(46, 204, 143, .45); color: #6ff0bd;
}
.btn-dance:disabled { opacity: .6; cursor: progress; }

/* Paar-/Einzel-Kennzeichnung in der Check-in-Liste – nur Mobil sichtbar */
.pe-badge { display: none; }
@media (max-width: 640px) {
    .pe-badge {
        display: inline-flex; align-items: center; justify-content: center;
        border-radius: 50%; vertical-align: super; margin-left: 5px;
        font-weight: 700; line-height: 1; text-align: center;
    }
    /* P: dezent (Paar) */
    .pe-badge.pe-p {
        width: 15px; height: 15px; font-size: 9px;
        background: rgba(255, 255, 255, .06); color: var(--muted);
        border: 1px solid var(--line);
    }
    /* E: auffälliger (Einzeln) */
    .pe-badge.pe-e {
        width: 20px; height: 20px; font-size: 12px;
        background: var(--accent); color: #fff;
        border: 1px solid var(--accent);
        box-shadow: 0 0 0 3px rgba(255, 77, 141, .28);
    }
}

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.anf { background: rgba(46, 204, 143, .18); color: #6ff0bd; }
.pill.fort { background: rgba(91, 140, 255, .2); color: #a9c3ff; }
.pill.yes { background: rgba(46, 204, 143, .18); color: #6ff0bd; }
.pill.no { background: rgba(255, 107, 107, .18); color: #ffb3b3; }
.pill.test { background: rgba(255, 184, 77, .2); color: var(--amber); }
.pill.mann { background: rgba(91, 140, 255, .2); color: #a9c3ff; }
.pill.frau { background: rgba(255, 77, 141, .2); color: #ffb0cf; }

.einzel-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.einzel-cards .kpi { padding: 12px 16px; }
.einzel-cards .kpi .num { font-size: 26px; }

.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.checkbox-cell { width: 34px; text-align: center; }
/* Druck-Box (zum Abhaken auf Papier) – nur beim Drucken sichtbar */
.checkbox-cell .box-print { display: none; width: 18px; height: 18px; border: 2px solid var(--line); border-radius: 4px; }
/* Interaktive Check-in-Checkbox auf dem Bildschirm */
.anwesend-box { width: 20px; height: 20px; cursor: pointer; accent-color: var(--green); vertical-align: middle; }
.anwesend-box:disabled { opacity: .5; cursor: progress; }
tr.is-anwesend { background: rgba(46, 204, 143, .12); }
tr.is-anwesend td { border-color: rgba(46, 204, 143, .3); }

/* Anwesenheits-Zähler in den Check-in-Überschriften */
.anwesend-counter {
    font-size: 13px; font-weight: 600; color: var(--green);
    background: rgba(46, 204, 143, .14); border: 1px solid rgba(46, 204, 143, .35);
    border-radius: 999px; padding: 2px 10px; margin-left: 8px; vertical-align: middle;
}

.legend { color: var(--muted); font-size: 13px; margin-top: 4px; }
.foot { color: var(--muted); font-size: 12px; margin-top: 30px; text-align: center; }

/* Upload / Drag & Drop */
.dropzone {
    border: 2px dashed var(--line); border-radius: var(--radius);
    background: var(--bg2); padding: 40px 20px; text-align: center; transition: .15s;
}
.dropzone.drag { border-color: var(--accent2); background: rgba(91, 140, 255, .1); }
.dz-inner { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.dz-icon { font-size: 42px; line-height: 1; }
.dz-title { font-size: 18px; font-weight: 700; }
.dz-sub { color: var(--muted); font-size: 14px; }
.dz-hint { color: var(--muted); font-size: 12.5px; }
.note code, .dz-hint code, .box code {
    background: var(--card2); padding: 1px 6px; border-radius: 6px; font-size: .92em;
}
.dz-results { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 6px; }
.dz-results li { font-size: 13px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); }
.dz-results .dz-ok { background: rgba(46, 204, 143, .12); border-color: var(--green); color: #b9f3da; }
.dz-results .dz-err { background: rgba(255, 107, 107, .12); border-color: var(--red); color: #ffd0d0; }
.dz-results .dz-info { background: rgba(91, 140, 255, .1); border-color: var(--accent2); color: #cfdcff; }

/* Benutzer-Box im Header (Name + Abmelden) */
.user-box { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-name { color: var(--muted); font-size: 14px; }
.logout-btn { background: var(--card2); }
.logout-btn:hover { border-color: var(--accent); }

/* Login-Seite */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
    width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 26px;
    display: flex; flex-direction: column; gap: 12px; text-align: center;
}
.login-logo {
    width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 4px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: grid; place-items: center; font-weight: 800; font-size: 22px; color: #fff;
    box-shadow: var(--shadow); letter-spacing: 1px;
}
.login-title { margin: 0; font-size: 22px; }
.login-sub { color: var(--muted); font-size: 14px; margin: 0; }
.login-hint { color: var(--muted); font-size: 12.5px; margin: 2px 0 6px; }
.login-label { display: flex; flex-direction: column; gap: 5px; text-align: left; font-size: 13px; color: var(--muted); }
.login-label input {
    background: var(--bg2); border: 1px solid var(--line); color: var(--txt);
    border-radius: 10px; padding: 11px 12px; font-size: 15px;
}
.login-label input:focus { outline: none; border-color: var(--accent2); }
.login-btn {
    margin-top: 6px; border: none; border-radius: 10px; padding: 12px 14px;
    font-size: 15px; font-weight: 700; cursor: pointer; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.login-btn:hover { filter: brightness(1.07); }
.login-error {
    background: rgba(255, 107, 107, .12); border: 1px solid var(--red); color: #ffd0d0;
    border-radius: 10px; padding: 10px 12px; font-size: 13px;
}

/* Druck */
@media print {
    body { background: #fff; color: #000; }
    .site-head .logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .tabs, .toolbar, .no-print, .site-head .sub { display: none !important; }
    .col-dance { display: none !important; }
    thead th.sortable::after { content: '' !important; }
    .panel { display: none !important; }
    .panel.print-active { display: block !important; }
    .box, .kpi, .table-scroll { box-shadow: none; border-color: #bbb; }
    thead th { background: #eee; color: #000; }
    tbody td { border-color: #ccc; }
    .pill { border: 1px solid #999; }
    a { color: #000; text-decoration: none; }
    /* Anwesenheit: gedruckt als Kästchen mit Häkchen statt interaktiver Box */
    .checkbox-cell .box-print {
        display: inline-block; border-color: #000;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    .checkbox-cell .box-print.checked {
        background: #000; position: relative;
    }
    .checkbox-cell .box-print.checked::after {
        content: '✓'; color: #fff; font-size: 14px; font-weight: 700;
        position: absolute; top: 50%; left: 50%; transform: translate(-50%, -55%); line-height: 1;
    }
    tr.is-anwesend { background: #eef9f2 !important; }
    .anwesend-counter { color: #000; background: none; border: 1px solid #999; }
}
