/* 07-dashboard.css — Dashboard and reports widgets: portfolio, charts, heatmap, funnel, leaderboard,
   mini stats, comparisons, staff cards, the short match list.
   Part of the CRM stylesheet: the files load in number order (components/app_styles.html) and later
   rules win, exactly as when this was one file. */

/* ---------- Dashboard widgets ---------- */
.dash-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr) 280px; gap: 12px; }
.portfolio { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.portfolio .row-between { flex-wrap: wrap; gap: 6px; }
.portfolio .k { display: block; font-size: 13.5px; color: var(--muted); }
.pf-value { margin-top: 4px; }
.pf-value b { display: block; margin-top: 2px; font-size: clamp(24px, 8vw, 30px); overflow-wrap: anywhere; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.pf-income { padding: 12px 14px; border-radius: 12px; background: var(--green-bg); }
.pf-income .k { color: var(--green); font-weight: 600; }
.pf-income b { display: block; margin: 2px 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--green); }
.pf-income small { font-size: 12.5px; color: var(--muted); }
.pf-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.pf-row b { white-space: nowrap; }
.pf-total { padding-top: 10px; border-top: 1px dashed var(--border); font-weight: 600; }
.pf-total b { font-size: 15px; color: var(--accent); }
.pf-split { margin-top: 10px; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--green) 35%, transparent); display: grid; gap: 8px; }
.pf-split .pf-row small { display: block; margin-top: 1px; }
.pf-split .pf-row b { font-size: 14px; color: var(--green); }
.chart-box { position: relative; height: 230px; }
.chart-box.sm { height: 190px; }

.heatmap { display: grid; grid-template-columns: 44px repeat(7, minmax(0, 1fr)); gap: 5px; font-size: 12px; }
.heatmap .h { color: var(--muted); display: flex; align-items: center; }
.heatmap .wd { text-align: center; color: var(--muted); font-weight: 600; }
.heatmap .cell { height: 24px; border-radius: 6px; background: var(--accent-soft); position: relative; }
.heatmap .l1 { background: #fed7b5; } .heatmap .l2 { background: #fdba74; } .heatmap .l3 { background: #fb923c; } .heatmap .l4 { background: #ea580c; }
[data-theme="dark"] .heatmap .l1 { background: #5a2e12; } [data-theme="dark"] .heatmap .l2 { background: #8a4216; }
.heat-legend { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); }
.heat-legend i { width: 14px; height: 8px; border-radius: 3px; display: inline-block; }

.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px; font-size: 13px; }
.funnel-row .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel-bar { grid-column: 1 / -1; height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.funnel-bar i { display: block; height: 100%; border-radius: 6px; min-width: 3px; }

.leader { display: grid; grid-template-columns: 26px minmax(0, 1.6fr) repeat(6, minmax(0, 1fr)) 110px; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.leader.head { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.leader:last-child { border-bottom: 0; }
.leader.me { background: var(--accent-soft); }
a.leader-stat { color: inherit; text-decoration: none; }
a.leader-stat:hover { color: var(--accent-strong); text-decoration: underline; }
.rank { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; background: var(--surface-3); color: var(--muted); }
.rank.r1 { background: #fef3c7; color: #b45309; } .rank.r2 { background: #e5e7eb; color: #4b5563; } .rank.r3 { background: #fde2cf; color: #c2410c; }
.score-bar { height: 6px; border-radius: 4px; background: var(--accent-soft-2); overflow: hidden; }
.score-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); border-radius: 4px; }
.score-num { font-weight: 800; color: var(--accent-strong); }

.mini-stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.mini { padding: 9px 11px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border-soft); }
a.mini { color: inherit; text-decoration: none; transition: border-color .15s, background .15s; }
a.mini:hover { border-color: var(--accent); background: var(--accent-soft); }
.mini .k { font-size: 12px; color: var(--muted); }
.mini .v { font-size: 14px; font-weight: 800; }
.stat-link { color: inherit; font-weight: 800; text-decoration: none; }
.stat-link:hover { color: var(--accent-strong); text-decoration: underline; }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-item i { width: 9px; height: 9px; border-radius: 50%; }

.compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.compare .box { padding: 12px; border-radius: 10px; border: 1px solid var(--border); }
.compare .box.today { background: var(--accent-soft); border-color: var(--accent-soft-2); }
.compare .box h5 { margin: 0 0 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.compare .line { display: flex; justify-content: space-between; font-size: 13.5px; padding: 3px 0; color: inherit; text-decoration: none; }
a.compare .line, .compare a.line { border-radius: 6px; margin: 0 -4px; padding: 3px 4px; }
.compare a.line:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.compare .line b { font-weight: 800; }
.delta-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--green-bg); color: var(--green); margin: 8px 6px 0 0; }
.delta-chip.down { background: var(--red-bg); color: var(--red); }
.rating-parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.rating-parts .mini .v small { font-size: 12px; color: var(--muted); font-weight: 600; }
.big-score { font-size: 42px; font-weight: 800; color: var(--accent-strong); letter-spacing: -.03em; line-height: 1; }
.progress { height: 10px; border-radius: 6px; background: var(--accent-soft-2); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); }

.staff-card { padding: 14px; }
.staff-card .grid { margin-top: 10px; gap: 8px; }
a.staff-card { display: block; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.staff-card:hover { border-color: var(--accent-soft-2); box-shadow: var(--shadow); }
.staff-metric { background: var(--surface-2); text-align: center; }
.staff-metric .v { font-size: 18px; }
.staff-metric.accent { background: var(--accent-soft); border-color: var(--accent-soft-2); }
.staff-metric.accent .v, .staff-metric.accent .k { color: var(--accent-strong); }

.match-list { display: flex; flex-direction: column; gap: 8px; }
.match { display: flex; gap: 10px; align-items: center; padding: 9px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); transition: border-color .15s; }
.match:hover { border-color: var(--accent-soft-2); }
.match .thumb { width: 56px; height: 44px; border-radius: 7px; overflow: hidden; background: var(--surface-3); flex: none; }
.match .thumb img { width: 100%; height: 100%; object-fit: cover; }
.match-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--green-bg); color: var(--green); }

