/* ==========================================================================
   Phenome LIMS — "Pro" layout layer (financeDashboardPro / sampleDashboardPro)
   Loaded after pl-dashboard.css. Presentation only.
   ========================================================================== */

.pl-dash.pro { --pl-aside-w: 292px; }

/* ---------- Hero with integrated filters ---------- */
.pro-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 26px 28px 22px;
  margin-bottom: 22px;
  color: #fff;
  background:
    radial-gradient(1200px 300px at 110% -40%, rgba(139, 92, 246, .55), transparent 60%),
    radial-gradient(700px 260px at -10% 120%, rgba(14, 165, 233, .45), transparent 60%),
    linear-gradient(125deg, #0f1a4a 0%, #1e2a78 45%, #3b5bfd 100%);
  box-shadow: 0 24px 48px -28px rgba(30, 42, 120, .9);
}
.pro-hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
  pointer-events: none;
}
.pro-hero > * { position: relative; z-index: 1; }
.pro-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.pro-eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.65); }
.pro-title { font-size: 30px !important; font-weight: 800 !important; letter-spacing: -.025em; color: #fff !important; margin: 6px 0 4px !important; line-height: 1.1; }
.pro-sub { margin: 0; font-size: 14px; color: rgba(255,255,255,.78); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pro-sub .dateFiltrCl { background: rgba(255,255,255,.16) !important; color: #fff !important; }
.pro-crumb {
  font-size: 12.5px; color: rgba(255,255,255,.85); background: rgba(255,255,255,.12);
  padding: 6px 14px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center;
  backdrop-filter: blur(6px);
}
.pro-crumb a { color: #fff; text-decoration: none; }

.pro-filter {
  margin-top: 22px;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  padding: 12px;
  backdrop-filter: blur(8px);
}
.pro-field { display: flex; flex-direction: column; gap: 5px; min-width: 150px; flex: 1 1 150px; max-width: 220px; }
.pro-field > span { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.pl-dash .pro-filter .form-control, .pl-dash .pro-filter select.form-control {
  background: rgba(255,255,255,.96) !important;
  border: 0 !important;
  min-height: 40px;
  font-weight: 600;
  color: #0f172a !important;
}
.pro-btn {
  border: 0; border-radius: 10px; min-height: 40px; padding: 0 20px;
  font-weight: 800; font-size: 14px; color: #1e2a78; background: #fff;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  box-shadow: 0 10px 20px -12px rgba(0,0,0,.6);
  transition: transform .15s ease, box-shadow .15s ease;
}
.pro-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 24px -12px rgba(0,0,0,.7); }
.pro-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; align-self: center; }
.pro-chip {
  border: 1px solid rgba(255,255,255,.28); background: transparent; color: #fff;
  font-size: 12px; font-weight: 700; border-radius: 999px; padding: 6px 12px; cursor: pointer;
  transition: background .15s;
}
.pro-chip:hover, .pro-chip.on { background: rgba(255,255,255,.2); }

/* ---------- Section label ---------- */
.pro-section { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 30px 0 14px; flex-wrap: wrap; }
.pro-section h2 {
  font-size: 18px !important; font-weight: 800 !important; letter-spacing: -.015em; margin: 0 !important;
  color: var(--pl-text) !important; display: flex; align-items: center; gap: 10px;
}
.pro-section h2 .pro-num {
  width: 26px; height: 26px; border-radius: 8px; font-size: 12px; font-weight: 800;
  display: inline-grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--pl-primary), var(--pl-violet));
}
.pro-section p { margin: 4px 0 0; font-size: 13px; color: var(--pl-muted); }

/* ---------- Finance: currency KPI cards ---------- */
.pro-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1199.98px) { .pro-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .pro-kpis { grid-template-columns: minmax(0, 1fr); } }
.pro-kpi {
  position: relative; overflow: hidden;
  background: var(--pl-surface); border: 1px solid var(--pl-border); border-radius: 16px;
  padding: 18px; box-shadow: var(--pl-shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.pro-kpi:hover { transform: translateY(-2px); box-shadow: var(--pl-shadow-hover); }
.pro-kpi::before {
  content: ""; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%);
}
.pro-kpi-head { display: flex; align-items: center; gap: 10px; position: relative; }
.pro-kpi-sym {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  font-weight: 800; font-size: 18px; color: #fff; background: var(--c);
  box-shadow: 0 8px 16px -8px var(--c);
}
.pro-kpi-cur { font-weight: 800; font-size: 13px; letter-spacing: .08em; color: var(--pl-text-2); }
.pro-kpi-rate {
  margin-left: auto; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c);
}
.pro-kpi-label { margin-top: 16px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pl-muted); }
.pro-kpi-val { font-size: clamp(22px, 1.9vw, 30px); font-weight: 800; letter-spacing: -.03em; color: var(--pl-text); line-height: 1.15; white-space: nowrap; }
.pro-kpi-bar { height: 6px; border-radius: 99px; background: var(--pl-surface-2); margin: 14px 0 10px; overflow: hidden; }
.pro-kpi-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.pro-kpi-foot { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--pl-muted); }
.pro-kpi-foot b { font-size: 15px; color: var(--pl-text); font-weight: 800; }

