/**
 * SAMP v4.7.1 — Municipal portal visual system
 * Presentation-only layer inspired by compact Saudi municipal service portals.
 * No database, Supabase schema, field name, selector ID or workflow logic is changed.
 */

:root {
  --portal-green-950: #064b3f;
  --portal-green-900: #075c4b;
  --portal-green-800: #0a6d58;
  --portal-green-700: #0d7d65;
  --portal-green-600: #159277;
  --portal-green-100: #e9f5f1;
  --portal-green-50: #f3faf7;
  --portal-gold: #d99a2b;
  --portal-ink: #18343d;
  --portal-muted: #667982;
  --portal-line: #dbe5e8;
  --portal-line-soft: #e9eff1;
  --portal-page: #f3f6f7;
  --portal-surface: #ffffff;
  --portal-header-height: 124px;
  --portal-band-height: 74px;
  --portal-nav-height: 50px;
  --portal-page-gap: clamp(8px, .75vw, 14px);
  --portal-page-pad: clamp(10px, 1vw, 18px);
  --portal-radius: 7px;
  --portal-shadow: 0 3px 13px rgba(22, 61, 70, .07);
}

/* --------------------------------------------------------------------------
   Government portal shell
   -------------------------------------------------------------------------- */
body:not(.auth-locked) {
  min-height: 100dvh;
  background: var(--portal-page);
  color: var(--portal-ink);
  overflow-x: hidden;
}

body:not(.auth-locked) .sidebar {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  height: var(--portal-header-height);
  min-height: var(--portal-header-height);
  padding: 0;
  display: grid;
  grid-template-rows: var(--portal-band-height) var(--portal-nav-height);
  overflow: visible;
  background: var(--portal-surface);
  color: var(--portal-ink);
  border: 0;
  box-shadow: 0 2px 10px rgba(16, 56, 65, .11);
  z-index: 1000;
}

body:not(.auth-locked) .sidebar .brand {
  position: relative;
  grid-row: 1;
  width: 100%;
  height: var(--portal-band-height);
  margin: 0;
  padding: 0 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(100deg, var(--portal-green-900), var(--portal-green-700));
  background-size: 28px 28px, 28px 28px, auto;
  border: 0;
  color: #fff;
  overflow: hidden;
}

body:not(.auth-locked) .sidebar .brand::before {
  content: "SAMP";
  position: absolute;
  left: 22px;
  top: 50%;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 3px solid rgba(255,255,255,.88);
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font: 700 11px/1 "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
  letter-spacing: .5px;
  box-shadow: 0 4px 14px rgba(0,0,0,.11);
}

body:not(.auth-locked) .sidebar .brand-mark {
  position: absolute;
  right: 22px;
  top: 50%;
  width: 52px;
  height: 52px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  box-shadow: 0 4px 14px rgba(0,0,0,.11);
}

body:not(.auth-locked) .sidebar .brand > div {
  width: min(720px, calc(100% - 190px));
  text-align: center;
}

body:not(.auth-locked) .sidebar .brand strong {
  display: block;
  color: #fff;
  font-size: clamp(18px, 1.45vw, 25px);
  line-height: 1.25;
  font-weight: 700;
  white-space: normal;
}

body:not(.auth-locked) .sidebar .brand small {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.82);
  font-size: clamp(9px, .75vw, 11px);
  line-height: 1.35;
  font-weight: 500;
}

body:not(.auth-locked) .sidebar nav {
  grid-row: 2;
  width: 100%;
  height: var(--portal-nav-height);
  margin: 0;
  padding: 0 18px 0 305px;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  background: #fff;
  border-bottom: 1px solid var(--portal-line);
}

body:not(.auth-locked) .sidebar .nav {
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  min-height: var(--portal-nav-height);
  height: var(--portal-nav-height);
  margin: 0;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #43545c;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
  white-space: nowrap;
}

body:not(.auth-locked) .sidebar .nav:hover {
  background: var(--portal-green-50);
  color: var(--portal-green-800);
}

body:not(.auth-locked) .sidebar .nav.active {
  background: linear-gradient(180deg, #f5fbf8, #e9f5f1);
  color: var(--portal-green-900);
  border-bottom-color: var(--portal-green-700);
  box-shadow: none;
}

body:not(.auth-locked) .sidebar .side-account {
  position: absolute;
  left: 16px;
  bottom: 7px;
  width: 275px;
  min-height: 36px;
  margin: 0;
  padding: 4px 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #cfe1dc;
  border-radius: 999px;
  background: #f4faf8;
  color: var(--portal-green-900);
  box-shadow: none;
  z-index: 2;
}

body:not(.auth-locked) .sidebar .side-account span {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--portal-green-900);
  font-size: 10px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

body:not(.auth-locked) .sidebar .side-account button {
  flex: 0 0 auto;
  width: auto;
  min-height: 27px;
  padding: 4px 10px;
  border: 1px solid #c6dbd5;
  border-radius: 999px;
  background: #fff;
  color: var(--portal-green-900);
  font-size: 10px;
}

body:not(.auth-locked) main,
body:not(.auth-locked).command-center-active main,
html[dir="ltr"] body:not(.auth-locked) main,
html[dir="ltr"] body:not(.auth-locked).command-center-active main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100dvh;
  margin: 0 !important;
  padding-top: var(--portal-header-height);
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background: var(--portal-page);
}

body:not(.auth-locked) .topbar,
body:not(.auth-locked).command-center-active .topbar {
  position: relative;
  width: calc(100% - (var(--portal-page-pad) * 2));
  min-height: 48px;
  height: auto;
  margin: var(--portal-page-gap) var(--portal-page-pad) 0;
  padding: 8px 14px;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid var(--portal-line-soft);
  border-inline-end: 3px solid var(--portal-green-700);
  border-radius: var(--portal-radius);
  background: #fff;
  box-shadow: 0 2px 8px rgba(22, 61, 70, .045);
}

body:not(.auth-locked) .topbar h1 {
  margin: 0;
  color: var(--portal-green-900);
  font-size: clamp(15px, 1.1vw, 18px);
  font-weight: 700;
  line-height: 1.3;
}

body:not(.auth-locked) .topbar p {
  margin: 2px 0 0;
  color: var(--portal-muted);
  font-size: 10px;
}

body:not(.auth-locked) .top-actions {
  gap: 6px;
}

body:not(.auth-locked) .top-actions .primary,
body:not(.auth-locked) .top-actions .secondary {
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 5px;
  font-size: 11px;
}

body:not(.auth-locked) main > section.view {
  flex: 1 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: var(--portal-page-gap) var(--portal-page-pad) 18px;
  overflow-x: clip;
}

body:not(.auth-locked) main > section.view[hidden],
body:not(.auth-locked) main > section.view:not(.active) {
  display: none !important;
}

body:not(.auth-locked) main > section.view.active:not([hidden]) {
  display: block;
}

body:not(.auth-locked) .cc-hero {
  display: none;
}

/* --------------------------------------------------------------------------
   Shared surfaces, typography and actions
   -------------------------------------------------------------------------- */
body:not(.auth-locked) .panel,
body:not(.auth-locked) .metric,
body:not(.auth-locked) .team-card,
body:not(.auth-locked) .cc-kpi,
body:not(.auth-locked) .scouting-metric,
body:not(.auth-locked) .shelter-metric,
body:not(.auth-locked) .cc-field-care-metric,
body:not(.auth-locked) .cc-chart-card,
body:not(.auth-locked) .period-bar {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--portal-line-soft);
  border-radius: var(--portal-radius);
  background: var(--portal-surface);
  box-shadow: var(--portal-shadow);
}

body:not(.auth-locked) .panel {
  padding: clamp(10px, .75vw, 15px);
}

body:not(.auth-locked) .panel-title,
body:not(.auth-locked) .section-actions,
body:not(.auth-locked) .table-summary,
body:not(.auth-locked) .cc-zone-header,
body:not(.auth-locked) .cc-chart-head,
body:not(.auth-locked) .scouting-page-head,
body:not(.auth-locked) .shelter-page-head {
  gap: 8px;
  margin-bottom: 10px;
}

body:not(.auth-locked) .panel h2,
body:not(.auth-locked) .section-actions h2,
body:not(.auth-locked) .cc-zone-header h3,
body:not(.auth-locked) .cc-chart-head h3 {
  margin: 0;
  color: var(--portal-green-900);
  font-size: clamp(13px, .95vw, 16px);
  font-weight: 700;
  line-height: 1.35;
}

body:not(.auth-locked) .panel p,
body:not(.auth-locked) .section-actions p,
body:not(.auth-locked) .cc-chart-head p {
  margin: 2px 0 0;
  color: var(--portal-muted);
  font-size: 10px;
  line-height: 1.45;
}

body:not(.auth-locked) .primary,
body:not(.auth-locked) .secondary,
body:not(.auth-locked) .link-btn {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}

body:not(.auth-locked) .primary {
  border-color: var(--portal-green-700);
  background: var(--portal-green-700);
  color: #fff;
}

