/* ==========================================================================
   Dashboard-specific layout & simple SVG chart styling
   ========================================================================== */

/* Admin dashboard welcome banner — a soft brand-tinted card behind the
   greeting, scoped to this one page (.page-header itself stays plain on
   every other screen). */
.dash-welcome-banner {
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--surface) 70%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-4);
}
.dash-welcome-banner h1 { background: linear-gradient(90deg, var(--primary) 0%, var(--primary-hover) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

.dash-section-title { display: flex; align-items: center; gap: 8px; }
.dash-section-title .dash-section-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }

.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.dash-grid-3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-4); }

/* Panel card used by the dashboard's chart row (Leads Trend / Lead Sources / Pipeline) */
.dash-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-5); }
.dash-panel-title { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: var(--sp-4); }

/* Bar chart (pure CSS/SVG) */
.bar-chart { display: flex; align-items: flex-end; gap: var(--sp-3); height: 220px; padding-top: var(--sp-4); }
.bar-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 100%; width: 100%; justify-content: center; }
.bar-chart-bar { width: 12px; border-radius: 4px 4px 0 0; transition: height 500ms cubic-bezier(.4,0,.2,1); position: relative; }
.bar-chart-bar:hover::after {
  content: attr(data-value);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--surface); font-size: 12.5px; font-weight: 700;
  padding: 4px 8px; border-radius: 5px; white-space: nowrap;
}
.bar-chart-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }

/* Donut chart */
.donut-wrap { display: flex; align-items: center; gap: var(--sp-6); }
.donut-chart { flex-shrink: 0; }
.donut-center-value { font-size: 26px; font-weight: 800; fill: var(--text); }
.donut-center-label { font-size: 12.5px; font-weight: 600; fill: var(--text-faint); }

/* Line/area sparkline chart */
.line-chart-svg { width: 100%; height: 220px; overflow: visible; }
.line-chart-dot { fill: var(--surface); stroke-width: 2.5; }
.line-chart-axis-label { font-size: 11.5px; font-weight: 600; fill: var(--text-faint); }
.line-chart-value-label { font-size: 11.5px; font-weight: 700; fill: var(--text); }
.line-chart-tooltip-dot:hover { r: 6; cursor: pointer; }
.area-chart-gridline { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }

/* Simple funnel */
.funnel-row { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.funnel-row:last-child { margin-bottom: 0; }
.funnel-label { width: 112px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); flex-shrink: 0; }
.funnel-bar-track { flex: 1; height: 30px; background: var(--surface-2); border-radius: var(--radius-sm); overflow: hidden; }
.funnel-bar-fill { height: 100%; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; color: #fff; font-size: 12.5px; font-weight: 700; transition: width 500ms ease; min-width: fit-content; }
.funnel-count { width: 44px; text-align: right; font-size: 13.5px; font-weight: 800; flex-shrink: 0; color: var(--text); }

/* Follow-up overview mini stats */
.mini-stat-row { display: flex; gap: var(--sp-4); }
.mini-stat { flex: 1; text-align: center; padding: var(--sp-4); border-radius: var(--radius-md); background: var(--surface-2); }
.mini-stat b { display: block; font-size: 22px; }
.mini-stat span { font-size: 12px; color: var(--text-muted); }

/* Activity feed icon colors keyed by type in HTML via inline classes */
.act-lead { background: var(--primary-soft); color: var(--primary); }
.act-followup { background: var(--info-soft); color: var(--info); }
.act-quote { background: var(--warning-soft); color: var(--warning); }
.act-invoice { background: var(--success-soft); color: var(--success); }
.act-payment { background: var(--success-soft); color: var(--success); }
.act-expense { background: var(--danger-soft); color: var(--danger); }

/* ---------- Calendar ---------- */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-4); flex-wrap: wrap; gap: var(--sp-3); }
.cal-nav { display: flex; align-items: center; gap: var(--sp-2); }
.cal-nav-btn { width: 34px; height: 34px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); }
.cal-nav-btn:hover { background: var(--surface-hover); }
.cal-range-label { font-size: var(--fs-md); font-weight: 700; min-width: 170px; text-align: center; }
.cal-view-switch { display: flex; gap: 3px; background: var(--surface-2); border-radius: var(--radius-md); padding: 3px; }
.cal-view-btn { padding: 7px 14px; font-size: 12px; font-weight: 600; border-radius: 7px; cursor: pointer; color: var(--text-muted); }
.cal-view-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

.cal-grid-header { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.cal-grid-body { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 110px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px; cursor: pointer; transition: background var(--transition); }
.cal-cell:hover { background: var(--surface-hover); }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell-empty { background: var(--surface-2); cursor: default; }
.cal-cell-empty:hover { background: var(--surface-2); }
.cal-cell-date { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.cal-today { background: var(--primary-soft); }
.cal-today .cal-cell-date { color: var(--primary); }
.cal-cell-events { display: flex; flex-direction: column; gap: 3px; }
.cal-event-chip { font-size: 10.5px; font-weight: 600; padding: 3px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-event-chip.block { white-space: normal; margin-bottom: 4px; }
.cal-more-chip { font-size: 10.5px; font-weight: 700; color: var(--text-faint); cursor: pointer; padding: 2px 6px; }
.cal-more-chip:hover { color: var(--primary); }

.cal-week-list { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--sp-2); }
.cal-week-day { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-2); min-height: 160px; }
.cal-week-day-head { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; text-align: center; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* Performance list (sales dashboard) */
.perf-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.perf-row:last-child { border-bottom: none; }
.perf-row .perf-name { flex: 1; font-size: 13px; font-weight: 600; }
.perf-row .perf-value { font-size: 13px; font-weight: 700; }
