/* Admin Dashboard Styles — matches LeadPulse landing page theme */
:root {
  --navy: #0f1f38;
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --warm-bg: #fafaf8;
  --warm-mid: #f3f1ed;
  --text-primary: #0f1f38;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --border: #e5e2dc;
  --green: #059669;
  --red: #dc2626;
}

body { font-family: 'DM Sans', system-ui, sans-serif; background: var(--warm-bg); color: var(--text-primary); margin: 0; }

.admin-nav {
  background: var(--navy);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 56px;
}
.admin-nav-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-nav-brand .brand-mark { color: var(--amber); }
.admin-nav-links { display: flex; gap: 0.25rem; }
.admin-nav-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s;
}
.admin-nav-links a:hover, .admin-nav-links a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.admin-nav-links a.active { color: var(--amber); }

.admin-main { max-width: 1100px; margin: 0 auto; padding: 2rem; }
.admin-header { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 2rem; }
.admin-header h1 { font-family: 'Playfair Display', serif; font-size: 2rem; margin: 0; }
.admin-sub { color: var(--text-muted); font-size: 0.875rem; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 1.25rem; }
.stat-card.featured { border-color: var(--amber); }
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.5rem; }
.stat-value { font-size: 2rem; font-weight: 700; font-family: 'Playfair Display', serif; }
.stat-value.amber { color: var(--amber); }

.dashboard-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
.dash-section { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 1.5rem; }
.dash-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.dash-section-header h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.dash-link { color: var(--amber); font-size: 0.875rem; text-decoration: none; }
.dash-link:hover { text-decoration: underline; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 2px solid var(--border); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.admin-table td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--border); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--warm-bg); }
.admin-table tr { transition: background 0.15s; }