body:not(.auth-locked) .primary:hover {
  background: var(--portal-green-900);
}

body:not(.auth-locked) .secondary {
  border-color: #d2dde0;
  background: #eef3f4;
  color: #42565f;
}

body:not(.auth-locked) .section-actions,
body:not(.auth-locked) .scouting-page-head,
body:not(.auth-locked) .shelter-page-head {
  margin: 0 0 var(--portal-page-gap);
  padding: 10px 13px;
  border: 1px solid var(--portal-line-soft);
  border-inline-end: 3px solid var(--portal-green-700);
  border-radius: var(--portal-radius);
  background: #fff;
  box-shadow: 0 2px 8px rgba(22, 61, 70, .04);
}

/* --------------------------------------------------------------------------
   Dense KPI language
   -------------------------------------------------------------------------- */
body:not(.auth-locked) .cards,
body:not(.auth-locked) .cc-kpi-grid,
body:not(.auth-locked) .scouting-metrics,
body:not(.auth-locked) .shelter-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--portal-page-gap);
  margin: 0 0 var(--portal-page-gap);
}

body:not(.auth-locked) .metric,
body:not(.auth-locked) .cc-kpi,
body:not(.auth-locked) .scouting-metric,
body:not(.auth-locked) .shelter-metric {
  position: relative;
  min-height: 94px;
  padding: 12px 14px;
  overflow: hidden;
  border-bottom: 3px solid var(--portal-green-700);
}

body:not(.auth-locked) .metric::before,
body:not(.auth-locked) .cc-kpi::before,
body:not(.auth-locked) .scouting-metric::before,
body:not(.auth-locked) .shelter-metric::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 72px;
  height: 52px;
  background: linear-gradient(135deg, transparent 45%, rgba(10,109,88,.045) 46%);
  pointer-events: none;
}

body:not(.auth-locked) .metric h3,
body:not(.auth-locked) .metric span,
body:not(.auth-locked) .cc-kpi small,
body:not(.auth-locked) .scouting-metric span,
body:not(.auth-locked) .shelter-metric span {
  color: var(--portal-muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
}

body:not(.auth-locked) .metric b,
body:not(.auth-locked) .cc-kpi b,
body:not(.auth-locked) .scouting-metric b,
body:not(.auth-locked) .shelter-metric b,
body:not(.auth-locked) .card-value {
  color: var(--portal-green-950);
  font-size: clamp(24px, 2vw, 36px);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

body:not(.auth-locked) .cc-kpi {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  gap: 4px 8px;
}

body:not(.auth-locked) .cc-kpi .cc-kpi-icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--portal-green-100);
  color: var(--portal-green-800);
}

body:not(.auth-locked) .cc-kpi b {
  align-self: center;
}

/* --------------------------------------------------------------------------
   Filters and forms
   -------------------------------------------------------------------------- */
body:not(.auth-locked) .cc-filter-panel,
body:not(.auth-locked) .reports-filter-panel,
body:not(.auth-locked) .scouting-filter-panel,
body:not(.auth-locked) .shelter-filter-panel {
  position: static;
  margin: 0 0 var(--portal-page-gap);
  padding: 10px 12px;
  border-radius: var(--portal-radius);
  background: #fff;
}

body:not(.auth-locked) .cc-filter-toolbar {
  min-height: 35px;
  margin-bottom: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--portal-line-soft);
}

body:not(.auth-locked) .cc-filter-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

body:not(.auth-locked) .cc-filter-heading span {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--portal-green-100);
  color: var(--portal-green-800);
  font-size: 10px;
  font-weight: 700;
}

body:not(.auth-locked) .cc-filter-heading b {
  color: var(--portal-ink);
  font-size: 11px;
}

body:not(.auth-locked) .cc-quick-periods {
  padding: 3px;
  border-radius: 6px;
  background: #edf2f3;
}

body:not(.auth-locked) .cc-quick-periods button {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
}

body:not(.auth-locked) .cc-filter-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: end;
}

body:not(.auth-locked) .cc-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
}

body:not(.auth-locked) .filters,
body:not(.auth-locked) .reports-filters,
body:not(.auth-locked) .scouting-filters,
body:not(.auth-locked) .shelter-filters,
body:not(.auth-locked) .form-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 8px;
  align-items: end;
  margin: 0;
}

body:not(.auth-locked) .filters label,
body:not(.auth-locked) .form-grid label,
body:not(.auth-locked) .modal-card label {
  min-width: 0;
  color: var(--portal-green-900);
  font-size: 10px;
  font-weight: 600;
}

body:not(.auth-locked) input,
body:not(.auth-locked) select,
body:not(.auth-locked) textarea,
body:not(.auth-locked) .filters input,
body:not(.auth-locked) .filters select,
body:not(.auth-locked) .modal-card input,
body:not(.auth-locked) .modal-card select,
body:not(.auth-locked) .modal-card textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 35px;
  padding: 7px 9px;
  border: 1px solid #d4dfe2;
  border-radius: 4px;
  background: #fff;
  color: var(--portal-ink);
  font-size: 11px;
  box-shadow: none;
}

body:not(.auth-locked) textarea {
  min-height: 74px;
  resize: vertical;
}

body:not(.auth-locked) input:focus,
body:not(.auth-locked) select:focus,
body:not(.auth-locked) textarea:focus {
  outline: 2px solid rgba(13,125,101,.14);
  border-color: var(--portal-green-700);
}

body:not(.auth-locked) .cc-filter-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(76px, auto));
  gap: 7px;
}

/* --------------------------------------------------------------------------
   Command center composition
   -------------------------------------------------------------------------- */
body:not(.auth-locked) .cc-zone {
  margin: 0 0 var(--portal-page-gap);
  padding: 0;
  border: 0;
  border-radius: var(--portal-radius);
  background: transparent;
  box-shadow: none;
}

body:not(.auth-locked) .cc-zone-header {
  min-height: 42px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--portal-line-soft);
  border-inline-end: 3px solid var(--portal-green-700);
  border-radius: var(--portal-radius) var(--portal-radius) 0 0;
  background: #fff;
}

body:not(.auth-locked) .cc-zone-title {
  gap: 8px;
}

body:not(.auth-locked) .cc-zone-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--portal-green-100);
  color: var(--portal-green-800);
  box-shadow: none;
}

body:not(.auth-locked) .cc-zone > .cc-kpi-grid {
  margin: 0;
  padding: var(--portal-page-gap) 0;
}

body:not(.auth-locked) .cc-report-analytics-grid,
body:not(.auth-locked) .cc-field-analytics-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--portal-page-gap);
  margin: 0;
}

body:not(.auth-locked) .cc-report-analytics-grid > .cc-chart-card,
body:not(.auth-locked) .cc-field-analytics-grid > .cc-chart-card,
body:not(.auth-locked) .cc-field-care-card {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 11px 12px;
  border-radius: var(--portal-radius);
  overflow: hidden;
}

body:not(.auth-locked) .cc-report-trend-card { grid-column: span 8; }
body:not(.auth-locked) .cc-report-mix-card { grid-column: span 4; }
body:not(.auth-locked) .cc-hourly-card { grid-column: 1 / -1; }
body:not(.auth-locked) .cc-sector-reports-card,
body:not(.auth-locked) .cc-top-areas-card,
body:not(.auth-locked) .cc-period-comparison-card { grid-column: span 4; }

body:not(.auth-locked) .cc-control-outcomes-card { grid-column: span 7; }
body:not(.auth-locked) .cc-field-sector-card { grid-column: span 5; }
body:not(.auth-locked) .cc-observed-card,
body:not(.auth-locked) .cc-impact-indicator-card { grid-column: span 6; }

body:not(.auth-locked) .cc-field-care-card {
  margin: 0 0 var(--portal-page-gap);
}

body:not(.auth-locked) .cc-chart-body {
  width: 100%;
  min-width: 0;
  min-height: clamp(180px, 21vw, 285px);
  max-height: none;
  padding: 4px;
  overflow: hidden;
}

body:not(.auth-locked) .cc-hourly-chart-body {
  min-height: clamp(205px, 23vw, 310px);
  overflow-x: auto;
  overflow-y: hidden;
}

body:not(.auth-locked) .cc-segmented {
  padding: 2px;
  border-radius: 5px;
  background: #edf2f3;
}

body:not(.auth-locked) .cc-segmented button {
  min-height: 27px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 9px;
}

body:not(.auth-locked) .cc-bottom-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--portal-page-gap);
  margin: 0;
}

body:not(.auth-locked) .cc-summary-panel {
  min-height: 0;
}

/* --------------------------------------------------------------------------
   Reports, scouting, teams and shelter
   -------------------------------------------------------------------------- */
body:not(.auth-locked) #reports-view .reports-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "filters"
    "table"
    "map";
  gap: var(--portal-page-gap);
  direction: rtl;
}

body:not(.auth-locked) #reports-view .reports-filter-panel { grid-area: filters; }
body:not(.auth-locked) #reports-view .reports-table-pane { grid-area: table; }
body:not(.auth-locked) #reports-view .reports-map-pane { grid-area: map; }

