/* Public statistics dashboard — county brand palette (orange, not default blue) */

:root {
  --pd-brand: #bf5f0b;
  --pd-brand-hover: #92400e;
  --pd-brand-soft: rgb(255 247 237);
  --pd-brand-border: rgb(253 230 138);
  --pd-link-name: rgb(146 64 14);
  --pd-link-count: rgb(71 85 105);
  --pd-completed: rgb(21 128 61);
  --pd-ongoing: rgb(29 78 216);
  --pd-stalled: rgb(220 38 38);
  --pd-muted: rgb(100 116 139);
  --pd-amber: rgb(194 65 12);
}

.pd-section-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: rgb(15 23 42);
  padding-bottom: 0.5rem;
}

.pd-page-header {
  margin: -0.5rem 0 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgb(15 23 42) 0%, rgb(67 20 7) 45%, rgb(120 53 15) 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgb(15 23 42 / 0.12);
}

.pd-page-header h1 {
  font-size: 1.35rem;
  font-weight: 800;
}

.pd-breadcrumb {
  font-size: 0.8125rem;
  color: rgb(254 215 170);
}

.pd-breadcrumb a {
  color: #fff;
  text-decoration: underline;
}

.pd-header-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pd-header-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.pd-fy-strip {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -0.25rem 1.25rem;
  padding: 0.75rem 0.25rem;
  background: rgb(248 250 252 / 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgb(226 232 240);
}

.pd-fy-strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pd-fy-strip__label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgb(100 116 139);
}

.pd-fy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 9999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid rgb(226 232 240);
  background: #fff;
  color: rgb(51 65 85);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.pd-fy-btn:hover {
  border-color: var(--pd-brand-border);
  color: var(--pd-brand);
}

.pd-fy-btn.is-active {
  background: var(--pd-brand);
  border-color: var(--pd-brand);
  color: #fff;
}

.pd-fy-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background: rgb(220 252 231);
  color: rgb(21 128 61);
}

.pd-fy-btn.is-active .pd-fy-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.pd-stat-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .pd-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .pd-stat-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.pd-stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 9.5rem;
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgb(226 232 240);
  background: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
}

.pd-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.pd-stat-card__label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(100 116 139);
}

.pd-stat-card__count {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1.1;
}

.pd-stat-card__budget {
  font-size: 0.75rem;
  color: rgb(100 116 139);
}

.pd-stat-card__cta {
  margin-top: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pd-brand);
}

.pd-stat-card--all { border-top: 3px solid var(--pd-brand); }
.pd-stat-card--completed { border-top: 3px solid var(--pd-completed); }
.pd-stat-card--ongoing { border-top: 3px solid var(--pd-ongoing); }
.pd-stat-card--under_procurement { border-top: 3px solid var(--pd-amber); }
.pd-stat-card--not_started { border-top: 3px solid rgb(148 163 184); }
.pd-stat-card--stalled { border-top: 3px solid var(--pd-stalled); }

.pd-progress-row {
  margin-bottom: 0.85rem;
}

.pd-progress-row__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.pd-progress-row__meta a {
  color: rgb(51 65 85);
  text-decoration: none;
}

.pd-progress-row__meta a:hover {
  color: var(--pd-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pd-progress-bar {
  height: 0.45rem;
  border-radius: 9999px;
  background: rgb(226 232 240);
  overflow: hidden;
}

.pd-progress-bar__fill {
  height: 100%;
  border-radius: 9999px;
  width: 0;
  transition: width 0.8s ease;
}

.pd-progress-bar--lg {
  height: 1rem;
  border-radius: 0.5rem;
}

.pd-absorption-value {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--pd-brand);
  letter-spacing: -0.02em;
  text-align: center;
}

.pd-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pd-info-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgb(241 245 249);
  font-size: 0.8125rem;
}

.pd-info-list li:last-child {
  border-bottom: none;
}

.pd-chart-shell {
  position: relative;
  min-height: 260px;
}

.pd-chart-shell--sm {
  min-height: 220px;
}

.pd-subcounty-group {
  border-top: 1px solid rgb(241 245 249);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.pd-subcounty-group__title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pd-link-name);
  margin-bottom: 0.5rem;
}

