:root {
  --bg: #21201C;
  --card-bg: #2a2924;
  --card-border: #3a3830;
  --accent: #208368;
  --accent-hover: #26997B;
  --accent-light: #29A383;
  --text: #F9F9F8;
  --text-muted: #82827C;
  --success: #46A758;
  --warning: #EF5F00;
  --error: #DC3E42;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

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

.container.wide {
  max-width: 1200px;
}

/* ── Header ─────────────────────────────────────────── */
.header {
  text-align: center;
  margin-bottom: 48px;
}

.header .logo {
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.header h1 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 8px;
}

.header p {
  color: var(--text-muted);
  font-size: 16px;
}

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

.card h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--text-muted);
}

/* ── Forms ──────────────────────────────────────────── */
.input-group {
  display: flex;
  gap: 12px;
}

input[type="email"], input[type="text"] {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

input:focus {
  border-color: var(--accent);
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

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

.btn-primary:disabled {
  background: #1D3B31;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover {
  background: rgba(67, 97, 238, 0.1);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-danger {
  background: var(--error);
  color: white;
}

/* ── Badges ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.badge-available { background: rgba(46, 204, 113, 0.15); color: var(--success); }
.badge-claimed { background: rgba(32, 131, 104, 0.15); color: var(--accent-light); }
.badge-error { background: rgba(231, 76, 60, 0.15); color: var(--error); }
.badge-running { background: rgba(243, 156, 18, 0.15); color: var(--warning); }
.badge-completed { background: rgba(46, 204, 113, 0.15); color: var(--success); }
.badge-paused { background: rgba(136, 136, 170, 0.15); color: var(--text-muted); }
.badge-failed { background: rgba(231, 76, 60, 0.15); color: var(--error); }

/* ── Instance URL ───────────────────────────────────── */
.instance-url {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 16px;
}

.instance-url a {
  color: var(--accent);
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
}

.instance-url a:hover {
  text-decoration: underline;
}

/* ── Agent Cards ────────────────────────────────────── */
.agent-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 8px;
}

.agent-info {
  flex: 1;
}

.agent-name {
  font-weight: 500;
  margin-bottom: 4px;
}

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

/* ── Progress ───────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  background: var(--accent-light);
  border-radius: 3px;
  transition: width 0.3s;
}

.drip-status {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Log ────────────────────────────────────────────── */
.drip-log {
  margin-top: 12px;
}

.drip-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--card-border);
}

.drip-log-item:last-child {
  border-bottom: none;
}

/* ── Admin Table ────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--card-border);
}

td {
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--card-border);
}

tr:hover td {
  background: rgba(32, 131, 104, 0.05);
}

.ip-cell {
  font-family: var(--mono);
  font-size: 13px;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
}

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

/* ── Utility ────────────────────────────────────────── */
.hidden { display: none; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--card-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}