body:not(.auth-locked) #reports-view .reports-map-pane,
body:not(.auth-locked) #reports-view .reports-table-pane,
body:not(.auth-locked) #reports-view .reports-filter-panel {
  width: 100%;
  min-width: 0;
  margin: 0;
}

body:not(.auth-locked) #reports-view .reports-map-content {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  gap: 10px;
  align-items: stretch;
}

body:not(.auth-locked) #pending-map,
body:not(.auth-locked) #scouting-map {
  width: 100%;
  height: clamp(300px, 38vh, 470px);
  min-height: 300px;
  border: 1px solid var(--portal-line);
  border-radius: 5px;
  overflow: hidden;
}

body:not(.auth-locked) .map-filters,
body:not(.auth-locked) .compact-map-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}

body:not(.auth-locked) .map-summary,
body:not(.auth-locked) .compact-map-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

body:not(.auth-locked) .map-summary span,
body:not(.auth-locked) .compact-map-summary span {
  padding: 5px 9px;
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  background: #f8fbfa;
  font-size: 10px;
}

body:not(.auth-locked) .scouting-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, .8fr);
  gap: var(--portal-page-gap);
  margin-bottom: var(--portal-page-gap);
}

body:not(.auth-locked) .team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: var(--portal-page-gap);
}

body:not(.auth-locked) .team-card {
  padding: 12px;
}

body:not(.auth-locked) .shelter-workflow-grid,
body:not(.auth-locked) .shelter-operations-grid {
  gap: var(--portal-page-gap);
}

/* --------------------------------------------------------------------------
   Dense government tables
   -------------------------------------------------------------------------- */
body:not(.auth-locked) .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--portal-line-soft);
  border-radius: 4px;
  background: #fff;
}

body:not(.auth-locked) .table-wrap.tall {
  max-height: min(68vh, 720px);
}

body:not(.auth-locked) table {
  width: 100%;
  min-width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 11px;
}

body:not(.auth-locked) thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 38px;
  padding: 9px 10px;
  border-inline-end: 1px solid rgba(255,255,255,.14);
  border-bottom: 1px solid var(--portal-green-950);
  background: var(--portal-green-800);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

body:not(.auth-locked) thead th:first-child {
  border-start-start-radius: 3px;
}

body:not(.auth-locked) thead th:last-child {
  border-start-end-radius: 3px;
}

body:not(.auth-locked) tbody td {
  max-width: 280px;
  padding: 8px 9px;
  border-inline-end: 1px solid #edf1f2;
  border-bottom: 1px solid #e6ecee;
  background: #fff;
  color: #283e47;
  font-size: 10px;
  line-height: 1.45;
  vertical-align: middle;
}

body:not(.auth-locked) tbody tr:nth-child(even) td {
  background: #fafcfc;
}

body:not(.auth-locked) tbody tr:hover td {
  background: #edf8f4;
}

body:not(.auth-locked) .sort-control {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  white-space: nowrap;
}

body:not(.auth-locked) .table-summary {
  min-height: 34px;
  margin: 0 0 7px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--portal-line-soft);
  font-size: 10px;
}

body:not(.auth-locked) .reports-pager {
  min-height: 38px;
  margin: 0 0 7px;
  gap: 7px;
}

body:not(.auth-locked) .reports-pager button,
body:not(.auth-locked) .reports-pager select {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 10px;
}

/* --------------------------------------------------------------------------
   Modals and footer
   -------------------------------------------------------------------------- */
body:not(.auth-locked) .modal {
  padding: 12px;
}

body:not(.auth-locked) .modal-card {
  width: min(980px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--portal-line);
  box-shadow: 0 22px 70px rgba(5, 56, 47, .22);
  overflow: auto;
}

body:not(.auth-locked) .modal-close {
  position: sticky;
  top: 0;
  z-index: 4;
}

body:not(.auth-locked) .platform-footer {
  min-height: 38px;
  margin: auto var(--portal-page-pad) 10px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--portal-green-950), var(--portal-green-800));
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Responsive states — based on available visual width, never browser zoom hacks
   -------------------------------------------------------------------------- */
@media (min-width: 1600px) {
  body:not(.auth-locked) .cc-kpi-grid,
  body:not(.auth-locked) .cards,
  body:not(.auth-locked) .scouting-metrics,
  body:not(.auth-locked) .shelter-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body:not(.auth-locked) .filters,
  body:not(.auth-locked) .reports-filters,
  body:not(.auth-locked) .scouting-filters,
  body:not(.auth-locked) .shelter-filters,
  body:not(.auth-locked) .form-grid {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
  }
}

@media (max-width: 1250px) {
  :root {
    --portal-header-height: 116px;
    --portal-band-height: 68px;
    --portal-nav-height: 48px;
  }

  body:not(.auth-locked) .sidebar nav {
    padding-left: 18px;
  }

  body:not(.auth-locked) .sidebar .side-account {
    display: none;
  }

  body:not(.auth-locked) .sidebar .nav {
    padding: 0 12px;
    font-size: 11px;
  }

  body:not(.auth-locked) .cc-filter-grid,
  body:not(.auth-locked) .filters,
  body:not(.auth-locked) .reports-filters,
  body:not(.auth-locked) .scouting-filters,
  body:not(.auth-locked) .shelter-filters,
  body:not(.auth-locked) .form-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  body:not(.auth-locked) .cc-report-trend-card,
  body:not(.auth-locked) .cc-report-mix-card,
  body:not(.auth-locked) .cc-control-outcomes-card,
  body:not(.auth-locked) .cc-field-sector-card {
    grid-column: span 6;
  }

  body:not(.auth-locked) .scouting-analysis-grid,
  body:not(.auth-locked) #reports-view .reports-map-content {
    grid-template-columns: 1fr;
  }

  body:not(.auth-locked) .team-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --portal-header-height: 108px;
    --portal-band-height: 62px;
    --portal-nav-height: 46px;
  }

  body:not(.auth-locked) .sidebar .brand {
    padding: 0 68px;
  }

  body:not(.auth-locked) .sidebar .brand-mark {
    right: 14px;
    width: 44px;
    height: 44px;
  }

  body:not(.auth-locked) .sidebar .brand::before {
    left: 14px;
    width: 43px;
    height: 43px;
    font-size: 9px;
  }

  body:not(.auth-locked) .sidebar .brand strong {
    font-size: 16px;
  }

  body:not(.auth-locked) .sidebar .brand small {
    font-size: 8px;
  }

  body:not(.auth-locked) .sidebar nav {
    justify-content: flex-start;
    padding: 0 8px;
  }

  body:not(.auth-locked) .sidebar .nav {
    min-width: 115px;
    padding: 0 9px;
    font-size: 10px;
  }

  body:not(.auth-locked) .cards,
  body:not(.auth-locked) .cc-kpi-grid,
  body:not(.auth-locked) .scouting-metrics,
  body:not(.auth-locked) .shelter-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.auth-locked) .cc-filter-content {
    grid-template-columns: 1fr;
  }

  body:not(.auth-locked) .cc-filter-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.auth-locked) .cc-sector-reports-card,
  body:not(.auth-locked) .cc-top-areas-card,
  body:not(.auth-locked) .cc-period-comparison-card,
  body:not(.auth-locked) .cc-observed-card,
  body:not(.auth-locked) .cc-impact-indicator-card {
    grid-column: span 6;
  }

  body:not(.auth-locked) .team-grid {
    grid-template-columns: 1fr;
  }

  body:not(.auth-locked) .map-filters,
  body:not(.auth-locked) .compact-map-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  :root {
    --portal-header-height: 102px;
    --portal-band-height: 57px;
    --portal-nav-height: 45px;
    --portal-page-pad: 8px;
    --portal-page-gap: 8px;
  }

  body:not(.auth-locked) .sidebar {
    inset: 0 0 auto 0;
    width: 100%;
    height: var(--portal-header-height);
    min-height: var(--portal-header-height);
    padding: 0;
    display: grid;
    grid-template-rows: var(--portal-band-height) var(--portal-nav-height);
  }

  body:not(.auth-locked) .sidebar .brand {
    display: flex;
    padding: 0 54px;
  }

  body:not(.auth-locked) .sidebar .brand > div {
    width: calc(100% - 20px);
  }

  body:not(.auth-locked) .sidebar .brand strong {
    font-size: 13px;
  }

  body:not(.auth-locked) .sidebar .brand small {
    display: none;
  }

  body:not(.auth-locked) .sidebar .brand-mark {
    right: 9px;
    width: 38px;
    height: 38px;
  }

  body:not(.auth-locked) .sidebar .brand::before {
    left: 9px;
    width: 36px;
    height: 36px;
    border-width: 2px;
    font-size: 8px;
  }

  body:not(.auth-locked) .sidebar nav {
    position: static;
    width: 100%;
    height: var(--portal-nav-height);
    padding: 0 5px;
    display: flex;
    justify-content: flex-start;
    gap: 1px;
  }

  body:not(.auth-locked) .sidebar .nav {
    flex: 0 0 auto;
    width: auto;
    min-width: 105px;
    height: var(--portal-nav-height);
    min-height: var(--portal-nav-height);
    padding: 0 8px;
    flex-direction: row;
    border-radius: 0;
    font-size: 9px;
  }

  body:not(.auth-locked) .sidebar .nav span {
    display: inline;
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.auth-locked) .topbar,
  body:not(.auth-locked).command-center-active .topbar {
    min-height: 42px;
    margin-top: 7px;
    padding: 7px 9px;
  }

  body:not(.auth-locked) .topbar h1 {
    font-size: 13px;
  }

  body:not(.auth-locked) .topbar p,
  body:not(.auth-locked) .live-dot,
  body:not(.auth-locked) .import-summary {
    display: none;
  }

  body:not(.auth-locked) main > section.view {
    padding: 7px 8px 12px;
  }

  body:not(.auth-locked) .cards,
  body:not(.auth-locked) .cc-kpi-grid,
  body:not(.auth-locked) .scouting-metrics,
  body:not(.auth-locked) .shelter-metrics {
    grid-template-columns: 1fr;
  }

  body:not(.auth-locked) .metric,
  body:not(.auth-locked) .cc-kpi,
  body:not(.auth-locked) .scouting-metric,
  body:not(.auth-locked) .shelter-metric {
    min-height: 82px;
  }

  body:not(.auth-locked) .cc-filter-toolbar {
    align-items: flex-start;
  }

  body:not(.auth-locked) .cc-quick-periods {
    width: 100%;
    overflow-x: auto;
    display: flex;
  }

  body:not(.auth-locked) .cc-filter-grid,
  body:not(.auth-locked) .filters,
  body:not(.auth-locked) .reports-filters,
  body:not(.auth-locked) .scouting-filters,
  body:not(.auth-locked) .shelter-filters,
  body:not(.auth-locked) .form-grid,
  body:not(.auth-locked) .map-filters,
  body:not(.auth-locked) .compact-map-filters {
    grid-template-columns: 1fr;
  }

  body:not(.auth-locked) .cc-report-analytics-grid,
  body:not(.auth-locked) .cc-field-analytics-grid {
    grid-template-columns: 1fr;
  }

  body:not(.auth-locked) .cc-report-analytics-grid > .cc-chart-card,
  body:not(.auth-locked) .cc-field-analytics-grid > .cc-chart-card,
  body:not(.auth-locked) .cc-report-trend-card,
  body:not(.auth-locked) .cc-report-mix-card,
  body:not(.auth-locked) .cc-hourly-card,
  body:not(.auth-locked) .cc-sector-reports-card,
  body:not(.auth-locked) .cc-top-areas-card,
  body:not(.auth-locked) .cc-period-comparison-card,
  body:not(.auth-locked) .cc-control-outcomes-card,
  body:not(.auth-locked) .cc-field-sector-card,
  body:not(.auth-locked) .cc-observed-card,
  body:not(.auth-locked) .cc-impact-indicator-card {
    grid-column: 1;
  }

  body:not(.auth-locked) .cc-chart-body {
    min-height: 210px;
  }

  body:not(.auth-locked) .platform-footer {
    margin-inline: 8px;
    font-size: 9px;
  }

  body:not(.auth-locked) .modal-card {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    padding: 12px;
    border-radius: 6px;
  }
}

