:root {
  --accent: #6d6bff;
  --accent-soft: rgba(109, 107, 255, 0.16);
  --accent-line: rgba(109, 107, 255, 0.34);
  --on-accent: #ffffff;
  --bg: #07070b;
  --panel: rgba(19, 19, 25, 0.82);
  --panel-solid: #14141b;
  --panel-raise: rgba(255, 255, 255, 0.045);
  --panel-hover: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --text-soft: #cacdd6;
  --muted: #8d90a0;
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.14);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.14);
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;
  --font: "Geist", "Segoe UI", Inter, system-ui, -apple-system, Arial, sans-serif;
  --mono: "Geist Mono", "Cascadia Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  background: radial-gradient(circle at 20% 0%, #14121f 0%, var(--bg) 60%);
  font-family: var(--font);
  color: var(--text);
}

.hidden {
  display: none !important;
}

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

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 340px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.8);
}

.login-card h1 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.login-card p {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 20px;
}

.login-card input {
  width: 100%;
  margin-bottom: 12px;
}

.login-error {
  font-size: 12px;
  color: #ffb4b4;
  min-height: 16px;
  margin-bottom: 4px;
}

/* ---------------------------------------------------------- Shared */

input,
textarea {
  background: var(--panel-raise);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  border-radius: var(--r-sm);
  padding: 9px 12px;
  outline: none;
  width: 100%;
}

input:focus,
textarea:focus {
  border-color: var(--accent-line);
}

.btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--panel-raise);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
  background: var(--panel-hover);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  width: 100%;
}

.btn.primary:hover {
  filter: brightness(1.08);
}

.btn.ghost {
  background: transparent;
}

/* ---------------------------------------------------------- Shell */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--panel-solid);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  padding: 4px 8px 22px;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-line);
}

.tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tab {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font);
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab:hover {
  background: var(--panel-raise);
  color: var(--text);
}

.tab.active {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-footer .status-pill {
  text-align: center;
}

.content {
  flex: 1;
  padding: 28px 32px 60px;
  max-width: 900px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}

.status-pill {
  font-size: 11.5px;
  font-family: var(--mono);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 12px;
  color: var(--muted);
}

.status-pill.online {
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.4);
}

.status-pill.offline {
  color: #ffb4b4;
  border-color: rgba(239, 68, 68, 0.4);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-header h2 {
  font-size: 15px;
  font-weight: 600;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
}

.player-row {
  background: var(--panel-raise);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.player-main {
  min-width: 160px;
}

.player-name {
  font-weight: 600;
  font-size: 13.5px;
}

.player-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  font-family: var(--mono);
}

.player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.player-actions button {
  font-family: var(--font);
  font-size: 11.5px;
  border: 1px solid var(--line);
  background: var(--panel-hover);
  color: var(--text-soft);
  border-radius: 7px;
  padding: 6px 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.player-actions button:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--text);
}

.player-actions button.danger:hover {
  background: var(--red-soft);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ffb4b4;
}

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

.announce-row {
  display: flex;
  gap: 10px;
}

.announce-row textarea {
  flex: 1;
  min-height: 42px;
  resize: vertical;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.log-list .ok {
  color: var(--green);
}

.log-list .fail {
  color: #ffb4b4;
}

/* ---------------------------------------------------------- Jobs */

.job-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
}

.job-row {
  background: var(--panel-raise);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
}

.job-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.job-name {
  font-weight: 600;
  font-size: 13.5px;
}

.job-key {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  margin-left: 6px;
}

.job-counts {
  display: flex;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
}

.job-counts .online {
  color: var(--green);
}

.job-counts .offline {
  color: var(--muted);
}

.job-members {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.job-member-chip {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-soft);
  background: var(--panel-hover);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 10px;
}
