:root{
  --cfc-blue: #12a8e0;
  --cfc-blue-dark: #0b87c4;
  --cfc-gray: #58595b;
  --cfc-ink: #202124;
  --bg: #f4f8fb;
  --card: #ffffff;
  --border: rgba(32,33,36,.12);
  --shadow: 0 12px 35px rgba(0,0,0,.08);
  --radius: 16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  min-height:100%;
  display:flex;
  flex-direction:column;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--cfc-ink);
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(18,168,224,.15), transparent 60%),
    radial-gradient(900px 500px at 90% 15%, rgba(88,89,91,.08), transparent 55%),
    radial-gradient(1400px 620px at 18% 100%, rgba(18,168,224,.05), transparent 64%),
    radial-gradient(1100px 520px at 88% 100%, rgba(88,89,91,.035), transparent 60%),
    linear-gradient(180deg, #fff 0%, var(--bg) 72%, #eef6fa 100%);
  background-repeat:no-repeat;
  background-size:100% 100%;
}

a{ color: var(--cfc-blue-dark); text-decoration:none; }
a:hover{ text-decoration:underline; }

a,
.subtext,
.badge{
  overflow-wrap:anywhere;
}

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(32,33,36,.08);
}
.topbar-inner{
  max-width:1160px;
  margin:0 auto;
  padding:12px 16px;
  display:flex;
  align-items:center;
  gap:24px;
}
.brand{
  display:flex;
  align-items:center;
  flex:0 0 auto;
}
.brand img{
  width:240px;
  height:auto;
  display:block;
}

.wrap{
  max-width:1160px;
  margin:0 auto;
  width:100%;
  min-width:0;
  flex:1 0 auto;
  padding:18px 16px 28px;
  display:grid;
  grid-template-columns:360px minmax(0, 1fr);
  gap:18px;
  align-items:start;
}

.filter-panel{
  align-self:start;
}

@media (max-width: 980px){
  .wrap{ grid-template-columns:1fr; }
}

@media (min-width: 981px){
  .wrap{
    grid-template-columns:340px minmax(0, 1fr);
  }

  .filter-panel{
    position:sticky;
    top:86px;
  }
}

@media (min-width: 1200px){
  .wrap{
    grid-template-columns:332px minmax(0, 1fr);
  }
}

.results-column{
  display:grid;
  gap:14px;
  min-width:0;
}

.results-heading{
  flex:1 1 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 10px;
  text-align:center;
}

.results-heading-title{
  font-family: 'Montserrat', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size:32px;
  font-weight:500;
  line-height:1.05;
  letter-spacing:-.03em;
  color: var(--cfc-blue);
}

@media (max-width: 640px){
  .topbar-inner{
    flex-direction:column;
    gap:12px;
  }
  .results-heading-title{ font-size:26px; }
}

.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-h{
  padding:16px 16px 10px;
  border-bottom:1px solid rgba(32,33,36,.08);
}
.card-h h2{
  margin:0;
  font-size:15px;
  font-weight:700;
}
.card-h p{
  margin:6px 0 0;
  font-size:13px;
  color: rgba(32,33,36,.68);
  line-height:1.35;
}
.card-b{ padding:10px 16px 14px; }

.search-form > label:first-of-type{
  margin-top:0;
}

label{
  display:block;
  font-size:13px;
  font-weight:700;
  margin:12px 0 8px;
}
.required{ color:#c62828; }

input[type="text"]{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid rgba(32,33,36,.18);
  background:#fff;
  font-size:14px;
  outline:none;
  transition: box-shadow .15s ease, border-color .15s ease;
}
input[type="text"]:focus{
  border-color: rgba(18,168,224,.85);
  box-shadow: 0 0 0 4px rgba(18,168,224,.18);
}

input[type="date"],
select{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid rgba(32,33,36,.18);
  background:#fff;
  font-size:14px;
  outline:none;
  transition: box-shadow .15s ease, border-color .15s ease;
}

input[type="date"]:focus,
select:focus{
  border-color: rgba(18,168,224,.85);
  box-shadow: 0 0 0 4px rgba(18,168,224,.18);
}

.checks{
  display:grid;
  gap:4px;
  margin-top:6px;
  padding-top:4px;
}

@media (min-width: 1200px){
  .checks{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    column-gap:14px;
    row-gap:8px;
  }
}

.check{
  display:grid;
  grid-template-columns:16px minmax(0, 1fr);
  align-items:start;
  column-gap:8px;
  margin:0;
  min-height:calc(1.18em * 2 + 2px);
  font-size:13px;
  font-weight:600;
  color: rgba(32,33,36,.8);
  line-height:1.18;
}
.check input{
  flex:none;
  margin-top:1px;
  width:16px;
  min-width:16px;
  max-width:16px;
  height:16px;
  min-height:16px;
  max-height:16px;
  inline-size:16px;
  block-size:16px;
  accent-color: var(--cfc-blue);
  justify-self:start;
  align-self:start;
  -webkit-appearance:checkbox;
  appearance:auto;
}

.search-actions{
  display:flex;
  gap:10px;
  margin-top:16px;
  width:100%;
  justify-content:center;
}
.btn, .btn-secondary{
  cursor:pointer;
  padding:12px 14px;
  border-radius:12px;
  font-weight:800;
  font-size:14px;
  white-space:nowrap;
}
.btn{
  border:none;
  color:#fff;
  background: linear-gradient(180deg, var(--cfc-blue), var(--cfc-blue-dark));
  box-shadow: 0 10px 22px rgba(18,168,224,.28);
}
.btn-secondary{
  border:1px solid rgba(32,33,36,.18);
  background:#fff;
  color: rgba(32,33,36,.82);
}

.results-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid rgba(32,33,36,.08);
}
.results-top .meta{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}
.results-top .meta strong{ font-size:15px; }
.results-top .meta span{
  font-size:13px;
  color: rgba(32,33,36,.68);
}

