/* Dashboard reference 4: compact charcoal business surfaces.
   Presentation only: original values, disclosure state and commands are retained. */
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) {
  --dashboard-surface: #161b24;
  --dashboard-inset: #1d232e;
  --dashboard-line: #303743;
  color: #e7ecf3;
  font-size: 13px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-original-card {
  min-width: 0;
  padding: 12px 14px;
  margin: 0 0 10px;
  border: 1px solid var(--dashboard-line) !important;
  border-radius: 12px !important;
  background: var(--dashboard-surface) !important;
  box-shadow: none !important;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content .wb-cockpit-board {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) :is(.dashboard-card-header h3,.wb-cockpit-disclosure>summary h3) {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 650;
  color: #edf2f8 !important;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-card-header {
  gap: 8px;
  margin-bottom: 10px;
  padding: 0;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) :is(.dashboard-middle,.wb-cockpit-middle) {
  display: grid;
  grid-template-columns: minmax(0,1.4fr) minmax(300px,1fr);
  align-items: stretch;
  gap: 10px;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-health-grid {
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 8px;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-health-card {
  position: relative;
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
  gap: 4px;
  border: 1px solid var(--dashboard-line) !important;
  border-radius: 8px !important;
  background: var(--dashboard-inset) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-health-card>div { min-width: 0; padding-right: 44px; gap: 6px; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-health-card strong { font-size: 12px; overflow-wrap: anywhere; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-health-card .health-status {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1.5;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-health-card small {
  color: #a9b5c5 !important;
  font-size: 12px;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-metrics-grid {
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-metric {
  position: relative;
  height: auto;
  min-height: 128px;
  padding: 12px;
  border: 1px solid #39414e !important;
  border-radius: 9px !important;
  background: #242b36 !important;
  box-shadow: inset 0 1px rgba(255,255,255,.025) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-metric>div { gap: 7px; font-size: 12px; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-metric>div>b {
  width: 24px;
  height: 24px;
  padding: 4px;
  border-radius: 6px;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-metric>strong {
  margin: 8px 0 4px;
  font-size: 23px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -.02em;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-metric>small { font-size: 12px; line-height: 1.5; padding-right: 34px; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-metric .dashboard-sparkline {
  width: 72px;
  height: 25px;
  margin-top: 5px;
  align-self: flex-end;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-risk-row {
  min-height: 58px;
  padding: 9px 11px;
  margin: 0 0 7px;
  border: 1px solid var(--dashboard-line) !important;
  border-radius: 8px;
  background: var(--dashboard-inset) !important;
  color: #e7ecf3 !important;
  gap: 10px;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-risk-row strong { font-size: 13px; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-risk-row small { margin-top: 2px; color: #a9b5c5 !important; font-size: 12px; line-height: 1.4; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-risk-row>b { font-size: 17px; font-weight: 600; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-risk-row:hover:not(:disabled) { border-color: #5a6b80 !important; background: #242d39 !important; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-action-grid {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  gap: 7px;
  background: transparent !important;
  border: 0 !important;
  padding: 0;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .wb-cockpit-actions { display: block; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .wb-cockpit-actions>.dashboard-card-header { margin-bottom: 9px; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-action-grid .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 36px !important;
  height: auto !important;
  padding: 7px 10px !important;
  border: 1px solid #343e4e !important;
  border-radius: 7px;
  background: #202735 !important;
  color: #e2e9f3 !important;
  font-size: 12px !important;
  line-height: 1.5;
  white-space: normal;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-ranking-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-ranking-row {
  min-height: 39px;
  padding: 8px 2px;
  border-color: #262e39;
  font-size: 13px;
  gap: 9px;
}
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-ranking-row>b { width: 20px; color: #5debc9 !important; background: #153c37; border-radius: 5px; font-size: 12px; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-ranking-row :is(strong,small) { white-space: nowrap; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-ranking-row small { font-size: 12px; color: #a9b5c5 !important; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .wb-cockpit-ranking-list { min-height: 0; max-height: 210px; }
/* Closed sections still show the real summaries; opening keeps all details. */
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .wb-cockpit-disclosure>summary { gap: 10px; min-height: 30px; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .wb-cockpit-summary { font-size: 12px; line-height: 1.6; gap: 7px 14px; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) [data-cockpit-panel="health"] .wb-cockpit-summary { flex-wrap: wrap; overflow: visible; white-space: normal; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) [data-cockpit-panel="metrics"] .wb-cockpit-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px 10px; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) [data-cockpit-panel="metrics"] .wb-cockpit-summary>span { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; white-space: normal; font-size: 12px; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) [data-cockpit-panel="metrics"] .wb-cockpit-summary>span>b { font-size: 21px; line-height: 1.35; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) [data-cockpit-panel="risks"] .wb-cockpit-summary { max-height: none; overflow: visible; }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .wb-disclosure-body { padding-top: 10px; margin-top: 10px; border-color: var(--dashboard-line); }
html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .wb-disclosure-body>.dashboard-original-card { margin: 0; padding: 0; border: 0 !important; background: transparent !important; }
@media (max-width: 1050px) {
  html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) :is(.dashboard-middle,.wb-cockpit-middle) { grid-template-columns: minmax(0,1fr); }
  html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-action-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-health-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) :is(.dashboard-metrics-grid,.dashboard-action-grid) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-ranking-grid { grid-template-columns: minmax(0,1fr); }
  html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) .dashboard-action-grid .button { min-height: 44px !important; }
  html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) [data-cockpit-panel="metrics"] .wb-cockpit-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* Keep the six metric summaries on one row on wide dashboards. */
@media (min-width: 1151px) {
  html:root[data-theme="dark"][data-shx-theme] body #app-view #page-content :is(#dashboard-original,.wb-cockpit-board) [data-cockpit-panel="metrics"] .wb-cockpit-summary { grid-template-columns: repeat(6,minmax(0,1fr)); }
}
