:root {
	--bg: #0f0c1c;
	--bg2: #171228;
	--card: #1d1631;
	--card2: #271e40;
	--line: #382b58;
	--text: #f1eafb;
	--muted: #a597c2;
	--accent: #ff8ad8;
	--accent2: #8fb8ff;
	--live: #ff3b6b;
	--ok: #4fd69c;
	--warn: #ffc857;
	--danger: #ff6b6b;
	--radius: 14px;
	font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, #24184a 0%, transparent 60%), var(--bg); }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.spacer { flex: 1; }
h2 { font-size: 1.05rem; margin: 0 0 12px; letter-spacing: 0.02em; }
h3 { margin: 0 0 8px; font-size: 0.95rem; }
code { background: #ffffff12; padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }

/* Marke */
.brand { font-weight: 800; font-size: 1.3rem; display: flex; align-items: center; gap: 8px; }
.brand b { color: var(--accent); }
.brand.big { font-size: 2rem; justify-content: center; }
.logo-dot { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 0 14px var(--accent); }

/* Bausteine */
.card { background: linear-gradient(180deg, var(--card), var(--bg2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--card2); color: var(--text); padding: 9px 14px; border-radius: 10px; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background 0.15s, border-color 0.15s; }
.btn:hover { border-color: var(--accent2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.small { padding: 6px 10px; font-size: 0.88rem; }
.btn.primary { background: linear-gradient(135deg, #d958b4, #6d6cf0); border-color: transparent; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.wide { width: 100%; justify-content: center; }
label.btn input[type=file] { display: none; }
input, select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font: inherit; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--accent2); outline-offset: 1px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 0.9rem; color: var(--muted); }
.mt { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.error-text { color: var(--danger); margin: 4px 0; }
.info-box, .hint, .error-box { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 0.9rem; }
.info-box { background: #8fb8ff14; border: 1px solid #8fb8ff44; }
.hint { background: #ffc8571a; border: 1px solid #ffc85755; color: #ffe3a3; }
.error-box { background: #ff6b6b1a; border: 1px solid #ff6b6b55; color: #ffb3b3; }
.empty { padding: 18px; text-align: center; color: var(--muted); }

/* Anmeldung */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; text-align: center; }
.login-card label { text-align: left; }

/* Kopfzeile */
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: #0f0c1ccc; backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.pill { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; padding: 4px 10px; border-radius: 999px; background: #ffffff14; color: var(--muted); white-space: nowrap; }
.pill.live { background: var(--live); color: #fff; box-shadow: 0 0 16px #ff3b6b88; animation: pulse 2s infinite; }
.pill.bot { background: #4fd69c26; color: var(--ok); }
.pill.stream { background: #8fb8ff26; color: var(--accent2); }
.pill.down { background: #ff6b6b33; color: #ffb3b3; }
@keyframes pulse { 50% { box-shadow: 0 0 4px #ff3b6b44; } }
.tabs { display: flex; gap: 4px; }
.tabs button { background: none; border: none; color: var(--muted); font: inherit; padding: 8px 12px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--text); background: var(--card2); }
.listen-mini { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.listen-mini b { color: var(--text); font-size: 1rem; }
.user-menu { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; min-width: 190px; z-index: 30; }
.menu button, .menu a { background: none; border: none; color: var(--text); text-align: left; padding: 8px 10px; border-radius: 7px; font: inherit; cursor: pointer; text-decoration: none; }
.menu button:hover, .menu a:hover { background: #ffffff10; }
.tab { padding: 20px; max-width: 1400px; margin: 0 auto; }

/* Raster */
.grid-2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* Sender */
.onair { display: flex; gap: 18px; align-items: center; }
.onair-icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; background: radial-gradient(circle at 30% 30%, #3a2a62, #171228); border: 3px solid var(--line); flex-shrink: 0; }
.onair-icon.live { border-color: var(--live); box-shadow: 0 0 30px #ff3b6b55; }
.onair-icon.bot { border-color: var(--ok); }
.onair-icon.stream { border-color: var(--accent2); }
.now { flex: 1; min-width: 0; }
.now-kind { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); font-weight: 700; }
.now-title { font-size: 1.35rem; font-weight: 700; margin: 4px 0 2px; overflow-wrap: anywhere; }
.now-artist { color: var(--muted); overflow-wrap: anywhere; }
.progress { margin-top: 14px; height: 8px; background: #ffffff14; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.9s linear; }
.progress-times { display: flex; justify-content: space-between; font-size: 0.8rem; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--muted); }
.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid #ffffff0d; }
.switch { flex-direction: row; align-items: center; gap: 8px; cursor: pointer; color: var(--text); font-size: 0.95rem; }
.switch input { display: none; }
.switch span { width: 42px; height: 24px; background: #ffffff1c; border-radius: 99px; position: relative; transition: background 0.2s; flex-shrink: 0; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.setting-rows { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 14px; align-items: center; }
.setting-rows > span { color: var(--muted); font-size: 0.9rem; }

/* Hoerer */
.listeners { display: flex; align-items: baseline; gap: 10px; }
.listeners .big { font-size: 2.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 70px; margin-top: 10px; display: block; }
.spark path.area { fill: #ff8ad822; }
.spark path.line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-legend { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid #ffffff0d; min-width: 0; }
.list li:last-child { border-bottom: none; }
.list .t { flex: 1; min-width: 0; }
.list .t div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .sub { font-size: 0.8rem; color: var(--muted); }
.list .num { width: 28px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.85rem; flex-shrink: 0; }
.list .time { color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list li.mark { color: var(--live); font-weight: 600; }
.list li.dragging { opacity: 0.4; }
.list li.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.list .grip { cursor: grab; color: var(--muted); user-select: none; }
.scroll { max-height: 420px; overflow: auto; }
.icon-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; font: inherit; }
.icon-btn:hover { color: var(--text); background: #ffffff12; }
.icon-btn.danger:hover { color: var(--danger); }
.src-tag { font-size: 0.68rem; padding: 1px 6px; border-radius: 6px; background: #ffffff12; color: var(--muted); margin-right: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.src-tag.live { background: #ff3b6b33; color: #ffb3c6; }
.src-tag.stream { background: #8fb8ff26; color: var(--accent2); }

/* Speicher */
.bar { height: 10px; background: #ffffff14; border-radius: 99px; overflow: hidden; display: flex; }
.bar .seg-music { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.bar .seg-other { background: #ffffff30; }
.bar .seg-reserve { background: repeating-linear-gradient(45deg, #ffc85744 0 6px, transparent 6px 12px); }
.storage-legend { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 8px; font-size: 0.85rem; color: var(--muted); }
.storage-legend b { color: var(--text); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.dot.music { background: var(--accent); }
.dot.other { background: #ffffff50; }
.dot.free { background: #ffffff14; border: 1px solid #ffffff40; }

/* Musik */
.crumbs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.crumbs button { background: none; border: none; color: var(--accent); font: inherit; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.crumbs button:hover { background: #ffffff10; }
.crumbs .sep { color: var(--muted); }
.sel-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #8fb8ff1a; border-radius: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.dropzone { position: relative; border-radius: 10px; min-height: 160px; }
.drop-overlay { display: none; position: absolute; inset: 0; border: 2px dashed var(--accent); border-radius: 10px; background: #0f0c1cdd; place-items: center; font-size: 1.2rem; font-weight: 700; color: var(--accent); z-index: 5; }
.dropzone.drag .drop-overlay { display: grid; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.82rem; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid #ffffff0d; }
tr:hover td { background: #ffffff06; }
.files .chk { width: 32px; }
.files .num { text-align: right; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.files .act { text-align: right; white-space: nowrap; width: 1%; }
.files .name { overflow-wrap: anywhere; min-width: 160px; }
.files .name button { background: none; border: none; color: var(--text); font: inherit; cursor: pointer; padding: 0; text-align: left; }
.files .name button:hover { color: var(--accent); }
.files .artist { color: var(--muted); font-size: 0.85rem; }
.files .other { color: var(--muted); }
.tag { font-size: 0.7rem; padding: 2px 6px; border-radius: 6px; background: #ffc85722; color: var(--warn); margin-left: 6px; }
.search { flex: 1; min-width: 160px; max-width: 320px; }

/* Playlists */
.pl-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.pl-names { list-style: none; margin: 0; padding: 0; }
.pl-names li button { width: 100%; text-align: left; background: none; border: 1px solid transparent; color: var(--text); padding: 9px 10px; border-radius: 9px; font: inherit; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.pl-names li button:hover { background: #ffffff0a; }
.pl-names li button.active { background: var(--card2); border-color: var(--line); }
.pl-names .count { margin-left: auto; color: var(--muted); font-size: 0.82rem; }
.badge { font-size: 0.68rem; padding: 1px 7px; border-radius: 99px; background: #4fd69c26; color: var(--ok); }

/* Sendeplan */
.week { display: grid; grid-template-columns: 44px repeat(7, minmax(0, 1fr)); gap: 0; position: relative; font-size: 0.78rem; }
.week .dayhead { text-align: center; padding: 6px 0; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.week .dayhead.today { color: var(--accent); }
.week .hours { position: relative; height: 576px; }
.week .hours span { position: absolute; right: 6px; transform: translateY(-50%); color: var(--muted); font-size: 0.72rem; }
.week .daycol { position: relative; height: 576px; border-left: 1px solid #ffffff0d; background: repeating-linear-gradient(180deg, #ffffff08 0 1px, transparent 1px 72px); }
.week .slot { position: absolute; left: 3px; right: 3px; border-radius: 7px; padding: 3px 6px; background: linear-gradient(135deg, #d958b4cc, #6d6cf0cc); color: #fff; overflow: hidden; cursor: pointer; border: none; font: inherit; text-align: left; font-size: 0.75rem; line-height: 1.25; }
.week .slot.stream { background: linear-gradient(135deg, #3f7fd6cc, #4fb6a8cc); }
.week .slot.active { outline: 2px solid #fff; }
.week .nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--live); z-index: 2; pointer-events: none; }
.slot-list li .when { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* DJ */
.creds { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; }
.creds > span { color: var(--muted); font-size: 0.9rem; }
.creds code { font-size: 1rem; padding: 4px 8px; overflow-wrap: anywhere; }
.howto { margin: 0; padding-left: 20px; line-height: 1.7; }
details { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-top: 10px; }
details summary { cursor: pointer; font-weight: 600; }
.pw-show { font-size: 1.3rem; letter-spacing: 0.05em; padding: 10px 14px; background: #4fd69c1a; border: 1px solid #4fd69c55; border-radius: 10px; text-align: center; font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }

/* Verwaltung */
.role { font-size: 0.75rem; padding: 2px 8px; border-radius: 99px; background: #ffffff14; }
.role.admin { background: #ff8ad833; color: #ffd0ef; }
.role.dj { background: #8fb8ff33; color: #d5e4ff; }

/* Uploads */
.uploads { position: fixed; right: 16px; bottom: 16px; width: min(420px, calc(100vw - 32px)); max-height: 50vh; background: var(--card2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 50px #0008; display: flex; flex-direction: column; z-index: 40; }
.uploads-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.uploads ul { list-style: none; margin: 0; padding: 6px 12px; overflow: auto; }
.uploads li { padding: 7px 0; border-bottom: 1px solid #ffffff0d; font-size: 0.86rem; }
.uploads li .r { display: flex; gap: 8px; align-items: center; }
.uploads li .r span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploads .ubar { margin-top: 5px; height: 5px; background: #ffffff14; border-radius: 99px; overflow: hidden; }
.uploads .ufill { height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--accent2)); }
.uploads li.error .ufill { background: var(--danger); }
.uploads li .err { color: var(--danger); font-size: 0.8rem; }

/* Dialog + Meldung */
dialog { background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; width: min(460px, calc(100vw - 32px)); }
dialog::backdrop { background: #0009; }
.dialog-fields { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { flex-direction: row; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--line); padding: 5px 9px; border-radius: 8px; cursor: pointer; color: var(--text); }
.days input { accent-color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--card2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 60; box-shadow: 0 10px 30px #0008; max-width: calc(100vw - 32px); }
.toast.err { border-color: var(--danger); color: #ffb3b3; }

@media (max-width: 1000px) {
	.grid-2, .pl-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
	.topbar { padding: 10px 16px; gap: 10px; }
	.tab { padding: 16px; }
	.tabs { order: 10; width: 100%; overflow-x: auto; }
	.onair-icon { width: 58px; height: 58px; font-size: 1.5rem; }
	.files th:nth-child(4), .files td:nth-child(4), .files th:nth-child(5), .files td:nth-child(5) { display: none; }
	.week { grid-template-columns: 30px repeat(7, minmax(0, 1fr)); }
	.week .slot { font-size: 0.62rem; padding: 2px 3px; }
	.creds { grid-template-columns: auto minmax(0, 1fr); }
	.creds .icon-btn { grid-column: 2; justify-self: start; }
	.setting-rows { grid-template-columns: minmax(0, 1fr); }
}
