/* Visual dashboard system. Scoped to .vd; no business screens are restyled. */
#tab-dashboard > .dashboard-dashboard {
  display: none !important;
}
.vd {
  --vd-bg: #f4f7fb;
  --vd-surface: #ffffff;
  --vd-ink: #142138;
  --vd-muted: #607089;
  --vd-line: #dde5ef;
  --vd-soft: #edf3fa;
  --vd-blue: #2874db;
  --vd-accent: var(--site-primary, #2874db);
  color: var(--vd-ink);
  display: grid;
  gap: 24px;
  min-width: 0;
  margin: 0 auto 28px;
  max-width: 1520px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  line-height: 1.5;
}
html[data-mu-theme="night"] .vd {
  --vd-bg: #0d1420;
  --vd-surface: #162132;
  --vd-ink: #e6edf8;
  --vd-muted: #a9bad1;
  --vd-line: #304057;
  --vd-soft: #1f2e43;
  --vd-blue: #73a8f1;
}
html[data-site-custom="true"]:not([data-mu-theme="night"]) .vd {
  --vd-surface: var(--site-surface);
  --vd-ink: var(--site-text);
}
.vd * {
  box-sizing: border-box;
  min-width: 0;
}
.vd [hidden] {
  display: none !important;
}
.vd button,
.vd select,
.vd input {
  font: inherit;
}
.vd button:focus-visible,
.vd input:focus-visible,
.vd select:focus-visible,
.vd summary:focus-visible {
  outline: 3px solid #80b7ff;
  outline-offset: 3px;
}
.vd h2,
.vd h3,
.vd h4,
.vd p {
  margin: 0;
}
.vd-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border: 1px solid var(--vd-line);
  border-radius: 16px;
  background: var(--vd-surface);
}
.vd-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: var(--vd-muted);
  margin-bottom: 12px !important;
}
.vd-heading h2 {
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1.2;
  letter-spacing: -1px;
  color: var(--vd-ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}
.vd-heading-copy {
  font-size: 14px;
  color: var(--vd-muted);
  margin-top: 12px !important;
  max-width: 640px;
}
.vd-model-badge {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  padding: 10px 14px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  background: var(--vd-soft);
}
.vd[data-model="analytics"] .vd-heading,
.vd[data-model="operations"] .vd-heading,
.vd[data-model="sales"] .vd-heading {
  background: linear-gradient(115deg, #122442, #185795);
  color: #fff;
  border: 0;
}
.vd[data-model="operations"] .vd-heading {
  background: linear-gradient(115deg, #113c43, #147d79);
}
.vd[data-model="sales"] .vd-heading {
  background: linear-gradient(115deg, #292447, #66509d);
}
.vd[data-model="analytics"] .vd-heading :is(h2, p),
.vd[data-model="operations"] .vd-heading :is(h2, p),
.vd[data-model="sales"] .vd-heading :is(h2, p) {
  color: inherit;
}
.vd[data-model="analytics"] .vd-model-badge,
.vd[data-model="operations"] .vd-model-badge,
.vd[data-model="sales"] .vd-model-badge {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}
.vd[data-model="finance"] .vd-heading {
  border-left: 5px solid #66509d;
}
.vd[data-model="projects"] .vd-heading {
  border-top: 4px solid #2874db;
  border-radius: 4px 4px 14px 14px;
}
.vd-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: -4px;
}
.vd-toolbar label {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  gap: 12px;
  align-items: center;
}
.vd-toolbar select {
  min-height: 44px;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  background: var(--vd-surface);
  color: var(--vd-ink);
}
.vd-updated {
  font-size: 13px;
  color: var(--vd-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.vd-updated i {
  color: #34856b;
}
.vd-toolbar-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.vd-button {
  border: 1px solid var(--vd-line);
  background: var(--vd-surface);
  color: var(--vd-ink);
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  font-size: 14px !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.vd-button:hover,
.vd-action:hover {
  background: var(--vd-soft);
  border-color: #87a9d5;
}
.vd-button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.vd-scope {
  color: var(--vd-muted);
  font-size: 13px;
  margin-top: -14px !important;
}
.vd-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.vd-stat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-content: start;
  gap: 8px;
  padding: 20px;
  background: var(--vd-surface);
  border: 1px solid var(--vd-line);
  border-radius: 12px;
  min-height: 144px;
}
.vd-stat-icon {
  grid-column: 2;
  grid-row: 1/3;
  align-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-size: 16px;
}
.vd-stat p {
  grid-column: 1;
  grid-row: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--vd-muted);
}
.vd-stat strong {
  grid-column: 1/-1;
  font-size: clamp(20px, 1.7vw, 27px);
  font-weight: 800;
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.vd-stat small {
  grid-column: 1/-1;
  display: block;
  font-size: 12px;
  color: var(--vd-muted);
  line-height: 1.5;
}
.vd .blue {
  color: #2262b7;
  background: #eaf2fe;
}
.vd .orange {
  color: #9b531b;
  background: #fcf0df;
}
.vd .red {
  color: #ad3541;
  background: #fcecee;
}
.vd .purple {
  color: #71509c;
  background: #f2edfb;
}
.vd .green {
  color: #27785f;
  background: #e8f5ef;
}
html[data-mu-theme="night"] .vd :is(.blue, .orange, .red, .purple, .green) {
  background: var(--vd-soft);
  color: var(--vd-ink);
}
.vd-grid {
  display: grid;
  gap: 24px;
  min-width: 0;
  align-items: start;
}
.vd-grid-main {
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
}
.vd-grid-support {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.vd-panel {
  padding: 24px;
  background: var(--vd-surface);
  border: 1px solid var(--vd-line);
  border-radius: 14px;
  min-width: 0;
  overflow: hidden;
}
.vd-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.vd-panel-head h3 {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 800;
  color: var(--vd-ink);
}
.vd-panel-head p {
  font-size: 13px;
  color: var(--vd-muted);
  margin-top: 6px;
  line-height: 1.5;
}
.vd-chart {
  height: 300px;
  position: relative;
  min-width: 0;
}
.vd-chart-ring {
  height: 300px;
  max-width: 400px;
  margin: 0 auto;
}
.vd-chart canvas {
  width: 100% !important;
  height: 100% !important;
}
.vd-chart-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 24px;
  text-align: center;
  color: var(--vd-muted);
  font-size: 14px;
}
.vd-data {
  border-top: 1px solid var(--vd-line);
  padding-top: 12px;
  margin-top: 16px;
}
.vd-data summary {
  font-size: 14px;
  cursor: pointer;
  color: var(--vd-blue);
  font-weight: 700;
  min-height: 32px;
}
.vd-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 12px 0 16px;
}
.vd table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
  color: var(--vd-ink);
}
.vd table caption {
  text-align: left;
  color: var(--vd-muted);
  font-size: 13px;
  margin-bottom: 10px;
}
.vd th,
.vd td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--vd-line);
  vertical-align: top;
}
.vd th {
  font-weight: 700;
  color: var(--vd-muted);
}
.vd td small {
  display: block;
  font-size: 12px;
  color: var(--vd-muted);
  margin-top: 4px;
}
.vd .vd-stock-table {
  min-width: 360px;
}
.vd .vd-stock-table td:first-child {
  width: 60%;
}
.vd td strong {
  font-size: 14px;
  font-weight: 700;
}
.vd-badge {
  display: inline-flex;
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.vd-search-label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--vd-muted);
  font-weight: 700;
  margin-bottom: 16px;
}
.vd-search {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--vd-surface);
  border: 1px solid var(--vd-line);
  color: var(--vd-ink);
  font-size: 14px !important;
}
.vd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.vd-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  background: var(--vd-surface);
  color: var(--vd-ink);
  min-height: 44px;
  font-size: 14px !important;
  font-weight: 700 !important;
  text-align: left;
  cursor: pointer;
}
.vd-action span {
  color: var(--vd-blue);
}
.vd-shortcuts .vd-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.vd-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
}
.vd-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--vd-line);
  padding: 14px 0;
  font-size: 14px;
}
.vd-list li:first-child {
  padding-top: 0;
}
.vd-list li > div {
  flex: 1;
}
.vd-list strong {
  font-weight: 700;
  overflow-wrap: anywhere;
  display: block;
}
.vd-list small {
  font-size: 12px;
  color: var(--vd-muted);
  display: block;
  margin-top: 4px;
}
.vd-list b {
  font-size: 14px;
  max-width: 42%;
  text-align: right;
  overflow-wrap: anywhere;
}
.vd-list-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vd-attention {
  display: grid;
  gap: 12px;
}
.vd-attention-item {
  display: flex;
  align-items: start;
  gap: 12px;
  padding: 14px 0;
  background: transparent;
  color: var(--vd-ink);
  border: 0;
  border-bottom: 1px solid var(--vd-line);
  text-align: left;
  width: 100%;
  cursor: pointer;
}
.vd-attention-item > span:nth-child(2) {
  flex: 1;
}
.vd-attention-item strong {
  font-size: 14px;
  display: block;
  line-height: 1.5;
}
.vd-attention-item small {
  font-size: 12px;
  color: var(--vd-muted);
  display: block;
  line-height: 1.5;
  margin-top: 4px;
}
.vd-attention-item:hover strong {
  color: var(--vd-blue);
}
.vd-empty,
.vd-no-results {
  padding: 24px 16px;
  border: 1px dashed var(--vd-line);
  border-radius: 8px;
  background: var(--vd-soft);
  color: var(--vd-muted);
  font-size: 14px;
  text-align: center;
}
.vd-finance-balance {
  padding: 24px;
  background: var(--vd-soft);
  border-radius: 12px;
  margin-bottom: 24px;
}
.vd-finance-balance > span {
  font-size: 14px;
  color: var(--vd-muted);
}
.vd-finance-balance > strong {
  font-size: 32px;
  display: block;
  margin: 8px 0 24px;
  overflow-wrap: anywhere;
}
.vd-finance-balance > div {
  display: grid;
  gap: 16px;
}
.vd-finance-balance > div span {
  font-size: 14px;
  color: var(--vd-muted);
}
.vd-finance-balance b {
  display: block;
  color: var(--vd-ink);
  margin-top: 4px;
}
.vd-sales-summary {
  text-align: center;
  padding: 24px;
  background: var(--vd-soft);
  border-radius: 12px;
  margin-bottom: 24px;
}
.vd-sales-summary > i {
  color: #8b65b6;
  font-size: 32px;
}
.vd-sales-summary > strong {
  display: block;
  font-size: 28px;
  margin: 12px 0;
}
.vd-sales-summary p {
  font-size: 14px;
  color: var(--vd-muted);
}
.vd-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  align-items: start;
}
.vd-board-column {
  padding: 12px;
  background: var(--vd-soft);
  border-radius: 10px;
  display: grid;
  gap: 12px;
}
.vd-board-column h4 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  align-items: center;
  min-height: 42px;
}
.vd-board-column h4 span {
  border: 1px solid var(--vd-line);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 12px;
}
.vd-project {
  border: 1px solid var(--vd-line);
  padding: 14px;
  background: var(--vd-surface);
  border-radius: 8px;
}
.vd-project strong {
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.vd-project small {
  font-size: 12px;
  color: var(--vd-muted);
  display: block;
  margin: 8px 0;
}
.vd-project b {
  font-size: 13px;
  display: block;
  margin-top: 8px;
}
.vd-progress-track {
  height: 6px;
  background: var(--vd-soft);
  border-radius: 4px;
  overflow: hidden;
}
.vd-progress-track span {
  display: block;
  height: 100%;
  background: var(--vd-accent);
}
.vd-board-column .vd-empty {
  padding: 12px 4px;
  border: 0;
  font-size: 13px;
}
.vd-muted {
  font-size: 12px;
  color: var(--vd-muted);
}
.vd-command {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.65fr);
  gap: 24px;
  align-items: start;
}
.vd-command > aside,
.vd-command > div {
  display: grid;
  gap: 24px;
  min-width: 0;
}
.vd-command .vd-actions {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
}
.vd-command-bottom {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.vd-command .vd-chart-ring {
  height: 260px;
}
.vd-command-bottom .vd-list-icon {
  display: none;
}
.vd-activity #dashboardFeed {
  max-height: 360px;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
}
.vd-activity .rl-entry {
  color: var(--vd-ink);
}
.vd-activity :is(.rl-text, .rl-actor, .rl-time) {
  color: var(--vd-ink) !important;
}
.vd-error,
.vd-role-note {
  padding: 16px 20px;
  border: 1px solid #e6c592;
  border-radius: 10px;
  background: #fff6e7;
  color: #714815;
  font-size: 14px;
}
.vd-error:empty {
  display: none;
}
.vd-error h3 {
  margin-bottom: 8px;
}
.vd-error button {
  margin-top: 16px;
}
.vd-loading {
  padding: 64px 24px;
  background: var(--vd-surface);
  border: 1px solid var(--vd-line);
  text-align: center;
  font-size: 16px;
  border-radius: 14px;
}
html[data-mu-theme="night"] .vd-role-note,
html[data-mu-theme="night"] .vd-error {
  background: #302a1e;
  color: #f6d69e;
  border-color: #665331;
}
@media (min-width: 1200px) {
  .vd[data-model="finance"] .vd-grid-main {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
  .vd[data-model="sales"] .vd-grid-main {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
}
@media (max-width: 1150px) {
  .vd-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vd-grid-main,
  .vd-command {
    grid-template-columns: minmax(0, 1fr);
  }
  .vd-command > aside {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vd-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .vd-heading {
    padding: 24px;
  }
  .vd-grid-support {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 700px) {
  .vd {
    gap: 16px;
  }
  .vd-heading {
    align-items: start;
    flex-direction: column;
    gap: 16px;
    padding: 24px 20px;
  }
  .vd-heading-copy {
    line-height: 1.6;
  }
  .vd-toolbar {
    align-items: stretch;
    gap: 12px;
  }
  .vd-toolbar label {
    justify-content: space-between;
    width: 100%;
  }
  .vd-toolbar-actions {
    width: 100%;
    margin-left: 0;
  }
  .vd-toolbar-actions button {
    flex: 1;
  }
  .vd-updated {
    width: 100%;
  }
  .vd-scope {
    margin-top: -6px !important;
    line-height: 1.6;
  }
  .vd-stat {
    padding: 16px;
    gap: 8px;
    min-height: 160px;
  }
  .vd-stat strong {
    font-size: 21px;
  }
  .vd-stat p {
    font-size: 13px;
  }
  .vd-stat-icon {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
  .vd-stats {
    gap: 12px;
  }
  .vd-panel {
    padding: 20px 16px;
  }
  .vd-grid,
  .vd-command,
  .vd-command > aside,
  .vd-command > div {
    gap: 16px;
  }
  .vd-command > aside,
  .vd-command-bottom {
    grid-template-columns: minmax(0, 1fr);
  }
  .vd-chart {
    height: 290px;
  }
  .vd-chart-ring {
    height: 290px;
  }
  .vd-shortcuts .vd-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vd-action {
    font-size: 13px !important;
    padding: 10px 12px;
  }
  .vd-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .vd-finance-balance > strong {
    font-size: 26px;
  }
}
@media (max-width: 380px) {
  .vd-stats,
  .vd-board,
  .vd-shortcuts .vd-actions {
    grid-template-columns: minmax(0, 1fr);
  }
  .vd-stat {
    min-height: 128px;
  }
  .vd-heading h2 {
    font-size: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .vd * {
    transition: none !important;
    animation: none !important;
  }
}
/* Bound the activity viewport; its complete contents remain scrollable. */
html body #dashboardVisual .vd-activity #dashboardFeed {
  max-height: 360px !important;
  overflow: auto !important;
}

.vd-board-column {
  max-height: 640px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* Long currency totals remain readable; full stock list scrolls within its panel. */
.vd-stock-scroll {max-height:520px;overflow:auto;overscroll-behavior:contain;}
.vd-stock-scroll thead {position:sticky;top:0;background:var(--vd-surface);z-index:1;}
@media(max-width:700px){.vd[data-model="finance"] .vd-stats{grid-template-columns:minmax(0,1fr);}.vd[data-model="finance"] .vd-stat{min-height:128px;}}
