/* Boost AI Admin — dark gradient theme */

:root {
  --bg: #000;
  --bg-raised: #0a0a0f;
  --bg-card: #0d0d14;
  --bg-hover: #12121c;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --text: #fff;
  --text-dim: rgba(255,255,255,0.72);
  --text-muted: rgba(255,255,255,0.48);
  --text-faint: rgba(255,255,255,0.32);
  --grad-start: #6366f1;
  --grad-mid: #a855f7;
  --grad-end: #ec4899;
  --gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --green: #22c55e;
  --yellow: #fbbf24;
  --red: #ef4444;
  --blue: #3b82f6;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.mono { font-family: var(--mono); }

/* ─── LOGIN ─── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background:
    radial-gradient(ellipse at top left, rgba(99,102,241,0.18), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(236,72,153,0.14), transparent 50%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.login-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.login-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }
.login-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.6;
}

/* ─── FORMS ─── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: none;
  transition: all 150ms;
  resize: vertical;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--grad-mid);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.15);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ─── BUTTONS ─── */
.btn {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  transition: all 150ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary { background: var(--gradient); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(168,85,247,0.35); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
  transition: all 150ms;
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); }
.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.3);
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-block { width: 100%; }
.err-msg { color: var(--red); font-size: 13px; margin-top: 12px; text-align: center; min-height: 18px; }

/* ─── APP LAYOUT ─── */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-logo {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
  padding: 8px 10px;
  margin-bottom: 24px;
}
.sidebar-logo .dim { color: var(--text-muted); font-weight: 500; }
.sidebar-section {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  padding: 14px 10px 8px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text-dim);
  border-radius: 8px;
  cursor: pointer;
  transition: all 150ms;
  margin-bottom: 2px;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,0.18), rgba(168,85,247,0.06));
  color: var(--text);
}
.nav-item .nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.nav-item.active .nav-dot {
  background: var(--grad-mid);
  box-shadow: 0 0 10px var(--grad-mid);
}
.nav-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 7px;
  background: var(--gradient);
  color: #fff;
  border-radius: 20px;
  font-weight: 700;
}
.sidebar-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.me-info {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
}
.me-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

/* ─── MAIN ─── */
.main { min-height: 100vh; }
.main-header {
  padding: 22px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(16px);
  z-index: 10;
  gap: 16px;
  flex-wrap: wrap;
}
.main-h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.main-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.main-body { padding: 28px 32px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ─── KPI CARDS ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.kpi {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0.6;
}
.kpi-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* ─── SECTIONS ─── */
.section-block { margin-bottom: 36px; }
.section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── TABLES ─── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  background: rgba(255,255,255,0.02);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.data-table thead th.num { text-align: right; }
.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.data-table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table .empty {
  text-align: center;
  color: var(--text-faint);
  padding: 32px;
  font-size: 13px;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill-info  { background: rgba(255,255,255,0.06); color: var(--text-dim); }
.pill-warn  { background: rgba(251,191,36,0.15); color: var(--yellow); }
.pill-error { background: rgba(239,68,68,0.15);  color: var(--red); }
.pill-admin { background: rgba(168,85,247,0.18); color: #d8b4fe; }
.pill-ok    { background: rgba(34,197,94,0.15);  color: var(--green); }

/* ─── CARDS ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

/* ─── STATUS BAR ─── */
.status-bar {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-bar.info    { background: rgba(59,130,246,0.10); color: #93c5fd; border-color: rgba(59,130,246,0.25); }
.status-bar.success { background: rgba(34,197,94,0.10);  color: #86efac; border-color: rgba(34,197,94,0.25); }
.status-bar.error   { background: rgba(239,68,68,0.10);  color: #fca5a5; border-color: rgba(239,68,68,0.25); }

/* ─── EDITOR ─── */
.editor-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
}
#config-editor {
  width: 100%;
  height: 65vh;
  background: transparent;
  color: var(--text);
  border: 0;
  outline: 0;
  resize: none;
  padding: 20px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
}

/* ─── COMMANDS LIST ─── */
.cmd-list { display: flex; flex-direction: column; gap: 8px; }
.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  gap: 12px;
}
.cmd-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.cmd-type { font-family: var(--mono); font-weight: 700; font-size: 13px; }
.cmd-target { font-size: 12px; color: var(--text-muted); }
.cmd-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--mono);
}

/* ─── TOGGLES ─── */
.toggle-poll {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-strong);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}
.toggle-poll input { accent-color: var(--grad-mid); }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

/* ─── RESPONSIVE ─── */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
}
