:root {
    /* Schwarz- & Grautöne */
    --bg-color: #0d0e11;
    --surface-card: #16181d;
    --surface-elevated: #1f2229;
    --surface-input: #121418;
    --border-subtle: #2a2e39;
    --border-light: #383d4c;

    /* Textfarben */
    --text-main: #f0f0f2;
    --text-muted: #9aa0ac;

    /* 1. GOLD: Reserviert für Deko-Elemente (Überschriften, Rahmen, Tabellenköpfe) */
    --gold-light: #f7e59b;
    --gold-mid: #d4af37;
    --gold-dark: #8c6224;
    --gold-border: rgba(212, 175, 55, 0.42);
    --gold-glow: rgba(212, 175, 55, 0.2);
    --gold-gradient: linear-gradient(135deg, #8c6224 0%, #c99e4c 28%, #f7e59b 50%, #c99e4c 72%, #8c6224 100%);

    /* 2. GELB: Für Navigations-Knöpfe (führen auf eine weitere Seite) */
    --accent-yellow: #eab308;
    --accent-yellow-hover: #facc15;
    --accent-yellow-bg: rgba(234, 179, 8, 0.15);
    --accent-yellow-border: rgba(234, 179, 8, 0.55);

    /* 3. GRÜN: Für Eintragen- & Absenden-Knöpfe (Highscores, Feedback, Meldungen) */
    --status-green: #2ea043;
    --status-green-hover: #3fb950;
    --status-green-bg: rgba(46, 160, 67, 0.18);
    --status-green-border: rgba(63, 185, 80, 0.6);

    /* Weitere Statusfarben */
    --status-red: #cf3432;
    --status-orange: #d4942a;
    --primary-blue: #388bfd;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 0%, #1c1e26 0%, #0d0e11 75%);
    background-attachment: fixed;
    color: var(--text-main);
    overflow-x: hidden;
}

textarea {
    resize: none !important;
}

/* Header & Original Pin&Play Logo (Gold-Deko) */
header {
    background: linear-gradient(180deg, #1a1c22 0%, #111216 100%);
    color: var(--text-main);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid var(--gold-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

header.tech-mode {
    background: linear-gradient(180deg, #221d14 0%, #12110e 100%);
    border-bottom: 2px solid var(--gold-mid);
}

.logo {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, opacity 0.15s;
}
.logo:hover {
    opacity: 0.92;
    transform: scale(1.01);
}
.logo-img {
    height: 48px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Navigations-Knöpfe oben rechts (Gelbes Schema) */
.quick-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.quick-actions button {
    padding: 9px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    transition: all 0.2s;
}

.btn-nav-page {
    background-color: var(--accent-yellow-bg);
    color: var(--accent-yellow-hover);
    border: 1px solid var(--accent-yellow-border);
}
.btn-nav-page:hover {
    background-color: var(--accent-yellow);
    color: #111;
    border-color: var(--accent-yellow-hover);
    transform: translateY(-1px);
}

.btn-nav-active {
    background-color: var(--accent-yellow);
    color: #111;
    border: 2px solid var(--gold-light);
    box-shadow: 0 0 12px var(--gold-glow);
}

.btn-nav-util {
    background-color: var(--surface-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}
.btn-nav-util:hover {
    color: #ff7b72;
    border-color: var(--status-red);
}

.btn-yellow {
    background-color: var(--accent-yellow-bg) !important;
    color: var(--accent-yellow-hover) !important;
    border: 1px solid var(--accent-yellow-border) !important;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.15s;
}
.btn-yellow:hover {
    background-color: var(--accent-yellow) !important;
    color: #111 !important;
    border-color: var(--accent-yellow-hover) !important;
}

.btn-green {
    background-color: var(--status-green) !important;
    color: #fff !important;
    border: 1px solid var(--status-green-border) !important;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(46, 160, 67, 0.25);
    transition: all 0.15s;
}
.btn-green:hover {
    background-color: var(--status-green-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 160, 67, 0.35);
}

/* Haupt-Container & Goldene Deko-Überschriften */
.container {
    max-width: 1000px;
    margin: 24px auto;
    padding: 24px;
    background: var(--surface-card);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}
.hidden { display: none !important; }

h2, h3 {
    color: var(--gold-light);
    letter-spacing: 0.5px;
}

/* Flipper-Karten im Grid */
.grid-overview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}
.flipper-card {
    border: 1px solid var(--border-subtle);
    padding: 15px;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    background: linear-gradient(180deg, #1d2027 0%, #15171c 100%);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.flipper-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold-mid);
    box-shadow: 0 6px 18px var(--gold-glow);
}
.flipper-card h3 {
    color: var(--text-main);
    font-size: 17px;
}
.flipper-card:hover h3 {
    color: var(--gold-light);
}
.flipper-card .placeholder-img {
    width: 100%;
    height: 155px;
    background: #0f1115;
    border: 1px solid var(--border-subtle);
    margin-bottom: 12px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.flipper-card .placeholder-img img { width: 100%; height: 100%; object-fit: cover; }

/* Detail-Header & Zurück-Button oben links */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gold-border);
    padding-bottom: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.detail-header-left { display: flex; align-items: center; gap: 14px; }
.detail-header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn-back {
    background-color: var(--surface-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    width: 40px;
    height: 40px;
    padding: 0 0 3px 0;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
    box-sizing: border-box;
}
.btn-back:hover {
    background-color: var(--accent-yellow);
    color: #111;
    border-color: var(--accent-yellow-hover);
    transform: translateX(-2px);
}

.detail-top-section { display: flex; gap: 20px; }
.detail-left { flex: 1.5; }
.detail-right { flex: 1; }
.placeholder-img-large {
    width: 100%;
    height: 300px;
    background: #0f1115;
    border: 1px solid var(--gold-border);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.placeholder-img-large img { width: 100%; height: 100%; object-fit: cover; }

.info-box {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--gold-mid);
    padding: 16px;
    border-radius: 6px;
    line-height: 1.9;
    font-size: 15px;
    color: var(--text-main);
}
.info-box strong {
    color: var(--gold-mid);
}

.georg-text-container {
    margin-top: 20px;
    padding: 20px;
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    column-count: 2;
    column-gap: 30px;
    text-align: justify;
    white-space: pre-wrap;
    line-height: 1.65;
    color: #d8dbe2;
}

/* Allgemeine & Destruktive Buttons */
.btn-report {
    background-color: var(--status-red);
    color: white;
    padding: 9px 16px;
    border: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.15s;
}
.btn-report:hover { opacity: 0.9; }

.btn-switch {
    background-color: var(--surface-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.15s;
}
.btn-switch:hover {
    border-color: var(--gold-mid);
    color: var(--gold-light);
}

.btn-power {
    background-color: #121418;
    color: #3fb950;
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
}

.btn-status-tech {
    font-weight: bold;
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    border-radius: 5px;
    background: var(--surface-elevated);
    cursor: pointer;
}
.btn-status-tech:hover { border-color: var(--gold-mid); }

.btn-add-score {
    background-color: var(--status-green);
    color: #fff;
    border: 1px solid var(--status-green-border);
    border-radius: 4px;
    width: 26px;
    height: 26px;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.btn-add-score:hover {
    background-color: var(--status-green-hover);
    transform: scale(1.06);
}

/* Hinweisschilder & Goldene Deko-Ranglisten-Badges */
.badge-inactive-warn {
    display: inline-block;
    background-color: rgba(212, 175, 55, 0.12);
    color: var(--gold-light);
    border: 1px solid var(--gold-border);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    vertical-align: middle;
}
.badge-inactive-icon {
    background-color: rgba(212, 175, 55, 0.15);
    color: var(--gold-light);
    border: 1px solid var(--gold-border);
    border-radius: 4px;
    width: 26px;
    height: 26px;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    cursor: help;
    margin-left: 8px;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 24px;
    padding: 0 6px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 13px;
}
.rank-1 { background: var(--gold-gradient); color: #111; border: 1px solid var(--gold-light); }
.rank-2 { background: linear-gradient(135deg, #7d828a, #d0d5dd, #8b9098); color: #111; }
.rank-3 { background: linear-gradient(135deg, #6e4223, #b87333, #7a4928); color: #fff; }

tr.unverified-hs-row { background-color: rgba(234, 179, 8, 0.07); }
tr.unverified-hs-row td:first-child { border-left: 4px solid var(--accent-yellow); }
.badge-unverified-hs {
    display: inline-block;
    background-color: var(--accent-yellow-bg);
    color: var(--accent-yellow-hover);
    border: 1px solid var(--accent-yellow-border);
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
    cursor: pointer;
    vertical-align: middle;
}
.badge-unverified-hs:hover {
    background-color: var(--accent-yellow);
    color: #111;
}

/* Tabellen (Desktop-Standard) */
table { width: 100%; border-collapse: collapse; margin-top: 15px; }
th, td {
    border: 1px solid var(--border-subtle);
    padding: 11px 12px;
    text-align: left;
    vertical-align: middle;
}
th {
    background-color: var(--surface-elevated);
    color: var(--gold-mid);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gold-border);
}
tr:nth-child(even) { background-color: rgba(255, 255, 255, 0.015); }
tr:hover { background-color: rgba(212, 175, 55, 0.05); }

th.sortable-th { cursor: pointer; user-select: none; transition: background-color 0.15s, color 0.15s; }
th.sortable-th:hover { background-color: #282c36; color: var(--gold-light); }
.sort-indicator { display: inline-block; margin-left: 5px; font-size: 12px; color: var(--gold-light); }

.status-grün { color: #3fb950; font-weight: bold; }
.status-rot { color: #f85149; font-weight: bold; }
.status-orange { color: var(--accent-yellow-hover); font-weight: bold; }

.clickable-name { color: var(--text-main); font-weight: bold; text-decoration: underline; text-decoration-color: var(--accent-yellow); cursor: pointer; }
.clickable-name:hover { color: var(--accent-yellow-hover); }

.status-color-box { width: 100%; min-width: 48px; height: 24px; border-radius: 4px; display: block; border: 1px solid rgba(255,255,255,0.15); }
.status-box-green { background-color: var(--status-green); }
.status-box-orange { background-color: var(--status-orange); }
.status-box-red { background-color: var(--status-red); }

/* Formulare & Inputs */
.report-form label { color: var(--gold-light); font-size: 14px; }
.report-form select, .report-form input, .report-form textarea {
    width: 100%;
    padding: 11px;
    margin-top: 6px;
    margin-bottom: 16px;
    background-color: var(--surface-input);
    color: var(--text-main);
    border: 1px solid var(--border-light);
    box-sizing: border-box;
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
}
.report-form select:focus, .report-form input:focus, .report-form textarea:focus {
    outline: none;
    border-color: var(--gold-mid);
    box-shadow: 0 0 0 2px var(--gold-glow);
}

.prev-score-banner {
    background: var(--surface-elevated);
    border-left: 4px solid var(--gold-mid);
    padding: 10px 12px;
    margin-top: 5px;
    margin-bottom: 14px;
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-main);
}
.hs-rules-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: -10px;
    margin-bottom: 12px;
    background: var(--surface-input);
    padding: 7px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

/* 3-Wege Modus-Tabs im Techniker-Detail */
.report-mode-tabs { display: flex; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; }
.report-tab-btn {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--surface-elevated);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.report-tab-btn:hover { border-color: var(--accent-yellow-border); color: var(--text-main); }
.report-tab-btn.active-open {
    background: linear-gradient(180deg, #252934 0%, #1b1e26 100%);
    border: 1px solid var(--gold-mid);
    color: var(--gold-light);
    box-shadow: 0 2px 10px var(--gold-glow);
}
.report-tab-btn.active-resolved {
    background: linear-gradient(180deg, #16261b 0%, #111c14 100%);
    border: 1px solid #3fb950;
    color: #7ee787;
    box-shadow: 0 2px 10px rgba(46, 160, 67, 0.2);
}
.report-tab-btn.active-highscore {
    background: linear-gradient(180deg, #2b2312 0%, #1c170c 100%);
    border: 1px solid var(--accent-yellow);
    color: var(--accent-yellow-hover);
    box-shadow: 0 2px 12px rgba(234, 179, 8, 0.2);
}

.report-controls {
    background: var(--surface-elevated);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
}
.report-controls.resolved-mode-controls { background: #131f16; border-color: #264a2e; }
.report-controls.highscore-mode-controls { background: #211c11; border-color: #57441d; }

.filter-Toolbar { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 15px; }
.filter-pills-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-pill {
    padding: 6px 13px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid transparent;
    user-select: none;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.filter-pill.inactive {
    opacity: 0.35;
    filter: grayscale(80%);
    background: #14161b !important;
    color: #666 !important;
    border-color: #2a2e39 !important;
}
.pill-unverif { background: var(--accent-yellow-bg); color: var(--accent-yellow-hover); border-color: var(--accent-yellow-border); }
.pill-verif { background: rgba(46, 160, 67, 0.16); color: #7ee787; border-color: #2ea043; }
.pill-p1 { background: rgba(207, 52, 50, 0.18); color: #ff7b72; border-color: var(--status-red); }
.pill-p2 { background: rgba(212, 148, 42, 0.18); color: #f0b754; border-color: var(--status-orange); }
.pill-p3 { background: rgba(56, 139, 253, 0.18); color: #79c0ff; border-color: var(--primary-blue); }

.sort-and-action-group { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.bold-sort-select {
    padding: 10px 12px !important;
    font-weight: bold;
    font-size: 13px;
    color: var(--text-main);
    border: 1px solid var(--border-light) !important;
    border-radius: 6px !important;
    background-color: var(--surface-input);
    cursor: pointer;
    min-width: 230px;
}
.bold-sort-select option { font-weight: bold; background-color: var(--surface-card); color: var(--text-main); }

.btn-context-add {
    background-color: var(--status-green);
    color: #fff;
    border: 1px solid var(--status-green-border);
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 800;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(46, 160, 67, 0.25);
    transition: all 0.15s;
}
.btn-context-add:hover {
    background-color: var(--status-green-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 160, 67, 0.35);
}

.resolved-archive-banner {
    background: rgba(46, 160, 67, 0.14);
    color: #7ee787;
    border: 1px solid #2ea043;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.reports-list-resolved-wrapper {
    background: rgba(22, 38, 27, 0.45);
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed #2ea043;
}

.highscore-archive-banner {
    background: var(--accent-yellow-bg);
    color: var(--accent-yellow-hover);
    border: 1px solid var(--accent-yellow-border);
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.reports-list-highscore-wrapper {
    background: rgba(43, 35, 18, 0.4);
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed var(--accent-yellow-border);
}

/* Report-Karten */
.report-comment {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.report-comment.unverified-card {
    background: #211d14;
    border-color: var(--accent-yellow-border);
}
.report-comment.resolved-card {
    background: #151f18;
    border-color: #264a2e;
}
.report-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}
.badge-prio {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    letter-spacing: 0.4px;
}
.badge-prio-1 { background-color: var(--status-red); }
.badge-prio-2 { background-color: var(--status-orange); color: #111; }
.badge-prio-3 { background-color: var(--primary-blue); }
.badge-prio-0 { background-color: #484f58; }

.badge-unverified {
    display: inline-block;
    background-color: var(--accent-yellow-bg);
    color: var(--accent-yellow-hover);
    border: 1px solid var(--accent-yellow-border);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}
.badge-verified {
    display: inline-block;
    background-color: rgba(46, 160, 67, 0.2);
    color: #7ee787;
    border: 1px solid #2ea043;
    padding: 4px 9px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}
.badge-resolved {
    display: inline-block;
    background-color: var(--status-green);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}
.report-body-text {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-main);
    white-space: pre-wrap;
    margin-bottom: 12px;
}
.report-solution-box {
    background: rgba(46, 160, 67, 0.12);
    border-left: 4px solid var(--status-green);
    padding: 10px 14px;
    border-radius: 4px;
    margin-top: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #a2f2a9;
    white-space: pre-wrap;
}
.report-cause-box {
    background: rgba(212, 175, 55, 0.1);
    border-left: 4px solid var(--gold-mid);
    padding: 10px 14px;
    border-radius: 4px;
    margin-top: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--gold-light);
    white-space: pre-wrap;
}
.report-meta-email { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.report-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-subtle);
}

/* Farbige Meldungs-Zähler in der Techniker-Übersicht */
.meldungen-counts { display: inline-flex; gap: 6px; align-items: center; font-weight: bold; font-size: 13px; cursor: pointer; flex-wrap: wrap; }
.count-r { color: white; background: var(--status-red); padding: 2px 8px; border-radius: 4px; min-width: 14px; text-align: center; }
.count-g { color: #111; background: var(--status-orange); padding: 2px 8px; border-radius: 4px; min-width: 14px; text-align: center; }
.count-b { color: white; background: var(--primary-blue); padding: 2px 8px; border-radius: 4px; min-width: 14px; text-align: center; }
.count-u { color: var(--accent-yellow-hover); background: var(--accent-yellow-bg); padding: 2px 8px; border-radius: 4px; border: 1px solid var(--accent-yellow-border); min-width: 14px; text-align: center; }

/* Modals / Popups */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 15px;
}
.modal-box {
    background: var(--surface-card);
    border: 1px solid var(--gold-border);
    max-width: 550px;
    width: 100%;
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

/* ==========================================================================
   HANDY- & SMARTPHONE-OPTIMIERUNG (Alle Tabellen passen ohne Scrollen)
   ========================================================================== */
@media (max-width: 768px) {
    .detail-top-section { flex-direction: column; }
    .detail-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .detail-header-actions { width: 100%; justify-content: flex-start; }
    .georg-text-container { column-count: 1; padding: 15px; }
}

@media (max-width: 680px) {
    header {
        padding: 10px 12px;
        gap: 10px;
    }
    .logo-img {
        height: 38px;
    }
    .quick-actions {
        width: 100%;
        gap: 6px;
    }
    .quick-actions button {
        flex: 1 1 auto;
        padding: 8px 8px;
        font-size: 11px;
        text-align: center;
    }

    .container {
        margin: 10px 8px;
        padding: 14px 12px;
    }
    h2 { font-size: 19px; }
    h3 { font-size: 16px; }

    .grid-overview {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    .flipper-card { padding: 10px; }
    .flipper-card .placeholder-img { height: 120px; }
    .flipper-card h3 { font-size: 15px; }
    .placeholder-img-large { height: 210px; }

    .report-mode-tabs { gap: 8px; }
    .report-tab-btn {
        min-width: 100%;
        padding: 10px 12px;
        font-size: 13px;
    }
    .sort-and-action-group {
        width: 100%;
    }
    .sort-and-action-group > div {
        flex: 1 1 100%;
    }
    .bold-sort-select {
        width: 100%;
        min-width: 0;
    }
    .btn-context-add {
        width: 100%;
        text-align: center;
    }

    /* 1. TECHNIKER-TABELLE (.tech-table) AUF DEM HANDY:
       Kopfzeile wird zur kompakten Sortier-Leiste, Zeilen werden zu 2-zeiligen Karten */
    table.tech-table,
    table.tech-table tbody {
        display: block;
        width: 100%;
    }
    table.tech-table thead {
        display: block;
        margin-bottom: 12px;
    }
    table.tech-table thead tr {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        background: var(--surface-elevated);
        padding: 8px;
        border: 1px solid var(--gold-border);
        border-radius: 6px;
    }
    table.tech-table thead tr::before {
        content: "Sortieren:";
        width: 100%;
        font-size: 11px;
        font-weight: bold;
        color: var(--text-muted);
        text-transform: uppercase;
        margin-bottom: 2px;
    }
    table.tech-table thead th {
        flex: 1 1 auto;
        width: auto !important;
        padding: 6px 8px;
        font-size: 11px;
        border: 1px solid var(--border-light);
        border-radius: 4px;
        text-align: center;
    }
    /* Spalte 'Handbuch' ist nicht sortierbar -> in der mobilen Sortier-Leiste ausblenden */
    table.tech-table thead th:last-child {
        display: none;
    }

    table.tech-table tbody tr {
        display: grid;
        grid-template-columns: auto 1fr auto auto;
        gap: 8px 10px;
        align-items: center;
        padding: 12px;
        margin-bottom: 10px;
        background: var(--surface-elevated);
        border: 1px solid var(--border-subtle);
        border-radius: 6px;
    }
    table.tech-table tbody td {
        border: none;
        padding: 0;
    }
    table.tech-table tbody td[colspan] {
        grid-column: 1 / -1;
        text-align: center;
        padding: 12px;
    }
    /* Zeile 1 der Karte: Kürzel | Name | Status-Box */
    table.tech-table tbody td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        background: var(--surface-input);
        padding: 3px 7px;
        border-radius: 4px;
        border: 1px solid var(--border-light);
        font-size: 12px;
    }
    table.tech-table tbody td:nth-child(2) {
        grid-column: 2 / 4;
        grid-row: 1;
        font-size: 15px;
        word-break: break-word;
    }
    table.tech-table tbody td:nth-child(3) {
        grid-column: 4;
        grid-row: 1;
        justify-self: end;
    }
    table.tech-table .status-color-box {
        min-width: 32px;
        width: 32px;
        height: 22px;
    }
    /* Zeile 2 der Karte: Offene Meldungen | Power-Button | PDF-Button */
    table.tech-table tbody td:nth-child(4) {
        grid-column: 1 / 3;
        grid-row: 2;
        padding-top: 8px;
        border-top: 1px dashed var(--border-subtle);
        display: flex;
        align-items: center;
        gap: 6px;
        min-height: 32px;
    }
    table.tech-table tbody td:nth-child(4)::before {
        content: "Meldungen:";
        font-size: 11px;
        color: var(--text-muted);
    }
    table.tech-table tbody td:nth-child(5) {
        grid-column: 3;
        grid-row: 2;
        padding-top: 8px;
        border-top: 1px dashed var(--border-subtle);
        justify-self: end;
    }
    table.tech-table tbody td:nth-child(6) {
        grid-column: 4;
        grid-row: 2;
        padding-top: 8px;
        border-top: 1px dashed var(--border-subtle);
        justify-self: end;
    }
    table.tech-table tbody td button {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* 2. HIGHSCORE GRAND-CHAMPIONS-TABELLE (.hs-champions-table) AUF DEM HANDY */
    table.hs-champions-table,
    table.hs-champions-table tbody {
        display: block;
        width: 100%;
    }
    table.hs-champions-table thead {
        display: none;
    }
    table.hs-champions-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 6px 10px;
        align-items: center;
        padding: 12px;
        margin-bottom: 10px;
        background: var(--surface-elevated);
        border: 1px solid var(--border-subtle);
        border-radius: 6px;
    }
    table.hs-champions-table tbody td {
        border: none;
        padding: 0;
    }
    table.hs-champions-table tbody td:nth-child(1) {
        grid-column: 1 / -1;
        grid-row: 1;
        font-size: 15px;
        padding-bottom: 6px;
        border-bottom: 1px dashed var(--border-subtle);
        word-break: break-word;
    }
    table.hs-champions-table tbody td:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
        font-size: 13px;
        padding-top: 2px;
    }
    table.hs-champions-table tbody td:nth-child(2)::before {
        content: "Rekordhalter: ";
        color: var(--text-muted);
        font-size: 12px;
    }
    table.hs-champions-table tbody td:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
        font-size: 14px;
    }
    table.hs-champions-table tbody td:nth-child(3)::before {
        content: "Punkte: ";
        color: var(--text-muted);
        font-size: 12px;
    }
    table.hs-champions-table tbody td:nth-child(4) {
        grid-column: 2;
        grid-row: 2 / 4;
        justify-self: end;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    table.hs-champions-table tbody td:nth-child(4) .btn-yellow {
        padding: 7px 10px;
        font-size: 12px;
    }

    /* 3. EINZELGERÄT-RANGLISTE (.hs-single-table) AUF DEM HANDY */
    table.hs-single-table th,
    table.hs-single-table td {
        padding: 8px 6px;
        font-size: 13px;
    }
    table.hs-single-table th:first-child,
    table.hs-single-table td:first-child {
        width: 44px !important;
    }
}