/* ---------- Segmented switch + panes ---------- */
.pro-seg { display: inline-flex; gap: 2px; background: var(--pl-surface-2); border: 1px solid var(--pl-border); border-radius: 12px; padding: 4px; }
.pro-seg button {
  border: 0; background: transparent; color: var(--pl-text-2); font-weight: 700; font-size: 13px;
  padding: 7px 16px; border-radius: 9px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center;
}
.pro-seg button i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .5; }
.pro-seg button.active { background: var(--pl-surface); color: var(--pl-primary); box-shadow: 0 1px 2px rgba(16,24,40,.08), 0 2px 6px -2px rgba(16,24,40,.14); }
.pro-seg button.active i { opacity: 1; }
.pro-pane { display: none; }
.pro-pane.active { display: block; animation: proFade .25s ease; }
@keyframes proFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pl-dash .pro-pane > .card { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
.pl-dash .pro-pane > .card:hover { box-shadow: none !important; }
.pl-dash .pro-pane > .card > .card-header { display: none; }

/* chart cards in 2-up row */
.pl-dash .pro-trends .card-header p { display: block; }
.pl-dash .pro-trends .card-body > ul:first-child { justify-content: flex-start !important; margin: 0 0 6px !important; }

/* ---------- Collapsible card (<details>) ---------- */
.pro-collapse {
  background: var(--pl-surface); border: 1px solid var(--pl-border); border-radius: var(--pl-radius);
  box-shadow: var(--pl-shadow); overflow: hidden; margin-top: 4px;
}
.pro-collapse > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; font-weight: 700; font-size: 15px; color: var(--pl-text);
}
.pro-collapse > summary::-webkit-details-marker { display: none; }
.pro-collapse > summary small { display: block; font-weight: 500; font-size: 12.5px; color: var(--pl-muted); margin-top: 2px; }
.pro-collapse > summary .pro-caret {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--pl-surface-2); border: 1px solid var(--pl-border); transition: transform .2s ease; flex-shrink: 0;
}
.pro-collapse[open] > summary .pro-caret { transform: rotate(180deg); }
.pro-collapse[open] > summary { border-bottom: 1px solid var(--pl-border); }
.pl-dash .pro-collapse > .card, .pl-dash .pro-collapse .card { border: 0 !important; box-shadow: none !important; margin: 0 !important; width: 100% !important; }

/* ---------- Sample: health band ---------- */
.pro-health { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1199.98px) { .pro-health { grid-template-columns: minmax(0, 1fr); } }
.pro-ring-card {
  background: var(--pl-surface); border: 1px solid var(--pl-border); border-radius: 16px; box-shadow: var(--pl-shadow);
  padding: 20px; display: flex; align-items: center; gap: 20px;
}
.pro-ring { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.pro-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pro-ring circle { fill: none; stroke-width: 12; }
.pro-ring .trk { stroke: var(--pl-surface-2); }
.pro-ring .val { stroke: url(#proRingGrad); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.pro-ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.pro-ring-center b { font-size: 30px; font-weight: 800; letter-spacing: -.03em; color: var(--pl-text); line-height: 1; }
.pro-ring-center span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pl-muted); margin-top: 6px; }
.pro-ring-meta { display: grid; gap: 14px; min-width: 0; }
.pro-ring-meta .t { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--pl-muted); }
.pro-ring-meta .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--pl-text); line-height: 1.1; }
.pro-ring-meta .v.ok { color: var(--pl-success); }
.pro-ring-meta .verdict { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; display: inline-block; }
.pro-ring-meta .verdict.good { background: var(--pl-success-soft); color: var(--pl-success); }
.pro-ring-meta .verdict.mid { background: var(--pl-warning-soft); color: var(--pl-warning); }
.pro-ring-meta .verdict.bad { background: var(--pl-danger-soft); color: var(--pl-danger); }

