:root {
    --bg: #08111d;
    --bg-2: #0d1727;
    --panel: rgba(15, 23, 38, 0.92);
    --line: rgba(255, 255, 255, 0.08);
    --text: #f5f7fb;
    --muted: #9fb0c8;
    --accent: #ffd200;
    --success: #22c55e;
    --danger: #ef4444;
    --edit: #60a5fa;
    --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 210, 0, 0.10), transparent 26%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    color: var(--text);
    min-height: 100vh;
}

button, input { font: inherit; }
button { cursor: pointer; }

/* Topbar ------------------------------------------------------------------ */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: rgba(6, 12, 22, 0.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--accent);
    color: #111;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.brand-title { font-weight: 800; font-size: 17px; }
.brand-sub { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.conn { color: var(--danger); font-size: 14px; }
.conn.on { color: var(--success); }

.ghost-btn {
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}
.ghost-btn:hover { background: rgba(255, 255, 255, 0.12); }

/* Layout ------------------------------------------------------------------ */

.main {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 60px;
    display: grid;
    gap: 16px;
}

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

/* NO AR ------------------------------------------------------------------- */

.onair {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
}

.onair.live {
    border-color: rgba(34, 197, 94, 0.55);
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.16), var(--panel) 60%);
}

.onair-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: var(--muted);
    white-space: nowrap;
}

.dot { width: 10px; height: 10px; border-radius: 50%; background: #475569; }
.onair.live .onair-label { color: var(--success); }
.onair.live .dot { background: var(--success); box-shadow: 0 0 12px var(--success); }

.onair-body { flex: 1; min-width: 0; }
.onair-nome { font-size: 26px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onair-funcao { color: var(--muted); font-size: 15px; margin-top: 2px; }

.clear-btn {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    font-weight: 800;
    white-space: nowrap;
}
.clear-btn:hover { background: rgba(239, 68, 68, 0.25); }

/* Formulário ------------------------------------------------------------- */

input[type="text"], input[type="search"], input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    outline: none;
}
input:focus { border-color: var(--accent); }

.add-form { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 10px; }

.primary-btn {
    padding: 12px 18px;
    border-radius: 12px;
    border: 0;
    background: var(--accent);
    color: #111;
    font-weight: 900;
    white-space: nowrap;
}
.primary-btn:hover { filter: brightness(1.08); }

.status { min-height: 0; font-size: 13px; font-weight: 700; }
.status.ok, .status.error { margin-top: 10px; }
.status.ok { color: var(--success); }
.status.error { color: #fca5a5; }

/* Lista ------------------------------------------------------------------- */

.list-head { display: flex; align-items: center; gap: 12px; }
.list-head input { flex: 1; font-size: 16px; }
.count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 2px 12px; }

.lista { display: grid; gap: 8px; }

.item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}
.item.selected { border-color: var(--accent); background: rgba(255, 210, 0, 0.07); }
.item.live { border-color: rgba(34, 197, 94, 0.6); background: rgba(34, 197, 94, 0.10); }

.info { flex: 1; min-width: 0; }
.nome { font-weight: 800; font-size: 16px; }
.funcao { color: var(--muted); font-size: 13px; margin-top: 2px; }

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

.small-btn {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.small-btn:hover { color: var(--text); border-color: var(--edit); }
.small-btn.danger:hover { color: #fca5a5; border-color: var(--danger); }
.small-btn.save { background: var(--edit); border-color: var(--edit); color: #08111d; }

.apply-btn {
    min-width: 96px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 0;
    background: var(--success);
    color: #052e16;
    font-weight: 900;
    letter-spacing: 0.06em;
}
.apply-btn:hover { filter: brightness(1.1); }
.item.live .apply-btn { background: transparent; color: var(--success); box-shadow: inset 0 0 0 2px var(--success); }

.item.editing { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 8px; }
.item.editing input { padding: 9px 12px; }

.empty { color: var(--muted); padding: 24px; text-align: center; }

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

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { width: 100%; max-width: 340px; display: grid; gap: 12px; justify-items: start; }
.login-box h1 { margin: 0; font-size: 22px; }
.login-box button { width: 100%; }

/* Celular ----------------------------------------------------------------- */

@media (max-width: 640px) {
    .topbar { padding: 12px 16px; }
    .onair { flex-wrap: wrap; }
    .onair-nome { font-size: 20px; }
    .add-form, .item.editing { grid-template-columns: 1fr; }
    .item { flex-wrap: wrap; }
    .info { min-width: 140px; }
    .actions { margin-left: auto; }
}
