/* Dashboard (bento). Rendered by js/routes/dashboard.js with .au-* + .dash-* classes. */
.au-dash { display: grid; gap: 18px; max-width: 1400px; margin-inline: auto; width: 100%; }
.au-bento { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(118px, auto); }
#view.is-entering .au-bento > * { animation: auIn .75s var(--au-ease) both; animation-delay: calc(min(var(--i, 0), 12) * 55ms); }

.dash-hero {
  grid-column: span 7; grid-row: span 2; padding: 30px; min-height: 290px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(120% 140% at 100% 0%, rgb(var(--au-v-rgb) / .38), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgb(var(--au-c-rgb) / .16), transparent 60%),
    var(--au-tile) !important;
}
.dash-hero h2 { font-size: 38px; line-height: 1.15; font-weight: 900; letter-spacing: -.03em; margin: 14px 0 8px; }
.dash-hero p { color: var(--text-soft); max-width: 52ch; margin: 0; line-height: 1.8; }
.dash-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; padding: 6px 12px; border-radius: 999px; width: fit-content;
  background: rgb(61 220 151 / .1); color: #6ee7b0; border: 1px solid rgb(61 220 151 / .3); }
.dash-status.warn { background: rgb(247 184 75 / .1); color: #f9c66c; border-color: rgb(247 184 75 / .35); }
.dash-status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; color: inherit; animation: auPulse 1.8s infinite; }
.dash-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.dash-orbit { position: absolute; inset-inline-start: -70px; top: -70px; width: 270px; height: 270px; border-radius: 50%; border: 1px dashed rgb(255 255 255 / .12); animation: auSpin 60s linear infinite; pointer-events: none; }
.dash-orbit::after { content: ''; position: absolute; top: 18px; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--au-cyan); box-shadow: 0 0 18px var(--au-cyan); }
.dash-orbit.b { width: 400px; height: 400px; inset-inline-start: -135px; top: -135px; animation-duration: 95s; animation-direction: reverse; }
.dash-orbit.b::after { background: var(--au-pink); box-shadow: 0 0 18px var(--au-pink); }

