/* ===== DASHBOARD SHELL ===== */
.dash-body {
  background: var(--bg);
  min-height: 100vh;
}

.dash-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex;
  align-items: center;
}

.dash-nav-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}

.dash-logo .logo-accent {
  color: var(--accent);
}

.dash-nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

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

.nav-link.nav-active {
  color: var(--accent);
  background: var(--accent-glow);
}

.dash-main {
  padding: 32px 24px 80px;
}

.dash-page {
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== ANALYTICS STRIP ===== */
.analytics-strip {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 32px;
  overflow: hidden;
}

.analytics-card {
  flex: 1;
  padding: 20px 28px;
  text-align: center;
}

.analytics-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 6px;
}

.analytics-value.accent { color: var(--accent); }
.analytics-value.hot { color: #fb923c; }

.analytics-label {
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.analytics-divider {
  width: 1px;
  height: 52px;
  background: var(--border);
  flex-shrink: 0;
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-sub {
  color: var(--fg-muted);
  font-size: 0.88rem;
}

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

/* ===== FILTER TABS ===== */
.filter-tabs {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.filter-tab {
  padding: 6px 14px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-tab.active {
  background: var(--bg-card);
  color: var(--fg);
}

.filter-tab:hover:not(.active) {
  color: var(--fg);
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: var(--accent);
  color: #0a0a0f;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

.btn-ghost {
  padding: 9px 20px;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

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

/* ===== LEADS TABLE ===== */
.leads-table-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.leads-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

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

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

.lead-row {
  cursor: pointer;
}

.lead-row:hover {
  background: rgba(255,255,255,0.025);
}

.leads-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  vertical-align: middle;
}

.lead-name {
  font-weight: 500;
  color: var(--fg);
}

.lead-contact {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.text-muted { color: var(--fg-muted); }
.text-sm { font-size: 0.82rem; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-display);
  white-space: nowrap;
}

.badge-hot {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.25);
}

.badge-warm {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-soft);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-cold {
  background: rgba(96, 165, 250, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.18);
}

.badge-xs { padding: 2px 7px; font-size: 0.72rem; }

.appt-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.link-arrow {
  color: var(--fg-muted);
  font-size: 1.1rem;
  text-decoration: none;
  transition: color 0.15s;
}

.link-arrow:hover { color: var(--accent); }

.empty-state {
  padding: 60px 32px;
  text-align: center;
  color: var(--fg-muted);
}

.empty-state-sm {
  padding: 32px;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s;
}

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

.modal-form {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-muted);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: rgba(245, 158, 11, 0.4);
}

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

/* ===== LEAD DETAIL ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--fg-muted);
  margin-bottom: 24px;
}

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

.breadcrumb-sep { color: var(--border); }

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

.detail-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.detail-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.detail-contact-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.contact-chip:hover { color: var(--fg); border-color: rgba(255,255,255,0.15); }

.status-control select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  outline: none;
}

.qualification-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.qual-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.qual-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.qual-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg);
}

.notes-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.notes-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.notes-body {
  color: var(--fg-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Appointment list in detail */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.appt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.appt-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.appt-time {
  min-width: 140px;
}

.appt-date {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--fg);
}

.appt-clock {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 2px;
}

.appt-details {
  flex: 1;
}

.appt-notes {
  font-size: 0.88rem;
  color: var(--fg-muted);
}

.appt-status-badge {
  flex-shrink: 0;
}

/* Sidebar */
.sidebar-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--fg-muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  font-family: var(--font-body);
  text-align: left;
}

.action-btn:hover {
  color: var(--fg);
  border-color: rgba(255,255,255,0.12);
  background: var(--bg-elevated);
}

.action-icon { font-size: 1rem; }

.score-display {
  display: flex;
  justify-content: center;
}

.score-circle {
  display: flex;
  align-items: baseline;
  gap: 4px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.score-circle.score-high { border-color: #4ade80; }
.score-circle.score-mid  { border-color: var(--accent); }
.score-circle.score-low  { border-color: #f87171; }

.score-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
}

.score-circle.score-high .score-num { color: #4ade80; }
.score-circle.score-mid  .score-num { color: var(--accent); }
.score-circle.score-low  .score-num { color: #f87171; }

.score-label {
  font-size: 0.72rem;
  color: var(--fg-muted);
}

/* ===== CALENDAR ===== */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cal-nav-btn {
  padding: 7px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg-muted);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.15s;
}

.cal-nav-btn:hover { color: var(--fg); }

.cal-month-label {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  min-width: 160px;
  text-align: center;
}

.cal-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-day-header {
  padding: 12px 8px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.cal-cell {
  min-height: 100px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.cal-cell:nth-child(7n) { border-right: none; }

.cal-cell-empty { background: rgba(0,0,0,0.15); }

.cal-today {
  background: rgba(245, 158, 11, 0.05);
}

.cal-today .cal-day-num {
  background: var(--accent);
  color: #0a0a0f;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.cal-day-num {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

.cal-appt {
  display: block;
  background: var(--accent-glow);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 5px;
  padding: 3px 6px;
  margin-bottom: 3px;
  text-decoration: none;
  font-size: 0.72rem;
  line-height: 1.4;
  overflow: hidden;
}

.cal-appt-scheduled { background: var(--accent-glow); border-color: rgba(245,158,11,0.2); }
.cal-appt-completed { background: rgba(74, 222, 128, 0.1); border-color: rgba(74,222,128,0.2); }
.cal-appt-cancelled,
.cal-appt-no_show  { background: rgba(248, 113, 113, 0.1); border-color: rgba(248,113,113,0.2); opacity: 0.7; }

.cal-appt-time {
  display: block;
  color: var(--accent);
  font-weight: 600;
}

.cal-appt-name {
  display: block;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Upcoming list */
.upcoming-section { margin-top: 8px; }

.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.upcoming-item {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-decoration: none;
  transition: border-color 0.15s;
}

.upcoming-item:hover { border-color: rgba(245, 158, 11, 0.25); }

.upcoming-date-block {
  text-align: center;
  min-width: 52px;
  background: var(--bg-card);
  border-radius: 10px;
  padding: 8px 12px;
}

.upcoming-day {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.upcoming-date-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-top: 2px;
}

.upcoming-details {
  flex: 1;
}

.upcoming-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
  margin-bottom: 4px;
}

.upcoming-meta {
  font-size: 0.82rem;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.upcoming-notes {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-top: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .detail-sidebar .detail-card {
    flex: 1;
    min-width: 200px;
  }

  .qualification-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .analytics-strip {
    flex-wrap: wrap;
  }

  .analytics-divider {
    display: none;
  }

  .analytics-card {
    min-width: 50%;
    border-bottom: 1px solid var(--border);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .cal-grid {
    font-size: 0.75rem;
  }

  .cal-cell {
    min-height: 70px;
    padding: 4px;
  }

  .cal-appt-name { display: none; }
}