.pro-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 575.98px) { .pro-stats { grid-template-columns: minmax(0, 1fr); } }
.pro-stat {
  background: var(--pl-surface); border: 1px solid var(--pl-border); border-radius: 16px; box-shadow: var(--pl-shadow);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden;
}
.pro-stat::after { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.pro-stat-ico {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent);
}
.pro-stat-ico .pl-ico { width: 20px; height: 20px; }
.pro-stat .t { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--pl-muted); }
.pro-stat .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--pl-text); line-height: 1.15; }
.pro-stat .s { font-size: 12px; color: var(--pl-muted); }

/* rows spacing */
.pl-dash.pro .row.pro-row { --bs-gutter-y: 16px; --bs-gutter-x: 16px; }
.pl-dash.pro .row.pro-row > [class*="col-"] > .card { height: 100%; }
.pl-dash.pro .row.pro-row .mt-3 { margin-top: 0 !important; }

/* stacked donut + table inside narrow cards */
.pl-dash.pro .pro-stack .apexcharts-canvas { margin: 0 auto; }
.pl-dash.pro .pro-stack .table-responsive { margin-top: 12px; }

/* legend chips for duration tables */
.pro-legend-inline { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.pro-legend-inline span { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pro-legend-inline .ok { background: var(--pl-success-soft); color: var(--pl-success); }
.pro-legend-inline .bad { background: var(--pl-danger-soft); color: var(--pl-danger); }

/* the old page-header style must not hit the pro hero */
.pl-dash.pro .pl-main > .pro-hero { background-clip: padding-box; }

/* dark mode tweaks */
[data-theme="dark"] .pl-dash .pro-filter .form-control { background: rgba(13,18,32,.85) !important; color: #e8ecf5 !important; }
[data-theme="dark"] .pro-btn { background: #e8ecf5; }

/* ---------- Readable table text in Pro (original page forces 10px) ---------- */
.pl-dash.pro .table td, .pl-dash.pro .table th { font-size: 13px !important; }
.pl-dash.pro .table thead th { font-size: 11.5px !important; }

/* ---------- Rerun by test: donut beside table ---------- */
.pl-dash.pro .pro-split > .card, .pl-dash.pro .pro-heatmap > .card { height: auto !important; }
.pl-dash.pro .pro-split .row { align-items: center; row-gap: 12px; }
.pl-dash.pro .pro-donut-col .apexcharts-canvas,
.pl-dash.pro .pro-stack .apexcharts-canvas { max-width: 300px; margin: 0 auto; }
.pl-dash.pro .pro-split .table-responsive { margin-top: 0; }

/* ---------- Heatmap ---------- */
.pl-dash.pro .pro-heatmap .card-header > .d-flex { align-items: center !important; }
.pro-scale { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--pl-muted); }
.pro-scale i {
  width: 120px; height: 8px; border-radius: 99px; display: block;
  background: linear-gradient(90deg, hsl(120,78%,80%), hsl(60,78%,78%), hsl(0,78%,80%));
}
.pl-dash .pro-heat {
  display: inline-block; min-width: 64px; text-align: center;
  padding: 5px 10px; border-radius: 8px; font-weight: 800; font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.pl-dash.pro .pro-heatmap td:first-child .text-secondary-light { color: var(--pl-text) !important; font-weight: 700; }
.pl-dash.pro .pro-heatmap .table tbody tr:hover > * { background: var(--pl-surface-2) !important; }

/* ---------- Donuts: centered, readable ---------- */
.pl-dash.pro #userOverviewDonutChart2, .pl-dash.pro #userOverviewDonutChart3 { display: flex; justify-content: center; }
.pl-dash.pro .apexcharts-pie-label, .pl-dash.pro .apexcharts-datalabel { font-weight: 800 !important; }

/* ---------- Duration cards ---------- */
.pl-dash.pro .pro-dur-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pro-seg.pro-seg-sm button { padding: 5px 12px; font-size: 12.5px; }
.pro-dur-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.pro-dur-item {
  border: 1px solid var(--pl-border); border-radius: 12px; padding: 12px 14px; background: var(--pl-surface);
  position: relative; overflow: hidden;
}
.pro-dur-item::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--c); }
.pro-dur-item .n { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--pl-muted); }
.pro-dur-item .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--pl-text); line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
.pro-dur-item .v small { font-size: 12px; font-weight: 600; color: var(--pl-muted); letter-spacing: 0; }
.pro-dur-item .v.ok { color: var(--pl-success); }
.pro-dur-item .v.bad { color: var(--pl-danger); }
.pro-dur-item .m { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--pl-muted); margin-top: 4px; flex-wrap: wrap; }
.pro-dur-item .m .pct { font-weight: 700; color: var(--pl-text-2); }
.pro-dur-item .bar { height: 4px; border-radius: 99px; background: var(--pl-surface-2); margin-top: 8px; overflow: hidden; }
.pro-dur-item .bar i { display: block; height: 100%; background: var(--c); border-radius: inherit; }

