/* ==========================================================================
   Dashboard (#/). Tokens from base.css only.
   ========================================================================== */

/* ---------- Shared ---------- */

.dash-tiles {
  transition: opacity 0.2s ease;
}

/* ---------- Dashboard ---------- */

.dash-monitor,
.dash-lower {
  margin-top: 1.25rem;
}
.dash-monitor .card-header {
  justify-content: flex-start;
  gap: 0.75rem;
}

.monitor-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}
.monitor-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
a.monitor-item:hover {
  text-decoration: none;
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.monitor-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: var(--neutral-soft);
  color: var(--text-2);
}
.monitor-icon svg {
  width: 18px;
  height: 18px;
}
.monitor-item.tone-info .monitor-icon { background: var(--info-soft); color: var(--info-text); }
.monitor-item.tone-warn .monitor-icon { background: var(--warn-soft); color: var(--warn-text); }
.monitor-item.tone-serious .monitor-icon { background: var(--serious-soft); color: var(--serious-text); }
.monitor-item.tone-neutral .monitor-icon { background: var(--neutral-soft); color: var(--text-2); }
.monitor-item.is-zero .monitor-icon {
  background: var(--neutral-soft);
  color: var(--muted);
}
.monitor-item.is-zero .monitor-count {
  color: var(--muted);
}
.monitor-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.monitor-count {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}
.monitor-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-2);
}

.monitor-foot {
  margin-top: 0.85rem;
}
.monitor-refunds {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}
a.monitor-refunds:hover {
  text-decoration: none;
  filter: brightness(0.98);
}
.monitor-refunds svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex: none;
}
.monitor-refund-count {
  min-width: 1.5rem;
  padding: 0 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  text-align: center;
  font-size: var(--fs-xs);
  line-height: 1.5rem;
}

.dash-lower {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.dash-lower.is-single {
  grid-template-columns: minmax(0, 1fr);
}
.dash-recent-body {
  margin-top: 0.75rem;
}
.dash-recent .table-wrap {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---------- Smaller screens ---------- */

@media (max-width: 1100px) {
  .monitor-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dash-lower {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .monitor-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    --gap: 0.75rem;
  }
  .dash-tiles .kpi {
    padding: 0.9rem 1rem;
  }
  .dash-tiles .kpi-value {
    font-size: 1.3rem;
  }
}

/* Phones: recent payouts as compact two-line rows (recipient and amount, then status and time). */
@media (max-width: 560px) {
  .dash-recent thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .dash-recent table,
  .dash-recent tbody {
    display: block;
  }
  .dash-recent tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "payment amount"
      "status created";
    gap: 0.35rem 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
  }
  .dash-recent tbody tr:last-child {
    border-bottom: 0;
  }
  .dash-recent tbody td {
    display: block;
    padding: 0;
    border: 0;
    min-width: 0;
  }
  .dash-recent tbody td:nth-child(1) { grid-area: payment; }
  .dash-recent tbody td:nth-child(2) { grid-area: amount; }
  .dash-recent tbody td:nth-child(3) { display: none; }
  .dash-recent tbody td:nth-child(4) { grid-area: status; }
  .dash-recent tbody td:nth-child(5) { grid-area: created; justify-self: end; align-self: center; }
}
