/* CallLoop Dashboard Styles — extends theme.css */

.dashboard-main { padding: 48px 0 80px; min-height: calc(100vh - 60px); }

.dash-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 40px; }
.dash-title { font-family: var(--font-display); font-size: 32px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.5px; }
.dash-subtitle { color: var(--fg-muted); font-size: 15px; }
.dash-actions { display: flex; gap: 12px; align-items: center; }

/* Buttons */
.btn { display: inline-block; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: all 0.15s; border: none; }
.btn-primary { background: var(--accent); color: #0F1923; }
.btn-primary:hover { background: #e08c0a; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--fg-muted); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 13px; background: var(--bg-alt); border: 1px solid var(--border); color: var(--fg-muted); border-radius: 6px; cursor: pointer; }
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.stat-card .stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--fg-muted); margin-bottom: 10px; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--fg); }
.stat-card .stat-value.status-ok { color: #10b981; font-size: 14px; font-family: var(--font-body); font-weight: 600; }
.stat-card .stat-value.status-warn { color: var(--accent); font-size: 14px; font-family: var(--font-body); font-weight: 600; }
.stat-unit { font-size: 16px; font-weight: 400; color: var(--fg-muted); }

/* Webhook box */
.webhook-box { background: var(--bg-alt); border: 1px solid rgba(245,158,11,0.25); border-radius: 12px; padding: 24px; margin-bottom: 40px; }
.webhook-label { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.webhook-url-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.webhook-url { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 15px; color: var(--fg); background: var(--bg); padding: 12px 16px; border-radius: 8px; border: 1px solid var(--border); flex: 1; word-break: break-all; }
.webhook-hint { font-size: 13px; color: var(--fg-muted); line-height: 1.6; }

/* Section header */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-header h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.call-count { font-size: 13px; color: var(--fg-muted); }

/* Call Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.call-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.call-table th { text-align: left; padding: 14px 16px; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--fg-muted); border-bottom: 1px solid var(--border); background: var(--bg-alt); white-space: nowrap; }
.call-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.call-table tr:last-child td { border-bottom: none; }
.call-table tr:hover td { background: rgba(255,255,255,0.02); }
.phone-cell { font-family: 'SF Mono', monospace; font-size: 13px; }
.muted { color: var(--fg-muted); }
.time-cell { font-size: 13px; white-space: nowrap; }
.latency-cell { font-size: 12px; font-family: monospace; }
.msg-cell { max-width: 320px; font-size: 13px; line-height: 1.5; color: var(--fg); }

/* Status badges */
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.status-missed { background: rgba(239,68,68,0.15); color: #f87171; }
.status-replied { background: rgba(16,185,129,0.15); color: #10b981; }
.status-completed { background: rgba(255,255,255,0.05); color: var(--fg-muted); }

/* Empty state */
.empty-state { text-align: center; padding: 64px 32px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-family: var(--font-display); font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--fg-muted); font-size: 15px; max-width: 480px; margin: 0 auto; }

/* Test panel */
.test-panel { margin-top: 48px; padding: 32px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; }
.test-panel h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.test-panel p { color: var(--fg-muted); font-size: 14px; margin-bottom: 20px; }
.test-form { display: flex; gap: 12px; align-items: center; }
.test-form input { flex: 1; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--fg); font-family: 'SF Mono', monospace; font-size: 14px; }
.test-form input:focus { outline: none; border-color: var(--accent); }
.test-result { margin-top: 16px; padding: 16px; border-radius: 8px; font-size: 14px; line-height: 1.7; display: none; }
.test-result.success { display: block; background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #10b981; }
.test-result.error { display: block; background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }

/* Setup page */
.setup-step { display: flex; gap: 20px; padding: 28px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 20px; }
.setup-step .step-num { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--accent); flex-shrink: 0; width: 40px; }
.setup-step .step-content { flex: 1; }
.setup-step .step-content h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.setup-step .step-content p { color: var(--fg-muted); font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.setup-steps-list { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.setup-steps-list li { color: var(--fg-muted); font-size: 14px; line-height: 1.6; }
.setup-steps-list li strong { color: var(--fg); }

.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 40px; }
.setup-card { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 16px; padding: 32px; }
.setup-card h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.setup-card p { color: var(--fg-muted); font-size: 14px; line-height: 1.6; margin-bottom: 24px; }
.env-list { display: flex; flex-direction: column; gap: 12px; }
.env-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); }
.env-key { font-family: 'SF Mono', monospace; font-size: 13px; font-weight: 600; color: var(--accent); }
.env-label { font-size: 14px; color: var(--fg); flex: 1; margin-left: 16px; }
.env-status { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.env-status.set { background: rgba(16,185,129,0.15); color: #10b981; }
.env-status.missing { background: rgba(239,68,68,0.15); color: #f87171; }

/* Mobile overrides */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .dash-header { flex-direction: column; gap: 16px; }
  .setup-grid { grid-template-columns: 1fr; }
  .test-form { flex-direction: column; }
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}