/* The full dashboard (DashboardDesktop, DashboardCounselorDesktop and Main on phones), once ministering data exists.
   Desktop shows the stat grid, the districts table and the needs and activity cards; below 1024px it's Main: tiles,
   overdue interviews, open needs and each district's progress. */

@media (min-width: 1024px) { .dash-phone-only { display: none !important; } }
@media (max-width: 1023px) { .dash-desktop-only { display: none !important; } }

.dash-full, .dash-phone { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.dash-phone { gap: 22px; }
.dash-muted { color: var(--ink-500); }
.dash-empty { padding: 12px 20px 16px; font-size: 14px; color: var(--ink-500); line-height: 1.5; }

/* StatCard (display/StatCard.jsx). */
.stat-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 16px 20px;
  border-radius: 14px; min-width: 0; height: 100%;
}
.stat-card-sm { padding: 14px; }
.stat-card-label { font-size: 13px; font-weight: 600; }
.stat-card-value { font-family: var(--font-display); font-size: 36px; font-weight: var(--weight-display); line-height: 1; }
.stat-card-sm .stat-card-value { font-size: 32px; }
.stat-card-lg .stat-card-value { font-size: 48px; }
.stat-card-of { font-size: 18px; }
.stat-card-sm .stat-card-of { font-size: 16px; }
.stat-card-sub { font-size: 13px; }
.stat-card-sm .stat-card-sub { font-size: 12px; }
.stat-card-rule { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.stat-card-paper { background: #FFFFFF; border: 1px solid var(--paper-300); box-shadow: var(--shadow-card); }
.stat-card-paper .stat-card-label, .stat-card-paper .stat-card-sub, .stat-card-paper .stat-card-of { color: var(--ink-500); }
.stat-card-paper .stat-card-value { color: var(--navy-700); }
.stat-card-paper .stat-card-value-walnut { color: var(--walnut-900); }
.stat-card-ruby { background: var(--ruby-800); color: #FFFFFF; box-shadow: var(--shadow-ruby); }
.stat-card-ruby .stat-card-label, .stat-card-ruby .stat-card-sub { color: var(--ruby-100); }
.stat-card-walnut { background: var(--walnut-900); color: var(--walnut-50); box-shadow: var(--shadow-walnut); }
.stat-card-walnut .stat-card-label, .stat-card-walnut .stat-card-sub { color: var(--walnut-300); }
.stat-card-walnut .stat-card-value { color: var(--gold-200); }
.stat-card-navy { background: var(--navy-950); color: #FFFFFF; }
.stat-card-navy .stat-card-label { color: var(--navy-200); }
.stat-card-navy .stat-card-sub { color: var(--navy-100); }
.stat-card-navy .stat-card-of { color: var(--navy-200); }
.stat-card-split {
  margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 12px; font-size: 13px;
  border-top: 1px solid var(--walnut-700);
}
.stat-card-split-row { display: flex; justify-content: space-between; gap: var(--space-8); }
.dash-needs-link { display: grid; text-decoration: none; }
.dash-needs-link:hover .stat-card { box-shadow: 0 0 0 2px var(--gold-500); }

/* The stat grids. */
.dash-stats { display: grid; gap: 14px 16px; }
.dash-stats-ward { grid-template-columns: 170px repeat(3, minmax(0, 1fr)) minmax(0, 0.9fr); }
.dash-stats-ward .dash-needs-tile { grid-column: 5; grid-row: 1 / span 2; display: grid; }
.dash-stats-org { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-org { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding-left: 12px; border-left: 4px solid var(--navy-700); }
.dash-org-rs { border-left-color: var(--walnut-900); }
.dash-org-name { font-family: var(--font-display); font-size: 19px; font-weight: var(--weight-display); color: var(--navy-950); line-height: 1.2; }
.dash-org-count { font-size: 12px; color: var(--ink-500); }

/* The body: districts on the left, needs and activity on the right. */
.dash-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dash-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-12); padding: 18px 22px 12px; }
.dash-card-title { font-family: var(--font-display); font-size: 21px; font-weight: var(--weight-display); color: var(--walnut-900); }
.dash-side .dash-card-head { padding: 18px 20px 10px; }
.dash-side .dash-card-title { font-size: var(--type-title-sm); }

/* ProgressBar and its legend. */
.dash-bar { display: block; width: 100%; height: 10px; border-radius: 6px; background: var(--paper-200); overflow: hidden; }
.dash-bar-in-person { fill: var(--navy-700); }
.dash-bar-other { fill: var(--navy-300); }
.dash-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-500); }
.dash-legend-item { display: flex; align-items: center; gap: 6px; }
.dash-swatch { width: 10px; height: 10px; border-radius: 2px; }
.dash-swatch-in-person { background: var(--navy-700); }
.dash-swatch-other { background: var(--navy-300); }

/* Districts this quarter. */
.dash-district-rows { list-style: none; margin: 0; padding: 0; }
.dash-district-grid { display: grid; grid-template-columns: 1.3fr 1fr 2fr 70px 90px; gap: 16px; align-items: center; padding: 14px 22px; font-size: 14px; }
.dash-district-head {
  padding-top: 10px; padding-bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--walnut-300); background: var(--walnut-900);
}
.dash-district-row { border-bottom: 1px solid var(--border-row); }
.dash-district-name { font-weight: 600; text-decoration: none; color: var(--ink-900); overflow-wrap: anywhere; }
.dash-district-name:hover { color: var(--navy-700); }
.dash-district-leader { color: var(--ink-500); overflow-wrap: anywhere; }
.dash-district-done { font-weight: 700; color: var(--navy-700); white-space: nowrap; }

