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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  font-size: 14px;
  background: #0f1117;
  color: #e2e8f0;
  min-height: 100vh;
}

header {
  background: #1a1d27;
  border-bottom: 1px solid #2d3148;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

header h1 {
  font-size: 18px;
  font-weight: 700;
  color: #f97316;
  letter-spacing: 0.5px;
}

header .tagline {
  font-size: 12px;
  color: #64748b;
}

nav {
  display: flex;
  gap: 4px;
  padding: 12px 24px 0;
  border-bottom: 1px solid #2d3148;
  background: #1a1d27;
}

nav button {
  background: none;
  border: none;
  color: #94a3b8;
  padding: 8px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s;
}

nav button:hover { color: #e2e8f0; }
nav button.active { color: #f97316; border-bottom-color: #f97316; }

main { padding: 24px; max-width: 1100px; }

.admin-layout {
  display: flex;
  gap: 0;
  min-height: 400px;
}

.admin-sidebar {
  width: 140px;
  flex-shrink: 0;
  border-right: 1px solid #2d3148;
  padding-right: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 2px;
}

.admin-sidebar-item {
  background: none;
  border: none;
  color: #64748b;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  border-radius: 6px 0 0 6px;
  transition: background 0.15s, color 0.15s;
}

.admin-sidebar-item:hover { background: #1e2130; color: #e2e8f0; }
.admin-sidebar-item.active { background: #1e2130; color: #f97316; border-right: 2px solid #f97316; }

.admin-content {
  flex: 1;
  padding-left: 24px;
  min-width: 0;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h2 { font-size: 15px; font-weight: 600; color: #e2e8f0; }

button.btn {
  background: #f97316;
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}
button.btn:hover { background: #ea6c0f; }
button.btn.secondary {
  background: #1e2130;
  border: 1px solid #2d3148;
  color: #94a3b8;
}
button.btn.secondary:hover { background: #252840; color: #e2e8f0; }
button.btn.danger { background: #dc2626; }
button.btn.danger:hover { background: #b91c1c; }
button.btn.small { padding: 4px 10px; font-size: 12px; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #1a1d27;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #2d3148;
}

th:first-child:has(input[type="checkbox"]),
td:first-child:has(input[type="checkbox"]) { width: 32px; padding: 10px 8px; }

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  background: #151720;
  border-bottom: 1px solid #2d3148;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid #1e2130;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #1e2130; }

.mono { font-family: monospace; font-size: 12px; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge.http { background: #1d4ed8; color: #bfdbfe; }
.badge.meta { background: #7c3aed; color: #ddd6fe; }
.badge.js   { background: #b45309; color: #fde68a; }
.badge.proxy { background: #065f46; color: #6ee7b7; }

.hit-count {
  font-size: 12px;
  color: #94a3b8;
}
.hit-count.has-hits { color: #f97316; font-weight: 600; }

.copy-btn {
  background: none;
  border: 1px solid #2d3148;
  color: #64748b;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s;
}
.copy-btn:hover { border-color: #f97316; color: #f97316; }
.copy-btn.copied { border-color: #16a34a; color: #16a34a; }

/* Form */
.form-card {
  background: #1a1d27;
  border: 1px solid #2d3148;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.form-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: #e2e8f0; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; color: #94a3b8; font-weight: 500; }

.form-group input, .form-group select {
  background: #0f1117;
  border: 1px solid #2d3148;
  color: #e2e8f0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  transition: border-color 0.15s;
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: #f97316;
}

.form-group input::placeholder { color: #475569; }

.form-actions { display: flex; gap: 8px; margin-top: 4px; }

/* Config page */
.config-section {
  background: #1a1d27;
  border: 1px solid #2d3148;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}
.config-section h3 { font-size: 13px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }

.config-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #1e2130;
}
.config-row:last-child { border-bottom: none; }
.config-label { font-size: 13px; color: #94a3b8; }
.config-value { font-family: monospace; font-size: 13px; color: #e2e8f0; }

.cmd-block {
  background: #0f1117;
  border: 1px solid #2d3148;
  border-radius: 6px;
  padding: 12px 14px;
  font-family: monospace;
  font-size: 12px;
  color: #a3e635;
  margin-top: 8px;
  overflow-x: auto;
  white-space: pre;
}

/* Rebind status */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.waiting { background: #f97316; }
.status-dot.flipped { background: #16a34a; }

/* Hits tab */
.hits-table td { font-size: 12px; }
.timestamp { color: #64748b; font-family: monospace; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px;
  color: #475569;
}
.empty-state p { font-size: 14px; }

/* Modal */
.modal-open { display: flex !important; }

/* Alert */
.alert {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13px;
}
.alert.error { background: #450a0a; border: 1px solid #dc2626; color: #fca5a5; }
.alert.success { background: #052e16; border: 1px solid #16a34a; color: #86efac; }
