/* static/stats.css */

/* === Stats palette (scoped) === */
.stats-page{
  --brand-blue:  #2880c2;
  --brand-green: #86c249;
  --cx-olive:    #ADB13E;
  --brand-orange:#f79a4a;
  --brand-red:   #ef4b3d;
  --cx-amber:    #F6AC21;

  --stats-ink: #0f172a;
  --stats-muted: rgba(15,23,42,.68);
  --stats-border: rgba(0,0,0,.06);
  --stats-card: rgba(255,255,255,.90);
}

.stats-hero{
  margin-top: 14px;
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(90deg, rgba(40,128,194,.12), rgba(129,194,65,.12));
border: 1px solid rgba(0,0,0,.06);
}
.stats-title{ font-weight: 600; margin: 0; }
.stats-subtitle{ margin: 4px 0 0; opacity: .8; }

.stats-kpis{
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
  margin-top: 12px;
}
.kpi{
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.04);
}
.kpi__top{
  display:flex; align-items:center; gap:8px;
  font-size: 12px;
  opacity: .85;
}
.kpi__top i{
  width: 24px; height:24px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius: 8px;
  background: rgba(40,128,194,.12);
  color: var(--brand-blue);
}
.kpi__value{
  font-size: 28px;
  font-weight: 650;
  margin-top: 6px;
  line-height: 1.05;
}
.kpi__hint{ font-size: 12px; opacity: .75; margin-top: 4px; }

.stats-grid{
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  padding-bottom: 18px;
}
.card{
  background: rgba(255,255,255,.90);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.04);
  overflow: hidden;
}
.card__head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px dashed rgba(0,0,0,.08);
}
.card__head h3{
  font-size: 14px;
  margin:0;
  font-weight: 600;
}
.card__tag{
  font-size: 11px;
  opacity: .7;
}
.card__body{ padding: 12px 14px; }
.card__note{ margin: 10px 0 0; font-size: 12px; opacity: .75; }
.card--chart .card__body{ height: 300px; }
.card--chart canvas{ width:100% !important; height: 230px !important; }
.card--wide{ grid-column: 1 / -1; }

.card__split{
  display:grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
}
.table-wrap{
  padding: 12px 14px;
  border-right: 1px dashed rgba(0,0,0,.08);
}
.chart-wrap{
  padding: 12px 14px;
}
.chart-wrap canvas{ width:100% !important; height: 320px !important; }

.legend-hint{ font-size: 12px; opacity: .7; margin-top: 6px; }

.btn-lite{
  border: 1px solid rgba(0,0,0,.12);
  background: white;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 13px;
  display:flex; align-items:center; gap:8px;
}
.btn-lite:hover{ background: rgba(40,128,194,.08); }


.table-scroll{
  max-height: 320px;
  overflow: auto;
  padding-right: 6px;
  overscroll-behavior: contain;
}
.table-scroll thead th{
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(4px);
  z-index: 2;
}

.mini-table{
  width:100%;
  border-collapse: collapse;
}
.mini-table th, .mini-table td{
  padding: 8px 8px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  vertical-align: middle;
}
.mini-table th{ text-align:left; font-size: 12px; opacity: .8; }
.mini-table td.num, .mini-table th.num{ text-align:right; width: 120px; }

.mini-row{ display:flex; align-items:center; gap:10px; }

.mol{
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.08);
  background: white;
  display:flex; align-items:center; justify-content:center;
  overflow: hidden;
}
.mol img{ width: 42px; height: 42px; object-fit: contain; }
.mol--placeholder{
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 1px dashed rgba(0,0,0,.18);
  background: rgba(0,0,0,.02);
}

.mol-label{
  font-weight: 600;
  max-width: 340px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mol-label a{ color: inherit; text-decoration: none; }
.mol-label a:hover{ text-decoration: underline; }

.status{
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.7);
  font-size: 13px;
}
.small-hint{ margin-top: 10px; font-size: 12px; opacity: .75; }

@media (max-width: 992px){
  .stats-kpis{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stats-grid{ grid-template-columns: 1fr; }
  .card__split{ grid-template-columns: 1fr; }
  .table-wrap{ border-right: none; border-bottom: 1px dashed rgba(0,0,0,.08); }
}


/* === Scrollable compound cards (Top lists) === */
.scroll-cards{
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.scroll-cards::-webkit-scrollbar{ height: 10px; }
.scroll-cards::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,.12);
  border-radius: 999px;
}
.scroll-cards::-webkit-scrollbar-track{ background: rgba(0,0,0,.04); border-radius: 999px; }

.cmpd-card{
  flex: 0 0 auto;
  width: 240px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.92);
  border-radius: 14px;
  padding: 10px;
  scroll-snap-align: start;
  box-shadow: 0 10px 26px rgba(15,23,42,.06);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.cmpd-card:hover{
  transform: translateY(-2px);
  border-color: rgba(40,128,194,.35);
  box-shadow: 0 14px 34px rgba(15,23,42,.10);
}
.cmpd-card__top{ display:flex; align-items:center; gap:10px; }
.cmpd-card__mol{
  width: 54px; height: 54px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.cmpd-card__mol img{ width: 52px; height: 52px; object-fit: contain; }
.cmpd-card__title{
  font-weight: 700;
  font-size: 12.5px;
  color: var(--stats-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.cmpd-card__sub{
  font-size: 11px;
  color: var(--stats-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.cmpd-card__value{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 8px;
}
.value-pill{
  font-weight: 800;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-green));
}
.value-key{
  font-size: 11px;
  color: var(--stats-muted);
}
