/* =====================================================================
   LUCA-AI Hub — hub-shell.css (v2)
   Chrome condiviso per tutti i tool: token di brand, font unico, barra
   superiore con logo / titolo / menu strumenti / torna all'hub.
   Incluso DOPO il CSS del tool: vince per ordine e specificità.
   ===================================================================== */
:root{
  --hub-primary:#0A66C2;--hub-primary-dark:#004182;--hub-primary-light:#E8F0FE;
  --hub-accent:#E94560;--hub-green:#057642;--hub-text:#1D2226;--hub-text-2:#56687A;--hub-muted:#8899A6;
  --hub-border:#E1E8ED;--hub-bg:#EDF1F5;--hub-white:#FFFFFF;--hub-radius:12px;
  --hub-font:'Manrope','Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  --hub-navy:#0B1F3A;
}
html.hub-shell body{font-family:var(--hub-font)}
html.hub-shell button,html.hub-shell input,html.hub-shell select,html.hub-shell textarea{font-family:inherit}

/* ---- barra ---- */
.hub-shell-bar{position:relative;z-index:9000;display:flex;align-items:center;gap:14px;height:54px;padding:0 18px;
  background:#fff;color:var(--hub-text);font-family:var(--hub-font);border-bottom:3px solid var(--hub-primary);
  box-shadow:none;font-size:13px;-webkit-font-smoothing:antialiased}
