:root {
  --bg: #0a0a0f;
  --bg-card: #13131a;
  --bg-hover: #1c1c26;
  --border: #2a2a35;
  --text: #e4e4e7;
  --text-dim: #8b8b96;
  --accent: #3B82F6;
  --accent-hover: #2563EB;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* Navbar */
.navbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.navbar .logo { font-weight: 700; font-size: 18px; color: var(--text); }
.navbar .logo span { color: var(--accent); }
.navbar .nav-links { display: flex; gap: 20px; align-items: center; }
.navbar button { cursor: pointer; }

/* Auth page */
.auth-wrapper {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 40px; width: 380px;
}
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-card p.sub { color: var(--text-dim); margin-bottom: 24px; font-size: 14px; }
.tabs { display: flex; margin-bottom: 24px; border-radius: 8px; background: var(--bg); padding: 4px; }
.tabs button {
  flex: 1; padding: 8px; border: none; background: transparent; color: var(--text-dim);
  border-radius: 6px; cursor: pointer; font-weight: 500; font-size: 14px;
}
.tabs button.active { background: var(--accent); color: white; }

label { font-size: 13px; color: var(--text-dim); display: block; margin-bottom: 6px; margin-top: 14px; }
input, select {
  width: 100%; padding: 10px 12px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text);
  font-size: 14px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }

.btn {
  width: 100%; padding: 11px; border: none; border-radius: 8px;
  background: var(--accent); color: white; font-weight: 600; font-size: 14px;
  cursor: pointer; margin-top: 20px; transition: background 0.15s;
}
.btn:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--bg-hover); border: 1px solid var(--border); }
.btn.danger { background: var(--red); }
.btn.small { width: auto; padding: 6px 14px; font-size: 13px; margin-top: 0; }

.error-msg { color: var(--red); font-size: 13px; margin-top: 10px; display: none; }

/* Dashboard */
.page-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; }
.page-header p { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.server-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px; cursor: pointer; transition: border-color 0.15s;
}
.server-card:hover { border-color: var(--accent); }
.server-card .name { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.status-badge {
  display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 12px; font-weight: 600;
}
.status-running { background: rgba(34,197,94,0.15); color: var(--green); }
.status-creating { background: rgba(234,179,8,0.15); color: var(--yellow); }
.status-paused { background: rgba(139,139,150,0.15); color: var(--text-dim); }
.status-error, .status-unreachable { background: rgba(239,68,68,0.15); color: var(--red); }

.server-meta { color: var(--text-dim); font-size: 13px; margin-top: 10px; line-height: 1.6; }
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-dim); }

/* Create server form */
.form-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 28px;
}
.slider-row { display: flex; justify-content: space-between; align-items: center; }
.slider-row .val { color: var(--accent); font-weight: 600; }
input[type=range] { -webkit-appearance: none; height: 6px; background: var(--border); border-radius: 3px; margin-top: 8px; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
}
.estimate-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; margin-top: 20px; font-size: 13px; color: var(--text-dim);
}
.estimate-box .row { display: flex; justify-content: space-between; padding: 4px 0; }
.estimate-box .row span:last-child { color: var(--text); font-weight: 600; }

/* Server detail */
.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.gauge-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 18px; text-align: center; }
.gauge-card .label { color: var(--text-dim); font-size: 12px; margin-bottom: 8px; }
.gauge-card .value { font-size: 28px; font-weight: 700; }
.gauge-bar { height: 6px; background: var(--border); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.gauge-fill { height: 100%; background: var(--accent); transition: width 0.5s; }

.tabs-row { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs-row button {
  padding: 10px 16px; background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 14px; border-bottom: 2px solid transparent;
}
.tabs-row button.active { color: var(--text); border-bottom-color: var(--accent); }

#terminal { background: #000; border-radius: 8px; height: 420px; padding: 12px; overflow-y: auto; font-family: monospace; font-size: 13px; }
#terminal .line { white-space: pre-wrap; margin-bottom: 2px; }
#terminal-input-row { display: flex; margin-top: 8px; }
#terminal-input-row input { font-family: monospace; }

.info-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.info-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--text-dim); }

.actions-row { display: flex; gap: 8px; margin-top: 16px; }
