/* CallShield Dashboard Styles */

:root {
  --navy: #0B1628;
  --deep: #121E33;
  --slate: #1A2A45;
  --warm: #E8926A;
  --warm-light: #F0A882;
  --ice: #C4D4E8;
  --ghost: #8A9BB5;
  --white: #F4F6FA;
  --danger: #E05252;
  --success: #52C07A;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--navy);
  color: var(--white);
  line-height: 1.6;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

a { color: var(--warm); text-decoration: none; }
a:hover { color: var(--warm-light); }

/* ── Layout ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--deep);
  border-right: 1px solid var(--slate);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  padding: 40px 48px;
  overflow-y: auto;
}

/* ── Sidebar ── */
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--warm);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.nav-links { display: flex; flex-direction: column; gap: 8px; }
.nav-link {
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--ghost);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link:hover, .nav-link.active {
  background: var(--slate);
  color: var(--white);
}
.nav-link.active { color: var(--warm); }

.sidebar-user {
  margin-top: auto;
  border-top: 1px solid var(--slate);
  padding-top: 24px;
  font-size: 13px;
}
.sidebar-user .user-name { color: var(--white); font-weight: 500; }
.sidebar-user .user-email { color: var(--ghost); font-size: 12px; }

/* ── Header ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}
.page-header h1 { font-size: 28px; font-weight: 700; }
.page-header p { color: var(--ice); margin-top: 4px; font-size: 15px; }

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--deep);
  border: 1px solid var(--slate);
  border-radius: 16px;
  padding: 24px;
}
.stat-card .label {
  font-size: 13px;
  color: var(--ghost);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.stat-card .value {
  font-size: 36px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}
.stat-card.blocked .value { color: var(--danger); }
.stat-card.flagged .value { color: var(--warm); }
.stat-card.contacts .value { color: var(--success); }

/* ── Section ── */
.section {
  background: var(--deep);
  border: 1px solid var(--slate);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 28px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.section-header h2 { font-size: 18px; font-weight: 600; }

/* ── Setup Guide Panel ── */
.setup-guide-panel { border-color: var(--warm); }
.setup-guide-steps { list-style: none; counter-reset: setupstep; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.setup-guide-steps li { counter-increment: setupstep; padding: 12px 14px; background: var(--slate); border-radius: 10px; font-size: 14px; line-height: 1.55; }
.setup-guide-steps li strong { display: block; font-family: 'Space Grotesk', sans-serif; color: var(--white); margin-bottom: 4px; }
.setup-guide-steps li code { font-family: monospace; color: var(--ice); }
.setup-guide-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end; }

/* ── Calls Table ── */
.calls-table { width: 100%; border-collapse: collapse; }
.calls-table th {
  text-align: left;
  font-size: 12px;
  color: var(--ghost);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 12px 12px 0;
  border-bottom: 1px solid var(--slate);
}
.calls-table td {
  padding: 14px 12px 14px 0;
  border-bottom: 1px solid rgba(26, 42, 69, 0.6);
  font-size: 14px;
}
.calls-table tr:last-child td { border-bottom: none; }

.call-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.call-type-badge.blocked { background: rgba(224, 82, 82, 0.15); color: var(--danger); }
.call-type-badge.flagged { background: rgba(232, 146, 106, 0.15); color: var(--warm); }

.caller-name { font-weight: 500; color: var(--white); }
.phone-number { color: var(--ghost); font-size: 13px; font-family: monospace; }
.call-time { color: var(--ghost); font-size: 13px; }

/* ── Contacts ── */
.contacts-list { display: flex; flex-direction: column; gap: 12px; }

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--slate);
  border-radius: 12px;
}
.contact-info { display: flex; align-items: center; gap: 14px; }
.contact-avatar {
  width: 40px;
  height: 40px;
  background: var(--warm);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--navy);
}
.contact-name { font-weight: 500; }
.contact-phone { color: var(--ghost); font-size: 13px; font-family: monospace; }
.contact-remove {
  background: none;
  border: none;
  color: var(--ghost);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.contact-remove:hover { background: var(--deep); color: var(--danger); }

/* ── Add Contact Form ── */
.add-contact-form {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.add-contact-form input {
  flex: 1;
  background: var(--slate);
  border: 1px solid rgba(132, 155, 181, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--white);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.add-contact-form input:focus {
  border-color: var(--warm);
}
.add-contact-form input::placeholder { color: var(--ghost); }

/* ── Contact Tags / Filter ── */
.contact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.contact-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--slate);
  color: var(--ghost);
  font-size: 13px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s;
}
.contact-tag:hover { color: var(--white); }
.contact-tag.active {
  background: rgba(232, 146, 106, 0.15);
  color: var(--warm);
  border-color: var(--warm);
}
.contact-group-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(132, 155, 181, 0.15);
  color: var(--ghost);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.contact-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  text-decoration: none;
  color: inherit;
}
.contact-card-link:hover .contact-name { color: var(--warm); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--warm); color: var(--navy); }
.btn-primary:hover { background: var(--warm-light); }