.hub-shell-brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--hub-navy);font-weight:800;letter-spacing:-.01em;white-space:nowrap}
.hub-shell-brand img{width:32px;height:32px;border-radius:50%;background:transparent;object-fit:cover;box-shadow:none}
.hub-shell-brand span{font-size:15px}
.hub-shell-sep{width:1px;height:22px;background:var(--hub-border)}
.hub-shell-title{font-weight:600;color:var(--hub-text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1}
.hub-shell-right{display:flex;align-items:center;gap:8px;margin-left:auto}
.hub-shell-btn{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;border-radius:9px;border:1px solid #D4DCE6;
  background:#fff;color:var(--hub-text);font-weight:700;font-size:12.5px;text-decoration:none;cursor:pointer;font-family:inherit;transition:background .15s,border-color .15s,transform .1s;white-space:nowrap}
.hub-shell-btn:hover{background:#F3F6FA;border-color:var(--hub-primary);color:var(--hub-primary)}
.hub-shell-btn:active{transform:translateY(1px)}
.hub-shell-btn-primary{background:var(--hub-primary);color:#fff;border-color:var(--hub-primary)}
.hub-shell-btn-primary:hover{background:var(--hub-primary-dark);color:#fff;border-color:var(--hub-primary-dark)}
.hub-shell-btn:focus-visible{outline:2px solid var(--hub-primary);outline-offset:2px}

/* ---- intestazioni interne dei tool: niente fasce colorate sotto la barra, tutto bianco e in armonia ---- */
html.hub-shell .header,html.hub-shell .app-header{background:#fff !important;color:var(--hub-text) !important;border-bottom:1px solid var(--hub-border);box-shadow:none !important}
html.hub-shell .header h1,html.hub-shell .app-header h1,html.hub-shell .header h2,html.hub-shell .app-header h2{color:var(--hub-text) !important;text-shadow:none}
html.hub-shell .header p,html.hub-shell .header span,html.hub-shell .app-header span,html.hub-shell .header small{color:var(--hub-text-2) !important;opacity:1 !important}
html.hub-shell .header a{color:var(--hub-primary) !important}
html.hub-shell .app-header .logo-mark,html.hub-shell .app-header .logo-text,html.hub-shell .app-header .logo-sep{display:none}   /* il brand c'è già nella barra: resta solo il sottotitolo */
html.hub-shell .app-header .logo-sub{font-weight:700;color:var(--hub-text) !important;font-size:14px}
html.hub-shell .app-header .header-actions{margin-left:auto;align-items:center}
html.hub-shell .app-header .header-actions select{width:auto !important;min-width:150px}

/* ---- menu strumenti ---- */
.hub-shell-menu{position:relative}
.hub-shell-dd{position:absolute;top:38px;right:0;width:min(92vw,720px);background:#fff;color:var(--hub-text);border-radius:14px;
  box-shadow:0 20px 50px rgba(0,0,0,.28);padding:14px;display:none;z-index:9500;max-height:min(78vh,620px);overflow:auto;
  border:1px solid var(--hub-border)}
.hub-shell-dd.open{display:block;animation:hubDdIn .16s ease}
@keyframes hubDdIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.hub-shell-dd-search{width:100%;box-sizing:border-box;padding:9px 12px;border:1.5px solid var(--hub-border);border-radius:9px;font-size:13px;
  font-family:inherit;outline:none;margin-bottom:10px;background:#F5F7FA;color:var(--hub-text)}
.hub-shell-dd-search:focus{border-color:var(--hub-primary);box-shadow:0 0 0 3px var(--hub-primary-light)}
.hub-shell-dd-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(205px,1fr));gap:4px 16px}
.hub-shell-dd-cat{grid-column:1/-1;font-size:11px;font-weight:800;letter-spacing:.6px;text-transform:uppercase;color:var(--hub-muted);margin:8px 0 2px}
.hub-shell-dd a{display:flex;align-items:center;gap:8px;padding:7px 9px;border-radius:8px;text-decoration:none;color:var(--hub-text);font-size:13px;font-weight:600}
.hub-shell-dd a:hover,.hub-shell-dd a:focus-visible{background:var(--hub-primary-light);color:var(--hub-primary-dark);outline:none}
.hub-shell-dd a.current{background:var(--hub-primary);color:#fff}
.hub-shell-dd a .k{opacity:.55;font-size:11px;margin-left:auto}
.hub-shell-dd-empty{padding:16px;text-align:center;color:var(--hub-muted);font-size:13px;display:none}

/* nasconde i vecchi link "Torna al Hub" dentro i tool (ora stanno nella barra) */
.hub-shell-hidden-link{display:none!important}

/* ---- responsive ---- */
@media (max-width:640px){
  .hub-shell-bar{height:44px;padding:0 10px;gap:8px}
  .hub-shell-brand span,.hub-shell-sep,.hub-shell-title{display:none}
  .hub-shell-btn{padding:0 10px}
  .hub-shell-btn .t{display:none}
  .hub-shell-dd{position:fixed;top:48px;left:8px;right:8px;width:auto}
}
@media print{.hub-shell-bar{display:none!important}}
@media (max-width:640px){.hub-shell-brand img{width:28px;height:28px}}

/* ---- toast + dialoghi custom per i tool ---- */
.hub-toast-box{position:fixed;right:16px;bottom:16px;z-index:100001;display:flex;flex-direction:column;gap:8px;max-width:min(92vw,420px);font-family:var(--hub-font)}
.hub-toast{display:flex;align-items:flex-start;gap:9px;padding:11px 14px;border-radius:10px;background:#1D2226;color:#fff;font-size:13.5px;line-height:1.4;box-shadow:0 10px 30px rgba(0,0,0,.28);animation:hubToastIn .2s ease;border-left:4px solid var(--hub-primary)}
.hub-toast-success{border-left-color:#057642}.hub-toast-error{border-left-color:#DC2626}.hub-toast-warning{border-left-color:#D97706}
.hub-toast.out{opacity:0;transform:translateY(8px);transition:all .3s}
.hub-toast-ic{flex-shrink:0}
@keyframes hubToastIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.hub-dlg-overlay{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(15,23,42,.55);backdrop-filter:blur(3px);animation:hubDlgIn .15s ease;font-family:var(--hub-font)}
.hub-dlg-overlay.hub-dlg-out{animation:hubDlgOut .14s ease forwards}
@keyframes hubDlgIn{from{opacity:0}to{opacity:1}}@keyframes hubDlgOut{from{opacity:1}to{opacity:0}}
.hub-dlg{background:#fff;color:var(--hub-text);border-radius:14px;width:100%;max-width:460px;box-shadow:0 24px 64px rgba(0,0,0,.35);padding:22px 22px 18px;animation:hubDlgPop .18s cubic-bezier(.16,1,.3,1);border-top:4px solid var(--hub-primary);text-align:left}
.hub-dlg-danger{border-top-color:#DC2626}
@keyframes hubDlgPop{from{transform:translateY(14px) scale(.97);opacity:0}to{transform:none;opacity:1}}
.hub-dlg-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}.hub-dlg-icon{font-size:22px;line-height:1}
.hub-dlg-head h3{font-size:16px;font-weight:800;margin:0;color:var(--hub-text)}
.hub-dlg-body{font-size:14px;line-height:1.55;color:var(--hub-text-2);word-break:break-word}
.hub-dlg-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px;flex-wrap:wrap}
.hub-dlg-btn{padding:9px 16px;border-radius:8px;font-weight:700;font-size:13px;font-family:inherit;cursor:pointer;border:1.5px solid var(--hub-border);background:transparent;color:var(--hub-text-2);min-width:96px}
.hub-dlg-btn:hover{background:#F5F7FA}
.hub-dlg-ok{background:var(--hub-primary);border-color:var(--hub-primary);color:#fff}.hub-dlg-ok:hover{background:var(--hub-primary-dark)}
.hub-dlg-ok-danger{background:#DC2626;border-color:#DC2626}.hub-dlg-ok-danger:hover{background:#B91C1C}
