/* === CIVARO ADMIN — PREMIUM DARK STYLE === */

:root {
  --bg: #0f0e0c;
  --surface: #1a1814;
  --surface-raised: #221f1a;
  --surface-hover: #2a2620;
  --accent: #c9a84c;
  --accent-dark: #a8863a;
  --accent-hover: #b8943f;
  --accent-dim: rgba(201,168,76,0.08);
  --accent-dim2: rgba(201,168,76,0.15);
  --text: #f5f0e8;
  --text-secondary: #a8a090;
  --text-muted: #6a6258;
  --border: rgba(201,168,76,0.12);
  --border-strong: rgba(201,168,76,0.30);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-gold: 0 4px 24px rgba(201,168,76,0.20);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; line-height: 1.15; letter-spacing: -0.02em; }

a { text-decoration: none; color: inherit; }

/* === TOPBAR === */
.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.topbar-brand img {
  height: 34px;
  width: 34px;
  object-fit: contain;
}

.topbar-brand-name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.topbar-brand-sub {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0 1.25rem;
}

.topbar-section-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.topbar-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.topbar-link:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.topbar-link.active {
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border);
}

/* === PAGE LAYOUT === */
.admin-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}

.page-header {
  margin-bottom: 2.5rem;
}

.page-eyebrow {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.20em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.page-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.page-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === STAT STRIP === */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* === ERROR BANNER === */
.error-banner {
  background: rgba(192,57,43,0.12);
  border: 1px solid rgba(192,57,43,0.30);
  color: #e06050;
  padding: 0.875rem 1.25rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

/* === LEADS TABLE === */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.table-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-title-icon {
  width: 28px;
  height: 28px;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--accent);
}

.table-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
}

.leads-table thead tr {
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
}

.leads-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 0.875rem 1.75rem;
}

.leads-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.leads-table tbody tr:last-child { border-bottom: none; }

.leads-table tbody tr:hover {
  background: var(--surface-raised);
}

.leads-table td {
  padding: 1.1rem 1.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

.lead-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.92rem;
}

.lead-email {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: block;
}

.lead-phone {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-dim);
  border: 1px solid rgba(201,168,76,0.18);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
}

.service-badge-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.lead-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.lead-date-main {
  display: block;
  color: var(--text-secondary);
}

.lead-date-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon {
  width: 60px;
  height: 60px;
  background: var(--accent-dim);
  border: 2px dashed var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.5rem;
  color: var(--accent);
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 360px;
  margin: 0 auto;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .admin-topbar { padding: 0.85rem 1.25rem; }
  .topbar-divider { display: none; }
  .topbar-section-label { display: none; }
  .admin-page { padding: 1.75rem 1rem 4rem; }
  .leads-table th,
  .leads-table td { padding: 0.9rem 1rem; }
  .lead-phone, .lead-email { display: none; }
  .page-title { font-size: 1.75rem; }
}

@media (max-width: 480px) {
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .table-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}