:root {
  --bg: #10131A;
  --panel: #171C27;
  --panel-2: #1E2433;
  --text: #EDEFF5;
  --muted: #A9B5CA;
  --muted-2: #6B738C;
  --primary: #FF3B5C;
  --primary-hover: #FF5670;
  --secondary: #2A3142;
  --secondary-hover: #343D52;
  --danger: #E03A3A;
  --danger-hover: #F04A4A;
  --live: #4CF2C0;
  --gold: #F4B740;
  --border: rgba(237, 239, 245, 0.10);
  --radius: 8px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Login */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 59, 92, 0.10), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(76, 242, 192, 0.07), transparent 40%);
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 360px;
  box-shadow: var(--shadow);
}
.login-card .brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.login-card .brand small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  margin-top: 4px;
}
.login-card .subtitle {
  font-size: 18px;
  margin-top: 18px;
  font-weight: 600;
}
.login-card .hint {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 24px;
}
.login-card input {
  width: 100%;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  margin-bottom: 14px;
}
.login-card button {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
}
.login-card button:hover { background: var(--primary-hover); }
.err {
  color: var(--primary);
  font-size: 13px;
  margin-top: 12px;
}

/* Esconde elementos de forma definitiva, independente de display/flex nativo. */
.hidden {
  display: none !important;
}

/* App */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
  z-index: 100;
}
.topbar .brand {
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.topbar .brand small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  margin-left: 8px;
}
.tabs { display: flex; gap: 6px; flex: 1; }
.tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
}
.logout:hover { color: var(--text); border-color: var(--muted); }

.content {
  padding: 84px 24px 24px;
  max-width: 1400px;
  margin: 0 auto;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.grid.two {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}
@media (max-width: 980px) {
  .grid.two { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; }
}

.panel-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 14px 0 6px;
}
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--primary); }
textarea { resize: vertical; font-family: inherit; }

.btn {
  padding: 9px 16px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.secondary { background: var(--secondary); color: var(--text); }
.btn.secondary:hover { background: var(--secondary-hover); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: var(--danger-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.inline {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.inline input, .inline select { flex: 1; min-width: 120px; }

.hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 12px;
  line-height: 1.5;
}

/* Lists */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}
.list::-webkit-scrollbar { width: 6px; }
.list::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 3px; }
.row {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.row:hover { border-color: var(--muted-2); }
.row.selected { border-color: var(--primary); }
.row .main { min-width: 0; }
.row .title { font-weight: 600; word-break: break-word; }
.row .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.row .actions { display: flex; gap: 6px; flex-shrink: 0; }
.row .actions button { padding: 6px 10px; font-size: 12px; }

.empty { color: var(--muted-2); text-align: center; padding: 30px 0; font-size: 13px; }

/* Chat */
.chat-name { color: var(--live); font-weight: 700; }
.chat-body { color: var(--text); word-break: break-word; }

/* Prizes */
.selected-info {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin: 14px 0;
  font-size: 13px;
}
.history {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
  font-size: 13px;
  margin-bottom: 10px;
}
.history .msg { margin-bottom: 6px; }
.history .msg.dj b { color: var(--gold); }
.history .msg b { color: var(--live); }

/* Schedule */
.sched-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  z-index: 200;
  max-width: 380px;
  animation: slideIn 0.25s ease;
}
.toast.error { border-color: var(--danger); }
.toast.success { border-color: var(--live); }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
