* { box-sizing: border-box; margin:0; padding:0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    background: #0d0d0d;
    color: #e0e0e0;
    min-height: 100vh;
}

/* Header */
header {
    background: #161616;
    padding: 28px 40px;
    border-bottom: 2px solid #252525;
}
header h1 {
    font-size: 1.4em;
    color: #f0f0f0;
    margin-bottom: 4px;
    font-weight: 700;
}
header p { color: #888; font-size: 0.85em; }
.switch-bar {
    display: flex; gap: 6px; margin-bottom: 12px;
}
.switch-btn {
    padding: 6px 18px; border-radius: 20px;
    font-size: 0.82em; font-weight: 500;
    border: 1px solid #333; background: #181818; color: #888;
    text-decoration: none; transition: all 0.15s;
}
.switch-btn:hover { border-color: #555; color: #ccc; background: #222; }
.switch-btn.active { background: #1a3a2a; border-color: #2a5a3a; color: #8bc8a0; }
.ref-bar {
    display: flex; align-items: center; gap: 14px;
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid #252525;
    flex-wrap: wrap;
}
.ref-item {
    font-size: 0.78em; font-weight: 500; padding: 3px 10px;
    border-radius: 12px; border: 1px solid #333;
}
.ref-lufs  { color: #8bc8a0; border-color: #2a5a3a; }
.ref-peak  { color: #d29922; border-color: #4a3a1a; }
.ref-range { color: #8bc8a0; border-color: #2a5a3a; }
.ref-hint  { font-size: 0.72em; color: #666; margin-left: auto; }
.badge {
    display: inline-block;
    background: #222;
    color: #aaa;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.82em;
    margin-left: 10px;
    border: 1px solid #333;
}

/* Toolbar */
.toolbar {
    background: #141414;
    padding: 14px 40px;
    border-bottom: 1px solid #222;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.toolbar-group { display: flex; align-items: center; gap: 10px; }
.toolbar label { font-size: 0.82em; font-weight: 600; color: #999; white-space: nowrap; }
.search-input {
    background: #1e1e1e;
    border: 1px solid #333;
    color: #ddd;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    width: 240px;
    outline: none;
    transition: border 0.2s;
}
.search-input:focus { border-color: #555; }
.search-input::placeholder { color: #555; }
.scan-btn {
    background: #1a3a2a;
    border: 1px solid #2a5a3a;
    color: #8bc8a0;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.82em;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.scan-btn:hover { background: #1e4a30; border-color: #3a7a4a; color: #a0e0b0; }
.scan-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.scan-status {
    font-size: 0.78em;
    color: #888;
    margin-left: 4px;
}
.toolbar-right {
    margin-left: auto;
    color: #666;
    font-size: 0.8em;
}
.cpu-group { display: flex; align-items: center; gap: 8px; }
.cpu-label { font-size: 0.72em; color: #8b949e; font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; }
.cpu-bar-bg {
    width: 80px; height: 8px;
    background: #2a2e38; border-radius: 8px;
    overflow: hidden;
}
.cpu-bar-fill {
    height: 100%; border-radius: 8px;
    transition: width 0.5s ease, background 0.5s ease;
}
.cpu-text { font-size: 0.72em; color: #8b949e; min-width: 32px; text-align: right; }
.log-group { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.log-label { font-size: 0.72em; color: #8b949e; font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.log-text {
    font-size: 0.78em; color: #8b949e;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 400px;
}
.timer-text {
    font-size: 0.78em; color: #d29922; font-weight: 600;
    white-space: nowrap; margin-left: 4px;
}

/* Main Grid */
main {
    padding: 10px 40px 30px;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Karten - untereinander, kompakt */
.card {
    background: #181818;
    border: 1px solid #282828;
    border-radius: 10px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 16px;
}
.card:hover {
    border-color: #444;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transform: translateY(-3px);
}
.card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.card-title {
    font-size: 0.85em;
    font-weight: 600;
    color: #eee;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-date {
    font-size: 0.72em;
    color: #555;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Metriken in der Karte */
.card-metrics {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.metric {
    min-width: 60px;
    width: 72px;
    background: #111;
    border: 1px solid #222;
    border-radius: 6px;
    padding: 6px 4px;
    text-align: center;
    flex-shrink: 0;
}
.metric-label {
    display: block;
    font-size: 0.65em;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.metric-value {
    display: block;
    font-size: 1.05em;
    font-weight: 700;
    color: #ccc;
}
.metric-good .metric-value { color: #4caf50; }
.metric-warn .metric-value { color: #ff9800; }
.metric-bad  .metric-value { color: #f44336; }

/* Overlay / Detail */
.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.overlay.active {
    display: flex;
}
.overlay-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 32px;
    max-width: 520px;
    width: 90%;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}
.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.3em;
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover { color: #fff; }

#detail-inner h2 {
    font-size: 1.2em;
    color: #f0f0f0;
    margin-bottom: 4px;
    padding-right: 24px;
}
.detail-date {
    color: #666;
    font-size: 0.82em;
    margin-bottom: 20px;
}
.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.detail-metric {
    background: #111;
    border: 1px solid #252525;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dm-label {
    font-size: 0.75em;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.dm-value {
    font-size: 1.6em;
    font-weight: 700;
    color: #ddd;
}
.dm-desc {
    font-size: 0.75em;
    color: #555;
    margin-top: 2px;
}
.detail-metric.metric-good .dm-value { color: #4caf50; }
.detail-metric.metric-warn .dm-value { color: #ff9800; }
.detail-metric.metric-bad  .dm-value { color: #f44336; }

/* Footer */
footer {
    text-align: center;
    color: #555;
    font-size: 0.76em;
    padding: 24px 40px;
    border-top: 1px solid #222;
    background: #121212;
    margin-top: 20px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* Leerseite */
.empty-state {
    text-align: center;
    color: #555;
    padding: 80px 20px;
    font-style: italic;
    grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 768px) {
    header { padding: 20px 16px; }
    .toolbar { padding: 12px 16px; }
    main {
        padding: 16px;
        grid-template-columns: 1fr;
    }
    .search-input { width: 180px; }
    .card-metrics { flex-wrap: wrap; }
    .metric { min-width: 80px; }
}