:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-2: #1a1a28;
  --border: #2a2a3a;
  --text: #e4e4ef;
  --text-dim: #8888a0;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

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

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

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

/* Layout */
.container { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }
header { border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 2rem; display: flex; justify-content: space-between; align-items: center; }
header h1 { font-size: 1.25rem; font-weight: 600; }
header .nav { display: flex; gap: 1rem; align-items: center; }

/* Cards / Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.panel h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.panel h3 { font-size: 0.875rem; font-weight: 600; margin: 1rem 0 0.5rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.stat-card .label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .value { font-size: 1.5rem; font-weight: 700; margin-top: 0.25rem; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
th { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
td { font-size: 0.875rem; }
tr:hover td { background: var(--surface-2); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); transition: all 0.15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: rgba(239,68,68,0.1); }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.8rem; }
.btn-group { display: flex; gap: 0.5rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.25rem; font-weight: 500; }
input[type="text"], input[type="number"], input[type="password"], select, textarea {
  width: 100%; padding: 0.5rem 0.75rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--font); font-size: 0.875rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 120px; resize: vertical; font-family: var(--mono); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Checkboxes */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.checkbox-group label { display: flex; align-items: center; gap: 0.35rem; font-size: 0.875rem; color: var(--text); cursor: pointer; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

/* Range slider */
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* Pills / Tags */
.pill {
  display: inline-block; padding: 0.15rem 0.5rem;
  background: var(--surface-2); border-radius: 4px;
  font-size: 0.75rem; color: var(--text-dim);
}
.pill-accent { background: rgba(99,102,241,0.15); color: var(--accent); }

/* Copy button */
.copy-row { display: flex; gap: 0.5rem; align-items: center; }
.copy-row code {
  flex: 1; padding: 0.5rem 0.75rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--mono);
  font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis;
}

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.875rem; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: var(--success); }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--danger); }

/* Loading */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Visibility */
.hidden { display: none !important; }

/* Pre-filter list */
.filter-list { list-style: none; }
.filter-list li { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.filter-list input { flex: 1; }
.filter-list select { width: 80px; }

/* Preview */
.preview-output {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
  font-family: var(--mono); font-size: 0.8rem;
  white-space: pre-wrap; word-break: break-word;
  max-height: 500px; overflow-y: auto;
}
