/* ── DASHBOARD LAYOUT ── */
.dash-wrap {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ── SIDEBAR ── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-subtle);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo .wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--fg) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}

.sidebar-logo .tagline {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 4px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  font-family: 'Space Grotesk', sans-serif;
  padding: 0 8px;
  margin: 16px 0 6px;
}

.nav-section-label:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--fg-muted);
  transition: background 0.15s, color 0.15s;
  user-select: none;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--fg);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-item .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--warning);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  padding: 2px 6px;
  border-radius: 100px;
  min-width: 18px;
  text-align: center;
}

.nav-item .nav-badge.accent {
  background: var(--accent);
  color: var(--bg);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.sidebar-footer a {
  color: var(--accent);
  text-decoration: none;
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: 240px;
  flex: 1;
  padding: 32px 36px;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
}

.page-subtitle {
  font-size: 0.88rem;
  color: var(--fg-muted);
  margin-top: 4px;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--fg);
  border: 1px solid rgba(255,255,255,0.08);
}

.btn-secondary:hover { background: rgba(255,255,255,0.09); }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid rgba(255,255,255,0.08);
}

.btn-ghost:hover { color: var(--fg); background: rgba(255,255,255,0.04); }

.btn-danger {
  background: rgba(255, 107, 74, 0.12);
  color: var(--warning);
  border: 1px solid rgba(255, 107, 74, 0.2);
}

.btn-danger:hover { background: rgba(255, 107, 74, 0.2); }

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
}

/* ── STAT CARDS ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.stat-card.warning::after {
  background: radial-gradient(circle, rgba(255,107,74,0.15) 0%, transparent 70%);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 10px;
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.stat-card.warning .stat-value { color: var(--warning); }

.stat-meta {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-top: 8px;
}

/* ── SECTION LAYOUT ── */
.section {
  display: none;
}

.section.active {
  display: block;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.panel-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
}

.panel-body {
  padding: 0;
}

/* ── TABLES ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 10px 20px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: var(--bg-subtle);
}

.data-table td {
  padding: 14px 20px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.data-table tr.clickable { cursor: pointer; }

/* ── BADGES / STATUS PILLS ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-new { background: var(--accent-dim); color: var(--accent); }
.badge-contacted { background: rgba(100,160,255,0.12); color: #6ab0ff; }
.badge-booked { background: rgba(100,220,100,0.12); color: #6adc6a; }
.badge-missed { background: rgba(255,107,74,0.12); color: var(--warning); }
.badge-answered { background: var(--accent-dim); color: var(--accent); }
.badge-urgent { background: rgba(255,107,74,0.15); color: var(--warning); border: 1px solid rgba(255,107,74,0.3); }
.badge-normal { background: rgba(255,255,255,0.06); color: var(--fg-muted); }
.badge-scheduled { background: rgba(100,160,255,0.12); color: #6ab0ff; }
.badge-completed { background: rgba(100,220,100,0.12); color: #6adc6a; }
.badge-cancelled { background: rgba(255,107,74,0.12); color: var(--warning); }
.badge-emergency { background: rgba(255,60,60,0.15); color: #ff4444; border: 1px solid rgba(255,60,60,0.3); }
.badge-closed { background: rgba(255,255,255,0.06); color: var(--fg-muted); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--fg-muted);
}

.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; max-width: 280px; margin: 0 auto; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(10px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  margin-top: -2px;
}

.modal-close:hover { color: var(--fg); }

.modal-body {
  padding: 24px 28px 28px;
}

/* ── FORMS ── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 6px;
  font-family: 'Space Grotesk', sans-serif;
}

.form-group label .req { color: var(--warning); margin-left: 3px; }

.form-control {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: rgba(0, 212, 170, 0.4);
}

.form-control::placeholder { color: var(--fg-muted); }

select.form-control option { background: var(--bg-card); }

textarea.form-control { resize: vertical; min-height: 80px; }

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

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── CALL LOG ITEMS ── */
.call-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.12s;
}

.call-item:last-child { border-bottom: none; }
.call-item:hover { background: rgba(255,255,255,0.02); }

.call-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.call-icon.missed { background: rgba(255,107,74,0.12); }
.call-icon.answered { background: var(--accent-dim); }

.call-details { flex: 1; min-width: 0; }
.call-name { font-size: 0.9rem; font-weight: 500; }
.call-phone { font-size: 0.78rem; color: var(--fg-muted); }
.call-time { font-size: 0.78rem; color: var(--fg-muted); text-align: right; flex-shrink: 0; }

/* ── CALENDAR VIEW ── */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  min-width: 180px;
  text-align: center;
}

.calendar-grid {
  padding: 0 8px 8px;
}

.cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 12px 8px 4px;
}

.cal-dow {
  text-align: center;
  font-size: 0.72rem;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 0;
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0 8px;
}

.cal-day {
  min-height: 80px;
  background: var(--bg-subtle);
  border-radius: 6px;
  padding: 6px;
  cursor: default;
  transition: background 0.12s;
  border: 1px solid transparent;
}

.cal-day:hover { background: rgba(255,255,255,0.04); }

.cal-day.other-month { opacity: 0.35; }

.cal-day.today {
  border-color: rgba(0, 212, 170, 0.3);
  background: var(--accent-dim);
}

.cal-day-num {
  font-size: 0.78rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 4px;
}

.cal-day.today .cal-day-num { color: var(--accent); }

.cal-appt {
  background: rgba(0,212,170,0.15);
  border-left: 2px solid var(--accent);
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 0.68rem;
  color: var(--accent);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.cal-appt:hover { background: rgba(0,212,170,0.25); }

/* ── LEAD QUALIFY FORM STEPPER ── */
.stepper {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
}

.step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: calc(50% + 14px);
  top: 14px;
  right: calc(-50% + 14px);
  height: 1px;
  background: rgba(255,255,255,0.1);
}

.step.done::after { background: var(--accent); }

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--fg-muted);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.step.active .step-num {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.step.done .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.step-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-family: 'Space Grotesk', sans-serif;
}

.step.active .step-label { color: var(--accent); }
.step.done .step-label { color: var(--fg); }

/* ── TOAST ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.88rem;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.25s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.toast.success { border-color: rgba(0,212,170,0.3); }
.toast.error { border-color: rgba(255,107,74,0.3); }
.toast-icon { font-size: 1rem; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── DETAIL DRAWER ── */
.detail-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
}

.detail-item label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 4px;
}

.detail-item .val {
  font-size: 0.92rem;
  font-weight: 500;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar { width: 200px; }
  .main-content { margin-left: 200px; padding: 20px 20px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 660px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