.dash-kpi { grid-column: span 5; overflow: hidden; }
.dash-kpi.half { grid-column: span 5; }
.dash-kpi.third { grid-column: span 4; }
/* a.au-tile is display:block in aurora.css; these anchors need their own layout back */
a.au-tile.dash-kpi { display: flex; flex-direction: column; }
a.au-tile.dash-xs { display: grid; }
/* the sparkline sits in the flow under the sub line and bleeds to the tile edges, so it never covers text */
.dash-spark { display: block; flex: none; margin: auto -20px -18px; width: calc(100% + 40px); height: 64px; opacity: .95; pointer-events: none; }
.dash-kpi .au-sub { margin-bottom: 12px; }
.dash-spark path.line { fill: none; stroke: url(#au-g); stroke-width: 2.2; stroke-linecap: round; }
.dash-spark path.area { fill: url(#au-a); stroke: none; }
.dash-kpi.alert .au-num { color: #ff8fa0; }

.dash-ring { grid-column: span 5; display: flex; align-items: center; gap: 18px; }
.dash-ring svg.ring { width: 104px; height: 104px; flex: none; transform: rotate(-90deg); }
.dash-ring circle { fill: none; stroke-width: 10; }
.dash-ring .track { stroke: rgb(255 255 255 / .07); }
.dash-ring .val { stroke: url(#au-g); stroke-linecap: round; transition: stroke-dashoffset 1.6s var(--au-ease); }

.dash-flow { grid-column: span 8; grid-row: span 2; display: flex; flex-direction: column; min-height: 280px; overflow: hidden; }
.dash-flow canvas { flex: 1; width: 100%; min-height: 200px; display: block; }
.dash-flow-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.dash-flow-legend b { color: var(--text-strong, #fff); font-variant-numeric: tabular-nums; }

.dash-xs { grid-column: span 12; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  background: radial-gradient(80% 160% at 100% 50%, rgb(29 155 240 / .24), transparent 60%), var(--au-tile) !important; }
.dash-xs-logo { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-weight: 900; font-size: 26px; color: #fff;
  background: linear-gradient(145deg, #1d9bf0, var(--au-violet)); box-shadow: 0 10px 30px -8px rgb(29 155 240 / .8); animation: auFloat 5s ease-in-out infinite; }
.dash-xs h3 { margin: 0 0 4px; font-weight: 900; font-size: 18px; display: flex; gap: 8px; align-items: center; }
.dash-xs p { margin: 0; color: var(--text-soft); font-size: 13.5px; }
.dash-xs-stats { display: flex; gap: 18px; text-align: center; align-items: center; }
.dash-xs-stats b { display: block; font-size: 20px; font-weight: 900; }
.dash-xs-stats small { color: var(--muted); font-size: 11.5px; }

.dash-quick { grid-column: span 12; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dash-quick a.au-tile { display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: var(--text); }
.dash-quick b { display: block; font-weight: 800; }
.dash-quick small { color: var(--muted); font-size: 12px; }

.dash-chart { grid-column: span 8; }
.dash-chart svg { width: 100%; height: 200px; margin-top: 12px; overflow: visible; }
.dash-chart .bar { stroke: none; fill: url(#au-bar); transform-box: fill-box; transform-origin: bottom; animation: dashBar .9s var(--au-ease) both; animation-delay: calc(var(--b, 0) * 35ms + 300ms); }
.dash-chart .bar:hover { filter: brightness(1.25); }
.dash-axis { display: flex; justify-content: space-between; direction: ltr; margin-top: 6px; padding-inline: 4px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.dash-axis span { flex: 1; text-align: center; }
@keyframes dashBar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.dash-bots { grid-column: span 4; }
.dash-bots ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; max-height: 214px; overflow: auto; }
.dash-bots li { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 12px; background: rgb(255 255 255 / .035); font-size: 13.5px; }
.dash-bots li i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); flex: none; }
.dash-bots li.on i { background: #3ddc97; color: rgb(61 220 151 / .6); animation: auPulse 2s infinite; }
.dash-bots li small { margin-inline-start: auto; color: var(--muted); font-size: 11.5px; }

@media (max-width: 1200px) {
  .dash-hero, .dash-flow { grid-column: span 12; grid-row: auto; }
  .dash-kpi, .dash-kpi.half, .dash-kpi.third { grid-column: span 6; }
  .dash-ring { grid-column: span 6; }
  .dash-chart, .dash-bots { grid-column: span 12; }
}
@media (max-width: 760px) {
  .au-bento { grid-template-columns: 1fr 1fr; gap: 12px; }
  .au-bento > * { grid-column: 1 / -1 !important; }
  /* the two small counters share a row instead of two half-empty full-width tiles */
  .au-bento > .dash-kpi.third { grid-column: span 1 !important; padding: 16px; }
  .dash-kpi.third .au-num { font-size: 28px; }
  .dash-kpi.third .au-label { font-size: 12px; }
  .dash-xs { padding: 18px; gap: 14px; }
  .dash-xs-logo { width: 46px; height: 46px; border-radius: 14px; font-size: 21px; }
  .dash-xs h3 { font-size: 16px; }
  .dash-quick { gap: 10px; }
  .dash-quick a.au-tile { padding: 14px; gap: 10px; }
  .dash-quick .au-ic { width: 36px; height: 36px; }
  .dash-chart svg { height: 170px; }
  .dash-axis span:nth-child(even) { visibility: hidden; }
  .dash-hero { padding: 22px; min-height: 0; }
  .dash-hero h2 { font-size: 28px; }
  .dash-quick { grid-template-columns: 1fr 1fr; }
  .dash-xs { grid-template-columns: auto 1fr; }
  .dash-xs-stats { display: none; }
  .dash-flow { min-height: 0; }
  .dash-flow canvas { min-height: 190px; max-height: 210px; }
}
html[data-theme="light"] .dash-hero h2.au-grad-text { background-image: linear-gradient(110deg, #1b1340 15%, #6a4dff 40%, #0aa5c4 65%, #1b1340 90%); }
html[data-theme="light"] .dash-status { color: #0f8a5a; }
html[data-theme="light"] .dash-status.warn { color: #9a6200; background: rgb(247 184 75 / .14); }
html[data-theme="light"] .dash-kpi.alert .au-num { color: #d6365a; }
html[data-theme="light"] .dash-orbit { border-color: rgb(30 30 80 / .12); }