/* ── Table link & stat colors ── */

.pd-link {
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s ease;
}

.pd-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pd-link--name {
  color: var(--pd-link-name);
}

.pd-link--name:hover {
  color: var(--pd-brand-hover);
}

.pd-link--count {
  color: var(--pd-link-count);
  font-variant-numeric: tabular-nums;
}

.pd-link--count:hover {
  color: var(--pd-brand);
}

.pd-link--completed {
  color: var(--pd-completed);
  font-variant-numeric: tabular-nums;
}

.pd-link--completed:hover {
  color: rgb(22 101 52);
}

.pd-link--ongoing {
  color: var(--pd-ongoing);
  font-variant-numeric: tabular-nums;
}

.pd-link--ongoing:hover {
  color: rgb(30 64 175);
}

.pd-link--stalled {
  color: var(--pd-stalled);
  font-variant-numeric: tabular-nums;
}

.pd-link--muted {
  color: var(--pd-muted);
  font-variant-numeric: tabular-nums;
}

.pd-link--amber {
  color: var(--pd-amber);
  font-variant-numeric: tabular-nums;
}

.pd-link--total {
  color: rgb(15 23 42);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pd-link--total:hover {
  color: var(--pd-brand);
}

.pd-stat {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pd-stat--count {
  color: var(--pd-link-count);
}

.pd-stat--ongoing {
  color: var(--pd-ongoing);
}

.pd-stat--stalled {
  color: var(--pd-stalled);
}

.pd-stat--muted {
  color: var(--pd-muted);
}

.pd-stat--total {
  color: rgb(15 23 42);
}

.pd-stat--completed {
  color: var(--pd-completed);
}

.pd-stat--amber {
  color: var(--pd-amber);
}

.pd-num-link {
  font-weight: 700;
  color: var(--pd-link-count);
}

.pd-num-link:hover {
  text-decoration: underline;
  color: var(--pd-brand);
}

.pd-table {
  border-collapse: separate;
  border-spacing: 0;
}

.pd-table thead th {
  background: linear-gradient(180deg, rgb(248 250 252) 0%, rgb(241 245 249) 100%);
  border-bottom: 2px solid rgb(226 232 240);
  padding: 0.65rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(71 85 105);
}

.pd-table tbody td {
  padding: 0.62rem 0.75rem;
  border-bottom: 1px solid rgb(241 245 249);
  vertical-align: middle;
}

.pd-table tbody tr:hover td {
  background: rgb(255 251 235 / 0.45);
}

.pd-table tbody tr:nth-child(even) td {
  background: rgb(248 250 252 / 0.65);
}

.pd-table tbody tr:nth-child(even):hover td {
  background: rgb(255 251 235 / 0.55);
}

.pd-th--completed { color: var(--pd-completed) !important; }
.pd-th--count { color: var(--pd-link-count) !important; }
.pd-th--ongoing { color: var(--pd-ongoing) !important; }
.pd-th--stalled { color: var(--pd-stalled) !important; }
.pd-th--muted { color: var(--pd-muted) !important; }
.pd-th--amber { color: var(--pd-amber) !important; }
.pd-th--total { color: var(--pd-brand) !important; }

.pd-table tfoot td,
.pd-table tbody tr.pd-table__total td {
  font-weight: 800;
  background: rgb(248 250 252);
}

/* Inset tables inside flush panel bodies — breathing room from panel border */
.public-page-root .dashboard-panel__body--flush.pd-table-panel {
  padding: 0;
}

.public-page-root .pd-table-panel .dashboard-table-wrap {
  margin: 1rem 1.25rem 1.25rem;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.625rem;
  overflow: hidden;
  box-shadow: none;
}

.public-page-root .dashboard-panel__header + .dashboard-panel__body--flush.pd-table-panel .dashboard-table-wrap {
  margin-top: 0.35rem;
}

.pd-header-pill--link {
  text-decoration: none;
  background: var(--pd-brand-soft);
  color: var(--pd-brand-hover);
  border-color: var(--pd-brand-border);
  transition: background 0.15s ease;
}

.pd-header-pill--link:hover {
  background: rgb(254 243 199);
}

.pd-empty-state {
  padding: 1.25rem;
  text-align: center;
  color: rgb(100 116 139);
  font-size: 0.875rem;
}

.pd-empty-state--table {
  padding: 2rem 1.25rem;
}

.pd-empty-state__link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--pd-brand);
}

