:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2d3748;
  --accent: #6366f1;
  --accent-hover: #4f52c9;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --mono: #a5f3fc;
  --sidebar-width: 220px;
}

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
}

/* Sidebar */
nav {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
}

nav .brand {
  padding: 0 20px 24px;
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

nav .brand span { color: var(--accent); }

nav ul { list-style: none; padding: 16px 0; flex: 1; }

nav ul li a {
  display: block;
  padding: 9px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
}

nav ul li a:hover { color: var(--text); background: rgba(255,255,255,.04); }
nav ul li a.active { color: var(--text); background: rgba(99,102,241,.15); border-left: 2px solid var(--accent); }

/* Main content */
main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 32px 40px;
  max-width: 860px;
}

h1 { font-size: 20px; font-weight: 600; margin-bottom: 24px; }
h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--text); }

/* Flash messages */
.flash {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 13px;
}
.flash.success { background: rgba(16,185,129,.15); border: 1px solid var(--success); color: var(--success); }
.flash.error   { background: rgba(239,68,68,.15);  border: 1px solid var(--error);   color: var(--error); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.field input[type="text"],
.field input[type="password"],
.field input[type="url"],
.field select,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.field .field-error { font-size: 12px; color: var(--error); margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 5px;
  border: none;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: transparent; color: var(--error); border: 1px solid var(--error); }
.btn-danger:hover { background: rgba(239,68,68,.1); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Status dots */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-green  { background: var(--success); }
.dot-red    { background: var(--error); }
.dot-yellow { background: var(--warning); }

/* Monospace values */
.mono { font-family: monospace; color: var(--mono); font-size: 12px; }

/* Redirect URL row */
.url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.url-row .mono { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--text-muted); font-weight: 500; padding: 8px 12px; border-bottom: 1px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid rgba(45,55,72,.5); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-success { background: rgba(16,185,129,.15); color: var(--success); }
.badge-error   { background: rgba(239,68,68,.15);  color: var(--error); }
.badge-running { background: rgba(99,102,241,.15); color: var(--accent); }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.empty-state p  { margin-bottom: 20px; font-size: 13px; }
.empty-state ol { text-align: left; display: inline-block; line-height: 2; font-size: 13px; }
.empty-state a  { color: var(--accent); }

/* Section divider */
.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
}

/* Utility */
.row { display: flex; gap: 12px; align-items: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-muted { color: var(--text-muted); font-size: 13px; }
