/* Dash-only layout. All core styling/tokens come from Foundry theme base. */
/* Built to sit on top of foundry-light/dark (single-link swap). */

.app-dash {
  /* subtle hero glow like Planr without stealing the show */
  --bg:
    radial-gradient(1000px 700px at 80% -20%, rgba(90,120,255,.14), transparent 75%),
    radial-gradient(900px 650px at 10% 120%, rgba(110,255,190,.10), transparent 78%),
    linear-gradient(180deg, #0b0a13 0%, #0d1016 100%);
}

html[data-theme="lt"] .app-dash {
  --bg:
    radial-gradient(1000px 700px at 80% -20%, rgba(90,120,255,.10), transparent 75%),
    radial-gradient(900px 650px at 10% 120%, rgba(110,255,190,.07), transparent 78%),
    linear-gradient(180deg, #f8f9fb 0%, #f3f5f8 100%);
}

.dash-shell {
  padding: 18px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.dash-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 2fr 1fr;
  align-items: stretch;
}

/* Responsive: stack */
@media (max-width: 980px) {
  .dash-grid { grid-template-columns: 1fr; }
}

.dash-card {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--panel);
  border-radius: var(--round);
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .15s ease, filter .15s ease, border-color .15s ease;
}

.dash-card:hover { transform: translateY(-2px); filter: brightness(1.03); border-color: rgba(90,120,255,.35); }
.dash-card:focus-visible { outline: 2px solid var(--brand2); outline-offset: 3px; }

.dash-card__head {
  padding: 14px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dash-card__title { display: flex; gap: 10px; align-items: center; }
.dash-card__title .h { font: 500 16px var(--font-title); letter-spacing: -.01em; }
.dash-card__cta { display: inline-flex; gap: 10px; align-items: center; }
.chev { font-size: 16px; opacity: .85; }

.dash-card__body { padding: 0 14px 14px; }

/* App dots */
.app-dot {
  width: 12px; height: 12px; border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
  display: inline-block;
}
.app-dot--projctr { background: #5a78ff; }
.app-dot--briefr  { background: #30d179; }
.app-dot--apprvl  { background: #f6a73b; }
.app-dot--foldr   { background: #b57de8; }

/* KPI */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 520px) {
  .kpi-row, .kpi-grid { grid-template-columns: 1fr; }
}

.kpi {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 10px;
}
html[data-theme="lt"] .kpi { background: rgba(0,0,0,.03); }

.kpi__value {
  font: 600 26px var(--font-title);
  letter-spacing: -.02em;
  line-height: 1.05;
}
.kpi__label { margin-top: 4px; font-size: 12px; }

.kpi--alert { border-color: rgba(255,95,111,.35); }
.kpi--warn  { border-color: rgba(246,167,59,.35); }

/* Chart */
.chart-shell {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  position: relative;
}
html[data-theme="lt"] .chart-shell { background: rgba(0,0,0,.03); }

.chart-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.chart-legend { display: inline-flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
.legend-item { display: inline-flex; gap: 6px; align-items: center; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.swatch--bars { background: rgba(90,120,255,.65); }
.swatch--line { background: rgba(48,209,120,.75); border-radius: 999px; }

canvas { width: 100%; height: auto; display: block; }

.chart-tip {
  position: absolute;
  pointer-events: none;
  min-width: 160px;
  max-width: 220px;
  background: rgba(10,12,18,.92);
  border: 1px solid rgba(255,255,255,.14);
  color: #f3f5f2;
  border-radius: 12px;
  padding: 10px 10px;
  font-size: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
  transform: translate(10px, 10px);
}
html[data-theme="lt"] .chart-tip {
  background: rgba(255,255,255,.96);
  color: var(--ink);
  border-color: rgba(0,0,0,.10);
}

/* Minis */
.mini-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  font-size: 12px;
}
html[data-theme="lt"] .pill { background: rgba(0,0,0,.03); }

.meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  flex: 1;
  overflow: hidden;
}
html[data-theme="lt"] .meter { background: rgba(0,0,0,.05); }

.meter__bar {
  height: 100%;
  width: 0%;
  background: var(--brand2);
  border-radius: 999px;
  transition: width .25s ease;
}

.sparkline {
  width: 120px;
  height: 26px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
}
html[data-theme="lt"] .sparkline { background: rgba(0,0,0,.03); }

.dash-footer {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 10px 0 2px;
}

.toolbar-stack .toolbar-title { font: 500 18px var(--font-title); color: #f3f5f2; }
.toolbar-stack .toolbar-sub { margin-top: 4px; color: rgba(255,255,255,.85); }
.chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.10);
  color: #f3f5f2;
}