/* Integrated overview — uses the workspace glass, spacing and theme language. */
.workspace-dashboard[hidden], .workspace-composer-view[hidden] { display: none !important; }

.console-sidebar-entry { appearance: none; font: inherit; cursor: pointer; }
.sidebar-svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease, filter .18s ease; }
.console-sidebar-entry:hover .sidebar-svg { transform: scale(1.06); filter: drop-shadow(0 0 8px rgba(77,153,238,.35)); }
.console-sidebar-entry.is-active { color: #176cbe !important; background: rgba(216,235,255,.8) !important; box-shadow: inset 0 0 0 1px rgba(45,132,230,.22), 0 8px 24px rgba(37,102,170,.08) !important; }
html[data-theme="dark"] .console-sidebar-entry.is-active { color: #8fc6ff !important; background: rgba(37,75,113,.48) !important; box-shadow: inset 0 0 0 1px rgba(93,164,238,.24) !important; }
body.workspace-dashboard-active #newTaskBtn { color: #63788d !important; background: transparent !important; box-shadow: none !important; }
html[data-theme="dark"] body.workspace-dashboard-active #newTaskBtn { color: #9dafc1 !important; background: transparent !important; }

button.console-top-link { font-family: inherit; cursor: pointer; }
.workspace-composer-view { width: 100%; display: flex; flex-direction: column; align-items: center; }

#moduleSection.dashboard-mode { align-items: stretch; overflow-y: auto; scrollbar-width: thin; }
#moduleSection.dashboard-mode::before { transform: scale(1.12); opacity: .8; }

.workspace-dashboard { width: min(1050px, 100%); margin: 82px auto 0; padding: 10px 0 22px; animation: dashboardEnter .52s cubic-bezier(.16,1,.3,1) both; }
@keyframes dashboardEnter { from { opacity: 0; transform: translateY(14px) scale(.992); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

.workspace-dashboard-head { padding: clamp(16px, 2vw, 26px) 4px 28px; display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.workspace-dashboard-head > div:first-child { max-width: 680px; }
.dashboard-kicker { margin-bottom: 12px; display: flex; align-items: center; gap: 9px; color: #2b78c9; font-size: 10px; font-weight: 850; letter-spacing: .18em; }
.dashboard-kicker span { width: 7px; height: 7px; border-radius: 50%; background: #3a94f5; box-shadow: 0 0 0 5px rgba(58,148,245,.1), 0 0 18px rgba(58,148,245,.38); }
.workspace-dashboard-head h2 { margin: 0; color: #102a46; font-size: clamp(34px, 4.4vw, 52px); font-weight: 780; line-height: 1.05; letter-spacing: -.05em; }
.workspace-dashboard-head p { max-width: 640px; margin: 15px 0 0; color: #687d92; font-size: 15px; line-height: 1.65; }

.dashboard-primary { height: 54px; min-width: 180px; padding: 0 19px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid rgba(255,255,255,.42); border-radius: 17px; color: #fff; background: linear-gradient(135deg, #3898ff, #1c73dc); box-shadow: 0 14px 32px rgba(31,119,219,.27), inset 0 1px rgba(255,255,255,.3); font-size: 14px; font-weight: 780; cursor: pointer; transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, filter .2s; }
.dashboard-primary svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.dashboard-primary:hover { transform: translateY(-3px); box-shadow: 0 20px 44px rgba(31,119,219,.34), inset 0 1px rgba(255,255,255,.36); filter: saturate(1.08); }
.dashboard-primary:hover svg { transform: translateX(3px); }
.dashboard-primary:active { transform: translateY(0) scale(.97); }

.dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dashboard-metrics article { position: relative; min-height: 145px; padding: 21px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid rgba(130,164,199,.24); border-radius: 22px; background: rgba(255,255,255,.59); box-shadow: 0 16px 45px rgba(34,75,117,.09), inset 0 1px rgba(255,255,255,.84); backdrop-filter: blur(22px) saturate(1.15); overflow: hidden; transition: transform .22s cubic-bezier(.2,.8,.2,1), border-color .22s, box-shadow .22s; }
.dashboard-metrics article::after { content: ""; position: absolute; right: -30px; bottom: -42px; width: 100px; height: 100px; border: 1px solid rgba(50,139,232,.13); border-radius: 50%; box-shadow: 0 0 0 18px rgba(50,139,232,.025); }
.dashboard-metrics article:hover { transform: translateY(-4px); border-color: rgba(57,143,236,.38); box-shadow: 0 23px 56px rgba(34,75,117,.13), inset 0 1px rgba(255,255,255,.9); }
.dashboard-metrics span { color: #6d8095; font-size: 12px; font-weight: 700; }
.dashboard-metrics strong { position: relative; z-index: 1; margin-top: 12px; color: #112d4a; font-size: 37px; line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.dashboard-metrics small { position: relative; z-index: 1; color: #90a0b0; font-size: 10px; }

.dashboard-grid { margin-top: 12px; display: grid; grid-template-columns: 1.25fr .75fr; gap: 12px; }
.dashboard-panel { min-height: 300px; border: 1px solid rgba(130,164,199,.24); border-radius: 24px; background: rgba(255,255,255,.59); box-shadow: 0 18px 50px rgba(34,75,117,.09), inset 0 1px rgba(255,255,255,.84); backdrop-filter: blur(24px) saturate(1.15); overflow: hidden; }
.dashboard-panel-head { min-height: 76px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid rgba(130,164,199,.18); }
.dashboard-panel-head span:first-child { display: block; margin-bottom: 4px; color: #2f7dca; font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.dashboard-panel-head h3 { margin: 0; color: #18334f; font-size: 18px; letter-spacing: -.02em; }
#dashboardRefresh { width: 39px; height: 39px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(110,151,192,.24); border-radius: 13px; color: #4d759d; background: rgba(255,255,255,.58); cursor: pointer; transition: transform .2s, border-color .2s, color .2s, background .2s; }
#dashboardRefresh svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#dashboardRefresh:hover { color: #247ed7; border-color: rgba(50,137,229,.4); background: rgba(242,248,255,.9); transform: rotate(22deg); }
#dashboardRefresh:active { transform: rotate(22deg) scale(.94); }
#dashboardRefresh.is-loading svg { animation: dashboardSpin .8s linear infinite; }
@keyframes dashboardSpin { to { transform: rotate(360deg); } }

.dashboard-live { margin: 0 !important; padding: 8px 10px; display: inline-flex !important; align-items: center; gap: 8px; border: 1px solid rgba(89,190,153,.2); border-radius: 12px; color: #447665 !important; background: rgba(92,200,160,.08); font-size: 10px !important; letter-spacing: 0 !important; }
.dashboard-live i { width: 7px; height: 7px; border-radius: 50%; background: #e0a34d; box-shadow: 0 0 0 4px rgba(224,163,77,.1); }
.dashboard-live.is-online i { background: #58c69e; box-shadow: 0 0 0 4px rgba(88,198,158,.12), 0 0 13px rgba(88,198,158,.44); }
.dashboard-live.is-offline { color: #a85c69 !important; border-color: rgba(226,105,124,.2); background: rgba(226,105,124,.07); }
.dashboard-live.is-offline i { background: #e2697c; box-shadow: 0 0 0 4px rgba(226,105,124,.1); }

.dashboard-recent { min-height: 220px; padding: 4px 12px 12px; }
.dashboard-history-row { min-height: 67px; padding: 12px 10px; display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid rgba(130,164,199,.13); border-radius: 13px; transition: background .18s, transform .18s; }
.dashboard-history-row:hover { background: rgba(228,241,255,.5); transform: translateX(2px); }
.dashboard-history-row > i { width: 7px; height: 7px; border-radius: 50%; background: #58c69e; box-shadow: 0 0 0 4px rgba(88,198,158,.1); }
.dashboard-history-row.review > i { background: #edae53; box-shadow: 0 0 0 4px rgba(237,174,83,.1); }
.dashboard-history-row.risk > i { background: #e56e7f; box-shadow: 0 0 0 4px rgba(229,110,127,.1); }
.dashboard-history-row div { min-width: 0; }
.dashboard-history-row strong { display: block; overflow: hidden; color: #203c58; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-history-row small { display: block; margin-top: 4px; overflow: hidden; color: #8293a5; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-history-row time { color: #94a3b2; font-size: 10px; white-space: nowrap; }
.dashboard-empty { min-height: 215px; display: grid; place-items: center; text-align: center; color: #8799aa; }
.dashboard-empty svg { width: 38px; margin: 0 auto 12px; fill: none; stroke: #79a4d0; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-empty strong { display: block; color: #4f6983; font-size: 13px; }
.dashboard-empty small { display: block; margin-top: 5px; }

.readiness-items { padding: 8px 20px 14px; }
.readiness-items article { min-height: 54px; display: grid; grid-template-columns: 10px 1fr; gap: 12px; align-items: center; border-bottom: 1px solid rgba(130,164,199,.13); }
.readiness-items article:last-child { border-bottom: 0; }
.readiness-items article > i { width: 7px; height: 7px; border-radius: 50%; background: #58c69e; box-shadow: 0 0 0 4px rgba(88,198,158,.1); }
.readiness-items strong, .readiness-items small { display: block; }
.readiness-items strong { color: #28445f; font-size: 12px; }
.readiness-items small { margin-top: 3px; color: #8798a9; font-size: 10px; line-height: 1.3; }

html[data-theme="dark"] .workspace-dashboard-head h2 { color: #eef6ff; }
html[data-theme="dark"] .workspace-dashboard-head p { color: #9eb0c2; }
html[data-theme="dark"] .dashboard-kicker { color: #79b8f8; }
html[data-theme="dark"] .dashboard-metrics article,
html[data-theme="dark"] .dashboard-panel { border-color: rgba(125,166,207,.18); background: rgba(20,31,43,.68); box-shadow: 0 22px 58px rgba(0,4,10,.3), inset 0 1px rgba(255,255,255,.05); }
html[data-theme="dark"] .dashboard-metrics article:hover { border-color: rgba(87,157,228,.38); box-shadow: 0 26px 66px rgba(0,4,10,.4), inset 0 1px rgba(255,255,255,.06); }
html[data-theme="dark"] .dashboard-metrics span { color: #91a4b8; }
html[data-theme="dark"] .dashboard-metrics strong { color: #f0f6fc; }
html[data-theme="dark"] .dashboard-metrics small { color: #6f8295; }
html[data-theme="dark"] .dashboard-panel-head { border-bottom-color: rgba(125,166,207,.14); }
html[data-theme="dark"] .dashboard-panel-head h3 { color: #e7f0fa; }
html[data-theme="dark"] #dashboardRefresh { color: #a6bad0; border-color: rgba(125,166,207,.18); background: rgba(35,49,64,.68); }
html[data-theme="dark"] #dashboardRefresh:hover { color: #8fc6ff; border-color: rgba(87,157,228,.4); background: rgba(42,60,78,.78); }
html[data-theme="dark"] .dashboard-live { color: #8bc8b1 !important; background: rgba(88,198,158,.07); }
html[data-theme="dark"] .dashboard-history-row,
html[data-theme="dark"] .readiness-items article { border-bottom-color: rgba(125,166,207,.11); }
html[data-theme="dark"] .dashboard-history-row:hover { background: rgba(48,83,119,.24); }
html[data-theme="dark"] .dashboard-history-row strong,
html[data-theme="dark"] .readiness-items strong { color: #dce7f2; }
html[data-theme="dark"] .dashboard-history-row small,
html[data-theme="dark"] .dashboard-history-row time,
html[data-theme="dark"] .readiness-items small,
html[data-theme="dark"] .dashboard-empty { color: #7f93a8; }
html[data-theme="dark"] .dashboard-empty strong { color: #adbed0; }

@media (max-width: 980px) {
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  #moduleSection.dashboard-mode { overflow-y: auto; }
}

@media (max-width: 700px) {
  .workspace-dashboard { margin-top: 72px; }
  .workspace-dashboard-head { align-items: stretch; flex-direction: column; gap: 20px; }
  .dashboard-primary { width: 100%; }
  .dashboard-metrics { grid-template-columns: 1fr 1fr; }
  .dashboard-metrics article { min-height: 125px; padding: 17px; border-radius: 18px; }
  .dashboard-metrics strong { font-size: 31px; }
  .dashboard-panel { border-radius: 20px; }
}

@media (max-width: 440px) {
  .dashboard-metrics { grid-template-columns: 1fr; }
  .dashboard-history-row { grid-template-columns: 9px minmax(0,1fr); }
  .dashboard-history-row time { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-dashboard { animation: none; }
  #dashboardRefresh.is-loading svg { animation-duration: .001ms; }
}
