/* ════════════════════════════════════════════════════════════
   Capacity Command Center
   ════════════════════════════════════════════════════════════
   Read-only dashboard. All persistent capacity data lives in
   Dataverse — no localStorage anywhere.

   Chrome (ph-nav, ph-sidebar, ph-content, wk-tab-panel) is
   copied verbatim from apps/Work/work.css so this app inherits
   the exact same visual language as Work / Process Hub.
*/

/* ─── PILL TAB NAV — identical to Work / Process Hub ──────────── */
.ph-nav-wrap {
  width: 100%; max-width: none; margin: 0 0 16px; padding: 0;
  position: sticky; top: 0; z-index: 800;
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(248,250,252,0.95));
  border: 1px solid var(--border, #e5e7eb); border-radius: 12px;
  box-shadow: var(--shadow-md, 0 4px 14px rgba(15,23,42,.06));
  overflow: hidden;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.ph-nav {
  display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; justify-content: center;
  background: transparent; border: none; padding: 8px 16px;
  width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.ph-nav::-webkit-scrollbar { height: 0; background: transparent; }
.ph-nav { scrollbar-width: none; }
.ph-nav-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 16px; font-size: 12.5px; font-weight: 600; color: #64748b;
  letter-spacing: .01em; cursor: pointer; background: none; border: none;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
  border-radius: 8px; white-space: nowrap; user-select: none; line-height: 1;
}
.ph-nav-btn + .ph-nav-btn::before {
  content: ''; position: absolute; left: -3px; top: 50%;
  width: 1px; height: 14px; transform: translateY(-50%);
  background: #cbd5e1; opacity: .45;
}
.ph-nav-btn:hover { color: #1e293b; background: rgba(15,23,42,.045); }
.ph-nav-btn.is-active {
  color: var(--c-blue, #2563eb);
  background: color-mix(in srgb, var(--c-blue, #2563eb) 8%, transparent);
}
.ph-nav-btn.is-active:hover { background: color-mix(in srgb, var(--c-blue, #2563eb) 12%, transparent); }
.ph-nav-btn.is-active::before { display: none; }
.ph-nav-badge {
  margin-left: 6px; min-width: 16px; height: 16px; border-radius: 9px;
  font-size: 9px; font-weight: 800; display: inline-flex; align-items: center;
  justify-content: center; padding: 0 4px; background: var(--c-red, #dc2626); color: #fff;
}
.ph-nav-badge:empty { display: none; }
@media (max-width: 700px) {
  .ph-nav { justify-content: flex-start; padding: 6px 10px; }
  .ph-nav-btn { padding: 5px 12px; font-size: 11.5px; }
}

/* Top-bar right side — window picker + refresh, sits in the same row as tabs */
.ph-nav-right {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px 0 8px;
  border-left: 1px solid #e5e7eb;
  margin-left: 6px;
}

/* ─── Tab panels (one per top tab) — smooth fade ─────────── */
.wk-tab-panel {
  display: none;
  opacity: 0;
}
.wk-tab-panel.is-active {
  display: block;
  opacity: 1;
  animation: cpFadeIn .26s cubic-bezier(.22,1,.36,1);
}
@keyframes cpFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── HUB GRID: SIDEBAR + CONTENT — identical to Work ──────── */
.ph-hub {
  display: grid; grid-template-columns: 220px 1fr 300px;
  gap: 16px; align-items: start; min-height: 500px;
}
.ph-hub--no-rail { grid-template-columns: 220px 1fr; }
@media (max-width: 1180px) {
  .ph-hub { grid-template-columns: 220px 1fr; }
  .cp-rightrail { display: none; }
}
@media (max-width: 900px) {
  .ph-hub, .ph-hub--no-rail { grid-template-columns: 1fr; }
}

.ph-sidebar {
  background: var(--surf, #fff); border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 12px); padding: 10px;
  position: sticky; top: 60px; align-self: start;
  max-height: calc(100vh - 80px); overflow-y: auto; z-index: 2;
  scrollbar-width: none;
}
.ph-sidebar::-webkit-scrollbar { display: none; }
@media (max-width: 900px) {
  .ph-sidebar { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
}
.ph-sb-label {
  font-size: 10px; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 6px 4px;
}
@media (max-width: 900px) { .ph-sb-label { display: none; } }
.ph-sb-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--ink, #0f172a); cursor: pointer;
  border: none; background: none; text-align: left;
  transition: background .15s ease, box-shadow .15s ease, color .15s ease, transform .15s ease;
}
.ph-sb-item:hover { background: rgba(255,255,255,0.5); transform: translateY(-1px); }
.ph-sb-item.is-active {
  background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  color: var(--c-blue, #2563eb);
}
@media (max-width: 900px) { .ph-sb-item { padding: 6px 12px; font-size: 11.5px; border-radius: 8px; } }
.ph-sb-icon {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex-shrink: 0;
}
.ph-sb-icon svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.ph-sb-badge {
  margin-left: auto; min-width: 18px; height: 18px; border-radius: 9px;
  font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px; flex-shrink: 0;
}
.ph-sb-badge:empty { display: none; }
.ph-sb-badge-red    { background: #dc2626; color: #fff; }
.ph-sb-badge-yellow { background: #f59e0b; color: #fff; }
.ph-sb-badge-blue   { background: #2563eb; color: #fff; }
.ph-sb-badge-green  { background: #16a34a; color: #fff; }

/* Content panel */
.ph-content { min-width: 0; }
.ph-sub { display: none; }
.ph-sub.is-active { display: block; }

/* ─── Sidebar status filter chips (visual style for non-list filters) ── */
.ph-sb-chip-row { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 6px 0; }
.ph-sb-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px;
  font-weight: 600; color: #64748b; background: #f1f5f9;
  border: 1px solid #e2e8f0; cursor: pointer;
}
.ph-sb-chip:hover { background: #e2e8f0; color: #0f172a; }
.ph-sb-chip.is-active {
  background: var(--c-blue, #2563eb); color: #fff;
  border-color: var(--c-blue, #2563eb);
}

.ph-sb-input {
  width: calc(100% - 12px); margin: 4px 6px;
  padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 6px;
  font-size: 12px; color: #0f172a;
}
.ph-sb-input:focus {
  outline: 2px solid var(--c-blue, #2563eb); outline-offset: -1px;
  border-color: transparent;
}

/* ─── KPI cards — clickable, animated ────────────────────────── */
.cp-kpi.ax-card { cursor: pointer; transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .2s; }
.cp-kpi.ax-card:hover { transform: translateY(-3px); }
.cp-kpi.ax-card:active { transform: scale(.97); }
.cp-kpi-val--state { font-size: clamp(15px, 2.2vw, 22px) !important; letter-spacing: -.4px !important; }
.cp-kpi .ax-card-val { transition: color .25s ease; }

/* Sidebar Health card — big colored panel */
.cp-health-card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--_hc, #16a34a) 12%, #fff), #fff);
  border: 1px solid color-mix(in srgb, var(--_hc, #16a34a) 35%, #e5e7eb);
  border-radius: 12px; padding: 14px 12px; margin: 4px 6px 8px;
  text-align: center;
  transition: border-color .3s, background .3s;
}
.cp-health-state {
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--_hc, #16a34a);
}
.cp-health-pct {
  font-size: 32px; font-weight: 900; color: #0f172a;
  letter-spacing: -.02em; line-height: 1; margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
.cp-health-sub { font-size: 11px; color: #94a3b8; }

/* ════════════════════════════════════════════════════════════
   Capacity-specific styles
   ════════════════════════════════════════════════════════════ */

/* ── Top bar ── */
.cp-topbar-right {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px;
}
.cp-window-select {
  padding: 5px 10px; border: 1px solid #d1d5db; border-radius: 6px;
  background: #fff; color: #0f172a; font-size: 13px; cursor: pointer;
}
.cp-window-select:hover { border-color: #94a3b8; }
.cp-refresh-btn {
  padding: 5px 12px; border: 1px solid #d1d5db; border-radius: 6px;
  background: #fff; color: #0f172a; font-size: 13px; cursor: pointer;
  font-weight: 600;
}
.cp-refresh-btn:hover { background: #f8fafc; border-color: #94a3b8; }

/* About-this-view block in sidebar */
.cp-sb-help {
  font-size: 12px; color: #475569; padding: 4px 8px;
}
.cp-help-row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.cp-help-k { color: #94a3b8; }
.cp-help-v { font-weight: 600; color: #0f172a; }

/* Content stack inside ph-content */
.cp-content-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ── KPIs ── */
.cp-kpis .ax-card { cursor: default; }
.cp-kpi {
  border: 1px solid #e5e7eb; border-radius: 12px; background: #fff;
  padding: 12px 14px; min-width: 130px;
}
.cp-kpi--health .ax-card-val {
  font-weight: 800; letter-spacing: -0.01em;
}

/* ── Section shell ── */
.cp-section {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 14px;
}
.cp-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.cp-section-title {
  margin: 0; font-size: 15px; font-weight: 700; color: #0f172a;
}
.cp-section-meta { font-size: 12px; color: #64748b; }
.cp-loading, .cp-empty {
  padding: 22px; text-align: center; color: #94a3b8; font-size: 13px;
}
.cp-error {
  padding: 14px; color: var(--c-red-dark, #991b1b);
  background: color-mix(in srgb, var(--c-red, #dc2626) 6%, #fff);
  border: 1px solid color-mix(in srgb, var(--c-red, #dc2626) 22%, #fff);
  border-radius: 8px; font-size: 13px;
}

/* ── Capacity map rows ── */
.cp-map-rows { display: flex; flex-direction: column; gap: 6px; }
.cp-map-row {
  background: #fafbfc; border: 1px solid #f1f5f9; border-radius: 8px;
  padding: 9px 12px; cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.cp-map-row:hover { background: #f1f5f9; border-color: #e2e8f0; }
.cp-map-row-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 6px; flex-wrap: wrap;
}
.cp-map-row-name {
  font-size: 13.5px; font-weight: 600; color: #0f172a;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cp-map-row-meta { font-size: 12px; color: #64748b; font-variant-numeric: tabular-nums; }
.cp-map-row-chips {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px;
  font-size: 11px;
}

/* ── Utilization bar ── */
.cp-bar {
  position: relative; height: 8px; border-radius: 999px; overflow: hidden;
  background: #e5e7eb;
}
.cp-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: #16a34a;
  transition: width .25s ease;
}
.cp-bar--yellow .cp-bar-fill { background: #f59e0b; }
.cp-bar--orange .cp-bar-fill { background: #ea580c; }
.cp-bar--red    .cp-bar-fill { background: #dc2626; }
.cp-bar--gray   .cp-bar-fill { background: #cbd5e1; }
.cp-bar-over {
  position: absolute; right: 0; top: 0; bottom: 0;
  background: repeating-linear-gradient(135deg, #b91c1c 0 4px, #7f1d1d 4px 8px);
  border-left: 1px solid #fff;
}
.cp-bar-label {
  position: absolute; right: 6px; top: -1px;
  font-size: 10px; font-weight: 700; color: #fff;
  text-shadow: 0 0 2px rgba(0,0,0,.4);
  font-variant-numeric: tabular-nums;
  line-height: 10px;
}

/* ── State dots & chips ── */
.cp-state-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  flex-shrink: 0;
}
.cp-state-dot--green  { background: #16a34a; }
.cp-state-dot--yellow { background: #f59e0b; }
.cp-state-dot--orange { background: #ea580c; }
.cp-state-dot--red    { background: #dc2626; }
.cp-state-dot--gray   { background: #cbd5e1; }

.cp-chip {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  background: #f1f5f9; color: #475569; font-weight: 600; font-size: 11px;
}
.cp-chip--red {
  background: color-mix(in srgb, #dc2626 12%, #fff);
  color: #991b1b;
}
.cp-chip--amber {
  background: color-mix(in srgb, #f59e0b 14%, #fff);
  color: #92400e;
}
.cp-chip--critical { background: #991b1b; color: #fff; }
.cp-chip--high { background: color-mix(in srgb, #dc2626 12%, #fff); color: #991b1b; }
.cp-chip--medium { background: color-mix(in srgb, #f59e0b 14%, #fff); color: #92400e; }
.cp-chip--low { background: #f1f5f9; color: #475569; }
.cp-chip--unknown { background: #f1f5f9; color: #94a3b8; }

.cp-badge--default {
  display: inline-block; font-size: 9.5px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 1px 5px; border-radius: 4px;
  background: #f1f5f9; color: #94a3b8;
}

.cp-muted { color: #94a3b8; font-weight: 400; }
.cp-muted-sm { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* ── Bottom grid ── */
.cp-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.cp-section--full { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .cp-bottom-grid { grid-template-columns: 1fr; }
}

/* ── Tables ── */
.cp-table-wrap { overflow-x: auto; }
.cp-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
.cp-table th {
  text-align: left; font-weight: 700; color: #64748b;
  font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  padding: 6px 8px; border-bottom: 1px solid #e5e7eb;
}
.cp-table td {
  padding: 8px; border-bottom: 1px solid #f1f5f9; vertical-align: top;
  color: #0f172a;
}
.cp-table tbody tr {
  cursor: pointer; transition: background .1s ease;
}
.cp-table tbody tr:hover { background: #f8fafc; }
.cp-table tbody tr:last-child td { border-bottom: 0; }

/* ── Timeline pressure ── */
.cp-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr); gap: 10px;
}
@media (max-width: 720px) {
  .cp-timeline { grid-template-columns: 1fr 1fr; }
}
.cp-timeline-week {
  background: #fafbfc; border: 1px solid #f1f5f9;
  border-radius: 8px; padding: 12px;
  border-left: 4px solid #16a34a;
}
.cp-timeline-week--yellow { border-left-color: #f59e0b; }
.cp-timeline-week--orange { border-left-color: #ea580c; background: color-mix(in srgb, #ea580c 5%, #fafbfc); }
.cp-timeline-week--red    { border-left-color: #dc2626; background: color-mix(in srgb, #dc2626 6%, #fafbfc); }
.cp-timeline-week-label { font-size: 11px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cp-timeline-week-pct { font-size: 24px; font-weight: 800; color: #0f172a; margin: 4px 0; font-variant-numeric: tabular-nums; }
.cp-timeline-week-meta { font-size: 11.5px; color: #64748b; }
.cp-timeline-week-warn {
  margin-top: 6px; font-size: 11px; font-weight: 700;
  color: #991b1b;
}

/* ── Right rail (recommended moves placeholder) ── */
.cp-rightrail {
  position: sticky; top: 60px; align-self: start;
  max-height: calc(100vh - 80px); overflow-y: auto;
}
.cp-rightrail::-webkit-scrollbar { display: none; }
.cp-rec-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 14px;
}
.cp-rec-card--soon {
  background: linear-gradient(180deg, color-mix(in srgb, #2563eb 4%, #fff), #fff);
  border-color: color-mix(in srgb, #2563eb 22%, #e5e7eb);
}
.cp-rec-head { margin-bottom: 8px; }
.cp-rec-tag {
  display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: #fff; background: #2563eb;
  padding: 2px 8px; border-radius: 999px;
}
.cp-rec-title { margin: 6px 0 0; font-size: 15px; font-weight: 700; color: #0f172a; }
.cp-rec-body { font-size: 12.5px; color: #475569; line-height: 1.5; }
.cp-rec-list-head {
  margin-top: 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #64748b;
}
.cp-rec-list { margin: 6px 0 0; padding-left: 18px; font-size: 12px; }
.cp-rec-list li { margin: 4px 0; color: #475569; }

/* ── Modal ── full-viewport, blurred backdrop, smooth open/close ── */
.cp-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.42);
  -webkit-backdrop-filter: blur(0px);
          backdrop-filter: blur(0px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .26s cubic-bezier(.22,1,.36,1),
              backdrop-filter .26s cubic-bezier(.22,1,.36,1),
              -webkit-backdrop-filter .26s cubic-bezier(.22,1,.36,1);
}
.cp-modal-overlay[data-open="true"] {
  opacity: 1; pointer-events: auto;
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}
@media (prefers-reduced-motion: reduce) {
  .cp-modal-overlay,
  .cp-modal-overlay[data-open="true"] .cp-modal { transition: none; }
}
.cp-modal {
  position: relative;
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 640px; max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(15, 23, 42, .28), 0 4px 12px rgba(15,23,42,.08);
  padding: 24px;
  transform: translateY(10px) scale(.96);
  opacity: 0;
  transition: transform .28s cubic-bezier(.22,1,.36,1),
              opacity   .22s cubic-bezier(.22,1,.36,1);
  will-change: transform, opacity;
}
.cp-modal-overlay[data-open="true"] .cp-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.cp-modal-close {
  position: absolute; top: 10px; right: 14px;
  background: transparent; border: 0; font-size: 26px; line-height: 1;
  color: #94a3b8; cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .18s ease, background .18s ease, transform .15s ease;
}
.cp-modal-close:hover { color: #0f172a; background: #f1f5f9; }
.cp-modal-close:active { transform: scale(.92); }
.cp-modal-head { margin-bottom: 16px; }
.cp-modal-tag {
  display: inline-block; font-size: 10px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: #2563eb;
  padding: 2px 8px; border-radius: 999px;
}
.cp-modal-tag--amber { background: #d97706; }
.cp-modal-head h2 { margin: 8px 0 4px; font-size: 20px; color: #0f172a; }
.cp-modal-sub { font-size: 12.5px; color: #64748b; }
.cp-modal-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px; margin-bottom: 14px;
}
.cp-modal-stat {
  background: #fafbfc; border: 1px solid #f1f5f9; border-radius: 8px;
  padding: 8px 10px;
}
.cp-modal-stat-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #94a3b8; margin-bottom: 2px;
}
.cp-modal-stat-val {
  font-size: 16px; font-weight: 700; color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.cp-modal-stat-val--green  { color: #16a34a; }
.cp-modal-stat-val--yellow { color: #d97706; }
.cp-modal-stat-val--orange { color: #ea580c; }
.cp-modal-stat-val--red    { color: #dc2626; }
.cp-modal-stat-val--critical { color: #991b1b; }
.cp-modal-stat-val--high { color: #dc2626; }
.cp-modal-stat-val--medium { color: #d97706; }
.cp-modal-stat-val--low { color: #16a34a; }
.cp-modal-note {
  font-size: 12px; color: #92400e;
  background: color-mix(in srgb, #d97706 10%, #fff);
  border: 1px solid color-mix(in srgb, #d97706 25%, #fff);
  border-radius: 6px; padding: 8px 10px; margin-bottom: 12px;
}
.cp-modal-block { margin-bottom: 14px; }
.cp-modal-block-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #64748b; margin-bottom: 4px;
}
.cp-modal-block-body {
  background: #fafbfc; border: 1px solid #f1f5f9; border-radius: 8px;
  padding: 10px; font-size: 13px; color: #0f172a; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.cp-modal-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px;
  padding-top: 14px; border-top: 1px solid #f1f5f9;
}
.cp-modal-form { margin-bottom: 14px; }
.cp-modal-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #64748b; margin-bottom: 6px;
}

/* ── Buttons ── */
.cp-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 6px; border: 1px solid #d1d5db;
  background: #fff; color: #0f172a; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.cp-btn:hover { background: #f8fafc; border-color: #94a3b8; }
.cp-btn:disabled { opacity: .5; cursor: not-allowed; }
.cp-btn--primary {
  background: #2563eb; color: #fff; border-color: #2563eb;
}
.cp-btn--primary:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.cp-btn--ghost { background: transparent; border-color: transparent; color: #64748b; }
.cp-btn--ghost:hover { background: #f1f5f9; color: #0f172a; }
.cp-btn--small { padding: 4px 10px; font-size: 12px; }

.cp-input-num {
  width: 110px; padding: 6px 10px;
  border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 14px; color: #0f172a;
  font-variant-numeric: tabular-nums;
}

/* ── Settings tab ── */
.cp-settings-body { display: flex; flex-direction: column; gap: 14px; }
.cp-settings-card {
  background: #fafbfc; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 14px;
}
.cp-settings-label {
  font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 4px;
}
.cp-settings-help { font-size: 12px; color: #64748b; margin-bottom: 10px; }
.cp-settings-row { display: flex; gap: 8px; align-items: center; }
.cp-settings-overrides { margin-top: 6px; }

/* ── Main-Dashboard widget (rendered into a host element on /Main-Dashboard.html) ── */
.cp-widget {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 14px; transition: box-shadow .15s ease;
}
.cp-widget:hover { box-shadow: 0 6px 20px rgba(15, 23, 42, .08); }
.cp-widget-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.cp-widget-title { font-size: 14px; font-weight: 700; color: #0f172a; }
.cp-widget-state {
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 999px;
  color: #fff;
}
.cp-widget-state--healthy  { background: #16a34a; }
.cp-widget-state--watch    { background: #f59e0b; }
.cp-widget-state--at-risk  { background: #dc2626; }
.cp-widget-state--critical { background: #991b1b; }
.cp-widget-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.cp-widget-cell {
  background: #fafbfc; border: 1px solid #f1f5f9; border-radius: 8px;
  padding: 8px 10px; text-align: center;
}
.cp-widget-num {
  font-size: 18px; font-weight: 800; color: #0f172a;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.cp-widget-lbl {
  font-size: 9.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #94a3b8; margin-top: 2px;
}
.cp-widget-loading, .cp-widget-error {
  padding: 18px; text-align: center; color: #94a3b8; font-size: 12px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
}
.cp-widget-error { color: #991b1b; }

/* ════════════════════════════════════════════════════════════
   STORAGE TAB — Dataverse capacity tracker
   ════════════════════════════════════════════════════════════ */

/* Gauge (big visual progress bar) */
.cp-section--gauge { background: linear-gradient(180deg, #fff, #fafbfc); }
.cp-gauge { padding: 8px 0 4px; }
.cp-gauge-row { padding: 8px 0 4px; }
.cp-gauge-bar-track {
  position: relative;
  height: 36px;
  background: #f1f5f9;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.cp-gauge-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: 18px 0 0 18px;
  transition: width .9s cubic-bezier(.22,1,.36,1), background .3s ease;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.08);
}
.cp-gauge-bar-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.18) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: cpShimmer 2.5s linear infinite;
  border-radius: 18px;
}
@keyframes cpShimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.cp-gauge-bar-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #0f172a;
  letter-spacing: -.01em;
  text-shadow: 0 0 6px rgba(255,255,255,.7);
  font-variant-numeric: tabular-nums;
}
.cp-gauge-legend {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; margin-top: 12px;
  font-size: 11.5px; color: #64748b;
}
.cp-gauge-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.cp-gauge-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
}
.cp-gauge-legend-spacer { flex: 1; min-width: 8px; }
.cp-gauge-legend-note { color: #94a3b8; font-style: italic; }

/* Per-bucket cards (DB / File / Log) */
.cp-buckets-section { margin-top: -4px; }
.cp-buckets {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 720px) {
  .cp-buckets { grid-template-columns: 1fr; }
}
.cp-bucket {
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 12px; padding: 14px 16px;
  transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .2s;
  position: relative; overflow: hidden;
}
.cp-bucket:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
}
.cp-bucket--db { border-color: color-mix(in srgb, #2563eb 22%, #e5e7eb); }
.cp-bucket-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.cp-bucket-icon { font-size: 16px; line-height: 1; }
.cp-bucket-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: #64748b;
}
.cp-bucket-val {
  font-size: 24px; font-weight: 800; color: #0f172a;
  margin: 4px 0 8px; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.cp-bucket-unit {
  font-size: 13px; font-weight: 600; color: #94a3b8;
  letter-spacing: 0;
}
.cp-bucket-bar {
  height: 6px; background: #f1f5f9; border-radius: 999px; overflow: hidden;
}
.cp-bucket-bar-fill {
  height: 100%;
  transition: width 1s cubic-bezier(.22,1,.36,1);
}
.cp-bucket-note {
  font-size: 11px; color: #94a3b8; margin-top: 8px;
}

/* Per-table breakdown table polish */
.cp-table--storage td.cp-num,
.cp-table--storage th.cp-num {
  text-align: right; font-variant-numeric: tabular-nums;
}
.cp-class {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase;
}
.cp-class--memo-heavy {
  background: color-mix(in srgb, #dc2626 12%, #fff);
  color: #991b1b;
}
.cp-class--wide {
  background: color-mix(in srgb, #f59e0b 14%, #fff);
  color: #92400e;
}
.cp-class--narrow {
  background: #f1f5f9; color: #475569;
}

.cp-pie-bar {
  position: relative;
  height: 18px; min-width: 80px;
  background: #f1f5f9; border-radius: 999px;
  overflow: hidden;
}
.cp-pie-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}
.cp-pie-bar-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #0f172a;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 4px rgba(255,255,255,.8);
}

/* Recommendations list */
.cp-rec-item {
  background: #fafbfc; border: 1px solid #e5e7eb;
  border-radius: 10px; padding: 12px 14px;
  margin-bottom: 8px;
  border-left: 4px solid #cbd5e1;
}
.cp-rec-item--critical { border-left-color: #991b1b; background: color-mix(in srgb, #dc2626 5%, #fafbfc); }
.cp-rec-item--high     { border-left-color: #dc2626; }
.cp-rec-item--medium   { border-left-color: #f59e0b; }
.cp-rec-item--low      { border-left-color: #2563eb; }
.cp-rec-item--info     { border-left-color: #16a34a; }
.cp-rec-item-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.cp-rec-item-sev {
  font-size: 9.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 999px;
  color: #fff;
}
.cp-rec-item-sev--critical { background: #991b1b; }
.cp-rec-item-sev--high     { background: #dc2626; }
.cp-rec-item-sev--medium   { background: #f59e0b; }
.cp-rec-item-sev--low      { background: #2563eb; }
.cp-rec-item-sev--info     { background: #16a34a; }
.cp-rec-item-title {
  font-size: 14px; font-weight: 700; color: #0f172a;
}
.cp-rec-item-body {
  font-size: 12.5px; color: #475569; line-height: 1.5;
}

/* Settings row (used by capacity settings tab + caps editor) */
.cp-settings-row {
  display: flex; gap: 8px; align-items: center;
}

/* ─── Heaviest tables list (overview tab) ───────────────────── */
.cp-toptables { display: flex; flex-direction: column; gap: 8px; }
.cp-toprow {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 12px 14px; cursor: pointer; text-align: left;
  width: 100%; font-family: inherit;
  transition: transform .18s cubic-bezier(.22,1,.36,1), border-color .18s, box-shadow .18s;
}
.cp-toprow:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, #2563eb 28%, #e5e7eb);
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
}
.cp-toprow:active { transform: scale(.98); }
.cp-toprow-rank {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: #f1f5f9; color: #64748b;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
}
.cp-toprow:nth-child(1) .cp-toprow-rank { background: color-mix(in srgb, #dc2626 14%, #fff); color: #991b1b; }
.cp-toprow:nth-child(2) .cp-toprow-rank { background: color-mix(in srgb, #f59e0b 16%, #fff); color: #92400e; }
.cp-toprow:nth-child(3) .cp-toprow-rank { background: color-mix(in srgb, #2563eb 14%, #fff); color: #1e3a8a; }
.cp-toprow-body { flex: 1; min-width: 0; }
.cp-toprow-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 6px;
}
.cp-toprow-name {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 13px; font-weight: 600; color: #0f172a;
}
.cp-toprow-size {
  font-size: 14px; color: #0f172a; font-variant-numeric: tabular-nums;
}
.cp-toprow-pie {
  height: 5px; background: #f1f5f9; border-radius: 999px; overflow: hidden;
  margin-bottom: 6px;
}
.cp-toprow-pie-fill {
  height: 100%; background: linear-gradient(90deg, #2563eb, #60a5fa);
  transition: width .8s cubic-bezier(.22,1,.36,1);
}
.cp-toprow-meta {
  font-size: 11.5px; color: #64748b;
}
.cp-toprow-arrow {
  color: #cbd5e1; font-size: 22px; line-height: 1;
  transition: transform .2s, color .2s;
}
.cp-toprow:hover .cp-toprow-arrow {
  color: #2563eb; transform: translateX(3px);
}

/* "View all →" link button */
.cp-link-btn {
  background: transparent; border: 0; padding: 4px 8px;
  color: var(--c-blue, #2563eb); font-weight: 600; font-size: 12.5px;
  cursor: pointer; border-radius: 6px;
  transition: background .15s;
}
.cp-link-btn:hover { background: color-mix(in srgb, #2563eb 8%, transparent); }

/* ─── Caps form (Settings tab) ──────────────────────────────── */
.cp-caps-form {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
@media (max-width: 720px) {
  .cp-caps-form { grid-template-columns: 1fr; }
}
.cp-caps-field {
  background: #fafbfc; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 14px;
}
.cp-caps-label {
  font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: #64748b; display: block;
  margin-bottom: 8px;
}
.cp-caps-input-row {
  display: flex; align-items: center; gap: 8px;
}
.cp-caps-input-row .cp-input-num {
  width: 100%; font-size: 18px; font-weight: 700;
}
.cp-caps-unit {
  font-size: 14px; font-weight: 700; color: #64748b;
}
.cp-caps-help {
  font-size: 11px; color: #94a3b8; margin-top: 8px; line-height: 1.4;
}
.cp-caps-actions {
  grid-column: 1 / -1;
  display: flex; gap: 12px; align-items: center;
  margin-top: 4px;
}
.cp-caps-status { font-size: 12.5px; font-weight: 600; color: #64748b; }
.cp-caps-status--ok  { color: #16a34a; }
.cp-caps-status--err { color: #dc2626; }

/* ─── Tables tab — staggered fade on rows ───────────────────── */
.cp-table tbody tr {
  animation: cpRowIn .35s cubic-bezier(.22,1,.36,1) both;
  cursor: pointer;
  transition: background .12s ease;
}
.cp-table tbody tr:hover { background: #f8fafc; }
.cp-table tbody tr:nth-child(1)  { animation-delay: 0ms; }
.cp-table tbody tr:nth-child(2)  { animation-delay: 30ms; }
.cp-table tbody tr:nth-child(3)  { animation-delay: 60ms; }
.cp-table tbody tr:nth-child(4)  { animation-delay: 90ms; }
.cp-table tbody tr:nth-child(5)  { animation-delay: 120ms; }
.cp-table tbody tr:nth-child(n+6) { animation-delay: 150ms; }
@keyframes cpRowIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Pie-bar (per-table share) — animate on render */
.cp-pie-bar-fill {
  transition: width .7s cubic-bezier(.22,1,.36,1);
}

/* Recommendation list — fade in stagger */
.cp-rec-item {
  animation: cpRowIn .35s cubic-bezier(.22,1,.36,1) both;
}
.cp-rec-item:nth-child(1) { animation-delay: 0ms; }
.cp-rec-item:nth-child(2) { animation-delay: 60ms; }
.cp-rec-item:nth-child(3) { animation-delay: 120ms; }
.cp-rec-item:nth-child(n+4) { animation-delay: 180ms; }

/* Smooth ph-nav-btn underline on active */
.ph-nav-btn { transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .15s ease; }
.ph-nav-btn:active { transform: scale(.97); }

/* ─── Multi-source: per-source card grid (Overview tab) ─────── */
.cp-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.cp-source-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
  padding: 16px 18px;
  text-align: left; cursor: pointer;
  font-family: inherit;
  position: relative;
  transition: transform .2s cubic-bezier(.22,1,.36,1), border-color .2s, box-shadow .2s;
  animation: cpCardIn .35s cubic-bezier(.22,1,.36,1) both;
}
.cp-source-card:nth-child(1) { animation-delay: 0ms; }
.cp-source-card:nth-child(2) { animation-delay: 60ms; }
.cp-source-card:nth-child(3) { animation-delay: 120ms; }
.cp-source-card:nth-child(4) { animation-delay: 180ms; }
.cp-source-card:nth-child(5) { animation-delay: 240ms; }
.cp-source-card:nth-child(n+6) { animation-delay: 300ms; }
@keyframes cpCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cp-source-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, #2563eb 28%, #e5e7eb);
  box-shadow: 0 8px 22px rgba(15,23,42,.08);
}
.cp-source-card:active { transform: scale(.98); }
.cp-source-card--off {
  background: linear-gradient(180deg, #fafbfc, #fff);
  border-style: dashed;
}
.cp-source-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.cp-source-card-name {
  font-size: 14px; font-weight: 700; color: #0f172a;
}
.cp-source-card-state {
  font-size: 9.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  color: #fff;
}
.cp-source-card-state--healthy  { background: #16a34a; }
.cp-source-card-state--watch    { background: #f59e0b; }
.cp-source-card-state--at-risk  { background: #dc2626; }
.cp-source-card-state--critical { background: #991b1b; }
.cp-source-card-state--off, .cp-source-card-state--unconfigured {
  background: #f1f5f9; color: #64748b;
}
.cp-source-card-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; margin-bottom: 8px;
}
.cp-source-card-val {
  font-size: 22px; font-weight: 800; color: #0f172a;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.cp-source-card-pct {
  font-size: 13px; font-weight: 700; color: #64748b;
  font-variant-numeric: tabular-nums;
}
.cp-source-card-bar {
  height: 6px; background: #f1f5f9; border-radius: 999px;
  overflow: hidden; margin-bottom: 8px;
}
.cp-source-card-bar-fill {
  height: 100%; transition: width 1s cubic-bezier(.22,1,.36,1);
}
.cp-source-card-foot {
  font-size: 11.5px; color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.cp-source-card-empty {
  font-size: 12px; color: #64748b; line-height: 1.5;
  padding: 4px 0;
}
.cp-source-card-arrow {
  position: absolute; top: 14px; right: 14px;
  color: #cbd5e1; font-size: 18px; line-height: 1;
  transition: color .2s, transform .2s;
}
.cp-source-card:hover .cp-source-card-arrow {
  color: #2563eb; transform: translateX(3px);
}

/* ─── Empty-state for an unconfigured source tab ────────────── */
.cp-empty--config {
  text-align: center; padding: 40px 24px;
  background: linear-gradient(180deg, #fafbfc, #fff);
  border: 1px dashed #e5e7eb; border-radius: 12px;
}
.cp-empty-emoji { font-size: 36px; line-height: 1; margin-bottom: 8px; }
.cp-empty-title {
  font-size: 16px; font-weight: 700; color: #0f172a; margin-bottom: 6px;
}
.cp-empty-body {
  font-size: 13px; color: #475569; line-height: 1.5;
  max-width: 480px; margin: 0 auto 14px;
}
.cp-empty-keys {
  font-size: 11.5px; color: #64748b; line-height: 1.7;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 12px 14px; max-width: 380px; margin: 0 auto;
  text-align: left;
}
.cp-empty-keys code {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 4px;
  padding: 1px 6px; font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px; color: #0f172a;
}
.cp-empty-actions {
  margin-top: 16px; display: flex; gap: 8px; justify-content: center;
}

/* Sidebar warn variant */
.cp-sb-help--warn {
  background: color-mix(in srgb, #f59e0b 10%, #fff);
  border-left: 3px solid #f59e0b;
  padding-left: 8px;
  border-radius: 4px;
}

/* ─── Storage Strategy section (Overview tab) ───────────────── */
.cp-section--strategy {
  background: linear-gradient(180deg, #fafbfc, #fff);
}
.cp-strategy-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 720px) {
  .cp-strategy-cards { grid-template-columns: 1fr; }
}
.cp-strat-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 16px 18px; position: relative;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.cp-strat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
}
.cp-strat-card--dataverse { border-color: color-mix(in srgb, #f59e0b 26%, #e5e7eb); }
.cp-strat-card--blob      { border-color: color-mix(in srgb, #16a34a 26%, #e5e7eb); }
.cp-strat-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.cp-strat-icon { font-size: 22px; line-height: 1; }
.cp-strat-name {
  margin: 0; font-size: 16px; font-weight: 800; color: #0f172a;
  flex: 1;
}
.cp-strat-price {
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
}
.cp-strat-card--dataverse .cp-strat-price {
  background: color-mix(in srgb, #f59e0b 14%, #fff); color: #92400e;
}
.cp-strat-card--blob .cp-strat-price {
  background: color-mix(in srgb, #16a34a 14%, #fff); color: #166534;
}
.cp-strat-section { margin-bottom: 10px; }
.cp-strat-section-label {
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: #64748b; margin-bottom: 4px;
}
.cp-strat-list {
  margin: 0; padding-left: 18px;
  font-size: 12.5px; color: #334155; line-height: 1.5;
}
.cp-strat-list li { margin: 3px 0; }
.cp-strat-list--avoid li::marker { color: #dc2626; }
.cp-strat-list--avoid li { color: #475569; }
.cp-strat-foot {
  font-size: 11.5px; color: #64748b; line-height: 1.5;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e5e7eb;
}

.cp-strat-rule {
  background: linear-gradient(135deg, color-mix(in srgb, #2563eb 6%, #fff), #fff);
  border: 1px solid color-mix(in srgb, #2563eb 22%, #e5e7eb);
  border-radius: 12px; padding: 14px 16px;
  margin-bottom: 14px;
}
.cp-strat-rule-head {
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--c-blue, #2563eb);
  margin-bottom: 6px;
}
.cp-strat-rule-body {
  font-size: 13.5px; color: #0f172a; line-height: 1.55;
}
.cp-strat-rule-body code {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 4px;
  padding: 1px 6px; font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
}

.cp-strat-savings {
  background: linear-gradient(135deg, color-mix(in srgb, #16a34a 7%, #fff), #fff);
  border: 1px solid color-mix(in srgb, #16a34a 25%, #e5e7eb);
  border-radius: 12px; padding: 14px 16px;
}
.cp-strat-savings-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.cp-strat-savings-tag {
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
  background: #16a34a; color: #fff;
}
.cp-strat-savings-title {
  font-size: 14px; font-weight: 700; color: #0f172a;
}
.cp-strat-savings-headline {
  display: flex; align-items: baseline; gap: 14px;
  padding: 8px 0 12px;
  border-bottom: 1px dashed #e5e7eb; margin-bottom: 12px;
}
.cp-strat-savings-num {
  font-size: 36px; font-weight: 900; color: #166534;
  letter-spacing: -.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cp-strat-savings-unit {
  font-size: 14px; font-weight: 700; color: #16a34a;
  margin-left: 4px;
}
.cp-strat-savings-sub {
  font-size: 12.5px; color: #475569;
}
.cp-table--strat th, .cp-table--strat td {
  padding: 7px 8px;
}
.cp-strat-savings-note {
  font-size: 11px; color: #94a3b8; margin-top: 8px;
  font-style: italic; line-height: 1.5;
}

/* ─── Strategy hero (top of Overview) ──────────────────────── */
.cp-strat-hero {
  margin-bottom: 16px;
  padding: 18px 22px;
  background: linear-gradient(135deg, color-mix(in srgb, #2563eb 6%, #fff), #fff 65%, color-mix(in srgb, #16a34a 5%, #fff));
  border: 1px solid color-mix(in srgb, #2563eb 18%, #e5e7eb);
  border-radius: 14px;
}
.cp-strat-hero-eyebrow {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--c-blue, #2563eb);
  margin-bottom: 6px;
}
.cp-strat-hero-title {
  margin: 0 0 8px; font-size: 22px; font-weight: 800; color: #0f172a;
  letter-spacing: -.02em; line-height: 1.2;
}
.cp-strat-hero-sub {
  font-size: 14px; color: #334155; line-height: 1.55;
  max-width: 720px;
}
.cp-strat-hero-sub em { font-style: italic; color: #0f172a; }

/* ─── FAQ Q&A blocks ───────────────────────────────────────── */
.cp-strat-faq {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 16px;
}
.cp-strat-faq-q {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.cp-strat-faq-q:hover {
  border-color: color-mix(in srgb, #2563eb 22%, #e5e7eb);
  box-shadow: 0 4px 12px rgba(15,23,42,.04);
}
.cp-strat-faq-icon {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: color-mix(in srgb, #2563eb 12%, #fff);
  color: var(--c-blue, #2563eb);
  font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.cp-strat-faq-qtext {
  font-size: 14px; font-weight: 700; color: #0f172a;
  margin-bottom: 6px;
}
.cp-strat-faq-a {
  font-size: 13px; color: #475569; line-height: 1.55;
}
.cp-strat-faq-a strong { color: #0f172a; }
.cp-strat-faq-a em { color: #0f172a; }
.cp-strat-faq-a code {
  background: #f1f5f9; border-radius: 4px; padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px; color: #0f172a;
}

/* ─── In-practice pattern grid ─────────────────────────────── */
.cp-strat-pattern {
  background: #fafbfc; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 14px 16px; margin-bottom: 14px;
}
.cp-strat-pattern-head {
  font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: #64748b; margin-bottom: 10px;
}
.cp-strat-pattern-grid { display: flex; flex-direction: column; gap: 6px; }
.cp-strat-pattern-row {
  display: grid;
  grid-template-columns: minmax(160px, 200px) 130px 1fr;
  gap: 12px; align-items: center;
  padding: 8px 10px; border-radius: 8px;
  background: #fff; border: 1px solid #f1f5f9;
}
@media (max-width: 720px) {
  .cp-strat-pattern-row { grid-template-columns: 1fr; gap: 4px; }
}
.cp-strat-pattern-row--watch {
  background: color-mix(in srgb, #f59e0b 4%, #fff);
  border-color: color-mix(in srgb, #f59e0b 22%, #f1f5f9);
}
.cp-strat-pattern-data {
  font-size: 13px; font-weight: 600; color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.cp-strat-pattern-data code {
  background: #f1f5f9; border-radius: 4px; padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
}
.cp-strat-pattern-loc {
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  text-align: center;
}
.cp-strat-pattern-loc--dv    { background: color-mix(in srgb, #f59e0b 14%, #fff); color: #92400e; }
.cp-strat-pattern-loc--blob  { background: color-mix(in srgb, #16a34a 14%, #fff); color: #166534; }
.cp-strat-pattern-loc--watch { background: color-mix(in srgb, #f59e0b 22%, #fff); color: #92400e; }
.cp-strat-pattern-why {
  font-size: 12px; color: #475569; line-height: 1.45;
}
.cp-strat-pattern-why code {
  background: #f1f5f9; border-radius: 4px; padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
}

/* ─── Sidebar source row (Overview tab) ────────────────────── */
.cp-sidebar-source-row {
  display: grid !important;
  grid-template-columns: auto 1fr auto;
  gap: 8px; align-items: center;
}
.cp-sidebar-source-name { font-weight: 600; }
.cp-sidebar-source-status {
  font-size: 11px; font-weight: 700; color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.cp-sidebar-source-row .cp-state-dot--gray { background: #cbd5e1; }
.cp-sidebar-source-row .cp-state-dot--unconfigured { background: #cbd5e1; }
.cp-sidebar-source-row .cp-state-dot--healthy  { background: #16a34a; }
.cp-sidebar-source-row .cp-state-dot--watch    { background: #f59e0b; }
.cp-sidebar-source-row .cp-state-dot--at-risk  { background: #dc2626; }
.cp-sidebar-source-row .cp-state-dot--critical { background: #991b1b; }

/* ─── Page header (title + ? info button) ──────────────────── */
.cp-page-header {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px;
}
.cp-page-title {
  margin: 0; font-size: 22px; font-weight: 800; color: #0f172a;
  letter-spacing: -.02em; line-height: 1.2;
}
.cp-info-btn {
  flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: #f1f5f9; border: 1px solid #e2e8f0;
  color: #64748b; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit;
  transition: background .15s, color .15s, transform .12s;
}
.cp-info-btn:hover {
  background: color-mix(in srgb, #2563eb 12%, #fff);
  color: #2563eb;
  border-color: color-mix(in srgb, #2563eb 30%, #e2e8f0);
}
.cp-info-btn:active { transform: scale(.92); }
.cp-info-btn--inline { width: 22px; height: 22px; }
.cp-info-mark { font-weight: 800; font-size: 14px; line-height: 1; }
.cp-info-btn--inline .cp-info-mark { font-size: 12px; }

/* ─── Info modal (shared by overview + per-source `?` buttons) ── */
.cp-modal-head--info {
  text-align: center; padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9; margin-bottom: 14px;
}
.cp-modal-head--info h2 { margin: 6px 0 4px; font-size: 22px; }
.cp-modal-head--amber  { color: #92400e; }
.cp-modal-head--green  { color: #166534; }
.cp-modal-head--blue   { color: #1e3a8a; }
.cp-modal-head--purple { color: #581c87; }
.cp-modal-info-icon {
  font-size: 36px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%;
  background: #f1f5f9;
  margin: 0 auto 4px;
}
.cp-modal-head--amber  .cp-modal-info-icon { background: color-mix(in srgb, #f59e0b 14%, #fff); }
.cp-modal-head--green  .cp-modal-info-icon { background: color-mix(in srgb, #16a34a 14%, #fff); }
.cp-modal-head--blue   .cp-modal-info-icon { background: color-mix(in srgb, #2563eb 14%, #fff); }
.cp-modal-head--purple .cp-modal-info-icon { background: color-mix(in srgb, #7c3aed 14%, #fff); }

.cp-info-block { padding: 12px 14px; margin-bottom: 8px; background: #fafbfc; border: 1px solid #f1f5f9; border-radius: 10px; }
.cp-info-block .cp-info-row-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: #64748b; margin-bottom: 4px;
}
.cp-info-row-text {
  font-size: 13px; color: #334155; line-height: 1.55;
}
.cp-info-row-text strong { color: #0f172a; }
.cp-info-row-text em { color: #0f172a; font-style: italic; }
.cp-info-row-text code, .cp-info-block code {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 4px;
  padding: 1px 6px; font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px; color: #0f172a;
}
.cp-info-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cp-info-example {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 4px;
  padding: 1px 7px; font-size: 12px;
}
.cp-info-pattern { display: flex; flex-direction: column; gap: 6px; }
.cp-info-pat-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 6px 10px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 6px;
  font-size: 12.5px; flex-wrap: wrap;
}
.cp-info-pat-tag {
  font-size: 9.5px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 999px;
}
.cp-info-pat-tag--dv    { background: color-mix(in srgb, #f59e0b 14%, #fff); color: #92400e; }
.cp-info-pat-tag--blob  { background: color-mix(in srgb, #16a34a 14%, #fff); color: #166534; }
.cp-info-pat-tag--watch { background: color-mix(in srgb, #f59e0b 22%, #fff); color: #92400e; }

/* ─── Setup help (Azure Portal step-by-step on auth errors) ─── */
.cp-setup-help {
  margin-top: 14px; padding: 14px;
  background: color-mix(in srgb, #2563eb 5%, #fff);
  border: 1px solid color-mix(in srgb, #2563eb 22%, #e5e7eb);
  border-radius: 10px;
  text-align: left;
  max-width: 520px;
  margin-left: auto; margin-right: auto;
}
.cp-setup-help-title {
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: #1e3a8a; margin-bottom: 8px;
}
.cp-setup-list {
  margin: 0; padding-left: 22px;
  font-size: 12.5px; color: #334155; line-height: 1.6;
}
.cp-setup-list li { margin: 4px 0; }
.cp-setup-list code {
  background: #fff; border: 1px solid #cbd5e1; border-radius: 4px;
  padding: 1px 6px; font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11.5px; color: #0f172a;
}

/* Compact strategy section (Overview tab) */
.cp-strategy-compact .cp-section-head { gap: 8px; }
.cp-strategy-compact .cp-strat-rule {
  margin-bottom: 12px; padding: 10px 14px;
}
.cp-strategy-compact .cp-strat-rule-body {
  font-size: 13px; line-height: 1.5;
}
.cp-strategy-compact .cp-strat-card { padding: 14px 16px; }
.cp-strategy-compact .cp-strat-card .cp-strat-section { margin-bottom: 0; }
.cp-strategy-compact .cp-strat-card .cp-strat-foot { display: none; }

/* ─── Per-source "What this is for" intro card ─────────────── */
.cp-intro {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
  padding: 16px 18px;
  border-left: 4px solid #94a3b8;
  animation: cpFadeIn .26s cubic-bezier(.22,1,.36,1);
}
.cp-intro--amber  { border-left-color: #f59e0b; background: linear-gradient(135deg, color-mix(in srgb, #f59e0b 4%, #fff), #fff); }
.cp-intro--green  { border-left-color: #16a34a; background: linear-gradient(135deg, color-mix(in srgb, #16a34a 4%, #fff), #fff); }
.cp-intro--blue   { border-left-color: #2563eb; background: linear-gradient(135deg, color-mix(in srgb, #2563eb 4%, #fff), #fff); }
.cp-intro--purple { border-left-color: #7c3aed; background: linear-gradient(135deg, color-mix(in srgb, #7c3aed 4%, #fff), #fff); }
.cp-intro-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
}
.cp-intro-icon { font-size: 30px; line-height: 1; flex-shrink: 0; }
.cp-intro-text { flex: 1; min-width: 0; }
.cp-intro-name {
  font-size: 18px; font-weight: 800; color: #0f172a;
  letter-spacing: -.01em; line-height: 1.1;
}
.cp-intro-tagline {
  font-size: 13px; color: #475569; margin-top: 4px;
  font-style: italic;
}
.cp-intro-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 4px 0 4px;
}
.cp-intro-row {
  font-size: 12.5px; color: #334155; line-height: 1.5;
}
.cp-intro-row-label {
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: #64748b; margin-bottom: 4px;
}
.cp-intro-row-text { color: #334155; }
.cp-intro-examples {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed #e5e7eb;
  font-size: 11.5px; color: #64748b; line-height: 1.7;
}
.cp-intro-examples-label {
  font-weight: 700; color: #64748b; margin-right: 4px;
}
.cp-intro-examples code {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 4px;
  padding: 1px 6px; font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px; color: #0f172a;
}

/* ─── Freshness footer (per-source tabs) ───────────────────── */
.cp-freshness {
  text-align: center;
  font-size: 11px; color: #94a3b8;
  padding: 6px 0 0;
  font-style: italic;
}

/* ─── Per-tone caps fields (Settings tab) ──────────────────── */
.cp-caps-field--amber  { border-left: 3px solid #f59e0b; padding-left: 14px; }
.cp-caps-field--green  { border-left: 3px solid #16a34a; padding-left: 14px; }
.cp-caps-field--blue   { border-left: 3px solid #2563eb; padding-left: 14px; }
.cp-caps-field--purple { border-left: 3px solid #7c3aed; padding-left: 14px; }
.cp-caps-form { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .cp-caps-form { grid-template-columns: 1fr 1fr; }
}
.cp-caps-foot {
  grid-column: 1 / -1;
  font-size: 11.5px; color: #64748b; line-height: 1.55;
  padding: 12px 14px; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 8px;
  margin-top: 6px;
}
.cp-caps-foot code {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 4px;
  padding: 1px 6px; font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px; color: #0f172a;
}

/* ─── Unconfigured sources collapsible ─────────────────────── */
.cp-unconfigured-block {
  margin-top: 14px;
  background: #fafbfc; border: 1px dashed #e5e7eb; border-radius: 12px;
  overflow: hidden;
}
.cp-unconfigured-block[open] {
  background: #fff; border-style: solid;
}
.cp-unconfigured-summary {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; cursor: pointer; user-select: none;
  font-size: 13px; color: #475569; font-weight: 600;
  list-style: none;
  transition: background .15s;
}
.cp-unconfigured-summary::-webkit-details-marker { display: none; }
.cp-unconfigured-summary:hover { background: #f1f5f9; }
.cp-unconfigured-icon { font-size: 16px; }
.cp-unconfigured-text { flex: 1; }
.cp-unconfigured-toggle {
  color: #94a3b8; transition: transform .2s;
}
.cp-unconfigured-block[open] .cp-unconfigured-toggle { transform: rotate(180deg); }
.cp-unconfigured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  padding: 4px 14px 14px;
}

/* ─── Global polish: shared transitions on every interactive surface ─── */
.cp-health-card {
  transition: transform .22s cubic-bezier(.22,1,.36,1),
              box-shadow .22s ease,
              border-color .22s ease;
}
.cp-health-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(15,23,42,.07);
}
.cp-info-btn { transition: transform .18s cubic-bezier(.22,1,.36,1), background .18s ease, color .18s ease, box-shadow .18s ease; }
.cp-info-btn:hover { box-shadow: 0 4px 14px rgba(37,99,235,.18); }

/* Bucket-card grid hover (per-source 'cp-bucket' detail cards) */
.cp-bucket { cursor: pointer; }
.cp-bucket:active { transform: scale(.985); }

/* Bucket table rows already have cursor + bg hover; add a subtle slide */
.cp-table tbody tr {
  transition: background .15s ease, transform .15s ease;
}
.cp-table tbody tr:hover { transform: translateX(2px); }
.cp-table tbody tr:active { transform: translateX(2px) scale(.998); }

/* ─── Skeleton shimmer for loading states ─── */
.cp-skel {
  position: relative; overflow: hidden;
  background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 50%, #eef2f7 100%);
  background-size: 200% 100%;
  border-radius: 8px;
  animation: cpSkelShimmer 1.4s linear infinite;
}
@keyframes cpSkelShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.cp-skel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.cp-skel-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.cp-skel-line { height: 12px; }
.cp-skel-line--lg { height: 22px; }
.cp-skel-line--w70 { width: 70%; }
.cp-skel-line--w40 { width: 40%; }
.cp-skel-line--w90 { width: 90%; }

/* Setup-help block (one-click admin consent + manual fallback) */
.cp-setup-help {
  margin-top: 14px; padding: 14px;
  background: linear-gradient(180deg,#f5f3ff,#fff);
  border: 1px solid color-mix(in srgb,#7c3aed 22%,#e5e7eb);
  border-radius: 12px; text-align: left;
}
.cp-setup-help-title {
  font-size: 13px; font-weight: 800; color: #4c1d95; margin-bottom: 4px;
}
.cp-setup-help-body { font-size: 12.5px; color: #475569; line-height: 1.5; margin-bottom: 10px; }
.cp-setup-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cp-setup-manual { font-size: 12px; color: #64748b; margin-top: 6px; }
.cp-setup-manual summary { cursor: pointer; user-select: none; padding: 4px 0; }
.cp-setup-list { padding-left: 22px; margin: 6px 0 0; }
.cp-setup-list li { margin: 4px 0; line-height: 1.5; }

/* Indeterminate progress bar — for slow Graph fan-outs */
.cp-progress {
  position: relative; height: 4px; width: 100%;
  background: #eef2f7; border-radius: 999px; overflow: hidden;
  margin: 8px 0 14px;
}
.cp-progress::after {
  content: "";
  position: absolute; top: 0; left: -40%;
  width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, #2563eb 50%, transparent 100%);
  animation: cpProgressSlide 1.2s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes cpProgressSlide {
  to { left: 100%; }
}

/* The text loader fades in, doesn't pop */
.cp-loading {
  animation: cpFadeIn .25s ease both;
}

