:root{--bg:#0f0d1a;--surface:#1a1826;--surface2:#252038;--card:#1e1c2e;--border:#2e2a42;--border2:#3d3858;--accent:#9B0033;--accent2:#b8003d;--accent3:#a78bfa;--text:#ffffff;--text2:#e0dcf8;--muted:#a09cbc;--success:#22c55e;--brand:#990a3f;--green:#22c55e;--blue:#6b8fff;--orange:#f97316;--red:#ef4444;--yellow:#eab308;--purple:#a78bfa}
*{margin:0;padding:0;box-sizing:border-box}
body{background:var(--bg);color:var(--text);font-family:'Inter', sans-serif;min-height:100vh;overflow-x:hidden}
body::before{content:'';position:fixed;inset:0;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");pointer-events:none;z-index:0;opacity:.4}
header{position:relative;padding:1.2rem 2rem;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;background:linear-gradient(180deg,rgba(167,139,250,.06) 0%,transparent 100%)}
.logo{font-family:'Inter',sans-serif;font-size:1.1rem;font-weight:800;display:flex;align-items:center;gap:.6rem}
.logo span{color:var(--brand)}
.layout{display:flex;min-height:calc(100vh - 60px)}
aside{width:220px;flex-shrink:0;border-right:1px solid var(--border);padding:1.2rem .8rem;background:var(--surface);overflow-y:auto;position:sticky;top:0;height:calc(100vh - 60px)}
.sidebar-section{font-size:.62rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);padding:.8rem .5rem .3rem;margin-top:.3rem}
.nav-item{display:flex;align-items:center;gap:.5rem;padding:.5rem .6rem;border-radius:7px;cursor:pointer;font-size:.82rem;color:var(--muted);transition:all .15s;margin-bottom:.1rem}
.nav-item:hover{background:var(--card);color:var(--text)}
.nav-item.active{background:var(--brand);color:#fff;font-weight:600}
.nav-item .icon{font-size:.9rem;width:18px;text-align:center}
.nav-badge{margin-left:auto;font-size:.55rem;font-weight:700;padding:.15rem .35rem;border-radius:4px;background:var(--accent);color:#000;letter-spacing:.04em}
main{flex:1;padding:2rem;overflow-y:auto;min-width:0}
.section{display:none;animation:fadeIn .2s ease}
.section.active{display:block}
@keyframes fadeIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media(max-width:768px){
  aside{display:none}
  main{padding:1rem}
  .setup-card,.gen-box{max-width:100%}
  .input-row{flex-direction:column}
  header{padding:.8rem 1rem}
}
.section-title{font-family:'Inter',sans-serif;font-size:1.5rem;font-weight:800;margin-bottom:.25rem}
.section-title span{color:var(--brand)}
.section-sub{font-size:.82rem;color:var(--muted);margin-bottom:1.5rem;line-height:1.5}
.setup-card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:1.2rem;margin-bottom:1rem;max-width:1100px}
.setup-card h3{font-family:'Inter',sans-serif;font-size:.88rem;font-weight:700;margin-bottom:.9rem;color:var(--text)}
/* ─ Accordion Brand sezioni ─ */
.brand-card-accordion .accordion-head{display:flex;align-items:center;justify-content:space-between;cursor:pointer;user-select:none;gap:1rem;margin-bottom:0}
.brand-card-accordion .accordion-head-left{display:flex;align-items:center;gap:.6rem;min-width:0}
.brand-card-accordion .accordion-head h3{margin-bottom:0}
.brand-card-accordion .caret{display:inline-block;font-size:.8rem;transition:transform .2s;color:var(--muted);flex-shrink:0}
.brand-card-accordion.open .caret{transform:rotate(90deg)}
.brand-card-accordion.fixed-open .caret{display:none}
.brand-card-accordion.fixed-open .accordion-head{cursor:default}
.brand-card-accordion .accordion-body{max-height:0;overflow:hidden;transition:max-height .35s ease,padding-top .3s ease;padding-top:0}
.brand-card-accordion.open .accordion-body,.brand-card-accordion.fixed-open .accordion-body{max-height:8000px;padding-top:1rem}
.brand-badge-compilato{font-size:.62rem;padding:.18rem .55rem;border-radius:5px;background:rgba(34,197,94,.15);color:var(--green);border:1px solid rgba(34,197,94,.3);font-weight:700;flex-shrink:0}
.brand-badge-vuoto{font-size:.62rem;padding:.18rem .55rem;border-radius:5px;background:rgba(255,159,67,.15);color:#ff9f43;border:1px solid rgba(255,159,67,.3);font-weight:700;flex-shrink:0}
.brand-badge-livello{font-size:.62rem;padding:.18rem .55rem;border-radius:5px;background:rgba(229,229,229,.1);color:var(--text);border:1px solid rgba(229,229,229,.2);font-weight:700;flex-shrink:0}
.input-group{margin-bottom:.7rem}
/* FEAT-REGOLE-BRAND: pulsanti segmentati */
.rb-seg-group{display:flex;gap:.3rem;flex-wrap:wrap;margin-top:.35rem}
.rb-seg-btn{font-size:.7rem;padding:.28rem .6rem;border-radius:6px;border:1px solid rgba(229,229,229,.2);background:rgba(255,255,255,.04);color:var(--muted);cursor:pointer;transition:all .15s;white-space:nowrap}
.rb-seg-btn:hover{border-color:rgba(229,229,229,.4);color:var(--text)}
.rb-seg-btn.rb-active{background:rgba(155,0,51,.15);border-color:rgba(155,0,51,.5);color:#e55;font-weight:700}
.rb-field-label{font-size:.72rem;font-weight:600;color:var(--muted);margin-bottom:.1rem;margin-top:.6rem}
.input-group label{display:block;font-size:.75rem;font-weight:500;color:var(--muted);margin-bottom:.3rem}
.input-row{display:grid;grid-template-columns:1fr 1fr;gap:.8rem}
input[type=text],input[type=password],textarea,select{width:100%;background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:.5rem .7rem;color:var(--text);font-family:'Inter',sans-serif;font-size:.82rem;outline:none;transition:border-color .2s}
input:focus,textarea:focus,select:focus{border-color:var(--brand)}
textarea{resize:vertical;min-height:80px;line-height:1.5}
select{cursor:pointer}
select option{background:var(--card)}
.btn{display:inline-flex;align-items:center;gap:.4rem;padding:.55rem 1.1rem;border-radius:8px;border:none;cursor:pointer;font-family:'Inter',sans-serif;font-size:.82rem;font-weight:500;transition:all .15s}
.btn-primary{background:var(--brand);color:#fff}
.btn-primary:hover{background:#b01255;transform:translateY(-1px)}
.btn-primary:disabled{opacity:.5;cursor:not-allowed;transform:none}
.btn-secondary{background:var(--card);color:var(--text);border:1px solid var(--border)}
.btn-secondary:hover{border-color:var(--brand);color:var(--brand)}
.btn-sm{padding:.3rem .7rem;font-size:.75rem}
.chip-row{display:flex;flex-wrap:wrap;gap:.4rem}
.chip{padding:.3rem .7rem;border-radius:20px;border:1px solid var(--border);font-size:.75rem;cursor:pointer;transition:all .15s;color:var(--muted)}
.chip.active,.chip:hover{border-color:var(--brand);background:rgba(153,10,63,.12);color:var(--brand)}
.gen-box{background:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden;margin-top:1rem;max-width:1100px}
.gen-header{display:flex;align-items:center;justify-content:space-between;padding:.7rem 1rem;border-bottom:1px solid var(--border);background:var(--surface)}
.gen-title{font-size:.8rem;font-weight:600;font-family:'Inter',sans-serif}
.gen-actions{display:flex;gap:.4rem}
.gen-output{background:var(--surface);padding:1.1rem;min-height:120px;font-size:.85rem;line-height:1.75;color:var(--text);white-space:pre-wrap;font-weight:300;border:1px solid var(--border);border-radius:10px}
.gen-output.empty{color:var(--muted);font-style:italic}
.edit-toolbar{display:flex;align-items:center;justify-content:space-between;padding:.5rem .8rem;background:rgba(153,10,63,.06);border:1px solid rgba(153,10,63,.2);border-top:none;border-radius:0 0 10px 10px;gap:.5rem}
.toast{position:fixed;bottom:1.5rem;right:1.5rem;background:var(--card);border:1px solid var(--border);border-radius:10px;padding:.7rem 1.1rem;font-size:.82rem;z-index:9999;transform:translateY(20px);opacity:0;transition:all .25s;pointer-events:none}
.toast.show{transform:none;opacity:1}
.toast.success{border-color:var(--success);color:var(--success)}
.toast.error{border-color:#ff4444;color:#ff4444}
.toast.info{border-color:var(--accent3);color:var(--accent3)}
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.7);z-index:9998;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .2s}
.modal-overlay.open{opacity:1;pointer-events:all}
.modal{background:var(--card);border:1px solid var(--border);border-radius:14px;padding:1.5rem;width:460px;max-width:90vw}
.modal h3{font-family:'Inter',sans-serif;margin-bottom:1rem;font-size:1rem}
/* Techniques grid */
.techniques-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:.5rem;margin:.5rem 0}
.tech-card{background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:.5rem .4rem;cursor:pointer;transition:all .15s;text-align:center}
.tech-card:hover,.tech-card.active{border-color:var(--brand);background:rgba(153,10,63,.1)}
.tech-card .t-icon{font-size:1rem;margin-bottom:.2rem}
.tech-card .t-name{font-size:.62rem;font-weight:600;color:var(--text)}
/* Tabs */
.tab-row{display:flex;gap:.5rem;margin-bottom:1rem}
.tab-btn{padding:.4rem 1rem;border-radius:7px;border:1px solid var(--border);background:transparent;color:var(--muted);cursor:pointer;font-size:.8rem;font-family:'Inter',sans-serif;transition:all .15s}
.tab-btn.active{background:rgba(153,10,63,.15);border-color:var(--brand);color:var(--brand);font-weight:600}
.tab-content{display:none}
.tab-content.active{display:block}
/* Canvas */
#slideCanvas{width:100%;height:auto;border-radius:8px;border:1px solid var(--border)}
.carousel-workspace{display:grid;grid-template-columns:1fr 320px;gap:1rem;margin-top:1rem}
.carousel-preview-wrap{min-width:0}
.carousel-controls{min-width:0}
.carousel-slides-nav{display:flex;gap:.4rem;margin-bottom:.5rem;flex-wrap:wrap}
.slide-thumb{width:30px;height:30px;border-radius:4px;border:2px solid var(--border);cursor:pointer;transition:all .15s;background:var(--surface);display:flex;align-items:center;justify-content:center;font-size:.65rem;color:var(--muted)}
.slide-thumb.active{border-color:var(--brand);color:var(--brand)}
.ctrl-group{margin-bottom:.7rem}
.ctrl-label{font-size:.7rem;color:var(--muted);margin-bottom:.3rem}
.color-row{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}
.color-swatch{width:22px;height:22px;border-radius:4px;cursor:pointer;border:2px solid transparent;transition:all .15s}
.color-swatch:hover,.color-swatch.active{border-color:var(--text);transform:scale(1.1)}
input[type=color]{width:22px;height:22px;border:none;background:none;cursor:pointer;padding:0}
.status-bozza{background:rgba(112,112,160,.2);color:var(--muted)}
.status-pronto{background:rgba(155,0,51,.15);color:var(--text)}
.status-pubblicato{background:rgba(34,197,94,.15);color:var(--success)}
.status-da.fare{background:rgba(155,0,51,.15);color:var(--accent2)}
/* Voice slider */
input[type=range]{accent-color:var(--brand)}
/* Loading */
.gen-box.loading .gen-output::after{content:'▋';animation:blink .7s steps(1) infinite}
@keyframes blink{0%,100%{opacity:1}50%{opacity:0}}
.spinner{display:inline-block;width:16px;height:16px;border:2px solid var(--border);border-top-color:var(--brand);border-radius:50%;animation:spin .7s linear infinite;vertical-align:middle;margin-right:.4rem}
@keyframes spin{to{transform:rotate(360deg)}}
/* Dashboard cards */
.dash-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.8rem;margin-top:1rem}
.dash-card{background:var(--card);border:1px solid var(--border);border-radius:10px;padding:1rem;cursor:pointer;transition:all .15s}
.dash-card:hover{border-color:var(--brand);transform:translateY(-2px)}
.dc-icon{font-size:1.4rem;margin-bottom:.4rem}
.dc-title{font-size:.85rem;font-weight:600;margin-bottom:.2rem}
.dc-desc{font-size:.72rem;color:var(--muted);line-height:1.4}
/* Piano grid */
#pianoWeekGrid .slot-card{background:var(--surface);border-radius:8px;padding:.8rem .6rem;cursor:pointer;transition:all .2s}
#pianoWeekGrid .slot-card:hover{background:var(--card)}
/* Funnel pills */
.funnel-att{color:var(--text)}
.funnel-fid{color:var(--purple)}
.funnel-conv{color:var(--brand)}
.funnel-story{color:#ff9f43}

/* ── Leva emotiva & Pain toggles ── */
.toggle-row { display:flex; gap:.5rem; flex-wrap:wrap; margin:.5rem 0 .3rem; }
.toggle-pill { display:inline-flex; align-items:center; gap:.35rem; padding:.3rem .75rem; border-radius:20px; font-size:.72rem; cursor:pointer; border:1px solid var(--border); background:var(--surface); color:var(--muted); transition:all .18s; user-select:none; }
.toggle-pill:hover { border-color:var(--brand); color:var(--text); }
.toggle-pill.active { background:rgba(153,10,63,.18); border-color:var(--brand); color:var(--brand); }
.toggle-panel { display:none; padding:.6rem .8rem; background:rgba(153,10,63,.06); border:1px solid rgba(153,10,63,.2); border-radius:10px; margin-bottom:.5rem; }
.toggle-panel.open { display:block; }
.chip-group { display:flex; flex-wrap:wrap; gap:.4rem; margin-top:.4rem; }
.emo-chip, .pain-chip { padding:.25rem .65rem; border-radius:14px; font-size:.72rem; cursor:pointer; border:1px solid var(--border); background:var(--surface); color:var(--muted); transition:all .15s; }
.emo-chip.sel { background:rgba(155,0,51,.15); border-color:var(--text); color:var(--text); }
.pain-chip.sel { background:rgba(34,197,94,.15); border-color:var(--green); color:var(--green); }
.des-chip { padding:.25rem .65rem; border-radius:14px; font-size:.72rem; cursor:pointer; border:1px solid var(--border); background:var(--surface); color:var(--muted); transition:all .15s; }
.des-chip.sel { background:rgba(167,139,250,.15); border-color:var(--purple); color:#a89aff; }
.obj-chip { padding:.25rem .65rem; border-radius:14px; font-size:.72rem; cursor:pointer; border:1px solid var(--border); background:var(--surface); color:var(--muted); transition:all .15s; }
.obj-chip.sel { background:rgba(155,0,51,.15); border-color:var(--orange); color:#ff9060; }

.int-tab-btn { font-size:.75rem;padding:.3rem .8rem;border-radius:7px;border:1px solid var(--border);background:var(--card);color:var(--muted);cursor:pointer; }
.int-tab-btn.active-int { background:var(--brand);color:#fff;border-color:var(--brand); }
.nav-sub { font-size:.75rem;padding:.3rem .5rem .3rem 2rem !important; }


  /* SIDEBAR LOGO */
  .sidebar-logo-wrap {
    display: flex;
    align-items: baseline;
    gap: .3rem;
    padding: .8rem .6rem .9rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .4rem;
  }
  .sidebar-ai-label {
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--muted);
    text-transform: uppercase;
    margin-top: .1rem;
  }
  /* NAV active: fill bordeaux + white text */
  aside .nav-item.active {
    background: var(--brand);
    color: white !important;
    border-radius: 5px;
  }
  aside .nav-item:not(.active) {
    color: var(--muted);
  }
  aside .nav-item:not(.active):hover {
    color: var(--text);
    background: var(--card);
  }

  /* ── ONBOARDING ── */
  .onb-step { animation: fadeInUp .3s ease; }
  @keyframes fadeInUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
  .onb-dot { width:8px;height:8px;border-radius:50%;background:var(--border);transition:all .2s; }
  .onb-dot.active { background:var(--brand);width:20px;border-radius:4px; }
  
  /* ── SEARCH HISTORY ── */
  #historySearch { transition: all .2s; }
  #historySearch:focus { border-color:var(--brand); box-shadow: 0 0 0 2px rgba(153,10,63,.15); }
  
  /* ── EXPORT BUTTON ── */
  .export-btn { font-size:.7rem;background:var(--card);border:1px solid var(--border);color:var(--muted);border-radius:6px;padding:.25rem .6rem;cursor:pointer; }
  .export-btn:hover { background:var(--surface);color:var(--text); }



/* ── PROGRAMMAZIONE SOCIAL ── */
.pfm-tab-panel { }
.pfm-cal-day { background:var(--card);border:1px solid var(--border);border-radius:6px;min-height:80px;padding:.3rem;cursor:default;transition:border-color .15s; }
.pfm-cal-day:hover { border-color:var(--brand); }
.pfm-cal-day.today { border-color:var(--brand);box-shadow:0 0 0 1px var(--brand); }
.pfm-cal-day.outside { opacity:.35; }
.pfm-cal-day .day-num { font-size:.65rem;font-weight:700;color:var(--muted);margin-bottom:.2rem; }
.pfm-cal-day.today .day-num { color:var(--brand); }
.pfm-cal-dot { display:inline-block;width:5px;height:5px;border-radius:50%;margin-right:2px; }
.pfm-cal-item { font-size:.58rem;color:var(--text2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:.1rem .2rem;border-radius:3px;margin-bottom:1px;background:rgba(155,0,51,.08);cursor:pointer; }
.pfm-cal-item:hover { background:rgba(155,0,51,.18); }
.pfm-platform-pill { display:inline-flex;align-items:center;gap:.2rem;padding:.2rem .5rem;border-radius:14px;font-size:.65rem;cursor:pointer;border:1px solid var(--border);background:var(--surface);color:var(--muted);transition:all .15s;user-select:none; }
.pfm-platform-pill.sel { border-color:var(--brand);background:rgba(155,0,51,.12);color:var(--brand); }
.pfm-chip { padding:.22rem .65rem;border-radius:20px;font-size:.72rem;font-weight:500;border:1px solid var(--border);background:transparent;color:var(--muted);cursor:pointer;font-family:'DM Sans',sans-serif;transition:all .12s; }
.pfm-chip.active { background:var(--brand-soft);border-color:var(--brand-mid);color:var(--text); }
.pfm-chip:hover:not(.active) { border-color:var(--border-m);color:var(--text); }

/* Campo API key nascosto per studenti */
.hide-for-student { display: none !important; }

/* ============================================================
   PAGELLA STUDENTE V2 — 25 apr 2026
   Catena 4 stadi · 7 segnali · MA dinamica · Reporter mode
   ============================================================ */
.pagella-v2 { padding: .5rem 0 4rem; }
.pagella-v2 .diag-header { margin-bottom: 1.5rem; }
.pagella-v2 .kicker { font-size: .68rem; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.pagella-v2 h1.diag-title { font-size: 1.6rem; line-height: 1.3; margin: .4rem 0 .8rem; font-weight: 700; }
.pagella-v2 p.diag-subtitle { color: var(--muted); font-size: .92rem; line-height: 1.55; margin: 0; }

.pagella-v2 .chain-container { background: var(--surface); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 1.4rem 1.2rem; margin: 1.5rem 0; }
.pagella-v2 .chain-title { font-size: .72rem; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; margin-bottom: 1rem; font-weight: 600; }
.pagella-v2 .chain { display: grid; grid-template-columns: 1fr 16px 1fr 16px 1fr 16px 1fr; align-items: stretch; gap: 0; }
.pagella-v2 .stage { background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.06); border-radius: 12px; padding: 1rem .85rem; position: relative; transition: all .3s; }
.pagella-v2 .stage.unlocked { border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.05); }
.pagella-v2 .stage.active { border-color: rgba(255,212,0,.4); background: rgba(255,212,0,.06); box-shadow: 0 0 24px rgba(255,212,0,.15); }
.pagella-v2 .stage.pending { opacity: .55; border-style: dashed; }
.pagella-v2 .stage .node { font-size: 1.1rem; font-weight: 800; margin-bottom: .35rem; }
.pagella-v2 .stage.unlocked .node { color: #22C55E; }
.pagella-v2 .stage.active .node { color: #FFD400; }
.pagella-v2 .stage .stage-k { font-size: .58rem; letter-spacing: .12em; color: var(--muted); font-weight: 600; text-transform: uppercase; margin-bottom: .25rem; }
.pagella-v2 .stage .stage-label { font-size: .82rem; color: var(--text); margin-bottom: .55rem; line-height: 1.3; }
.pagella-v2 .stage .stage-progress-bar { height: 5px; background: rgba(255,255,255,.06); border-radius: 99px; overflow: hidden; margin-bottom: .35rem; }
.pagella-v2 .stage .stage-progress-fill { height: 100%; background: var(--brand); border-radius: 99px; transition: width .6s; }
.pagella-v2 .stage.unlocked .stage-progress-fill { background: #22C55E; }
.pagella-v2 .stage.active .stage-progress-fill { background: #FFD400; }
.pagella-v2 .stage .stage-progress-val { font-size: .68rem; color: var(--muted); }
.pagella-v2 .stage .work-tag { display: inline-block; margin-top: .55rem; font-size: .62rem; padding: .15rem .5rem; border-radius: 99px; background: rgba(255,255,255,.06); color: var(--muted); letter-spacing: .04em; }
.pagella-v2 .stage.active .work-tag { background: rgba(255,212,0,.15); color: #FFD400; }
.pagella-v2 .stage.unlocked .work-tag { background: rgba(34,197,94,.12); color: #22C55E; }
.pagella-v2 .stage .here-pill { position: absolute; top: -10px; right: 8px; background: #FFD400; color: #0B0B0D; font-size: .58rem; font-weight: 700; padding: .15rem .5rem; border-radius: 99px; letter-spacing: .06em; }
.pagella-v2 .connector { display: flex; align-items: center; justify-content: center; }
.pagella-v2 .connector::before { content: ''; height: 2px; width: 100%; background: rgba(255,255,255,.08); }
.pagella-v2 .work-split { margin-top: 1rem; padding: .75rem 1rem; background: rgba(155,0,51,.06); border-left: 3px solid var(--brand); border-radius: 6px; font-size: .82rem; color: var(--text); }
.pagella-v2 .work-split b { color: var(--text); }
.pagella-v2 .work-split .frac { color: var(--brand-light, #d1004a); font-weight: 700; }

.pagella-v2 .blocchi-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: 1rem 0; }
.pagella-v2 .blocco-card { background: var(--surface); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 1rem 1.1rem; display: flex; align-items: center; gap: .9rem; }
.pagella-v2 .blocco-card.bi { border-left: 3px solid #F59E0B; }
.pagella-v2 .blocco-card.tempo { border-left: 3px solid #38BDF8; }
.pagella-v2 .blocco-card .b-icon { font-size: 1.4rem; font-weight: 800; flex-shrink: 0; }
.pagella-v2 .blocco-card.bi .b-icon { color: #F59E0B; }
.pagella-v2 .blocco-card.tempo .b-icon { color: #38BDF8; }
.pagella-v2 .blocco-card .b-body { flex: 1; }
.pagella-v2 .blocco-card .b-kicker { font-size: .62rem; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.pagella-v2 .blocco-card .b-headline { font-size: .9rem; font-weight: 600; margin: .2rem 0 .25rem; }
.pagella-v2 .blocco-card .b-meaning { font-size: .76rem; color: var(--muted); line-height: 1.45; }
.pagella-v2 .blocco-card .b-status-pill { font-size: .65rem; padding: .15rem .55rem; border-radius: 99px; font-weight: 700; letter-spacing: .04em; }
.pagella-v2 .blocco-card.bi .b-status-pill.forte { background: rgba(245,158,11,.18); color: #F59E0B; }
.pagella-v2 .blocco-card.bi .b-status-pill.medio { background: rgba(245,158,11,.12); color: #F59E0B; }
.pagella-v2 .blocco-card.tempo .b-status-pill.forte { background: rgba(56,189,248,.18); color: #38BDF8; }
.pagella-v2 .blocco-card.tempo .b-status-pill.medio { background: rgba(56,189,248,.12); color: #38BDF8; }

.pagella-v2 .focus-card { background: var(--surface); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 1.4rem; margin: 1.5rem 0; }
.pagella-v2 .focus-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .8rem; }
.pagella-v2 .focus-head h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.pagella-v2 .focus-head .focus-score { font-size: .82rem; color: var(--muted); }
.pagella-v2 .focus-head .focus-score b { color: var(--text); }
.pagella-v2 .focus-meaning { font-size: .92rem; line-height: 1.6; color: var(--text); margin-bottom: 1rem; }
.pagella-v2 .focus-meaning strong { color: #FFD400; }
.pagella-v2 .cost-line { padding: .75rem 1rem; background: rgba(239,68,68,.06); border-left: 3px solid #ef4444; border-radius: 6px; font-size: .82rem; line-height: 1.5; color: var(--text); margin: 1rem 0; }
.pagella-v2 .cost-line b { color: #ef4444; }

.pagella-v2 .signals-section { margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.06); }
.pagella-v2 .signals-head { margin-bottom: .8rem; }
.pagella-v2 .signals-head h3 { font-size: .95rem; margin: 0 0 .15rem; font-weight: 700; }
.pagella-v2 .signals-hint { font-size: .72rem; color: var(--muted); }
.pagella-v2 .signals-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.pagella-v2 .signal { display: flex; gap: .6rem; padding: .65rem .8rem; background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.06); border-radius: 8px; cursor: pointer; transition: all .15s; align-items: flex-start; }
.pagella-v2 .signal:hover { border-color: rgba(255,255,255,.12); }
.pagella-v2 .signal.active { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.35); }
.pagella-v2 .signal-check { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: .75rem; flex-shrink: 0; color: transparent; }
.pagella-v2 .signal.active .signal-check { background: #22C55E; border-color: #22C55E; color: #0B0B0D; font-weight: 800; }
.pagella-v2 .signal-text { font-size: .8rem; line-height: 1.45; }
.pagella-v2 .signals-meter { margin-top: .8rem; padding: .65rem .9rem; background: rgba(255,255,255,.03); border-radius: 8px; font-size: .78rem; color: var(--muted); }
.pagella-v2 .signals-meter b { color: var(--text); }

.pagella-v2 .action-card { background: linear-gradient(140deg, rgba(155,0,51,.08), rgba(255,212,0,.04)); border: 1px solid rgba(155,0,51,.25); border-radius: 14px; padding: 1.4rem; margin: 1.5rem 0; }
.pagella-v2 .action-kicker { font-size: .65rem; letter-spacing: .1em; color: var(--brand); font-weight: 700; text-transform: uppercase; }
.pagella-v2 .action-card h3 { margin: .35rem 0 .6rem; font-size: 1.15rem; font-weight: 700; }
.pagella-v2 .action-why { font-size: .85rem; line-height: 1.55; color: var(--text); margin: 0 0 .9rem; }
.pagella-v2 .action-why strong { color: #FFD400; }
.pagella-v2 .action-do { font-size: .9rem; line-height: 1.6; color: var(--text); margin: .8rem 0 1.1rem; padding: .75rem 1rem; background: rgba(255,255,255,.03); border-radius: 8px; }
.pagella-v2 .action-buttons { display: flex; gap: .55rem; flex-wrap: wrap; }
.pagella-v2 .action-btn { background: var(--brand); color: #fff; border: none; padding: .65rem 1.1rem; border-radius: 8px; font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .15s; }
.pagella-v2 .action-btn:hover { background: #b30040; transform: translateY(-1px); }
.pagella-v2 .action-btn.secondary { background: transparent; border: 1px solid rgba(255,255,255,.18); color: var(--text); }
.pagella-v2 .action-btn.secondary:hover { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.04); }
.pagella-v2 .reporter-rhythm { margin-top: 1rem; padding: .8rem 1rem; background: rgba(56,189,248,.06); border-left: 3px solid #38BDF8; border-radius: 6px; font-size: .82rem; line-height: 1.5; color: var(--text); }
.pagella-v2 .reporter-rhythm b { color: #38BDF8; }

.pagella-v2 .objection-card { background: var(--surface); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 1.1rem 1.3rem; margin: 1.2rem 0; }
.pagella-v2 .objection-kicker { font-size: .65rem; letter-spacing: .1em; color: var(--muted); font-weight: 600; text-transform: uppercase; margin-bottom: .5rem; }
.pagella-v2 .objection-quote { display: block; padding: .7rem .9rem; background: rgba(255,255,255,.04); border-left: 3px solid var(--brand); border-radius: 6px; margin: .55rem 0; font-style: italic; font-size: .92rem; line-height: 1.5; color: var(--text); }
.pagella-v2 .objection-body { font-size: .82rem; line-height: 1.55; color: var(--muted); }
.pagella-v2 .objection-body strong { color: var(--text); }

.pagella-v2 .coach-note-card { background: var(--surface); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; margin: 1.2rem 0; overflow: hidden; }
.pagella-v2 .coach-note-head { padding: 1rem 1.3rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background .15s; }
.pagella-v2 .coach-note-head:hover { background: rgba(255,255,255,.02); }
.pagella-v2 .coach-note-title { font-weight: 700; font-size: .92rem; }
.pagella-v2 .coach-note-meta { font-size: .72rem; color: var(--muted); }
.pagella-v2 .coach-note-body { padding: 0 1.3rem; max-height: 0; overflow: hidden; transition: all .3s; }
.pagella-v2 .coach-note-card.expanded .coach-note-body { max-height: 1000px; padding: .5rem 1.3rem 1.3rem; }
.pagella-v2 .coach-note-body p { font-size: .85rem; line-height: 1.6; margin: .5rem 0; color: var(--text); white-space: pre-wrap; }

.pagella-v2 .closure { padding: 1.4rem 1.3rem; background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.05); border-radius: 14px; margin-top: 1.5rem; }
.pagella-v2 .closure-tag { font-size: .62rem; letter-spacing: .12em; color: var(--brand); font-weight: 700; text-transform: uppercase; margin-bottom: .55rem; }
.pagella-v2 .closure p { font-size: .92rem; line-height: 1.6; color: var(--text); margin: .55rem 0; }
.pagella-v2 .closure p strong { color: #FFD400; }

/* ── Pagella v2 — blocchi narrativi ibridi (#42) ───────────────── */
.pagella-v2 .block-kicker { font-size: .62rem; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; font-weight: 600; margin-bottom: .65rem; }

.pagella-v2 .scena-hero { background: linear-gradient(140deg, rgba(255,212,0,.05), rgba(255,255,255,.02)); border: 1px solid rgba(255,212,0,.18); border-radius: 14px; padding: 1.5rem 1.4rem; margin: 1.5rem 0; }
.pagella-v2 .scena-kicker { font-size: .62rem; letter-spacing: .12em; color: #FFD400; text-transform: uppercase; font-weight: 700; margin-bottom: .6rem; }
.pagella-v2 .scena-text { font-size: 1.12rem; line-height: 1.6; color: var(--text); font-weight: 500; margin: 0 0 .9rem; }
.pagella-v2 .scena-text .dg-hl { color: #FFD400; font-weight: 700; background: rgba(255,212,0,.1); padding: 0 .2em; border-radius: 4px; }
.pagella-v2 .scena-def { font-size: .9rem; line-height: 1.6; color: var(--muted); margin: 0; }

.pagella-v2 .senti-block { margin: 1.3rem 0; }
.pagella-v2 .senti-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .7rem; }
.pagella-v2 .senti-card { background: var(--surface); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; padding: .9rem 1rem; }
.pagella-v2 .senti-t { font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: .35rem; }
.pagella-v2 .senti-p { font-size: .78rem; line-height: 1.5; color: var(--muted); }

.pagella-v2 .scenari-block { margin: 1.2rem 0; padding-top: 1.1rem; border-top: 1px solid rgba(255,255,255,.06); }
.pagella-v2 .scenari-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.pagella-v2 .scenario { background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.07); border-radius: 10px; padding: .85rem .95rem; }
.pagella-v2 .scenario-h { display: flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: .35rem; }
.pagella-v2 .scenario-badge { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; background: rgba(255,212,0,.15); color: #FFD400; font-size: .7rem; font-weight: 800; flex-shrink: 0; }
.pagella-v2 .scenario-p { font-size: .78rem; line-height: 1.5; color: var(--muted); }
.pagella-v2 .scenari-dist { margin-top: .7rem; padding: .65rem .9rem; background: rgba(255,255,255,.03); border-radius: 8px; font-size: .8rem; line-height: 1.5; color: var(--text); }
.pagella-v2 .scenari-dist b { color: var(--text); }

.pagella-v2 .verifiche-block { margin: 1.2rem 0; padding-top: 1.1rem; border-top: 1px solid rgba(255,255,255,.06); }
.pagella-v2 .verifiche-list { display: flex; flex-direction: column; gap: .55rem; }
.pagella-v2 .verifica { display: flex; gap: .7rem; align-items: flex-start; }
.pagella-v2 .verifica-n { flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; background: rgba(155,0,51,.15); color: var(--brand-light, #d1004a); font-size: .72rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.pagella-v2 .verifica-body { flex: 1; }
.pagella-v2 .verifica-t { font-size: .82rem; font-weight: 700; color: var(--text); }
.pagella-v2 .verifica-q { font-size: .8rem; line-height: 1.5; color: var(--muted); }
.pagella-v2 .verifiche-test { margin-top: .8rem; padding: .7rem .9rem; background: rgba(56,189,248,.06); border-left: 3px solid #38BDF8; border-radius: 6px; font-size: .8rem; line-height: 1.5; color: var(--text); }
.pagella-v2 .verifiche-test b { color: #38BDF8; }

.pagella-v2 .esci-close { margin-top: .9rem; padding: .75rem .95rem; background: rgba(34,197,94,.05); border-left: 3px solid #22C55E; border-radius: 6px; font-size: .82rem; line-height: 1.55; color: var(--text); font-style: italic; }

.pagella-v2 .voci-block { margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid rgba(255,255,255,.06); }
.pagella-v2 .voce { font-size: .85rem; line-height: 1.5; color: var(--text); font-style: italic; padding: .55rem .85rem; background: rgba(255,255,255,.03); border-left: 3px solid rgba(255,255,255,.15); border-radius: 4px; margin-bottom: .5rem; }

.pagella-v2 .scelta-block { margin: 1.3rem 0; }
.pagella-v2 .scelta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.pagella-v2 .scelta-col { border-radius: 12px; padding: 1rem 1.1rem; border: 1px solid rgba(255,255,255,.08); }
.pagella-v2 .scelta-col.solo { background: rgba(255,255,255,.02); }
.pagella-v2 .scelta-col.noi { background: rgba(155,0,51,.06); border-color: rgba(155,0,51,.25); }
.pagella-v2 .scelta-h { font-size: .82rem; font-weight: 700; color: var(--text); margin-bottom: .4rem; }
.pagella-v2 .scelta-col.noi .scelta-h { color: var(--brand-light, #d1004a); }
.pagella-v2 .scelta-p { font-size: .8rem; line-height: 1.55; color: var(--muted); }

@media (max-width: 768px) {
  .pagella-v2 .chain { grid-template-columns: 1fr; gap: .5rem; }
  .pagella-v2 .connector { display: none; }
  .pagella-v2 .blocchi-row { grid-template-columns: 1fr; }
  .pagella-v2 .signals-grid { grid-template-columns: 1fr; }
  .pagella-v2 .senti-grid { grid-template-columns: 1fr; }
  .pagella-v2 .scenari-grid { grid-template-columns: 1fr; }
  .pagella-v2 .scelta-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   VISTA COACH ESTESA — 25 apr 2026
   Sub-dim per stadio, BI dettaglio, blocco tempo, brand+quotes
   ============================================================ */
.coach-ext { padding: .5rem 0; }
.coach-ext .ce-section-title { font-size: .65rem; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; font-weight: 600; margin: 1.2rem 0 .6rem; }
.coach-ext .ce-chain { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-bottom: 1rem; }
.coach-ext .ce-lvl-card { background: var(--surface); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: .9rem .85rem; position: relative; }
.coach-ext .ce-lvl-card.active { border-color: rgba(255,212,0,.4); background: rgba(255,212,0,.05); }
.coach-ext .ce-lvl-card.unlocked { border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.04); }
.coach-ext .ce-lvl-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; }
.coach-ext .ce-lvl-k { font-size: .58rem; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.coach-ext .ce-lvl-state { font-size: .58rem; padding: .1rem .45rem; border-radius: 99px; font-weight: 700; letter-spacing: .04em; }
.coach-ext .ce-lvl-state.active { background: rgba(255,212,0,.18); color: #FFD400; }
.coach-ext .ce-lvl-state.unlocked { background: rgba(34,197,94,.15); color: #22C55E; }
.coach-ext .ce-lvl-state.pending { background: rgba(255,255,255,.05); color: var(--muted); }
.coach-ext .ce-lvl-name { font-size: .82rem; font-weight: 600; margin-bottom: .35rem; }
.coach-ext .ce-lvl-score { font-size: 1.4rem; font-weight: 800; color: var(--text); margin-bottom: .55rem; }
.coach-ext .ce-lvl-score small { font-size: .7rem; color: var(--muted); font-weight: 500; }
.coach-ext .ce-sub-dim { display: flex; flex-direction: column; gap: .25rem; margin-top: .55rem; padding-top: .55rem; border-top: 1px solid rgba(255,255,255,.05); }
.coach-ext .ce-sub-row { display: flex; justify-content: space-between; align-items: center; font-size: .68rem; }
.coach-ext .ce-sub-label { color: var(--muted); }
.coach-ext .ce-sub-val { font-weight: 700; padding: .1rem .4rem; border-radius: 4px; font-size: .65rem; }
.coach-ext .ce-sub-val.zero { background: rgba(239,68,68,.15); color: #ef4444; }
.coach-ext .ce-sub-val.low { background: rgba(255,176,32,.15); color: #FFB020; }
.coach-ext .ce-sub-val.mid { background: rgba(96,165,250,.15); color: #60A5FA; }
.coach-ext .ce-sub-val.high { background: rgba(34,197,94,.15); color: #22C55E; }

.coach-ext .ce-blocco { background: var(--surface); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 1rem 1.2rem; margin: .8rem 0; display: flex; align-items: center; gap: 1rem; }
.coach-ext .ce-blocco.bi { border-left: 3px solid #F59E0B; }
.coach-ext .ce-blocco.tempo { border-left: 3px solid #38BDF8; }
.coach-ext .ce-blocco.vendita { border-left: 3px solid #D1004A; }
.coach-ext .ce-blocco-icon { font-size: 1.5rem; font-weight: 800; flex-shrink: 0; }
.coach-ext .ce-blocco.bi .ce-blocco-icon { color: #F59E0B; }
.coach-ext .ce-blocco.tempo .ce-blocco-icon { color: #38BDF8; }
.coach-ext .ce-blocco.vendita .ce-blocco-icon { color: #D1004A; }
.coach-ext .ce-blocco-body { flex: 1; }
.coach-ext .ce-blocco-kicker { font-size: .62rem; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.coach-ext .ce-blocco-headline { font-size: .92rem; font-weight: 600; margin: .2rem 0 .25rem; }
.coach-ext .ce-blocco-meaning { font-size: .76rem; color: var(--muted); line-height: 1.45; }
.coach-ext .ce-blocco-score-big { font-size: 1.6rem; font-weight: 800; line-height: 1; flex-shrink: 0; }
.coach-ext .ce-blocco.bi .ce-blocco-score-big { color: #F59E0B; }
.coach-ext .ce-blocco.tempo .ce-blocco-score-big { color: #38BDF8; }
.coach-ext .ce-blocco-score-big small { display: block; font-size: .55rem; letter-spacing: .15em; color: var(--muted); margin-top: .2rem; font-weight: 700; }

.coach-ext .ce-bi-details { background: var(--surface); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; margin: .6rem 0; overflow: hidden; }
.coach-ext .ce-bi-details-head { padding: .85rem 1.1rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background .15s; }
.coach-ext .ce-bi-details-head:hover { background: rgba(255,255,255,.02); }
.coach-ext .ce-bi-details-head .ce-bi-title { font-size: .82rem; font-weight: 600; }
.coach-ext .ce-bi-details-head .ce-bi-toggle { font-size: .7rem; color: var(--muted); }
.coach-ext .ce-bi-details-body { padding: 0 1.1rem; max-height: 0; overflow: hidden; transition: all .3s; }
.coach-ext .ce-bi-details.expanded .ce-bi-details-body { max-height: 1500px; padding: .5rem 1.1rem 1.1rem; }
.coach-ext .ce-bi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.coach-ext .ce-bi-q { padding: .55rem .75rem; background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.06); border-radius: 8px; }
.coach-ext .ce-bi-q.high { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.05); }
.coach-ext .ce-bi-q .q { font-size: .68rem; color: var(--muted); margin-bottom: .25rem; line-height: 1.4; }
.coach-ext .ce-bi-q .a { font-size: .8rem; font-weight: 600; }
.coach-ext .ce-bi-q .a b { color: #F59E0B; }

.coach-ext .ce-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin: 1rem 0; }
.coach-ext .ce-brand-ctx, .coach-ext .ce-quotes { background: var(--surface); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 1rem 1.1rem; }
.coach-ext .ce-brand-ctx h3, .coach-ext .ce-quotes h3 { font-size: .82rem; margin: 0 0 .7rem; font-weight: 700; }
.coach-ext .ce-brand-field { margin-bottom: .55rem; padding-bottom: .55rem; border-bottom: 1px solid rgba(255,255,255,.04); }
.coach-ext .ce-brand-field:last-child { border-bottom: none; }
.coach-ext .ce-brand-field .k { font-size: .62rem; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; font-weight: 600; margin-bottom: .2rem; }
.coach-ext .ce-brand-field .v { font-size: .76rem; line-height: 1.45; color: var(--text); }
.coach-ext .ce-quote { margin-bottom: .8rem; padding-bottom: .8rem; border-bottom: 1px solid rgba(255,255,255,.04); }
.coach-ext .ce-quote:last-child { border-bottom: none; }
.coach-ext .ce-quote-label { font-size: .62rem; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; font-weight: 600; margin-bottom: .35rem; }
.coach-ext .ce-quote-text { font-size: .8rem; line-height: 1.5; color: var(--text); padding: .55rem .75rem; background: rgba(255,255,255,.03); border-left: 3px solid var(--brand); border-radius: 4px; font-style: italic; }
.coach-ext .ce-quote-meta { font-size: .68rem; color: var(--muted); margin-top: .35rem; font-style: italic; }

/* Header studente esteso (25 apr 2026 — polish vista coach) */
.coach-ext-header { display: flex; align-items: flex-start; gap: .8rem; padding: .2rem 0 1rem; border-bottom: 1px solid rgba(255,255,255,.06); margin-bottom: 1rem; }
.coach-ext-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #9B0033, #6b002a); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem; letter-spacing: .03em; flex-shrink: 0; }
.coach-ext-headinfo { flex: 1; min-width: 0; }
.coach-ext-nameline { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .25rem; }
.coach-ext-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.coach-ext-email { font-size: .76rem; color: var(--muted); }
.coach-ext-meta { font-size: .72rem; color: var(--muted); line-height: 1.5; }
.coach-ext-meta b { color: var(--text); font-weight: 600; }
.coach-ext-status { font-size: .58rem; padding: .25rem .6rem; border-radius: 99px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; flex-shrink: 0; }
.coach-ext-status.pending { background: rgba(255,176,32,.15); color: #FFB020; border: 1px solid rgba(255,176,32,.3); }
.coach-ext-status.approved { background: rgba(34,197,94,.15); color: #22C55E; border: 1px solid rgba(34,197,94,.3); }
.coach-ext-status.review { background: rgba(239,68,68,.15); color: #ef4444; border: 1px solid rgba(239,68,68,.3); }

/* Sub-legend "COSA MISURA CIASCUNA" + badge scavo */
.coach-ext .ce-sub-legend { margin-top: .6rem; padding-top: .55rem; border-top: 1px dashed rgba(255,255,255,.06); }
.coach-ext .ce-sub-legend-kicker { font-size: .55rem; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; font-weight: 600; margin-bottom: .35rem; }
.coach-ext .ce-sub-legend-row { display: grid; grid-template-columns: 100px 1fr; gap: .4rem; font-size: .62rem; line-height: 1.35; margin-bottom: .25rem; }
.coach-ext .ce-sub-legend-row .lk { color: var(--text); font-weight: 600; }
.coach-ext .ce-sub-legend-row .lv { color: var(--muted); }
.coach-ext .ce-scavo-badge { margin-top: .55rem; font-size: .55rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; padding: .25rem .5rem; border-radius: 4px; display: inline-block; }
.coach-ext .ce-scavo-badge.on { background: rgba(34,197,94,.12); color: #22C55E; border: 1px solid rgba(34,197,94,.25); }
.coach-ext .ce-scavo-badge.off { background: rgba(255,255,255,.03); color: var(--muted); border: 1px solid rgba(255,255,255,.06); }

/* AI Panel viola — Livello B (25 apr 2026 sera) */
#aiAnalysisPanel {
  background: linear-gradient(180deg, rgba(139,92,246,.08), rgba(139,92,246,.03));
  border: 1px solid rgba(167,139,250,.3);
  border-radius: 14px;
  padding: 1.2rem 1.3rem;
  margin: 1rem 0 1.2rem;
  position: relative;
}
#aiAnalysisPanel.loading::after {
  content: ''; position: absolute; inset: 0; border-radius: 14px;
  background: linear-gradient(90deg, transparent, rgba(167,139,250,.08), transparent);
  background-size: 200% 100%; animation: aiShimmer 1.5s infinite;
  pointer-events: none;
}
@keyframes aiShimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
#aiAnalysisPanel .ai-kicker {
  font-size: .58rem; letter-spacing: .14em; color: #a78bfa;
  text-transform: uppercase; font-weight: 700; margin-bottom: .5rem;
  display: flex; align-items: center; gap: .35rem;
}
#aiAnalysisPanel .ai-headline {
  font-size: 1rem; font-weight: 700; color: var(--text);
  margin-bottom: .55rem; line-height: 1.4;
}
#aiAnalysisPanel .ai-headline em { color: #a78bfa; font-style: normal; font-weight: 700; }
#aiAnalysisPanel .ai-reasoning {
  font-size: .82rem; line-height: 1.55; color: var(--text2);
  margin-bottom: 1rem;
}
#aiAnalysisPanel .ai-reasoning b, #aiAnalysisPanel .ai-reasoning strong { color: var(--text); }
#aiAnalysisPanel .ai-blocks {
  display: grid; grid-template-columns: 1fr 1fr; gap: .8rem;
  margin-top: .3rem;
}
#aiAnalysisPanel .ai-block {
  background: rgba(0,0,0,.25); border: 1px solid rgba(167,139,250,.15);
  border-radius: 10px; padding: .85rem 1rem;
}
#aiAnalysisPanel .ai-block-kicker {
  font-size: .56rem; letter-spacing: .12em; color: #a78bfa;
  text-transform: uppercase; font-weight: 700; margin-bottom: .45rem;
}
#aiAnalysisPanel .ai-block-body {
  font-size: .8rem; line-height: 1.5; color: var(--text);
}
#aiAnalysisPanel .ai-block-body em { color: var(--text2); font-style: italic; }
#aiAnalysisPanel .ai-error {
  font-size: .8rem; color: #ef4444; padding: .8rem 1rem;
  background: rgba(239,68,68,.05); border: 1px solid rgba(239,68,68,.2);
  border-radius: 8px;
}
#aiAnalysisPanel .ai-loading-msg {
  font-size: .85rem; color: var(--text2); padding: .5rem 0;
  display: flex; align-items: center; gap: .55rem;
}
#aiAnalysisPanel .ai-spinner {
  width: 14px; height: 14px; border: 2px solid rgba(167,139,250,.2);
  border-top-color: #a78bfa; border-radius: 50%;
  animation: aiSpin .8s linear infinite;
}
@keyframes aiSpin { to { transform: rotate(360deg); } }

#aiActionRow {
  display: flex; gap: .5rem; flex-wrap: wrap; align-items: center;
  margin-top: .8rem; margin-bottom: .3rem;
}
.btn-ai {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  border: 1px solid rgba(167,139,250,.35);
  color: #fff; padding: .5rem 1rem; border-radius: 8px;
  font-size: .78rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: .35rem;
  transition: all .18s; letter-spacing: .01em;
}
.btn-ai:hover { box-shadow: 0 0 0 3px rgba(139,92,246,.15); transform: translateY(-1px); }
.btn-ai:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ai-ghost {
  background: transparent; border: 1px solid rgba(167,139,250,.3);
  color: #a78bfa; padding: .5rem .9rem; border-radius: 8px;
  font-size: .76rem; font-weight: 600; cursor: pointer;
}
.btn-ai-ghost:hover { background: rgba(167,139,250,.08); }

@media (max-width: 720px) {
  #aiAnalysisPanel .ai-blocks { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .coach-ext .ce-chain { grid-template-columns: 1fr 1fr; }
  .coach-ext .ce-two-col { grid-template-columns: 1fr; }
  .coach-ext .ce-bi-grid { grid-template-columns: 1fr; }
}

/* Lista diagnosi coach — filtro tabs + riga compatta (25 apr 2026) */
.diag-list-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; padding-bottom: .9rem; border-bottom: 1px solid var(--border); }
.diag-list-tab { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: .4rem .85rem; border-radius: 99px; font-size: .76rem; font-weight: 600; cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; gap: .4rem; }
.diag-list-tab:hover { color: var(--text); border-color: rgba(255,255,255,.2); }
.diag-list-tab.active { background: rgba(155,0,51,.12); border-color: var(--brand); color: var(--brand); }
.diag-list-tab .count { background: rgba(255,255,255,.06); color: inherit; padding: .1rem .45rem; border-radius: 99px; font-size: .68rem; font-weight: 700; }
.diag-list-tab.active .count { background: rgba(155,0,51,.18); }

.diag-row { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1.1rem; margin-bottom: .55rem; display: flex; align-items: center; gap: 1rem; cursor: pointer; transition: all .12s; }
.diag-row:hover { border-color: rgba(155,0,51,.4); transform: translateX(2px); }
.diag-row-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #9B0033, #6b002a); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .75rem; letter-spacing: .03em; flex-shrink: 0; }
.diag-row-main { flex: 1; min-width: 0; }
.diag-row-nameline { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .25rem; }
.diag-row-name { font-size: .9rem; font-weight: 700; color: var(--text); }
.diag-row-email { font-size: .72rem; color: var(--muted); }
.diag-row-meta { font-size: .7rem; color: var(--muted); line-height: 1.4; }
.diag-row-meta b { color: var(--text2); font-weight: 600; }
.diag-row-status { font-size: .56rem; padding: .25rem .6rem; border-radius: 99px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; flex-shrink: 0; white-space: nowrap; }
.diag-row-status.in_attesa { background: rgba(255,176,32,.15); color: #FFB020; border: 1px solid rgba(255,176,32,.3); }
.diag-row-status.approvata { background: rgba(34,197,94,.15); color: #22C55E; border: 1px solid rgba(34,197,94,.3); }
.diag-row-status.da_rivedere { background: rgba(239,68,68,.15); color: #ef4444; border: 1px solid rgba(239,68,68,.3); }
.diag-row-cta { font-size: .72rem; color: var(--brand); font-weight: 600; flex-shrink: 0; }

@media (max-width: 640px) {
  .diag-row { flex-wrap: wrap; }
  .diag-row-status { order: -1; }
}

/* ════════════════════════════════════════════════════════════
   DASHBOARD AI & BUSINESS — coach v129 (26 mag 2026 — Fase 2: routing + token tracking; fix sync 400 PGRST102)
   Tutto scopato sotto #section-aidashboard per isolamento totale.
   Palette = variabili :root del coach (identiche al mockup v3).
   ════════════════════════════════════════════════════════════ */
#section-aidashboard .ai-tabs{display:flex;gap:.4rem;margin-bottom:1.4rem;flex-wrap:wrap}
#section-aidashboard .ai-tab{padding:.4rem 1.1rem;border-radius:7px;border:1px solid transparent;background:none;color:var(--muted);font-family:inherit;font-size:.82rem;font-weight:500;cursor:pointer;transition:all .15s;white-space:nowrap}
#section-aidashboard .ai-tab:hover{color:var(--text);background:var(--card)}
#section-aidashboard .ai-tab.active{background:rgba(153,10,63,.15);border-color:var(--brand);color:var(--brand);font-weight:600}
#section-aidashboard .ai-page{display:none}
#section-aidashboard .ai-page.active{display:block}
#section-aidashboard .ai-page-sub{font-size:.82rem;color:var(--muted);margin-bottom:1.4rem;line-height:1.5}

#section-aidashboard .ai-card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:1.3rem 1.5rem;margin-bottom:1.2rem;max-width:1100px}
#section-aidashboard .ai-card h3{font-size:.92rem;font-weight:700;margin-bottom:.25rem;color:var(--text)}
#section-aidashboard .ai-card-sub{font-size:.76rem;color:var(--muted);margin-bottom:1.1rem;line-height:1.5}
#section-aidashboard .ai-info{background:rgba(107,143,255,.08);border-left:3px solid var(--blue);border-radius:6px;padding:.7rem 1rem;font-size:.77rem;color:var(--muted);margin-bottom:1.1rem;line-height:1.6}
#section-aidashboard .ai-info strong{color:var(--text)}

/* Preset */
#section-aidashboard .ai-preset-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.8rem}
#section-aidashboard .ai-preset-btn{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:.9rem 1rem;cursor:pointer;text-align:left;transition:all .15s;width:100%;font-family:inherit}
#section-aidashboard .ai-preset-btn:hover{border-color:var(--brand);transform:translateY(-1px)}
#section-aidashboard .ai-preset-btn.active{border-color:var(--brand);background:rgba(153,10,63,.1)}
#section-aidashboard .ai-preset-name{font-weight:700;font-size:.88rem;margin-bottom:.2rem;color:var(--text)}
#section-aidashboard .ai-preset-desc{color:var(--muted);font-size:.72rem;line-height:1.5;margin-bottom:.4rem}
#section-aidashboard .ai-preset-cost{font-size:.72rem;color:var(--accent2);font-weight:600}

/* Gruppi */
#section-aidashboard .ai-groups-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:.8rem;margin-bottom:1rem}
#section-aidashboard .ai-group-card{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:.9rem 1rem}
#section-aidashboard .ai-group-head{display:flex;align-items:center;gap:.5rem;margin-bottom:.7rem}
#section-aidashboard .ai-group-color{width:14px;height:14px;border-radius:50%;flex-shrink:0;cursor:pointer}
#section-aidashboard .ai-group-name-input{flex:1;background:none;border:none;border-bottom:1px solid transparent;color:var(--text);font-family:inherit;font-size:.84rem;font-weight:600;padding:.15rem 0}
#section-aidashboard .ai-group-name-input:focus{outline:none;border-bottom-color:var(--brand)}
#section-aidashboard .ai-btn-del-group{background:none;border:none;color:var(--muted);cursor:pointer;font-size:.85rem;padding:.1rem .3rem}
#section-aidashboard .ai-btn-del-group:hover{color:var(--red)}
#section-aidashboard .ai-group-preset-label{font-size:.66rem;color:var(--muted);text-transform:uppercase;letter-spacing:.07em;margin-bottom:.4rem}
#section-aidashboard .ai-group-preset-pills{display:flex;gap:.25rem;flex-wrap:wrap}
#section-aidashboard .ai-gpill{padding:.25rem .6rem;border-radius:6px;border:1px solid var(--border);background:var(--card);color:var(--muted);font-size:.7rem;font-family:inherit;cursor:pointer;transition:all .12s}
#section-aidashboard .ai-gpill:hover{border-color:var(--brand);color:var(--text)}
#section-aidashboard .ai-gpill.active{background:rgba(153,10,63,.15);border-color:var(--brand);color:var(--brand);font-weight:600}
#section-aidashboard .ai-group-count{font-size:.7rem;color:var(--muted);margin-top:.6rem}
#section-aidashboard .ai-btn-add-group{background:none;border:1px dashed var(--border);color:var(--muted);border-radius:8px;padding:.5rem 1rem;cursor:pointer;font-size:.78rem;font-family:inherit;transition:all .12s}
#section-aidashboard .ai-btn-add-group:hover{border-color:var(--brand);color:var(--text)}

/* Generatori */
#section-aidashboard .ai-gen-group{font-size:.7rem;color:var(--accent3);text-transform:uppercase;letter-spacing:.07em;font-weight:700;margin:1.1rem 0 .5rem}
#section-aidashboard .ai-gen-row{display:grid;grid-template-columns:1fr auto auto auto;align-items:center;gap:.8rem;padding:.55rem 0;border-bottom:1px solid var(--border)}
#section-aidashboard .ai-gen-name{font-size:.82rem;font-weight:600;color:var(--text)}
#section-aidashboard .ai-gen-desc{font-size:.7rem;color:var(--muted);margin-top:.12rem}
#section-aidashboard .ai-gen-tok{font-size:.68rem;color:var(--muted);white-space:nowrap}
#section-aidashboard .ai-pill-group{display:flex;gap:.2rem}
#section-aidashboard .ai-mpill{padding:.28rem .65rem;border-radius:6px;border:1px solid var(--border);background:var(--card);color:var(--muted);font-size:.72rem;font-family:inherit;cursor:pointer;transition:all .12s}
#section-aidashboard .ai-mpill:hover{border-color:var(--brand);color:var(--text)}
#section-aidashboard .ai-mpill.sel-haiku{background:rgba(34,197,94,.15);border-color:var(--green);color:var(--green);font-weight:600}
#section-aidashboard .ai-mpill.sel{background:rgba(107,143,255,.15);border-color:var(--blue);color:var(--blue);font-weight:600}
#section-aidashboard .ai-mpill.sel-opus{background:rgba(167,139,250,.18);border-color:var(--purple);color:var(--purple);font-weight:600}
#section-aidashboard .ai-cost-tag{font-size:.7rem;font-weight:600;white-space:nowrap;text-align:right;min-width:54px}
#section-aidashboard .ai-cost-tag.lo{color:var(--green)}
#section-aidashboard .ai-cost-tag.me{color:var(--blue)}
#section-aidashboard .ai-cost-tag.hi{color:var(--orange)}

/* Mese / range */
#section-aidashboard .ai-month-bar{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap;margin-bottom:1.3rem}
#section-aidashboard .ai-month-label{font-size:.72rem;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
#section-aidashboard .ai-month-pills{display:flex;gap:.25rem;flex-wrap:wrap}
#section-aidashboard .ai-month-pill{padding:.3rem .65rem;border-radius:6px;border:1px solid var(--border);background:var(--card);color:var(--muted);font-size:.73rem;font-family:inherit;cursor:pointer;transition:all .12s}
#section-aidashboard .ai-month-pill:hover{border-color:var(--brand);color:var(--text)}
#section-aidashboard .ai-month-pill.active{background:rgba(153,10,63,.15);border-color:var(--brand);color:var(--brand);font-weight:600}
#section-aidashboard .ai-month-pill.in-range{background:rgba(153,10,63,.07);border-color:var(--brand);color:var(--text)}
#section-aidashboard .ai-btn-range{background:none;border:1px solid var(--border);color:var(--muted);border-radius:6px;padding:.3rem .8rem;cursor:pointer;font-size:.73rem;font-family:inherit}
#section-aidashboard .ai-btn-range:hover{border-color:var(--brand);color:var(--text)}
#section-aidashboard .ai-btn-range.active{background:rgba(153,10,63,.15);border-color:var(--brand);color:var(--brand)}

/* Summary cards */
#section-aidashboard .ai-summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.8rem;margin-bottom:1.2rem;max-width:1100px}
#section-aidashboard .ai-summary-card{background:var(--card);border:1px solid var(--border);border-radius:11px;padding:1rem 1.1rem}
#section-aidashboard .ai-summary-card.hl-brand{border-color:rgba(153,10,63,.4)}
#section-aidashboard .ai-summary-card.hl-green{border-color:rgba(34,197,94,.35)}
#section-aidashboard .ai-summary-label{font-size:.7rem;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin-bottom:.4rem}
#section-aidashboard .ai-summary-value{font-size:1.4rem;font-weight:800;color:var(--text)}
#section-aidashboard .ai-summary-sub{font-size:.7rem;color:var(--muted);margin-top:.25rem}
#section-aidashboard .ai-trend-up{color:var(--orange);font-weight:600}
#section-aidashboard .ai-trend-down{color:var(--green);font-weight:600}

/* Grafico */
#section-aidashboard .ai-chart-card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:1.2rem 1.4rem;margin-bottom:1.2rem;max-width:1100px}
#section-aidashboard .ai-chart-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;flex-wrap:wrap;gap:.6rem}
#section-aidashboard .ai-chart-title{font-size:.88rem;font-weight:700;color:var(--text)}
#section-aidashboard .ai-chart-legend{display:flex;gap:1rem;flex-wrap:wrap}
#section-aidashboard .ai-leg-item{display:flex;align-items:center;gap:.35rem;font-size:.72rem;color:var(--muted)}
#section-aidashboard .ai-leg-dot{width:10px;height:10px;border-radius:50%}
#section-aidashboard .ai-chart-area{position:relative}
#section-aidashboard .ai-chart-xaxis{display:flex;justify-content:space-between;font-size:.64rem;color:var(--muted);margin-top:.4rem}

/* P&L */
#section-aidashboard .ai-pl-grid{display:grid;grid-template-columns:1fr 1fr;gap:1.2rem;max-width:1100px}
@media(max-width:900px){#section-aidashboard .ai-pl-grid{grid-template-columns:1fr}#section-aidashboard .ai-preset-grid{grid-template-columns:1fr}}
#section-aidashboard .ai-cost-section{margin-bottom:.4rem}
#section-aidashboard .ai-block-head{display:flex;justify-content:space-between;font-size:.7rem;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-weight:700;padding:.4rem 0;border-bottom:1px solid var(--border);margin-bottom:.3rem}
#section-aidashboard .ai-cost-row{display:flex;align-items:center;gap:.6rem;padding:.35rem 0}
#section-aidashboard .ai-cost-row-lbl{flex:1;display:flex;flex-direction:column}
#section-aidashboard .ai-cost-row-name{font-size:.8rem;color:var(--text);font-weight:500}
#section-aidashboard .ai-cost-row-sub{font-size:.66rem;color:var(--muted)}
#section-aidashboard .ai-c-input{width:80px;background:var(--surface);border:1px solid var(--border);border-radius:6px;color:var(--text);font-family:inherit;font-size:.78rem;padding:.3rem .5rem;text-align:right}
#section-aidashboard .ai-c-input:focus{outline:none;border-color:var(--brand)}
#section-aidashboard .ai-cost-name-input{flex:1;background:var(--surface);border:1px solid var(--border);border-radius:6px;color:var(--text);font-family:inherit;font-size:.78rem;padding:.3rem .5rem}
#section-aidashboard .ai-cost-name-input:focus{outline:none;border-color:var(--brand)}
#section-aidashboard .ai-btn-del{background:none;border:none;color:var(--muted);cursor:pointer;font-size:1rem;padding:0 .3rem}
#section-aidashboard .ai-btn-del:hover{color:var(--red)}
#section-aidashboard .ai-btn-add{background:none;border:1px dashed var(--border);color:var(--muted);border-radius:8px;padding:.45rem 1rem;cursor:pointer;font-size:.75rem;font-family:inherit;margin-top:.5rem}
#section-aidashboard .ai-btn-add:hover{border-color:var(--brand);color:var(--text)}
#section-aidashboard .ai-block{margin-top:.2rem}
#section-aidashboard .ai-pl-row{display:flex;justify-content:space-between;align-items:center;padding:.4rem 0}
#section-aidashboard .ai-pl-row.total{border-top:1px solid var(--border);margin-top:.3rem;padding-top:.6rem}
#section-aidashboard .ai-pl-lbl{display:flex;flex-direction:column}
#section-aidashboard .ai-pl-lbl-main{font-size:.82rem;color:var(--text);font-weight:600}
#section-aidashboard .ai-pl-lbl-sub{font-size:.66rem;color:var(--muted)}
#section-aidashboard .ai-pl-val{font-size:.88rem;font-weight:700}
#section-aidashboard .ai-pl-val.acc{color:var(--accent2)}
#section-aidashboard .ai-pl-val.neg{color:var(--red)}
#section-aidashboard .ai-pl-val.pos{color:var(--green)}

/* Proiezioni */
#section-aidashboard .ai-projection-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.6rem}
#section-aidashboard .ai-projection-card{background:var(--surface);border:1px solid var(--border);border-radius:9px;padding:.7rem .8rem;text-align:center}
#section-aidashboard .ai-projection-students{font-size:.72rem;color:var(--muted);font-weight:600}
#section-aidashboard .ai-projection-cost{font-size:1.05rem;font-weight:800;color:var(--text);margin:.2rem 0}
#section-aidashboard .ai-projection-label{font-size:.62rem;color:var(--muted)}
#section-aidashboard .ai-projection-margin{font-size:.66rem;color:var(--green);font-weight:600;margin-top:.25rem}

/* Tabella studenti */
#section-aidashboard .ai-students-table{width:100%;border-collapse:collapse;font-size:.78rem}
#section-aidashboard .ai-students-table th{text-align:left;font-size:.66rem;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-weight:700;padding:.5rem .6rem;border-bottom:1px solid var(--border)}
#section-aidashboard .ai-students-table td{padding:.55rem .6rem;border-bottom:1px solid var(--border);color:var(--text)}
#section-aidashboard .ai-stud-email{font-weight:500}
#section-aidashboard .ai-group-badge{display:inline-block;padding:.18rem .55rem;border-radius:6px;border:1px solid var(--border);font-size:.68rem;font-weight:600;cursor:pointer}
#section-aidashboard .ai-stud-status{font-size:.66rem;padding:.15rem .5rem;border-radius:5px;font-weight:600}
#section-aidashboard .ai-stud-status.active{background:rgba(34,197,94,.12);color:var(--green)}
#section-aidashboard .ai-stud-status.alert{background:rgba(249,115,22,.12);color:var(--orange)}
#section-aidashboard .ai-stud-status.off{background:rgba(160,156,188,.12);color:var(--muted)}
#section-aidashboard .ai-pl-input{width:72px;background:var(--surface);border:1px solid var(--border);border-radius:6px;color:var(--text);font-family:inherit;font-size:.78rem;padding:.25rem .4rem;text-align:right}
#section-aidashboard .ai-pl-input:focus{outline:none;border-color:var(--brand)}
#section-aidashboard .ai-margin-val{font-weight:700}
#section-aidashboard .ai-margin-val.ok{color:var(--green)}
#section-aidashboard .ai-usage-bar{width:80px;height:6px;background:var(--surface2);border-radius:3px;overflow:hidden}
#section-aidashboard .ai-usage-bar-fill{height:100%;border-radius:3px}
#section-aidashboard .ai-usage-bar-fill.low{background:var(--green)}
#section-aidashboard .ai-usage-bar-fill.med{background:var(--blue)}
#section-aidashboard .ai-usage-bar-fill.crit{background:var(--orange)}
#section-aidashboard .ai-override-btn{background:none;border:1px solid var(--border);color:var(--muted);border-radius:6px;padding:.25rem .6rem;cursor:pointer;font-size:.7rem;font-family:inherit}
#section-aidashboard .ai-override-btn:hover{border-color:var(--brand);color:var(--text)}
#section-aidashboard .ai-override-btn.has{border-color:var(--brand);color:var(--brand)}
#section-aidashboard .ai-override-panel{display:none;background:var(--surface);border-radius:8px;margin:.3rem 0}
#section-aidashboard .ai-override-panel.open{display:block}
#section-aidashboard .ai-override-title{font-size:.74rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--text);margin-bottom:.6rem}
#section-aidashboard .ai-ov-row{display:flex;align-items:center;gap:.7rem;padding:.4rem 0;flex-wrap:wrap}
#section-aidashboard .ai-ov-name{font-size:.78rem;color:var(--text);font-weight:500;min-width:150px}
#section-aidashboard .ai-ov-inherit{font-size:.68rem;color:var(--muted)}

/* Footer */
#section-aidashboard .ai-footer-bar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:.6rem;max-width:1100px;margin-top:.4rem}
#section-aidashboard .ai-footer-saved{font-size:.72rem;color:var(--muted)}
#section-aidashboard .ai-btn{padding:.45rem 1rem;border-radius:7px;font-family:inherit;font-size:.78rem;font-weight:600;cursor:pointer;border:1px solid var(--border)}
#section-aidashboard .ai-btn-primary{background:var(--brand);border-color:var(--brand);color:#fff}
#section-aidashboard .ai-btn-secondary{background:none;color:var(--muted)}
#section-aidashboard .ai-btn-secondary:hover{color:var(--text);border-color:var(--brand)}
#section-aidashboard .ai-empty{color:var(--muted);font-size:.8rem;padding:1rem 0}
