/* ==========================================================================
   views-dashboard.css · dashboard, due popup, approvals, reports
   Colours come only from the CSS variables in app.css (dark theme works).
   Motion: transform and opacity only; honours prefers-reduced-motion.
   ========================================================================== */

/* ---------- hero ---------- */
.dash-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 24px 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 62%, var(--brand-3) 100%);
  color: var(--on-brand);
  box-shadow: var(--shadow);
}
.dash-hero::before {
  /* soft amber glow, like evening light on a site */
  content: "";
  position: absolute;
  right: -80px;
  top: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  opacity: .22;
  pointer-events: none;
  animation: dash-glow 9s var(--ease) infinite alternate;
}
.dash-hero::after {
  /* thin skyline strip at the bottom */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 40%, transparent 100%);
  opacity: .85;
  transform-origin: left center;
  animation: dash-line .9s var(--ease) both;
}
.dash-hero-text { position: relative; min-width: 0; }
.dash-hero .eyebrow { color: var(--on-brand-muted); }
.dash-hello { color: var(--on-brand); margin: 4px 0 2px; font-family: var(--font-display); }
.dash-hero-sub { color: var(--on-brand-muted); font-size: .95rem; }
.dash-qas { position: relative; display: flex; flex-wrap: wrap; gap: 10px; }
.dash-qa { min-height: 48px; gap: 8px; }
.dash-hero .dash-qa:not(.accent) {
  background: var(--brand-3);
  color: var(--on-brand);
  border-color: transparent;
}
.dash-qa .count-badge { margin-left: 4px; }

@keyframes dash-glow { from { transform: translate(0, 0) scale(1); } to { transform: translate(-30px, 20px) scale(1.12); } }
@keyframes dash-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- cards & lists ---------- */
.dash-cards .stat { min-height: 118px; }

/* partner: one card per project (My projects) */
.dash-pp { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: start; }
.dash-pp .card-head { align-items: flex-start; gap: 10px; }
.dash-pp .card-head .badge { flex: none; }
.dash-pp .card-foot { flex-wrap: wrap; }
.dash .card-title .icon, .dash .card-title svg { vertical-align: -3px; color: var(--accent); }
.dash .list-item { text-decoration: none; color: inherit; min-height: 48px; }
.dash .list-item .list-main { text-decoration: none; color: inherit; min-width: 0; }
.dash .list-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dash .list-side.right { text-align: right; }
.dash-act { position: relative; padding-left: 4px; }
.dash-act-icon {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-right: 10px;
  border-radius: 12px;
  background: var(--amber-bg);
  color: var(--amber-ink);
  transition: transform .2s var(--ease);
}
.dash-act.tone-red .dash-act-icon { background: var(--red-bg); color: var(--red-ink); }
.dash-act.tone-indigo .dash-act-icon { background: var(--indigo-bg); color: var(--indigo-ink); }
.dash-act.tone-green .dash-act-icon { background: var(--green-bg); color: var(--green-ink); }
.dash-act:active .dash-act-icon { transform: scale(.92); }
@media (hover: hover) { .dash-act:hover .dash-act-icon { transform: translateX(2px); } }
.dash-wait-card { border-top: 3px solid var(--accent); }

.dash-mini {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: inherit;
  text-decoration: none;
  border-left: 4px solid var(--line-strong);
  transition: transform .2s var(--ease);
}
.dash-mini .strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.dash-mini.tone-red { border-left-color: var(--red); }
.dash-mini.tone-red .strong { color: var(--red); }
.dash-mini.tone-amber { border-left-color: var(--amber); }
.dash-mini:active { transform: scale(.98); }

.dash-activity a.tl-item { color: inherit; text-decoration: none; border-radius: var(--radius-sm); }
@media (hover: hover) { .dash-activity a.tl-item:hover .tl-title { color: var(--brand-3); } }
[data-theme="dark"] .dash-activity a.tl-item:hover .tl-title { color: var(--accent-2); }

/* ---------- due popup ---------- */
.due-sum .stat { min-height: 0; padding: 12px 14px; }
.due-list { max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.due-row { color: inherit; text-decoration: none; min-height: 52px; }
.due-row.is-overdue { box-shadow: inset 4px 0 0 var(--red); background: var(--red-bg); }
.due-row.is-overdue .list-title { color: var(--red-ink); }
.due-row .list-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

/* ---------- reports ---------- */
.rep-filter { padding: 14px 16px; }
.rep-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 14px;
  align-items: end;
}
.rep-filter .field { margin: 0; }
.rep-apply .btn { width: 100%; min-height: 48px; }
.rep-pct { display: flex; align-items: center; gap: 8px; justify-content: flex-end; min-width: 120px; }
.rep-pct .progress { flex: 1; min-width: 60px; }
.rep-pct span { min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .dash-hero { padding: 18px 16px 18px; border-radius: var(--radius); }
  .dash-qas { width: 100%; }
  .dash-qa { flex: 1 1 100%; justify-content: flex-start; }
  .dash-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-cards .stat { min-height: 104px; }
  .dash-act-icon { width: 34px; height: 34px; margin-right: 8px; }
  .due-sum { grid-template-columns: 1fr 1fr; }
  .due-sum .stat:last-child { grid-column: 1 / -1; }
  .rep-filter-grid { grid-template-columns: 1fr 1fr; }
  .rep-apply { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .dash-hero::before, .dash-hero::after { animation: none; }
  .dash-act-icon, .dash-mini { transition: none; }
}

/* payments-due popup: vendor name, order line and due date each on their own line */
.due-row .list-title, .due-row .list-sub { display: block; }
