/* RadioMonitor */
:root {
    --bg: #0a0a0a;
    --bg2: #1c1c1c;
    --card: #151515;
    --line: #2c2c2c;
    --text: #f2f2f2;
    --muted: #9a9a9a;
    --accent: #ff7a00;
    --accent2: #ffa040;
    --accent-dark: #d65f00;
    --grey: #3a3a3a;
    --red: #ff5a4f;
    --radius: 14px;
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: radial-gradient(1200px 500px at 50% -15%, rgba(255, 122, 0, .14) 0%, transparent 60%), var(--bg);
    background-attachment: fixed;
    min-height: 100vh;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h2 { font-size: 1rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
h3 { font-size: 1rem; margin-top: 1.2em; }

.wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 40px; }
.wrap.wide { max-width: 1200px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.break { word-break: break-all; }

/* Kopf */
.head { text-align: center; margin-bottom: 22px; }
.head h1 { font-size: 2rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.head .head-icon { filter: drop-shadow(0 4px 12px rgba(255, 122, 0, .45)); }
.head .sub { margin: 4px 0 0; color: var(--accent2); font-size: 1.1rem; font-weight: 600; }

/* Auswahl */
.picker { margin-bottom: 16px; }
.picker h2 { font-size: .8rem; margin-bottom: .5em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: 999px;
    background: var(--bg2); border: 1px solid var(--line); color: var(--text);
    font-weight: 600; transition: background .15s, border-color .15s;
}
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip.on { background: linear-gradient(135deg, var(--accent2), var(--accent-dark)); border-color: transparent; color: #fff; }
.badge {
    min-width: 24px; padding: 1px 7px; border-radius: 999px; text-align: center;
    background: rgba(255, 255, 255, .1); font-size: .78rem; font-weight: 700;
}

/* Kennzahlen */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0; }
.tile {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 12px; text-align: center;
}
.tile b { display: block; font-size: 2rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: .85rem; }
.tile.hl { background: linear-gradient(135deg, rgba(255, 122, 0, .2), rgba(255, 122, 0, .06)); border-color: rgba(255, 122, 0, .55); }
.tile.hl b { color: var(--accent2); }

/* Karten & Tabellen */
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px; margin-bottom: 16px; overflow-x: auto;
}
table.list { width: 100%; border-collapse: collapse; }
.list th {
    text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.list td { padding: 10px; border-bottom: 1px solid rgba(42, 51, 82, .6); vertical-align: middle; }
.list tr:last-child td { border-bottom: 0; }
.list .c-lis { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; width: 70px; }
.list .c-name { font-weight: 600; }
.list .c-name a { color: var(--text); }
.list .c-song { color: #d0d0d0; }
.cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell .txt { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.cell .nm { display: inline-flex; align-items: center; }
.logo, .cover {
    position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    overflow: hidden; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); font-weight: 800;
}
.logo { width: 44px; height: 44px; border-radius: 10px; font-size: 1.1rem; }
.logo-lg { width: 96px; height: 96px; border-radius: 16px; font-size: 2rem; }
.cover { width: 48px; height: 48px; border-radius: 8px; font-size: 1.2rem; }
.logo img, .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--bg2); }
.logo img { object-fit: contain; background: #fff; }
.logo-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.list td.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.dot { display: inline-block; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #555; margin-right: 8px; }
tr.is-active .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
tr.is-active .c-lis { color: var(--accent); }
tr.is-offline .dot { background: var(--red); }
tr.is-offline .c-name, tr.is-offline .c-lis { color: var(--muted); }
tr.is-inactive td { opacity: .55; }

.type {
    display: inline-block; font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 6px;
    vertical-align: middle; margin-left: 4px; letter-spacing: .02em;
}
.type { margin-left: 0; }
.type-icecast { background: #2a2a2a; color: #d6d6d6; }
.type-shoutcast { background: #333; color: #bdbdbd; }
.type-lautfm { background: rgba(255, 122, 0, .16); color: var(--accent2); }
.tag-off, .tag-on { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 6px; }
.tag-off { background: rgba(248, 113, 113, .15); color: var(--red); }
.tag-on { background: rgba(255, 122, 0, .16); color: var(--accent2); }

.foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 18px; }
.brandline { margin-top: 8px; font-size: .85rem; }
.brandline a { color: var(--accent); font-weight: 700; }

/* Admin */
.topbar { background: rgba(10, 10, 10, .92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); }
.topbar-in { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.brand { font-weight: 800; color: var(--text); font-size: 1.05rem; }
.brand small { color: var(--accent); font-weight: 700; margin-left: 4px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 600; }
.nav a:hover { color: var(--text); background: var(--bg2); text-decoration: none; }
.nav a.on { color: #fff; background: var(--bg2); box-shadow: inset 0 -2px 0 var(--accent); }
.userbox { display: flex; align-items: center; gap: 12px; font-size: .88rem; }
.userbox form { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; }
.linkbtn:hover { color: var(--text); }
.page-title { font-size: 1.5rem; margin: 6px 0 18px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar form { margin: 0; }
.grow { flex: 1; min-width: 180px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--bg2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
    text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent2), var(--accent-dark)); border-color: transparent; color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }
.c-act { white-space: nowrap; text-align: right; }
.c-act form { display: inline; margin: 0; }
.c-act .btn { margin: 2px 0; }

.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .9rem; }
.form label.check, .form label.radio { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.form input[type=text], .form input[type=password], .form input[type=number], .form input[type=search], .form select, input.copy, .toolbar input[type=search] {
    width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--bg); color: var(--text); font: inherit; font-weight: 400;
}
.toolbar input[type=search] { width: auto; }
.form input:focus, .form select:focus, input.copy:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0; }
.form legend { color: var(--muted); font-size: .85rem; padding: 0 6px; }
fieldset.types { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.hint { margin: -6px 0 0; color: var(--muted); font-size: .82rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 17px; height: 17px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.form label.check-item {
    flex-direction: row; align-items: center; gap: 8px; font-weight: 500;
    padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); cursor: pointer;
}
.check-item:has(input:checked) { border-color: var(--accent); background: rgba(255, 122, 0, .1); }
.check-item span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daychecks { display: flex; flex-wrap: wrap; gap: 6px 18px; }

.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 500; }
.alert-success { background: rgba(255, 122, 0, .1); border: 1px solid rgba(255, 122, 0, .45); color: #ffd2a8; }
.alert-error { background: rgba(248, 113, 113, .12); border: 1px solid rgba(248, 113, 113, .4); color: #fecaca; }

.steps { padding-left: 20px; margin: 0 0 10px; }
.steps li { margin-bottom: 6px; }
.steps li.done { color: var(--muted); }
.steps li.done::marker { color: var(--accent); }

body.login { display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { width: 100%; max-width: 400px; padding: 28px; overflow: visible; }
.login-box.wide-box { max-width: 620px; }
.login-box h1 { font-size: 1.4rem; margin-bottom: 2px; }
.checks { list-style: none; padding: 0; margin: 10px 0 16px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; }
.checks .ok { color: var(--accent2); }
.checks .fail { color: var(--red); font-weight: 700; }

@media (max-width: 600px) {
    .live thead { display: none; }
    .live tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; padding: 12px 4px; border-bottom: 1px solid rgba(44, 44, 44, .8); }
    .live tr:last-child { border-bottom: 0; }
    .live td, .list.live td { padding: 0; border: 0; }
    .live .c-name { grid-column: 1; grid-row: 1; }
    .live .c-lis { grid-column: 2; grid-row: 1; align-self: center; font-size: 1.25rem; width: auto; }
    .live .c-song { grid-column: 1 / -1; grid-row: 2; }
    .live td.empty { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .tiles { grid-template-columns: repeat(2, 1fr); }
    .tile b { font-size: 1.6rem; }
    .grid2, .row2 { grid-template-columns: 1fr; }
    .head h1 { font-size: 1.6rem; }
    .logo { width: 36px; height: 36px; }
    .cover { width: 38px; height: 38px; }
    .cell { gap: 8px; }
    .list .c-song { font-size: .88rem; }
    .list td, .list th { padding: 8px 6px; }
    .card { padding: 12px; }
    .c-act { white-space: normal; }
}

.loglist { list-style: none; margin: 0 0 12px; padding: 0; font-size: .82rem; color: #ffc9a0; }
.loglist li { padding: 5px 0; border-bottom: 1px solid var(--line); word-break: break-word; }

/* Anbieter-Badges */
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.prov {
    display: inline-block; font-size: .68rem; font-weight: 800; padding: 1px 7px; border-radius: 6px;
    letter-spacing: .03em; vertical-align: middle; margin-left: 4px; line-height: 1.5;
}
.badges .prov { margin-left: 0; }
.prov-s4r { background: var(--accent); color: #111; }
.prov-lfmsn { background: transparent; color: var(--accent2); box-shadow: inset 0 0 0 1px var(--accent); }
.prov-direkt { background: #e6e6e6; color: #111; }

.c-prov { white-space: nowrap; }

.type-azuracast { background: #262626; color: var(--accent2); box-shadow: inset 0 0 0 1px #3a3a3a; }

/* Sendezeit an den Tag-Chips */
.chip-time { font-weight: 500; opacity: .85; font-size: .85rem; }

/* Sendungs-Archiv */
.archive { overflow: visible; }
.arc-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin-bottom: 10px; }
.arc-head h2 { margin: 0; }
.chips.dates { margin-bottom: 14px; }
.chips.dates .chip { padding: 5px 12px; font-size: .88rem; font-variant-numeric: tabular-nums; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(255, 90, 79, .6); animation: rm-puls 1.6s infinite; }
@keyframes rm-puls { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 79, .6); } 70% { box-shadow: 0 0 0 8px rgba(255, 90, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 79, 0); } }
.arc-title { font-size: 1.1rem; margin: 4px 0 0; }
.tag-live { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 6px; background: rgba(255, 90, 79, .16); color: var(--red); font-size: .75rem; font-weight: 800; vertical-align: middle; }
.arc-tiles { margin: 14px 0; }
.arc-tiles .tile b { font-size: 1.7rem; }
.curve-wrap { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px 4px; margin-bottom: 8px; }
.curve-box { position: relative; padding: 8px 20px 22px 46px; }
.plot { position: relative; height: 200px; }
.curve { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.curve .g { stroke: #2a2a2a; stroke-width: 1; vector-effect: non-scaling-stroke; }
.curve .g.v { stroke-dasharray: 3 4; }
.curve .ln { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.curve .now { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.plot .pk { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 0 10px rgba(255, 122, 0, .6); }
.plot .yl, .plot .xl { position: absolute; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1; }
.plot .yl { right: calc(100% + 8px); transform: translateY(-50%); }
.plot .xl { top: calc(100% + 6px); transform: translateX(-50%); }
.archive h3 { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin: 22px 0 8px; }
.list .c-nr { width: 36px; color: var(--muted); font-variant-numeric: tabular-nums; }
.list .c-time { width: 64px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.songs .cover { width: 40px; height: 40px; }
tr.is-peak td { background: rgba(255, 122, 0, .08); }
tr.is-peak .c-lis { color: var(--accent2); }
tr.is-sel td { background: rgba(255, 122, 0, .1); }
tr.is-sel a { color: var(--text); font-weight: 700; }
.c-bar { width: 40%; }
.c-bar .bar { display: inline-block; width: calc(100% - 52px); height: 8px; border-radius: 6px; background: var(--bg2); vertical-align: middle; overflow: hidden; }
.c-bar .bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent-dark), var(--accent2)); }
.c-bar b { display: inline-block; width: 46px; text-align: right; font-variant-numeric: tabular-nums; }

/* Sendezeit im Admin */
.timerow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.timerow label { width: 140px; }
.form input[type=time] { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; color-scheme: dark; }

@media (max-width: 600px) {
    .plot { height: 160px; }
    .curve-box { padding-left: 38px; }
    .c-bar { width: 34%; }
    .c-bar .bar { display: none; }
    .songs .c-nr { display: none; }
}
