/* ===== RINNOVI BOARD KANBAN (playground redesign) ===== */

.rinnovi-board {
    /* Layout classico flex: le larghezze delle 5 colonne le calcola JS al render
       e al resize (--rb-col-w) — solo così bypassiamo il min-content dei figli
       che con grid/flex nativo vincerebbero costantemente. */
    display: flex;
    align-items: stretch;
    gap: 4px;
    padding-bottom: 12px;
    width: 100%;
    margin: 0;
    overflow-x: hidden;
}
.rb-mobile-tabs { display: none; }

.rb-col {
    /* Larghezza esplicita via custom prop, impostata dal JS (fitBoardColumns) */
    width: var(--rb-col-w, 260px);
    min-width: 0;
    max-width: var(--rb-col-w, 260px);
    flex: 0 0 var(--rb-col-w, 260px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: #12141A;
    border: 1px solid rgba(255,255,255,0.06);
    border-top: 3px solid var(--rb-accent, #64748b);
    border-radius: 12px;
    max-height: calc(100vh - 340px);
    min-height: 320px;
    overflow: hidden;
}
.rb-col > * { min-width: 0; }

/* Cascata min-width:0 a TUTTI i discendenti della colonna: qualsiasi elemento
   con min-content largo (chip lunghi, input, badge, testi non wrappabili)
   forzerebbe la colonna a espandersi oltre la sua track grid. Con questo
   reset, il min-content di ogni discendente è 0 e la colonna resta nella
   sua track (fluida col viewport). */
.rb-col * { min-width: 0; }
.rb-col input, .rb-col select, .rb-col button { max-width: 100%; }

/* Chip filters: DEVONO wrappare, altrimenti riga lunga forza la colonna larga */
.rb-col .rb-chips, .rb-col [class*="chip"] { flex-wrap: wrap; }

/* Testi lunghi nelle card: wrap parole o troncamento con ellipsis */
.rb-col .rb-card, .rb-col .rb-card * {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.rb-col1 { --rb-accent: #64748b; }
.rb-col2 { --rb-accent: #f59e0b; }
.rb-col3 { --rb-accent: #3b82f6; }
.rb-col4 { --rb-accent: #a78bfa; }
.rb-col5 { --rb-accent: #22c55e; }

.rb-col-head {
    padding: 14px 14px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
    border-radius: 12px 12px 0 0;
}
.rb-col-head-top { display: flex; align-items: center; gap: 8px; }
.rb-col-icon { font-size: 1rem; line-height: 1; }
.rb-col-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #E8E9EB;
    flex: 1;
}
.rb-col-counter {
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    color: #E8E9EB;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rb-col-desc {
    font-size: 0.68rem;
    color: #8B8F98;
    margin-top: 4px;
    line-height: 1.35;
}

/* v3 (redesign filtri gestionali): chip categoria più leggibili, con tick su
   attivo, weight 600 base, tabular-nums per contatori inline. La riga
   scadenza (.rb-scad-row) è visivamente distinta per non confondersi con i
   chip categoria: pill quadrate, dash-border, prefisso label. */
.rb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    align-items: center;
}
.rb-chip {
    padding: 4px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    color: #9aa0aa;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    transition: all 0.12s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.rb-chip:hover { background: rgba(255,255,255,0.08); border-color: var(--rb-accent, #3B82F6); color: #E8E9EB; }
.rb-chip.active {
    background: var(--rb-accent, #3B82F6);
    color: #0b0c10;
    border-color: transparent;
    font-weight: 700;
}
.rb-chip-tick { font-size: 0.72rem; line-height: 1; opacity: 0.9; }
.rb-chip-reset {
    background: transparent;
    border-style: dashed;
    color: #ef4444;
    font-weight: 700;
    padding: 4px 10px;
}
.rb-chip-reset:hover { background: transparent; border-color: #ef4444; color: #ef4444; }

/* --- Toggle collasso riga chip categoria (playground v3) --- */
.rb-chips-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}
.rb-chips-toggle {
    align-self: flex-start;
    padding: 4px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #8b8f98;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.12s;
}
.rb-chips-toggle:hover { background: rgba(255,255,255,0.07); color: #E8E9EB; border-color: rgba(255,255,255,0.14); }
.rb-chips-toggle.has-active { color: var(--rb-accent, #E8E9EB); border-color: var(--rb-accent, rgba(255,255,255,0.14)); }
.rb-chips-toggle-arrow { font-size: 0.62rem; line-height: 1; opacity: 0.8; }
.rb-chips-toggle-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--rb-accent, #3B82F6);
    color: #0b0c10;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0;
}
.rb-chips.rb-chips--collapsed { display: none; }
.rb-chips-wrap .rb-chips { margin-top: 0; }

body.light-mode .rb-chips-toggle { background: rgba(0,0,0,0.03); color: #64748b; border-color: #e2e4e9; }
body.light-mode .rb-chips-toggle:hover { background: rgba(0,0,0,0.06); color: #1a1a2e; }

/* --- Nav DEV in cima alla card: frecce ◀ ▶ per spostare la carta tra colonne --- */
.rb-card-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -3px -3px 6px -3px;
    padding: 2px 4px;
    border-bottom: 1px dashed rgba(167,139,250,0.15);
}
.rb-card-nav-btn {
    background: transparent;
    border: 1px solid rgba(167,139,250,0.28);
    border-radius: 6px;
    color: #c4b5fd;
    padding: 1px 8px;
    font-size: 0.72rem;
    line-height: 1.4;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.12s;
}
.rb-card-nav-btn:hover { background: rgba(167,139,250,0.18); color: #fff; border-color: #a78bfa; }
.rb-card-nav-btn--disabled {
    border-color: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.15);
    cursor: default;
    display: inline-block;
    padding: 1px 8px;
    border-radius: 6px;
    border-style: solid;
    border-width: 1px;
    font-size: 0.72rem;
}
.rb-card-nav-tag {
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(167,139,250,0.25);
    color: #ede9fe;
}
body.light-mode .rb-card-nav { border-bottom-color: rgba(124,109,250,0.2); }
body.light-mode .rb-card-nav-btn { color: #6d5cf0; border-color: rgba(124,109,250,0.3); }
body.light-mode .rb-card-nav-btn:hover { background: rgba(124,109,250,0.15); color: #4c3fc7; }

/* --- Riga 2 header colonna: filtri fascia scadenza (0-3, 3-6, 6-9, 9-12 mesi) --- */
.rb-scad-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(255,255,255,0.06);
}
.rb-scad-prefix {
    font-size: 0.60rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    font-weight: 600;
    padding-right: 2px;
    white-space: nowrap;
}
.rb-scad-pill {
    padding: 4px 10px;
    background: transparent;
    border: 1px dashed rgba(255,255,255,0.14);
    border-radius: 8px;
    color: #8b8f98;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    transition: all 0.12s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}
.rb-scad-pill:hover {
    background: rgba(255,255,255,0.04);
    color: #ccc;
    border-color: rgba(255,255,255,0.22);
    border-style: solid;
}
.rb-scad-pill.active {
    background: rgba(255,255,255,0.10);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.28);
    font-weight: 700;
}
.rb-scad-pill-count {
    font-size: 0.62rem;
    padding: 1px 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    color: #999;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
    line-height: 1.3;
}
.rb-scad-pill.active .rb-scad-pill-count {
    background: rgba(0,0,0,0.35);
    color: #fff;
}

/* Light mode: bordi + testi coerenti */
body.light-mode .rb-scad-row { border-top-color: rgba(0,0,0,0.06); }
body.light-mode .rb-scad-prefix { color: #999; }
body.light-mode .rb-scad-pill {
    background: transparent;
    border-color: rgba(0,0,0,0.14);
    color: #64748b;
}
body.light-mode .rb-scad-pill:hover { background: rgba(0,0,0,0.03); color: #1e293b; border-color: rgba(0,0,0,0.28); }
body.light-mode .rb-scad-pill.active { background: rgba(0,0,0,0.08); color: #0b0c10; border-color: rgba(0,0,0,0.35); }
body.light-mode .rb-scad-pill-count { background: rgba(0,0,0,0.06); color: #64748b; }
body.light-mode .rb-scad-pill.active .rb-scad-pill-count { background: rgba(0,0,0,0.20); color: #fff; }

.rb-col-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rb-empty {
    padding: 24px 10px;
    text-align: center;
    color: #6b7280;
    font-size: 0.78rem;
    line-height: 1.5;
}

.rb-card {
    background: #171923;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 11px 12px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}
.rb-card:hover { border-color: var(--rb-accent, rgba(255,255,255,0.2)); transform: translateY(-1px); }
@keyframes rb-card-enter {
    from { opacity: 0; transform: translateX(-16px) scale(0.98); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
.rb-card--enter { animation: rb-card-enter 0.42s cubic-bezier(0.22, 1, 0.36, 1); }

.rb-card-top { display: flex; gap: 9px; align-items: flex-start; }
.rb-avatar { font-size: 1.2rem; line-height: 1; }
.rb-card-id { min-width: 0; }
.rb-name { font-weight: 600; font-size: 0.82rem; color: #E8E9EB; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-meta { font-size: 0.68rem; color: #8B8F98; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-scad { font-size: 0.72rem; font-weight: 600; margin-top: 8px; }

/* Consulente prominente in card (playground redesign v3) */
.rb-consulente-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; min-width: 0; }
.rb-consulente-avatar {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.2px;
}
.rb-consulente-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #E8E9EB;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.rb-badge-unassigned {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
    font-size: 0.72rem;
    font-weight: 700;
}
body.light-mode .rb-consulente-name { color: #1a1a2e; }
body.light-mode .rb-badge-unassigned { background: rgba(217, 119, 6, 0.12); border-color: rgba(217, 119, 6, 0.35); color: #b45309; }

.rb-card-extra:empty { display: none; }
.rb-card-extra { margin-top: 8px; }

.rb-myboard-btn {
    width: 100%;
    padding: 6px 8px;
    background: rgba(245,158,11,0.1);
    border: 1px dashed rgba(245,158,11,0.4);
    border-radius: 7px;
    color: #f59e0b;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
.rb-myboard-btn:hover { background: rgba(245,158,11,0.18); }
.rb-myboard-form { display: flex; flex-direction: column; gap: 6px; }
.rb-myboard-input {
    width: 100%;
    padding: 6px 8px;
    background: #0e0f14;
    border: 1px solid rgba(245,158,11,0.4);
    border-radius: 6px;
    color: #E8E9EB;
    font-size: 0.75rem;
    outline: none;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}
.rb-myboard-input:focus { border-color: #f59e0b; }
.rb-myboard-actions { display: flex; gap: 6px; }
.rb-myboard-save, .rb-myboard-cancel {
    flex: 1;
    padding: 5px 0;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    border: none;
}
.rb-myboard-save { background: #22c55e; color: #08130c; }
.rb-myboard-save:hover { background: #16a34a; }
.rb-myboard-cancel { background: rgba(255,255,255,0.06); color: #8B8F98; }
.rb-myboard-cancel:hover { color: #E8E9EB; }

.rb-myboard-chip {
    display: inline-block;
    padding: 3px 9px;
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 7px;
    color: #60a5fa;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}
.rb-hint { font-size: 0.65rem; color: #6b7280; margin-top: 6px; font-style: italic; }

.rb-badge-match {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    background: rgba(34,197,94,0.12);
    border: 1px solid rgba(34,197,94,0.3);
    border-radius: 7px;
    color: #22c55e;
    font-size: 0.68rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.rb-dev-btn {
    width: 100%;
    margin-top: 8px;
    padding: 6px 8px;
    background: repeating-linear-gradient(135deg, rgba(167,139,250,0.1), rgba(167,139,250,0.1) 6px, rgba(167,139,250,0.16) 6px, rgba(167,139,250,0.16) 12px);
    border: 1px dashed rgba(167,139,250,0.5);
    border-radius: 7px;
    color: #c4b5fd;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.rb-dev-btn:hover { border-color: #a78bfa; color: #E8E9EB; }
.rb-dev-tag {
    background: #a78bfa;
    color: #1a1023;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.rb-badge-esito {
    text-align: center;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}
.rb-badge-esito.confermato { background: rgba(34,197,94,0.15); color: #22c55e; border: 1px solid rgba(34,197,94,0.35); }
.rb-badge-esito.perso { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.35); }
.rb-badge-esito.archiviato { background: rgba(107,114,128,0.15); color: #9ca3af; border: 1px solid rgba(107,114,128,0.3); font-style: italic; }

/* Badge esito attivazione (colonna 4) — sempre visibile, compatto, sopra la card-extra */
.rb-badge-att {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    margin: 4px 0 0 0;
}
.rb-badge-att.approvata { background: rgba(52,211,153,0.15); color: #34d399; }
.rb-badge-att.condizione { background: rgba(251,191,36,0.15); color: #fbbf24; }
.rb-badge-att.senza-contratto { background: rgba(56,189,248,0.15); color: #38bdf8; }
.rb-badge-att.info-mancanti { background: rgba(251,146,60,0.15); color: #fb923c; }
.rb-badge-att.garanzia { background: rgba(167,139,250,0.15); color: #a78bfa; }
.rb-badge-att.in-corso { background: rgba(255,255,255,0.08); color: #999; }

/* Connettore a freccia tra colonne (indicatore di flusso 1→2→3→4→5) */
.rb-connector {
    flex: 0 0 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    color: rgba(255,255,255,0.18);
    font-size: 1rem;
    position: relative;
}
.rb-connector::before {
    content: '';
    position: absolute;
    top: 34px;
    left: 0;
    right: 0;
    border-top: 1px dashed rgba(255,255,255,0.12);
}
.rb-connector span { position: relative; background: transparent; z-index: 1; margin-top: 34px; }

/* Selettore colonne mobile (sotto i 768px) */
.rb-mobile-tab {
    padding: 7px 10px;
    background: #12141A;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #8B8F98;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    white-space: nowrap;
}
.rb-mobile-tab.active { border-color: #3B82F6; color: #E8E9EB; background: rgba(59,130,246,0.1); }
.rb-mobile-tab-count {
    font-size: 0.62rem;
    opacity: 0.85;
    background: rgba(255,255,255,0.08);
    padding: 0 5px;
    border-radius: 8px;
}

/* Responsive: sotto 1400px le 5 colonne (300px) + connector non ci stanno più
   nel viewport disponibile — la board scrolla orizzontalmente, le colonne
   mantengono la loro larghezza fissa (nessuno shrink, vedi .rb-col sopra). */

/* Responsive: sotto 768px, una colonna alla volta con selettore in alto (scrollabile) */
@media (max-width: 767px) {
    /* Sotto 767px il column-selector mostra una sola colonna a piena larghezza:
       niente più "a misura di contenuto" (quello è per il layout desktop a colonne fisse). */
    .rinnovi-board { overflow-x: hidden; flex-direction: column; width: 100%; max-width: 100%; margin: 0; }
    .rb-mobile-tabs { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; padding-bottom: 4px; }
    .rb-connector { display: none; }
    .rb-col { display: none; max-height: none; }
    /* In flex-direction:column il main-axis è verticale: "width" (cross-axis) va forzata
       esplicitamente a 100%, altrimenti resta quella desktop (300px) ereditata sopra
       (min-width/max-width vanno resettati per lo stesso motivo). */
    .rb-col.rb-col--mobileactive { display: flex; width: 100%; min-width: 0; max-width: 100%; flex: 1 1 auto; }
}

/* Light mode board rinnovi */
body.light-mode .rb-col { background: #fff; border-color: #e2e4e9; }
body.light-mode .rb-col-head { background: linear-gradient(180deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0) 100%); border-color: #e2e4e9; }
body.light-mode .rb-col-title { color: #1a1a2e; }
body.light-mode .rb-col-desc { color: #64748b; }
body.light-mode .rb-card { background: #f8f9fb; border-color: #e2e4e9; }
body.light-mode .rb-name { color: #1a1a2e; }
body.light-mode .rb-meta { color: #64748b; }
body.light-mode .rb-chip { background: rgba(0,0,0,0.03); color: #64748b; border-color: #e2e4e9; }
body.light-mode .rb-mobile-tab { background: #fff; border-color: #e2e4e9; color: #64748b; }
body.light-mode .rb-myboard-input { background: #fff; color: #1a1a2e; }

/* =========================================================================
 * INTEGRAZIONE UX COPY + A11Y — Board Rinnovi (playground)
 * Vedi: tl/ux-content.js (window.UX_CONTENT) e tl/a11y-kanban.js (window.A11Y_KANBAN)
 * I css tokens critici (focus-visible, reduced-motion, skip-links, forced-colors)
 * vengono iniettati a runtime da index.html come <style id="a11y-styles">
 * leggendo A11Y_KANBAN.cssTokens.all — qui sotto solo lo stile "di prodotto".
 * ========================================================================= */

/* Empty state strutturato (title/message/hint) */
.rb-empty-title { font-weight: 700; color: #9ca3af; margin-bottom: 4px; }
.rb-empty-message { color: #6b7280; }
.rb-empty .empty-hint { display: block; margin-top: 8px; color: #6b7280; font-style: italic; opacity: 0.85; }
.rb-empty--filtered { color: #f59e0b; }
body.light-mode .rb-empty-title { color: #475569; }

/* Hint sotto l'input MyBoard */
.rb-myboard-help { font-size: 0.64rem; color: #6b7280; font-style: italic; margin-top: -2px; }

/* Badge "N giorni senza contatto" (col2) */
.rb-days-contact { font-size: 0.66rem; color: #f59e0b; margin-top: 6px; }

/* Toast board (successo/errore/info) */
.board-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.board-toast {
    min-width: 240px;
    max-width: 360px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.board-toast--show { opacity: 1; transform: translateY(0); }
.board-toast--success { background: #16a34a; }
.board-toast--error { background: #dc2626; }
.board-toast--info { background: #374151; }

/* Mini-onboarding (tour first-visit) */
.rb-onboarding-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100001; }
.rb-onboarding-tooltip {
    position: fixed;
    width: 300px;
    max-width: calc(100vw - 24px);
    background: #171923;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    color: #E8E9EB;
}
.rb-onboarding-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 6px; }
.rb-onboarding-content { font-size: 0.8rem; color: #b8bcc4; line-height: 1.45; margin-bottom: 14px; }
.rb-onboarding-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rb-onboarding-skip { background: none; border: none; color: #8B8F98; font-size: 0.76rem; cursor: pointer; font-family: 'Inter', sans-serif; }
.rb-onboarding-skip:hover { color: #E8E9EB; text-decoration: underline; }
.rb-onboarding-next {
    padding: 7px 16px;
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
.rb-onboarding-next:hover { background: #2563eb; }

/* Link "Rivedi tour" sotto la board */
.rb-tour-relaunch { text-align: center; margin-top: 10px; }
.rb-tour-relaunch a { font-size: 0.72rem; color: #8B8F98; text-decoration: none; }
.rb-tour-relaunch a:hover { color: #60a5fa; text-decoration: underline; }

/* =========================================================================
 * KPI STRIP COMPATTA (playground redesign v2)
 * Sostituisce .fl-kpi-hero + le 2x .fl-kpi-section nella sub-view Rinnovi:
 * 9 celle in un'unica fascia orizzontale, altezza max ~90px (contro i ~370px
 * dei blocchi precedenti). Le regole originali .fl-kpi-hero / .fl-kpi-section /
 * .fl-kpi-mini restano intatte sopra: potrebbero essere in uso altrove
 * (es. .fl-tab-flotta) — qui si aggiunge soltanto, non si rimuove nulla.
 * ========================================================================= */
.fl-kpi-strip {
    display: flex;
    align-items: stretch;
    background: #12141A;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    margin-bottom: 16px;
    /* overflow:hidden invece di auto: con auto il flex "vede spazio infinito"
       e le celle mantengono la loro min-content (~200px cad × 9 = sforare) */
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.fl-kpi-cell {
    flex: 1 1 0;
    min-width: 0;   /* fondamentale: permette al flex di ignorare min-content del testo */
    padding: 12px 8px;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
}
.fl-kpi-cell:last-child { border-right: none; }
.fl-kpi-cell-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: #E8E9EB;
    line-height: 1.15;
    font-family: 'Inter', sans-serif;
}
.fl-kpi-cell-lbl {
    font-size: 0.62rem;
    font-weight: 500;
    color: #8B8F98;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    /* Le label lunghe come "SCAD. IPOTETICA" possono wrappare su 2 righe se serve */
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    text-align: center;
}

/* Gerarchia: Pendenti + Tasso Rinnovo restano le celle "hero" (più grandi/rilevanti) */
.fl-kpi-cell--hero {
    flex: 1.4 1 0;
    min-width: 110px;
    padding: 14px 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0) 100%);
}
.fl-kpi-cell--hero .fl-kpi-cell-val { font-size: 1.9rem; font-weight: 800; }
.fl-kpi-cell--hero .fl-kpi-cell-lbl { font-size: 0.68rem; }

/* Colori semantici esistenti, invariati rispetto ai blocchi originali */
.fl-kpi-cell--orange .fl-kpi-cell-val { color: #f59e0b; }
.fl-kpi-cell--blue .fl-kpi-cell-val { color: #3b82f6; }
.fl-kpi-cell--green .fl-kpi-cell-val { color: #22c55e; }
.fl-kpi-cell--red .fl-kpi-cell-val { color: #ef4444; }
.fl-kpi-cell--gray .fl-kpi-cell-val { color: #6b7280; }
.fl-kpi-cell--purple .fl-kpi-cell-val { color: #a78bfa; }

/* Sotto 1200px: scroll orizzontale con snap (coerente con la board sotto) */
@media (max-width: 1200px) {
    .fl-kpi-strip { scroll-snap-type: x mandatory; }
    .fl-kpi-cell { scroll-snap-align: start; min-width: 100px; }
    .fl-kpi-cell--hero { min-width: 130px; }
}

/* Sotto 768px: griglia 3x3 */
@media (max-width: 768px) {
    .fl-kpi-strip { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; }
    .fl-kpi-cell {
        min-width: 0;
        border-right: 1px solid rgba(255,255,255,0.06);
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .fl-kpi-cell:nth-child(3n) { border-right: none; }
    .fl-kpi-cell:nth-last-child(-n+3) { border-bottom: none; }
    .fl-kpi-cell--hero { flex: 1 1 0; padding: 12px 10px; }
    .fl-kpi-cell--hero .fl-kpi-cell-val { font-size: 1.5rem; }
}

/* =========================================================================
 * FILTRO CONSULENTE PER COLONNA BOARD (playground redesign v2)
 * Input compatto tra i chip filtri e il body della colonna. Vedi flotta.js:
 * _boardConsulenteInputHtml / flottaBoardSetConsulenteFilter.
 * ========================================================================= */
.rb-consulente-filter {
    position: relative;
    margin-top: 8px;
}
.rb-consulente-input {
    width: 100%;
    height: 28px;
    padding: 0 26px 0 10px;
    background: #0e0f14;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    color: #E8E9EB;
    font-size: 0.72rem;
    outline: none;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}
.rb-consulente-input::placeholder { color: #6b7280; }
.rb-consulente-input:focus { border-color: var(--rb-accent, #3B82F6); }
.rb-consulente-clear {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #8B8F98;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    font-family: 'Inter', sans-serif;
}
.rb-consulente-clear:hover { color: #ef4444; background: rgba(239,68,68,0.12); }

/* ============================================================
   SEZIONE PERSI (collapsible sotto la board) — 2026-09-08
   Portata dal playground: bar Volt rosso-tenue + glass panel
   con tabella compatta. Default chiusa, un click apre.
   ============================================================ */
.rp-persi-section{
    margin-top:28px;
    font-family:'Sofia Pro','Inter',sans-serif;
}
.rp-persi-toggle{
    display:flex; align-items:center; gap:14px;
    width:100%;
    padding:14px 22px;
    background:rgba(239,68,68,0.055);
    border:1px solid rgba(239,68,68,0.20);
    border-radius:14px;
    color:#f0f2f7;
    font-family:inherit;
    font-size:14px; font-weight:500;
    cursor:pointer;
    text-align:left;
    transition:background 0.15s ease, border-color 0.15s ease;
}
.rp-persi-toggle:hover{
    background:rgba(239,68,68,0.11);
    border-color:rgba(239,68,68,0.35);
}
.rp-persi-toggle:focus-visible{
    outline:2px solid rgba(239,68,68,0.55);
    outline-offset:2px;
}
.rp-persi-caret{
    display:inline-block;
    color:#ef4444;
    font-size:12px;
    transition:transform 0.2s ease;
    width:12px;
    text-align:center;
}
.rp-persi-section[data-open="true"] .rp-persi-caret{
    transform:rotate(90deg);
}
.rp-persi-title{ flex:1; letter-spacing:0.3px; }
.rp-persi-count{
    background:rgba(239,68,68,0.16);
    color:#f87171;
    padding:3px 12px;
    border-radius:999px;
    font-family:'JetBrains Mono',ui-monospace,monospace;
    font-size:11px; letter-spacing:1.5px;
    min-width:32px; text-align:center;
    border:1px solid rgba(239,68,68,0.25);
}
.rp-persi-panel{
    margin-top:14px;
    background:rgba(18,20,26,0.55);
    backdrop-filter:blur(24px) saturate(160%);
    -webkit-backdrop-filter:blur(24px) saturate(160%);
    border:1px solid rgba(255,255,255,0.10);
    border-radius:14px;
    padding:18px;
    box-shadow:0 20px 60px -20px rgba(0,0,0,0.40);
}
.rp-persi-panel[hidden]{ display:none; }
.rp-persi-filters{
    display:flex; gap:10px; margin-bottom:16px;
    flex-wrap:wrap;
}
.rp-persi-search, .rp-persi-select{
    padding:8px 12px;
    background:rgba(0,0,0,0.30);
    border:1px solid rgba(255,255,255,0.10);
    border-radius:8px;
    color:#f0f2f7;
    font-family:inherit;
    font-size:12.5px;
    outline:none;
}
.rp-persi-search:focus, .rp-persi-select:focus{
    border-color:rgba(245,158,11,0.45);
}
.rp-persi-search{ flex:1; min-width:220px; }
.rp-persi-select{ min-width:180px; }
.rp-persi-tbl-wrap{
    overflow-x:auto;
    border-radius:10px;
}
.rp-persi-tbl{
    width:100%;
    border-collapse:collapse;
    font-family:inherit;
    font-size:12.5px;
}
.rp-persi-tbl thead th{
    text-align:left;
    padding:10px 12px;
    color:#8b8f98;
    font-weight:600;
    letter-spacing:0.8px;
    text-transform:uppercase;
    font-size:10px;
    border-bottom:1px solid rgba(255,255,255,0.10);
    background:rgba(0,0,0,0.20);
    position:sticky; top:0;
}
.rp-persi-tbl thead th.rp-persi-num{ text-align:right; }
.rp-persi-tbl tbody tr{
    border-bottom:1px solid rgba(255,255,255,0.05);
    cursor:pointer;
    transition:background 0.12s ease;
}
.rp-persi-tbl tbody tr:hover{
    background:rgba(255,255,255,0.03);
}
.rp-persi-tbl tbody tr:last-child{ border-bottom:none; }
.rp-persi-tbl tbody td{
    padding:11px 12px;
    color:#e5e7eb;
    vertical-align:middle;
}
.rp-persi-tbl tbody td.rp-persi-num{ text-align:right; font-family:'JetBrains Mono',ui-monospace,monospace; font-size:11.5px; color:#f0f2f7; }
.rp-persi-tbl tbody td strong{
    color:#f7f9ff;
    font-weight:600;
}
.rp-persi-tbl tbody td.rp-persi-muted{
    color:#8b8f98;
}
.rp-persi-empty{
    text-align:center;
    padding:36px 20px;
    color:#6b7280;
    font-style:italic;
}
.rp-motivo-badge{
    display:inline-flex;
    padding:4px 10px;
    border-radius:999px;
    font-size:10px;
    letter-spacing:0.9px;
    text-transform:uppercase;
    font-weight:600;
    white-space:nowrap;
}
.rp-motivo-rinnovo_no{
    background:rgba(239,68,68,0.14);
    color:#f87171;
    border:1px solid rgba(239,68,68,0.28);
}
.rp-motivo-respinta{
    background:rgba(245,158,11,0.14);
    color:#fbbf24;
    border:1px solid rgba(245,158,11,0.28);
}
@media (max-width:900px){
    .rp-persi-filters{ flex-direction:column; }
    .rp-persi-search, .rp-persi-select{ min-width:0; width:100%; }
    .rp-persi-tbl{ font-size:11.5px; }
    .rp-persi-tbl tbody td, .rp-persi-tbl thead th{ padding:8px 10px; }
}