@media print {
  body:not(.auth-locked) .sidebar,
  body:not(.auth-locked) .topbar,
  body:not(.auth-locked) .platform-footer,
  body:not(.auth-locked) .cc-filter-panel,
  body:not(.auth-locked) .reports-filter-panel,
  body:not(.auth-locked) .scouting-filter-panel,
  body:not(.auth-locked) .shelter-filter-panel {
    display: none !important;
  }

  body:not(.auth-locked) main,
  body:not(.auth-locked).command-center-active main {
    padding: 0;
  }

  body:not(.auth-locked) main > section.view {
    padding: 0;
  }
}

/* Final command-center specificity corrections */
body:not(.auth-locked) #command-center-view .cc-hero {
  display: none !important;
}

body:not(.auth-locked) #command-center-view .cc-kpi {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  text-align: start;
}

body:not(.auth-locked) #command-center-view .cc-kpi-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 4px;
  text-align: start;
}

body:not(.auth-locked) #command-center-view .cc-kpi-copy small,
body:not(.auth-locked) #command-center-view .cc-kpi-copy b,
body:not(.auth-locked) #command-center-view .cc-kpi-copy em {
  width: 100%;
  margin: 0;
  text-align: start;
}

body:not(.auth-locked) #command-center-view .cc-kpi-copy b {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

body:not(.auth-locked) #command-center-view .cc-kpi-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  order: -1;
}

/* Keep brand and navigation labels visible after legacy rail/mobile rules. */
body:not(.auth-locked) .sidebar .brand > div {
  display: block;
}

body:not(.auth-locked) .sidebar .nav span {
  display: inline;
}


/* v4.7.2 — command-center filters: labelled fields and one-row desktop layout */
body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-content {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-grid {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-field {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 42px;
  gap: 6px;
  align-content: end;
}

body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-field > span {
  display: block;
  min-height: 15px;
  color: var(--portal-green-900);
  font-family: "IBM Plex Sans Arabic", "Noto Kufi Arabic", Tahoma, Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.45;
  text-align: start;
  white-space: nowrap;
}

body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-field > input,
body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-field > select {
  width: 100%;
  min-width: 0;
  height: 42px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #d4dfe2;
  border-radius: 4px;
  background-color: #fff;
  color: var(--portal-ink);
  font-family: "IBM Plex Sans Arabic", "Noto Kufi Arabic", Tahoma, Arial, sans-serif;
  font-size: 11px;
  box-shadow: none;
}

body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-field > select option[value=""] {
  color: transparent;
}

body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-actions {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 8px;
  padding: 0;
}

body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-actions .primary,
body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-actions .secondary {
  min-width: 94px;
  min-height: 42px;
  height: 42px;
  padding-inline: 16px;
}

/* Standard desktop at 100%: all six filters remain on one row. */
@media (min-width: 1200px) {
  body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* Laptop and tablet: reduce columns only when the real viewport becomes narrow. */
@media (min-width: 760px) and (max-width: 1199px) {
  body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-content {
    grid-template-columns: 1fr;
  }

  body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-actions {
    justify-content: flex-start;
  }
}

@media (min-width: 520px) and (max-width: 759px) {
  body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-content {
    grid-template-columns: 1fr;
  }

  body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 519px) {
  body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-content {
    grid-template-columns: 1fr;
  }

  body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-grid {
    grid-template-columns: 1fr;
  }

  body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-actions .primary,
  body:not(.auth-locked) .cc-dashboard-2026 .cc-filter-actions .secondary {
    width: 100%;
    min-width: 0;
  }
}
/* v4.7.3 — remove the duplicate command-center title/status strip.
   Other views keep their page header and actions unchanged. */
body:not(.auth-locked).command-center-active .topbar {
  display: none !important;
}


/* v4.7.5 — reliable desktop KPI row.
   Use the real viewport width instead of the previous named-container threshold,
   which did not activate consistently after the municipal header redesign. */
@media (min-width: 1280px) {
  body:not(.auth-locked) #command-center-view #cc-primary-kpis.cc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    grid-auto-flow: row;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  body:not(.auth-locked) #command-center-view #cc-primary-kpis > .cc-kpi {
    min-width: 0;
    min-height: 112px;
    padding: 11px 10px;
    gap: 6px;
  }

  body:not(.auth-locked) #command-center-view #cc-primary-kpis > .cc-kpi .cc-kpi-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  body:not(.auth-locked) #command-center-view #cc-primary-kpis > .cc-kpi .cc-kpi-copy {
    min-width: 0;
    gap: 3px;
  }

  body:not(.auth-locked) #command-center-view #cc-primary-kpis > .cc-kpi .cc-kpi-copy small {
    font-size: 9px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  body:not(.auth-locked) #command-center-view #cc-primary-kpis > .cc-kpi .cc-kpi-copy b {
    font-size: clamp(21px, 1.55vw, 29px);
    line-height: 1.08;
    white-space: nowrap;
  }

  body:not(.auth-locked) #command-center-view #cc-primary-kpis > .cc-kpi .cc-kpi-copy em {
    font-size: 8px;
    line-height: 1.2;
  }
}

/* ============================================================================
   SAMP v4.7.19 — compact complete sector scouting analysis section
   Visual density only; data, calculations, filters and Supabase are unchanged.
   ============================================================================ */