/* Open needs and Recent activity. */
.dash-need-rows, .dash-activity-rows, .dash-overdue-rows, .dash-phone-districts { list-style: none; margin: 0; padding: 0; }
.dash-need { display: flex; flex-direction: column; gap: 5px; padding: 12px 20px; border-top: 1px solid var(--border-row); }
.dash-need-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); }
.dash-need-title { font-size: 15px; font-weight: 600; text-decoration: none; color: var(--ink-900); overflow-wrap: anywhere; }
.dash-need-text { font-size: 14px; color: var(--ink-700); overflow-wrap: anywhere; }
.dash-need-meta { font-size: 12px; color: var(--ink-500); }
.dash-activity-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 20px; border-top: 1px solid var(--border-row); }
.dash-activity-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.dash-activity-when { font-size: 12px; color: var(--ink-500); }
.dash-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--paper-700); }
.dash-dot-interview { background: var(--navy-700); }
.dash-dot-import { background: var(--gold-500); }
.dash-dot-done { background: var(--green-800); }
.dash-dot-moved { background: var(--ruby-800); }

/* The phone dashboard (Main). */
.dash-phone-head { display: flex; flex-direction: column; gap: 6px; padding: 8px 20px 24px; }
.dash-phone-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy-200); }
.dash-phone-title { font-family: var(--font-display); font-size: 30px; font-weight: var(--weight-display); line-height: 1.15; }
.dash-phone-label { display: flex; align-items: center; gap: 8px; margin-bottom: -12px; }
.dash-phone-label span:first-child { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy-700); }
.dash-phone-label::after { content: ''; flex-grow: 1; height: 1px; background: var(--paper-300); }
.dash-phone-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dash-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dash-split-part { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dash-split-part + .dash-split-part { padding-left: 8px; border-left: 1px solid var(--paper-300); }
.dash-split-org { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--ink-500); }
.dash-split-of { font-size: 11px; color: var(--ink-500); }
.dash-phone-section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dash-phone-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-12); }
.dash-overdue { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 14px; border-bottom: 1px solid var(--border-row); }
.dash-overdue:last-child { border-bottom: 0; }
.dash-overdue-text { display: flex; flex-direction: column; gap: 3px; flex-grow: 1; min-width: 0; }
.dash-overdue-names { font-size: 15px; font-weight: 600; text-decoration: none; color: var(--ink-900); overflow-wrap: anywhere; }
.dash-overdue-sub { font-size: 13px; color: var(--ink-500); }
.dash-overdue-badge {
  font-size: 12px; font-weight: 700; color: var(--ruby-800); background: var(--ruby-50); padding: 4px 8px;
  border-radius: 6px; white-space: nowrap;
}
.dash-phone-districts { padding: 6px 14px; }
.dash-phone-district { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border-row); }
.dash-phone-district:last-child { border-bottom: 0; }
.dash-phone-district-top { display: flex; justify-content: space-between; gap: var(--space-8); font-size: 14px; }
.dash-phone-district .dash-bar { height: 8px; }

@media (max-width: 1023px) {
  .dash-card-head { padding: 14px 14px 8px; }
  .dash-card-title { font-size: var(--type-section); }
  .dash-need { padding: 14px; }
  .dash-empty { padding: 12px 14px 14px; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .dash-stats-ward { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-stats-ward .dash-org { grid-column: 1 / -1; }
  .dash-stats-ward .dash-needs-tile { grid-column: 1 / -1; grid-row: auto; }
  .dash-stats-org { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-body { grid-template-columns: minmax(0, 1fr); }
}
