body { background: #f5f7fb; }
.metric-card { border: 0; border-radius: 1rem; }
.metric-label { color: #6c757d; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.metric-value { font-size: 1.65rem; font-weight: 800; }
.metric-subtitle { color: #6c757d; font-size: .85rem; }
.progress-badge { padding: .25rem .5rem; border-radius: 999px; font-weight: 700; font-size: .85rem; display: inline-block; }
.progress-low { background: #ffe5e5; color: #991b1b; }
.progress-mid { background: #fff3cd; color: #7a5200; }
.progress-high { background: #dcfce7; color: #166534; }
.callout-item { border-bottom: 1px solid #e9ecef; padding: .55rem 0; }
.callout-item:last-child { border-bottom: 0; }
.loading-box { display: flex; align-items: center; gap: .55rem; color: #6c757d; padding: 1rem; }
.loading-cell { color: #6c757d; padding: 1rem !important; }
.clickable { cursor: pointer; color: #0d6efd; text-decoration: underline; text-decoration-style: dotted; }
.voter-card { border: 0; border-radius: 1rem; overflow: hidden; }
.voter-card .voter-name { font-size: 1.15rem; font-weight: 800; }
.voter-chip { display: inline-block; padding: .25rem .5rem; border-radius: 999px; background: #eef2ff; margin: .15rem .2rem .15rem 0; font-size: .85rem; }
.status-chip { display: inline-block; padding: .25rem .55rem; border-radius: 999px; background: #f1f5f9; font-weight: 700; }
.svg-map-wrap { width: 100%; min-height: 420px; background: #eef6ef; border-radius: .75rem; border: 1px solid #dee2e6; overflow: hidden; }
.svg-map-wrap svg { width: 100%; height: 520px; display: block; }
.legend-dot { display:inline-block; width:.8rem; height:.8rem; border-radius:50%; margin-right:.35rem; vertical-align:middle; }
.legend-visited { background:#198754; }
.legend-unvisited { background:#dc3545; }
.decile-sparkline {
  display: inline-flex;
  align-items: end;
  gap: 2px;
  height: 32px;
  min-width: 90px;
  vertical-align: middle;
}
.decile-bar {
  display: inline-block;
  width: 7px;
  min-height: 3px;
  border-radius: 2px 2px 0 0;
  background: #8ecae6;
  opacity: 0.95;
}
.decile-sparkline-label {
  line-height: 1;
}

.mini-metric {
    border: 1px solid rgba(0,0,0,.08);
    border-radius: .75rem;
    padding: .75rem;
    background: #fff;
    height: 100%;
}
.mini-metric-value { font-size: 1.45rem; font-weight: 800; line-height: 1; }
.mini-metric-label { font-size: .9rem; color: #495057; margin-top: .25rem; }
.mini-metric-sub { font-size: .78rem; color: #6c757d; }
.brief-list { border: 1px solid rgba(0,0,0,.08); border-radius: .75rem; padding: .75rem; height: 100%; background:#fff; }
.brief-list ul { margin: 0; padding-left: 1.1rem; }
.notes-cell { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-row { margin-bottom: .85rem; }
.goal-row .progress { height: 1.25rem; }
.goal-input { width: 5rem; border: 1px solid #ced4da; border-radius: .35rem; padding: .05rem .35rem; text-align: right; }
.quality-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .5rem; }
.quality-check { display:flex; justify-content:space-between; gap:.75rem; border:1px solid rgba(0,0,0,.08); border-radius:.6rem; padding:.55rem .7rem; background:#fff; }
.quality-check strong { color:#dc3545; }

.turf-builder-map {
    min-height: 580px;
    border: 1px dashed #b8c2cc;
    border-radius: 12px;
    background: #f8fafc;
    overflow: hidden;
}

/* Turf map modal with street underlay */
.turf-leaflet-map {
    width: 100%;
    height: 620px;
    min-height: 420px;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #eef2f7;
}

/* Voter lookup badge coloring */
.voter-chip.chip-blue-strong { background:#dbeafe; color:#1e3a8a; border:1px solid #93c5fd; font-weight:700; }
.voter-chip.chip-blue-mid { background:#e0f2fe; color:#075985; border:1px solid #bae6fd; }
.voter-chip.chip-blue-light { background:#f0f9ff; color:#0369a1; border:1px solid #e0f2fe; }

.voter-chip.chip-score-very-low { background:#fee2e2; color:#991b1b; border:1px solid #fecaca; font-weight:700; }
.voter-chip.chip-score-low { background:#ffedd5; color:#9a3412; border:1px solid #fed7aa; font-weight:700; }
.voter-chip.chip-score-mid { background:#fef9c3; color:#854d0e; border:1px solid #fde68a; font-weight:700; }
.voter-chip.chip-score-mid-high { background:#dcfce7; color:#166534; border:1px solid #86efac; font-weight:700; }
.voter-chip.chip-score-high { background:#bbf7d0; color:#166534; border:1px solid #4ade80; font-weight:800; }
.voter-chip.chip-score-very-high { background:#86efac; color:#14532d; border:1px solid #22c55e; font-weight:900; }
.voter-chip.chip-gender-m { background:#dbeafe; color:#1d4ed8; border:1px solid #93c5fd; font-weight:700; }
.voter-chip.chip-gender-f { background:#fce7f3; color:#be185d; border:1px solid #f9a8d4; font-weight:700; }
.voter-chip.chip-neutral, .status-chip.chip-neutral { background:#f1f5f9; color:#475569; border:1px solid #cbd5e1; }
.status-chip.chip-visit-good, .voter-chip.chip-support, .voter-chip.chip-support-strong { background:#dcfce7; color:#166534; border:1px solid #86efac; }
.voter-chip.chip-support-strong { font-weight:800; }
.status-chip.chip-visit-bad { background:#fee2e2; color:#991b1b; border:1px solid #fecaca; }
.status-chip.chip-visit-warn, .voter-chip.chip-warning { background:#fef3c7; color:#92400e; border:1px solid #fde68a; }
.voter-chip.chip-orange { background:#ffedd5; color:#9a3412; border:1px solid #fed7aa; }
.voter-chip.chip-danger { background:#fee2e2; color:#991b1b; border:1px solid #fecaca; }
.voter-chip.chip-tier { background:#ecfeff; color:#155e75; border:1px solid #a5f3fc; }
.voter-chip.chip-group { background:#eef2ff; color:#3730a3; border:1px solid #c7d2fe; }
.voter-chip.chip-plain { background:#f8fafc; color:#334155; border:1px solid #e2e8f0; }
.voter-chip.chip-donor { background:#ecfdf5; color:#065f46; border:1px solid #a7f3d0; font-weight:700; }
.voter-chip.chip-party-dem { background:#dbeafe; color:#1e40af; border:1px solid #93c5fd; font-weight:800; }
.voter-chip.chip-party-rep { background:#fee2e2; color:#991b1b; border:1px solid #fecaca; font-weight:800; }
.voter-chip.chip-party-other { background:#f3e8ff; color:#6b21a8; border:1px solid #d8b4fe; font-weight:700; }
.donation-block { background:linear-gradient(180deg, rgba(236,253,245,.45), rgba(255,255,255,0)); border-radius:.6rem; }
.score-help { cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }

/* Issue analysis / issue chips */
.voter-chip.chip-issue-1 { background:#ede9fe; color:#5b21b6; border:1px solid #c4b5fd; font-weight:700; }
.voter-chip.chip-issue-2 { background:#e0f2fe; color:#075985; border:1px solid #7dd3fc; font-weight:700; }
.voter-chip.chip-issue-3 { background:#ccfbf1; color:#115e59; border:1px solid #5eead4; font-weight:700; }
.issue-block { background:linear-gradient(180deg, rgba(237,233,254,.45), rgba(255,255,255,0)); border-radius:.6rem; }

/* Map street-number labels above household dots */
.street-num-label {
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    border: 1px solid rgba(17, 24, 39, 0.25);
    border-radius: 999px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 800;
    line-height: 14px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    white-space: nowrap;
}
.svg-street-num {
    font-size: 10px;
    font-weight: 800;
    fill: #111827;
    paint-order: stroke;
    stroke: rgba(255,255,255,.95);
    stroke-width: 3px;
}

/* Turf Leaflet dot markers - HTML markers stay visible above polygons/tiles */
.turf-dot-marker {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 3px solid #fff;
    box-shadow: 0 1px 5px rgba(0,0,0,.55);
}
.turf-dot-marker.visited { background:#198754; }
.turf-dot-marker.unvisited { background:#dc3545; }

/* v26 navbar cleanup */
.db-schema-label {
    font-size: 0.78rem;
    line-height: 1.05;
    text-align: right;
    opacity: 0.85;
}
.navbar-brand {
    letter-spacing: 0.01em;
}

.turf-email-controls select { max-width: 100%; }
.street-num-label { font-weight: 800; font-size: 11px; color: #111827; text-shadow: 0 1px 2px #fff, 1px 0 2px #fff, -1px 0 2px #fff; }

/* v33: slightly smaller header/nav typography */
.navbar {
    font-size: 0.92rem;
}
.navbar-brand {
    font-size: 1.05rem;
}
.navbar .nav-link {
    font-size: 0.9rem;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}
.navbar-text,
.db-schema-label {
    font-size: 0.72rem;
}

/* Campaign finance pages */
.finance-section-title { font-weight: 800; letter-spacing: .01em; }
.finance-positive { color: #166534; font-weight: 800; }
.finance-negative { color: #991b1b; font-weight: 800; }
.finance-form .form-label { font-size: .78rem; color: #475569; font-weight: 700; }
.finance-badge-due { background:#fef3c7; color:#92400e; border:1px solid #fde68a; }
.voter-chip.chip-issue-main { background:#fef3c7; color:#92400e; border:1px solid #fcd34d; font-weight:700; }

/* v39 finance colors and collapsible widgets */
.finance-positive { color: #166534 !important; font-weight: 800; }
.finance-negative { color: #991b1b !important; font-weight: 800; }
.finance-pledge { color: #22c55e !important; font-weight: 800; }
.widget-collapse-toggle { font-size: 0.75rem; padding: 0.15rem 0.45rem; }
.widget-collapsed .card-header { border-bottom: 0; }
.action-detail-link, .audit-count-link { text-decoration-style: dotted; }

/* Form validation polish */
.was-validated .form-control:invalid,
.was-validated .form-select:invalid,
.form-control:invalid:not(:placeholder-shown) {
    border-color: #dc3545;
}
.was-validated .form-control:valid,
.was-validated .form-select:valid {
    border-color: #198754;
}

.metric-delta {
    display: inline-block;
    white-space: nowrap;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    padding-top: 0.15rem;
}

/* Turf Builder Leaflet preview */
.turf-builder-leaflet-map {
    width: 100%;
    height: 580px;
    min-height: 580px;
    border-radius: 12px;
    overflow: hidden;
}
.tb-turf-number-label {
    background: transparent;
    border: none;
}
.tb-turf-number-label span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: rgba(255,255,255,.86);
    border: 3px solid rgba(17,24,39,.85);
    color: #111827;
    font-size: 1.65rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
#tbTable tr.table-secondary td {
    color: #6b7280;
    text-decoration: line-through;
}

/* v49 turf walk-list grouping/sorting */
.walk-list-table { border-collapse: separate; border-spacing: 0; }
.walk-list-table tbody tr.walk-address-group-a > td { background: #f8fafc; }
.walk-list-table tbody tr.walk-address-group-b > td { background: #eef6ff; }
.walk-list-table tbody tr > td { border-bottom: 1px solid #dbe3ec; vertical-align: top; }
.walk-address-cell { min-width: 170px; }
.walk-notes-cell { min-width: 220px; max-width: 360px; white-space: normal; }
@media print {
  .turf-email-controls, .legend-dot, #turfWalkSort, .turf-walk-list button, .leaflet-control-container { display: none !important; }
  #turfLeafletMap { display: block !important; height: 420px !important; break-after: avoid; }
  .walk-list-table { font-size: 10px; }
}


/* v50: when printing with a Bootstrap modal open, print only the popup. */
@media print {
  body:has(.modal.show) > *:not(.modal):not(.modal-backdrop) { visibility: hidden !important; }
  body:has(.modal.show) .modal.show,
  body:has(.modal.show) .modal.show * { visibility: visible !important; }
  body:has(.modal.show) .modal.show {
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }
  body:has(.modal.show) .modal-dialog {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
  }
  body:has(.modal.show) .modal-content {
    border: 0 !important;
    box-shadow: none !important;
  }
  body:has(.modal.show) .modal-body {
    max-height: none !important;
    overflow: visible !important;
  }
  body:has(.modal.show) .modal-header .btn-close,
  body:has(.modal.show) .modal-footer,
  body:has(.modal.show) .modal-backdrop {
    display: none !important;
  }
}

/* Absentee / permanent AV voter indicators */
.voter-chip.chip-abv {
    background: #e0f2fe;
    border: 1px solid #38bdf8;
    color: #075985;
    font-weight: 700;
}
.walk-abv-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: #e0f2fe;
    border: 1px solid #38bdf8;
    color: #075985;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}
.walk-abv-badge.muted {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

/* v56 Turf Builder selection clarity */
#tbTable tr.tb-turf-selected > td { font-weight: 800; border-top: 2px solid #0d6efd; border-bottom: 2px solid #0d6efd; background: #eaf3ff !important; }
#tbTable tr.tb-turf-unselected > td { color: #6b7280; background: #f8fafc !important; }
.metric-card.finance-positive .metric-value { color: #198754; }
.metric-card.finance-negative .metric-value { color: #dc3545; }

/* v61: overview financial mini-widget should match every other mini-widget.
   Only the dollar value gets finance coloring; card, label, and subtitle keep normal metric-card typography. */
#overviewCards .metric-card .metric-label {
    font-size: .82rem;
    font-weight: 400;
}
#overviewCards .metric-card .metric-value {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.2;
}
#overviewCards .metric-card .metric-subtitle {
    font-size: .85rem;
    font-weight: 400;
}

/* v66 turf-builder editable polygon states */
#tbTable tr.tb-turf-active > td {
  outline: 2px solid rgba(13, 110, 253, 0.35);
  outline-offset: -2px;
  background-color: rgba(13, 110, 253, 0.08) !important;
}
#tbTable tr.tb-turf-active td:first-child::after {
  content: ' editing target';
  display: block;
  font-size: 0.68rem;
  color: #0d6efd;
  font-weight: 700;
}
.leaflet-pm-icon-marker,
.marker-icon,
.leaflet-marker-icon.marker-icon {
  cursor: move;
}


.walk-parity-section td {
    background: #f3f4f6 !important;
    border-top: 2px solid #6b7280;
    font-size: 1rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
@media print {
    .walk-page-break { break-before: page; page-break-before: always; }
}
.targeting-override-block .btn-group { gap: .25rem; }


/* Build 71: widgetized page sections */
.dashboard-widget {
  position: relative;
}
.dashboard-widget-header {
  cursor: default;
  gap: .5rem;
}
.dashboard-widget-tools {
  flex-shrink: 0;
}
.widget-drag-handle {
  cursor: grab;
}
.widget-drag-ghost {
  opacity: .55;
  outline: 2px dashed rgba(0,0,0,.25);
}
.widget-collapsed > .card-body,
.widget-collapsed > .widget-body,
.widget-collapsed > .list-group,
.widget-collapsed > .table-responsive,
.widget-collapsed > .card-footer {
  display: none !important;
}
.widget-hidden {
  display: none !important;
}
.page-customizer {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  max-width: min(380px, calc(100vw - 2rem));
}
.page-customizer-toggle {
  border-radius: 999px;
}
.page-customizer-panel {
  width: min(380px, calc(100vw - 2rem));
  max-height: min(620px, calc(100vh - 6rem));
  overflow: auto;
  margin-bottom: .5rem;
}
.page-customizer-list label:last-child {
  border-bottom: 0 !important;
}
@media print {
  .page-customizer,
  .dashboard-widget-tools {
    display: none !important;
  }
  .widget-hidden {
    display: block !important;
  }
}


/* Build 72: cleaner widget controls and restored compact dashboard cards */
.dashboard-widget-card > .dashboard-widget-header {
  min-height: 3rem;
  padding-top: .55rem;
  padding-bottom: .55rem;
}
.dashboard-widget-tools {
  gap: 0;
  margin-left: auto;
}
.widget-icon-btn {
  width: 2.15rem;
  min-width: 2.15rem;
  padding-left: 0;
  padding-right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.widget-icon-btn i { pointer-events: none; }
.dashboard-widget > .card { height: 100%; }
.metric-card .card-header,
.mini-metric .card-header { display: none !important; }
#overviewCards .metric-card { min-height: 0; }
#overviewCards .metric-card .card-body { padding: 1rem 1.1rem; }
#overviewCards .metric-label { font-size: .82rem; }
#overviewCards .metric-value { font-size: 1.65rem; line-height: 1.05; }
#overviewCards .metric-subtitle { font-size: .85rem; }
.card-header .widget-label { min-width: 0; }
.card-header .small.text-muted { overflow-wrap: anywhere; }

/* Volunteers: compact rows and more practical columns */
#volunteerStatsTable,
#volunteersTable,
#volunteerContactsTable { font-size: .92rem; }
#volunteerStatsTable th,
#volunteerStatsTable td,
#volunteersTable th,
#volunteersTable td,
#volunteerContactsTable th,
#volunteerContactsTable td {
  padding: .35rem .45rem;
  line-height: 1.15;
  vertical-align: middle;
}
#volunteerStatsTable td:first-child a,
#volunteerStatsTable td:first-child,
#volunteersTable td:first-child {
  font-size: .95rem;
  font-weight: 500 !important;
}
#volunteerStatsTable th:nth-child(1), #volunteerStatsTable td:nth-child(1) { min-width: 105px; }
#volunteerStatsTable th:nth-child(2), #volunteerStatsTable td:nth-child(2),
#volunteerStatsTable th:nth-child(3), #volunteerStatsTable td:nth-child(3),
#volunteerStatsTable th:nth-child(4), #volunteerStatsTable td:nth-child(4),
#volunteerStatsTable th:nth-child(5), #volunteerStatsTable td:nth-child(5) { width: 64px; max-width: 72px; }
#volunteerStatsTable th:nth-child(8), #volunteerStatsTable td:nth-child(8) { min-width: 92px; }
#volunteerStatsTable th { white-space: normal; }
#volunteerStatsTable td { white-space: nowrap; }

/* Turf popup paper output: map pages and evens/odds page breaks */
.turf-print-map-page { display: none; }
@media print {
  .turf-print-map-page {
    display: block !important;
    break-before: page;
    page-break-before: always;
    break-after: page;
    page-break-after: always;
    height: 96vh;
    padding: .25in;
  }
  .turf-print-map-page:first-child { break-before: auto; page-break-before: auto; }
  .turf-print-map-page h2 { font-size: 18pt; margin-bottom: .2in; }
  .turf-print-map-svg { width: 100%; height: 82vh; border: 1px solid #222; }
  .walk-page-break { break-before: page; page-break-before: always; }
}


/* Build 74: mini metric widgets, cleaner print maps, and R/RW permissions */
.mini-widget-shell { position: relative; }
.mini-widget-hidden { display: none !important; }
.metric-card { position: relative; overflow: hidden; }
.mini-widget-tools { position:absolute; top:.25rem; right:.3rem; display:flex; gap:.1rem; opacity:.15; transition:opacity .15s ease; z-index:3; }
.metric-card:hover .mini-widget-tools { opacity:1; }
.mini-widget-tools button { border:0; background:rgba(255,255,255,.85); color:#64748b; padding:.05rem .25rem; border-radius:.35rem; font-size:.72rem; line-height:1.2; }
.mini-widget-drag { cursor: grab; }
.turf-print-map-page { break-before: page; page-break-before: always; padding:.35in; }
.turf-print-map-page:first-child { break-before:auto; page-break-before:auto; }
.turf-print-map-svg { width:100%; height:auto; max-height:7.4in; border:1px solid #111; background:#fff; }
.permission-grid .btn { min-width:3.3rem; }
@media print { .turf-print-map-page { min-height:9.5in; display:block; } .turf-print-map-page h2 { font-size:18pt; margin:0 0 .15in; } .walk-page-break { break-before:page; page-break-before:always; } }


/* Build 75: compact colored page permissions, true minimize, issue/print polish */
.permission-grid { --perm-font: .72rem; }
.permission-grid .border { padding: .35rem .45rem !important; }
.permission-grid .fw-semibold { font-size: .78rem; line-height: 1.05; margin-bottom: .22rem !important; }
.permission-grid .btn-group { display: inline-flex; }
.permission-grid .btn { min-width: 2.35rem !important; padding: .12rem .35rem !important; font-size: var(--perm-font) !important; line-height: 1.15 !important; font-weight: 700; }
.permission-grid .btn-check[value="none"]:checked + .btn { background:#dc3545 !important; border-color:#dc3545 !important; color:#fff !important; }
.permission-grid .btn-check[value="read"]:checked + .btn { background:#ffc107 !important; border-color:#ffc107 !important; color:#111827 !important; }
.permission-grid .btn-check[value="write"]:checked + .btn { background:#198754 !important; border-color:#198754 !important; color:#fff !important; }
.permission-grid .btn-check:not(:checked) + .btn { background:#fff; color:#64748b; }

/* Minimize should leave a compact header bar; hide is the only full removal action. */
.dashboard-widget.widget-collapsed,
.dashboard-widget-card.widget-collapsed { display:block !important; visibility:visible !important; min-height:0 !important; }
.dashboard-widget-card.widget-collapsed > .dashboard-widget-header,
.dashboard-widget.widget-collapsed > .dashboard-widget-header { display:flex !important; border-bottom:0 !important; }
.dashboard-widget-card.widget-collapsed > *:not(.dashboard-widget-header):not(.card-header),
.dashboard-widget.widget-collapsed > *:not(.dashboard-widget-header):not(.card-header) { display:none !important; }
.widget-hidden { display:none !important; }

.turf-print-map-page { display:none; }
@media print {
  body.printing-turf-map * { visibility:hidden !important; }
  body.printing-turf-map #turfWalkList,
  body.printing-turf-map #turfWalkList * { visibility:visible !important; }
  .turf-print-map-page {
    display:flex !important;
    flex-direction:column;
    break-before:page;
    page-break-before:always;
    width:100vw;
    height:100vh;
    box-sizing:border-box;
    padding:.18in;
    background:#fff !important;
  }
  .turf-print-map-page:first-child { break-before:auto; page-break-before:auto; }
  .turf-print-map-title { font-size:18pt; font-weight:800; margin:0 0 .08in 0; }
  .turf-print-map-svg { flex:1 1 auto; width:100%; height:100%; max-height:none !important; border:1px solid #111; background:#fff; }
  .turf-print-map-legend { font-size:9pt; color:#475569; margin-top:.05in; }
  .walk-page-break { break-before:page; page-break-before:always; }
}


/* Build 76: admin permissions compact 3/4 across, true minimized widgets, and full-page turf print maps */
.permission-grid.permission-grid-existing .border,
.permission-grid.permission-grid-create .border { padding: .22rem .35rem !important; }
.permission-grid.permission-grid-existing .fw-semibold,
.permission-grid.permission-grid-create .fw-semibold { font-size: .72rem !important; line-height: 1 !important; margin-bottom: .14rem !important; }
.permission-grid.permission-grid-existing .btn,
.permission-grid.permission-grid-create .btn { min-width: 1.95rem !important; padding: .07rem .24rem !important; font-size: .66rem !important; line-height: 1.05 !important; }
.permission-grid .btn-check[value="none"]:checked + .btn { background:#dc3545 !important; border-color:#dc3545 !important; color:#fff !important; }
.permission-grid .btn-check[value="read"]:checked + .btn { background:#ffc107 !important; border-color:#ffc107 !important; color:#111827 !important; }
.permission-grid .btn-check[value="write"]:checked + .btn { background:#198754 !important; border-color:#198754 !important; color:#fff !important; }

/* The minus icon must collapse only the body/content, never hide the whole card. */
.dashboard-widget.widget-collapsed,
.dashboard-widget-card.widget-collapsed { display:block !important; visibility:visible !important; opacity:1 !important; }
.dashboard-widget-card.widget-collapsed > .dashboard-widget-header,
.dashboard-widget.widget-collapsed > .dashboard-widget-header,
.dashboard-widget-card.widget-collapsed > .card-header,
.dashboard-widget.widget-collapsed > .card-header { display:flex !important; visibility:visible !important; }
.dashboard-widget-card.widget-collapsed > .card-body,
.dashboard-widget.widget-collapsed > .card-body,
.dashboard-widget-card.widget-collapsed > .table-responsive,
.dashboard-widget.widget-collapsed > .table-responsive,
.dashboard-widget-card.widget-collapsed > .list-group,
.dashboard-widget.widget-collapsed > .list-group { display:none !important; }
.widget-hidden { display:none !important; }

@media print {
  @page { size: landscape; margin: 0.25in; }
  body.printing-turf-map > *:not(.modal):not(.modal-backdrop) { display:none !important; }
  body.printing-turf-map .modal,
  body.printing-turf-map .modal-dialog,
  body.printing-turf-map .modal-content,
  body.printing-turf-map .modal-body { display:block !important; position:static !important; transform:none !important; width:auto !important; max-width:none !important; height:auto !important; overflow:visible !important; box-shadow:none !important; border:0 !important; padding:0 !important; margin:0 !important; }
  body.printing-turf-map .modal-header,
  body.printing-turf-map .modal-footer,
  body.printing-turf-map .turf-map-container,
  body.printing-turf-map .turf-email-controls,
  body.printing-turf-map #turfWalkList > .d-flex,
  body.printing-turf-map #turfWalkList > .small,
  body.printing-turf-map #turfWalkList > .table-responsive { display:none !important; }
  body.printing-turf-map #turfWalkList { display:block !important; margin:0 !important; padding:0 !important; }
  body.printing-turf-map .turf-print-map-page {
    display:flex !important;
    flex-direction:column;
    width:100%;
    height:7.45in;
    page-break-after:always;
    break-after:page;
    box-sizing:border-box;
    padding:0;
    margin:0;
    background:#fff !important;
  }
  body.printing-turf-map .turf-print-map-title { font-size:20pt; font-weight:800; margin:0 0 .08in 0; }
  body.printing-turf-map .turf-print-map-svg { flex:1 1 auto; width:100% !important; height:100% !important; max-height:none !important; border:1px solid #111; background:#fff; }
  body.printing-turf-map .turf-print-map-legend { font-size:10pt; margin-top:.06in; }
}


/* Build 77: user permission grid and true column-shell minimize fixes */
.permissions-cell { min-width: 620px !important; width: 620px; }
.permission-grid.permission-grid-existing,
.permission-grid.permission-grid-create { --bs-gutter-x: .35rem; --bs-gutter-y: .35rem; }
.permission-grid .permission-tile { flex: 0 0 25% !important; width: 25% !important; max-width: 25% !important; }
.permission-grid .permission-tile > .border { display:inline-block; width:auto; min-width: 7.1rem; max-width: 100%; }
.permission-grid.permission-grid-existing .fw-semibold,
.permission-grid.permission-grid-create .fw-semibold { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 6.6rem; }
.permission-grid.permission-grid-existing .btn,
.permission-grid.permission-grid-create .btn { min-width: 1.78rem !important; padding: .06rem .2rem !important; font-size: .64rem !important; }
@media (max-width: 1200px) {
  .permission-grid .permission-tile { flex-basis: 33.333% !important; width: 33.333% !important; max-width:33.333% !important; }
  .permissions-cell { min-width: 520px !important; width: 520px; }
}

/* Collapse only the card body/content. The shell/column must stay visible. */
.dashboard-widget.widget-collapsed-shell { display:block !important; visibility:visible !important; opacity:1 !important; }
.dashboard-widget.widget-collapsed-shell > .dashboard-widget-card,
.dashboard-widget.widget-collapsed-shell > .card { display:block !important; visibility:visible !important; opacity:1 !important; }
.dashboard-widget-card.widget-collapsed > .dashboard-widget-header,
.dashboard-widget-card.widget-collapsed > .card-header { display:flex !important; visibility:visible !important; opacity:1 !important; }
.dashboard-widget-card.widget-collapsed > .card-body,
.dashboard-widget-card.widget-collapsed > .table-responsive,
.dashboard-widget-card.widget-collapsed > .list-group,
.dashboard-widget-card.widget-collapsed > .card-footer { display:none !important; }

/* Build 77: if the standalone print-window fallback is blocked, make current-page print less brittle. */
@media print {
  body.printing-turf-map #turfWalkList { display:block !important; visibility:visible !important; }
  body.printing-turf-map .turf-print-map-page { display:flex !important; width:100% !important; height:7.45in !important; }
}


/* Build 78 demo polish pass */
/* Keep all widget controls at far right and small. */
.dashboard-widget-header { display:flex !important; align-items:center !important; gap:.5rem !important; }
.dashboard-widget-header .widget-label { flex:1 1 auto; min-width:0; }
.dashboard-widget-tools { margin-left:auto !important; flex:0 0 auto !important; }
.dashboard-widget-tools .btn { padding:.15rem .35rem !important; line-height:1 !important; }

/* True minimized state: leave the title/header; only collapse content. */
.dashboard-widget-card.widget-collapsed,
.dashboard-widget.widget-collapsed,
.dashboard-widget.widget-collapsed-shell { display:block !important; visibility:visible !important; opacity:1 !important; height:auto !important; min-height:0 !important; }
.dashboard-widget-card.widget-collapsed > .card-header,
.dashboard-widget-card.widget-collapsed > .dashboard-widget-header,
.dashboard-widget.widget-collapsed > .card-header,
.dashboard-widget.widget-collapsed > .dashboard-widget-header { display:flex !important; visibility:visible !important; opacity:1 !important; }
.dashboard-widget-card.widget-collapsed > .card-body,
.dashboard-widget-card.widget-collapsed > .table-responsive,
.dashboard-widget-card.widget-collapsed > .list-group,
.dashboard-widget-card.widget-collapsed > .card-footer,
.dashboard-widget.widget-collapsed > .card-body,
.dashboard-widget.widget-collapsed > .table-responsive,
.dashboard-widget.widget-collapsed > .list-group,
.dashboard-widget.widget-collapsed > .card-footer { display:none !important; }
.widget-hidden { display:none !important; }

/* Admin users: four compact permission groups across, no big tile borders. */
.permissions-cell { min-width: 780px !important; width: 780px !important; }
.permission-grid.permission-grid-existing,
.permission-grid.permission-grid-create { --bs-gutter-x:.45rem; --bs-gutter-y:.35rem; align-items:start; }
.permission-grid .permission-tile { flex:0 0 25% !important; width:25% !important; max-width:25% !important; }
.permission-grid .permission-tile > .border { border:0 !important; padding:0 !important; background:transparent !important; min-width:0 !important; width:auto !important; display:block !important; }
.permission-grid .fw-semibold { font-size:.82rem !important; line-height:1.05 !important; max-width:none !important; margin-bottom:.12rem !important; }
.permission-grid .btn-group { display:inline-flex !important; }
.permission-grid .btn { min-width:2.25rem !important; padding:.08rem .3rem !important; font-size:.78rem !important; line-height:1.1 !important; font-weight:700 !important; }
.user-save-btn:disabled { opacity:.35; cursor:not-allowed; }
@media (max-width: 1400px) { .permissions-cell { min-width:660px !important; width:660px !important; } .permission-grid .permission-tile { flex-basis:33.333% !important; width:33.333% !important; max-width:33.333% !important; } }

/* Volunteers: compact, aligned rows. */
#volunteerStatsTable { table-layout:auto; font-size:.82rem; }
#volunteerStatsTable th { font-size:.72rem; line-height:1.05; padding:.18rem .28rem; vertical-align:bottom; white-space:normal; }
#volunteerStatsTable td { font-size:.82rem; line-height:1.05; padding:.22rem .32rem; vertical-align:middle; white-space:nowrap; }
#volunteerStatsTable tbody tr { height:auto !important; }
#volunteerStatsTable td:first-child a { font-size:.84rem !important; font-weight:500 !important; }
#volunteerStatsTable th:nth-child(1), #volunteerStatsTable td:nth-child(1) { min-width:86px; }
#volunteerStatsTable th:nth-child(2), #volunteerStatsTable td:nth-child(2),
#volunteerStatsTable th:nth-child(3), #volunteerStatsTable td:nth-child(3),
#volunteerStatsTable th:nth-child(4), #volunteerStatsTable td:nth-child(4),
#volunteerStatsTable th:nth-child(5), #volunteerStatsTable td:nth-child(5),
#volunteerStatsTable th:nth-child(6), #volunteerStatsTable td:nth-child(6) { width:52px; min-width:46px; }
#volunteerStatsTable th:nth-child(8), #volunteerStatsTable td:nth-child(8) { min-width:74px; }
#volunteerContactsTable { font-size:.86rem; }
#volunteerContactsTable th, #volunteerContactsTable td { padding:.24rem .35rem !important; line-height:1.1 !important; vertical-align:middle; }
#volunteerContactsTable .form-control, #volunteerContactsTable .form-select, #volunteerContactsTable .btn { font-size:.82rem; padding:.18rem .35rem; }

/* Visits page: make precinct skinny and preserve date/address lines. */
#visitsTable th, #visitsTable td { font-size:.86rem; padding:.25rem .35rem; vertical-align:middle; }
#visitsTable th:nth-child(3), #visitsTable td:nth-child(3) { width:70px; max-width:78px; white-space:nowrap; }
#visitsTable th:nth-child(1), #visitsTable td:nth-child(1),
#visitsTable th:nth-child(2), #visitsTable td:nth-child(2) { white-space:nowrap; }

/* Finance tables: keep rows readable without mushing values together. */
#pledgeQueueTable th, #pledgeQueueTable td,
#allDonationsTable th, #allDonationsTable td,
#expenseLedgerTable th, #expenseLedgerTable td { font-size:.84rem; padding:.3rem .4rem; vertical-align:middle; }
#pledgeQueueTable td, #allDonationsTable td { white-space:nowrap; }
#expenseLedgerTable td { white-space:normal; }

/* Field Ops: make Next Best Turfs and Assignment Gaps full-width if wrapped in columns. */
[data-widget-id*="next-best-turfs"], [data-widget-id*="assignment-gaps"],
[data-widget-title*="Next Best Turfs"], [data-widget-title*="Assignment Gaps"] { flex:0 0 100% !important; max-width:100% !important; width:100% !important; }

/* Audit: keep most flagged-visit cells on one line, notes can wrap. */
#auditFlaggedVisitsTable th, #auditFlaggedVisitsTable td { white-space:nowrap; font-size:.84rem; }
#auditFlaggedVisitsTable td:last-child { white-space:normal; min-width:260px; }

/* Status page should not show widget chrome. */
body[data-page-key="status"] .dashboard-widget-tools,
body.status-page .dashboard-widget-tools { display:none !important; }

/* Turf health: keep turf names on one line. */
#turfHealthTable th:first-child, #turfHealthTable td:first-child { min-width:170px; white-space:nowrap; }


/* Build 79: demo follow-up polish */
/* Widget controls always right; minus collapses content, eye hides. */
.dashboard-widget-header,.card-header{align-items:center;}
.dashboard-widget-tools{margin-left:auto!important;justify-content:flex-end!important;}
.dashboard-widget-card.widget-collapsed>.card-body,.dashboard-widget-card.widget-collapsed>.table-responsive,.dashboard-widget-card.widget-collapsed>.card-footer,.dashboard-widget.widget-collapsed>.card-body,.dashboard-widget.widget-collapsed>.table-responsive,.dashboard-widget.widget-collapsed>.card-footer{display:none!important;}

/* Admin user permissions: tighter, 4 across, no wasted tile width. */
.permissions-cell{min-width:680px!important;width:680px!important;}
.permission-grid .permission-tile{flex:0 0 25%!important;width:25%!important;max-width:25%!important;}
.permission-grid .permission-tile>.border{border:0!important;box-shadow:none!important;background:transparent!important;padding:0!important;}
.permission-grid .fw-semibold{font-size:.86rem!important;}
.permission-grid .btn{font-size:.82rem!important;min-width:2.35rem!important;padding:.08rem .35rem!important;}

/* Donations / pledges: smaller headers and fewer wrapped cells. */
#allDonationsTable th,#allDonationsTable td,.data-table th,.data-table td{font-size:.8rem;}
#allDonationsTable th,.data-table th{line-height:1.05;}
#allDonationsTable td:nth-child(1),#allDonationsTable td:nth-child(12),#allDonationsTable td:nth-child(13),#allDonationsTable td:nth-child(14){white-space:nowrap;}
#pledgeQueueTable th,#pledgeQueueTable td{white-space:nowrap;font-size:.82rem;}
.donation-add-card .row.g-2{align-items:end;}
.donation-add-card input,.donation-add-card select{font-size:.86rem;}

/* Expenses: keep date on one line. */
#expenseLedgerTable td:first-child,#expenseLedgerTable th:first-child{white-space:nowrap;min-width:92px;}

/* Volunteers: align headers with columns, compact rows, wider status, shorter phone. */
#volunteersTable th{font-size:.82rem;line-height:1.1;vertical-align:bottom;}
#volunteersTable td{font-size:.88rem;line-height:1.1;vertical-align:middle;}
#volunteerStatsTable th{font-size:.68rem!important;line-height:1.02!important;vertical-align:bottom!important;padding-right:.75rem!important;}
#volunteerStatsTable .sorting:before,#volunteerStatsTable .sorting:after{right:.1rem!important;}
#volunteerContactsTable th,#volunteerContactsTable td{font-size:.84rem!important;line-height:1.05!important;padding:.2rem .32rem!important;}
#volunteerContactsTable th:nth-child(2),#volunteerContactsTable td:nth-child(2){min-width:112px!important;width:112px!important;}
#volunteerContactsTable th:nth-child(5),#volunteerContactsTable td:nth-child(5){max-width:150px!important;width:150px!important;}
#volunteerContactsTable td:nth-child(5) input{max-width:140px!important;}
#volunteerContactsTable .btn[data-action="save"],#volunteerContactsTable .volunteer-save-btn:disabled{opacity:.4;}

/* DataTables sorting arrows: stop overlapping labels. */
table.dataTable thead>tr>th{padding-right:1.25rem!important;vertical-align:bottom!important;}
table.dataTable thead .sorting:before,table.dataTable thead .sorting:after,table.dataTable thead .sorting_asc:before,table.dataTable thead .sorting_asc:after,table.dataTable thead .sorting_desc:before,table.dataTable thead .sorting_desc:after{right:.25rem!important;top:50%!important;}
#priorityPrecinctsTable th,#volunteerProgressTable th,#lowestProgressTurfsTable th{font-size:.86rem;line-height:1.12;}

/* Standalone print window map: keep full-page basemap visible. */
@media print{.print-map-wrap .leaflet-container{height:100%!important;width:100%!important;} .print-page{page-break-after:always!important;}}


/* Build 80: demo stabilizing fixes */
/* Widget controls always right and minimize only collapses card content. */
.dashboard-widget-header { display:flex !important; align-items:center !important; gap:.5rem !important; }
.dashboard-widget-header .widget-label, .card-header .widget-label { flex:1 1 auto !important; min-width:0 !important; }
.dashboard-widget-tools { margin-left:auto !important; flex:0 0 auto !important; }
.dashboard-widget-card.widget-collapsed,
.dashboard-widget.widget-collapsed,
.dashboard-widget.widget-collapsed-shell { display:block !important; visibility:visible !important; opacity:1 !important; height:auto !important; min-height:0 !important; }
.dashboard-widget-card.widget-collapsed > .card-header,
.dashboard-widget-card.widget-collapsed > .dashboard-widget-header { display:flex !important; visibility:visible !important; opacity:1 !important; }
.dashboard-widget-card.widget-collapsed > .card-body,
.dashboard-widget-card.widget-collapsed > .table-responsive,
.dashboard-widget-card.widget-collapsed > .list-group,
.dashboard-widget-card.widget-collapsed > .card-footer { display:none !important; }
.widget-hidden { display:none !important; }
/* If a dragged widget ends up as the only visible widget on a row, it should use the full row. */
.row > .dashboard-widget.col-12 > .card { width:100%; }
/* DataTables sorting arrows: reserve right padding so arrows stop overlaying headers. */
table.dataTable thead > tr > th { padding-right:1.25rem !important; vertical-align:bottom !important; }
table.dataTable thead .sorting:before,
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:before,
table.dataTable thead .sorting_desc:after { right:.25rem !important; top:50% !important; transform:translateY(-50%); }
/* Volunteers: make field stats readable, aligned, and not double height. */
#volunteerStatsTable { table-layout:auto !important; font-size:.84rem !important; }
#volunteerStatsTable thead th { font-size:.72rem !important; line-height:1.06 !important; padding:.25rem 1.1rem .25rem .35rem !important; white-space:normal !important; vertical-align:bottom !important; }
#volunteerStatsTable tbody td { font-size:.84rem !important; line-height:1.08 !important; padding:.25rem .4rem !important; white-space:nowrap !important; vertical-align:middle !important; }
#volunteerStatsTable tbody tr { height:auto !important; }
#volunteerStatsTable th:nth-child(1), #volunteerStatsTable td:nth-child(1) { min-width:115px !important; }
#volunteerStatsTable th:nth-child(8), #volunteerStatsTable td:nth-child(8) { min-width:90px !important; }
#volunteerStatsTable th:nth-child(10), #volunteerStatsTable td:nth-child(10) { min-width:105px !important; }
/* Volunteer contacts: wider status, shorter phone, save disabled until dirty. */
#volunteerContactsTable th:nth-child(2), #volunteerContactsTable td:nth-child(2) { min-width:120px !important; }
#volunteerContactsTable th:nth-child(5), #volunteerContactsTable td:nth-child(5) { width:150px !important; max-width:150px !important; }
#volunteerContactsTable .vc-phone, #volunteerContactsTable input[name="phone"] { max-width:145px !important; }
#volunteerContactsTable .contact-save-btn:disabled, #volunteerContactsTable button:disabled { opacity:.35; cursor:not-allowed; }
/* Admin users: save button must be visually available when dirty; compact permission grid. */
.permission-grid .permission-tile { flex:0 0 25% !important; width:25% !important; max-width:25% !important; }
.permission-grid .permission-tile > .border { border:0 !important; background:transparent !important; padding:0 !important; }
.permission-grid .fw-semibold { font-size:.88rem !important; }
.user-save-btn:disabled { opacity:.35 !important; cursor:not-allowed !important; }
/* Visits/Turfs section title fixes and table spacing. */
#visitsTable td:nth-child(1), #visitsTable th:nth-child(1),
#visitsTable td:nth-child(7), #visitsTable th:nth-child(7) { white-space:nowrap !important; min-width:150px; }
#turfsTable thead th { font-size:.78rem; line-height:1.05; padding-right:1.25rem !important; }
#turfsTable th:first-child, #turfsTable td:first-child { min-width:160px; white-space:nowrap; }
/* Donations / pledges */
#pledgeQueueTable th, #pledgeQueueTable td, #allDonationsTable th, #allDonationsTable td { white-space:nowrap !important; font-size:.8rem !important; }
#pledgeQueueTable td:first-child, #allDonationsTable td:nth-child(2) { min-width:170px; }
/* Print window generated from map screenshot. */
.print-map-image { width:100%; height:100%; object-fit:cover; display:block; }


/* Build 81: dashboard visual-row full-width widgets + Turf Health sort arrow cleanup */
body[data-page-key="dashboard"] .row > .dashboard-widget.widget-full-row,
body.dashboard-page .row > .dashboard-widget.widget-full-row {
  flex: 0 0 100% !important;
  max-width: 100% !important;
  width: 100% !important;
}
body[data-page-key="dashboard"] .dashboard-widget.widget-full-row > .card,
body.dashboard-page .dashboard-widget.widget-full-row > .card {
  width: 100% !important;
}

/* Turf Health Score: reserve room for sort arrows and keep them beside labels, not floating above. */
#turfHealthTable {
  table-layout: auto !important;
}
#turfHealthTable thead th {
  position: relative !important;
  vertical-align: middle !important;
  line-height: 1.08 !important;
  padding-top: .45rem !important;
  padding-bottom: .45rem !important;
  padding-right: 1.55rem !important;
  white-space: nowrap !important;
}
#turfHealthTable thead th:nth-child(2),
#turfHealthTable tbody td:nth-child(2) {
  min-width: 190px !important;
  white-space: nowrap !important;
}
#turfHealthTable thead th:nth-child(3),
#turfHealthTable tbody td:nth-child(3) {
  min-width: 135px !important;
  white-space: nowrap !important;
}
#turfHealthTable thead th:nth-child(5),
#turfHealthTable thead th:nth-child(7),
#turfHealthTable thead th:nth-child(10) {
  min-width: 120px !important;
}
#turfHealthTable.dataTable thead > tr > th.sorting:before,
#turfHealthTable.dataTable thead > tr > th.sorting_asc:before,
#turfHealthTable.dataTable thead > tr > th.sorting_desc:before,
#turfHealthTable.dataTable thead > tr > th.sorting:after,
#turfHealthTable.dataTable thead > tr > th.sorting_asc:after,
#turfHealthTable.dataTable thead > tr > th.sorting_desc:after {
  right: .45rem !important;
  left: auto !important;
  bottom: auto !important;
  line-height: 1 !important;
}
#turfHealthTable.dataTable thead > tr > th.sorting:before,
#turfHealthTable.dataTable thead > tr > th.sorting_asc:before,
#turfHealthTable.dataTable thead > tr > th.sorting_desc:before {
  top: calc(50% - .32rem) !important;
}
#turfHealthTable.dataTable thead > tr > th.sorting:after,
#turfHealthTable.dataTable thead > tr > th.sorting_asc:after,
#turfHealthTable.dataTable thead > tr > th.sorting_desc:after {
  top: calc(50% + .32rem) !important;
}


/* Build 82: global DataTables header/sort-arrow alignment + adaptive widget row widths */
/* Make all DataTables sort arrows live horizontally beside the header text, not floating above. */
table.dataTable thead > tr > th.sorting,
table.dataTable thead > tr > th.sorting_asc,
table.dataTable thead > tr > th.sorting_desc,
table.dataTable thead > tr > td.sorting,
table.dataTable thead > tr > td.sorting_asc,
table.dataTable thead > tr > td.sorting_desc {
  position: relative !important;
  vertical-align: middle !important;
  padding-right: 1.85rem !important;
  line-height: 1.15 !important;
}
table.dataTable thead > tr > th.sorting::before,
table.dataTable thead > tr > th.sorting_asc::before,
table.dataTable thead > tr > th.sorting_desc::before,
table.dataTable thead > tr > td.sorting::before,
table.dataTable thead > tr > td.sorting_asc::before,
table.dataTable thead > tr > td.sorting_desc::before,
table.dataTable thead > tr > th.sorting::after,
table.dataTable thead > tr > th.sorting_asc::after,
table.dataTable thead > tr > th.sorting_desc::after,
table.dataTable thead > tr > td.sorting::after,
table.dataTable thead > tr > td.sorting_asc::after,
table.dataTable thead > tr > td.sorting_desc::after {
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  line-height: 1 !important;
  font-size: .72rem !important;
}
table.dataTable thead > tr > th.sorting::before,
table.dataTable thead > tr > th.sorting_asc::before,
table.dataTable thead > tr > th.sorting_desc::before,
table.dataTable thead > tr > td.sorting::before,
table.dataTable thead > tr > td.sorting_asc::before,
table.dataTable thead > tr > td.sorting_desc::before {
  right: .95rem !important;
  left: auto !important;
}
table.dataTable thead > tr > th.sorting::after,
table.dataTable thead > tr > th.sorting_asc::after,
table.dataTable thead > tr > th.sorting_desc::after,
table.dataTable thead > tr > td.sorting::after,
table.dataTable thead > tr > td.sorting_asc::after,
table.dataTable thead > tr > td.sorting_desc::after {
  right: .45rem !important;
  left: auto !important;
}
/* Dashboard widgets should resize based on how many are on their visual row. */
body[data-page-key="dashboard"] .row > .dashboard-widget.widget-row-1,
body.dashboard-page .row > .dashboard-widget.widget-row-1 { flex:0 0 100% !important; max-width:100% !important; width:100% !important; }
body[data-page-key="dashboard"] .row > .dashboard-widget.widget-row-2,
body.dashboard-page .row > .dashboard-widget.widget-row-2 { flex:0 0 50% !important; max-width:50% !important; width:50% !important; }
body[data-page-key="dashboard"] .row > .dashboard-widget.widget-row-3,
body.dashboard-page .row > .dashboard-widget.widget-row-3 { flex:0 0 33.333333% !important; max-width:33.333333% !important; width:33.333333% !important; }
body[data-page-key="dashboard"] .row > .dashboard-widget.widget-row-4,
body.dashboard-page .row > .dashboard-widget.widget-row-4 { flex:0 0 25% !important; max-width:25% !important; width:25% !important; }
@media (max-width: 991.98px) {
  body[data-page-key="dashboard"] .row > .dashboard-widget.widget-row-2,
  body[data-page-key="dashboard"] .row > .dashboard-widget.widget-row-3,
  body[data-page-key="dashboard"] .row > .dashboard-widget.widget-row-4,
  body.dashboard-page .row > .dashboard-widget.widget-row-2,
  body.dashboard-page .row > .dashboard-widget.widget-row-3,
  body.dashboard-page .row > .dashboard-widget.widget-row-4 { flex:0 0 100% !important; max-width:100% !important; width:100% !important; }
}


/* Build 83: Audit page targeted fixes only. */
/* Audit summary cards are mini metric cards again, not movable/hidden widgets. */
#auditSummary .dashboard-widget-tools,
#auditSummary .dashboard-widget-header { display: none !important; }
#auditSummary .card { border-radius: .75rem; }

/* Apply the same visual-row resizing behavior to the Audit page widgets. */
body[data-page-key="audit"] .row > .dashboard-widget.widget-row-1,
body.audit-page .row > .dashboard-widget.widget-row-1 { flex:0 0 100% !important; max-width:100% !important; width:100% !important; }
body[data-page-key="audit"] .row > .dashboard-widget.widget-row-2,
body.audit-page .row > .dashboard-widget.widget-row-2 { flex:0 0 50% !important; max-width:50% !important; width:50% !important; }
body[data-page-key="audit"] .row > .dashboard-widget.widget-row-3,
body.audit-page .row > .dashboard-widget.widget-row-3 { flex:0 0 33.333333% !important; max-width:33.333333% !important; width:33.333333% !important; }
body[data-page-key="audit"] .row > .dashboard-widget.widget-row-4,
body.audit-page .row > .dashboard-widget.widget-row-4 { flex:0 0 25% !important; max-width:25% !important; width:25% !important; }
@media (max-width: 991.98px) {
  body[data-page-key="audit"] .row > .dashboard-widget.widget-row-2,
  body[data-page-key="audit"] .row > .dashboard-widget.widget-row-3,
  body[data-page-key="audit"] .row > .dashboard-widget.widget-row-4,
  body.audit-page .row > .dashboard-widget.widget-row-2,
  body.audit-page .row > .dashboard-widget.widget-row-3,
  body.audit-page .row > .dashboard-widget.widget-row-4 { flex:0 0 100% !important; max-width:100% !important; width:100% !important; }
}

/* Global DataTables sort arrow alignment: keep arrows on the same visual line as the header text. */
table.dataTable thead > tr > th,
table.dataTable thead > tr > td {
  position: relative !important;
  vertical-align: middle !important;
  padding-right: 1.75rem !important;
  padding-top: .45rem !important;
  padding-bottom: .45rem !important;
  line-height: 1.15 !important;
}
table.dataTable thead > tr > th.sorting::before,
table.dataTable thead > tr > th.sorting_asc::before,
table.dataTable thead > tr > th.sorting_desc::before,
table.dataTable thead > tr > td.sorting::before,
table.dataTable thead > tr > td.sorting_asc::before,
table.dataTable thead > tr > td.sorting_desc::before,
table.dataTable thead > tr > th.sorting::after,
table.dataTable thead > tr > th.sorting_asc::after,
table.dataTable thead > tr > th.sorting_desc::after,
table.dataTable thead > tr > td.sorting::after,
table.dataTable thead > tr > td.sorting_asc::after,
table.dataTable thead > tr > td.sorting_desc::after {
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  line-height: 1 !important;
  font-size: .70rem !important;
  opacity: .55;
}
table.dataTable thead > tr > th.sorting::before,
table.dataTable thead > tr > th.sorting_asc::before,
table.dataTable thead > tr > th.sorting_desc::before,
table.dataTable thead > tr > td.sorting::before,
table.dataTable thead > tr > td.sorting_asc::before,
table.dataTable thead > tr > td.sorting_desc::before { right: .95rem !important; }
table.dataTable thead > tr > th.sorting::after,
table.dataTable thead > tr > th.sorting_asc::after,
table.dataTable thead > tr > th.sorting_desc::after,
table.dataTable thead > tr > td.sorting::after,
table.dataTable thead > tr > td.sorting_asc::after,
table.dataTable thead > tr > td.sorting_desc::after { right: .45rem !important; }


/* Build 84: one sortable board per page so widgets can move up/down, not just sideways. */
.dashboard-widget-board { align-items: stretch; }
.dashboard-widget-board > .dashboard-widget { transition: width .12s ease, flex-basis .12s ease; }
.dashboard-widget-board-dragging > .dashboard-widget { transition: none; }
.widget-drag-ghost { opacity:.55; outline:2px dashed #0d6efd; background:#eef5ff; }

/* Build 86: keep donation dates on one line and keep package slim. */
#allDonationsTable th:nth-child(1),
#allDonationsTable td:nth-child(1) {
  white-space: nowrap !important;
  min-width: 96px;
  width: 96px;
}

#allDonationsTable th,
#allDonationsTable td {
  vertical-align: middle;
}

/* v87: Issues filters should stay as the fixed top section, not a movable widget. */
.issue-filters-card .dashboard-widget-tools { display:none !important; }
.issue-filters-card { order:-9999; }

/* Build 88: volunteer widget header and field stats column/header alignment. */
.volunteers-page .card-header > div:first-child h2,
body[data-page-key="volunteers"] .card-header > div:first-child h2 {
  display: block;
  margin-bottom: .1rem;
}
.volunteers-page .card-header > div:first-child .text-muted,
body[data-page-key="volunteers"] .card-header > div:first-child .text-muted {
  display: block;
  font-size: .78rem;
  line-height: 1.15;
}
.volunteers-page .dashboard-widget-header,
body[data-page-key="volunteers"] .dashboard-widget-header {
  gap: .75rem;
}
.volunteers-page .dashboard-widget-header .dashboard-widget-tools,
body[data-page-key="volunteers"] .dashboard-widget-header .dashboard-widget-tools {
  margin-left: auto !important;
  flex: 0 0 auto;
}

/* Keep Volunteer Field Stats headers lined up with the body columns. */
#volunteerStatsTable,
#volunteerStatsTable_wrapper table.dataTable {
  table-layout: fixed !important;
}
#volunteerStatsTable th,
#volunteerStatsTable td {
  white-space: nowrap !important;
  vertical-align: middle !important;
  font-size: .86rem;
}
#volunteerStatsTable thead th {
  font-size: .78rem;
  line-height: 1.08 !important;
  padding: .35rem 1.55rem .35rem .35rem !important;
  text-align: right;
}
#volunteerStatsTable thead th:first-child,
#volunteerStatsTable tbody td:first-child {
  text-align: left !important;
}
#volunteerStatsTable tbody td {
  padding-top: .28rem !important;
  padding-bottom: .28rem !important;
}
#volunteerStatsTable_wrapper .dt-scroll-head table,
#volunteerStatsTable_wrapper .dt-scroll-body table,
#volunteerStatsTable_wrapper .dataTables_scrollHead table,
#volunteerStatsTable_wrapper .dataTables_scrollBody table {
  margin: 0 !important;
}
#volunteerStatsTable_wrapper .dt-scroll-head,
#volunteerStatsTable_wrapper .dataTables_scrollHead {
  overflow: hidden !important;
}


/* Build 90: default widget widths, manual width controls, and easier vertical dragging. */
.dashboard-widget-board { row-gap: 1.15rem !important; align-items: stretch; }
.dashboard-widget-board-dragging { padding-top: .35rem; padding-bottom: .35rem; }
.dashboard-widget { margin-bottom: .25rem; transition: flex-basis .18s ease, max-width .18s ease; }
.dashboard-widget-tools .widget-size-down-btn,
.dashboard-widget-tools .widget-size-up-btn { display:inline-flex; align-items:center; justify-content:center; }
.row > .dashboard-widget.widget-size-full { flex:0 0 100% !important; max-width:100% !important; width:100% !important; }
.row > .dashboard-widget.widget-size-two-thirds { flex:0 0 66.666667% !important; max-width:66.666667% !important; width:66.666667% !important; }
.row > .dashboard-widget.widget-size-half { flex:0 0 50% !important; max-width:50% !important; width:50% !important; }
.row > .dashboard-widget.widget-size-third { flex:0 0 33.333333% !important; max-width:33.333333% !important; width:33.333333% !important; }
.row > .dashboard-widget.widget-size-quarter { flex:0 0 25% !important; max-width:25% !important; width:25% !important; }
@media (max-width: 991.98px) {
  .row > .dashboard-widget.widget-size-two-thirds,
  .row > .dashboard-widget.widget-size-half,
  .row > .dashboard-widget.widget-size-third,
  .row > .dashboard-widget.widget-size-quarter { flex:0 0 100% !important; max-width:100% !important; width:100% !important; }
}

/* Build 91: audit sample widget sizing + volunteer multiline table headers */
.volunteer-stats-table thead th,
.volunteer-status-table thead th {
  white-space: normal !important;
  line-height: 1.12 !important;
  vertical-align: bottom !important;
  min-width: 82px;
}
.volunteer-stats-table thead th:first-child,
.volunteer-status-table thead th:first-child { min-width: 145px; }
.volunteer-stats-table thead th .dt-column-title,
.volunteer-status-table thead th .dt-column-title,
.volunteer-stats-table thead th > span,
.volunteer-status-table thead th > span {
  display: inline-block;
  max-width: 92px;
  white-space: normal !important;
  overflow-wrap: normal;
  word-break: normal;
}
.volunteer-stats-table thead th:first-child .dt-column-title,
.volunteer-status-table thead th:first-child .dt-column-title,
.volunteer-stats-table thead th:first-child > span,
.volunteer-status-table thead th:first-child > span { max-width: 140px; }
.volunteer-stats-table thead th .dt-column-order,
.volunteer-status-table thead th .dt-column-order { top: 50% !important; transform: translateY(-50%) !important; }

/* Build 91: print capture map should have same map marker CSS even when offscreen. */
.turf-print-capture-holder .leaflet-container { background:#eef2f7; }

/* Build 92: Volunteer status placement + frozen first column for horizontal scroll tables. */
#volunteerStatsTable_wrapper .dt-scroll-body,
#volunteerStatusTable_wrapper .dt-scroll-body,
#volunteerStatsTable_wrapper .dataTables_scrollBody,
#volunteerStatusTable_wrapper .dataTables_scrollBody {
  position: relative;
}

#volunteerStatsTable thead th:first-child,
#volunteerStatsTable tbody td:first-child,
#volunteerStatusTable thead th:first-child,
#volunteerStatusTable tbody td:first-child {
  position: sticky !important;
  left: 0;
  z-index: 4;
  background: #fff !important;
  box-shadow: 2px 0 4px rgba(15, 23, 42, .08);
  min-width: 150px !important;
  max-width: 190px;
}

#volunteerStatsTable tbody tr:nth-child(odd) td:first-child,
#volunteerStatusTable tbody tr:nth-child(odd) td:first-child {
  background: #f2f2f2 !important;
}
#volunteerStatsTable tbody tr:nth-child(even) td:first-child,
#volunteerStatusTable tbody tr:nth-child(even) td:first-child {
  background: #fff !important;
}

#volunteerStatsTable thead th:first-child,
#volunteerStatusTable thead th:first-child {
  z-index: 7;
  background: #fff !important;
}

/* Keep the frozen volunteer name readable and compact. */
#volunteerStatsTable td:first-child .btn-link,
#volunteerStatusTable td:first-child .btn-link {
  white-space: nowrap;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* Build 94: widget drag/drop row reflow. */
.dashboard-widget-board-reflow {
  row-gap: 1.25rem !important;
  align-items: stretch !important;
}
.dashboard-widget-board-reflow.dashboard-widget-board-dragging {
  row-gap: 1.75rem !important;
  padding-bottom: 1.25rem;
}
.dashboard-widget-board-reflow .dashboard-widget {
  transition: flex-basis .16s ease, max-width .16s ease, width .16s ease;
}
.dashboard-widget-board-reflow .sortable-ghost,
.dashboard-widget-board-reflow .widget-drag-ghost {
  min-height: 4rem !important;
  border: 2px dashed #60a5fa !important;
  background: rgba(96,165,250,.12) !important;
  border-radius: .75rem !important;
}
/* Row width classes should work on every widgetized page, not only dashboard/audit. */
.dashboard-widget-board > .dashboard-widget.widget-row-1 { flex:0 0 100% !important; max-width:100% !important; width:100% !important; }
.dashboard-widget-board > .dashboard-widget.widget-row-2 { flex:0 0 50% !important; max-width:50% !important; width:50% !important; }
.dashboard-widget-board > .dashboard-widget.widget-row-3 { flex:0 0 33.333333% !important; max-width:33.333333% !important; width:33.333333% !important; }
.dashboard-widget-board > .dashboard-widget.widget-row-4 { flex:0 0 25% !important; max-width:25% !important; width:25% !important; }
@media (max-width: 991.98px) {
  .dashboard-widget-board > .dashboard-widget.widget-row-2,
  .dashboard-widget-board > .dashboard-widget.widget-row-3,
  .dashboard-widget-board > .dashboard-widget.widget-row-4 { flex:0 0 100% !important; max-width:100% !important; width:100% !important; }
}


/* v95: compact two-line overview mini cards. */
#overviewCards .metric-card-dual .card-body { padding-top: .9rem; padding-bottom: .9rem; }
#overviewCards .metric-dual-lines { font-weight: 800; line-height: 1.15; color: #17212f; }
#overviewCards .metric-dual-lines > div { white-space: nowrap; }
#overviewCards .metric-dual-value { font-size: 1.25rem; letter-spacing: -.02em; }
#overviewCards .metric-dual-label { font-size: .78rem; font-weight: 650; color: #5d6b7a; }
#overviewCards .metric-card-dual .metric-label { margin-bottom: .28rem; }

/* v97: compact overview mini-card lines with clearer priority/total counts. */
#overviewCards .metric-card-multi .card-body { padding-top: .82rem; padding-bottom: .82rem; }
#overviewCards .metric-multi-lines { line-height: 1.12; }
#overviewCards .metric-multi-row { white-space: nowrap; margin-top: .06rem; }
#overviewCards .metric-multi-value { font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; color: #17212f; }
#overviewCards .metric-multi-label { font-size: .70rem; font-weight: 650; color: #5d6b7a; }
#overviewCards .metric-multi-detail { font-size: .64rem; font-weight: 600; color: #6c757d; }
@media (max-width: 1400px) {
  #overviewCards .metric-multi-value { font-size: .98rem; }
  #overviewCards .metric-multi-label { font-size: .66rem; }
  #overviewCards .metric-multi-detail { font-size: .60rem; }
}

/* Build 98: widget stability */
.dashboard-widget-board { row-gap: 1.35rem !important; align-items: stretch; }
.dashboard-widget-board .dashboard-widget { transition: width .12s ease, flex-basis .12s ease; }
.dashboard-widget-board .dashboard-widget.widget-row-1 { flex: 0 0 100%; max-width: 100%; }
.dashboard-widget-board .dashboard-widget.widget-row-2 { flex: 0 0 50%; max-width: 50%; }
.dashboard-widget-board .dashboard-widget.widget-row-3 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.dashboard-widget-board .dashboard-widget.widget-row-4 { flex: 0 0 25%; max-width: 25%; }
.dashboard-widget-board-reflow { padding-top: .25rem; padding-bottom: .25rem; }
.dashboard-widget-board-reflow .sortable-ghost { min-height: 96px; border: 2px dashed #0d6efd; border-radius: 12px; background: rgba(13,110,253,.06); }
#overviewCards > div { cursor: grab; }
#overviewCards > div:active { cursor: grabbing; }
.turf-print-capture-holder-v98 .leaflet-container { background: #eef2f7; }
@media (max-width: 1199.98px) {
  .dashboard-widget-board .dashboard-widget.widget-row-4,
  .dashboard-widget-board .dashboard-widget.widget-row-3 { flex-basis: 50%; max-width: 50%; }
}
@media (max-width: 767.98px) {
  .dashboard-widget-board .dashboard-widget.widget-row-4,
  .dashboard-widget-board .dashboard-widget.widget-row-3,
  .dashboard-widget-board .dashboard-widget.widget-row-2 { flex-basis: 100%; max-width: 100%; }
}

/* Build 99: overview mini cards are draggable within their top section and explain themselves on hover. */
#overviewCards .overview-mini-card { cursor: grab; }
#overviewCards .overview-mini-card:active { cursor: grabbing; }
#overviewCards .metric-card[title] { cursor: help; }


/* Build 101: overview mini-card native drag/drop reorder. */
#overviewCards .overview-mini-card { cursor: grab; user-select: none; }
#overviewCards .overview-mini-card:active { cursor: grabbing; }
#overviewCards .overview-mini-card .metric-card { pointer-events: none; }
#overviewCards .overview-mini-card.mini-card-dragging { opacity: .45; transform: scale(.985); }
#overviewCards.mini-card-drag-over { outline: 2px dashed rgba(13,110,253,.25); outline-offset: 6px; border-radius: .75rem; }

/* Build 102: predictable swap-style overview mini-card dragging and slightly taller multi-line cards. */
#overviewCards .metric-card { min-height: 8.15rem; }
#overviewCards .metric-card-multi,
#overviewCards .metric-card-dual { min-height: 8.65rem; }
#overviewCards .overview-mini-card.mini-card-swap-target .metric-card {
  outline: 3px solid rgba(13, 110, 253, .35);
  outline-offset: 3px;
}
#overviewCards .overview-mini-card.mini-card-dragging { opacity: .38; }

/* Build 103: compact overview mini cards - reduce bottom whitespace while preserving multi-line readability. */
#overviewCards .metric-card {
  min-height: 7.25rem !important;
}
#overviewCards .metric-card-multi,
#overviewCards .metric-card-dual {
  min-height: 7.55rem !important;
}
#overviewCards .metric-card .card-body {
  padding-top: .78rem !important;
  padding-bottom: .62rem !important;
}
#overviewCards .metric-label {
  margin-bottom: .24rem !important;
  line-height: 1.05 !important;
}
#overviewCards .metric-value {
  line-height: 1.02 !important;
  margin-bottom: .15rem !important;
}
#overviewCards .metric-subtitle {
  margin-top: .10rem !important;
  line-height: 1.05 !important;
}
#overviewCards .metric-card-multi .card-body,
#overviewCards .metric-card-dual .card-body {
  padding-top: .70rem !important;
  padding-bottom: .52rem !important;
}
#overviewCards .metric-multi-lines,
#overviewCards .metric-dual-lines {
  line-height: 1.06 !important;
}
#overviewCards .metric-multi-row {
  margin-top: .02rem !important;
}
@media (max-width: 1400px) {
  #overviewCards .metric-card { min-height: 7.15rem !important; }
  #overviewCards .metric-card-multi,
  #overviewCards .metric-card-dual { min-height: 7.45rem !important; }
}

/* Build 104: shorter overview mini cards with tighter vertical spacing.
   Keep the information-heavy cards readable without the large blank bottom area. */
#overviewCards {
  row-gap: .9rem !important;
}
#overviewCards .overview-mini-card {
  display: flex;
}
#overviewCards .metric-card {
  width: 100%;
  min-height: 5.85rem !important;
  max-height: 6.35rem;
}
#overviewCards .metric-card-multi,
#overviewCards .metric-card-dual {
  min-height: 6.15rem !important;
  max-height: 6.65rem;
}
#overviewCards .metric-card .card-body {
  padding: .72rem 1.02rem .54rem 1.02rem !important;
  overflow: hidden;
}
#overviewCards .metric-label {
  font-size: .78rem !important;
  letter-spacing: .055em !important;
  line-height: 1.05 !important;
  margin-bottom: .28rem !important;
}
#overviewCards .metric-value {
  font-size: 1.58rem !important;
  line-height: .98 !important;
  margin-bottom: .12rem !important;
}
#overviewCards .metric-subtitle {
  font-size: .80rem !important;
  line-height: 1.04 !important;
  margin-top: .08rem !important;
}
#overviewCards .metric-dual-lines,
#overviewCards .metric-multi-lines {
  line-height: 1.12 !important;
}
#overviewCards .metric-dual-lines > div,
#overviewCards .metric-multi-row {
  margin-top: .03rem !important;
}
#overviewCards .metric-dual-value,
#overviewCards .metric-multi-value {
  font-size: 1.22rem !important;
  line-height: 1 !important;
}
#overviewCards .metric-dual-label,
#overviewCards .metric-multi-label {
  font-size: .72rem !important;
}
#overviewCards .metric-multi-detail {
  font-size: .61rem !important;
}
/* Give the complex priority/visited/universe-style cards a little more readable spacing without increasing overall height much. */
#overviewCards .metric-card-dual .card-body,
#overviewCards .metric-card-multi .card-body {
  padding-top: .76rem !important;
  padding-bottom: .50rem !important;
}
@media (max-width: 1400px) {
  #overviewCards .metric-card { min-height: 5.75rem !important; }
  #overviewCards .metric-card-multi,
  #overviewCards .metric-card-dual { min-height: 6.05rem !important; }
  #overviewCards .metric-value { font-size: 1.45rem !important; }
  #overviewCards .metric-dual-value,
  #overviewCards .metric-multi-value { font-size: 1.10rem !important; }
  #overviewCards .metric-multi-detail { font-size: .56rem !important; }
}

/* Build 106: tighten overview mini cards to remove bottom whitespace.
   The data-heavy cards get larger numbers and more line separation without making
   the entire card tall. */
#overviewCards {
  row-gap: .55rem !important;
  align-items: flex-start !important;
}
#overviewCards .overview-mini-card {
  align-items: flex-start !important;
}
#overviewCards .metric-card {
  min-height: 4.85rem !important;
  height: 4.85rem !important;
  max-height: 4.85rem !important;
  width: 100%;
}
#overviewCards .metric-card-dual,
#overviewCards .metric-card-multi {
  min-height: 4.95rem !important;
  height: 4.95rem !important;
  max-height: 4.95rem !important;
}
#overviewCards .metric-card .card-body {
  padding: .48rem .92rem .38rem .92rem !important;
  overflow: hidden !important;
}
#overviewCards .metric-label {
  font-size: .76rem !important;
  line-height: 1 !important;
  letter-spacing: .045em !important;
  margin-bottom: .26rem !important;
}
#overviewCards .metric-value {
  font-size: 1.65rem !important;
  line-height: .95 !important;
  margin-bottom: .12rem !important;
}
#overviewCards .metric-subtitle {
  font-size: .78rem !important;
  line-height: 1.02 !important;
  margin-top: .04rem !important;
}
/* Two-line cards: bigger values and a real gap between the two data rows. */
#overviewCards .metric-dual-lines,
#overviewCards .metric-multi-lines {
  line-height: 1.03 !important;
}
#overviewCards .metric-dual-lines > div,
#overviewCards .metric-multi-row {
  margin-top: .13rem !important;
}
#overviewCards .metric-dual-lines > div:first-child,
#overviewCards .metric-multi-row:first-child {
  margin-top: 0 !important;
}
#overviewCards .metric-dual-value,
#overviewCards .metric-multi-value {
  font-size: 1.38rem !important;
  line-height: .96 !important;
  font-weight: 850 !important;
  letter-spacing: -.025em !important;
}
#overviewCards .metric-dual-label,
#overviewCards .metric-multi-label {
  font-size: .78rem !important;
  font-weight: 700 !important;
}
#overviewCards .metric-multi-detail {
  font-size: .58rem !important;
  font-weight: 650 !important;
}
#overviewCards .metric-card-dual .card-body,
#overviewCards .metric-card-multi .card-body {
  padding-top: .46rem !important;
  padding-bottom: .34rem !important;
}
@media (max-width: 1400px) {
  #overviewCards .metric-card {
    min-height: 4.8rem !important;
    height: 4.8rem !important;
    max-height: 4.8rem !important;
  }
  #overviewCards .metric-card-dual,
  #overviewCards .metric-card-multi {
    min-height: 4.9rem !important;
    height: 4.9rem !important;
    max-height: 4.9rem !important;
  }
  #overviewCards .metric-value { font-size: 1.55rem !important; }
  #overviewCards .metric-dual-value,
  #overviewCards .metric-multi-value { font-size: 1.28rem !important; }
  #overviewCards .metric-dual-label,
  #overviewCards .metric-multi-label { font-size: .72rem !important; }
  #overviewCards .metric-multi-detail { font-size: .52rem !important; }
}

/* Build 107: Voter Lookup targeting override action layout */
.targeting-action-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
}
.targeting-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}
.targeting-action-row .btn {
  min-width: 9.25rem;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .targeting-action-row .btn {
    min-width: 100%;
  }
}


/* Build 108: slightly more breathing room between HH and voter lines in overview mini cards. */
#overviewCards .metric-dual-lines > div,
#overviewCards .metric-multi-row {
  margin-top: .23rem !important;
}
#overviewCards .metric-dual-lines > div:first-child,
#overviewCards .metric-multi-row:first-child {
  margin-top: 0 !important;
}

/* Build 113: reported party observation badges/modals */
.reported-party-block .btn,
.targeting-override-block .btn { margin-bottom: .15rem; }
.btn-xs { font-size: .72rem; line-height: 1.1; }
.voter-chip.chip-party-dem { background:#dbeafe; color:#1e40af; border:1px solid #93c5fd; font-weight:800; }
.voter-chip.chip-party-rep { background:#fee2e2; color:#991b1b; border:1px solid #fecaca; font-weight:800; }
.voter-chip.chip-party-other { background:#f3e8ff; color:#6b21a8; border:1px solid #d8b4fe; font-weight:700; }
.walk-list-table th:nth-child(4), .walk-list-table td:nth-child(4) { white-space: nowrap; }

/* Build 114: seven-point reported party color ramp.
   1 dark blue -> 4 neutral white -> 7 deep red. */
.voter-chip.chip-party-1 { background:#1d4ed8; color:#ffffff; border:1px solid #1e40af; font-weight:900; }
.voter-chip.chip-party-2 { background:#bfdbfe; color:#1e3a8a; border:1px solid #60a5fa; font-weight:850; }
.voter-chip.chip-party-3 { background:#eff6ff; color:#1d4ed8; border:1px solid #bfdbfe; font-weight:800; }
.voter-chip.chip-party-4 { background:#ffffff; color:#374151; border:1px solid #d1d5db; font-weight:750; }
.voter-chip.chip-party-5 { background:#fee2e2; color:#991b1b; border:1px solid #fecaca; font-weight:800; }
.voter-chip.chip-party-6 { background:#dc2626; color:#ffffff; border:1px solid #b91c1c; font-weight:850; }
.voter-chip.chip-party-7 { background:#7f1d1d; color:#ffffff; border:1px solid #450a0a; font-weight:900; }
.household-voter-link { font-weight:700; text-decoration:none; }
.household-voter-link:hover { text-decoration:underline; }

/* Build 121: restore overview mini-card tooltips and add Quick Stats picker. */
#overviewCards .overview-mini-card .metric-card {
  pointer-events: auto !important;
}
#overviewCards .overview-mini-card {
  cursor: grab;
}
#overviewCards .overview-mini-card .metric-card[title],
#overviewCards .overview-mini-card .metric-card[data-bs-toggle="tooltip"] {
  cursor: help;
}
.quick-stat-option {
  cursor: pointer;
  background: #fff;
  transition: background-color .15s ease, border-color .15s ease;
}
.quick-stat-option:hover {
  background: #f8fafc;
  border-color: #93c5fd !important;
}
.quick-stat-option .form-check-input {
  margin-left: 0;
}

/* Build 122 voter-history tab pills */
.voting-history-tabs .nav-link { font-size: 0.78rem; padding: 0.2rem 0.45rem; }
.voting-history-pill-grid { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.vote-pill-voted { background: #e8f5ed; color: #11643a; border: 1px solid #93d3ad; }
.vote-pill-missed { background: #fdeaea; color: #a12828; border: 1px solid #efaaaa; }
.vote-history-tab-pane { max-height: 170px; overflow-y: auto; }

/* Build 124: Voting-history pill border semantics. Color still means voted/missed; border style means election type; weight means scope. */
.voter-chip.vote-pill-general { border-style: double !important; border-width: 3px !important; }
.voter-chip.vote-pill-primary { border-style: dashed !important; border-width: 2px !important; }
.voter-chip.vote-pill-pres-primary { border-style: dashed !important; border-width: 3px !important; }
.voter-chip.vote-pill-special { border-style: dotted !important; border-width: 2px !important; }
.voter-chip.vote-pill-scope-wide { font-weight: 900 !important; }
.voter-chip.vote-pill-scope-local { font-weight: 650 !important; }
.voting-history-legend .voter-chip { margin-bottom: .2rem; }

/* Build 132: make actual voter-history pills match the border legend and keep election-type text visually bold. */
.vote-history-block .voter-chip[class*="vote-pill-"] {
  font-weight: 800 !important;
  padding: .28rem .6rem;
}
.vote-history-block .voter-chip.vote-pill-general { border-style: double !important; border-width: 3px !important; }
.vote-history-block .voter-chip.vote-pill-primary { border-style: dashed !important; border-width: 2px !important; }
.vote-history-block .voter-chip.vote-pill-pres-primary { border-style: dashed !important; border-width: 3px !important; }
.vote-history-block .voter-chip.vote-pill-special { border-style: dotted !important; border-width: 2px !important; }
.voting-history-legend strong { font-weight: 900; }
