/* Performance chart kit: only styles not already in admin.css (.chart/.grid/.axis/.hit/.legend/.chart-tip). */
.perf-chart .legend { margin-bottom: 6px; flex-wrap: wrap; }
.perf-donut { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.perf-donut .chart { width: 180px; flex: none; }
.perf-donut .legend { flex-direction: column; gap: 6px; }
.perf-chart .donut-total { font-size: 15px; font-weight: 700; fill: var(--ink, #1d1a2e); }
.perf-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--secondary, #525060); }
.perf-progress-track { flex: 1; height: 10px; border-radius: 999px; background: var(--line, #e4e1ee); overflow: hidden; }
.perf-progress-fill { display: block; height: 100%; border-radius: 999px; }
.perf-progress b { color: var(--ink, #1d1a2e); font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.perf-compare { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.perf-compare b { font-size: 22px; color: var(--ink, #1d1a2e); font-variant-numeric: tabular-nums; }
.perf-compare small { color: var(--muted, #6d6a7c); }
.perf-delta { font-size: 13px; font-weight: 600; }
.perf-delta.up { color: #16a34a; }
.perf-delta.down { color: #dc2626; }
.perf-delta.flat { color: var(--muted, #6d6a7c); }

/* Small screens: the 640-unit viewBox scales to ~0.56 at 390px wide, so 20 units renders ~11px.
   hbar uses a 420-unit viewBox (~0.85 scale), so 13 units renders ~11px. */
.perf-hbar { max-width: 560px; }
@media (max-width: 600px) {
  .perf-chart .chart .axis { font-size: 20px; }
  .perf-chart .chart .axis.xl:not(.xl-s) { display: none; }
  .perf-hbar .chart .axis { font-size: 13px; }
  .perf-donut .chart .axis { font-size: 15px; }
}

/* ---------- Performance pages (perf.js) and the agent member area ---------- */
/* Chart base styles, repeated here so member.html (which does not load admin.css) gets them too */
.chart { width: 100%; height: auto; display: block; }
.perf-chart .chart .grid { stroke: #ecebf2; stroke-width: 1; }
.perf-chart .chart .axis { fill: #8a879a; font-size: 11px; font-family: inherit; }
.perf-chart .legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--secondary, #525060); }
.perf-chart .legend i, .chart-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-tip { position: fixed; z-index: 60; pointer-events: none; background: #fff; border: 1px solid var(--line, #e4e1ee); border-radius: 8px; box-shadow: 0 8px 24px rgba(29,26,46,.14); padding: 8px 12px; font-size: 12.5px; min-width: 160px; }
.chart-tip b { display: block; margin-bottom: 4px; }
.chart-tip div { display: flex; align-items: center; color: var(--secondary, #525060); }
.chart-tip div span { margin-left: auto; padding-left: 14px; color: var(--ink, #1d1a2e); font-weight: 600; }

.note.warn.perf-demo { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: #fff3e8; border: 1px solid #f5c49c; color: #9a3a06; font-weight: 600; font-size: 13px; }

/* bands, medals, rank */
.perf-band { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.perf-band.b-green { background: #e7f6ec; color: #116d33; }
.perf-band.b-blue { background: #e8f0fe; color: #1d4fbf; }
.perf-band.b-orange { background: #fdf0e6; color: #b14309; }
.perf-band.b-red { background: #fde9e9; color: #b11c1c; }
.perf-band.b-gold { background: #fbf3d9; color: #8a6a07; }
.perf-band.b-none { background: #efeef4; color: #5f5c70; }
.perf-medal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 800; font-size: 12.5px; color: #fff; }
.perf-medal.m1 { background: linear-gradient(145deg, #f2c94c, #d4a017); }
.perf-medal.m2 { background: linear-gradient(145deg, #c9ced6, #8f98a6); }
.perf-medal.m3 { background: linear-gradient(145deg, #e3a36f, #b46a32); }
.perf-rank { display: inline-block; padding: 4px 12px; border-radius: 999px; background: #efeef4; color: #3d3a50; font-weight: 700; font-size: 13px; }
.perf-rank.gold { background: linear-gradient(145deg, #fbe7a1, #f0c94a); color: #5e4500; box-shadow: 0 1px 0 #d4a017 inset, 0 2px 8px rgba(212,160,23,.25); }
.perf-score-n { font-size: 15px; font-variant-numeric: tabular-nums; }
.perf-mini { display: block; width: 72px; height: 5px; border-radius: 999px; background: var(--line, #e4e1ee); overflow: hidden; margin-top: 4px; }
.perf-mini i { display: block; height: 100%; border-radius: 999px; }
.perf-who { display: inline-flex; align-items: center; gap: 10px; }
.perf-who { min-width: 170px; }
.perf-who > span { min-width: 0; }
.perf-who small { display: block; }
.perf-chart .chart .donut-total { font-size: 22px; font-weight: 700; }
.perf-wt-lbl { display: none; font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted, #6d6a7c); }

/* summary */
.perf-sum { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; align-items: start; }
.perf-sum .tiles { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.perf-sum-donut h3 { margin: 0 0 8px; font-size: 14px; }
.perf-sum-donut .perf-donut .chart { width: 130px; }
.perf-tiles .tile { border-top: 3px solid var(--line, #e4e1ee); }
.perf-tiles .t-blue { border-top-color: #2563eb; } .perf-tiles .t-green { border-top-color: #16a34a; }
.perf-tiles .t-orange { border-top-color: #ea580c; } .perf-tiles .t-gold { border-top-color: #d4a017; }

/* leaderboard */
.perf-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 14px; align-items: end; }
.perf-pod { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border: 1px solid var(--line, #e4e1ee); border-radius: 12px; background: var(--panel, #fff); font: inherit; cursor: pointer; min-width: 0; }
.perf-pod b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perf-pod small { color: var(--muted, #6d6a7c); font-size: 11.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perf-pod em { font-style: normal; font-weight: 800; font-size: 20px; color: var(--ink, #1d1a2e); }
.perf-pod.r1 { border-color: #d4a017; background: linear-gradient(180deg, #fff9e6, #fff); padding-top: 22px; order: 2; }
.perf-pod.r2 { order: 1; } .perf-pod.r3 { order: 3; }
.perf-pod-medal { font-size: 24px; line-height: 1; }
.perf-lb-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.perf-lb-bar select { flex: 1 1 150px; min-width: 0; max-width: 100%; width: auto; }
@media (min-width: 900px) { .perf-lb-bar select { flex: 0 1 auto; } }
.perf-live { font-size: 12.5px; font-weight: 600; color: var(--muted, #6d6a7c); }
.perf-live.on { color: #116d33; }
.perf-live.on::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.perf-lb-podium .perf-pod.r1, .perf-lb-podium .perf-pod.r2, .perf-lb-podium .perf-pod.r3 { border: 2px solid #d4a017; background: linear-gradient(180deg, #fff6da, #fff); }
.dt tr.perf-lb-top td { background: #fffaea; }
.dt tr.perf-lb-top td:first-child { box-shadow: inset 4px 0 0 #d4a017; }

/* individual dashboard */
.perf-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; border-left: 5px solid var(--band, #2563eb); }
.perf-hero-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.perf-hero-who h2 { margin: 0 0 2px; font-size: 20px; }
.perf-hero-who small { color: var(--muted, #6d6a7c); }
.perf-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.perf-hero-score { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.perf-ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, var(--panel, #fff) 76%, transparent 77%), conic-gradient(var(--band, #2563eb) calc(var(--p) * 1%), var(--line, #e4e1ee) 0); }
.perf-ring b { font-size: 26px; line-height: 1; color: var(--ink, #1d1a2e); }
.perf-ring small { font-size: 11px; color: var(--muted, #6d6a7c); text-transform: uppercase; letter-spacing: .05em; }
.perf-hero-grade { text-align: center; }
.perf-hero-grade small, .perf-hero-cmp small { display: block; color: var(--muted, #6d6a7c); font-size: 11.5px; }
.perf-grade-big { font-size: 30px; font-weight: 800; color: #3a21a3; }
.perf-grade-big.none { color: var(--muted, #6d6a7c); }
.perf-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.perf-two > .card { margin: 0; min-width: 0; }
.perf-two h4 { margin: 4px 0 6px; font-size: 13px; color: var(--secondary, #525060); }
.perf-remain { display: grid; gap: 10px; }
.perf-remain small { display: block; margin-top: 2px; color: var(--muted, #6d6a7c); font-size: 12px; }
.perf-progress-label { flex: 0 0 9.5em; color: var(--ink, #1d1a2e); }
.perf-cmp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.perf-cmp { border: 1px solid var(--line, #e4e1ee); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.perf-cmp > span { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted, #6d6a7c); text-transform: uppercase; letter-spacing: .04em; }
.perf-cmp .perf-compare b { font-size: 17px; overflow-wrap: anywhere; }
.perf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.perf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.perf-chip b { font-variant-numeric: tabular-nums; }
.perf-chip.good { background: #e7f6ec; color: #116d33; }
.perf-chip.warn { background: #fdf0e6; color: #b14309; }
.perf-soon { border-style: dashed; }
.perf-soon h3 { margin: 0 0 6px; font-size: 15px; }
.mb-perf-sub { border: 1px dashed var(--line, #e4e1ee); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.mb-perf-two { margin: 0; }
/* Figures table outside the dashboard (member area has no admin.css / mobile.css) */
.perf-figs { width: 100%; border-collapse: collapse; font-size: 13px; }
.mb .perf-figs th, .mb .perf-figs td { padding: 7px 8px; border-bottom: 1px solid var(--line, #e4e1ee); text-align: left; vertical-align: top; }
.mb .perf-figs th { font-size: 11px; text-transform: uppercase; color: var(--muted, #6d6a7c); }
.mb .perf-figs .num { text-align: right; font-variant-numeric: tabular-nums; }
.mb .tbl-wrap { overflow-x: auto; }

/* audit drawer */
.perf-drawer { position: fixed; inset: 0; z-index: 50; }
.perf-drawer[hidden] { display: none; }
.perf-drawer-scrim { position: absolute; inset: 0; background: rgba(29,26,46,.35); opacity: 0; transition: opacity .2s; }
.perf-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--panel, #fff); box-shadow: -8px 0 30px rgba(29,26,46,.18); padding: 18px; overflow-y: auto; transform: translateX(100%); transition: transform .2s; }
.perf-drawer.open .perf-drawer-scrim { opacity: 1; } .perf-drawer.open .perf-drawer-panel { transform: none; }
.perf-drawer-panel header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.perf-drawer-panel h2 { margin: 0; font-size: 18px; }
.perf-drawer-panel header small { color: var(--muted, #6d6a7c); }
.perf-audit { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.perf-audit li { border: 1px solid var(--line, #e4e1ee); border-left: 3px solid #ea580c; border-radius: 8px; padding: 10px 12px; }
.perf-audit-top { display: flex; justify-content: space-between; gap: 8px; }
.perf-audit-top small, .perf-audit li > small { color: var(--muted, #6d6a7c); }
.perf-audit-val { margin: 4px 0; font-variant-numeric: tabular-nums; }
.perf-audit p { margin: 4px 0; font-size: 13px; }

/* settings */
.perf-wgrid { display: grid; gap: 4px; }
.perf-wrow { display: grid; grid-template-columns: minmax(130px, 1.3fr) minmax(170px, 2fr) 90px minmax(130px, 1fr); gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line, #e4e1ee); }
.perf-whead { font-size: 11.5px; font-weight: 700; color: var(--muted, #6d6a7c); text-transform: uppercase; letter-spacing: .04em; }
.perf-wlabel { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.perf-wlabel i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.perf-wctl { display: flex; align-items: center; gap: 8px; }
.perf-wctl input[type=range] { flex: 1; min-width: 0; accent-color: #3a21a3; }
.perf-wnum { width: 64px; }
.perf-share { font-weight: 700; color: #2563eb; font-variant-numeric: tabular-nums; }
.perf-wtarget { display: flex; align-items: center; gap: 6px; }
.perf-wtarget input { width: 100%; min-width: 0; }
.perf-wtarget small { color: var(--muted, #6d6a7c); white-space: nowrap; }
.perf-wgrid input[type=number], .perf-grades input, .perf-tinput { padding: 6px 8px; border: 1px solid var(--line, #e4e1ee); border-radius: 8px; font: inherit; background: var(--panel, #fff); }
.perf-err { color: #dc2626; font-weight: 600; margin: 10px 0 0; min-height: 1em; }
.perf-grades { display: grid; gap: 8px; margin-bottom: 10px; }
.perf-grow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.perf-grow input[type=text] { width: 80px; } .perf-grow input[type=number] { width: 80px; }

/* targets grid */
.perf-tinput { width: 92px; }
.perf-tinput.saved { border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,.2); }

/* member area */
.mb-perf-h { font-size: 14px; margin: 16px 0 6px; }
.mb-perf-hero { padding: 12px; border-radius: 12px; background: #faf9fd; margin-bottom: 10px; }

/* Monthly calendar (PM.calendarGrid) */
.cal { min-width: 0; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted, #6d6a7c); margin-bottom: 8px; }
.cal-legend i, .cal-dots i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.cal .cal-grid { display: table; } .cal .cal-grid thead { display: table-header-group; } .cal .cal-grid tbody { display: table-row-group; } .cal .cal-grid tr { display: table-row; }
.cal .cal-grid td, .cal .cal-grid th { display: table-cell; }
.cal-grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; }
.cal-grid th { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted, #6d6a7c); padding: 2px 0; text-align: center; }
.cal-grid td { padding: 0; vertical-align: top; }
.cal-grid .cal-wh, .cal-grid .cal-week { width: 17%; }
.cal-btn { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; width: 100%; min-height: 48px; padding: 4px 5px; border: 1px solid var(--line, #e4e1ee); border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.cal-day.has .cal-btn { background: #faf9fd; }
.cal-day.sel .cal-btn { outline: 2px solid #2563eb; }
.cal-n { font-size: 12px; font-weight: 600; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 3px; }
.cal-dots i { margin: 0; }
.cal-week { text-align: center; font-size: 12px; padding-top: 6px !important; }
.cal-week b { display: block; font-size: 14px; }
.cal-week small { display: block; color: var(--muted, #6d6a7c); font-size: 9.5px; white-space: nowrap; }
.cal-detail { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line, #e4e1ee); border-radius: 10px; min-width: 0; overflow-wrap: anywhere; }
.cal-detail ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
@media (max-width: 480px) { .cal-grid { border-spacing: 2px; } .cal-btn { min-height: 42px; padding: 3px; } .cal-grid .cal-wh, .cal-grid .cal-week { width: 20%; } }

@media (max-width: 900px) {
  .perf-sum, .perf-two { grid-template-columns: minmax(0, 1fr); }
  .perf-wrow { grid-template-columns: minmax(0, 1fr) 80px; grid-template-areas: "l s" "c c" "t t"; row-gap: 6px; }
  .perf-wrow > .perf-wlabel { grid-area: l; } .perf-wrow > .perf-share { grid-area: s; text-align: right; }
  .perf-wrow > .perf-wctl { grid-area: c; } .perf-wrow > .perf-wtarget { grid-area: t; }
  .perf-whead { display: none; }
  .perf-wt-lbl { display: inline; }
}
@media (max-width: 640px) {
  .perf-hero { flex-direction: column; align-items: stretch; }
  .perf-hero-score { justify-content: space-between; }
  .perf-podium { gap: 6px; } .perf-pod { padding: 10px 4px; } .perf-pod em { font-size: 17px; }
  .perf-progress-label { flex-basis: 7.5em; }
  .perf-tinput { width: 100%; max-width: 140px; }
  .perf-sum-donut .perf-donut { flex-wrap: nowrap; }
}
@media (max-width: 640px) {
  .mb .perf-figs thead { display: none; }
  .mb .perf-figs, .mb .perf-figs tbody, .mb .perf-figs tr, .mb .perf-figs td { display: block; width: 100%; }
  .mb .perf-figs tr { padding: 10px 0; border-bottom: 1px solid var(--line, #e4e1ee); }
  .mb .perf-figs td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .mb .perf-figs td::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--muted, #6d6a7c); text-align: left; }
  .mb .perf-figs td:first-child { display: block; text-align: left; font-size: 14px; }
  .mb .perf-figs td:first-child::before { display: none; }
}
@media print { .perf-drawer, .perf-noprint { display: none !important; } .perf-two { grid-template-columns: 1fr 1fr; } }

/* ---------- Management dashboard (perf-overview) ---------- */
.perf-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.perf-filters .search { max-width: 100%; min-width: 0; }
.perf-filters select.search { max-width: 220px; }
.perf-flabel { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--secondary, #525060); }
.perf-cmp-m { display: inline-flex; align-items: center; gap: 4px; }
.perf-tiles .t-purple { border-top-color: #7c3aed; } .perf-tiles .t-red { border-top-color: #dc2626; }
.tiles.small.perf-ov-tiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.perf-ov-tiles .tile { min-width: 0; }
.perf-ov-tiles .tile b { font-size: 19px; overflow-wrap: anywhere; }
.perf-ov-tiles .tile small { display: block; margin-top: 4px; color: var(--muted, #6d6a7c); font-size: 12px; overflow-wrap: anywhere; }
.perf-ov-card { min-width: 0; }
.perf-ov-big { margin: 8px 0 0; color: var(--secondary, #525060); } .perf-ov-big b { color: #16a34a; font-size: 20px; }
.perf-ov-note { margin: 8px 0; }
.perf-rank2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.perf-rank2 h4 { margin: 0 0 6px; }
.perf-chart .ref-label { font-weight: 700; }
.perf-print-head, .perf-brand-foot { display: none; }
@media (max-width: 1100px) { .perf-rank2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) {
  .tiles.small.perf-ov-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .perf-ov-tiles .tile { padding: 12px; }
  .perf-ov-tiles .tile b { font-size: 18px; }
  .perf-filters select.search, .perf-filters input.search { flex: 1 1 140px; max-width: none; }
}

/* Printing (PDF and Print on the management dashboard print the page with its charts, see printPage in perf.js) */
@media print {
  .perf-print { -webkit-print-color-adjust: exact; print-color-adjust: exact; color: #1d1a2e; }
  .perf-print .perf-brand { display: flex; align-items: center; gap: 12px; border-bottom: 3px solid #3a21a3; padding-bottom: 8px; margin-bottom: 12px; }
  .perf-print .perf-brand img { width: 36px; height: 36px; }
  .perf-print .perf-brand h1 { color: #3a21a3; font-size: 18px; margin: 0; }
  .perf-print .perf-brand p { margin: 2px 0 0; color: #6d6a7c; font-size: 11px; }
  .perf-print .perf-brand-foot { display: block; margin-top: 14px; padding-top: 6px; border-top: 1px solid #d9d5ea; color: #6d6a7c; font-size: 10px; text-align: center; }
  .perf-print .perf-print-head { display: block; margin: 0 0 10px; }
  .perf-print .perf-print-head h2 { margin: 0; font-size: 15px; color: #3a21a3; }
  .perf-print .perf-print-head p { margin: 2px 0 0; font-size: 11px; color: #525060; }
  .perf-print .perf-filters, .perf-print .pager, .perf-print .chart-tip { display: none !important; }
  .perf-print .card { break-inside: avoid; box-shadow: none; border: 1px solid #e4e1ee; }
  .perf-print .card h3 { color: #3a21a3; }
  .perf-print .tiles.small.perf-ov-tiles { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .perf-print .perf-ov-tiles .tile { padding: 8px 10px; break-inside: avoid; }
  .perf-print .perf-ov-tiles .tile b { font-size: 15px; }
  .perf-print .perf-two { grid-template-columns: 1fr 1fr; gap: 10px; }
  .perf-print .perf-rank2 { grid-template-columns: 1fr 1fr; }
  .perf-print .tbl-wrap { overflow: visible; }
  .perf-print table.dt tr[hidden] { display: table-row !important; }
  .perf-print table.dt { font-size: 8.5px; width: 100%; table-layout: fixed; }
  .perf-print table.dt th, .perf-print table.dt td { padding: 3px 4px; white-space: normal; overflow-wrap: anywhere; }
  .perf-print table.dt .perf-mini { display: none; }
  .perf-print table.dt th:nth-child(2), .perf-print table.dt td:nth-child(2) { width: 15%; }
  .perf-print .perf-band { white-space: normal; padding: 1px 5px; }
}

/* ---------- AI insights card and forecast (Task 16). Severity colours from the Global Constraints, set inline as --sev ---------- */
.perf-ai { min-width: 0; }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ai-head h3 { margin: 0; font-size: 15px; }
.ai-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ai-item { border: 1px solid var(--line, #e4e1ee); border-left: 5px solid var(--sev, #9a97a8); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.ai-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-kind { color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.ai-who { font-weight: 600; font-size: 13px; }
.ai-status { margin-left: auto; }
.ai-text { margin: 6px 0; line-height: 1.45; overflow-wrap: anywhere; }
.ai-facts summary { cursor: pointer; font-size: 12.5px; color: var(--muted, #6d6a7c); }
.ai-facts ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; }
.ai-facts li { overflow-wrap: anywhere; }
.ai-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-removed { margin: 6px 0 10px; }
.perf-forecast { min-width: 0; }
.legend i.dash { width: 16px; border-radius: 0; vertical-align: middle; }
@media print { .ai-facts[open] summary { display: none; } }
