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

:root {
  --bg: #080c10;
  --surface: #0e1318;
  --surface-hover: #141b22;
  --border: #1e2830;
  --border-light: #263240;
  --text: #e8edf2;
  --text-muted: #6b7f8f;
  --text-dim: #3f5060;
  --accent: #00c0e8;
  --accent-hover: #00a8ce;
  --accent-dim: rgba(0, 192, 232, 0.12);
  --error: #f04444;
  --success: #22c55e;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── BRAND MARK ─────────────────────────────────────────── */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon {
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-product {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* ── LOGIN ─────────────────────────────────────────────── */

body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-image: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0,192,232,0.06) 0%, transparent 70%);
}

.login-container {
  width: 100%;
  max-width: 360px;
  padding: 40px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.login-container .brand {
  margin-bottom: 28px;
}

.login-container h1 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
}

.error-msg {
  background: rgba(240, 68, 68, 0.08);
  border: 1px solid rgba(240, 68, 68, 0.25);
  color: var(--error);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 7px;
}

.form-group input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.btn-primary {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #040d12;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.01em;
}

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

/* ── HEADER ─────────────────────────────────────────────── */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

nav {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.btn-link:hover { color: var(--text); }

/* ── DASHBOARD ──────────────────────────────────────────── */

body.dashboard-page main {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px;
}

.section-heading {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.server-list { display: flex; flex-direction: column; gap: 8px; }

.server-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, background 0.15s;
}

.server-card:hover {
  border-color: var(--border-light);
  background: var(--surface-hover);
}

.server-info { display: flex; align-items: center; gap: 16px; }

.server-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  flex-shrink: 0;
}

.server-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--mono);
  margin-bottom: 3px;
}

.server-ip {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.btn-console {
  padding: 7px 16px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn-console:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.loading, .empty { color: var(--text-muted); padding: 12px 0; }
.error { color: var(--error); padding: 12px 0; }

/* ── CONSOLE ────────────────────────────────────────────── */

body.console-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.console-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  height: 44px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-back {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  transition: color 0.15s;
}

.btn-back:hover { color: var(--accent); }

.console-server-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--mono);
}

.console-status {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.console-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
}

.console-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}

.console-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
