:root {
  --bg: #111111;
  --surface: #1a1a1a;
  --border: #262626;
  --border-hover: #333333;
  --text-primary: #fafafa;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --text-dim: #525252;
  --green: #22c55e;
  --red: #dc2626;
  --yellow: #f59e0b;
  --font: system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.5;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-version {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg);
}

.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg);
}

.table-header {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.table-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
}

.table-row:hover {
  background: var(--surface);
}

.table-row.expanded {
  background: var(--surface);
  border-bottom-color: transparent;
}

.expand-panel {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px;
}

.btn {
  font-family: var(--font);
  font-size: 12px;
  padding: 6px 14px;
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  line-height: 1.4;
}

.btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-start {
  color: var(--green);
  border-color: var(--green);
}

.btn-start:hover {
  background: rgba(34, 197, 94, 0.1);
}

.btn-danger {
  color: var(--red);
  border-color: var(--red);
}

.btn-danger:hover {
  background: rgba(220, 38, 38, 0.1);
}

.btn-primary-fill {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
  font-weight: 500;
}

.btn-primary-fill:hover {
  background: #e5e5e5;
  border-color: #e5e5e5;
}

.input {
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.input:focus {
  border-color: var(--text-dim);
}

.input-error {
  border-color: var(--red);
}

.label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 500;
}

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge-installed {
  color: var(--text-dim);
  border-color: var(--border);
}

.btn-danger-fill {
  background: var(--red);
  color: var(--text-primary);
  border-color: var(--red);
}

.btn-danger-fill:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
  pointer-events: auto;
  animation: toast-in 0.2s ease-out;
}

.toast-success::before {
  content: "\2713";
  color: var(--green);
  font-weight: 700;
}

.toast-error::before {
  content: "\2717";
  color: var(--red);
  font-weight: 700;
}

.toast-info::before {
  content: "\2022";
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
}

.toast.fade-out {
  animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  min-width: 360px;
  max-width: 480px;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-body {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.running {
  background: var(--green);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.status-dot.stopped {
  background: var(--red);
}

.status-dot.pending {
  background: var(--yellow);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.log-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 120px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.log-block.expanded {
  max-height: 400px;
  overflow: auto;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.3s ease;
  animation: progress-pulse 2s ease-in-out infinite;
}

@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

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

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

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.kv-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 13px;
}

.kv-grid dt {
  color: var(--text-muted);
}

.kv-grid dd {
  color: var(--text-primary);
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

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

.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
