/* css/page-dashboard.css — page-scoped styles for the Dashboard page
 * (js/pages/dashboard.js). Owned by the Dashboard page agent; add rules here so
 * page work never touches shared main.css / chrome.css / datatable.css.
 * Reuses shared .page-header/.page-title/.page-subtitle (chrome.css),
 * .stats-row/.stat-card/.stat-value/.stat-label (main.css), .btn (main.css). */

/* ── Stat tiles: 4 across on desktop, links to /pipeline ── */
.dash-stat-grid {
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px) {
  .dash-stat-grid { grid-template-columns: repeat(4, 1fr); }
}
.dash-stat-grid a.stat-card {
  text-decoration: none;
  color: inherit;
  display: block;
  border-top-color: var(--color-primary);
}
.dash-stat-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.15rem;
  font-variant-numeric: tabular-nums;
}
/* On Hold — paused deals; amber accent, distinct from the primary cards. */
.dash-stat-grid a.stat-card.dash-stat-hold {
  border-top-color: #d97706;
}
.dash-stat-grid a.stat-card.dash-stat-hold .stat-value {
  color: #b45309;
}
.dash-stat-grid a.stat-card.dash-stat-hold .dash-stat-sub {
  color: #b45309;
}

/* ── Panels (card surfaces for the breakdown + list sections) ── */
.dash-panel {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.15rem 1.15rem;
  margin-bottom: 1rem;
}
.dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.dash-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.dash-link {
  font-size: 0.8rem;
  color: var(--link-color);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.dash-link:hover { text-decoration: underline; }

/* ── Two-column rows (breakdown tables / list sections) ── */
.dash-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 860px) {
  .dash-cols { grid-template-columns: 1fr 1fr; }
}
.dash-cols .dash-panel { margin-bottom: 1rem; }

/* ── Breakdown tables ── */
.dash-table-wrap {
  overflow-x: auto;
  width: 100%;
}
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.dash-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.dash-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}
.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table .dash-r { text-align: right; font-variant-numeric: tabular-nums; }
.dash-table tbody tr:hover { background: var(--bg-secondary); }

/* Totals footer emphasis */
.dash-group-table tfoot td {
  border-top: 2px solid var(--border-color);
  font-weight: 700;
  color: var(--text-primary);
}
.dash-group-table tbody tr:last-child td { border-bottom: 1px solid var(--border-color); }

/* Stage color chip (mirrors the pills used elsewhere) */
.dash-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Count badge + sub-header (Overdue / Closing) ── */
.dash-sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.dash-sub-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.dash-badge-count {
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.dash-badge-count.dash-danger { background: #fee2e2; color: #991b1b; }
.dash-badge-count.dash-accent {
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary);
}

/* ── List rows (overdue activities / closing deals) ── */
.dash-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: inherit;
}
.dash-item:last-child { border-bottom: none; }
.dash-item:hover { background: var(--bg-secondary); }
.dash-item-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dash-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-item-meta {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dash-item-top {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.dash-item-top.dash-overdue-date { color: #991b1b; }
.dash-item-top.dash-item-money { color: var(--color-primary); }
.dash-item-bottom {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Empty states ── */
.dash-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.75rem 0.25rem;
}
.dash-emptystate {
  text-align: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 3rem 1.5rem;
}
.dash-emptystate-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.dash-emptystate p {
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}