@media (min-width: 1280px) {
  body:not(.auth-locked) #command-center-view .cc-field-sector-card {
    padding: 10px 12px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-sector-card .cc-chart-head {
    min-height: 0 !important;
    margin-bottom: 5px !important;
    padding-bottom: 5px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-sector-card .cc-chart-head h3 {
    font-size: 14px !important;
    line-height: 1.25 !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-sector-card .cc-chart-head p {
    margin-top: 1px !important;
    font-size: 9px !important;
    line-height: 1.25 !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-sector-card .cc-chart-body {
    padding-top: 7px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-executive {
    gap: 8px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-executive-top {
    gap: 8px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-leader {
    min-height: 86px !important;
    padding: 10px 14px !important;
    gap: 3px !important;
    border-radius: 14px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-leader strong {
    font-size: 21px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-overview-metrics {
    gap: 6px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-overview-metrics > div {
    padding: 8px 10px !important;
    gap: 7px !important;
    border-radius: 13px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-overview-metrics > div > span {
    width: 32px !important;
    height: 32px !important;
    flex-basis: 32px !important;
    font-size: 15px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-overview-metrics b {
    font-size: 19px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-ranking-head {
    padding-top: 0 !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-ranking-list {
    gap: 5px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-rank-row {
    min-height: 0 !important;
    padding: 6px 9px !important;
    gap: 8px !important;
    border-radius: 12px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-rank-index {
    width: 25px !important;
    height: 25px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-dual-bars {
    gap: 3px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-dual-bars i {
    height: 5px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-rank-stats > span {
    min-height: 31px !important;
    padding: 3px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sector-rank-stats b {
    font-size: 12px !important;
  }
}

/* ============================================================================
   SAMP v4.7.20 — professional two-by-two layout for the final four cards
   Sector analysis remains full-width; the final four cards form two balanced rows.
   ============================================================================ */
body:not(.auth-locked) #command-center-view .cc-field-analytics-grid {
  align-items: stretch !important;
  grid-auto-flow: row !important;
}

body:not(.auth-locked) #command-center-view .cc-field-analytics-grid > .cc-chart-card {
  align-self: stretch !important;
  height: 100% !important;
}

body:not(.auth-locked) #command-center-view .cc-field-sector-card {
  grid-column: 1 / -1 !important;
}

body:not(.auth-locked) #command-center-view .cc-control-outcomes-card,
body:not(.auth-locked) #command-center-view .cc-observed-card,
body:not(.auth-locked) #command-center-view .cc-impact-indicator-card,
body:not(.auth-locked) #command-center-view .cc-field-summary-card {
  grid-column: span 6 !important;
}

body:not(.auth-locked) #command-center-view .cc-field-summary-card {
  display: flex !important;
  flex-direction: column !important;
  padding: 14px !important;
  border-color: #d7e7e4 !important;
  background: linear-gradient(155deg, #ffffff 0%, #f8fcfb 100%) !important;
}

body:not(.auth-locked) #command-center-view .cc-field-summary-card .cc-section-title {
  margin-bottom: 10px !important;
  padding-bottom: 9px !important;
  border-bottom: 1px solid #e4efed !important;
}

body:not(.auth-locked) #command-center-view .cc-field-summary-card .cc-section-title h3 {
  margin-top: 2px !important;
  font-size: 16px !important;
}

body:not(.auth-locked) #command-center-view .cc-field-summary-card .cc-executive-summary {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  padding: 14px 16px !important;
  border: 1px solid #e1efec !important;
  background: linear-gradient(135deg, #eef9f6, #f6fafb) !important;
}

body:not(.auth-locked) #command-center-view .cc-field-summary-card .cc-executive-summary ul {
  width: 100% !important;
  gap: 8px !important;
}

body:not(.auth-locked) #command-center-view .cc-field-summary-card .cc-executive-summary li {
  font-size: 11px !important;
  line-height: 1.65 !important;
}

@media (max-width: 1100px) {
  body:not(.auth-locked) #command-center-view .cc-control-outcomes-card,
  body:not(.auth-locked) #command-center-view .cc-observed-card,
  body:not(.auth-locked) #command-center-view .cc-impact-indicator-card,
  body:not(.auth-locked) #command-center-view .cc-field-summary-card {
    grid-column: 1 / -1 !important;
  }
}

/* ============================================================================
   SAMP v4.7.21 — professional observed-animals column chart
   Interactive visual replacement for the legacy two-row progress display.
   ============================================================================ */
body:not(.auth-locked) #command-center-view .cc-observed-card .cc-chart-body {
  display: block !important;
  min-height: 0 !important;
  padding: 4px !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-professional {
  height: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(125px, .34fr) minmax(250px, 1fr) !important;
  grid-template-areas: "summary chart" "legend legend" !important;
  align-items: center !important;
  gap: 10px 14px !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-summary {
  grid-area: summary !important;
  display: grid !important;
  align-content: center !important;
  gap: 5px !important;
  min-height: 150px !important;
  padding: 14px !important;
  border: 1px solid #dceae7 !important;
  border-radius: 15px !important;
  background: linear-gradient(150deg, #f1faf7, #ffffff) !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-summary span {
  color: #59747f !important;
  font-size: 10px !important;
  font-weight: 800 !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-summary b {
  color: #0d4a5e !important;
  font-size: clamp(30px, 3vw, 44px) !important;
  line-height: 1 !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-summary small {
  color: #7b8e96 !important;
  font-size: 8px !important;
  line-height: 1.55 !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-chart-frame {
  grid-area: chart !important;
  min-width: 0 !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-chart-frame svg {
  display: block !important;
  width: 100% !important;
  max-height: 245px !important;
  overflow: visible !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-guide {
  stroke: #e4eeee !important;
  stroke-width: 1 !important;
  stroke-dasharray: 4 6 !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-axis {
  fill: #8a9ba2 !important;
  font-size: 9px !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-column {
  cursor: pointer !important;
  outline: none !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-bar {
  fill: #18a98b !important;
  filter: drop-shadow(0 8px 10px rgba(24, 169, 139, .18)) !important;
  transform-origin: bottom !important;
  transition: opacity .18s ease, filter .18s ease !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-column.dogs .cc-observed-bar {
  fill: #3971bd !important;
  filter: drop-shadow(0 8px 10px rgba(57, 113, 189, .18)) !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-column.unspecified .cc-observed-bar {
  fill: #8998a0 !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-column:hover .cc-observed-bar,
body:not(.auth-locked) #command-center-view .cc-observed-column:focus-visible .cc-observed-bar {
  opacity: .82 !important;
  filter: drop-shadow(0 10px 13px rgba(23, 63, 85, .25)) !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-value {
  fill: #123f53 !important;
  font-size: 16px !important;
  font-weight: 900 !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-label {
  fill: #496772 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-legend {
  grid-area: legend !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-legend-item {
  display: grid !important;
  grid-template-columns: 9px minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 7px 9px !important;
  border: 1px solid #dfeae9 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #355563 !important;
  text-align: inherit !important;
  cursor: pointer !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-legend-item i {
  width: 8px !important;
  height: 8px !important;
  border-radius: 3px !important;
  background: #18a98b !important;
}

body:not(.auth-locked) #command-center-view .cc-observed-legend-item.dogs i { background: #3971bd !important; }
body:not(.auth-locked) #command-center-view .cc-observed-legend-item.unspecified i { background: #8998a0 !important; }
body:not(.auth-locked) #command-center-view .cc-observed-legend-item span { font-size: 9px !important; }
body:not(.auth-locked) #command-center-view .cc-observed-legend-item b { font-size: 13px !important; }
body:not(.auth-locked) #command-center-view .cc-observed-legend-item em { color: #768a93 !important; font-size: 8px !important; font-style: normal !important; }

@media (max-width: 720px) {
  body:not(.auth-locked) #command-center-view .cc-observed-professional {
    grid-template-columns: 1fr !important;
    grid-template-areas: "summary" "chart" "legend" !important;
  }

  body:not(.auth-locked) #command-center-view .cc-observed-summary {
    min-height: 0 !important;
  }
}

/* ============================================================================
   SAMP v4.7.22 — split sector and area report lines into cats and dogs
   Each geography row uses two comparable tracks on one shared numeric scale.
   ============================================================================ */
body:not(.auth-locked) #command-center-view .cc-sector-reports-card .cc-chart-body,
body:not(.auth-locked) #command-center-view .cc-top-areas-card .cc-chart-body {
  display: block !important;
  min-height: 0 !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-chart {
  display: grid !important;
  gap: 9px !important;
  width: 100% !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-legend {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 13px !important;
  padding: 0 5px 6px !important;
  border-bottom: 1px solid #e7efef !important;
  color: #607983 !important;
  font-size: 9px !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-legend span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-legend i {
  width: 9px !important;
  height: 9px !important;
  border-radius: 3px !important;
  background: #d8a126 !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-legend .dogs i { background: #3971bd !important; }
body:not(.auth-locked) #command-center-view .cc-animal-split-legend small { margin-inline-start: auto !important; font-size: 8px !important; }

body:not(.auth-locked) #command-center-view .cc-animal-split-list {
  display: grid !important;
  gap: 4px !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-row {
  display: grid !important;
  grid-template-columns: minmax(100px, .85fr) minmax(150px, 2fr) 112px !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 6px 7px !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: #274b5a !important;
  text-align: inherit !important;
}

body:not(.auth-locked) #command-center-view button.cc-animal-split-row {
  cursor: pointer !important;
  transition: background .16s ease, border-color .16s ease, transform .16s ease !important;
}

body:not(.auth-locked) #command-center-view button.cc-animal-split-row:hover,
body:not(.auth-locked) #command-center-view button.cc-animal-split-row:focus-visible {
  border-color: #cbe2de !important;
  background: #f6fbfa !important;
  transform: translateY(-1px) !important;
  outline: none !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-name {
  min-width: 0 !important;
  overflow: hidden !important;
  color: #425f6b !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-tracks {
  display: grid !important;
  gap: 4px !important;
  min-width: 0 !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-tracks > i {
  display: block !important;
  height: 7px !important;
  overflow: hidden !important;
  border-radius: 999px !important;
  background: #edf2f2 !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-tracks b {
  display: block !important;
  height: 100% !important;
  min-width: 0 !important;
  border-radius: inherit !important;
  background: linear-gradient(90deg, #edc65b, #d39a17) !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-tracks .dogs b {
  background: linear-gradient(90deg, #73a6dc, #3971bd) !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-values {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: center !important;
  gap: 4px !important;
  direction: ltr !important;
  font-variant-numeric: tabular-nums !important;
  text-align: center !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-values em {
  padding: 3px 4px !important;
  border-radius: 7px !important;
  background: #fff7e5 !important;
  color: #9a6a00 !important;
  font-size: 8px !important;
  font-style: normal !important;
  font-weight: 800 !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-values em.dogs {
  background: #edf4fd !important;
  color: #3568ae !important;
}

body:not(.auth-locked) #command-center-view .cc-animal-split-values strong {
  color: #113e53 !important;
  font-size: 11px !important;
}

@media (max-width: 720px) {
  body:not(.auth-locked) #command-center-view .cc-animal-split-row {
    grid-template-columns: minmax(82px, .8fr) minmax(110px, 1.6fr) 90px !important;
    gap: 7px !important;
  }
}

@media (max-width: 480px) {
  body:not(.auth-locked) #command-center-view .cc-animal-split-row {
    grid-template-columns: minmax(0, 1fr) 76px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-animal-split-tracks {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
  }
}

@media (min-width: 900px) and (max-width: 1279px) {
  body:not(.auth-locked) #command-center-view #cc-primary-kpis.cc-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}


/* ========================================================================== 
   SAMP v4.7.7 — compact synchronized report charts
   Keeps the report timeline and report type cards equal in height while they
   share a row. No zoom/scale tricks and no database or behavior changes.
   ========================================================================== */
body:not(.auth-locked) #command-center-view .cc-report-analytics-grid {
  align-items: stretch;
}

body:not(.auth-locked) #command-center-view .cc-report-trend-card,
body:not(.auth-locked) #command-center-view .cc-report-mix-card {
  align-self: stretch;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: clamp(292px, 17vw, 330px);
  min-height: 0;
  max-height: 330px;
}

body:not(.auth-locked) #command-center-view .cc-report-trend-card > .cc-chart-body,
body:not(.auth-locked) #command-center-view .cc-report-mix-card > .cc-chart-body {
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
}

body:not(.auth-locked) #command-center-view .cc-report-trend-card .cc-svg-chart {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
}

body:not(.auth-locked) #command-center-view .cc-report-trend-card .cc-svg-chart > svg {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 220px;
}

body:not(.auth-locked) #command-center-view .cc-report-mix-card .cc-report-mix {
  height: 100%;
  min-height: 0;
  align-items: center;
}

body:not(.auth-locked) #command-center-view .cc-report-mix-card .cc-donut {
  width: min(158px, 100%);
}

body:not(.auth-locked) #command-center-view .cc-report-trend-card .cc-chart-head,
body:not(.auth-locked) #command-center-view .cc-report-mix-card .cc-chart-head {
  min-height: 32px;
  margin-bottom: 5px;
}

@media (max-width: 900px) {
  body:not(.auth-locked) #command-center-view .cc-report-trend-card,
  body:not(.auth-locked) #command-center-view .cc-report-mix-card {
    height: auto;
    min-height: 292px;
    max-height: none;
  }

  body:not(.auth-locked) #command-center-view .cc-report-trend-card > .cc-chart-body,
  body:not(.auth-locked) #command-center-view .cc-report-mix-card > .cc-chart-body {
    min-height: 235px;
  }
}

@media (max-width: 680px) {
  body:not(.auth-locked) #command-center-view .cc-report-trend-card,
  body:not(.auth-locked) #command-center-view .cc-report-mix-card {
    min-height: 0;
  }

  body:not(.auth-locked) #command-center-view .cc-report-mix-card .cc-report-mix {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ========================================================================== 
   SAMP v4.7.8 — hourly reports card at 50% visual height
   The SVG geometry is reduced proportionally, while all data, labels and
   interactions remain available. Rules are scoped to the command center only.
   ========================================================================== */
body:not(.auth-locked) #command-center-view .cc-hourly-card {
  min-height: 0;
  height: auto;
  overflow: hidden;
}

body:not(.auth-locked) #command-center-view .cc-hourly-card > .cc-hourly-chart-body {
  min-height: 0;
  height: auto;
  max-height: none;
  padding-block: 2px;
  overflow-x: auto;
  overflow-y: hidden;
}

body:not(.auth-locked) #command-center-view .cc-hourly-activity {
  gap: 7px;
}

body:not(.auth-locked) #command-center-view .cc-hourly-insights {
  gap: 6px;
}

body:not(.auth-locked) #command-center-view .cc-hourly-insights > div {
  min-height: 48px;
  padding: 6px 9px;
}

body:not(.auth-locked) #command-center-view .cc-hourly-insights small {
  font-size: 8px;
}

body:not(.auth-locked) #command-center-view .cc-hourly-insights b {
  font-size: 13px;
}

body:not(.auth-locked) #command-center-view .cc-hourly-insights span {
  font-size: 7px;
}

body:not(.auth-locked) #command-center-view .cc-hourly-scroll {
  padding-bottom: 0;
}

body:not(.auth-locked) #command-center-view .cc-hourly-scroll > svg {
  display: block;
  width: 100%;
  min-width: 780px;
  height: auto;
  max-height: 220px;
}

body:not(.auth-locked) #command-center-view .cc-hourly-activity .cc-chart-legend {
  min-height: 18px;
  margin-top: 0;
  font-size: 8px;
}

@media (max-width: 900px) {
  body:not(.auth-locked) #command-center-view .cc-hourly-scroll > svg {
    min-width: 760px;
    max-height: none;
  }
}


/* ========================================================================== 
   SAMP v4.7.9 — professional compact hourly reports card
   Refines visual hierarchy, spacing, chart framing and responsive behaviour
   without changing report data or calculations.
   ========================================================================== */
body:not(.auth-locked) #command-center-view .cc-hourly-card {
  padding: 12px 14px 10px;
  border-color: #dbe7e5;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  box-shadow: 0 10px 26px rgba(17, 64, 73, .07);
}

body:not(.auth-locked) #command-center-view .cc-hourly-card .cc-chart-head {
  min-height: 34px;
  margin: 0 0 9px;
  padding: 0 2px 8px;
  align-items: center;
  border-bottom: 1px solid #e5eeec;
}

body:not(.auth-locked) #command-center-view .cc-hourly-card .cc-chart-head h3 {
  font-size: clamp(13px, .95vw, 16px);
  font-weight: 700;
  letter-spacing: 0;
}

body:not(.auth-locked) #command-center-view .cc-hourly-card > .cc-hourly-chart-body {
  padding: 0;
  overflow: hidden;
}

body:not(.auth-locked) #command-center-view .cc-hourly-activity {
  gap: 8px;
}

body:not(.auth-locked) #command-center-view .cc-hourly-insights {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body:not(.auth-locked) #command-center-view .cc-hourly-insight {
  position: relative;
  min-width: 0;
  min-height: 56px;
  padding: 7px 10px 7px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label value"
    "count value";
  align-items: center;
  gap: 1px 8px;
  overflow: hidden;
  border: 1px solid #dce8e6;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(19, 69, 75, .035);
}

body:not(.auth-locked) #command-center-view .cc-hourly-insight::before {
  content: "";
  position: absolute;
  inset-block: 8px;
  inset-inline-start: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #168f78;
}

body:not(.auth-locked) #command-center-view .cc-hourly-insight:nth-child(1)::before { background: #dda21c; }
body:not(.auth-locked) #command-center-view .cc-hourly-insight:nth-child(2)::before { background: #3971bd; }
body:not(.auth-locked) #command-center-view .cc-hourly-insight:nth-child(3)::before { background: #168f78; }
body:not(.auth-locked) #command-center-view .cc-hourly-insight:nth-child(4)::before { background: #315e6f; }

body:not(.auth-locked) #command-center-view .cc-hourly-insight small {
  grid-area: label;
  min-width: 0;
  overflow: hidden;
  color: #607982;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:not(.auth-locked) #command-center-view .cc-hourly-insight b {
  grid-area: value;
  color: #0b4053;
  font-size: clamp(14px, 1.15vw, 19px);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body:not(.auth-locked) #command-center-view .cc-hourly-insight span {
  grid-area: count;
  color: #8a9aa0;
  font-size: 8px;
  line-height: 1.25;
}

