:root {
    --bg-color: #0f172a;
    --panel-bg: #1e293b;
    --card-bg: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --border: #334155;
    --btn-white-bg: #e2e8f0;
    --btn-white-text: #0f172a;
}

body.light-mode {
    --bg-color: #f8fafc;
    --panel-bg: #ffffff;
    --card-bg: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #0284c7;
    --border: #e2e8f0;
    --btn-white-bg: #f1f5f9;
    --btn-white-text: #0f172a;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    margin: 0; padding: 0; user-select: none;
    transition: background 0.3s, color 0.3s;
}

/* NAVBAR */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--panel-bg); padding: 15px 25px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.nav-brand { font-size: 20px; font-weight: 800; color: var(--accent); letter-spacing: -0.5px; }
.nav-links { display: flex; gap: 10px; align-items: center; }
.nav-btn {
    background: transparent; border: none; color: var(--text-muted);
    padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600;
    transition: 0.2s;
}
.nav-btn:hover { color: var(--text-main); background: var(--card-bg); }
.nav-btn.active { background: var(--accent); color: #fff; }
.theme-toggle { background: transparent; border: none; font-size: 20px; cursor: pointer; padding: 5px; margin-left: 10px; }

/* LAYOUT */
.tab-content { display: none; padding: 25px 20px; max-width: 900px; margin: 0 auto; animation: fadeIn 0.3s ease-out; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* PANELS */
.display-panel, .card {
    background: var(--panel-bg); padding: 40px; border-radius: 24px;
    text-align: center; margin-bottom: 25px; border: 1px solid var(--border);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.card { text-align: left; padding: 25px; border-radius: 16px; }
.mt-20 { margin-top: 20px; }
.card-title { margin-top: 0; color: var(--accent); font-size: 16px; margin-bottom: 20px; }

/* TYPOGRAFIE TIMER */
.clock-small { font-size: 18px; color: var(--text-muted); font-family: monospace; font-weight: 500; }
.state-badge {
    display: inline-block; padding: 6px 14px; background: var(--card-bg);
    border-radius: 20px; font-size: 13px; font-weight: 700; margin: 15px 0; border: 1px solid var(--border); letter-spacing: 1px;
}
.countdown { font-size: 110px; font-family: monospace; font-weight: 800; margin: 10px 0; letter-spacing: -3px; line-height: 1; }

/* NEXT ACTION */
.next-action-panel { margin-top: 30px; padding-top: 25px; border-top: 1px solid var(--border); }
.next-action-label { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: 1.5px; }
.next-action-time { font-size: 48px; color: var(--accent); font-family: monospace; font-weight: 700; margin-top: 5px; line-height: 1; }

/* BUTTON GRID */
.btn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 768px) { .btn-grid { grid-template-columns: 1fr 1fr; } }

.btn {
    padding: 24px 20px 24px 55px; font-size: 15px; font-weight: 600; border: none; border-radius: 16px;
    cursor: pointer; color: #fff; position: relative; text-align: left; transition: all 0.15s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.btn:active { transform: scale(0.97); box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1); }

/* FARBEN */
.btn-green { background: #16a34a; } 
.btn-white { background: var(--btn-white-bg); color: var(--btn-white-text); border: 1px solid var(--border); } 
.btn-yellow { background: #f59e0b; color: #000; } 
.btn-red { background: #dc2626; } 
.btn-blue { background: #2563eb; } 
.btn-orange { background: #ea580c; }

/* LEDS */
.led {
    width: 14px; height: 14px; border-radius: 50%; position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.6); border: 2px solid rgba(255,255,255,0.15); box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}
@keyframes blink_fast { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
@keyframes blink_slow { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.led.green.on { background: #4ade80; box-shadow: 0 0 15px #4ade80; } .led.green.blink_fast { background: #4ade80; box-shadow: 0 0 15px #4ade80; animation: blink_fast 0.3s infinite; }
.led.white.on { background: #fff; box-shadow: 0 0 15px #fff; border-color: #ccc; }
.led.yellow.on { background: #fde047; box-shadow: 0 0 15px #fde047; } .led.yellow.blink_slow { background: #fde047; box-shadow: 0 0 15px #fde047; animation: blink_slow 1.5s infinite; } .led.yellow.blink_fast { background: #fde047; box-shadow: 0 0 15px #fde047; animation: blink_fast 0.3s infinite; }
.led.red.on { background: #f87171; box-shadow: 0 0 15px #f87171; } .led.red.blink_slow { background: #f87171; box-shadow: 0 0 15px #f87171; animation: blink_slow 1.5s infinite; } .led.red.blink_fast { background: #f87171; box-shadow: 0 0 15px #f87171; animation: blink_fast 0.3s infinite; }
.led.blue.on { background: #60a5fa; box-shadow: 0 0 15px #60a5fa; } .led.blue.blink_slow { background: #60a5fa; box-shadow: 0 0 15px #60a5fa; animation: blink_slow 1.5s infinite; }
.led.orange.on { background: #fb923c; box-shadow: 0 0 15px #fb923c; }

/* EINSTELLUNGEN & LOG */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.checkbox-label { cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.log-box { background: #000; padding: 20px; border-radius: 12px; height: 300px; overflow-y: auto; font-family: monospace; font-size: 13px; line-height: 1.7; border: 1px solid var(--border); color: #a1a1aa; }