:root {
  --primary: #0062ff;
  --cyan: #00d2ff;
  --bg: #090e17;
  --card-bg: #111927;
  --border: #1e293b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --font-display: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 24px;
}

h2, h3, .brand h2 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  font-weight: 800;
}

.sub, .btn-primary, .btn-outline, .tab-btn, label, th, .status-badge, .btn-icon-wa {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.admin-wrapper { max-width: 1100px; margin: 0 auto; }

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

.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 20px; }
.sub { font-size: 0.8rem; color: var(--cyan); text-transform: uppercase; font-weight: 700; }

.actions { display: flex; gap: 10px; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-outline {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.05); }

.tabs-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
}

.tab-btn.active {
  color: var(--cyan);
  background: rgba(0, 210, 255, 0.1);
}

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

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.card h3 { font-size: 1.2rem; margin-bottom: 4px; }
.card .desc { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 20px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-full { grid-column: span 2; }
.field-half { grid-column: span 1; }
.field-third { grid-column: span 1; }

@media (max-width: 700px) {
  .field-half, .field-third { grid-column: span 2; }
}

label { display: block; font-size: 0.8rem; font-weight: 600; color: #cbd5e1; margin-bottom: 6px; }
input, textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}
input:focus, textarea:focus { border-color: var(--cyan); outline: none; }

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

.table-wrap { overflow-x: auto; }
.leads-table { width: 100%; border-collapse: collapse; text-align: left; }
.leads-table th, .leads-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.leads-table th { color: var(--text-muted); text-transform: uppercase; font-size: 0.75rem; }

.status-badge {
  padding: 3px 8px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.72rem;
}
.status-badge.new { background: rgba(0, 98, 255, 0.2); color: #38bdf8; }
.status-badge.contacted { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.status-badge.converted { background: rgba(34, 197, 94, 0.2); color: #22c55e; }

.btn-icon-wa {
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid rgba(37, 211, 102, 0.3);
  color: #25d366;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ==========================================================================
   ADMIN AUTH GUARD & HEADER PROFILE
   ========================================================================== */
.auth-guard-container {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-guard-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 20px;
  padding: 36px 30px;
  text-align: center;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 98, 255, 0.15);
  overflow: hidden;
}

.auth-guard-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 160px;
  background: radial-gradient(circle, rgba(0, 98, 255, 0.45) 0%, rgba(56, 189, 248, 0.1) 50%, transparent 70%);
  filter: blur(28px);
  pointer-events: none;
}

.auth-guard-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: 9999px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.auth-guard-badge .material-icons {
  font-size: 14px;
}

.auth-guard-logo {
  height: 32px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 10px rgba(0, 98, 255, 0.5));
}

.auth-guard-card h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: #ffffff;
}

.auth-guard-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 20px;
  line-height: 1.5;
}

.auth-guard-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  font-size: 0.82rem;
  color: #cbd5e1;
  margin-bottom: 20px;
  word-break: break-all;
}

.auth-guard-chip .material-icons {
  color: #38bdf8;
  font-size: 18px;
  flex-shrink: 0;
}

.btn-google-signin {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  color: #1e293b;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px 20px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-google-signin:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn-google-signin:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.google-icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.admin-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #cbd5e1;
  border-top-color: #0062ff;
  border-radius: 50%;
  animation: adminSpin 0.7s linear infinite;
}

@keyframes adminSpin {
  to { transform: rotate(360deg); }
}

.admin-feedback-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  line-height: 1.45;
}

.admin-feedback-box.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.admin-feedback-box.error .material-icons {
  color: #ef4444;
  font-size: 20px;
  flex-shrink: 0;
}

.admin-feedback-box.error code {
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  color: #ffffff;
  font-family: monospace;
}

.admin-feedback-box.success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.admin-feedback-box.success .material-icons {
  color: #22c55e;
  font-size: 20px;
  flex-shrink: 0;
}

.auth-guard-actions {
  margin-top: 20px;
}

.btn-return-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.btn-return-home:hover {
  color: #cbd5e1;
}

.btn-return-home .material-icons {
  font-size: 16px;
}

/* Admin Header User Profile Pill */
.admin-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 9999px;
}

.header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #38bdf8;
  background: #0b1329;
}

.header-admin-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.header-admin-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f8fafc;
}

.header-admin-email {
  font-size: 0.7rem;
  color: #94a3b8;
  font-family: monospace;
}

.btn-signout {
  padding: 10px 12px;
  color: #94a3b8;
}

.btn-signout:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
}


