/* ─────────────────────────────────────────────────────────────────────────
   portale.css — overrides specifici del portale
   Il tema dark globale è in styles.css. Qui solo ciò che è unico al portale.
───────────────────────────────────────────────────────────────────────── */

/* ── KPI strip: barra connessa senza gap ─────────────────────────────────── */
body.portal-page .kpi-strip {
  gap: 0;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surf);
  margin-top: 1.2rem;
  animation: p-fadeup .5s .07s ease both;
}
body.portal-page .kpi-strip .stat {
  background: transparent;
  border: none;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 1.3rem 1.4rem;
}
body.portal-page .kpi-strip .stat:last-child { border-right: none; }
body.portal-page .kpi-strip .stat .v {
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-top: .3rem;
}

/* ── KPI color coding ────────────────────────────────────────────────────── */
body.portal-page #kFree      { color: #34d399; }
body.portal-page #kWip       { color: #fbbf24; }
body.portal-page #kDone      { color: #a78bfa; }
body.portal-page #kPoints    { color: #fbbf24; }
body.portal-page #kDiscenti  { color: #2dd4bf; }
body.portal-page #kCandidati { color: #34d399; }

/* ── Card left-border = stato ────────────────────────────────────────────── */
body.portal-page .card.status-libera     { border-left: 3px solid #34d399; }
body.portal-page .card.status-presa      { border-left: 3px solid #fbbf24; }
body.portal-page .card.status-completata { border-left: 3px solid #a78bfa; }

/* ── Sidebar mine-kpis: griglia 2 colonne compatta ──────────────────────── */
body.portal-page .mine-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
}
body.portal-page .mine-kpis .stat {
  min-height: 0 !important;
  padding: .65rem .75rem;
}
body.portal-page .mine-kpis .stat .k {
  font-size: .68rem;
  min-height: 0 !important;
}
body.portal-page .mine-kpis .stat .v {
  font-size: 1.35rem;
  letter-spacing: -.02em;
}

/* ── Layout sidebar ──────────────────────────────────────────────────────── */
body.portal-page .layout {
  grid-template-columns: 265px 1fr;
}

/* ── Messaggio lista vuota ───────────────────────────────────────────────── */
body.portal-page #leadList > .panel {
  text-align: center;
  padding: 1.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .82rem;
}

/* ── Footer note con divisore ────────────────────────────────────────────── */
body.portal-page .footer-note {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 1.5rem;
}

/* ── Animazioni staggerate ───────────────────────────────────────────────── */
@keyframes p-fadeup {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
body.portal-page .hero      { animation: p-fadeup .5s ease both; }
body.portal-page .kpi-strip { animation: p-fadeup .5s .07s ease both; }
body.portal-page .layout    { animation: p-fadeup .5s .14s ease both; }

/* ── Opportunità: controlli (tab + search) ───────────────────────────────── */
.opport-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin: 1.1rem 0 .6rem;
}
.opport-search { flex: 1; min-width: 200px; }

/* ── Filter tabs ─────────────────────────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
}
.filter-tab {
  padding: .42rem .9rem;
  border-radius: 2rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: 'Syne', sans-serif;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.filter-tab:hover { border-color: var(--txt); color: var(--txt); }
.filter-tab.is-active {
  background: var(--accent-500);
  border-color: var(--accent-500);
  color: #fff;
}
.tab-count {
  display: inline-block;
  background: rgba(255,255,255,.18);
  border-radius: 1rem;
  padding: .05em .38em;
  font-size: .72em;
  margin-left: .22rem;
}
.filter-tab.is-active .tab-count { background: rgba(255,255,255,.28); }
.filter-tab:focus-visible {
  outline: 2px solid var(--aqua-500);
  outline-offset: 2px;
}

/* ── Source badge (Facebook, LinkedIn…) ──────────────────────────────────── */
.card-badges {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.card-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
}
.source-badge {
  display: inline-block;
  padding: .13em .5em;
  border-radius: .3rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: var(--surf);
  color: var(--muted);
}
.source-badge.fb { background: rgba(24,119,242,.16);  color: #5ba4f5; }
.source-badge.li { background: rgba(10,102,194,.16);  color: #5ba4f5; }
.source-badge.ig { background: rgba(225,48,108,.16);  color: #e85b8a; }
.source-badge.yt { background: rgba(255,0,0,.13);     color: #ff5a5a; }
.source-badge.tg { background: rgba(34,158,217,.16);  color: #4db8e8; }
.source-badge.wa { background: rgba(37,211,102,.16);  color: #3dcc7a; }
.card-meta-text  { font-size: .82rem; color: var(--muted); }
.card-note       { font-size: .85rem; color: var(--muted); margin-top: .35rem; }

/* ── Profilo: layout sidebar più stretta ─────────────────────────────────── */
body.portal-page .profilo-layout {
  grid-template-columns: 240px 1fr;
}

/* ── Profilo: definition list dati anagrafici ────────────────────────────── */
.profile-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .4rem .8rem;
  margin: 0 0 1.5rem;
}
.profile-dl dt {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .74rem;
  color: var(--muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  padding-top: .2rem;
}
.profile-dl dd {
  margin: 0;
  font-weight: 500;
  color: var(--txt);
  word-break: break-all;
}

/* ── Profilo: pulsanti azione sidebar ────────────────────────────────────── */
.profilo-actions {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-top: .25rem;
}

/* ── Profilo: griglia risultati 2×2 ──────────────────────────────────────── */
.results-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .4rem;
  margin-top: .75rem;
}
body.portal-page .results-kpis .stat .v {
  font-size: 1.9rem;
  letter-spacing: -.03em;
}

/* ── Profilo: progress bonus ─────────────────────────────────────────────── */
.profile-hint {
  font-size: .88rem;
  color: var(--muted);
  margin: 0 0 1rem;
}
.bonus-progress { margin-top: .25rem; }
.bonus-bar {
  height: .45rem;
  background: rgba(255,255,255,.08);
  border-radius: 1rem;
  overflow: hidden;
  margin-bottom: .65rem;
}
.bonus-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-500), var(--gold-400, #f7c24f));
  border-radius: 1rem;
  transition: width .6s ease;
}
.bonus-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .82rem;
  color: var(--muted);
  margin: 0;
}

/* ── Pagina iscrizioni ───────────────────────────────────────────────────── */
.muted-msg {
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
  padding: 2rem 0;
}
.muted-msg.error { color: #f87171; }

.iscritti-section { margin-bottom: 2rem; }

.iscritti-section-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.iscritti-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.iscritti-section-title {
  font-size: 1.1rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.iscritti-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 .4rem;
  border-radius: 1rem;
  background: rgba(255,255,255,.1);
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  font-weight: 400;
  color: var(--muted);
}
.iscritti-section-desc {
  font-size: .85rem;
  color: var(--muted);
  margin: 0;
  width: 100%;
  padding-left: 1.15rem;
}

.iscritti-table {
  width: 100%;
  border-collapse: collapse;
}
.iscritti-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.iscritti-table tbody tr:last-child { border-bottom: none; }
.iscritti-name {
  padding: .55rem 1rem .55rem 0;
  font-size: .9rem;
}
.iscritti-date {
  padding: .55rem 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .82rem;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
}
.results-kpis .v.is-loading {
  opacity: .45;
  letter-spacing: .08em;
}

.iscritti-empty {
  font-size: .85rem;
  color: var(--muted);
  margin: 0 0 .5rem;
  padding-left: 1.15rem;
}
.iscritti-feedback {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .74rem;
  color: var(--muted);
  margin-left: .5rem;
  white-space: nowrap;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  body.portal-page .layout {
    grid-template-columns: 1fr;
  }
  body.portal-page .kpi-strip {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  body.portal-page .kpi-strip .stat { padding: 1rem 1.1rem; }
  body.portal-page .kpi-strip .stat .v { font-size: 2rem; }
  body.portal-page .profilo-layout { grid-template-columns: 1fr; }
  .results-kpis { grid-template-columns: repeat(2, 1fr); }
  .opport-controls { flex-direction: column; align-items: stretch; }
  .filter-tabs { order: 1; }
  .opport-search { order: 2; }
  .filter-tab {
    min-height: 44px;
    padding: .5rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.portal-page .hero,
  body.portal-page .kpi-strip,
  body.portal-page .layout {
    animation: none;
  }
  .bonus-fill { transition: none; }
}
