[hidden] { display: none !important; }

:root {
    color-scheme: dark;
    --bg: #0e1116;
    --card: #171b22;
    --line: #2a313c;
    --text: #e6e9ef;
    --muted: #8b95a5;
    --accent: #3b82f6;
    --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.4;
}

h1 { font-size: 1.4rem; margin: 0 0 16px; }
h2 { font-size: 1.1rem; margin: 0; }

.container { max-width: 880px; margin: 0 auto; padding: 24px 16px; }
.narrow { max-width: 460px; margin: 32px auto; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
}

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--muted);
}

input {
    flex: 1;
    min-width: 180px;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

button {
    font: inherit;
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #222834;
    color: var(--text);
    cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.ghost { background: transparent; }

a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; margin: 0; }
.error { color: #f87171; margin: 0; }
.status { font-size: 1.05rem; margin: 0; }
.stream p { margin: 0; }

.badge {
    font-size: 0.8rem;
    padding: 3px 9px;
    border-radius: 999px;
    background: #2a313c;
}
.badge[data-state="active"] { background: rgba(22, 163, 74, 0.2); color: #4ade80; }
.badge[data-state="expired"],
.badge[data-state="revoked"] { background: rgba(220, 38, 38, 0.15); color: #f87171; }

video {
    width: 100%;
    background: #000;
    border-radius: 10px;
}

/* Página de recepción para la fuente de navegador de OBS: pantalla completa, sin controles. */
.viewer {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    background: #000;
}
.viewer video {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}
.overlay {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(0, 0, 0, 0.85);
    color: #ddd;
    font-size: 1.5rem;
}
