/* --- Radio NWW Studio — CSS --- */

:root {
    --bg:      #0c1117;
    --surface: #151c24;
    --border:  #252d38;
    --text:    #d8dee6;
    --muted:   #9ba8b8;
    --accent:  #4ea4d4;
    --green:   #4caf7c;
    --amber:   #d4a24e;
    --red:     #c45c5c;
    --focus:   rgba(78, 164, 212, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Fokus-Ringe (Barrierefreiheit) --- */

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* --- Navigation --- */

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    height: 52px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar-brand {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    white-space: nowrap;
}

.topbar-brand:hover { text-decoration: none; }

.topbar-nav {
    display: flex;
    gap: 4px;
}

.topbar-link {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--muted);
    transition: background 120ms, color 120ms;
}

.topbar-link:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    text-decoration: none;
}

.topbar-link.is-active {
    background: rgba(78,164,212,0.15);
    color: var(--accent);
}

.topbar-clock {
    margin-left: auto;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 16px;
    font-size: 13px;
}
.topbar-username { color: var(--muted); }
.topbar-logout {
    color: var(--muted);
    font-size: 12px;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
}
.topbar-logout:hover {
    color: var(--text);
    border-color: var(--muted);
    text-decoration: none;
}

/* --- Seitenlayout --- */

.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* --- Karten --- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

.card.wide { grid-column: 1 / -1; }

.card h2 {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 600;
}

/* --- Text --- */

.label {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.sub {
    margin: 4px 0 12px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
}

.hint {
    color: var(--muted);
    font-style: italic;
}

/* --- Kontexthilfe (Tooltips) --- */

.help-text {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.4;
}

.field .help-text {
    padding-top: 4px;
    border-top: 1px dotted var(--border);
}

/* --- Titelliste --- */

.tracklist {
    margin: 16px 0 0;
    padding-left: 24px;
}

.tracklist li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.tracklist li:last-child { border-bottom: 0; }

/* --- Tabellen --- */

.schedule,
.streams,
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.schedule td,
.schedule th,
.streams td,
.streams th,
.data-table td,
.data-table th {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.schedule th,
.streams th,
.data-table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.schedule .time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-weight: 600;
    width: 100px;
}

.schedule tr.is-now {
    background: rgba(78,164,212,0.1);
}

.schedule tr.is-now td:first-child {
    border-left: 3px solid var(--accent);
    padding-left: 9px;
}

code {
    font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
    font-size: 13px;
    color: var(--accent);
}

/* --- Kennzeichnungen --- */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255,255,255,0.08);
    color: var(--muted);
}

.badge.ok {
    background: rgba(76,175,124,0.15);
    color: var(--green);
}

.badge.warn {
    background: rgba(212,162,78,0.15);
    color: var(--amber);
}

.badge.error {
    background: rgba(196,92,92,0.15);
    color: var(--red);
}