.search-actions .btn,
.search-actions .btn-secondary{
  flex:1 1 0;
  min-width:0;
}

@media (max-width: 980px){
  .rpsp-portal .wrap,
  .wrap{
    grid-template-columns:minmax(0, 1fr);
  }

  .filter-panel{
    order:1;
    min-width:0;
  }

  .results-column{
    order:2;
    min-width:0;
  }

  .results-top{
    align-items:flex-start;
    flex-direction:column;
  }

}

@media (max-width: 640px){
  .card-b{ padding:8px 14px 12px; }

  .wrap{
    gap:12px;
  }

  .table,
  .table tbody,
  .table tr,
  .table td{
    display:block;
    width:100%;
  }

  .table thead{
    display:none;
  }

  .table{
    border-collapse:separate;
  }

  .table tbody{
    padding:8px;
  }

  .table tr{
    margin-bottom:12px;
    border:1px solid rgba(32,33,36,.08);
    border-radius:14px;
    background: rgba(244,248,251,.45);
    overflow:hidden;
  }

  .table tr:last-child{
    margin-bottom:0;
  }

  .table td{
    padding:10px 14px 12px;
    border-bottom:1px solid rgba(32,33,36,.08);
  }

  .table td:last-child{
    border-bottom:none;
  }

  .table td::before{
    display:block;
    margin-bottom:6px;
    font-size:11px;
    font-weight:800;
    letter-spacing:.06em;
    text-transform:uppercase;
    color: rgba(32,33,36,.56);
  }

  .table td:nth-child(1)::before{ content:'Location'; }
  .table td:nth-child(2)::before{ content:'Coverage'; }
  .table td:nth-child(3)::before{ content:'Services'; }
}

.table{
  width:100%;
  border-collapse:collapse;
}
.table th, .table td{
  text-align:left;
  padding:12px 16px;
  font-size:13px;
  vertical-align:top;
  border-bottom:1px solid rgba(32,33,36,.08);
}
.table th{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.06em;
  color: rgba(32,33,36,.62);
  background: rgba(244,248,251,.9);
}
.name{
  font-weight:800;
  font-size:14px;
  margin-bottom:4px;
}
.subtext{
  color: rgba(32,33,36,.7);
  line-height:1.45;
}
.badges{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:8px;
}
.badge{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(32,33,36,.14);
  background:#fff;
  color: rgba(32,33,36,.78);
}
.badge.ok{
  border-color: rgba(18,168,224,.28);
  background: rgba(18,168,224,.10);
}

.empty{
  padding:20px 16px;
  font-size:13px;
  color: rgba(32,33,36,.7);
  line-height:1.4;
}

.empty strong{
  font-size:inherit;
  font-weight:700;
}
.footer-note{
  padding:12px 16px 16px;
  font-size:12px;
  color: rgba(32,33,36,.6);
}

.site-footer{
  flex:0 0 auto;
  background: linear-gradient(180deg, rgba(244,248,251,0), rgba(244,248,251,.36) 38%, rgba(238,246,250,.7) 100%);
  backdrop-filter: blur(8px);
}

.site-footer-inner{
  max-width:1160px;
  margin:0 auto;
  padding:24px 16px 24px;
  font-size:12px;
  color: rgba(32,33,36,.64);
  text-align:center;
}

.alert{
  padding:12px 14px;
  border-radius:12px;
  margin-bottom:14px;
  font-size:14px;
}

.rpsp-portal{
  display:flex;
  flex-direction:column;
  min-height:100vh;
  background: transparent;
}

.rpsp-portal .card-h h2{
  font-weight:700;
}

.rpsp-portal .empty,
.rpsp-portal .empty strong{
  font-size:13px;
}

