/* Dashboard-specific styles — landing page tokens already in theme.css */

.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

/* Stats bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.stat-value.accent { color: var(--accent); }
.stat-label {
  font-size: 12px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Action bar */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.action-group { display: flex; gap: 12px; }

.webhook-url {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
}
.webhook-url code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--accent);
}

/* Two-column grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg);
}
.panel-title .signal-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}
.panel-title .cluster-icon { color: var(--accent); }
.badge {
  font-size: 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  color: var(--fg-muted);
}

/* Signal list */
.signal-list { max-height: 420px; overflow-y: auto; }
.signal-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: default;
}
.signal-item:last-child { border-bottom: none; }
.signal-item:hover { background: var(--surface2); }
.signal-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--fg-muted);
  flex-shrink: 0;
  margin-top: 2px;
}
.signal-icon.clustered { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.signal-body .signal-source {
  font-size: 11px;
  color: var(--fg-muted);
  display: block;
  margin-bottom: 3px;
}
.signal-body p { font-size: 13px; color: var(--fg); line-height: 1.4; }
.signal-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.signal-mrr { font-size: 12px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.signal-badge {
  font-size: 10px;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}
.signal-sent { font-size: 10px; color: var(--green); font-weight: 500; }

/* Cluster list */
.cluster-list { max-height: 420px; overflow-y: auto; }
.cluster-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cluster-item:last-child { border-bottom: none; }
.cluster-item:hover { background: var(--surface2); }
.cluster-meta { flex: 1; }
.cluster-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.cluster-name { font-size: 14px; font-weight: 600; color: var(--fg); }
.cluster-status-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--fg-muted);
}
.cluster-status-badge.pending { background: var(--accent-dim); color: var(--accent); }
.cluster-pushed-badge { font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 600; background: rgba(62,207,142,0.15); color: var(--green); }
.cluster-desc { font-size: 12px; color: var(--fg-muted); line-height: 1.4; }
.cluster-stats { display: flex; gap: 20px; }
.cluster-stat { display: flex; align-items: baseline; gap: 4px; }
.cs-val { font-size: 16px; font-weight: 600; color: var(--fg); }
.cs-mrr { font-size: 16px; font-weight: 600; color: var(--accent); }
.cs-label { font-size: 11px; color: var(--fg-muted); }

/* MRR panel */
.mrr-panel { margin-bottom: 24px; }
.mrr-actions { display: flex; gap: 8px; }
.mrr-table { width: 100%; border-collapse: collapse; }
.mrr-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.mrr-table td {
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.mrr-table tr:last-child td { border-bottom: none; }
.mrr-table tr:hover td { background: var(--surface2); }
.mrr-cell { color: var(--accent); font-weight: 600; }
.muted { color: var(--fg-muted); }
code { font-size: 12px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface2); border-color: var(--fg-muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }
.btn-primary:hover { background: #e8951a; border-color: #e8951a; }
.btn-secondary { background: var(--surface2); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-muted); padding: 6px 10px; }
.btn-ghost:hover { background: var(--surface2); color: var(--fg); }
.btn-icon { font-size: 14px; }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 20px;
  color: var(--fg-muted);
  text-align: center;
}
.empty-icon { font-size: 32px; opacity: 0.4; }
.empty-state p { font-size: 13px; max-width: 280px; line-height: 1.5; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 480px;
  max-width: 90vw;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 24px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 500;
  z-index: 2000;
  animation: slideUp 0.2s ease;
}
.toast.hidden { display: none; }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Form elements */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--fg-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.form-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--fg);
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}
.form-input:focus { outline: none; border-color: var(--accent); }
textarea.form-input { resize: vertical; min-height: 80px; }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .dashboard { padding: 0 20px 60px; }
  .stats-bar { grid-template-columns: 1fr 1fr; gap: 12px; }
  .action-bar { flex-direction: column; align-items: flex-start; }
  .webhook-url { display: none; }
}