/* compact duration tables: lighter group headers, sticky month column */
.pl-dash.pro .pro-dur .table thead th[style*="background-color"] {
  background: var(--pl-surface-2) !important; background-image: none !important;
  color: var(--pl-text-2) !important; border-bottom: 2px solid var(--pl-border-strong) !important;
}
.pl-dash.pro .pro-dur .table thead tr:first-child th[colspan] { box-shadow: inset 0 3px 0 var(--pl-primary); }
.pl-dash.pro .pro-dur .table td, .pl-dash.pro .pro-dur .table th { padding: 7px 10px !important; }
.pl-dash.pro .pro-dur .table tbody td:first-child, .pl-dash.pro .pro-dur .table thead th[rowspan] {
  position: sticky; left: 0; z-index: 1; background: var(--pl-surface) !important;
}
.pl-dash.pro .pro-dur .table tbody tr:last-child td { border-top: 2px solid var(--pl-border-strong) !important; font-weight: 800; }
.pl-dash.pro .pro-dur .table td .btn.bg-transparent.radius-8 { min-width: 56px; padding: 3px 10px !important; }
.pro-dur-chart { min-height: 340px; }

/* donut text: white slice labels, strong centre value (overrides generic chart-text colour) */
.pl-dash .apexcharts-pie .apexcharts-datalabels text,
.pl-dash .apexcharts-pie text.apexcharts-pie-label { fill: #ffffff !important; }
.pl-dash .apexcharts-datalabels-group .apexcharts-datalabel-value { fill: var(--pl-text) !important; }
.pl-dash .apexcharts-datalabels-group .apexcharts-datalabel-label { fill: var(--pl-muted) !important; }
.pl-dash.pro .pro-dur > .card { height: auto !important; }
.pl-dash.pro .row.pro-row:has(> .pro-dur) { align-items: flex-start; }
.pro-dur-sum { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.pl-dash .apexcharts-yaxis-annotations text, .pl-dash .apexcharts-yaxis-annotations .apexcharts-text { fill: #ffffff !important; }

/* ---------- Duration summary v2 (totals as chart cards) ---------- */
.pro-dur-sum { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.pro-dur-item { padding: 14px 16px 12px; display: grid; gap: 6px; }
.pro-dur-item::before { width: 100%; height: 3px; inset: 0 0 auto 0; }
.pro-dur-item .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pro-dur-item .n { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.pro-dur-item.is-total .n { color: var(--pl-text); }
.pro-dur-item .avg { font-size: 12.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--pl-surface-2); color: var(--pl-text-2); white-space: nowrap; }
.pro-dur-item .avg small { font-weight: 600; font-size: 10.5px; opacity: .8; }
.pro-dur-item .avg.ok { background: var(--pl-success-soft); color: var(--pl-success); }
.pro-dur-item .avg.bad { background: var(--pl-danger-soft); color: var(--pl-danger); }
.pro-dur-item .big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--pl-text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.pro-dur-item .big small { font-size: 12px; font-weight: 600; color: var(--pl-muted); letter-spacing: 0; }
.pro-dur-item .split { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--pl-surface-2); gap: 2px; }
.pro-dur-item .split i { display: block; height: 100%; }
.pro-dur-item .split .g { background: var(--pl-success); border-radius: 99px 0 0 99px; }
.pro-dur-item .split .r { background: var(--pl-danger); border-radius: 0 99px 99px 0; }
.pro-dur-item .leg { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; font-weight: 700; flex-wrap: wrap; color: var(--pl-muted); }
.pro-dur-item .leg .g { color: var(--pl-success); }
.pro-dur-item .leg .r { color: var(--pl-danger); }
.pro-dur-item.is-total { background: var(--pl-surface-2); }
.pro-dur-item .m, .pro-dur-item .v, .pro-dur-item .bar { display: none; }
/* total row stays but quieter, since the cards above carry it */
.pl-dash.pro .pro-dur tr.pro-total-row td { font-size: 12px !important; }