.rpsp-portal .wrap{
  grid-template-columns:380px minmax(0, 1fr);
}

@media (max-width: 980px){
  .rpsp-portal .wrap{
    grid-template-columns:minmax(0, 1fr);
  }
}

@media (min-width: 981px){
  .rpsp-portal .wrap{
    grid-template-columns:360px minmax(0, 1fr);
  }
}

@media (min-width: 1200px){
  .rpsp-portal .wrap{
    grid-template-columns:352px minmax(0, 1fr);
  }
}

.rpsp-portal input[type="text"]{
  background:#fff !important;
  border:1px solid rgba(32,33,36,.18) !important;
  border-radius:12px !important;
  box-shadow:none !important;
  color: var(--cfc-ink);
  -webkit-appearance:none;
  appearance:none;
}

.rpsp-portal .table,
.rpsp-portal .table tr,
.rpsp-portal .table th,
.rpsp-portal .table td{
  border-left:none !important;
  border-right:none !important;
  box-shadow:none !important;
}

.rpsp-portal .table{
  border:none !important;
}

.rpsp-portal .table th,
.rpsp-portal .table td{
  border-top:none !important;
  border-bottom:1px solid rgba(32,33,36,.08) !important;
}

.stats-wrap{
  max-width:1240px;
  margin:0 auto;
  width:100%;
  padding:22px 16px 32px;
  display:grid;
  gap:18px;
}

.stats-card{
  overflow:hidden;
}

body.rpsp-statistics-page{
  background:#eef6fa !important;
  background-repeat:no-repeat !important;
  background-size:auto !important;
  background-attachment:scroll !important;
}

body.rpsp-statistics-page .site-footer{
  background:transparent;
  backdrop-filter:none;
}

.rpsp-statistics-portal{
  position:relative;
  isolation:isolate;
}

.rpsp-statistics-portal::before{
  content:none;
}

.stats-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  align-items:end;
  justify-content:flex-start;
}

.stats-toolbar-card .card-b{
  display:grid;
  gap:12px;
}

.stats-field{
  min-width:0;
  flex:0 0 auto;
}

.stats-field select,
.stats-grid-filter select{
  -webkit-appearance:none;
  appearance:none;
  border-radius:12px !important;
  min-height:46px;
  height:46px;
  font-size:12px;
  line-height:1.2;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(32,33,36,.55) 50%),
    linear-gradient(135deg, rgba(32,33,36,.55) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size:6px 6px, 6px 6px;
  background-repeat:no-repeat;
  padding-right:36px;
}

.stats-field-range{
  width:180px;
}

#rpsp-range{
  width:100%;
  min-width:0;
  max-width:100%;
}

.stats-field-date{
  width:170px;
}

.stats-field-date input{
  width:100%;
}

.stats-field-date.is-hidden{
  display:none;
}

.stats-toolbar-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:end;
  justify-content:flex-start;
  flex:0 0 auto;
}

.stats-toolbar-actions .btn,
.stats-toolbar-actions .btn-secondary{
  min-width:168px;
  min-height:46px;
  height:46px;
  padding:0 18px;
  text-align:center;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none !important;
}

.stats-toolbar-actions a.btn-secondary:hover,
.stats-grid-filter .btn-secondary:hover{
  text-decoration:none !important;
}

.stats-export-form{
  display:none;
}

.stats-kpis{
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:16px;
}

.stats-kpi{
  padding:18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(244,248,251,.92)),
    radial-gradient(circle at top right, rgba(18,168,224,.14), transparent 42%);
}

.stats-kpi-label{
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(32,33,36,.58);
}

.stats-kpi-value{
  margin-top:12px;
  font-family:'Montserrat', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size:34px;
  font-weight:700;
  letter-spacing:-.04em;
  color:var(--cfc-blue-dark);
}

.stats-kpi-note{
  margin-top:8px;
  font-size:13px;
  color:rgba(32,33,36,.64);
}

.stats-chart-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:18px;
}

.stats-chart-card{
  min-width:0;
}

.stats-chart-card-wide{
  grid-column:1 / -1;
}

.stats-chart-card .card-b{
  min-height:320px;
}

.stats-chart-card-wide .card-b{
  min-height:360px;
}

.stats-table-card .card-b{
  display:grid;
  gap:14px;
}

.stats-table-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:18px;
}

.stats-table-head-side{
  display:grid;
  gap:10px;
  justify-items:end;
}

.stats-table-meta{
  font-size:13px;
  color:rgba(32,33,36,.62);
}

.stats-grid-filter{
  display:flex;
  flex-wrap:wrap;
  align-items:end;
  justify-content:flex-end;
  gap:10px;
}

.stats-grid-field{
  display:grid;
  gap:8px;
}

.stats-grid-field label{
  margin:0;
}