.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 3px; font-size: 0.75rem; font-weight: 600; text-transform: capitalize; }
.badge-chat { background: #dbeafe; color: #1e40af; }
.badge-missed_call { background: #fef3c7; color: #92400e; }
.badge-manual { background: #f3f4f6; color: #374151; }
.badge-status.status-new { background: #dbeafe; color: #1e40af; }
.badge-status.status-qualified { background: #fef3c7; color: #92400e; }
.badge-status.status-booked { background: #d1fae5; color: #065f46; }
.badge-status.status-lost { background: #fee2e2; color: #991b1b; }

.urgency { padding: 0.15rem 0.4rem; border-radius: 3px; font-size: 0.75rem; font-weight: 500; }
.urgency-high { background: #fee2e2; color: #991b1b; }
.urgency-medium { background: #fef3c7; color: #92400e; }
.urgency-low { background: #d1fae5; color: #065f46; }

.callback-list { display: flex; flex-direction: column; gap: 0.75rem; }
.callback-item { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem; background: var(--warm-bg); border-radius: 4px; }
.callback-info { display: flex; flex-direction: column; gap: 0.25rem; }
.callback-info strong { font-size: 0.875rem; }
.callback-time { font-size: 0.75rem; color: var(--text-muted); }
.btn-send-text { background: var(--navy); color: var(--amber); border: none; border-radius: 4px; padding: 0.4rem 0.75rem; font-size: 0.8125rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-send-text:hover { background: #1a3352; }

.embed-section { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 1.5rem; }
.embed-section h2 { font-size: 1rem; font-weight: 600; margin: 0 0 0.75rem; }
.embed-section p { color: var(--text-secondary); font-size: 0.875rem; margin: 0 0 0.75rem; }
.code-block { background: #1e293b; color: #e2e8f0; padding: 1rem; border-radius: 4px; font-size: 0.8125rem; overflow-x: auto; margin: 0; }

.empty-state { color: var(--text-muted); font-size: 0.875rem; padding: 2rem; text-align: center; background: #fff; border: 1px solid var(--border); border-radius: 6px; }

/* Leads page */
.filter-bar { display: flex; gap: 0.5rem; }
.filter-btn { padding: 0.4rem 0.75rem; border: 1px solid var(--border); border-radius: 4px; color: var(--text-secondary); text-decoration: none; font-size: 0.875rem; }
.filter-btn:hover { background: var(--warm-mid); }
.filter-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Lead detail */
.lead-detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.lead-detail-header h1 { font-family: 'Playfair Display', serif; font-size: 1.75rem; margin: 0; }
.lead-id { font-size: 0.875rem; color: var(--text-muted); font-family: 'DM Sans', sans-serif; font-weight: 400; }
.lead-meta { display: flex; gap: 0.5rem; align-items: center; margin: 0.5rem 0 0; }
.lead-actions { display: flex; gap: 0.75rem; align-items: center; }
.status-select { padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 4px; font-size: 0.875rem; font-family: inherit; cursor: pointer; }
.btn-primary { background: var(--amber); color: var(--navy); border: none; border-radius: 4px; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-primary:hover { background: var(--amber-light); }
.btn-back { background: none; border: 1px solid var(--border); border-radius: 4px; padding: 0.5rem 1rem; font-size: 0.875rem; cursor: pointer; font-family: inherit; color: var(--text-secondary); }

.lead-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.lead-info-card { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 1.25rem; }
.lead-info-card h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin: 0 0 0.75rem; }
.info-row { display: flex; justify-content: space-between; font-size: 0.875rem; padding: 0.3rem 0; }
.info-row span:first-child { color: var(--text-muted); }

.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1rem; }
.tab { background: none; border: none; padding: 0.75rem 1.25rem; font-size: 0.875rem; font-weight: 500; color: var(--text-muted); cursor: pointer; font-family: inherit; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.active { color: var(--navy); border-bottom-color: var(--amber); }

.timeline { display: flex; flex-direction: column; gap: 0.75rem; }
.timeline-item { display: flex; flex-direction: column; gap: 0.25rem; }
.timeline-meta { display: flex; gap: 0.5rem; align-items: center; }
.timeline-channel { font-size: 0.7rem; text-transform: uppercase; padding: 0.1rem 0.4rem; border-radius: 2px; font-weight: 600; }
.timeline-channel.chat { background: #dbeafe; color: #1e40af; }
.timeline-channel.sms { background: #d1fae5; color: #065f46; }
.timeline-channel.voice { background: #fef3c7; color: #92400e; }
.timeline-time { font-size: 0.75rem; color: var(--text-muted); }
.timeline-body { padding: 0.75rem 1rem; border-radius: 6px; font-size: 0.875rem; }
.timeline-body.inbound { background: #fff; border: 1px solid var(--border); }
.timeline-body.outbound { background: var(--navy); color: #fff; }
.timeline-body.system { background: var(--warm-mid); color: var(--text-secondary); }

.sms-list { display: flex; flex-direction: column; gap: 0.75rem; }
.sms-item { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 1rem; }
.sms-item.outbound { border-left: 3px solid var(--navy); }
.sms-item.inbound { border-left: 3px solid var(--amber); }
.sms-meta { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.5rem; font-size: 0.8125rem; }
.sms-body { font-size: 0.9375rem; }
.sms-status { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; }

/* Settings */
.settings-sections { display: flex; flex-direction: column; gap: 1.5rem; }
.settings-card { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 1.5rem; }
.settings-card h3 { font-size: 1rem; font-weight: 600; margin: 0 0 0.5rem; }
.settings-card p { color: var(--text-secondary); font-size: 0.875rem; margin: 0 0 0.75rem; }
.env-var { background: var(--warm-bg); border: 1px solid var(--border); border-radius: 4px; padding: 0.4rem 0.75rem; margin-bottom: 0.5rem; }
.env-var code { font-size: 0.8125rem; color: var(--navy); }
.setting-note { font-size: 0.8125rem; color: var(--text-muted); font-style: italic; }

.text-muted { color: var(--text-muted); }