/* Public statistics dashboard — Makueni-inspired layout on Tailwind shell */

.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), rgb(30 64 175));
  color: #fff;
}

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

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

.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: rgb(147 197 253);
  color: rgb(37 99 235);
}

.pd-fy-btn.is-active {
  background: rgb(37 99 235);
  border-color: rgb(37 99 235);
  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: rgb(37 99 235);
}

.pd-stat-card--all { border-top: 3px solid rgb(37 99 235); }
.pd-stat-card--completed { border-top: 3px solid rgb(16 185 129); }
.pd-stat-card--ongoing { border-top: 3px solid rgb(59 130 246); }
.pd-stat-card--under_procurement { border-top: 3px solid rgb(245 158 11); }
.pd-stat-card--not_started { border-top: 3px solid rgb(148 163 184); }
.pd-stat-card--stalled { border-top: 3px solid rgb(239 68 68); }

.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-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: rgb(37 99 235);
  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: rgb(30 64 175);
  margin-bottom: 0.5rem;
}

.pd-num-link {
  font-weight: 700;
  color: rgb(37 99 235);
}

.pd-num-link:hover {
  text-decoration: underline;
}

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

.pd-header-pill--link {
  text-decoration: none;
  background: rgb(239 246 255);
  color: rgb(29 78 216);
  transition: background 0.15s ease;
}

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

.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: rgb(37 99 235);
}

.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: rgb(219 234 254);
  color: rgb(29 78 216);
}

.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: rgb(37 99 235);
}

.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: rgb(37 99 235);
  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: rgb(37 99 235);
  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: rgb(37 99 235);
  color: rgb(37 99 235);
}

.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: rgb(37 99 235);
  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.75rem);
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    z-index: 15;
  }

  .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;
  }
}