.stats-grid-filter select{
  min-width:170px;
  width:170px;
  max-width:100%;
}

.stats-grid-filter .btn{
  min-height:46px;
  height:46px;
  padding:0 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:132px;
}

.stats-grid-filter .btn-secondary{
  min-height:46px;
  height:46px;
  padding:0 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:132px;
}

.stats-table-scroll{
  overflow:auto;
  max-height:520px;
  border:1px solid rgba(32,33,36,.08);
  border-radius:14px;
}

.stats-table{
  min-width:1820px;
}

.stats-table tbody td{
  white-space:nowrap;
}

.stats-pagination{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.stats-pagination .page-numbers{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:40px;
  min-height:40px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid rgba(32,33,36,.14);
  background:#fff;
  color:rgba(32,33,36,.82);
  font-size:13px;
  font-weight:700;
}

.stats-pagination .page-numbers.current{
  border-color:transparent;
  background:linear-gradient(180deg, var(--cfc-blue), var(--cfc-blue-dark));
  color:#fff;
}

.stats-chart-empty{
  min-height:240px;
  display:grid;
  place-items:center;
  padding:20px;
  border:1px dashed rgba(32,33,36,.14);
  border-radius:14px;
  color:rgba(32,33,36,.62);
  font-size:14px;
  text-align:center;
  background:rgba(244,248,251,.6);
}

.stats-line-chart{
  display:grid;
  gap:14px;
  min-height:320px;
}

.stats-line-chart svg{
  width:100%;
  height:100%;
  min-height:270px;
}

.stats-line-grid{
  stroke:rgba(32,33,36,.12);
  stroke-width:1;
}

.stats-line-axis-label{
  fill:rgba(32,33,36,.58);
  font-size:11px;
  font-family:ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.stats-line-axis-label-x{
  font-size:10px;
}

.stats-line-path{
  stroke-linecap:round;
  stroke-linejoin:round;
}

.stats-line-legend{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}

.stats-line-legend-item{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:rgba(32,33,36,.72);
}

.stats-line-legend-swatch{
  width:12px;
  height:12px;
  border-radius:999px;
  display:inline-block;
}

.stats-bars{
  display:grid;
  gap:14px;
}

.stats-bar-row{
  display:grid;
  gap:7px;
}

.stats-bar-meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  font-size:13px;
}

.stats-bar-label{
  color:rgba(32,33,36,.76);
  font-weight:700;
}

.stats-bar-value{
  color:rgba(32,33,36,.9);
  font-size:13px;
}

.stats-bar-track{
  position:relative;
  height:12px;
  border-radius:999px;
  background:rgba(32,33,36,.08);
  overflow:hidden;
}

.stats-bar-fill{
  display:block;
  height:100%;
  border-radius:inherit;
  min-width:10px;
  box-shadow:0 8px 18px rgba(18,168,224,.18);
}

@media (max-width: 1180px){
  .stats-kpis{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }

  .stats-table-head-side{
    justify-items:start;
  }
}

@media (max-width: 820px){
  .stats-kpis,
  .stats-chart-grid{
    grid-template-columns:minmax(0, 1fr);
  }

  .stats-toolbar{
    flex-direction:column;
    align-items:stretch;
  }

  .stats-toolbar-actions{
    flex-direction:column;
    align-items:stretch;
  }

  #rpsp-range,
  .stats-field-range,
  .stats-field-date,
  .stats-grid-filter select,
  .stats-grid-field{
    width:100%;
    min-width:0;
  }

  .stats-table-head{
    flex-direction:column;
    align-items:flex-start;
  }

  .stats-table-head-side,
  .stats-grid-filter{
    justify-items:stretch;
    justify-content:flex-start;
  }

  .stats-kpi-value{
    font-size:28px;
  }
}

.rpsp-portal .table tbody tr:last-child td{
  border-bottom:none !important;
}

.rpsp-portal .subtext a{
  font-weight:700;
}
.alert-error{
  background:#fdecec;
  color:#8f1d1d;
  border:1px solid #f5c2c2;
}

.loading-overlay{
  position:fixed;
  inset:0;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(2px);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:999;
  pointer-events:all;
}
.loading-overlay.is-active{
  display:flex;
}
.loading-box{
  background:#fff;
  border:1px solid rgba(32,33,36,.08);
  border-radius:16px;
  box-shadow: var(--shadow);
  padding:24px 28px;
  text-align:center;
  min-width:240px;
}
.spinner{
  width:42px;
  height:42px;
  margin:0 auto 12px;
  border-radius:50%;
  border:4px solid rgba(18,168,224,.2);
  border-top-color: var(--cfc-blue);
  animation: spin .8s linear infinite;
}
.loading-text{
  font-size:14px;
  color: rgba(32,33,36,.78);
}
@keyframes spin{
  to{ transform: rotate(360deg); }
}
