/* FLR1 Clips - Verwaltung */

:root {
    --accent: #ffb020;
    --bg: #0d131b;
    --bg-panel: #151e29;
    --bg-input: #0f1720;
    --line: rgba(255, 255, 255, 0.1);
    --text: #e8edf4;
    --text-muted: #8fa0b3;
    --ok: #35c07f;
    --warn: #ffb020;
    --error: #ff5b52;
    --radius: 8px;
}

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

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

a {
    color: var(--accent);
}

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

/* ---------------------------------------------------------------- Login */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: radial-gradient(circle at 50% 0%, #17222f 0%, #0a0f16 65%);
}

.login-card {
    width: min(420px, 100%);
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 2rem;
}

.login-card__title {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 800;
}

.login-card__subtitle {
    margin: 0.35rem 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.login-card__back {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.88rem;
}

/* ---------------------------------------------------------------- Grundgeruest */

.admin {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 100vh;
}

@media (max-width: 860px) {
    .admin {
        grid-template-columns: minmax(0, 1fr);
    }
}

.sidebar {
    background: #0a0f16;
    border-right: 1px solid var(--line);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sidebar__brand {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding-inline: 0.5rem;
}

.sidebar__brand span {
    color: var(--accent);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sidebar__link {
    display: block;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
}

.sidebar__link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.sidebar__link.is-active {
    background: rgba(255, 176, 32, 0.14);
    color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar__foot {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sidebar__user {
    display: block;
    color: var(--text);
    font-weight: 700;
}

.content {
    padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 4rem;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-head h1 {
    margin: 0;
    font-size: 1.45rem;
    letter-spacing: 0.02em;
}

.page-head p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    max-width: 68ch;
}

/* ---------------------------------------------------------------- Bausteine */

.card {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.card__title {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.card__hint {
    margin: -0.5rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.grid-2 {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.stats {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 1.5rem;
}

.stat {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
}

.stat__value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat__label {
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.notice {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border-left: 3px solid var(--accent);
    background: rgba(255, 255, 255, 0.04);
}

.notice--success {
    border-left-color: var(--ok);
}

.notice--error {
    border-left-color: var(--error);
}

.notice--info {
    border-left-color: var(--accent);
}

.notice code {
    background: rgba(0, 0, 0, 0.35);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.95em;
    user-select: all;
}

/* ---------------------------------------------------------------- Formulare */

.field {
    margin-bottom: 1rem;
}

.field__label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.field__hint {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.field__input,
.field__select,
.field__textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    font: inherit;
}

.field__textarea {
    min-height: 120px;
    resize: vertical;
}

.field__input:focus,
.field__select:focus,
.field__textarea:focus {
    border-color: var(--accent);
    outline: none;
}

.field__input[type="color"] {
    padding: 0.2rem;
    height: 42px;
}

.field--check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.field--check input {
    margin-top: 0.3rem;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    flex: none;
}

.field--check label {
    font-weight: 600;
    font-size: 0.92rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #0b1017;
}

.btn--primary:hover {
    filter: brightness(1.08);
    background: var(--accent);
}

.btn--danger {
    border-color: rgba(255, 91, 82, 0.5);
    color: #ff8b85;
}

.btn--danger:hover {
    background: rgba(255, 91, 82, 0.15);
}

.btn--small {
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
}

.btn--block {
    width: 100%;
}

.inline-form {
    display: inline;
}

/* ---------------------------------------------------------------- Tabellen */

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

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.table th,
.table td {
    padding: 0.7rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.table th {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.table td.actions {
    white-space: nowrap;
    text-align: right;
}

.tag {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid var(--line);
    color: var(--text-muted);
}

.tag--on {
    border-color: rgba(53, 192, 127, 0.5);
    color: var(--ok);
}

.tag--off {
    border-color: rgba(255, 91, 82, 0.4);
    color: #ff8b85;
}

.tag--live {
    border-color: rgba(255, 91, 82, 0.6);
    color: #ff8b85;
}

.empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.logo-preview {
    display: inline-block;
    padding: 0.75rem;
    background: repeating-conic-gradient(#243040 0% 25%, #1a2431 0% 50%) 50% / 16px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    margin-bottom: 0.75rem;
}

.logo-preview img {
    display: block;
    max-width: 220px;
    height: auto;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
}

/* ------------------------------------------------------------ Sendezelle */

.studio__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1100px) {
    .studio__grid {
        grid-template-columns: 1fr;
    }
}

.studio__stage {
    position: relative;
    background: #05090e;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.studio__stage video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #05090e;
}

.studio__stage video.is-mirrored {
    transform: scaleX(-1);
}

.studio__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    text-align: center;
    background: rgba(5, 9, 14, 0.92);
}

.studio__overlay p {
    margin: 0;
    color: var(--text-muted);
}

.studio__state {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(5, 9, 14, 0.8);
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.studio__state-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-muted);
}

.studio__state.is-live {
    border-color: var(--error);
    background: var(--error);
    color: #fff;
}

.studio__state.is-live .studio__state-dot {
    background: #fff;
    animation: onair-pulse 2s ease-in-out infinite;
}

@keyframes onair-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@media (prefers-reduced-motion: reduce) {
    .studio__state.is-live .studio__state-dot {
        animation: none;
    }
}

.studio__note {
    margin: 0.75rem 0 0;
    padding-left: 0.7rem;
    border-left: 3px solid var(--line);
    color: var(--text-muted);
    font-size: 0.88rem;
}

.studio__note--live {
    border-left-color: var(--error);
    color: var(--text);
}

.studio__bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.studio__bar .btn.is-off,
.studio__bar .btn.is-recording {
    border-color: var(--error);
    color: var(--error);
}

.studio__hint {
    margin: 0.9rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.studio__hint--ok {
    color: var(--ok);
}

.studio__hint--error {
    color: var(--error);
}

.studio__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.stat {
    padding: 0.7rem 0.85rem;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.stat__label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat__value {
    display: block;
    margin-top: 0.15rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.studio__recordings {
    margin-top: 1.5rem;
}

.studio__recordings h2 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.studio__recordings ul {
    margin: 0.6rem 0 0;
    padding-left: 1.1rem;
}

.studio__side .panel {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    margin-bottom: 1.15rem;
}

.studio__side .panel h2 {
    margin: 0 0 0.9rem;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.studio__side .field {
    display: block;
    margin-bottom: 0.9rem;
}

.studio__side select,
.studio__side input[type="text"],
.studio__side input[type="password"] {
    width: 100%;
    padding: 0.5rem 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
}

.studio__side input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.level {
    margin-bottom: 0.9rem;
}

.level__bar {
    position: relative;
    height: 12px;
    margin-top: 0.35rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
}

/* Markierung bei etwa zwei Dritteln - dort sollte der Pegel im Mittel liegen. */
.level__bar::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 70%;
    width: 1px;
    background: rgba(255, 255, 255, 0.25);
}

.level__fill {
    position: relative;
    display: block;
    width: 0;
    height: 100%;
    min-width: 0;
    background: linear-gradient(90deg, var(--ok) 0%, var(--accent) 70%, var(--error) 100%);
    transition: width 90ms linear;
}

.copy {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.copy input {
    flex: 1 1 auto;
    min-width: 0;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.checklist {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.checklist li + li {
    margin-top: 0.3rem;
}

/* Deaktivierte Knoepfe muessen als solche erkennbar sein. */

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

.studio__help {
    max-width: 46ch;
    margin-top: 0.4rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 91, 82, 0.09);
    border: 1px solid rgba(255, 91, 82, 0.4);
    border-radius: var(--radius);
    text-align: left;
}

.studio__help p {
    margin: 0;
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.5;
}

.studio__help-title {
    margin-bottom: 0.3rem !important;
    color: var(--error) !important;
    font-weight: 700;
}

.studio__origin {
    margin-top: 0.5rem !important;
    color: var(--text-muted) !important;
    font-size: 0.8rem !important;
}

.studio__origin span {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--text);
}

#studioOverlayText {
    max-width: 40ch;
    font-size: 1.02rem;
}

/* -------------------------------------------------------------------------
   Das hidden-Attribut stammt aus dem Browser-Stylesheet und wird von jeder
   eigenen display-Regel ueberstimmt. Diese Zeile stellt sicher, dass
   verborgene Elemente auch wirklich verschwinden.
   ------------------------------------------------------------------------- */

[hidden] {
    display: none !important;
}

.studio__setup {
    max-width: 62ch;
    margin-top: 0.9rem;
    padding: 1rem 1.15rem;
    background: rgba(255, 176, 32, 0.08);
    border: 1px solid rgba(255, 176, 32, 0.45);
    border-radius: var(--radius);
}

.studio__setup p {
    margin: 0 0 0.6rem;
    font-size: 0.9rem;
    line-height: 1.55;
}

.studio__setup p:last-child {
    margin-bottom: 0;
}

.studio__setup-title {
    color: var(--accent);
    font-weight: 700;
}

.studio__setup-note {
    padding-top: 0.6rem;
    border-top: 1px solid var(--line);
    color: var(--text-muted);
}

.studio__setup code {
    padding: 0.1rem 0.35rem;
    background: var(--bg-input);
    border-radius: 4px;
    font-size: 0.85em;
}
