/* ===== LAYOUT ===== */
.dash-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.dash-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--fg);
  padding: 0 24px 28px;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

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

.sidebar-link:hover {
  background: var(--bg-elevated);
  color: var(--fg);
}

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

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

.sidebar-footer {
  margin-top: auto;
  padding: 20px 24px 0;
  border-top: 1px solid var(--border);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #86efac;
  border-radius: 50%;
  animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(134,239,172,0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 4px rgba(134,239,172,0); }
}

/* ===== MAIN ===== */
.dash-main {
  padding: 0 0 60px;
  overflow-y: auto;
}

.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 36px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 2px;
}

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

.demo-indicator {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-glow);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
}

/* ===== KPI GRID ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.kpi-card {
  padding: 28px 28px;
  border-right: 1px solid var(--border);
}

.kpi-card:last-child {
  border-right: none;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--fg);
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  line-height: 1;
}

.kpi-revenue .kpi-value {
  color: var(--accent);
}

.kpi-speed .kpi-value {
  color: #86efac;
}

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

/* ===== LOWER GRID ===== */
.dash-lower {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

/* ===== PANELS ===== */
.activity-panel, .leads-panel {
  padding: 28px 36px;
}

.activity-panel {
  border-right: 1px solid var(--border);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #86efac;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: #86efac;
  border-radius: 50%;
  animation: pulse-green 2s ease-in-out infinite;
}

.btn-panel-action {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.btn-panel-action:hover {
  color: var(--accent-bright);
}

/* ===== ACTIVITY LIST ===== */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}

.activity-business {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--fg);
}

.activity-time {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.activity-outcome {
  font-size: 0.82rem;
  color: var(--fg-muted);
  line-height: 1.4;
}

.activity-booked .activity-outcome {
  color: #86efac;
}

.activity-revenue .activity-outcome,
.activity-new_lead .activity-outcome {
  color: var(--accent);
}

/* ===== LEADS TABLE ===== */
.leads-empty {
  text-align: center;
  padding: 40px 0;
}

.leads-empty p {
  color: var(--fg-muted);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.leads-table {
  display: flex;
  flex-direction: column;
}

.leads-table-head {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
  gap: 8px;
  padding: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.leads-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.leads-row:last-child {
  border-bottom: none;
}

.lead-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lead-biz {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--fg);
}

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

.lead-industry {
  font-size: 0.82rem;
  color: var(--fg-muted);
  text-transform: capitalize;
}

.lead-revenue {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
}

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

/* ===== CHART PANEL ===== */
.chart-panel {
  padding: 28px 36px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 180px;
  margin-top: 20px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}

.bar-fill {
  width: 100%;
  background: linear-gradient(to top, var(--accent), rgba(245,166,35,0.4));
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: height 0.6s ease;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.bar-val {
  position: absolute;
  top: -22px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fg-muted);
  white-space: nowrap;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi-card:nth-child(2) {
    border-right: none;
  }
  .kpi-card:nth-child(1), .kpi-card:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 768px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }
  .dash-sidebar {
    display: none;
  }
  .dash-lower {
    grid-template-columns: 1fr;
  }
  .activity-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}
