:root {
  --bg: #0e0f11;
  --panel: #161719;
  --panel-alt: #1c1e21;
  --border: #2a2c30;
  --text: #e5e7eb;
  --text-dim: #9ca3af;
  --green: #16a34a;
  --green-hover: #15803d;
  --red: #dc2626;
  --red-hover: #b91c1c;
  --accent: #22c55e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Consolas", "SF Mono", "Courier New", monospace;
}

/* ---------- Login ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
.login-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px;
  width: 320px;
  text-align: center;
}
.login-box h1 { font-size: 20px; margin-bottom: 24px; }
.login-box input {
  width: 100%;
  padding: 10px;
  margin-bottom: 16px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}
.error-msg { color: var(--red); font-size: 13px; min-height: 18px; }

/* ---------- App Layout ---------- */
.app { display: flex; height: 100vh; }

.sidebar {
  width: 200px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
}
.brand {
  font-size: 14px;
  font-weight: bold;
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.nav-item {
  background: none;
  border: none;
  color: var(--text-dim);
  text-align: left;
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.nav-item:hover { background: var(--panel-alt); color: var(--text); }
.nav-item.active { color: var(--accent); background: var(--panel-alt); }
.nav-item.logout { margin-top: auto; color: var(--red); }

.content { flex: 1; padding: 24px 32px; overflow-y: auto; }

.tab { display: none; }
.tab.active { display: block; }

h2 { margin-top: 0; font-weight: normal; font-size: 22px; }
h3 { font-size: 14px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

.columns { display: flex; gap: 32px; flex-wrap: wrap; }
.col { flex: 1; min-width: 220px; }

label { display: block; font-size: 12px; color: var(--text-dim); margin: 12px 0 4px; }
input[type=text], input:not([type]), input[type=password] {
  width: 100%;
  padding: 10px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}
.btn-green { background: var(--green); }
.btn-green:hover { background: var(--green-hover); }
.btn-red { background: var(--red); }
.btn-red:hover { background: var(--red-hover); }
.btn-gray { background: #374151; }
.btn-gray:hover { background: #4b5563; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }

.status-badge {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
}
.status-badge.online { color: var(--accent); }
.status-badge.offline { color: var(--red); }

/* Settings checkboxes */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.setting-left { display: flex; align-items: center; gap: 8px; }
.gear-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
}
.gear-btn:hover { color: var(--text); }

/* Account switch list (Connect tab) */
.account-switch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  margin-bottom: 8px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.account-switch-item.selected { border-color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.dot.on { background: var(--accent); }
.dot.off { background: var(--red); }

/* Chat tab */
.chat-log {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  height: 60vh;
  overflow-y: auto;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.chat-input-row { display: flex; gap: 8px; margin-top: 12px; }
.chat-input-row input { flex: 1; }

/* Accounts tab table */
.accounts-table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden { display: none; }
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  width: 400px;
}
.gear-field { margin-bottom: 12px; }
.gear-field label { margin-bottom: 4px; }