body:not(.auth-locked) #command-center-view .cc-hour-chart-frame {
  min-width: 0;
  padding: 7px 9px 5px;
  overflow: hidden;
  border: 1px solid #e0e9e7;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #fafcfb 100%);
}

body:not(.auth-locked) #command-center-view .cc-hourly-scroll {
  width: 100%;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #b7cbc7 transparent;
}

body:not(.auth-locked) #command-center-view .cc-hourly-scroll > svg {
  display: block;
  width: 100%;
  min-width: 820px;
  height: auto;
  max-height: 205px;
  overflow: visible;
}

body:not(.auth-locked) #command-center-view .cc-hour-zone.night {
  fill: rgba(31, 77, 92, .045);
}

body:not(.auth-locked) #command-center-view .cc-hour-zone.day {
  fill: rgba(218, 162, 28, .035);
}

body:not(.auth-locked) #command-center-view .cc-hour-zone.evening {
  fill: rgba(31, 77, 92, .055);
}

body:not(.auth-locked) #command-center-view .cc-hour-phase-separator {
  stroke: #dbe6e4;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

body:not(.auth-locked) #command-center-view .cc-hour-phase-label {
  fill: #536d77;
  font-size: 8px;
  font-weight: 700;
}

body:not(.auth-locked) #command-center-view .cc-hour-grid line {
  stroke: #dfe8e7;
  stroke-width: .9;
}

