/* Painel StreamMaxx: mesma paleta escura do app desktop (desktop/Theme.cs). */
:root {
  --bg: #0A0E13; --panel: #111821; --line: #1E2A38; --field: #0C121A; --ghost: #1C2734;
  --text: #E8EEF5; --muted: #8A9BB1; --accent: #3DDC97; --accent-ink: #04140D;
  --danger: #FF6B6B; --danger-bg: #2A1417; --warn: #F5C451; --warn-bg: #2A2312; --info: #6CB4FF;
  --radius: 10px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
p.sub { color: var(--muted); margin: 0 0 20px; }
.boot { padding: 40px; color: var(--muted); }
.mono { font-family: Consolas, "Cascadia Mono", monospace; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---- layout ---- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 4px 8px 18px; }
.brand img { width: 26px; height: 26px; }
.side a { color: var(--muted); padding: 8px 10px; border-radius: 8px; display: block; }
.side a:hover { background: var(--ghost); color: var(--text); text-decoration: none; }
.side a.on { background: var(--ghost); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.side .spacer { flex: 1; }
.side .who { padding: 10px; border-top: 1px solid var(--line); margin-top: 8px; font-size: 13px; }
.side .who b { display: block; }
main { padding: 28px 32px; min-width: 0; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---- blocos ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 28px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 12.5px; }
.stat.ok .n { color: var(--accent); }
.stat.bad .n { color: var(--danger); }

/* ---- tabelas ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
tbody tr:hover { background: #0f1620; }
tr.click { cursor: pointer; }
td.actions { white-space: nowrap; }
td.actions > * + * { margin-left: 8px; }
.empty { color: var(--muted); padding: 18px 10px; }
.details { display: inline-block; color: var(--muted); font-size: 12.5px; min-width: 220px; max-width: 520px; word-break: break-word; }

/* ---- etiquetas ---- */
.tag { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: var(--ghost); color: var(--text); white-space: nowrap; }
.tag.ok { background: #0f2a1f; color: var(--accent); }
.tag.bad { background: var(--danger-bg); color: var(--danger); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.info { background: #12233a; color: var(--info); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot.on { background: var(--accent); box-shadow: 0 0 0 3px #3ddc9726; }

/* ---- formulários ---- */
button, .btn { font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; background: var(--accent); color: var(--accent-ink); }
button.ghost { background: var(--ghost); color: var(--text); }
button.danger { background: var(--danger); color: #1A0505; }
button.small { padding: 5px 10px; font-size: 12.5px; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12.5px; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.form { display: grid; gap: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters label { min-width: 140px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.error { color: var(--danger); min-height: 20px; }

/* ---- login ---- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login .brand { padding: 0 0 6px; }

/* ---- janela modal ---- */
.modal-bg { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.secret { font-family: Consolas, monospace; font-size: 22px; letter-spacing: 1px; background: var(--field); border: 1px dashed var(--accent); border-radius: 8px; padding: 14px; text-align: center; user-select: all; margin: 10px 0; }
.groups-box { display: grid; gap: 6px; max-height: 180px; overflow: auto; padding: 8px; background: var(--field); border: 1px solid var(--line); border-radius: 8px; }

/* ---- linha do tempo ---- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline .t { color: var(--muted); font-family: Consolas, monospace; font-size: 12.5px; }

#toast { position: fixed; bottom: 20px; right: 20px; background: var(--ghost); border: 1px solid var(--line); padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 360px; z-index: 20; }
#toast.show { opacity: 1; }
#toast.bad { border-color: var(--danger); color: var(--danger); }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .brand { padding: 4px 8px; width: 100%; }
  .side .spacer, .side .who { display: none; }
  main { padding: 18px 16px; }
}
.narrow { max-width: 440px; }

/* blocos de código para copiar (página de instalação) */
pre.code { background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; white-space: pre; font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; margin: 0 0 10px; }