.pd-feedback-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pd-feedback-summary dt {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgb(100 116 139);
}

.pd-feedback-summary dd {
  margin-top: 0.15rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: rgb(15 23 42);
}

.pd-feedback-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 20rem;
  overflow-y: auto;
}

.pd-feedback-item {
  border: 1px solid rgb(226 232 240);
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: rgb(248 250 252);
}

.pd-feedback-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.pd-feedback-item__meta strong {
  font-size: 0.8125rem;
  color: rgb(15 23 42);
}

.pd-feedback-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: var(--pd-brand-soft);
  color: var(--pd-brand-hover);
}

.pd-feedback-item__comment {
  font-size: 0.8125rem;
  color: rgb(51 65 85);
  line-height: 1.45;
  margin: 0;
}

.pd-feedback-item__project {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--pd-brand);
}

.pd-assistant-panel__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pmts-assistant-inline__messages {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.65rem;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.65rem;
  background: rgb(248 250 252);
}

.pmts-assistant-inline__bubble {
  max-width: 92%;
  padding: 0.5rem 0.7rem;
  border-radius: 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.pmts-assistant-inline__bubble--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgb(226 232 240);
  color: rgb(15 23 42);
}

.pmts-assistant-inline__bubble--user {
  align-self: flex-end;
  background: var(--pd-brand);
  color: #fff;
}

.pmts-assistant-inline__links {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pmts-assistant-inline__links a {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--pd-brand);
  text-decoration: underline;
}

.pmts-assistant-inline__suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pmts-assistant-inline__suggestion-label {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.pmts-assistant-inline__suggestion-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pmts-assistant-inline__suggestion {
  border: 1px solid rgb(203 213 225);
  background: #fff;
  border-radius: 9999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.68rem;
  color: rgb(51 65 85);
  cursor: pointer;
}

.pmts-assistant-inline__suggestion:hover {
  border-color: var(--pd-brand);
  color: var(--pd-brand);
}

.pmts-assistant-inline__form {
  display: flex;
  gap: 0.35rem;
}

.pmts-assistant-inline__input {
  flex: 1;
  border: 1px solid rgb(203 213 225);
  border-radius: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.8125rem;
}

.pmts-assistant-inline__send {
  border: none;
  border-radius: 0.5rem;
  background: var(--pd-brand);
  color: #fff;
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.pmts-assistant-inline__send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.pd-assistant-note {
  margin: 0;
  font-size: 0.72rem;
  color: rgb(100 116 139);
}

/* Mobile / tablet public dashboard */
@media (max-width: 991px) {
  .pd-page-header {
    margin-left: 0;
    margin-right: 0;
    padding: 1rem 1.125rem;
  }

  .pd-page-header h1 {
    font-size: 1.125rem;
    line-height: 1.35;
  }

  .pd-header-pills {
    gap: 0.375rem;
  }

  .pd-header-pill {
    max-width: 100%;
    font-size: 0.6875rem;
    line-height: 1.35;
    white-space: normal;
  }
}

@media (max-width: 767px) {
  .pd-fy-strip {
    top: var(--pmts-public-header-height, 3.5rem);
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    z-index: 15;
  }

  .pd-fy-strip::after {
    content: "Swipe to change year →";
    display: block;
    padding: 0.35rem 1rem 0;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgb(100 116 139);
    text-align: center;
  }

  .pd-fy-strip__inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
  }

  .pd-fy-strip__inner::-webkit-scrollbar {
    display: none;
  }

  .pd-fy-btn {
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  .pd-stat-grid {
    grid-template-columns: 1fr;
  }

  .pd-stat-card {
    min-height: auto;
  }

  .pd-chart-shell {
    min-height: 220px;
  }

  .pd-feedback-summary {
    grid-template-columns: 1fr;
  }
}