body:not(.auth-locked) #command-center-view .cc-hour-grid line.guide {
  stroke-dasharray: 3 4;
}

body:not(.auth-locked) #command-center-view .cc-hour-grid line.baseline {
  stroke: transparent;
}

body:not(.auth-locked) #command-center-view .cc-hour-axis-value,
body:not(.auth-locked) #command-center-view .cc-hourly-activity .cc-axis-labels text {
  fill: #82949b;
  font-size: 7.5px;
  font-weight: 500;
}

body:not(.auth-locked) #command-center-view .cc-hour-baseline {
  stroke: #506f7b;
  stroke-width: 1.25;
  stroke-dasharray: 4 4;
}

body:not(.auth-locked) #command-center-view .cc-hour-bar {
  opacity: .96;
  transition: opacity .16s ease, filter .16s ease;
}

body:not(.auth-locked) #command-center-view .cc-hour-column:hover .cc-hour-bar {
  opacity: 1;
  filter: saturate(1.08) brightness(.96);
}

body:not(.auth-locked) #command-center-view .cc-hour-bar.cats { fill: #dda21c; }
body:not(.auth-locked) #command-center-view .cc-hour-bar.dogs { fill: #3971bd; }
body:not(.auth-locked) #command-center-view .cc-hour-total-dot { fill: #214f61; }

body:not(.auth-locked) #command-center-view .cc-hourly-activity .cc-chart-legend {
  min-height: 23px;
  margin: 4px 0 0;
  padding: 5px 2px 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 7px 14px;
  border-top: 1px solid #edf2f1;
  color: #657c85;
  font-size: 8.5px;
}

body:not(.auth-locked) #command-center-view .cc-hourly-activity .cc-chart-legend span {
  gap: 5px;
  white-space: nowrap;
}

body:not(.auth-locked) #command-center-view .cc-hourly-activity .cc-chart-legend i {
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 3px rgba(27, 93, 102, .045);
}

body:not(.auth-locked) #command-center-view .cc-hour-timezone {
  margin-inline-start: auto;
  color: #87989e;
}

@media (max-width: 900px) {
  body:not(.auth-locked) #command-center-view .cc-hourly-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.auth-locked) #command-center-view .cc-hourly-scroll > svg {
    min-width: 780px;
    max-height: none;
  }
}

@media (max-width: 560px) {
  body:not(.auth-locked) #command-center-view .cc-hourly-card {
    padding: 10px;
  }

  body:not(.auth-locked) #command-center-view .cc-hourly-insight {
    min-height: 52px;
    padding: 6px 8px 6px 10px;
  }

  body:not(.auth-locked) #command-center-view .cc-hourly-insight b {
    font-size: 14px;
  }

  body:not(.auth-locked) #command-center-view .cc-hour-timezone {
    width: 100%;
    margin-inline-start: 0;
  }
}


/* --------------------------------------------------------------------------
   SAMP v4.7.10 — synchronized summary analytics card heights
   The three summary cards share the natural height of the tallest card in
   their current CSS-grid row. Browser zoom changes the available CSS width,
   and the grid automatically recalculates without fixed heights or scaling.
   -------------------------------------------------------------------------- */
body:not(.auth-locked) #command-center-view .cc-report-analytics-grid {
  align-items: stretch;
}

body:not(.auth-locked) #command-center-view :is(
  .cc-sector-reports-card,
  .cc-top-areas-card,
  .cc-period-comparison-card
) {
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

body:not(.auth-locked) #command-center-view :is(
  .cc-sector-reports-card,
  .cc-top-areas-card,
  .cc-period-comparison-card
) > .cc-chart-head {
  flex: 0 0 auto;
}

body:not(.auth-locked) #command-center-view :is(
  .cc-sector-reports-card,
  .cc-top-areas-card,
  .cc-period-comparison-card
) > .cc-chart-body {
  flex: 1 1 auto;
  align-content: start;
}


/* --------------------------------------------------------------------------
   SAMP v4.7.16 — non-clipping summary-card synchronization
   JavaScript writes the same measured border-box height to the three cards
   after every chart render and available-width change. These rules ensure the
   inner chart bodies fill that shared height without altering data logic.
   -------------------------------------------------------------------------- */
body:not(.auth-locked) #command-center-view .cc-report-analytics-grid {
  align-items: stretch;
}

body:not(.auth-locked) #command-center-view :is(
  .cc-sector-reports-card,
  .cc-top-areas-card,
  .cc-period-comparison-card
) {
  box-sizing: border-box;
  align-self: stretch;
  height: auto;
  overflow: visible;
}

body:not(.auth-locked) #command-center-view :is(
  .cc-sector-reports-card,
  .cc-top-areas-card,
  .cc-period-comparison-card
) > .cc-chart-body {
  flex: 1 1 auto;
  min-height: clamp(210px, 18vw, 290px);
  overflow: visible;
}

@media (max-width: 679px) {
  body:not(.auth-locked) #command-center-view :is(
    .cc-sector-reports-card,
    .cc-top-areas-card,
    .cc-period-comparison-card
  ) {
    height: auto !important;
    min-height: 0 !important;
  }
}


/* v4.7.12 — field-impact KPI cards in one desktop row */
@media (min-width: 1280px) {
  body:not(.auth-locked) #command-center-view #cc-scouting-kpis.cc-kpi-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  body:not(.auth-locked) #command-center-view #cc-scouting-kpis > .cc-kpi {
    min-width: 0;
    min-height: 96px;
    height: 100%;
    padding: 11px 10px;
    gap: 8px;
  }

  body:not(.auth-locked) #command-center-view #cc-scouting-kpis > .cc-kpi .cc-kpi-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    font-size: 17px;
  }

  body:not(.auth-locked) #command-center-view #cc-scouting-kpis > .cc-kpi .cc-kpi-copy {
    min-width: 0;
    gap: 3px;
  }

  body:not(.auth-locked) #command-center-view #cc-scouting-kpis > .cc-kpi .cc-kpi-copy small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 9.5px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  body:not(.auth-locked) #command-center-view #cc-scouting-kpis > .cc-kpi .cc-kpi-copy b {
    font-size: clamp(17px, 1.15vw, 22px);
    line-height: 1.05;
  }

  body:not(.auth-locked) #command-center-view #cc-scouting-kpis > .cc-kpi .cc-kpi-copy em {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 8px;
    line-height: 1.3;
  }
}


/* --------------------------------------------------------------------------
   v4.7.14 — field-impact KPI cards: one reliable desktop row
   -------------------------------------------------------------------------- */
@media (min-width: 1280px) {
  body:not(.auth-locked) #command-center-view #cc-scouting-kpis.cc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-rows: 1fr;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  body:not(.auth-locked) #command-center-view #cc-scouting-kpis > .cc-kpi {
    width: 100%;
    min-width: 0;
    min-height: 96px;
    height: 100%;
    padding: 11px 10px;
    gap: 8px;
    overflow: hidden;
  }

  body:not(.auth-locked) #command-center-view #cc-scouting-kpis > .cc-kpi .cc-kpi-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    font-size: 17px;
  }

  body:not(.auth-locked) #command-center-view #cc-scouting-kpis > .cc-kpi .cc-kpi-copy {
    min-width: 0;
    gap: 3px;
  }

  body:not(.auth-locked) #command-center-view #cc-scouting-kpis > .cc-kpi .cc-kpi-copy small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    min-height: 27px;
    font-size: 9.5px;
    line-height: 1.4;
  }

  body:not(.auth-locked) #command-center-view #cc-scouting-kpis > .cc-kpi .cc-kpi-copy b {
    font-size: clamp(18px, 1.35vw, 23px);
    line-height: 1.05;
  }

  body:not(.auth-locked) #command-center-view #cc-scouting-kpis > .cc-kpi .cc-kpi-copy em {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 8.5px;
    line-height: 1.35;
  }
}

