:root {
  --bg: #121417;
  --card: #1c2026;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --green: #3ddc84;
  --yellow: #f6c344;
  --red: #ff6b6b;
  --blue: #6ea8fe;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
main { max-width: 560px; margin: 0 auto; padding: 0 16px 32px; }

.topbar { display: flex; justify-content: space-between; align-items: center;
  max-width: 560px; margin: 0 auto; padding: 16px; }
.topbar h1 { font-size: 1.25rem; margin: 0; }

.tabs { display: flex; gap: 6px; max-width: 560px; margin: 0 auto 12px; padding: 0 16px; }
.tab { flex: 1; padding: 10px; border: 0; border-radius: 10px; background: var(--card);
  color: var(--muted); font: inherit; cursor: pointer; }
.tab.active { color: var(--text); outline: 2px solid var(--blue); }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.label { display: block; color: var(--muted); font-size: .8rem; margin-bottom: 2px; }
.big { font-size: 2rem; font-weight: 700; margin: 0; }

.status-line { display: flex; align-items: center; gap: 10px; }
.status-line h2 { margin: 0; font-size: 1.4rem; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 12px var(--green); }
.dot.busy { background: var(--yellow); animation: pulse 1.2s infinite; }
.dot.warn { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }

button { font: inherit; }
.primary { width: 100%; margin-top: 12px; padding: 16px; border: 0; border-radius: 12px;
  font-size: 1.1rem; font-weight: 700; background: var(--green); color: #0b1a10; cursor: pointer; }
.primary.stop { background: var(--red); color: #200; }
.primary:disabled { background: #2b3038; color: var(--muted); cursor: default; }
.ghost { padding: 8px 12px; border: 1px solid #333a44; border-radius: 10px; background: transparent;
  color: var(--text); cursor: pointer; }

.address-row { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid #262b33; }
.address-row:first-of-type { border-top: 0; }
code { font-size: 1rem; word-break: break-all; }

.players { list-style: none; margin: 0; padding: 0; }
.players li { padding: 6px 0; border-top: 1px solid #262b33; }
.players li:first-child { border-top: 0; }

.grid { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; }
.grid dt { color: var(--muted); }
.grid dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.bar { height: 10px; background: #262b33; border-radius: 6px; overflow: hidden; }
.bar div { height: 100%; width: 0; background: var(--green); transition: width .4s; }
.pill { font-size: .75rem; padding: 2px 8px; border-radius: 999px; margin-left: 6px; background: #262b33; }
.pill.OK { color: var(--green); } .pill.ATENCAO { color: var(--yellow); } .pill.ESTOURADO { color: var(--red); }

input[type="month"] { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid #333a44;
  background: var(--bg); color: var(--text); font: inherit; }
.sessions { width: 100%; border-collapse: collapse; font-size: .9rem; }
.sessions th, .sessions td { text-align: left; padding: 6px 4px; border-top: 1px solid #262b33; }
.sessions th { color: var(--muted); font-weight: 500; border-top: 0; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: 90vw; padding: 12px 16px; border-radius: 12px; background: #2b3038; color: var(--text);
  box-shadow: 0 6px 24px rgba(0,0,0,.4); }
