/* ============================================================
   Dashboard — Refined Glass Design
   ============================================================ */

/* ---------- Refresh Button ---------- */
.dash-refresh-btn {
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.dash-refresh-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 12px rgba(215, 25, 32, 0.14);
}
.dash-refresh-btn:active i {
  animation: spin 0.6s ease;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- KPI Cards (Enhanced overview-card) ---------- */
.overview-card {
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  border: 1px solid var(--border, #E1E5EF);
  background: var(--bg-card, #fff);
  box-shadow: 0 1px 4px rgba(22, 34, 56, 0.03);
  transition: all 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.overview-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb, 215, 25, 32), 0.15), transparent);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.overview-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(22, 34, 56, 0.08);
  border-color: rgba(var(--primary-rgb, 215, 25, 32), 0.18);
}

.overview-card:hover::after {
  opacity: 1;
}

.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform 0.25s ease;
}

.overview-card:hover .metric-icon {
  transform: scale(1.08);
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted, #6B7280);
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 0.1rem;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main, #1E2430);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.metric-meta {
  font-size: 0.72rem;
  color: var(--text-muted, #6B7280);
  margin-top: 0.15rem;
}

/* ---------- Chart Cards ---------- */
.dash-chart-card,
.dash-section-card {
  border: 1px solid var(--border, #E1E5EF);
  border-radius: 14px;
  background: var(--bg-card, #fff);
  padding: 1.35rem;
  box-shadow: 0 1px 4px rgba(22, 34, 56, 0.03);
  transition: all 0.25s ease;
  height: 100%;
}

.dash-chart-card:hover,
.dash-section-card:hover {
  box-shadow: 0 6px 20px rgba(22, 34, 56, 0.06);
}

.dash-chart-header,
.dash-section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}

.dash-chart-icon,
.dash-section-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(var(--primary-rgb, 215, 25, 32), 0.08);
  color: var(--color-primary, #D71920);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.dash-chart-icon--accent,
.dash-section-icon--warn {
  background: rgba(230, 183, 92, 0.15);
  color: #7A5B0A;   /* dark amber — 5.8:1 contrast */
}

.dash-chart-title,
.dash-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main, #1E2430);
  margin: 0;
  letter-spacing: -0.01em;
}

.dash-chart-wrap {
  position: relative;
  height: 220px;
}

.dash-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ---------- Pipeline Funnel ---------- */
.dash-pipeline-step {
  display: grid;
  grid-template-columns: minmax(92px, 128px) minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.55rem;
  animation: appFadeUp 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.dash-pipeline-step:nth-child(1) { animation-delay: 0.05s; }
.dash-pipeline-step:nth-child(2) { animation-delay: 0.10s; }
.dash-pipeline-step:nth-child(3) { animation-delay: 0.15s; }
.dash-pipeline-step:nth-child(4) { animation-delay: 0.20s; }
.dash-pipeline-step:nth-child(5) { animation-delay: 0.25s; }

.dash-pipeline-label {
  color: var(--text-muted, #6B7280);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: right;
}

.dash-pipeline-track {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.dash-pipeline-bar {
  width: var(--step-width, 100%);
  min-width: 30px;
  max-width: 100%;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  transition: width 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  position: relative;
  overflow: hidden;
}

/* Subtle shimmer on pipeline bars */
.dash-pipeline-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  animation: shimmerAccent 3s ease infinite;
}

.dash-pipeline-value {
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
}

.dash-pipeline-bar--inquiry {
  background: linear-gradient(135deg, var(--color-primary, #D71920), var(--color-primary-dark, #A80F15));
}
.dash-pipeline-bar--consideration {
  background: linear-gradient(135deg, var(--color-info, #B7791F), #B7791F);
}
.dash-pipeline-bar--appointment {
  background: linear-gradient(135deg, var(--color-warning, #B7791F), #e8be6e);
  color: var(--text-main, #1E2430);
}
.dash-pipeline-bar--closed {
  background: linear-gradient(135deg, var(--color-success, #2D8F6F), #3da882);
}
.dash-pipeline-bar--lost {
  background: linear-gradient(135deg, var(--color-danger, #D2555A), #df7174);
}

@media (max-width: 575.98px) {
  .dash-pipeline-step {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
  }

  .dash-pipeline-label {
    text-align: center;
  }
}

/* ---------- Unanswered Questions ---------- */
.unanswered-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.5rem;
  border-radius: 10px;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
}

.unanswered-item:hover {
  background: rgba(var(--primary-rgb, 215, 25, 32), 0.04);
}

.unanswered-rank {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(var(--primary-rgb, 215, 25, 32), 0.10), rgba(var(--accent-rgb, 255, 201, 40), 0.16));
  color: var(--color-primary, #D71920);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid rgba(var(--primary-rgb, 215, 25, 32), 0.12);
}

.unanswered-text {
  font-size: 0.84rem;
  color: var(--text-main, #1E2430);
  font-weight: 500;
  line-height: 1.4;
}

.unanswered-freq {
  font-size: 0.72rem;
  color: var(--text-muted, #6B7280);
  margin-top: 0.1rem;
}

.unanswered-freq i {
  color: #7A5B0A;   /* dark amber — readable on white */
}

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
  .dash-chart-wrap {
    height: 180px;
  }
  .overview-card {
    padding: 1rem;
  }
  .metric-value {
    font-size: 1.25rem;
  }
}