@media (min-width: 992px) and (max-width: 1279px) {
  body:not(.auth-locked) #command-center-view #cc-scouting-kpis.cc-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 680px) and (max-width: 991px) {
  body:not(.auth-locked) #command-center-view #cc-scouting-kpis.cc-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 679px) {
  body:not(.auth-locked) #command-center-view #cc-scouting-kpis.cc-kpi-grid {
    grid-template-columns: 1fr;
  }
}


/* --------------------------------------------------------------------------
   SAMP v4.7.16 — final guard: summary analytics content must remain visible
   Cards may share a minimum height, but their content can always expand.
   -------------------------------------------------------------------------- */
body:not(.auth-locked) #command-center-view .cc-report-analytics-grid {
  align-items: stretch;
}

body:not(.auth-locked) #command-center-view :is(
  .cc-sector-reports-card,
  .cc-top-areas-card,
  .cc-period-comparison-card
) {
  height: auto !important;
  overflow: visible !important;
}

body:not(.auth-locked) #command-center-view :is(
  .cc-sector-reports-card,
  .cc-top-areas-card,
  .cc-period-comparison-card
) > .cc-chart-body {
  flex: 1 1 auto !important;
  min-height: clamp(210px, 18vw, 290px) !important;
  height: auto !important;
  overflow: visible !important;
}

@media (max-width: 679px) {
  body:not(.auth-locked) #command-center-view :is(
    .cc-sector-reports-card,
    .cc-top-areas-card,
    .cc-period-comparison-card
  ) > .cc-chart-body {
    min-height: 0 !important;
  }
}


/* ============================================================================
   SAMP v4.7.16 — compact single-row sterilization and release layout
   The four operational metrics sit beside the distribution card at desktop
   width. No business logic or Supabase schema is changed.
   ============================================================================ */
@media (min-width: 1280px) {
  body:not(.auth-locked) #command-center-view .cc-field-care-card {
    padding: 10px 12px;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-card .cc-chart-head {
    min-height: 28px;
    margin-bottom: 8px;
    padding-bottom: 7px;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-card .cc-chart-head h3 {
    font-size: 14px;
    line-height: 1.25;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(240px, 1.12fr);
    gap: 9px;
    align-items: stretch;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-metric {
    min-width: 0;
    min-height: 92px;
    height: 100%;
    padding: 11px 10px;
    gap: 9px;
    border-radius: 11px;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 11px;
    font-size: 17px;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-copy {
    gap: 4px;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-metric small {
    font-size: 10px;
    line-height: 1.3;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-metric b {
    font-size: clamp(22px, 1.6vw, 28px);
    line-height: 1;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-metric em {
    font-size: 8px;
    line-height: 1.2;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-open {
    display: none !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-distribution {
    min-width: 0;
    min-height: 92px;
    height: 100%;
    padding: 10px 11px;
    grid-template-columns: 1fr;
    grid-template-areas: "head" "stack" "legend";
    align-content: center;
    gap: 7px;
    border-radius: 11px;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-distribution-head {
    grid-area: head;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0;
    border: 0;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-distribution-head span {
    font-size: 10px;
    line-height: 1.25;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-distribution-head b {
    gap: 3px;
    font-size: 8px;
    white-space: nowrap;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-distribution-head b strong {
    font-size: 18px;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-stack {
    grid-area: stack;
    height: 10px;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-legend {
    grid-area: legend;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-legend button {
    min-width: 0;
    min-height: 30px;
    padding: 5px 7px;
    gap: 5px;
    border-radius: 8px;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-legend span {
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-legend b {
    font-size: 13px;
  }
}

@media (min-width: 1280px) and (max-width: 1450px) {
  body:not(.auth-locked) #command-center-view .cc-field-care-dashboard {
    grid-template-columns: minmax(0, 4fr) minmax(215px, 1fr);
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-metric {
    padding-inline: 8px;
    gap: 7px;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 15px;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-metric small {
    font-size: 9px;
  }
}


/* ============================================================================
   SAMP v4.7.17 — half-height sterilization card with double-width distribution
   Visual-only adjustment. The four metrics remain in one row beside a
   distribution panel whose desktop width is approximately doubled.
   ============================================================================ */
@media (min-width: 1280px) {
  body:not(.auth-locked) #command-center-view .cc-field-care-card {
    min-height: 0 !important;
    padding: 7px 10px !important;
    overflow: visible !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-card .cc-chart-head {
    min-height: 22px !important;
    margin-bottom: 5px !important;
    padding-bottom: 5px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-card .cc-chart-head h3 {
    font-size: 13px !important;
    line-height: 1.2 !important;
  }

  body:not(.auth-locked) #command-center-view #cc-field-care-chart.cc-chart-body {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-dashboard {
    display: grid !important;
    grid-template-columns: minmax(0, 4fr) minmax(360px, 2.24fr) !important;
    gap: 8px !important;
    align-items: stretch !important;
    min-height: 0 !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-metrics {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 7px !important;
    min-height: 0 !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-metric {
    min-width: 0 !important;
    min-height: clamp(118px, 7vw, 136px) !important;
    height: clamp(118px, 7vw, 136px) !important;
    padding: 7px 8px !important;
    gap: 7px !important;
    align-items: center !important;
    border-radius: 10px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-icon {
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px !important;
    border-radius: 9px !important;
    font-size: 14px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-copy {
    gap: 2px !important;
    align-content: center !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-metric small {
    font-size: 9px !important;
    line-height: 1.2 !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-metric b {
    font-size: clamp(19px, 1.35vw, 24px) !important;
    line-height: 1 !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-metric em,
  body:not(.auth-locked) #command-center-view .cc-field-care-open {
    display: none !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-distribution {
    display: grid !important;
    grid-template-columns: minmax(105px, .8fr) minmax(105px, 1fr) minmax(150px, 1.25fr) !important;
    grid-template-areas: "head stack legend" !important;
    align-items: center !important;
    min-width: 0 !important;
    min-height: clamp(118px, 7vw, 136px) !important;
    height: clamp(118px, 7vw, 136px) !important;
    padding: 7px 9px !important;
    gap: 8px !important;
    border-radius: 10px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-distribution-head {
    grid-area: head !important;
    display: grid !important;
    gap: 2px !important;
    align-content: center !important;
    padding: 0 0 0 8px !important;
    border: 0 !important;
    border-inline-end: 1px solid #e2ecea !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-distribution-head span {
    font-size: 9px !important;
    line-height: 1.2 !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-distribution-head b {
    display: flex !important;
    align-items: baseline !important;
    gap: 3px !important;
    font-size: 8px !important;
    white-space: nowrap !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-distribution-head b strong {
    font-size: 19px !important;
    line-height: 1 !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-stack {
    grid-area: stack !important;
    height: 9px !important;
    margin: 0 !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-legend {
    grid-area: legend !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-legend button {
    min-width: 0 !important;
    min-height: 34px !important;
    padding: 5px 7px !important;
    gap: 5px !important;
    border-radius: 8px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-legend span {
    overflow: hidden !important;
    font-size: 9px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-legend b {
    font-size: 13px !important;
  }
}

@media (min-width: 1280px) and (max-width: 1399px) {
  body:not(.auth-locked) #command-center-view .cc-field-care-dashboard {
    grid-template-columns: minmax(0, 4fr) minmax(330px, 2.05fr) !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-distribution {
    grid-template-columns: minmax(95px, .72fr) minmax(90px, .82fr) minmax(140px, 1.18fr) !important;
  }
}

/* ============================================================================
   SAMP v4.7.18 — reduced sterilization card height only
   Keeps the v4.7.17 desktop widths and one-row layout unchanged while reducing
   vertical whitespace in the four metrics and the distribution card.
   ============================================================================ */
@media (min-width: 1280px) {
  body:not(.auth-locked) #command-center-view .cc-field-care-card {
    padding-block: 5px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-card .cc-chart-head {
    min-height: 18px !important;
    margin-bottom: 3px !important;
    padding-bottom: 3px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-metric,
  body:not(.auth-locked) #command-center-view .cc-sterilization-distribution {
    min-height: clamp(84px, 5vw, 96px) !important;
    height: clamp(84px, 5vw, 96px) !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-metric {
    padding-block: 5px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-copy {
    min-height: 0 !important;
    grid-template-rows: auto auto !important;
    gap: 1px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-field-care-copy > small:first-child {
    min-height: 0 !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-distribution {
    padding-block: 5px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-stack {
    height: 8px !important;
  }

  body:not(.auth-locked) #command-center-view .cc-sterilization-legend button {
    min-height: 28px !important;
    padding-block: 3px !important;
  }
}
