/* Case inspection reuses the original detail/editor; document templates are untouched. */
:root { --case-data-ink: #000; }
html[data-sahamit-screen="dashboard"][data-theme="dark"] { --case-data-ink: #f5f6fa; }
@media(prefers-color-scheme:dark) {
  html[data-sahamit-screen="dashboard"]:not([data-theme="light"]) { --case-data-ink: #f5f6fa; }
}
html[data-sahamit-screen="dashboard"] .sidebar :is(.nav-group-label,.nav-item:not(.disabled),.nav-item:not(.disabled) .label,.nav-item:not(.disabled) .icon) { color:var(--case-data-ink); }
html[data-sahamit-screen="dashboard"] .sidebar .nav-item.active { background:var(--ui-primary-soft); color:var(--case-data-ink); box-shadow:inset 3px 0 var(--ui-primary); }
html[data-sahamit-screen="dashboard"] .claims-table :is(th,td,button,.status-pill,.claim-no) { color:var(--case-data-ink); }
html[data-sahamit-screen="dashboard"] .claims-table .claim-case-link { font:inherit; border:0; padding:0; background:none; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.report-case-backdrop { position:fixed; inset:0; z-index:43; background:rgb(32 35 43 / 7%); }
body.report-case-inspecting { overflow:hidden!important; }
.report-case-pane,.dashboard-case-pane {
  position:fixed; top:14px; right:14px; bottom:14px; width:min(920px,60vw);
  display:flex; flex-direction:column; min-width:0; overflow:hidden;
  border:1px solid var(--ui-line); border-radius:var(--ui-panel-radius);
  background:var(--ui-surface); color:var(--ui-ink); font-family:var(--ui-font);
  box-shadow:-8px 0 28px rgb(32 35 43 / 12%);
}
.report-case-pane { z-index:44; container-type:inline-size; }
.dashboard-case-pane { z-index:10010; width:min(920px,55vw); }
/* Inspecting a combined workspace temporarily prioritises the list, without changing
   saved graph mode, graph filters, chart instances or table state. Closing restores it. */
body.dashboard-case-inspecting #graph-claims-workspace { display:block!important; }
body.dashboard-case-inspecting :is(#dashboard-body,#graph-claims-divider) { display:none!important; }
.report-case-pane.is-full,.dashboard-case-pane.is-full { left:14px; width:auto; }
.case-inspect-header { flex:none; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; padding:12px; border-bottom:1px solid var(--ui-line); background:var(--ui-surface); }
.case-inspect-header h1,.case-inspect-header h2 { margin:0; font-size:20px; font-weight:600; overflow-wrap:anywhere; }
.case-inspect-header p { margin:3px 0 0; font-size:12px; color:var(--ui-muted); }
.case-inspect-actions,.case-inspect-navigation { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.case-inspect-navigation { width:100%; font-size:12px; }
.case-inspect-body { flex:1; min-height:0; overflow:auto; padding:12px; overscroll-behavior:contain; }
.report-case-pane .case-banner { flex-wrap:wrap; }
.report-case-pane .case-workspace-grid :is(.form-panel,.documents-live) { max-height:calc(100dvh - 238px); }
.report-case-pane .formula-overrides { margin-top:12px; }
.dashboard-case-pane > .claim-detail-page { flex:1; min-height:0; overflow:auto; padding:12px; overscroll-behavior:contain; }
.dashboard-case-pane .detail-lookup-card { flex-wrap:wrap; }
.dashboard-case-pane .detail-back-btn { display:none; }
.dashboard-case-pane:not(.is-full) :is(.detail-hero-metrics,.detail-grid,.workflow-layout) { grid-template-columns:repeat(2,minmax(0,1fr)); }
.dashboard-case-pane:not(.is-full) .detail-search { min-width:0; }
.dashboard-case-pane .claim-detail-tabs { overflow-x:auto; }
@container(max-width:720px) {
  .report-case-pane .stage-detail.case-workspace-grid { grid-template-columns:minmax(0,1fr); }
  .report-case-pane .case-workspace-grid .form-panel { grid-column:1; grid-row:1; max-height:none; }
  .report-case-pane .case-workspace-grid .documents-live { grid-column:1; grid-row:2; max-height:none; }
}
@media(max-width:900px) {
  .report-case-pane,.dashboard-case-pane,.report-case-pane.is-full,.dashboard-case-pane.is-full { inset:0; width:100%; border-radius:0; }
  .case-inspect-header { padding:10px; }
  .case-inspect-actions { gap:4px; }
  .case-inspect-body,.dashboard-case-pane > .claim-detail-page { padding:8px; }
}
@media(max-width:500px) {
  .report-case-pane .live-grid { grid-template-columns:minmax(0,1fr); }
  .dashboard-case-pane :is(.detail-hero-metrics,.detail-grid,.workflow-layout) { grid-template-columns:minmax(0,1fr); }
}