.badge.live {
    background: rgba(228,68,68,0.2);
    color: #e44;
    animation: pulse-live 1.5s ease-in-out infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* --- Statusliste --- */

.status-list { margin: 0; }

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.status-row:last-child { border-bottom: 0; }

.status-row dt {
    font-size: 14px;
}

.status-row dd {
    margin: 0;
}

/* --- Hinweise --- */

.notice {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.notice.success {
    border-color: var(--green);
    background: rgba(76,175,124,0.08);
}

.notice.error {
    border-color: var(--red);
    background: rgba(196,92,92,0.08);
}

/* --- Formulare --- */

.form {
    display: grid;
    gap: 28px;
    margin-top: 16px;
}

.field {
    display: grid;
    gap: 8px;
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.field > span:first-child,
.field > label:first-child {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.field input,
.field textarea {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    min-height: 52px;
}

.field input:focus,
.field textarea:focus {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-color: var(--accent);
}

.field textarea {
    resize: vertical;
    min-height: 90px;
}

.toggle-field {
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.toggle-field .toggle {
    padding: 0;
    border: none;
    background: none;
}

.toggle-field .help-text {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dotted var(--border);
}

.toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    min-height: 52px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.toggle input {
    width: 24px;
    height: 24px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.toggle span,
.toggle label {
    font-size: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: fit-content;
    min-height: 52px;
}

.btn:hover {
    filter: brightness(1.1);
}

.btn-danger {
    background: var(--red, #c45c5c);
    color: #fff;
}

.btn-warn {
    background: var(--amber);
    color: #1a1a1a;
}

/* --- Felder in Tabellen und Kompaktansicht --- */

.input-sm {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    min-height: 52px;
}

.input-sm:focus {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-color: var(--accent);
}

.input-num {
    width: 110px;
    text-align: right;
    padding-right: 8px;
}

.field-readonly {
    opacity: 0.7;
    cursor: default;
    user-select: all;
}

/* Zahlenschalter vergrößern und sauber absetzen */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.num-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    overflow: hidden;
}

.num-wrap input {
    border: none;
    border-radius: 0;
    background: transparent;
    text-align: center;
    min-width: 70px;
    padding: 14px 8px;
    font-size: 16px;
    min-height: 52px;
    color: var(--text);
    font: inherit;
    font-size: 16px;
}

.num-wrap input:focus {
    outline: none;
}

.num-wrap:focus-within {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-color: var(--accent);
}

.num-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 52px;
    border: none;
    background: var(--surface);
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.num-btn:hover {
    background: rgba(255,255,255,0.08);
}

.num-btn:active {
    background: rgba(255,255,255,0.12);
}

.num-btn-minus {
    border-right: 1px solid var(--border);
}

.num-btn-plus {
    border-left: 1px solid var(--border);
}

.num-with-unit {
    display: flex;
    align-items: center;
    gap: 10px;
}

.unit {
    font-size: 15px;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 40px;
}

/* --- Inline-Ordnerbrowser --- */

.browse-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 0;
    font-size: 15px;
}

.browse-selected-path {
    flex: 1;
    word-break: break-all;
}

.browse-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    overflow: hidden;
}

.browse-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}

.browse-breadcrumb a {
    white-space: nowrap;
}

.browse-select-link {
    font-weight: 600;
    color: var(--green);
}

.browse-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
}

.browse-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 15px;
    color: var(--text);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.browse-item:last-child {
    border-bottom: none;
}

.browse-item:hover,
.browse-item:focus-visible {
    background: rgba(78,164,212,0.08);
    outline: none;
}

.browse-icon {
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    font-size: 16px;
    color: var(--accent);
}

.browse-item-file .browse-icon {
    color: var(--muted);
}

.browse-item-up .browse-icon {
    color: var(--muted);
}

.browse-folder-action {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(78, 164, 212, 0.08);
}

.browse-select-folder-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--accent, #4ea4d4);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
}

.browse-select-folder-btn:hover,
.browse-select-folder-btn:focus-visible {
    background: var(--accent-hover, #3b8ab8);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.browse-hint {
    margin-left: auto;
    font-size: 12px;
    color: var(--muted);
}

.browse-loading,
.browse-error,
.browse-empty {
    padding: 16px 14px;
    font-size: 14px;
    color: var(--muted);
    list-style: none;
}

.browse-error {
    color: var(--red);
}

.btn-del {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
}

.btn-del:hover {
    background: rgba(196,92,92,0.1);
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* --- Tabellencontainer --- */

.table-wrap {
    overflow-x: auto;
}

/* --- Seitenüberschrift --- */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-link {
    color: var(--muted);
    font-size: 14px;
}

/* --- Blendeinstellungen (Blenden-Seite) --- */

.defaults-row {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.field-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-inline span:first-child {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

/* --- Kategorie-Karten --- */

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.cat-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 18px;
    transition: border-color 120ms;
    color: var(--text);
}

.cat-card:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.cat-card-active {
    border-color: var(--green);
    box-shadow: 0 0 0 1px var(--green);
}

/* Programmplan */
.prog-day-heading {
    margin: 0 0 12px 0;
    padding: 10px 0 6px 0;
    border-bottom: 2px solid var(--accent);
    font-size: 1.1em;
}

.prog-table td,
.prog-table th {
    vertical-align: top;
    padding: 10px 14px;
}

.prog-time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.9em;
}

.prog-show-link {
    font-weight: 600;
}

.prog-desc {
    color: var(--muted);
    font-size: 0.9em;
}
.prog-rotation {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 0.8em;
    font-weight: 600;
    vertical-align: middle;
}

.form-narrow { max-width: 640px; }

.text-muted { color: var(--muted); }

.cat-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.cat-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.cat-color-lg {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    flex-shrink: 0;
}

.cat-name {
    font-weight: 600;
    font-size: 15px;
}

.cat-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.cat-detail {
    font-size: 13px;
    color: var(--muted);
}

.cat-card-extra {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}

/* --- Kategorie-Bearbeitung --- */

.cat-form .card {
    margin-bottom: 0;
}

.blend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.field-row {
    display: flex;
    gap: 12px;
    align-items: start;
}

.field-row .field { flex: 1; }

.show-row,
.mod-row { margin-bottom: 8px; }
.show-row .btn-sm,
.mod-row .btn-sm { margin-top: 4px; }

.color-pick {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px;
    background: var(--bg);
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 14px;
    margin-top: 24px;
    align-items: center;
}

.field select {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    min-height: 52px;
}

.field select:focus {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-color: var(--accent);
}

/* --- Zeitsteuerung (Scheduler) --- */

/* Scheduler-spezifische Stile sind jetzt in der Tabelle und den Karten */

/* Wochentage-Auswahl */

.sched-days {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sched-day-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    min-height: 48px;
    background: rgba(255,255,255,0.02);
}

.sched-day-label input {
    width: 22px;
    height: 22px;
    accent-color: var(--accent);
}

.sched-day-label:has(input:checked) {
    border-color: var(--accent);
    background: rgba(78,164,212,0.08);
}

/* Stunden-Auswahl */

.sched-hours {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
}

.sched-hour-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 2px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    background: rgba(255,255,255,0.02);
}

.sched-hour-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.sched-hour-label:has(input:checked) {
    border-color: var(--accent);
    background: rgba(78,164,212,0.08);
}

/* --- Barrierefreiheit: Screenreader --- */

.daypart-range {
    display: flex;
    align-items: center;
    gap: 8px;
}
.daypart-range select {
    padding: 8px 12px;
    font-size: 15px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Responsive --- */


/* Folder navigation (Track-Editor) */
.folder-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.folder-link {
    display: inline-block;
    padding: 6px 12px;
    background: var(--card-bg, #2a2a2e);
    border: 1px solid var(--border, #444);
    border-radius: 4px;
    color: var(--link, #7ab);
    text-decoration: none;
    font-size: 0.9rem;
}
.folder-link:hover,
.folder-link:focus-visible {
    background: var(--hover-bg, #333);
    border-color: var(--link, #7ab);
}
.folder-up {
    font-weight: 600;
}

/* Waveform editor */
.waveform-wrap {
    position: relative;
    background: #1a1a1e;
    border: 1px solid var(--border, #444);
    border-radius: 4px;
    overflow: hidden;
    cursor: crosshair;
}
.waveform-wrap canvas {
    display: block;
    width: 100%;
}
.wf-cursor {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #fff;
    pointer-events: none;
    display: none;
    z-index: 2;
}
.wf-zoom, .wf-transport, .wf-markers {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.wf-time {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-muted, #999);
    margin-left: auto;
}
.wf-markers-label {
    font-size: 0.85rem;
    color: var(--text-muted, #999);
}
.btn-marker {
    font-size: 0.8rem;
    padding: 3px 8px;
}
.btn-cue-jump {
    flex-shrink: 0;
    padding: 4px 8px;
    font-size: 0.8rem;
}
.btn-marker kbd {
    display: inline-block;
    padding: 0 4px;
    margin-left: 3px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.75rem;
    line-height: 1.3;
}

/* --- Dashboard: Now Playing --- */

.now-playing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}
.now-playing-info {
    display: flex;
    align-items: center;
    gap: 16px;
}
.station-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}
.logo-preview {
    margin-bottom: 12px;
}
.logo-preview img {
    max-width: 160px;
    max-height: 80px;
    object-fit: contain;
    border-radius: 6px;
    background: var(--card-bg, #2a2a2a);
    padding: 8px;
}
.now-playing-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text, #eee);
}
.now-playing-artist {
    margin: 4px 0 0;
    font-size: 16px;
    color: var(--muted, #999);
}
.now-playing-next {
    margin: 8px 0 0;
    font-size: 18px;
    color: var(--text);
}
.now-playing-next::before {
    content: 'Nächster Titel: ';
    font-weight: 600;
    color: var(--muted);
}
.now-playing-time {
    font-size: 28px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--muted, #999);
    white-space: nowrap;
}
.pause-indicator {
    color: var(--warn, #e6a817);
}
.progress-bar-wrap {
    margin-top: 16px;
    height: 4px;
    background: var(--border, #444);
    border-radius: 2px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--accent, #7ab);
    border-radius: 2px;
    transition: width 1s linear;
}
.live-indicator {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 600;
    color: #e44;
}

.player-decks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 20px;
}
.deck {
    background: var(--bg, #1a1a1a);
    border: 2px solid var(--border, #333);
    border-radius: 8px;
    padding: 14px 16px;
    transition: border-color 0.3s, background 0.3s;
}
.deck-active {
    border-color: var(--accent, #7ab);
    background: rgba(119, 170, 187, 0.06);
}
.deck-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.deck-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted, #888);
}
.deck-active .deck-label {
    color: var(--accent, #7ab);
}
.deck-status {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--border, #333);
    color: var(--muted, #888);
}
.deck-active .deck-status {
    background: var(--accent, #7ab);
    color: #000;
}
.deck-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text, #eee);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.deck-artist {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--muted, #999);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.deck:not(.deck-active) .deck-title {
    color: var(--muted, #666);
}
.deck-progress-wrap {
    margin-top: 10px;
    height: 12px;
    background: var(--border, #333);
    border-radius: 6px;
    overflow: hidden;
}
.deck-progress {
    height: 100%;
    background: var(--amber, #d4a24e);
    border-radius: 6px;
    transition: width 1s linear;
}
.deck:not(.deck-active) .deck-progress {
    background: var(--border, #444);
}
.deck-time {
    margin-top: 8px;
    display: flex;
    gap: 24px;
    justify-content: flex-end;
    font-size: 20px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.time-segment {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.time-label {
    font-size: 13px;
    font-weight: 400;
    color: var(--muted, #888);
}
/* --- Stream-Links --- */
.stream-links { display: flex; flex-direction: column; gap: 10px; }
.stream-link-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.stream-link-row:last-child { border-bottom: none; }
.stream-link-row > div:first-child { flex: 1; }
.stream-format { font-size: 13px; color: var(--muted); margin-left: 8px; }
.stream-actions { display: flex; gap: 6px; }

#deck-live.deck-active {
    border-color: #e44;
    background: rgba(238, 68, 68, 0.06);
}
#deck-live.deck-active .deck-label {
    color: #e44;
}
#deck-live.deck-active .deck-status {
    background: #e44;
    color: #fff;
}
#deck-live.deck-active .deck-progress {
    background: #e44;
}

.data-table.compact td,
.data-table.compact th {
    padding: 6px 10px;
}
.data-table.compact .time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--muted, #999);
}
.data-table.compact tr.is-now {
    background: rgba(119, 170, 187, 0.1);
}
.data-table.compact tr.is-now td {
    font-weight: 600;
}

/* --- Skip-Link (Barrierefreiheit) --- */

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 1000;
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus {
    top: 0;
}

/* --- Hamburger-Button (standardmäßig versteckt) --- */

.topbar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 22px;
    padding: 6px 10px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ============================================================
   MOBIL — alles unterhalb von 800px
   Desktop bleibt vollständig unberührt.
   ============================================================ */

@media (max-width: 800px) {

    /* --- Navigation: Hamburger-Menü --- */
    .topbar-toggle {
        display: block;
    }
    .topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 16px;
        gap: 0;
    }
    .topbar-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 10px;
        border-top: 1px solid var(--border);
        padding-top: 8px;
    }
    .topbar-nav.is-open {
        display: flex;
    }
    .topbar-link {
        padding: 12px 8px;
        font-size: 16px;
        border-bottom: 1px solid var(--border);
    }
    .topbar-link:last-child {
        border-bottom: none;
    }
    .topbar-clock {
        margin-left: auto;
        width: auto;
    }

    /* --- Layout --- */
    .content {
        padding: 12px;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .card {
        padding: 16px;
    }
    .card.wide {
        grid-column: auto;
    }

    /* --- Seitenüberschrift --- */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* --- Dashboard: Now Playing --- */
    .now-playing-header {
        flex-direction: column;
        gap: 12px;
    }
    .now-playing-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .station-logo {
        width: 48px;
        height: 48px;
    }
    .now-playing-time {
        font-size: 20px;
    }

    /* --- Dashboard: Player-Decks --- */
    .player-decks {
        grid-template-columns: 1fr;
    }
    .deck {
        overflow: visible;
    }
    .deck-title {
        font-size: 15px;
        white-space: normal;
    }
    .deck-artist {
        white-space: normal;
    }
    .deck-time {
        flex-wrap: wrap;
        gap: 8px 16px;
        justify-content: flex-start;
        font-size: 16px;
    }
    .time-label {
        font-size: 11px;
    }

    /* --- Tabellen: horizontal scrollbar --- */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table {
        min-width: 500px;
    }

    /* --- Formulare --- */
    .form {
        gap: 16px;
    }
    .field {
        padding: 12px;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
    .form-actions {
        flex-direction: column;
        gap: 8px;
    }

    /* --- Kategorie-Karten --- */
    .cat-grid {
        grid-template-columns: 1fr;
    }

    /* --- Blendeinstellungen --- */
    .blend-grid {
        grid-template-columns: 1fr;
    }
    .defaults-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* --- Login / Setup --- */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}
.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px 32px;
    max-width: 380px;
    width: 100%;
    text-align: center;
}
.login-box h1 {
    font-size: 20px;
    margin: 0 0 24px;
    color: var(--text);
}
.login-logo {
    max-width: 120px;
    max-height: 80px;
    margin-bottom: 16px;
}
.login-box .form-group {
    text-align: left;
    margin-bottom: 12px;
}
.login-box label {
    display: block;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 4px;
}
.login-box input[type="email"],
.login-box input[type="password"],
.login-box select {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.login-box input:focus,
.login-box select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus);
}
.login-box .sub {
    font-size: 14px;
    color: var(--muted);
    text-align: left;
    margin-bottom: 20px;
}