.btn-secondary {
  background: var(--slate);
  color: var(--ice);
  border: 1px solid rgba(132, 155, 181, 0.2);
}
.btn-secondary:hover { background: #243558; color: var(--white); }

.btn-danger { background: rgba(224, 82, 82, 0.15); color: var(--danger); }
.btn-danger:hover { background: rgba(224, 82, 82, 0.25); }

.btn-sm { padding: 6px 14px; font-size: 13px; }

button[type="submit"] { font-family: 'DM Sans', sans-serif; }

/* ── Auth Pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--deep);
  border: 1px solid var(--slate);
  border-radius: 20px;
  padding: 40px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo .logo-icon {
  width: 48px;
  height: 48px;
  background: var(--warm);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 12px;
}
.auth-logo h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
}
.auth-logo p { color: var(--ghost); font-size: 14px; margin-top: 4px; }

.auth-error {
  background: rgba(224, 82, 82, 0.1);
  border: 1px solid rgba(224, 82, 82, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--danger);
  font-size: 14px;
  margin-bottom: 20px;
}

.auth-discount {
  background: rgba(82, 192, 122, 0.1);
  border: 1px solid rgba(82, 192, 122, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--success);
  font-size: 14px;
  margin-bottom: 20px;
  text-align: center;
}

.auth-notice {
  background: rgba(82, 192, 122, 0.1);
  border: 1px solid rgba(82, 192, 122, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--success);
  font-size: 14px;
  margin-bottom: 20px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--ice);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group input {
  width: 100%;
  background: var(--slate);
  border: 1px solid rgba(132, 155, 181, 0.2);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--white);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus { border-color: var(--warm); }
.form-group input::placeholder { color: var(--ghost); }

.auth-card .btn { width: 100%; justify-content: center; margin-top: 8px; }

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--ghost);
}

/* ── Logout ── */
.logout-form { display: flex; align-items: center; gap: 8px; }
.logout-btn {
  background: none;
  border: none;
  color: var(--ghost);
  cursor: pointer;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.logout-btn:hover { background: var(--slate); color: var(--danger); }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--ghost);
}
.empty-state h3 { color: var(--ice); margin-bottom: 8px; }

/* ── Onboarding Wizard ── */
.wizard-card {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.wizard-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--slate);
  color: var(--ghost);
  border: 1px solid transparent;
}
.step-indicator.active {
  background: rgba(232, 146, 106, 0.15);
  color: var(--warm);
  border-color: rgba(232, 146, 106, 0.3);
}
.step-indicator.done {
  background: rgba(82, 192, 122, 0.1);
  color: var(--success);
}

.step-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ghost);
  color: var(--navy);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.step-indicator.active .step-dot { background: var(--warm); }
.step-indicator.done .step-dot { background: var(--success); }

.step-label { display: none; }
@media (min-width: 480px) { .step-label { display: inline; } }

.wizard-step-title {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--ice);
  margin-bottom: 20px;
}

.carrier-option {
  text-align: center;
  padding: 32px 24px;
  background: var(--slate);
  border-radius: 12px;
  border: 1px solid rgba(132, 155, 181, 0.15);
}
.carrier-logo { font-size: 40px; margin-bottom: 12px; }
.carrier-name { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.carrier-option p { color: var(--ghost); font-size: 14px; margin-bottom: 20px; }

.invite-card { text-align: center; padding: 24px 0; }
.invite-card p { color: var(--ghost); font-size: 14px; margin-bottom: 20px; }
.invite-placeholder {
  padding: 16px;
  background: var(--slate);
  border-radius: 8px;
  color: var(--ghost);
  font-size: 13px;
  font-style: italic;
}

.confirmation-card {
  text-align: center;
  padding: 32px 24px;
  background: rgba(82, 192, 122, 0.08);
  border: 1px solid rgba(82, 192, 122, 0.2);
  border-radius: 16px;
}
.confirm-icon { font-size: 48px; margin-bottom: 16px; }
.confirmation-card h2 { font-size: 22px; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.confirmation-card p { color: var(--ice); font-size: 15px; margin-bottom: 24px; }
.confirmation-card .btn { display: inline-flex; }

/* ── Live Protection panel ── */
.live-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.live-card {
  background: var(--slate);
  border: 1px solid rgba(132, 155, 181, 0.18);
  border-radius: 12px;
  padding: 14px 16px;
}
.live-card .live-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ghost);
  margin-bottom: 4px;
}
.live-card .live-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--white);
}
.live-card .live-empty {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: var(--ghost);
}
.live-state-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(232, 146, 106, 0.12);
  border: 1px solid rgba(232, 146, 106, 0.35);
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--warm-light);
}
.live-state-banner code {
  background: rgba(0,0,0,0.25);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ice);
}
.live-state-detail { color: var(--ghost); font-size: 13px; }
.live-state-pulse {
  width: 10px; height: 10px;
  background: var(--warm);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(232, 146, 106, 0.6);
  animation: live-pulse 1.6s infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(232, 146, 106, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(232, 146, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 146, 106, 0); }
}
@media (max-width: 768px) {
  .live-grid { grid-template-columns: 1fr; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 16px; gap: 16px; }
  .main-content { padding: 24px 20px; }
  .stats-grid { grid-template-columns: 1fr; }
  .add-contact-form { flex-direction: column; }
}