/* Extracted from index.html <style> */

*{box-sizing:border-box}
:root{--primary:#2556d9;--secondary:#0e7c72;--ink:#101828;--muted:#667085;--line:rgba(16,24,40,.13);--panel:rgba(255,255,255,.91);--danger:#b42318;--ok:#027a48;--warn:#b7791f;--radius:13px;--shadow:0 18px 55px rgba(16,24,40,.10);--uiScale:.67}
html,body{margin:0;min-height:100%;color:var(--ink);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#eef3f7}
body{background:var(--company-bg,none),radial-gradient(circle at 12% -8%,rgba(37,86,217,.16),transparent 30%),radial-gradient(circle at 88% 0%,rgba(14,124,114,.14),transparent 31%),linear-gradient(90deg,rgba(16,24,40,.035) 1px,transparent 1px),linear-gradient(rgba(16,24,40,.028) 1px,transparent 1px),linear-gradient(135deg,#fbfaf6,#eef3f7 52%,#fbfaf6);background-size:cover,auto,auto,30px 30px,30px 30px,auto;background-attachment:fixed}
button,input,select,textarea{font:inherit}
button{border:1px solid var(--line);background:white;color:var(--ink);border-radius:10px;padding:9px 12px;font-weight:850;cursor:pointer;transition:.14s ease}
button:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(16,24,40,.10)}
button.primary{color:white;border-color:transparent;background:linear-gradient(135deg,var(--primary),var(--secondary))}
button.danger{color:#be123c;background:#fff1f2}
button.mini{padding:6px 8px;font-size:11px}
button:disabled,.locked{opacity:.46;filter:grayscale(.3);cursor:not-allowed}
input,select,textarea{width:100%;border:1px solid var(--line);border-radius:10px;padding:10px;background:white;color:var(--ink)}
textarea{min-height:110px;resize:vertical}
label{display:grid;gap:5px;font-size:11px;font-weight:850;color:#344054}
small,.muted{color:var(--muted)}
.scale-root{transform:scale(var(--uiScale));transform-origin:top left;width:calc(100% / var(--uiScale));min-height:calc(100vh / var(--uiScale))}
.app{display:grid;grid-template-columns:250px minmax(0,1fr) 315px;min-height:calc(100vh / var(--uiScale))}
.app.no-rightbar{grid-template-columns:250px minmax(0,1fr)}
.sidebar{position:sticky;top:0;height:calc(100vh / var(--uiScale));overflow:auto;border-right:1px solid var(--line);background:rgba(251,250,246,.92);padding:16px}
.rightbar{position:sticky;top:0;height:calc(100vh / var(--uiScale));overflow:auto;border-left:1px solid var(--line);background:rgba(251,250,246,.76);padding:16px}
.main{min-width:0;padding:16px}
.brand{display:flex;gap:11px;align-items:center;margin-bottom:14px}
.logo{width:40px;height:40px;border-radius:12px;background:linear-gradient(135deg,var(--primary),var(--secondary));color:white;display:grid;place-items:center;font-weight:950}
.brand h1{font-family:Georgia,serif;font-size:25px;letter-spacing:-.07em;margin:0}
.brand small{font-family:ui-monospace,monospace;font-size:9px;letter-spacing:.08em}
.nav{display:grid;gap:6px}
.nav button{display:flex;justify-content:space-between;align-items:center;text-align:left}
.nav button.active{border-color:rgba(37,86,217,.38);box-shadow:0 10px 28px rgba(37,86,217,.12)}
.topbar{position:sticky;top:0;z-index:20;margin:-16px -16px 16px;padding:11px 16px;border-bottom:1px solid var(--line);background:rgba(251,250,246,.82);backdrop-filter:blur(16px);display:flex;gap:10px;align-items:center;justify-content:space-between}
.search{display:flex;gap:8px;min-width:min(560px,50vw)}
.card{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);padding:14px;box-shadow:0 10px 30px rgba(16,24,40,.06);backdrop-filter:blur(14px)}
.card h3{margin:0 0 9px}
.grid{display:grid;gap:10px}.grid.two{grid-template-columns:1.1fr .9fr}.grid.three{grid-template-columns:repeat(3,1fr)}.grid.four{grid-template-columns:repeat(4,1fr)}
.actions{display:flex;gap:7px;flex-wrap:wrap;align-items:center}.view{display:none}.view.active{display:block}
.badge{display:inline-flex;padding:6px 9px;border-radius:999px;background:#101828;color:white;font-family:ui-monospace,monospace;font-size:9px;font-weight:900;letter-spacing:.07em;text-transform:uppercase}
.pill{display:inline-flex;align-items:center;gap:5px;padding:5px 7px;border-radius:999px;font-size:10px;font-weight:900;background:#e0f2fe;color:#075985}.pill.owner{background:#fef3c7;color:#92400e}.pill.admin{background:#f3e8ff;color:#6b21a8}.pill.manager{background:#dbeafe;color:#1e40af}.pill.operator{background:#dcfce7;color:#166534}.pill.bad{background:#fee4e2;color:#b42318}.pill.warn{background:#fff7ed;color:#9a3412}
.row{display:grid;grid-template-columns:1fr auto;gap:9px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:11px;background:white;margin:7px 0}
.hero{position:relative;overflow:hidden;border:1px solid var(--line);border-radius:20px;padding:22px;background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(248,250,252,.89));box-shadow:var(--shadow)}
.hero:after{content:"RABBIT DB OS";position:absolute;right:18px;top:7px;font-family:Georgia,serif;font-size:70px;letter-spacing:-.08em;color:rgba(16,24,40,.045);pointer-events:none}
.hero h2{font-family:Georgia,serif;font-size:clamp(36px,4.7vw,68px);line-height:.94;letter-spacing:-.075em;margin:8px 0;max-width:940px}.hero h2 span{color:var(--primary)}.hero p{color:#475467;max-width:920px;line-height:1.5}
.social-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:10px}.post{border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.95);padding:14px;margin-bottom:10px;box-shadow:0 10px 30px rgba(16,24,40,.055)}
.post-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.author{display:flex;gap:9px;align-items:center}.avatar{width:39px;height:39px;border-radius:12px;background:linear-gradient(135deg,var(--primary),var(--secondary));display:grid;place-items:center;color:white;font-weight:950}.post h3{margin:6px 0 4px}.post-body{white-space:pre-wrap;line-height:1.52;color:#344054}.comment-box{background:#f8fafc;border:1px solid var(--line);border-radius:12px;padding:9px;margin-top:9px}.comment{padding:7px 0;border-bottom:1px solid rgba(16,24,40,.08)}.comment:last-child{border-bottom:0}.inline-input{display:grid;grid-template-columns:1fr auto;gap:7px;margin-top:8px}
.online-user{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center;padding:9px;border:1px solid var(--line);background:white;border-radius:12px;margin:6px 0}.dot{width:9px;height:9px;border-radius:50%;background:#10b981}.dot.away{background:#f59e0b}.dot.off{background:#94a3b8}
.chat-layout{display:grid;grid-template-columns:310px minmax(0,1fr);gap:10px}.thread{border:1px solid var(--line);border-radius:13px;background:white;padding:11px;cursor:pointer;margin-bottom:7px}.thread.active{border-color:rgba(37,86,217,.4);box-shadow:0 10px 24px rgba(37,86,217,.10)}
.chat-panel{border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.94);min-height:560px;display:grid;grid-template-rows:auto 1fr auto;overflow:hidden}.chat-head,.chat-input{padding:12px;background:white;border-bottom:1px solid var(--line)}.chat-input{border-top:1px solid var(--line);border-bottom:0;display:grid;grid-template-columns:1fr auto;gap:8px}.chat-messages{padding:12px;overflow:auto;max-height:500px}.msg{max-width:76%;padding:9px 11px;border-radius:14px;margin:7px 0;background:#f1f5f9}.msg.mine{margin-left:auto;background:linear-gradient(135deg,var(--primary),var(--secondary));color:white}
.page-layout,.settings-layout{display:grid;grid-template-columns:320px minmax(0,1fr);gap:10px}.document-card,.knowledge-card{border:1px solid var(--line);border-radius:12px;background:white;padding:10px;margin:7px 0}.event{border-left:4px solid var(--primary);background:white;border-radius:12px;border-top:1px solid var(--line);border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:10px;margin:8px 0}
.settings-menu{position:sticky;top:78px;align-self:start;display:grid;gap:6px}
.home-structure-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.home-toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);background:#fff;border-radius:12px;padding:11px 12px}.home-toggle input{width:auto}.home-toggle small{display:block;color:var(--muted);font-weight:700;margin-top:2px}.settings-section{border:1px solid var(--line);border-radius:16px;background:white;padding:14px;margin-bottom:10px}.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.form-grid .full{grid-column:1/-1}
.table{width:100%;border-collapse:separate;border-spacing:0 7px}.table th{text-align:left;color:var(--muted);font-size:10px;text-transform:uppercase;padding:5px}.table td{background:white;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:8px}.table td:first-child{border-left:1px solid var(--line);border-radius:10px 0 0 10px}.table td:last-child{border-right:1px solid var(--line);border-radius:0 10px 10px 0}
.mask{position:fixed;inset:0;background:rgba(16,24,40,.42);z-index:4000;display:none;align-items:stretch;justify-content:flex-end;backdrop-filter:blur(10px)}.mask.show{display:flex}.mask-panel{width:min(1040px,100%);height:100%;background:#fbfaf6;box-shadow:-25px 0 90px rgba(16,24,40,.25);display:grid;grid-template-rows:auto 1fr;overflow:auto}.mask-head{position:sticky;top:0;background:rgba(251,250,246,.92);backdrop-filter:blur(16px);z-index:3;border-bottom:1px solid var(--line);padding:14px;display:flex;justify-content:space-between;gap:10px}.mask-title h2{font-family:Georgia,serif;font-size:34px;line-height:1;letter-spacing:-.06em;margin:0}.mask-body{padding:14px}
.login{position:fixed;inset:0;z-index:8000;display:none;align-items:center;justify-content:center;padding:24px;background:linear-gradient(135deg,#fbfaf6,#eef3f7)}.login.show{display:flex}.login-grid{width:min(980px,100%);display:grid;grid-template-columns:1fr 1fr;gap:14px}.login-card{border:1px solid var(--line);border-radius:20px;background:rgba(255,255,255,.94);box-shadow:var(--shadow);padding:22px}.login-card h1{font-family:Georgia,serif;font-size:58px;line-height:.94;letter-spacing:-.075em;margin:8px 0}.login-card h1 span{color:var(--primary)}
.toast{position:fixed;right:18px;bottom:18px;z-index:9000;background:white;border:1px solid var(--line);border-radius:14px;padding:13px;box-shadow:0 24px 70px rgba(16,24,40,.18);display:none;max-width:440px}.toast.show{display:block}.mobile-nav{display:none}
.db-status{border:1px solid rgba(2,122,72,.22);background:#ecfdf5;color:#065f46;border-radius:13px;padding:11px;font-size:12px}
.db-status.bad{border-color:#fecaca;background:#fff1f2;color:#991b1b}
.loading-cover{position:fixed;inset:0;z-index:7000;display:none;place-items:center;background:rgba(251,250,246,.86);backdrop-filter:blur(12px)}.loading-cover.show{display:grid}
@media(max-width:1180px){:root{--uiScale:1}.scale-root{transform:none;width:100%;min-height:100vh}.app{display:block}.sidebar,.rightbar{display:none}.main{padding:11px;padding-bottom:82px}.topbar{margin:-11px -11px 11px;padding:10px 11px;display:grid}.search{min-width:0}.grid.two,.grid.three,.grid.four,.social-layout,.chat-layout,.page-layout,.settings-layout,.form-grid,.login-grid{grid-template-columns:1fr}.hero{padding:17px}.hero h2{font-size:38px}.hero:after{font-size:38px}.mask-panel{width:100%}.mobile-nav{position:fixed;left:10px;right:10px;bottom:10px;display:grid;grid-template-columns:repeat(5,1fr);gap:6px;background:rgba(255,255,255,.94);border:1px solid var(--line);border-radius:18px;padding:7px;z-index:3000;box-shadow:0 18px 60px rgba(16,24,40,.18)}.mobile-nav button{font-size:11px;padding:8px 4px}.table{display:block;overflow:auto}}

.week-calendar{
  display:grid;
  grid-template-columns:90px repeat(7,minmax(130px,1fr));
  gap:7px;
  overflow:auto;
  padding-bottom:8px;
}
.week-cell{
  min-height:86px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.94);
  padding:8px;
}
.week-head{
  min-height:auto;
  background:linear-gradient(135deg,rgba(37,86,217,.10),rgba(14,124,114,.08));
  font-weight:950;
  text-align:center;
}
.week-hour{
  display:grid;
  place-items:center;
  font-size:11px;
  color:var(--muted);
  font-weight:900;
}
.week-item{
  border-radius:10px;
  padding:7px;
  margin:5px 0;
  background:#eff6ff;
  border:1px solid rgba(37,86,217,.20);
  cursor:pointer;
  font-size:11px;
}
.week-item b{
  display:block;
  color:#1e3a8a;
}
.week-item.scadenza{background:#fff7ed;border-color:#fed7aa}
.week-item.appuntamento{background:#ecfdf5;border-color:#bbf7d0}
.week-item.focus{background:#f5f3ff;border-color:#ddd6fe}
.week-toolbar{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-bottom:10px;
}
.week-mini-list{
  display:grid;
  gap:7px;
}
.week-mini-list .row{
  margin:0;
}


.week-all-day-label{
  display:grid;
  place-items:center;
  font-size:11px;
  color:var(--muted);
  font-weight:950;
  background:rgba(255,255,255,.72);
}
.week-all-day-cell{
  min-height:70px;
  border:1px dashed rgba(37,86,217,.25);
  background:rgba(239,246,255,.55);
}
.week-item.allday{
  background:#eef2ff;
  border-color:#c7d2fe;
}
.week-item .week-time{
  display:block;
  margin-top:3px;
  color:#475467;
  font-size:10px;
}
.week-range-note{
  font-size:10px;
  color:var(--muted);
  margin-top:4px;
}


.logo img{
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
  border-radius:12px;
}


.doc-preview-frame{
  width:100%;
  height:calc(100vh - 190px);
  min-height:620px;
  border:1px solid var(--line);
  border-radius:14px;
  background:white;
}
.doc-preview-image{
  max-width:100%;
  max-height:calc(100vh - 190px);
  display:block;
  margin:auto;
  border-radius:14px;
  border:1px solid var(--line);
  background:white;
}
.doc-preview-fallback{
  border:1px dashed var(--line);
  border-radius:14px;
  background:#fff;
  padding:18px;
}


/* =========================================================
   RABBIT RESPONSIVE PATCH — SMARTPHONE / TABLET
   ========================================================= */
.mobile-menu-btn{display:none}
.mobile-drawer{
  position:fixed;
  inset:0;
  z-index:7600;
  background:rgba(16,24,40,.42);
  backdrop-filter:blur(10px);
  display:none;
}
.mobile-drawer.show{display:block}
.mobile-drawer-panel{
  width:min(420px,92vw);
  height:100%;
  overflow:auto;
  background:rgba(251,250,246,.98);
  border-right:1px solid var(--line);
  box-shadow:24px 0 80px rgba(16,24,40,.24);
  padding:14px;
}
.mobile-drawer-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-bottom:12px;
  border-bottom:1px solid var(--line);
  margin-bottom:12px;
}
.mobile-drawer-nav{
  display:grid;
  gap:8px;
}
.mobile-drawer-nav button{
  min-height:48px;
  justify-content:space-between;
  display:flex;
  align-items:center;
}
.mobile-safe-spacer{height:76px;display:none}

@media(max-width:1180px){
  html,body{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
  }
  body{
    background-attachment:scroll;
  }
  .mobile-menu-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:44px;
  }
  .mobile-safe-spacer{display:block}
  .scale-root{
    transform:none!important;
    width:100%!important;
    min-height:100vh!important;
  }
  .app{
    display:block!important;
    width:100%;
    min-height:100vh;
  }
  .sidebar,.rightbar{
    display:none!important;
  }
  .main{
    width:100%;
    max-width:100vw;
    overflow-x:hidden;
    padding:10px 10px 92px!important;
  }
  .topbar{
    margin:-10px -10px 10px!important;
    padding:10px!important;
    position:sticky;
    top:0;
    z-index:3000;
    display:grid!important;
    grid-template-columns:auto 1fr;
    gap:8px;
    align-items:center;
    border-radius:0 0 18px 18px;
  }
  .topbar .search{
    min-width:0!important;
    width:100%;
    display:grid;
    grid-template-columns:1fr 44px;
    grid-column:2;
  }
  .topbar > .actions{
    grid-column:1 / -1;
    width:100%;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:7px;
    overflow:visible;
  }
  .topbar > .actions button{
    min-width:0;
    min-height:44px;
    padding:9px 6px;
    font-size:12px;
    white-space:normal;
    line-height:1.15;
  }
  .hero{
    padding:16px!important;
    border-radius:18px!important;
  }
  .hero:after{
    display:none;
  }
  .hero h2{
    font-size:clamp(34px,10vw,48px)!important;
    line-height:.96!important;
    letter-spacing:-.065em!important;
  }
  .hero p{
    font-size:14px;
  }
  .card{
    padding:12px!important;
    border-radius:16px!important;
  }
  .grid.two,.grid.three,.grid.four,
  .social-layout,.chat-layout,.page-layout,.settings-layout,
  .form-grid{
    grid-template-columns:1fr!important;
  }
  .row{
    grid-template-columns:1fr!important;
    align-items:start;
    gap:8px;
  }
  .row > button,
  .row > .actions{
    width:100%;
    justify-content:flex-start;
  }
  .row > button{
    min-height:40px;
  }
  .actions{
    width:100%;
  }
  .actions button{
    min-height:40px;
  }
  .post{
    padding:12px!important;
    border-radius:16px!important;
  }
  .post-head{
    display:grid!important;
    grid-template-columns:1fr;
  }
  .inline-input{
    grid-template-columns:1fr!important;
  }
  .chat-panel{
    min-height:70vh!important;
  }
  .chat-messages{
    max-height:58vh!important;
  }
  .chat-input{
    grid-template-columns:1fr!important;
  }
  .mask{
    align-items:stretch!important;
    justify-content:center!important;
  }
  .mask-panel{
    width:100%!important;
    max-width:100%!important;
  }
  .mask-head{
    display:grid!important;
    grid-template-columns:1fr;
    gap:10px;
  }
  .mask-title h2{
    font-size:30px!important;
  }
  .mask-head .actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .mask-body{
    padding:10px!important;
  }
  .table{
    display:block;
    overflow-x:auto;
    white-space:nowrap;
  }
  .doc-preview-frame{
    height:70vh!important;
    min-height:420px!important;
  }
  .login{
    padding:10px!important;
    align-items:flex-start!important;
    overflow:auto;
  }
  .login-grid{
    grid-template-columns:1fr!important;
    width:100%!important;
  }
  .login-card{
    padding:16px!important;
    border-radius:18px!important;
  }
  .login-card h1{
    font-size:42px!important;
  }
  .mobile-nav{
    left:8px!important;
    right:8px!important;
    bottom:8px!important;
    grid-template-columns:repeat(5,1fr)!important;
    gap:5px!important;
    border-radius:18px!important;
    padding:7px!important;
  }
  .mobile-nav button{
    min-width:0;
    min-height:48px;
    font-size:11px!important;
    line-height:1.1;
    padding:7px 4px!important;
  }
  .week-calendar{
    display:grid!important;
    grid-template-columns:72px repeat(7, minmax(118px,1fr))!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
    padding-bottom:10px;
  }
  .week-cell{
    min-width:118px;
  }
  .week-hour,.week-all-day-label{
    min-width:72px!important;
  }
}

@media(max-width:640px){
  .topbar{
    grid-template-columns:1fr!important;
  }
  .mobile-menu-btn{
    width:100%;
  }
  .topbar .search{
    grid-column:1;
  }
  .topbar > .actions{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .hero h2{
    font-size:36px!important;
  }
  .brand h1{
    font-size:22px;
  }
  input,select,textarea{
    font-size:16px; /* evita zoom automatico iOS */
  }
  .mobile-drawer-panel{
    width:94vw;
  }
  .week-calendar{
    grid-template-columns:64px repeat(7, minmax(112px,1fr))!important;
  }
  .week-cell{
    min-width:112px;
    padding:7px;
  }
  .week-item{
    font-size:10px;
  }
}


/* =========================================================
   RABBIT PATCH — HOME + PROFILO + PROGRAMMAZIONI
   ========================================================= */
.home-grid,.profile-grid,.program-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.profile-hero{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center}
.avatar-lg{width:84px;height:84px;border-radius:26px;background:linear-gradient(135deg,var(--primary),var(--secondary));display:grid;place-items:center;color:#fff;font-weight:900;font-size:30px;overflow:hidden;border:1px solid rgba(255,255,255,.45);box-shadow:0 20px 44px rgba(16,24,40,.15)}
.avatar-lg img{width:100%;height:100%;object-fit:cover;display:block}
.profile-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
.meta-chip{border:1px solid var(--line);background:#fff;border-radius:14px;padding:10px}
.program-card,.mini-card{border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.96);padding:12px;box-shadow:0 10px 26px rgba(16,24,40,.05)}
.program-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.program-steps{margin-top:10px;display:grid;gap:8px}
.step-item{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:flex-start;padding:10px;border:1px solid rgba(16,24,40,.09);background:#fbfcff;border-radius:12px}
.step-item.done{background:rgba(16,185,129,.08);border-color:rgba(16,185,129,.22)}
.step-toggle{width:20px;height:20px;border-radius:50%;border:2px solid #c7d2e0;display:grid;place-items:center;font-size:11px;margin-top:2px}
.step-item.done .step-toggle{background:#10b981;border-color:#10b981;color:#fff}
.list-compact{display:grid;gap:8px}.list-compact .row,.list-compact .mini-row{padding:10px;border:1px solid var(--line);background:#fff;border-radius:14px}
.home-stack{display:grid;gap:10px}.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.card h4{margin:0 0 6px}.inline-note{background:#f8fafc;border:1px dashed var(--line);padding:10px;border-radius:12px;color:#475467}
textarea.steps-input{min-height:120px}
@media(max-width:1180px){.home-grid,.profile-grid,.program-grid,.kpi-grid,.profile-meta{grid-template-columns:1fr!important}.profile-hero{grid-template-columns:1fr!important}.avatar-lg{width:72px;height:72px;border-radius:22px}}


/* =========================================================
   RABBIT POLISH — HOME / PROFILE / PROGRAM TEMPLATES
   ========================================================= */
.command-center{
  display:grid;
  grid-template-columns:1.15fr .85fr;
  gap:10px;
}
.command-panel{
  position:relative;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:22px;
  padding:18px;
  background:
    radial-gradient(circle at 12% 12%,rgba(37,86,217,.16),transparent 30%),
    radial-gradient(circle at 90% 0%,rgba(14,124,114,.14),transparent 28%),
    rgba(255,255,255,.94);
  box-shadow:var(--shadow);
}
.command-panel:after{
  content:"WORKSPACE";
  position:absolute;
  right:14px;
  bottom:-12px;
  font-family:Georgia,serif;
  font-size:62px;
  letter-spacing:-.08em;
  color:rgba(16,24,40,.055);
  pointer-events:none;
}
.command-title{
  font-family:Georgia,serif;
  font-size:44px;
  line-height:.96;
  letter-spacing:-.07em;
  margin:8px 0;
}
.command-title span{color:var(--primary)}
.command-actions{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-top:14px;
}
.command-actions button{
  min-height:54px;
}
.pulse-strip{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
}
.pulse-card{
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(255,255,255,.95);
  padding:12px;
}
.pulse-card b{
  display:block;
  font-family:Georgia,serif;
  font-size:30px;
  letter-spacing:-.05em;
}
.priority-board{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.board-col{
  min-height:220px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,.82);
  padding:12px;
}
.board-col h3{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}
.board-item{
  border:1px solid rgba(16,24,40,.09);
  border-radius:14px;
  padding:10px;
  background:white;
  margin:8px 0;
}
.profile-cover{
  min-height:190px;
  border-radius:22px;
  border:1px solid var(--line);
  background:
    linear-gradient(135deg,rgba(37,86,217,.18),rgba(14,124,114,.12)),
    radial-gradient(circle at 70% 0%,rgba(255,255,255,.8),transparent 35%),
    rgba(255,255,255,.86);
  padding:18px;
  display:grid;
  align-content:end;
  position:relative;
  overflow:hidden;
}
.profile-cover:after{
  content:"PROFILE";
  position:absolute;
  right:16px;
  top:16px;
  font-family:Georgia,serif;
  font-size:58px;
  letter-spacing:-.08em;
  color:rgba(16,24,40,.07);
}
.profile-actions-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}
.skill-grid{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}
.skill-pill{
  border:1px solid var(--line);
  background:white;
  border-radius:999px;
  padding:7px 10px;
  font-size:11px;
  font-weight:850;
}
.progress-track{
  height:10px;
  border-radius:999px;
  background:#eef2f7;
  overflow:hidden;
  border:1px solid rgba(16,24,40,.08);
}
.progress-fill{
  height:100%;
  background:linear-gradient(135deg,var(--primary),var(--secondary));
  border-radius:inherit;
}
.substep-list{
  display:grid;
  gap:5px;
  margin-top:7px;
}
.substep{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:7px;
  align-items:center;
  padding:7px;
  border-radius:10px;
  background:#f8fafc;
  border:1px solid rgba(16,24,40,.07);
  font-size:12px;
}
.substep.done{
  background:rgba(16,185,129,.08);
}
.template-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.template-card{
  border:1px solid var(--line);
  background:white;
  border-radius:16px;
  padding:12px;
}
@media(max-width:1180px){
  .command-center,.priority-board,.template-grid{grid-template-columns:1fr!important}
  .pulse-strip,.command-actions,.profile-actions-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .command-title{font-size:36px}
  .command-panel:after,.profile-cover:after{font-size:38px}
}
@media(max-width:640px){
  .pulse-strip,.command-actions,.profile-actions-grid{grid-template-columns:1fr!important}
  .command-panel{padding:14px}
  .command-title{font-size:32px}
}


/* === RABBIT CHAT-ONLY PATCH: messenger-like private chat, scoped only to messages/chat === */
.chat-layout.rabbit-messenger{display:grid;grid-template-columns:300px minmax(0,1fr) 230px;gap:0;border:1px solid var(--line);border-radius:16px;background:#fff;overflow:hidden;min-height:620px}
.rabbit-chat-list{border-right:1px solid var(--line);background:#fff;padding:12px;overflow:auto}.rabbit-chat-list-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}.rabbit-chat-search input{width:100%;border-radius:999px;background:#f1f5f9;border-color:#e5e7eb}.rabbit-thread{display:grid;grid-template-columns:auto 1fr auto;gap:9px;align-items:center;padding:9px;border-radius:12px;cursor:pointer;border:1px solid transparent;margin:4px 0}.rabbit-thread:hover,.rabbit-thread.active{background:#f1f5f9;border-color:#e5e7eb}.rabbit-thread b,.rabbit-thread small{overflow-wrap:anywhere}.rabbit-avatar-wrap{position:relative;width:max-content}.rabbit-avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;color:#fff;font-weight:950;background:linear-gradient(135deg,var(--primary),var(--secondary));font-size:12px}.rabbit-dot{position:absolute;width:10px;height:10px;border-radius:50%;right:-1px;bottom:-1px;background:#10b981;border:2px solid #fff}.rabbit-dot.away{background:#f59e0b}.rabbit-dot.off{background:#94a3b8}.rabbit-chat-main{display:grid;grid-template-rows:auto 1fr auto;background:#fff;min-height:620px}.rabbit-chat-head{padding:12px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:10px;align-items:center}.rabbit-chat-person{display:flex;align-items:center;gap:9px;min-width:0}.rabbit-chat-person b,.rabbit-chat-person small{overflow-wrap:anywhere}.rabbit-chat-body{overflow:auto;padding:14px;background:#fff}.rabbit-msg-row{display:flex;gap:7px;align-items:flex-end;margin:7px 0}.rabbit-msg-row.mine{justify-content:flex-end}.rabbit-msg-bubble{max-width:min(560px,78%);border-radius:18px;padding:9px 12px;background:#f1f5f9;color:#101828;overflow-wrap:anywhere}.rabbit-msg-row.mine .rabbit-msg-bubble{background:linear-gradient(135deg,var(--primary),var(--secondary));color:#fff}.rabbit-msg-bubble small{opacity:.72}.rabbit-chat-input{display:grid;grid-template-columns:auto 1fr auto;gap:8px;padding:10px;border-top:1px solid var(--line);background:#fff}.rabbit-chat-input input{border-radius:999px;background:#f1f5f9;border-color:#e5e7eb}.rabbit-chat-info{border-left:1px solid var(--line);padding:14px;background:#fff;overflow:auto}.rabbit-chat-info-card{border:1px solid var(--line);border-radius:14px;background:#fff;padding:12px;margin-top:10px}.rabbit-chat-dock{position:fixed;right:14px;bottom:14px;display:flex;align-items:flex-end;gap:10px;z-index:6500;pointer-events:none}.rabbit-dock-chat{width:320px;height:420px;border-radius:16px;overflow:hidden;background:#fff;border:1px solid rgba(16,24,40,.14);box-shadow:0 20px 80px rgba(16,24,40,.25);display:grid;grid-template-rows:auto 1fr auto;pointer-events:auto}.rabbit-dock-head{padding:9px 10px;display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center;border-bottom:1px solid var(--line);background:#fff}.rabbit-dock-body{padding:10px;overflow:auto;background:#fff}.rabbit-dock-input{display:grid;grid-template-columns:1fr auto;gap:7px;padding:8px;border-top:1px solid var(--line)}.rabbit-dock-input input{border-radius:999px;background:#f1f5f9;border-color:#e5e7eb}@media(max-width:1180px){.chat-layout.rabbit-messenger{grid-template-columns:1fr;min-height:auto}.rabbit-chat-list{border-right:0;border-bottom:1px solid var(--line);max-height:260px}.rabbit-chat-main{min-height:62vh}.rabbit-chat-info{display:none}.rabbit-chat-dock{left:8px;right:8px;bottom:76px;justify-content:flex-end}.rabbit-dock-chat{width:min(360px,calc(100vw - 16px));height:420px}}



/* === Rabbit Calendar Pro: enterprise calendar UX === */
.gcal-shell{display:grid;grid-template-columns:280px minmax(0,1fr);gap:14px;align-items:start}
.gcal-side{position:sticky;top:14px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:14px;box-shadow:var(--shadow)}
.gcal-main{min-width:0;background:#fff;border:1px solid var(--line);border-radius:18px;overflow:hidden;box-shadow:var(--shadow)}
.gcal-top{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,#fff,#f8fafc)}
.gcal-title{display:flex;align-items:center;gap:10px;min-width:0}.gcal-title h3{margin:0;font-size:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gcal-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.gcal-actions button,.gcal-view-tabs button{padding:8px 11px;border-radius:999px}.gcal-view-tabs{display:flex;gap:5px;flex-wrap:wrap}.gcal-view-tabs .active{background:var(--primary);color:#fff;border-color:var(--primary)}
.gcal-mini-month{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin-top:10px}.gcal-mini-month b,.gcal-mini-month button{text-align:center;font-size:11px;padding:6px 0;border-radius:999px}.gcal-mini-month button{border:0;background:#f8fafc;cursor:pointer}.gcal-mini-month button.today{background:rgba(37,86,217,.10);color:var(--primary);font-weight:900}.gcal-mini-month button.selected{background:var(--primary);color:#fff;font-weight:900}
.gcal-list-filter{display:grid;gap:8px;margin-top:14px}.gcal-check{display:flex;align-items:center;gap:8px;padding:8px;border-radius:12px;background:#f8fafc}.gcal-dot{width:10px;height:10px;border-radius:50%;background:var(--primary);display:inline-block}.gcal-dot.task{background:#7c3aed}.gcal-dot.room{background:#0891b2}.gcal-dot.private{background:#64748b}.gcal-dot.crm{background:#ea580c}
.gcal-grid-week{display:grid;grid-template-columns:64px repeat(7,minmax(130px,1fr));min-width:980px}.gcal-grid-day{display:grid;grid-template-columns:64px minmax(360px,1fr);min-width:620px}.gcal-scroll{overflow:auto;max-height:calc(100vh - 220px)}
.gcal-cell{min-height:54px;border-right:1px solid #edf2f7;border-bottom:1px solid #edf2f7;padding:4px;background:#fff;position:relative}.gcal-head{position:sticky;top:0;z-index:3;min-height:54px;background:#fff;font-weight:900;text-align:center;display:grid;place-items:center}.gcal-hour{background:#f8fafc;color:#64748b;font-size:12px;text-align:right;padding:7px}.gcal-allday{min-height:42px;background:#fbfdff}.gcal-dayname small{display:block;color:#64748b;font-weight:700}.gcal-dayname .num{font-size:20px;border-radius:999px;padding:4px 9px}.gcal-dayname.today .num{background:var(--primary);color:#fff}
.gcal-event{border-radius:10px;padding:6px 7px;margin:2px 0;background:linear-gradient(135deg,var(--primary),var(--secondary));color:#fff;box-shadow:0 8px 20px rgba(16,24,40,.13);cursor:pointer;font-size:12px;line-height:1.25;overflow:hidden}.gcal-event b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gcal-event small{opacity:.86}.gcal-event.task{background:linear-gradient(135deg,#7c3aed,#2563eb)}.gcal-event.room{background:linear-gradient(135deg,#0891b2,#0f766e)}.gcal-event.private{background:linear-gradient(135deg,#64748b,#334155)}.gcal-event.crm{background:linear-gradient(135deg,#ea580c,#b45309)}
.gcal-month{display:grid;grid-template-columns:repeat(7,minmax(130px,1fr));min-width:980px}.gcal-month .gcal-cell{min-height:128px}.gcal-month-num{font-weight:900;color:#334155}.gcal-month-num.muted{color:#cbd5e1}.gcal-month-num.today{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--primary);color:#fff}.gcal-more{font-size:11px;color:var(--primary);font-weight:900;margin-top:3px;cursor:pointer}.gcal-agenda{padding:12px;display:grid;gap:8px}.gcal-agenda-row{display:grid;grid-template-columns:120px 1fr auto;gap:12px;align-items:center;border:1px solid var(--line);border-radius:14px;padding:10px;background:#fff}.gcal-agenda-date{font-weight:900;color:#334155}.gcal-resource-board{padding:12px;display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:10px}.gcal-resource-card{border:1px solid var(--line);border-radius:14px;padding:12px;background:#fff}.gcal-availability{padding:12px}.gcal-slot{display:flex;justify-content:space-between;gap:10px;border:1px solid var(--line);border-radius:12px;padding:10px;margin:7px 0;background:#f8fafc}.gcal-event-detail{display:grid;gap:10px}.gcal-participants{display:flex;flex-wrap:wrap;gap:6px}.gcal-chip{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--line);border-radius:999px;padding:5px 9px;background:#f8fafc;font-size:12px}.gcal-quick-create{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:10px}.gcal-quick-create input{border-radius:999px}
@media(max-width:1180px){.gcal-shell{grid-template-columns:1fr}.gcal-side{position:relative;top:auto}.gcal-grid-week,.gcal-month{min-width:820px}.gcal-main{border-radius:14px}.gcal-top{align-items:flex-start;flex-direction:column}.gcal-agenda-row{grid-template-columns:1fr}.gcal-scroll{max-height:none}}



/* =========================================================
   RABBIT EXECUTIVE AURORA THEME
   Tema più accattivante, corporate e premium.
   Non modifica logica, Supabase, routing o funzioni: solo UI/CSS.
   ========================================================= */
:root{
  --primary:#0f5f8f;
  --secondary:#13b7a4;
  --accent:#f2b84b;
  --ink:#0b1220;
  --muted:#667085;
  --line:rgba(15,35,60,.12);
  --panel:rgba(255,255,255,.88);
  --radius:18px;
  --shadow:0 24px 70px rgba(15,35,60,.14);
}
html{scroll-behavior:smooth}
body{
  background:
    radial-gradient(circle at 8% 4%,rgba(19,183,164,.22),transparent 28%),
    radial-gradient(circle at 84% 0%,rgba(15,95,143,.20),transparent 32%),
    radial-gradient(circle at 52% 105%,rgba(242,184,75,.18),transparent 30%),
    linear-gradient(135deg,#f7fbff 0%,#eef5f8 47%,#f8f4ec 100%);
  background-attachment:fixed;
}
body:before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(15,35,60,.035) 1px,transparent 1px),
    linear-gradient(90deg,rgba(15,35,60,.035) 1px,transparent 1px);
  background-size:34px 34px;
  mask-image:linear-gradient(to bottom,rgba(0,0,0,.75),transparent 78%);
  z-index:-1;
}
.app{grid-template-columns:256px minmax(0,1fr) 330px}
.sidebar{
  background:linear-gradient(180deg,#071827 0%,#0b2740 52%,#0d3349 100%);
  color:#eaf7ff;
  border-right:1px solid rgba(255,255,255,.10);
  box-shadow:18px 0 55px rgba(7,24,39,.15);
}
.sidebar::-webkit-scrollbar,.rightbar::-webkit-scrollbar,.gcal-scroll::-webkit-scrollbar{width:10px;height:10px}
.sidebar::-webkit-scrollbar-thumb,.rightbar::-webkit-scrollbar-thumb,.gcal-scroll::-webkit-scrollbar-thumb{background:rgba(15,95,143,.35);border-radius:999px}
.brand{
  padding:12px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:22px;
  background:linear-gradient(135deg,rgba(255,255,255,.10),rgba(255,255,255,.035));
  box-shadow:0 18px 40px rgba(0,0,0,.12);
}
.logo{box-shadow:0 16px 36px rgba(19,183,164,.25);background:linear-gradient(135deg,#13b7a4,#0f5f8f)}
.brand h1{color:white;letter-spacing:-.055em}
.brand small{color:rgba(234,247,255,.72)}
.nav button{
  color:rgba(234,247,255,.92);
  background:rgba(255,255,255,.075);
  border-color:rgba(255,255,255,.105);
  border-radius:15px;
  box-shadow:none;
}
.nav button:hover{
  background:rgba(255,255,255,.13);
  border-color:rgba(255,255,255,.20);
  transform:translateX(2px);
}
.nav button.active{
  color:#062033;
  background:linear-gradient(135deg,#ffffff,#dffdf7);
  border-color:rgba(19,183,164,.45);
  box-shadow:0 18px 40px rgba(19,183,164,.22);
}
.nav button.active:before{
  content:"";
  width:5px;
  height:22px;
  border-radius:999px;
  margin-right:8px;
  background:linear-gradient(180deg,var(--secondary),var(--primary));
}
.main{padding:18px 20px}
.topbar{
  margin:-18px -20px 18px;
  padding:14px 20px;
  background:rgba(255,255,255,.72);
  border-bottom:1px solid rgba(15,35,60,.09);
  box-shadow:0 14px 34px rgba(15,35,60,.075);
  backdrop-filter:blur(22px) saturate(140%);
}
.search input,
input,select,textarea{
  border-radius:16px;
  border-color:rgba(15,35,60,.13);
  background:rgba(255,255,255,.92);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7),0 10px 24px rgba(15,35,60,.035);
}
.search input:focus,input:focus,select:focus,textarea:focus{
  outline:0;
  border-color:rgba(19,183,164,.55);
  box-shadow:0 0 0 4px rgba(19,183,164,.12),0 12px 28px rgba(15,35,60,.06);
}
button{
  border-radius:15px;
  border-color:rgba(15,35,60,.12);
  background:linear-gradient(180deg,#fff,#f7fafc);
  box-shadow:0 10px 22px rgba(15,35,60,.06);
}
button:hover{box-shadow:0 14px 32px rgba(15,35,60,.13)}
button.primary{
  background:linear-gradient(135deg,#0f5f8f 0%,#13b7a4 72%,#55d6c7 100%);
  box-shadow:0 16px 36px rgba(19,183,164,.28);
}
button.danger{background:linear-gradient(180deg,#fff7f7,#fff1f2);border-color:#ffd4da;color:#be123c}
.card,.post,.row,.gcal-side,.gcal-main,.login-card{
  border:1px solid rgba(15,35,60,.105);
  background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(255,255,255,.78));
  box-shadow:0 24px 70px rgba(15,35,60,.105);
  backdrop-filter:blur(18px) saturate(135%);
}
.card:hover,.post:hover,.row:hover{
  border-color:rgba(19,183,164,.24);
  box-shadow:0 28px 80px rgba(15,35,60,.14);
}
.hero{
  border-radius:28px;
  padding:28px;
  background:
    linear-gradient(135deg,rgba(7,24,39,.96),rgba(15,95,143,.92) 54%,rgba(19,183,164,.82)),
    radial-gradient(circle at 14% 10%,rgba(255,255,255,.18),transparent 26%);
  color:white;
  border:1px solid rgba(255,255,255,.20);
  box-shadow:0 32px 90px rgba(7,24,39,.24);
}
.hero:after{color:rgba(255,255,255,.075)}
.hero h2,.hero p{color:white}.hero h2 span{color:#69ffe9}.hero .badge{background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.20);color:white}
.badge{background:linear-gradient(135deg,#071827,#0f5f8f);box-shadow:0 10px 28px rgba(15,95,143,.16)}
.pill{background:#e9fbf8;color:#087567;border:1px solid rgba(19,183,164,.16)}
.avatar{border-radius:16px;box-shadow:0 12px 28px rgba(19,183,164,.20);background:linear-gradient(135deg,#0f5f8f,#13b7a4)}
.rightbar{
  background:linear-gradient(180deg,rgba(255,255,255,.62),rgba(246,250,252,.78));
  border-left:1px solid rgba(15,35,60,.08);
}
.rightbar .card{background:rgba(255,255,255,.86)}
.post{border-radius:22px}.comment-box{background:rgba(248,252,253,.92);border-radius:16px}.comment{border-color:rgba(15,35,60,.075)}
.table th{background:#edf8fa;color:#0b3c55}.table tr:hover td{background:#f7fcfd}
.gcal-shell{gap:16px}.gcal-side,.gcal-main{border-radius:24px}
.gcal-top{
  background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(241,248,250,.94));
  padding:15px 16px;
}
.gcal-title h3{letter-spacing:-.035em;color:#071827}.gcal-view-tabs .active{background:linear-gradient(135deg,var(--primary),var(--secondary));box-shadow:0 12px 26px rgba(19,183,164,.24)}
.gcal-mini-month button{background:#f3f8fa}.gcal-mini-month button.today{background:#e5f7f5;color:#087567}.gcal-mini-month button.selected{background:linear-gradient(135deg,var(--primary),var(--secondary));color:white}
.gcal-grid-week{background:linear-gradient(180deg,#f8fbfc,#eef5f8)}
.gcal-day-head,.gcal-month-head{background:linear-gradient(180deg,#f9fcfd,#eef7f8);color:#0b3c55}
.gcal-day-head.today{box-shadow:inset 0 -3px 0 var(--secondary)}
.gcal-event{
  border-radius:13px;
  background:linear-gradient(135deg,#0f8f7e,#3bc8b5);
  color:white;
  border:1px solid rgba(255,255,255,.25);
  box-shadow:0 12px 24px rgba(19,183,164,.22);
}
.gcal-event small,.gcal-event span{color:rgba(255,255,255,.78)}
.gcal-month-event{background:linear-gradient(135deg,#e9fbf8,#d9f7f2);color:#075f55;border:1px solid rgba(19,183,164,.18)}
.gcal-agenda-row{border-radius:18px;background:rgba(255,255,255,.9);box-shadow:0 12px 28px rgba(15,35,60,.055)}
.loading-cover{background:linear-gradient(135deg,rgba(7,24,39,.88),rgba(15,95,143,.78));backdrop-filter:blur(10px)}
.modal,.drawer{backdrop-filter:blur(18px) saturate(130%)}
@media(max-width:1050px){.sidebar{background:linear-gradient(180deg,#071827,#0d3349)}.app{grid-template-columns:1fr}.main{padding:14px}.topbar{margin:-14px -14px 14px;padding:12px 14px}}



/* === Rabbit Role AI Assistant - High Visibility Card === */
.ai-orb{
  position:fixed;right:22px;bottom:22px;z-index:9200;width:74px;height:74px;
  border-radius:12px;border:1px solid rgba(255,255,255,.34);
  background:linear-gradient(135deg,#083344 0%,#0f766e 54%,#14b8a6 100%);
  color:#fff;box-shadow:0 22px 55px rgba(8,51,68,.42),0 0 0 5px rgba(20,184,166,.12);
  font-weight:950;letter-spacing:.04em;display:grid;place-items:center;cursor:pointer;
  animation:aiPulse 2.7s ease-in-out infinite;
}
.ai-orb span{font-size:12px;display:block;line-height:1.05;text-align:center;text-transform:uppercase}
.ai-orb:after{content:"";position:absolute;right:9px;top:9px;width:11px;height:11px;border-radius:999px;background:#22c55e;border:2px solid #fff;box-shadow:0 0 0 4px rgba(34,197,94,.16)}
@keyframes aiPulse{0%,100%{transform:translateY(0);box-shadow:0 22px 55px rgba(8,51,68,.42),0 0 0 5px rgba(20,184,166,.12)}50%{transform:translateY(-2px);box-shadow:0 26px 70px rgba(8,51,68,.52),0 0 0 8px rgba(20,184,166,.16)}}
.ai-panel{
  position:fixed;right:22px;bottom:108px;z-index:9199;width:min(520px,calc(100vw - 34px));max-height:78vh;display:none;
  background:#ffffff;border:1px solid rgba(8,51,68,.20);border-top:5px solid #0f766e;border-radius:10px;
  box-shadow:0 30px 90px rgba(2,6,23,.36);overflow:hidden;color:#101828;
}
.ai-panel.show{display:block}
.ai-panel:before{content:"";position:absolute;inset:0 0 auto 0;height:86px;background:linear-gradient(135deg,rgba(15,118,110,.13),rgba(37,86,217,.08));pointer-events:none}
.ai-head{position:relative;display:flex;align-items:center;justify-content:space-between;padding:16px 18px 14px;background:#fff;border-bottom:1px solid #d6e1ea}
.ai-head h3{margin:6px 0 2px;font-size:20px;letter-spacing:-.02em;color:#0f172a}.ai-head small{color:#475569;font-weight:800}.ai-head button{width:38px;height:38px;border-radius:8px;background:#f8fafc;border:1px solid #cbd5e1;font-size:20px;color:#0f172a}
.ai-body{padding:16px;overflow:auto;max-height:calc(78vh - 82px);background:linear-gradient(180deg,#f8fafc 0%,#fff 42%)}
.ai-card{border:1px solid #cbd5e1;border-left:4px solid #0f766e;border-radius:8px;padding:14px 15px;margin:0 0 12px;background:#fff;box-shadow:0 12px 32px rgba(15,23,42,.09)}
.ai-card.ai-hero{border:1px solid rgba(15,118,110,.32);border-left:6px solid #0f766e;background:linear-gradient(135deg,#ecfeff 0%,#ffffff 58%);box-shadow:0 18px 45px rgba(15,118,110,.16)}
.ai-card b{display:block;margin:7px 0 6px;font-size:16px;color:#0f172a}.ai-card p{margin:0 0 12px;color:#475569;line-height:1.42;font-size:14px}.ai-card small{color:#64748b;display:block;margin-top:6px;line-height:1.3}
.ai-card .actions{gap:8px}.ai-card button{padding:9px 12px;border-radius:7px;font-weight:900}.ai-card button.primary,.ai-card .primary{background:linear-gradient(135deg,#0f766e,#14b8a6);border-color:#0f766e;color:#fff;box-shadow:0 8px 18px rgba(15,118,110,.20)}
.ai-input{display:grid;grid-template-columns:1fr auto;gap:10px;margin-top:14px;position:sticky;bottom:-16px;background:#fff;padding:12px 0 0;border-top:1px solid #e2e8f0}.ai-input input{flex:1;height:48px;border-radius:8px;border:1px solid #cbd5e1;background:#fff;font-size:15px}.ai-input button{height:48px;border-radius:8px;font-weight:950}
.ai-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;padding:5px 9px;border-radius:999px;background:#dffcf7;color:#0f766e;font-weight:950;text-transform:uppercase;letter-spacing:.06em;border:1px solid rgba(15,118,110,.18)}
.ai-state{display:flex;align-items:center;gap:7px;margin-top:8px;color:#0f766e;font-weight:900;font-size:12px;text-transform:uppercase;letter-spacing:.04em}.ai-state:before{content:"";width:8px;height:8px;border-radius:999px;background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.12)}
.ai-toggle-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--line);border-radius:8px;background:#fff;margin-bottom:8px}.ai-toggle-row small{display:block;color:var(--muted);margin-top:3px}
@media(max-width:760px){.ai-orb{right:14px;bottom:78px;width:66px;height:66px}.ai-panel{right:10px;left:10px;bottom:150px;width:auto;max-height:70vh}.ai-body{max-height:calc(70vh - 82px)}}.ai-panel{right:14px;bottom:146px}}



/* === Layout fix: sidebar scrolls with page + AI drawer usable === */
.app{align-items:stretch}
.sidebar{
  position:relative!important;
  top:auto!important;
  height:auto!important;
  min-height:calc(100vh / var(--uiScale));
  overflow:visible!important;
  align-self:stretch;
}
.sidebar .nav{padding-bottom:28px}

.ai-panel{
  top:96px!important;
  right:22px!important;
  bottom:24px!important;
  max-height:none!important;
  height:auto!important;
  width:min(560px,calc(100vw - 44px))!important;
  grid-template-rows:auto minmax(0,1fr);
}
.ai-panel.show{display:grid!important}
.ai-head{min-height:104px}
.ai-body{
  min-height:0;
  max-height:none!important;
  overflow-y:auto!important;
  display:flex;
  flex-direction:column;
  gap:0;
  padding-bottom:0!important;
}
.ai-answer{display:block}
.ai-input{
  position:sticky!important;
  bottom:0!important;
  z-index:2;
  margin-top:auto!important;
  padding:12px 0 12px!important;
  background:linear-gradient(180deg,rgba(255,255,255,.92),#fff 34%)!important;
}
.ai-input input{min-width:0}
@media(max-width:1180px){
  .sidebar{display:none!important}
}
@media(max-width:760px){
  .ai-panel{left:10px!important;right:10px!important;top:84px!important;bottom:86px!important;width:auto!important;max-height:none!important}
  .ai-body{max-height:none!important}
}



/* === Layout fix v2: sidebar, corpo centrale e rightbar scorrono insieme === */
.scale-root{
  min-height:calc(100vh / var(--uiScale));
}
.app{
  align-items:stretch!important;
}
.sidebar,.rightbar{
  position:relative!important;
  top:auto!important;
  height:auto!important;
  min-height:calc(100vh / var(--uiScale));
  overflow:visible!important;
  align-self:stretch!important;
}
.main{
  min-height:calc(100vh / var(--uiScale));
  align-self:stretch!important;
  background:linear-gradient(180deg,rgba(255,255,255,.18),rgba(255,255,255,.06));
}
.rightbar{
  background:linear-gradient(180deg,rgba(255,255,255,.70),rgba(246,250,252,.56) 55%,rgba(246,250,252,.36));
}
.rightbar:after,.sidebar:after{
  content:"";
  display:block;
  height:28px;
}
@media(max-width:1180px){
  .main{min-height:100vh;background:transparent}
  .sidebar,.rightbar{min-height:0}
}



/* === Layout fix v3: colonne visive continue fino al fondo pagina === */
.app{
  position:relative!important;
  isolation:isolate;
  align-items:stretch!important;
}
.app:before,
.app:after{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  pointer-events:none;
  z-index:0;
}
.app:before{
  left:0;
  width:256px;
  background:linear-gradient(180deg,#071827 0%,#0b2740 52%,#0d3349 100%);
  border-right:1px solid rgba(255,255,255,.10);
  box-shadow:18px 0 55px rgba(7,24,39,.12);
}
.app:after{
  right:0;
  width:330px;
  background:linear-gradient(180deg,rgba(255,255,255,.62),rgba(246,250,252,.78));
  border-left:1px solid rgba(15,35,60,.08);
}
.sidebar,.main,.rightbar{
  position:relative;
  z-index:1;
}
.sidebar,
.rightbar{
  background:transparent!important;
  box-shadow:none!important;
  min-height:100%!important;
}
.main{
  min-height:100%!important;
  background:linear-gradient(180deg,rgba(255,255,255,.16),rgba(255,255,255,.08));
}
@media(max-width:1180px){
  .app:before,.app:after{display:none}
  .main{min-height:100vh!important;background:transparent!important}
  .sidebar,.rightbar{background:transparent!important}
}



/* === Layout fix v4: forza le tre colonne a seguire fino al fondo pagina === */
.scale-root,
.app,
.sidebar,
.main,
.rightbar{
  min-height:var(--pageFillHeight)!important;
}
.app:before,
.app:after{
  min-height:var(--pageFillHeight)!important;
}



/* === Layout fix v5: pagina compatta, niente spazio vuoto finale === */
:root{--pageFillHeight:auto!important}
html,body{
  min-height:0!important;
}
.scale-root,
.app,
.sidebar,
.main,
.rightbar{
  min-height:0!important;
  height:auto!important;
}
.scale-root{
  display:block!important;
}
.app{
  align-items:start!important;
  min-height:0!important;
}
.app:before,
.app:after{
  display:none!important;
  content:none!important;
}
.sidebar,
.rightbar{
  align-self:start!important;
  min-height:auto!important;
  overflow:visible!important;
}
.main{
  align-self:start!important;
  min-height:auto!important;
  padding-bottom:24px!important;
  background:linear-gradient(180deg,rgba(255,255,255,.16),rgba(255,255,255,.08))!important;
}
.rightbar{
  background:linear-gradient(180deg,rgba(255,255,255,.62),rgba(246,250,252,.78))!important;
}
.sidebar{
  background:linear-gradient(180deg,#071827 0%,#0b2740 52%,#0d3349 100%)!important;
}
body:after{
  content:none!important;
  display:none!important;
}
@media(max-width:1180px){
  .main{padding-bottom:90px!important}
}



/* === Profile Refresh: operativo, moderno, edge corporate === */
.profile-v2{display:grid;gap:14px}
.profile-v2-hero{position:relative;overflow:hidden;border:1px solid rgba(15,35,60,.12);background:linear-gradient(135deg,#071827 0%,#0b2d45 50%,#0f766e 100%);color:#fff;padding:24px;box-shadow:0 22px 70px rgba(7,24,39,.22)}
.profile-v2-hero:after{content:"IDENTITÀ OPERATIVA";position:absolute;right:22px;bottom:-6px;font-family:Georgia,serif;font-size:54px;line-height:1;font-weight:900;letter-spacing:-.08em;color:rgba(255,255,255,.055);pointer-events:none;white-space:nowrap}
.profile-v2-top{position:relative;z-index:1;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:18px;align-items:center}
.profile-v2 .avatar-lg{width:96px;height:96px;border-radius:18px;border:2px solid rgba(255,255,255,.42);box-shadow:0 18px 44px rgba(0,0,0,.22)}
.profile-v2-title h2{margin:0;font-size:42px;line-height:.95;letter-spacing:-.055em;color:#fff}
.profile-v2-title p{margin:8px 0 0;color:rgba(255,255,255,.78);max-width:760px}
.profile-v2-status{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}.profile-v2-status span{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.10);padding:7px 10px;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.02em;color:#fff}.profile-v2-status i{width:8px;height:8px;border-radius:999px;background:#22c55e;display:inline-block}
.profile-v2-actions{position:relative;z-index:1;display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}.profile-v2-actions button{border-radius:8px}.profile-v2-actions .primary{background:#13b7a4;color:#052333}
.profile-kpi{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.profile-kpi-card{border:1px solid rgba(15,35,60,.10);background:#fff;padding:15px;box-shadow:0 16px 44px rgba(15,35,60,.075)}.profile-kpi-card small{display:block;color:var(--muted);font-weight:800;text-transform:uppercase;letter-spacing:.04em}.profile-kpi-card b{display:block;margin-top:8px;font-size:30px;letter-spacing:-.045em;color:#071827}.profile-kpi-card span{display:block;margin-top:4px;color:#667085;font-size:13px}
.profile-v2-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(330px,.75fr);gap:14px}.profile-v2-stack{display:grid;gap:14px}.profile-panel{border:1px solid rgba(15,35,60,.10);background:rgba(255,255,255,.94);box-shadow:0 18px 54px rgba(15,35,60,.08);padding:16px}.profile-panel h3{margin:0 0 10px;letter-spacing:-.025em}.profile-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:8px}.profile-panel-head p{margin:3px 0 0;color:var(--muted)}
.profile-meta-v2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.profile-meta-v2 .meta-chip{border-radius:8px;background:#f8fbfc;border:1px solid rgba(15,35,60,.09);padding:11px}.profile-meta-v2 .meta-chip b{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:#475467}.profile-meta-v2 .meta-chip small{font-size:14px;color:#071827;font-weight:850}
.profile-timeline{display:grid;gap:8px}.profile-item{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:start;padding:11px;border:1px solid rgba(15,35,60,.085);background:#fff}.profile-item-icon{width:34px;height:34px;display:grid;place-items:center;background:#e9fbf8;color:#087567;font-weight:950}.profile-item b{display:block;color:#071827}.profile-item small{color:#667085}.profile-item p{margin:5px 0 0;color:#667085;font-size:13px}.profile-item button{border-radius:8px;padding:8px 11px}
.skill-grid{display:flex;flex-wrap:wrap;gap:7px}.skill-pill{border-radius:7px;background:#eef7f8;border:1px solid rgba(15,95,143,.12);color:#0b3c55;padding:7px 9px;font-size:12px;font-weight:900}.profile-quick{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.profile-quick button{border-radius:8px;justify-content:flex-start}.profile-empty{padding:18px;border:1px dashed rgba(15,35,60,.22);background:#fbfcfd;color:#667085;text-align:center}
@media(max-width:1180px){.profile-v2-top,.profile-v2-grid{grid-template-columns:1fr}.profile-kpi{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-v2-actions{justify-content:flex-start}.profile-v2-title h2{font-size:34px}.profile-v2-hero:after{font-size:36px}}
@media(max-width:680px){.profile-kpi,.profile-meta-v2,.profile-quick{grid-template-columns:1fr}.profile-item{grid-template-columns:1fr}.profile-v2 .avatar-lg{width:82px;height:82px}}



/* === Profilo completo operativo === */
.profile-command-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px}
.profile-command-card{border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.10);padding:12px;color:#fff}
.profile-command-card small{display:block;color:rgba(255,255,255,.70);font-weight:800;text-transform:uppercase;letter-spacing:.04em}.profile-command-card b{display:block;margin-top:5px;font-size:18px;color:#fff}
.profile-section-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.profile-section-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.profile-state-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.profile-state-board button{border-radius:8px;text-align:left}.profile-state-board button.active{background:linear-gradient(135deg,#0f5f8f,#13b7a4);color:white;border-color:transparent}
.profile-goal{border:1px solid rgba(15,35,60,.09);background:#fff;padding:12px;margin:8px 0}.profile-goal-head{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}.profile-goal h4{margin:0}.profile-goal small{color:var(--muted)}
.profile-badge-grid{display:flex;gap:8px;flex-wrap:wrap}.profile-badge{display:inline-flex;align-items:center;gap:7px;border:1px solid rgba(15,95,143,.14);background:#eef7f8;color:#0b3c55;padding:8px 10px;font-weight:900;font-size:12px}.profile-badge button{padding:2px 6px;border-radius:6px;font-size:11px}
.profile-ai-box{border-left:4px solid #13b7a4;background:linear-gradient(135deg,#f0fffb,#ffffff);padding:14px;border:1px solid rgba(19,183,164,.20)}
.profile-privacy{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;border:1px solid rgba(15,35,60,.08);padding:9px;background:#fff;margin:6px 0}.profile-privacy b{font-size:13px}.profile-privacy select{height:36px;border-radius:8px}
.profile-manager-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.profile-manager-actions button{border-radius:8px;text-align:left}.profile-history-row{display:grid;grid-template-columns:92px 1fr;gap:10px;padding:9px;border-bottom:1px solid rgba(15,35,60,.07)}.profile-history-row:last-child{border-bottom:0}.profile-history-row time{font-weight:900;color:#0b3c55;font-size:12px}.profile-history-row small{color:var(--muted)}
@media(max-width:1180px){.profile-command-strip,.profile-section-grid,.profile-section-grid.three,.profile-state-board,.profile-manager-actions{grid-template-columns:1fr!important}}


/* === Colleghi / People Hub === */
.people-toolbar{display:grid;grid-template-columns:1fr 180px 180px auto;gap:10px;align-items:center;margin-bottom:12px}
.people-toolbar input,.people-toolbar select{height:44px;border-radius:8px}
.people-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.people-card{border:1px solid rgba(15,35,60,.12);background:rgba(255,255,255,.92);box-shadow:0 18px 48px rgba(15,35,60,.08);padding:14px;border-radius:8px;display:grid;gap:12px;cursor:pointer;transition:.18s ease}
.people-card:hover{border-color:rgba(19,183,164,.45);box-shadow:0 22px 58px rgba(15,35,60,.13);transform:translateY(-1px)}
.people-head{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center}.people-head h3{margin:0}.people-head small{display:block;color:var(--muted);font-weight:700;margin-top:3px}
.people-avatar{width:52px;height:52px;border-radius:10px;background:linear-gradient(135deg,var(--primary),var(--secondary));display:grid;place-items:center;color:#fff;font-weight:950;overflow:hidden}.people-avatar img{width:100%;height:100%;object-fit:cover}
.people-status{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:#fff;border-radius:999px;padding:5px 9px;font-size:12px;font-weight:900}.people-status i{width:8px;height:8px;border-radius:50%;background:#10b981}.people-status.off i{background:#94a3b8}.people-status.away i,.people-status.occupato i,.people-status.riunione i{background:#f59e0b}.people-status.busy i,.people-status.non-disturbare i{background:#ef4444}
.people-meta{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.people-meta div{border:1px solid var(--line);background:#f8fafc;border-radius:8px;padding:8px}.people-meta b{display:block;font-size:15px}.people-meta small{color:var(--muted);font-weight:800}
.people-actions{display:flex;flex-wrap:wrap;gap:8px}.people-actions button{border-radius:8px}.people-profile{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);gap:12px}.people-profile-hero{border:1px solid rgba(15,35,60,.12);background:linear-gradient(135deg,#071827,#0f5f8f 62%,#13b7a4);color:#fff;border-radius:8px;padding:18px;box-shadow:0 22px 70px rgba(7,24,39,.22)}.people-profile-hero h2{font-size:42px;letter-spacing:-.055em;margin:8px 0 4px}.people-profile-hero p{color:rgba(255,255,255,.86)}.people-profile-hero .people-status{color:#071827}.people-profile-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.people-profile-actions button{border-radius:8px}.people-section{border:1px solid var(--line);background:#fff;border-radius:8px;padding:14px;margin-bottom:12px}.people-section h3{margin-top:0}.people-feed-row{display:grid;grid-template-columns:95px 1fr auto;gap:10px;align-items:center;border-bottom:1px solid rgba(15,35,60,.08);padding:10px 0}.people-feed-row:last-child{border-bottom:0}.people-chip-list{display:flex;flex-wrap:wrap;gap:7px}.people-chip-list span{border:1px solid var(--line);background:#f8fafc;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:850}.people-empty{border:1px dashed var(--line);padding:16px;border-radius:8px;background:#f8fafc;color:var(--muted);font-weight:800}.people-mini-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:12px}.people-mini-kpis div{background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.18);border-radius:8px;padding:10px}.people-mini-kpis b{font-size:24px;display:block}.people-mini-kpis small{color:rgba(255,255,255,.76);font-weight:850}
@media(max-width:1180px){.people-grid{grid-template-columns:1fr}.people-toolbar{grid-template-columns:1fr}.people-profile{grid-template-columns:1fr}.people-mini-kpis,.people-meta{grid-template-columns:repeat(2,1fr)}}


/* === Appunti personali === */
.notes-dock .rabbit-dock-head{background:linear-gradient(135deg,rgba(15,95,143,.08),rgba(19,183,164,.14))}
.notes-dock .rabbit-dock-input input{background:#fffef8}


/* === HR Ferie: approval workflow === */
.leave-board{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}
.leave-kpi{border:1px solid var(--line);background:#fff;padding:12px;border-radius:10px;box-shadow:0 10px 24px rgba(15,35,60,.055)}
.leave-kpi b{font-size:24px;display:block;line-height:1}.leave-kpi small{color:var(--muted);font-weight:800}
.leave-row{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;border:1px solid var(--line);background:#fff;padding:12px;border-radius:10px;margin:8px 0}
.leave-status{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);border-radius:999px;padding:5px 9px;font-size:12px;font-weight:950}
.leave-status.pending{background:#fff7ed;color:#c2410c;border-color:#fed7aa}.leave-status.approved{background:#ecfdf5;color:#047857;border-color:#bbf7d0}.leave-status.rejected{background:#fff1f2;color:#be123c;border-color:#fecdd3}.leave-status.cancelled{background:#f1f5f9;color:#475569;border-color:#e2e8f0}
.leave-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}.leave-meta{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}.leave-timeline{border-left:3px solid rgba(19,183,164,.3);padding-left:10px;margin-top:8px;color:var(--muted);font-size:12px;line-height:1.45}
@media(max-width:900px){.leave-board{grid-template-columns:repeat(2,minmax(0,1fr))}.leave-row{grid-template-columns:1fr}.leave-actions{justify-content:flex-start}}
@media(max-width:560px){.leave-board{grid-template-columns:1fr}}


/* === Rabbit AI rimossa + Calendar duration/edit fix === */
.ai-orb,
.ai-panel,
.profile-ai-box,
button[title="Assistente AI"]{
  display:none!important;
}
.gcal-cell{
  overflow:visible!important;
}
.gcal-event{
  position:relative;
  z-index:4;
}
.gcal-event.timed-duration{
  margin-bottom:4px;
}
.gcal-event-tools{
  display:flex;
  gap:5px;
  margin-top:6px;
}
.gcal-event-tools button{
  width:26px;
  height:24px;
  min-height:24px;
  padding:0!important;
  border-radius:6px!important;
  background:rgba(255,255,255,.18)!important;
  color:#fff!important;
  border:1px solid rgba(255,255,255,.28)!important;
  box-shadow:none!important;
  font-size:12px!important;
}
.gcal-event-tools button:hover{
  background:rgba(255,255,255,.30)!important;
}


/* === Rabbit Core Stable: calendario a durata reale e AI rimossa === */
.ai-orb,.ai-panel,.profile-ai-box,[data-ai],button[title="Assistente AI"]{display:none!important}
.gcal-week-real,.gcal-day-real{display:grid;min-width:980px;background:#fff}
.gcal-week-real{grid-template-columns:64px repeat(7,minmax(130px,1fr))}
.gcal-day-real{grid-template-columns:64px minmax(620px,1fr);min-width:760px}
.gcal-time-col,.gcal-day-col{position:relative;background:#fff;min-height:756px;border-right:1px solid #edf2f7}
.gcal-bg-row{height:54px;border-bottom:1px solid #edf2f7;padding:6px;box-sizing:border-box;position:relative}
.gcal-time-col .gcal-bg-row{background:#f8fafc;color:#64748b;text-align:right;font-size:12px;font-weight:700}
.gcal-day-col .gcal-bg-row{cursor:pointer;background:linear-gradient(180deg,#fff,#fff)}
.gcal-day-col .gcal-bg-row:hover{background:#f8fcfd}
.gcal-day-events{position:absolute;left:5px;right:5px;top:0;height:756px;pointer-events:none;z-index:4}
.gcal-day-events .gcal-event{position:absolute;left:0;right:0;margin:0!important;pointer-events:auto;box-sizing:border-box}
.gcal-grid-day .gcal-event,.gcal-grid-week .gcal-event{max-width:100%}
.gcal-event-tools{display:flex;gap:5px;margin-top:6px}
.gcal-event-tools button{width:26px;height:24px;min-height:24px;padding:0!important;border-radius:6px!important;background:rgba(255,255,255,.18)!important;color:#fff!important;border:1px solid rgba(255,255,255,.28)!important;box-shadow:none!important;font-size:12px!important}
.gcal-event-tools button:hover{background:rgba(255,255,255,.30)!important}
@media(max-width:1180px){.gcal-week-real{min-width:860px}.gcal-day-real{min-width:680px}}


/* ==========================================================
   RABBIT SERIOUS ENTERPRISE UI
   Ispirazione: SAP Fiori shell, Salesforce Lightning cards,
   Atlassian tokens, Microsoft Fluent surfaces.
   Obiettivo: gestionale serio, leggibile, meno "fumettoso".
   ========================================================== */
:root{
  --primary:#1f4e79!important;
  --secondary:#2f6f73!important;
  --ink:#1f2937!important;
  --muted:#5f6b7a!important;
  --line:#d7dde5!important;
  --panel:#ffffff!important;
  --danger:#b42318!important;
  --ok:#027a48!important;
  --warn:#a15c07!important;
  --radius:8px!important;
  --shadow:0 1px 2px rgba(16,24,40,.08),0 8px 20px rgba(16,24,40,.06)!important;
}
html,body{
  background:#f4f6f8!important;
  color:#1f2937!important;
}
body{
  background:
    linear-gradient(180deg,#f7f9fb 0%,#eef2f6 100%)!important;
  background-attachment:fixed!important;
}
.scale-root{background:transparent!important}
.app{
  background:#f4f6f8!important;
  grid-template-columns:248px minmax(0,1fr) 300px!important;
}
.sidebar{
  background:#0f2537!important;
  color:#e8eef4!important;
  border-right:1px solid #0b1b29!important;
  box-shadow:none!important;
  padding:14px!important;
}
.brand{
  background:#132f46!important;
  border:1px solid rgba(255,255,255,.10)!important;
  border-radius:8px!important;
  padding:10px!important;
  margin-bottom:12px!important;
  box-shadow:none!important;
}
.logo{
  border-radius:6px!important;
  background:#1f4e79!important;
  box-shadow:none!important;
}
.brand h1{
  font-family:Georgia, 'Times New Roman', serif!important;
  font-size:22px!important;
  letter-spacing:-.04em!important;
  color:#ffffff!important;
}
.brand small{color:#aebdca!important;letter-spacing:.04em!important}
.nav{gap:4px!important}
.nav button{
  height:38px!important;
  border-radius:6px!important;
  background:transparent!important;
  border:1px solid transparent!important;
  color:#dbe5ee!important;
  padding:8px 10px!important;
  box-shadow:none!important;
  font-weight:750!important;
}
.nav button:hover{
  transform:none!important;
  background:#19384f!important;
  border-color:rgba(255,255,255,.08)!important;
  box-shadow:none!important;
}
.nav button.active{
  background:#ffffff!important;
  color:#123047!important;
  border-color:#ffffff!important;
  box-shadow:none!important;
}
.nav button.active:before{
  content:"";
  width:4px;
  height:18px;
  border-radius:2px;
  background:#2f6f73;
  margin-right:8px;
}
.main{padding:18px!important;background:#f4f6f8!important}
.topbar{
  position:sticky!important;
  top:0!important;
  margin:-18px -18px 18px!important;
  padding:12px 18px!important;
  background:#ffffff!important;
  border-bottom:1px solid #d7dde5!important;
  box-shadow:0 1px 3px rgba(16,24,40,.08)!important;
  backdrop-filter:none!important;
}
.search{min-width:min(620px,55vw)!important}
input,select,textarea,
.search input{
  border-radius:6px!important;
  border:1px solid #cfd6df!important;
  background:#ffffff!important;
  box-shadow:none!important;
  color:#1f2937!important;
}
input:focus,select:focus,textarea:focus,.search input:focus{
  outline:2px solid rgba(31,78,121,.18)!important;
  outline-offset:0!important;
  border-color:#1f4e79!important;
  box-shadow:none!important;
}
button{
  border-radius:6px!important;
  background:#ffffff!important;
  border:1px solid #cfd6df!important;
  color:#1f2937!important;
  box-shadow:none!important;
  font-weight:800!important;
}
button:hover{
  transform:none!important;
  background:#f7f9fb!important;
  border-color:#aeb8c4!important;
  box-shadow:0 1px 2px rgba(16,24,40,.10)!important;
}
button.primary{
  background:#1f4e79!important;
  border-color:#1f4e79!important;
  color:white!important;
  box-shadow:none!important;
}
button.primary:hover{background:#173b5c!important;border-color:#173b5c!important}
button.danger{
  background:#fff5f5!important;
  border-color:#f0b4b4!important;
  color:#b42318!important;
}
.card,.post,.row,.document-card,.knowledge-card,.people-card,.people-section,.settings-section,.leave-row,.leave-kpi,
.gcal-side,.gcal-main,.chat-panel,.thread,.rabbit-dock-chat,.login-card{
  background:#ffffff!important;
  border:1px solid #d7dde5!important;
  border-radius:8px!important;
  box-shadow:0 1px 2px rgba(16,24,40,.06)!important;
  backdrop-filter:none!important;
}
.card:hover,.post:hover,.row:hover,.people-card:hover{
  transform:none!important;
  border-color:#b7c1cc!important;
  box-shadow:0 2px 8px rgba(16,24,40,.08)!important;
}
.card h3,.post h3,.settings-section h3,.people-section h3{
  font-size:16px!important;
  letter-spacing:-.015em!important;
  color:#1f2937!important;
}
.hero{
  border-radius:8px!important;
  border:1px solid #cfd6df!important;
  background:#ffffff!important;
  color:#1f2937!important;
  box-shadow:0 1px 2px rgba(16,24,40,.06)!important;
  padding:22px!important;
}
.hero:before{
  content:"";
  position:absolute;
  left:0;top:0;bottom:0;
  width:5px;
  background:#1f4e79;
}
.hero:after{
  display:none!important;
}
.hero h2{
  font-family:Georgia,'Times New Roman',serif!important;
  font-size:clamp(34px,3.8vw,56px)!important;
  line-height:1!important;
  color:#1f2937!important;
  letter-spacing:-.055em!important;
}
.hero h2 span{color:#1f4e79!important}
.hero p{color:#5f6b7a!important}
.badge{
  background:#e8eef4!important;
  color:#1f4e79!important;
  border:1px solid #cfd6df!important;
  border-radius:4px!important;
  box-shadow:none!important;
}
.pill,.people-status,.leave-status{
  border-radius:4px!important;
  border:1px solid #cfd6df!important;
  background:#f4f6f8!important;
  color:#344054!important;
}
.pill.owner{background:#fff8e6!important;color:#7a4a00!important;border-color:#ead49a!important}
.pill.admin{background:#f1ebff!important;color:#5630a3!important;border-color:#d7c7ff!important}
.pill.manager{background:#eaf1fb!important;color:#1f4e79!important;border-color:#c3d3ea!important}
.pill.operator{background:#e8f5ef!important;color:#027a48!important;border-color:#b7dfcc!important}
.rightbar{
  background:#eef2f6!important;
  border-left:1px solid #d7dde5!important;
  padding:16px!important;
}
.rightbar .card{
  background:#ffffff!important;
  border-radius:8px!important;
  box-shadow:none!important;
}
.online-user{
  border-radius:6px!important;
  box-shadow:none!important;
}
.dot{background:#027a48!important}
.table{border-spacing:0!important;border-collapse:collapse!important;background:#fff!important;border:1px solid #d7dde5!important;border-radius:8px!important;overflow:hidden!important}
.table th{
  background:#eef2f6!important;
  color:#5f6b7a!important;
  padding:10px!important;
  border-bottom:1px solid #d7dde5!important;
}
.table td{
  border:0!important;
  border-bottom:1px solid #e6ebf0!important;
  border-radius:0!important;
  padding:10px!important;
}
.mask-panel{background:#f4f6f8!important}.mask-head{background:#ffffff!important;border-bottom:1px solid #d7dde5!important;backdrop-filter:none!important}
/* Calendar più serio */
.gcal-shell{gap:12px!important}
.gcal-side,.gcal-main{border-radius:8px!important;background:#ffffff!important}
.gcal-top{
  background:#ffffff!important;
  border-bottom:1px solid #d7dde5!important;
  padding:12px!important;
}
.gcal-title h3{color:#1f2937!important;font-size:20px!important;letter-spacing:-.025em!important}
.gcal-view-tabs button.active,.gcal-view-tabs .active{
  background:#1f4e79!important;
  color:white!important;
  border-color:#1f4e79!important;
  box-shadow:none!important;
}
.gcal-grid-week,.gcal-month,.gcal-week-real,.gcal-day-real{
  background:#ffffff!important;
  border-top:1px solid #d7dde5!important;
}
.gcal-day-head,.gcal-month-head{
  background:#f7f9fb!important;
  color:#344054!important;
  border-bottom:1px solid #d7dde5!important;
}
.gcal-day-head.today{box-shadow:inset 0 -3px 0 #1f4e79!important}
.gcal-time,.gcal-time-col .gcal-bg-row{
  background:#f7f9fb!important;
  color:#5f6b7a!important;
}
.gcal-cell,.gcal-bg-row,.gcal-day-col .gcal-bg-row{
  background:#ffffff!important;
  border-color:#e6ebf0!important;
}
.gcal-cell:hover,.gcal-day-col .gcal-bg-row:hover{background:#f7f9fb!important}
.gcal-event{
  border-radius:6px!important;
  background:#1f4e79!important;
  color:#ffffff!important;
  box-shadow:none!important;
  border:1px solid rgba(0,0,0,.08)!important;
}
.gcal-event.crm{background:#2f6f73!important}.gcal-event.task{background:#73510d!important}.gcal-event.private{background:#5b6472!important}.gcal-event.resource{background:#663399!important}
.gcal-mini-month button{border-radius:4px!important;background:#fff!important}.gcal-mini-month button.selected,.gcal-mini-month button.today{background:#1f4e79!important;color:white!important}
/* Social/chat più professionali */
.avatar,.people-avatar,.rabbit-avatar{
  border-radius:6px!important;
  background:#1f4e79!important;
  box-shadow:none!important;
}
.comment-box,.msg,.rabbit-msg-bubble{border-radius:6px!important;background:#f7f9fb!important}
.msg.mine,.rabbit-msg-row.mine .rabbit-msg-bubble{background:#1f4e79!important;color:#fff!important}
/* Profili e persone */
.profile-hero,.people-profile-hero{
  background:#1f4e79!important;
  border-radius:8px!important;
  box-shadow:none!important;
}
.profile-hero h2,.people-profile-hero h2{font-family:Georgia,'Times New Roman',serif!important}
.profile-command-strip,.people-mini-kpis div{
  background:rgba(255,255,255,.10)!important;
  border-color:rgba(255,255,255,.20)!important;
  border-radius:6px!important;
}
.people-toolbar input,.people-toolbar select{border-radius:6px!important}
.people-grid{gap:10px!important}
.people-card{padding:12px!important}
.people-meta div{border-radius:6px!important;background:#f7f9fb!important}
/* HR */
.leave-status.pending{background:#fff8e6!important;color:#7a4a00!important;border-color:#ead49a!important}
.leave-status.approved{background:#e8f5ef!important;color:#027a48!important;border-color:#b7dfcc!important}
.leave-status.rejected{background:#fff5f5!important;color:#b42318!important;border-color:#f0b4b4!important}
/* Riduzione effetto “giocoso” */
*{scrollbar-color:#b7c1cc #eef2f6}
button,.card,.post,.row,input,select,textarea,.nav button{transition:background-color .12s ease,border-color .12s ease,box-shadow .12s ease!important}
@media(max-width:1180px){
  .app{display:block!important;background:#f4f6f8!important}.main{background:#f4f6f8!important;padding:12px!important}.topbar{margin:-12px -12px 12px!important;padding:10px 12px!important}.mobile-nav{background:#ffffff!important;border-color:#d7dde5!important;border-radius:8px!important;box-shadow:0 4px 16px rgba(16,24,40,.12)!important}.mobile-nav button{border-radius:6px!important}
}


/* === Rabbit Enterprise Typography System v2 ===
   Reference direction: SAP Fiori / Salesforce Lightning / Atlassian / Fluent.
   No external webfont: robust enterprise system-font stack for Netlify/offline reliability. */
:root{
  --font-enterprise: "Segoe UI Variable", "Segoe UI", "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Roboto", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-enterprise-mono: "SFMono-Regular", "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;
  --type-xs: 11px;
  --type-sm: 12px;
  --type-md: 14px;
  --type-lg: 16px;
  --type-xl: 20px;
  --type-2xl: 26px;
  --type-3xl: 34px;
  --type-4xl: 44px;
}
html,body,
button,input,select,textarea,
.card,.post,.row,.table,.topbar,.sidebar,.rightbar,.mask,.login{
  font-family:var(--font-enterprise)!important;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-feature-settings:"kern" 1,"liga" 1,"calt" 1;
}
body{
  font-size:14px!important;
  line-height:1.46!important;
  letter-spacing:-.006em;
}
.brand h1,
.hero h2,
.hero:after,
.mask-title h2,
.login-card h1,
.command-title,
.command-panel:after,
.profile-cover:after,
.profile-v2-hero:after,
.profile-v2-title h2,
.people-profile-hero h2,
.profile-hero h2,
.card strong,
.card h1,.card h2,.card h3,
.post h3,
.gcal-title h3,
.profile-kpi-card b,
.people-mini-kpis b,
.leave-kpi b,
.kpi strong{
  font-family:var(--font-enterprise)!important;
  letter-spacing:-.035em!important;
}
.brand h1{
  font-size:22px!important;
  font-weight:760!important;
  line-height:1.05!important;
}
.brand small,
.badge,
.table th,
label,
.pill,
.ai-badge,
.profile-kpi-card small,
.profile-meta-v2 .meta-chip b,
.profile-command-card small,
.people-status,
.leave-status{
  font-family:var(--font-enterprise)!important;
  letter-spacing:.015em!important;
}
.brand small{
  font-size:10px!important;
  font-weight:650!important;
  text-transform:none!important;
  opacity:.78;
}
.hero h2,
.command-title{
  font-size:clamp(30px,3.2vw,46px)!important;
  line-height:1.06!important;
  font-weight:760!important;
  max-width:900px;
}
.hero:after,
.command-panel:after,
.profile-cover:after,
.profile-v2-hero:after{
  font-family:var(--font-enterprise)!important;
  font-size:clamp(34px,4vw,58px)!important;
  font-weight:800!important;
  letter-spacing:-.045em!important;
  opacity:.55;
}
.hero p,.post-body,.muted,.card p{
  font-size:14px!important;
  line-height:1.52!important;
}
.card h3,.post h3,.people-section h3{
  font-size:16px!important;
  line-height:1.2!important;
  font-weight:720!important;
  letter-spacing:-.018em!important;
}
.card h2,.mask-title h2{
  font-size:24px!important;
  line-height:1.12!important;
  font-weight:760!important;
}
button{
  font-family:var(--font-enterprise)!important;
  font-size:13px!important;
  font-weight:680!important;
  letter-spacing:-.004em!important;
}
button.mini,.gcal-event-tools button{
  font-size:12px!important;
  font-weight:700!important;
}
input,select,textarea{
  font-family:var(--font-enterprise)!important;
  font-size:14px!important;
  line-height:1.35!important;
}
label{
  font-size:12px!important;
  font-weight:650!important;
  color:#475569!important;
}
.table th{
  font-size:11px!important;
  font-weight:700!important;
  text-transform:uppercase;
}
.table td{
  font-size:13px!important;
  line-height:1.42!important;
}
.badge,.pill{
  font-size:11px!important;
  font-weight:700!important;
}
.nav button{
  font-size:13px!important;
  font-weight:680!important;
  letter-spacing:-.005em!important;
}
.gcal-title h3{
  font-size:19px!important;
  font-weight:740!important;
}
.gcal-day-head b,.gcal-month-head,.gcal-time,.gcal-bg-row{
  font-family:var(--font-enterprise)!important;
}
.gcal-event b{
  font-size:12px!important;
  line-height:1.1!important;
  font-weight:760!important;
}
.gcal-event small{
  font-size:10px!important;
  line-height:1.15!important;
  font-weight:600!important;
}
.profile-v2-title h2,.people-profile-hero h2{
  font-size:clamp(28px,3vw,40px)!important;
  line-height:1.08!important;
  font-weight:760!important;
}
.profile-kpi-card b,.people-mini-kpis b,.leave-kpi b{
  font-size:26px!important;
  font-weight:760!important;
}
.profile-item b,.row b,.online-user b{
  font-weight:700!important;
}
small{
  font-size:12px!important;
  line-height:1.35!important;
}
code,pre,.mono{
  font-family:var(--font-enterprise-mono)!important;
}
@media(max-width:1180px){
  .hero h2,.command-title{font-size:32px!important;line-height:1.08!important}
  body{font-size:14px!important}
}



/* === Rabbit Enterprise Operations Theme: Action Center / Kanban / Workspace === */
.ops-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.ops-kpis>div{background:#fff;border:1px solid #d7dde5;border-radius:8px;padding:14px 16px;box-shadow:0 1px 2px rgba(16,24,40,.06)}
.ops-kpis b{display:block;font-size:28px;line-height:1;color:#173b5c;letter-spacing:-.04em}.ops-kpis span{display:block;margin-top:6px;color:#667085;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.ops-layout,.workspace-grid{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:14px}.ops-action{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;background:#fff;border:1px solid #d7dde5;border-left:4px solid #1f4e79;border-radius:8px;padding:13px 14px;margin-bottom:10px;box-shadow:0 1px 2px rgba(16,24,40,.06)}
.ops-action.warn{border-left-color:#b7791f}.ops-action.bad{border-left-color:#b42318}.ops-action h3{margin:5px 0 4px;font-size:16px;color:#1f2937}.ops-action p{margin:0 0 4px;color:#475467}.ops-action small{color:#667085}.ops-kind{font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;color:#1f4e79;background:#e8eef4;border:1px solid #cfd6df;border-radius:4px;padding:3px 6px}.ops-step{display:grid;grid-template-columns:28px 1fr;gap:10px;align-items:center;padding:10px;border-bottom:1px solid #eef1f5}.ops-step:last-child{border-bottom:0}.ops-step b{display:grid;place-items:center;width:28px;height:28px;border-radius:6px;background:#e8eef4;color:#1f4e79}
.ops-tabs{display:flex;gap:8px;flex-wrap:wrap}.kanban-board{display:grid;grid-template-columns:repeat(5,minmax(220px,1fr));gap:12px;overflow:auto;padding-bottom:4px}.kanban-board.compact{grid-template-columns:repeat(3,minmax(240px,1fr))}.kanban-col{background:#f8fafc;border:1px solid #d7dde5;border-radius:8px;padding:10px;min-height:260px}.kanban-col h3{display:flex;justify-content:space-between;align-items:center;margin:0 0 10px;font-size:14px;text-transform:uppercase;letter-spacing:.045em;color:#344054}.kanban-col h3 span{background:#e8eef4;color:#1f4e79;border-radius:4px;padding:3px 7px}.kanban-card{background:#fff;border:1px solid #d7dde5;border-radius:8px;padding:12px;margin-bottom:9px;box-shadow:0 1px 2px rgba(16,24,40,.05)}.kanban-card.bad{border-left:4px solid #b42318}.kanban-card.warn{border-left:4px solid #b7791f}.kanban-card.ok{border-left:4px solid #2f6f73}.kanban-card b{color:#1f2937}.kanban-card p{margin:6px 0;color:#475467}.kanban-card small{color:#667085}.kanban-empty{border:1px dashed #cfd6df;border-radius:8px;padding:14px;color:#667085;background:#fff;text-align:center}
.workspace-switch select{max-width:520px}.timeline-row{display:grid;gap:3px;border-left:3px solid #d7dde5;padding:8px 0 8px 10px;margin-left:3px}.timeline-row span{font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;color:#1f4e79}.timeline-row b{font-size:14px;color:#1f2937}.timeline-row small{color:#667085}
@media(max-width:1180px){.ops-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.ops-layout,.workspace-grid{grid-template-columns:1fr}.kanban-board,.kanban-board.compact{grid-template-columns:repeat(5,260px)}}
@media(max-width:760px){.ops-kpis{grid-template-columns:1fr}.ops-action{grid-template-columns:1fr}.kanban-board,.kanban-board.compact{grid-template-columns:1fr;overflow:visible}}


/* === Rabbit Workflow Engine + Notifications === */
.workflow-grid{display:grid;grid-template-columns:1.05fr .95fr;gap:14px}
.workflow-rule{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;border:1px solid var(--line);background:#fff;padding:13px;margin:8px 0;border-radius:10px}
.workflow-rule .rule-dot{width:10px;height:10px;border-radius:50%;background:#94a3b8}
.workflow-rule.on .rule-dot{background:#0f766e;box-shadow:0 0 0 4px rgba(15,118,110,.10)}
.notification-list{display:grid;gap:9px}
.notification-card{border:1px solid var(--line);background:#fff;border-left:4px solid #64748b;border-radius:10px;padding:12px;display:grid;grid-template-columns:1fr auto;gap:12px;align-items:start}
.notification-card.critica{border-left-color:#b91c1c}
.notification-card.operativa{border-left-color:#0f766e}
.notification-card.info{border-left-color:#2563eb}
.audit-row{display:grid;grid-template-columns:150px 110px 1fr auto;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--line);background:#fff;border-radius:9px;margin:7px 0}
.system-check{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;border:1px solid var(--line);background:#fff;padding:11px;border-radius:9px;margin:7px 0}
.system-check .check{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:#ecfdf5;color:#047857;font-weight:900}
.system-check.warn .check{background:#fffbeb;color:#92400e}
.timeline-strip{border-left:2px solid #cbd5e1;padding-left:12px;margin:10px 0}
.timeline-item{position:relative;background:#fff;border:1px solid var(--line);border-radius:9px;padding:10px;margin:8px 0}
.timeline-item:before{content:"";position:absolute;left:-19px;top:16px;width:10px;height:10px;border-radius:50%;background:#0f766e;border:2px solid #fff}
.quick-workflow-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
@media(max-width:1050px){.workflow-grid{grid-template-columns:1fr}.audit-row{grid-template-columns:1fr}.notification-card{grid-template-columns:1fr}}


/* === Sidebar order & stable navigation polish === */
.nav button:first-child{
  background:linear-gradient(180deg,#ffffff,#eef6f9)!important;
  color:#102033!important;
  border-color:#c9d6df!important;
  font-weight:800;
}
.nav button:first-child b{background:#0f3d5e;color:#fff;border-color:#0f3d5e}


/* ==========================================================
   SIDEBAR SOFT ENTERPRISE PATCH
   Ammorbidisce solo sidebar, brand card e voci menu.
   Mantiene il resto del gestionale serio e squadrato.
   ========================================================== */
.sidebar{
  padding:16px 14px!important;
  background:linear-gradient(180deg,#0f2537 0%,#102b42 58%,#0d2235 100%)!important;
}
.sidebar .brand{
  border-radius:16px!important;
  padding:13px 12px!important;
  background:linear-gradient(180deg,rgba(255,255,255,.105),rgba(255,255,255,.045))!important;
  border:1px solid rgba(255,255,255,.14)!important;
  box-shadow:0 12px 30px rgba(0,0,0,.13)!important;
}
.sidebar .logo{
  border-radius:12px!important;
  background:linear-gradient(135deg,#1f4e79,#2f6f73)!important;
  box-shadow:0 10px 22px rgba(0,0,0,.16)!important;
}
.sidebar .nav{
  gap:6px!important;
}
.sidebar .nav button{
  min-height:40px!important;
  border-radius:12px!important;
  padding:9px 11px!important;
  background:rgba(255,255,255,.045)!important;
  border:1px solid rgba(255,255,255,.055)!important;
  color:#e6eef6!important;
  transition:background .16s ease,border-color .16s ease,transform .16s ease,box-shadow .16s ease!important;
}
.sidebar .nav button:hover{
  background:rgba(255,255,255,.105)!important;
  border-color:rgba(255,255,255,.16)!important;
  transform:translateX(2px)!important;
  box-shadow:0 8px 18px rgba(0,0,0,.10)!important;
}
.sidebar .nav button.active{
  border-radius:14px!important;
  background:#ffffff!important;
  color:#123047!important;
  border-color:rgba(255,255,255,.92)!important;
  box-shadow:0 12px 26px rgba(0,0,0,.16)!important;
}
.sidebar .nav button.active:before{
  border-radius:999px!important;
  height:20px!important;
  background:#2f6f73!important;
}
.sidebar::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.20)!important;
  border-radius:999px!important;
}
.mobile-drawer-panel .brand{
  border-radius:16px!important;
}


/* ==========================================================
   SIDEBAR FIXED BACKDROP PATCH
   Mantiene il fondo della sidebar continuo fino al fondo visibile
   senza allungare artificialmente la pagina o i contenuti.
   ========================================================== */
@media(min-width:1181px){
  body{
    position:relative!important;
  }
  body::before{
    content:""!important;
    position:fixed!important;
    top:0!important;
    left:0!important;
    bottom:0!important;
    width:calc(256px * var(--uiScale, 1))!important;
    background:linear-gradient(180deg,#0f2537 0%,#102b42 58%,#0d2235 100%)!important;
    box-shadow:18px 0 38px rgba(10,30,45,.10)!important;
    pointer-events:none!important;
    z-index:0!important;
  }
  .scale-root{
    position:relative!important;
    z-index:1!important;
  }
  .app{
    align-items:start!important;
  }
  .sidebar{
    position:sticky!important;
    top:0!important;
    align-self:start!important;
    height:calc(100vh / var(--uiScale, 1))!important;
    min-height:calc(100vh / var(--uiScale, 1))!important;
    overflow:auto!important;
    background:linear-gradient(180deg,#0f2537 0%,#102b42 58%,#0d2235 100%)!important;
    border-right:1px solid rgba(255,255,255,.08)!important;
    box-shadow:none!important;
  }
  .sidebar:after{
    content:""!important;
    display:block!important;
    height:32px!important;
  }
  .sidebar .nav{
    padding-bottom:44px!important;
  }
}
@media(max-width:1180px){
  body::before{content:none!important;display:none!important}
}



/* === Sidebar navy continuation fix ===
   Mantiene la parte estesa della sidebar coerente con il blu principale,
   evitando il grigio/azzurro staccato visto in fondo pagina. */
:root{
  --rabbit-sidebar-navy-top:#071827;
  --rabbit-sidebar-navy-mid:#0b2740;
  --rabbit-sidebar-navy-bottom:#0d3349;
}
.sidebar{
  background:linear-gradient(180deg,var(--rabbit-sidebar-navy-top) 0%,var(--rabbit-sidebar-navy-mid) 48%,var(--rabbit-sidebar-navy-bottom) 100%)!important;
}
.app::before,
.scale-root::before,
body::before{
  background:linear-gradient(180deg,var(--rabbit-sidebar-navy-top) 0%,var(--rabbit-sidebar-navy-mid) 48%,var(--rabbit-sidebar-navy-bottom) 100%)!important;
}
.sidebar-bg,
.sidebar-fill,
.sidebar-backdrop{
  background:linear-gradient(180deg,var(--rabbit-sidebar-navy-top) 0%,var(--rabbit-sidebar-navy-mid) 48%,var(--rabbit-sidebar-navy-bottom) 100%)!important;
}
.sidebar::after{
  background:linear-gradient(180deg,rgba(13,51,73,.98),rgba(7,24,39,.98))!important;
}
@media(min-width:1181px){
  .app{
    background:
      linear-gradient(90deg,
        var(--rabbit-sidebar-navy-top) 0,
        var(--rabbit-sidebar-navy-mid) 256px,
        transparent 256px
      )!important;
  }
  .sidebar{
    min-height:100vh!important;
    height:auto!important;
  }
}


.brand.brand-icon-only{justify-content:flex-start;padding:8px 0;border:0!important;background:transparent!important;box-shadow:none!important}
.brand.brand-icon-only .home-logo{display:grid;place-items:center;text-decoration:none}
.brand.brand-icon-only .logo{width:58px!important;height:58px!important;border-radius:14px!important;background:transparent!important;box-shadow:none!important;padding:0!important;overflow:hidden;border:1px solid rgba(255,255,255,.10)!important}
.brand.brand-icon-only .logo img{width:100%;height:100%;object-fit:contain;border-radius:14px}
.mobile-brand.brand-icon-only .logo{width:54px!important;height:54px!important}


/* NEXA/RABBIT COMMUNICATIONS SUITE: conference + audio/video calls */
:root{--call-panel:#fff;--call-soft:#f8fafc;--call-ink:#101828;--call-title:#0f172a;--call-muted:#667085;--call-border:#d9e2ee;--call-primary:#1d4ed8;--call-green:#047857;--call-red:#be123c;--call-shadow:0 14px 38px rgba(15,23,42,.10);--call-radius:16px}
.call-action-btn,.call-mini-btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;border-radius:999px!important;border:1px solid var(--call-border)!important;background:#fff!important;color:var(--call-ink)!important;font-weight:850!important;cursor:pointer!important;transition:transform .16s cubic-bezier(.22,1,.36,1),box-shadow .16s cubic-bezier(.22,1,.36,1),border-color .16s ease!important}.call-action-btn{min-height:36px!important;padding:0 13px!important;font-size:12px!important}.call-mini-btn{width:34px!important;height:34px!important;min-height:34px!important;padding:0!important;font-size:14px!important}.call-action-btn:hover,.call-mini-btn:hover{transform:translateY(-1px)!important;border-color:rgba(29,78,216,.28)!important;box-shadow:0 10px 24px rgba(15,23,42,.10)!important}.call-action-btn.primary,.call-mini-btn.primary{background:var(--call-primary)!important;border-color:var(--call-primary)!important;color:#fff!important}.call-action-btn.green,.call-mini-btn.green{background:var(--call-green)!important;border-color:var(--call-green)!important;color:#fff!important}.call-action-btn.red,.call-mini-btn.red{background:var(--call-red)!important;border-color:var(--call-red)!important;color:#fff!important}.call-action-btn.dark{background:#0f172a!important;border-color:#0f172a!important;color:#fff!important}
.video-suite-page{display:grid;gap:14px}.video-suite-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:center;padding:18px;border-radius:22px;background:radial-gradient(circle at 0% 0%,rgba(96,165,250,.26),transparent 34%),linear-gradient(135deg,#0f172a,#17345f 58%,#1d4ed8);color:#fff;box-shadow:var(--call-shadow)}.video-suite-hero h2{margin:0;color:#fff;font-size:28px;line-height:1.05;letter-spacing:-.055em;font-weight:950}.video-suite-hero p{margin:7px 0 0;color:#cbd5e1;max-width:760px}.video-suite-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.video-suite-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(330px,.85fr);gap:12px}.video-card{background:rgba(255,255,255,.94);border:1px solid rgba(15,23,42,.08);border-radius:var(--call-radius);box-shadow:0 1px 2px rgba(15,23,42,.06);padding:14px}.video-card h3{margin:0 0 4px;color:var(--call-title);font-size:15px;font-weight:900;letter-spacing:-.03em}.video-card p{margin:0;color:var(--call-muted);font-size:12px}
.meeting-room-preview{margin-top:12px;min-height:360px;border-radius:18px;background:radial-gradient(circle at 20% 10%,rgba(59,130,246,.22),transparent 34%),linear-gradient(135deg,#0b1220,#111827 72%,#17345f);border:1px solid rgba(255,255,255,.08);box-shadow:inset 0 1px 0 rgba(255,255,255,.08);padding:12px;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:12px;color:#fff}.meeting-room-head{display:flex;justify-content:space-between;align-items:center;gap:10px}.meeting-badge{display:inline-flex;align-items:center;gap:6px;min-height:25px;padding:0 9px;border-radius:999px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.16);font-size:11px;font-weight:850;color:#dbeafe}.meeting-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:10px;min-height:0}.meeting-tile{position:relative;min-height:160px;border-radius:16px;overflow:hidden;background:radial-gradient(circle at 30% 20%,rgba(255,255,255,.18),transparent 28%),linear-gradient(135deg,#1e293b,#0f172a);border:1px solid rgba(255,255,255,.10);display:grid;place-items:center}.meeting-tile.main{min-height:270px}.meeting-avatar{width:72px;height:72px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#1d4ed8,#0ea5e9);color:#fff;font-size:23px;font-weight:950;border:3px solid rgba(255,255,255,.20)}.meeting-tile-label{position:absolute;left:10px;bottom:10px;min-height:26px;display:inline-flex;align-items:center;padding:0 9px;border-radius:999px;background:rgba(15,23,42,.62);color:#fff;font-size:11px;font-weight:850;backdrop-filter:blur(10px)}.meeting-side-grid{display:grid;gap:10px}.meeting-controls{display:flex;justify-content:center;gap:8px;flex-wrap:wrap}.meeting-control{width:42px!important;height:42px!important;min-height:42px!important;border-radius:50%!important;background:rgba(255,255,255,.12)!important;color:#fff!important;border:1px solid rgba(255,255,255,.16)!important;box-shadow:none!important}.meeting-control.end{background:#dc2626!important;border-color:#dc2626!important}
.video-list{display:grid;gap:9px;margin-top:12px}.video-list-item{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:13px}.video-list-avatar{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#1d4ed8,#0ea5e9);color:#fff;font-size:12px;font-weight:950}.video-list-item b{display:block;color:var(--call-title);font-size:12.5px;font-weight:900}.video-list-item small{display:block;color:var(--call-muted);margin-top:2px;font-size:11px}.call-status-dot{width:9px;height:9px;border-radius:50%;background:#22c55e;display:inline-block;margin-right:5px;box-shadow:0 0 0 4px rgba(34,197,94,.14)}.call-status-dot.busy{background:#f97316;box-shadow:0 0 0 4px rgba(249,115,22,.14)}.call-status-dot.offline{background:#94a3b8;box-shadow:0 0 0 4px rgba(148,163,184,.14)}.chat-call-toolbar{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.call-injection-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;margin:8px 0;border:1px solid #dbe6f3;background:#f8fafc;border-radius:13px}.call-injection-bar b{color:var(--call-title);font-size:12px}.call-injection-bar small{color:var(--call-muted);display:block;margin-top:2px}
.call-floating-widget{position:fixed;right:18px;bottom:18px;width:min(370px,calc(100vw - 28px));background:#fff;border:1px solid rgba(15,23,42,.10);border-radius:20px;box-shadow:0 26px 80px rgba(15,23,42,.26);z-index:24000;overflow:hidden;transform:translateY(118%);opacity:0;pointer-events:none;transition:transform .28s cubic-bezier(.22,1,.36,1),opacity .28s cubic-bezier(.22,1,.36,1)}.call-floating-widget.show{transform:translateY(0);opacity:1;pointer-events:auto}.call-widget-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px;border-bottom:1px solid #e2e8f0;background:#f8fafc}.call-widget-head strong{color:var(--call-title)}.call-widget-body{padding:14px;display:grid;gap:12px}.call-widget-person{display:flex;align-items:center;gap:10px}.call-widget-controls{display:flex;justify-content:center;gap:8px;padding-top:4px}.call-widget-controls button{width:44px!important;height:44px!important;min-height:44px!important;border-radius:50%!important}@media(max-width:1180px){.video-suite-grid{grid-template-columns:1fr}}@media(max-width:720px){.video-suite-hero{grid-template-columns:1fr;padding:15px}.video-suite-actions{justify-content:flex-start}.meeting-grid{grid-template-columns:1fr}.meeting-tile.main{min-height:220px}.meeting-side-grid{grid-template-columns:1fr 1fr}.video-list-item{grid-template-columns:auto 1fr}.video-list-item>div:last-child{grid-column:2}}


/* =========================================================
   NEXAOS MEETINGS ENTRYPOINTS
   Videocall conference dentro Calendar e dentro Crea.
   ========================================================= */

.meeting-entry-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  margin:0 0 10px;
  border:1px solid rgba(15,23,42,.08);
  border-radius:16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(29,78,216,.10), transparent 34%),
    linear-gradient(180deg,#ffffff,#f8fafc);
  box-shadow:0 1px 2px rgba(15,23,42,.06);
}

.meeting-entry-toolbar h3{
  margin:0;
  color:#0f172a;
  font-size:14px;
  font-weight:900;
  letter-spacing:-.025em;
}

.meeting-entry-toolbar p{
  margin:3px 0 0;
  color:#667085;
  font-size:11.5px;
}

.meeting-entry-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.meeting-create-panel{
  position:fixed;
  inset:0;
  z-index:26000;
  background:rgba(15,23,42,.42);
  backdrop-filter:blur(10px);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
}

.meeting-create-panel.show{
  display:flex;
}

.meeting-create-card{
  width:min(760px,100%);
  max-height:88vh;
  overflow:auto;
  background:#fff;
  border:1px solid rgba(255,255,255,.72);
  border-radius:24px;
  box-shadow:0 30px 90px rgba(15,23,42,.28);
}

.meeting-create-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:18px;
  border-bottom:1px solid #e2e8f0;
}

.meeting-create-head h2{
  margin:0;
  color:#0f172a;
  font-size:20px;
  line-height:1.1;
  letter-spacing:-.04em;
  font-weight:950;
}

.meeting-create-head p{
  margin:5px 0 0;
  color:#667085;
  font-size:12px;
}

.meeting-create-body{
  padding:18px;
  display:grid;
  gap:14px;
}

.meeting-form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.meeting-form-field.full{
  grid-column:1/-1;
}

.meeting-form-field label{
  display:block;
  margin-bottom:5px;
  color:#344054;
  font-size:11px;
  font-weight:900;
}

.meeting-form-field input,
.meeting-form-field select,
.meeting-form-field textarea{
  width:100%;
  min-height:40px;
  border:1px solid #d9e2ee;
  border-radius:12px;
  background:#fff;
  color:#101828;
  padding:8px 10px;
}

.meeting-form-field textarea{
  min-height:90px;
  resize:vertical;
}

.meeting-options{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}

.meeting-option{
  border:1px solid #d9e2ee;
  border-radius:16px;
  background:#f8fafc;
  padding:12px;
  display:grid;
  gap:6px;
}

.meeting-option b{
  color:#0f172a;
  font-size:12.5px;
}

.meeting-option small{
  color:#667085;
  font-size:11px;
  line-height:1.35;
}

.meeting-create-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  padding-top:12px;
  border-top:1px solid #e2e8f0;
}

.meeting-primary-btn{
  background:#1d4ed8!important;
  border-color:#1d4ed8!important;
  color:#fff!important;
}

.meeting-live-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:24px;
  padding:0 8px;
  border-radius:999px;
  background:#eef4ff;
  border:1px solid #c7d8ff;
  color:#174ea6;
  font-size:10.5px;
  font-weight:900;
}

.meeting-live-chip::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:50%;
  background:#22c55e;
  box-shadow:0 0 0 4px rgba(34,197,94,.13);
}

.create-meeting-button-inline{
  display:inline-flex!important;
  align-items:center!important;
  gap:7px!important;
}

@media(max-width:720px){
  .meeting-entry-toolbar{
    align-items:flex-start;
    flex-direction:column;
  }

  .meeting-entry-actions{
    width:100%;
  }

  .meeting-entry-actions button{
    flex:1;
  }

  .meeting-form-grid,
  .meeting-options{
    grid-template-columns:1fr;
  }
}


/* =========================================================
   NEXAOS COLLEAGUE CALLS
   Chiamata audio/video tra colleghi come alternativa alla messaggistica.
   ========================================================= */

:root{
  --colcall-bg:#f8fafc;
  --colcall-panel:#ffffff;
  --colcall-border:#d9e2ee;
  --colcall-ink:#101828;
  --colcall-title:#0f172a;
  --colcall-muted:#667085;
  --colcall-blue:#1d4ed8;
  --colcall-green:#047857;
  --colcall-red:#be123c;
  --colcall-orange:#b45309;
  --colcall-shadow:0 18px 58px rgba(15,23,42,.16);
}

.colleague-call-entry{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:11px 12px;
  margin:0 0 10px;
  border:1px solid rgba(15,23,42,.08);
  border-radius:16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(29,78,216,.08), transparent 35%),
    linear-gradient(180deg,#ffffff,#f8fafc);
  box-shadow:0 1px 2px rgba(15,23,42,.06);
}

.colleague-call-entry h3{
  margin:0;
  color:var(--colcall-title);
  font-size:14px;
  font-weight:900;
  letter-spacing:-.025em;
}

.colleague-call-entry p{
  margin:3px 0 0;
  color:var(--colcall-muted);
  font-size:11.5px;
}

.colleague-call-actions{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
}

.colleague-call-btn{
  min-height:34px!important;
  border-radius:999px!important;
  padding:0 12px!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:7px!important;
  font-size:12px!important;
  font-weight:850!important;
  border:1px solid var(--colcall-border)!important;
  background:#fff!important;
  color:var(--colcall-ink)!important;
}

.colleague-call-btn.audio{
  background:var(--colcall-green)!important;
  border-color:var(--colcall-green)!important;
  color:#fff!important;
}

.colleague-call-btn.video{
  background:var(--colcall-blue)!important;
  border-color:var(--colcall-blue)!important;
  color:#fff!important;
}

.colleague-directory-panel{
  display:none;
  margin:0 0 10px;
  border:1px solid rgba(15,23,42,.08);
  border-radius:16px;
  background:#fff;
  box-shadow:0 10px 28px rgba(15,23,42,.08);
  overflow:hidden;
}

.colleague-directory-panel.show{
  display:block;
}

.colleague-directory-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:12px;
  border-bottom:1px solid #e2e8f0;
  background:#f8fafc;
}

.colleague-directory-head strong{
  color:var(--colcall-title);
  font-size:13px;
}

.colleague-search{
  width:100%;
  min-height:36px;
  border:1px solid var(--colcall-border);
  border-radius:999px;
  padding:0 12px;
  background:#fff;
}

.colleague-directory-body{
  display:grid;
  gap:7px;
  padding:10px;
  max-height:360px;
  overflow:auto;
}

.colleague-row{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:9px;
  border:1px solid #e2e8f0;
  border-radius:13px;
  background:#f8fafc;
}

.colleague-avatar{
  width:38px;
  height:38px;
  border-radius:50%;
  display:grid;
  place-items:center;
  color:#fff;
  background:linear-gradient(135deg,#1d4ed8,#0ea5e9);
  font-size:12px;
  font-weight:950;
}

.colleague-row b{
  display:block;
  color:var(--colcall-title);
  font-size:12.5px;
}

.colleague-row small{
  display:block;
  color:var(--colcall-muted);
  margin-top:2px;
  font-size:11px;
}

.colleague-row-actions{
  display:flex;
  gap:6px;
  align-items:center;
}

.colleague-icon-btn{
  width:34px!important;
  height:34px!important;
  min-height:34px!important;
  padding:0!important;
  border-radius:999px!important;
  display:grid!important;
  place-items:center!important;
  border:1px solid var(--colcall-border)!important;
  background:#fff!important;
  color:var(--colcall-ink)!important;
  font-size:14px!important;
}

.colleague-icon-btn.audio{
  background:var(--colcall-green)!important;
  border-color:var(--colcall-green)!important;
  color:#fff!important;
}

.colleague-icon-btn.video{
  background:var(--colcall-blue)!important;
  border-color:var(--colcall-blue)!important;
  color:#fff!important;
}

.colleague-presence{
  display:inline-flex;
  align-items:center;
  gap:5px;
}

.colleague-presence::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:#22c55e;
  box-shadow:0 0 0 4px rgba(34,197,94,.13);
}

.colleague-presence.busy::before{
  background:#f97316;
  box-shadow:0 0 0 4px rgba(249,115,22,.13);
}

.colleague-presence.offline::before{
  background:#94a3b8;
  box-shadow:0 0 0 4px rgba(148,163,184,.13);
}

.colleague-call-widget{
  position:fixed;
  right:18px;
  bottom:18px;
  width:min(380px,calc(100vw - 28px));
  z-index:27000;
  background:#fff;
  border:1px solid rgba(15,23,42,.10);
  border-radius:22px;
  box-shadow:var(--colcall-shadow);
  overflow:hidden;
  transform:translateY(118%);
  opacity:0;
  pointer-events:none;
  transition:transform .28s cubic-bezier(.22,1,.36,1), opacity .28s cubic-bezier(.22,1,.36,1);
}

.colleague-call-widget.show{
  transform:translateY(0);
  opacity:1;
  pointer-events:auto;
}

.colleague-call-widget-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:12px;
  background:#f8fafc;
  border-bottom:1px solid #e2e8f0;
}

.colleague-call-widget-head strong{
  color:var(--colcall-title);
}

.colleague-call-widget-body{
  padding:16px;
  display:grid;
  gap:14px;
}

.colleague-call-person{
  display:flex;
  align-items:center;
  gap:12px;
}

.colleague-call-person .colleague-avatar{
  width:50px;
  height:50px;
  font-size:14px;
}

.colleague-call-person b{
  display:block;
  color:var(--colcall-title);
  font-size:14px;
}

.colleague-call-person small{
  display:block;
  color:var(--colcall-muted);
  margin-top:2px;
}

.colleague-call-state{
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  color:#475467;
  font-size:12px;
  font-weight:800;
}

.colleague-call-controls{
  display:flex;
  justify-content:center;
  gap:8px;
}

.colleague-call-control{
  width:46px!important;
  height:46px!important;
  min-height:46px!important;
  border-radius:50%!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
  font-size:16px!important;
}

.colleague-call-control.end{
  background:#dc2626!important;
  border-color:#dc2626!important;
  color:#fff!important;
}

.colleague-call-control.primary{
  background:var(--colcall-blue)!important;
  border-color:var(--colcall-blue)!important;
  color:#fff!important;
}

.colleague-call-control.green{
  background:var(--colcall-green)!important;
  border-color:var(--colcall-green)!important;
  color:#fff!important;
}

@media(max-width:720px){
  .colleague-call-entry{
    grid-template-columns:1fr;
  }
  .colleague-call-actions{
    width:100%;
  }
  .colleague-call-actions button{
    flex:1;
  }
  .colleague-row{
    grid-template-columns:auto 1fr;
  }
  .colleague-row-actions{
    grid-column:2;
  }
}


/* =========================================================
   NEXAOS FULL FRONTEND CSS REWRITE
   Restyle globale: spacing coerente, griglia più pulita,
   UI più professionale, moderna e leggibile.
   Conserva tutte le funzioni esistenti.
   ========================================================= */

:root{
  --nx-bg:#f3f6fb;
  --nx-bg-2:#eef3f9;
  --nx-surface:#ffffff;
  --nx-surface-soft:#f8fafc;
  --nx-surface-alt:#f5f8fc;
  --nx-border:#d7e1ee;
  --nx-border-soft:rgba(15,23,42,.08);
  --nx-border-strong:rgba(15,23,42,.14);
  --nx-ink:#111827;
  --nx-title:#0f172a;
  --nx-muted:#667085;
  --nx-muted-2:#98a2b3;
  --nx-primary:#1d4ed8;
  --nx-primary-2:#2563eb;
  --nx-primary-soft:#ecf3ff;
  --nx-green:#047857;
  --nx-orange:#b45309;
  --nx-red:#be123c;
  --nx-purple:#6941c6;
  --nx-cyan:#0f766e;

  --nx-radius-xs:8px;
  --nx-radius-sm:10px;
  --nx-radius:14px;
  --nx-radius-lg:18px;
  --nx-radius-xl:24px;

  --nx-shadow-xs:0 1px 2px rgba(15,23,42,.04);
  --nx-shadow-sm:0 6px 16px rgba(15,23,42,.06);
  --nx-shadow-md:0 16px 46px rgba(15,23,42,.10);
  --nx-shadow-lg:0 30px 80px rgba(15,23,42,.16);

  --nx-gap-1:6px;
  --nx-gap-2:10px;
  --nx-gap-3:14px;
  --nx-gap-4:18px;
  --nx-gap-5:24px;
  --nx-gap-6:32px;

  --nx-ease:cubic-bezier(.22,1,.36,1);
  --nx-fast:160ms;
  --nx-normal:260ms;
  --nx-max:1720px;
}

html{
  scroll-behavior:smooth;
}

body.nexa-ui-rewrite{
  background:
    radial-gradient(circle at 0% 0%, rgba(29,78,216,.08), transparent 28%),
    linear-gradient(180deg, #f7faff 0%, var(--nx-bg) 48%, var(--nx-bg-2) 100%) !important;
  color:var(--nx-ink)!important;
  font-family:Inter,"SF Pro Display","SF Pro Text",Roboto,"Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,sans-serif!important;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  letter-spacing:-.01em;
}

body.nexa-ui-rewrite *{
  box-sizing:border-box;
}

body.nexa-ui-rewrite .app{
  width:min(100%, var(--nx-max))!important;
  max-width:var(--nx-max)!important;
  margin:0 auto!important;
  padding:0 12px 16px!important;
  gap:14px!important;
  background:transparent!important;
}

body.nexa-ui-rewrite .main{
  min-width:0!important;
  padding:0!important;
  display:block!important;
}

body.nexa-ui-rewrite .main > .view,
body.nexa-ui-rewrite .main > section,
body.nexa-ui-rewrite .main > div{
  min-width:0!important;
}

body.nexa-ui-rewrite .sidebar{
  padding:16px 14px!important;
  background:rgba(255,255,255,.80)!important;
  border:1px solid var(--nx-border-soft)!important;
  border-top:0!important;
  border-radius:0 0 var(--nx-radius-xl) var(--nx-radius-xl)!important;
  box-shadow:var(--nx-shadow-md)!important;
  backdrop-filter:blur(18px) saturate(1.05)!important;
  overflow:hidden!important;
}

body.nexa-ui-rewrite .brand{
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  padding:0 0 16px!important;
  margin:0 0 14px!important;
  border-bottom:1px solid var(--nx-border-soft)!important;
}

body.nexa-ui-rewrite .logo{
  width:46px!important;
  height:46px!important;
  border-radius:14px!important;
  background:linear-gradient(135deg,#0f172a,#17345f 55%,#1d4ed8)!important;
  box-shadow:0 14px 34px rgba(29,78,216,.20)!important;
}

body.nexa-ui-rewrite .brand h1{
  margin:0!important;
  color:var(--nx-title)!important;
  font-size:18px!important;
  line-height:1.05!important;
  font-weight:950!important;
  letter-spacing:-.06em!important;
}

body.nexa-ui-rewrite .brand small{
  color:var(--nx-muted)!important;
  font-size:10.5px!important;
  letter-spacing:.02em!important;
}

body.nexa-ui-rewrite .nav,
body.nexa-ui-rewrite #nav{
  display:grid!important;
  gap:6px!important;
}

body.nexa-ui-rewrite .nav button,
body.nexa-ui-rewrite #nav button{
  min-height:42px!important;
  padding:0 12px!important;
  display:grid!important;
  grid-template-columns:20px 1fr auto!important;
  align-items:center!important;
  gap:10px!important;
  border-radius:12px!important;
  border:1px solid transparent!important;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--nx-muted)!important;
  font-size:12.25px!important;
  font-weight:780!important;
  text-align:left!important;
  transition:
    background var(--nx-fast) var(--nx-ease),
    color var(--nx-fast) var(--nx-ease),
    border-color var(--nx-fast) var(--nx-ease),
    transform var(--nx-fast) var(--nx-ease)!important;
}

body.nexa-ui-rewrite .nav button:hover,
body.nexa-ui-rewrite #nav button:hover{
  background:var(--nx-surface-soft)!important;
  border-color:var(--nx-border-soft)!important;
  color:var(--nx-title)!important;
  transform:translateX(1px)!important;
}

body.nexa-ui-rewrite .nav button.active,
body.nexa-ui-rewrite #nav button.active{
  background:linear-gradient(180deg,#f6faff,#eef4ff)!important;
  border-color:rgba(29,78,216,.16)!important;
  color:var(--nx-primary)!important;
  box-shadow:inset 3px 0 0 var(--nx-primary)!important;
}

body.nexa-ui-rewrite .topbar{
  min-height:72px!important;
  margin:0 0 14px!important;
  padding:12px 14px!important;
  display:grid!important;
  grid-template-columns:minmax(220px,1fr) minmax(280px,640px) auto!important;
  gap:14px!important;
  align-items:center!important;
  background:rgba(255,255,255,.80)!important;
  border:1px solid var(--nx-border-soft)!important;
  border-top:0!important;
  border-radius:0 0 var(--nx-radius-xl) var(--nx-radius-xl)!important;
  box-shadow:var(--nx-shadow-sm)!important;
  backdrop-filter:blur(18px) saturate(1.05)!important;
}

body.nexa-ui-rewrite .topbar-heading,
body.nexa-ui-rewrite .page-title{
  min-width:0!important;
}

body.nexa-ui-rewrite .topbar-heading h2,
body.nexa-ui-rewrite .page-title h2{
  margin:0!important;
  color:var(--nx-title)!important;
  font-size:20px!important;
  line-height:1.08!important;
  letter-spacing:-.05em!important;
  font-weight:940!important;
}

body.nexa-ui-rewrite .topbar-heading p,
body.nexa-ui-rewrite .page-title p{
  margin:4px 0 0!important;
  color:var(--nx-muted)!important;
  font-size:11.5px!important;
}

body.nexa-ui-rewrite .search,
body.nexa-ui-rewrite .topbar .search{
  min-width:0!important;
}

body.nexa-ui-rewrite .search input,
body.nexa-ui-rewrite .topbar .search input,
body.nexa-ui-rewrite .rabbit-command-trigger{
  width:100%!important;
  min-height:42px!important;
  height:42px!important;
  border-radius:14px!important;
  border:1px solid var(--nx-border)!important;
  background:var(--nx-surface-soft)!important;
  color:var(--nx-ink)!important;
  box-shadow:inset 0 1px 2px rgba(15,23,42,.04)!important;
}

body.nexa-ui-rewrite .search input{
  padding:0 14px!important;
}

body.nexa-ui-rewrite .rightbar{
  padding:14px!important;
  background:rgba(255,255,255,.80)!important;
  border:1px solid var(--nx-border-soft)!important;
  border-top:0!important;
  border-radius:0 0 var(--nx-radius-xl) var(--nx-radius-xl)!important;
  box-shadow:var(--nx-shadow-md)!important;
  backdrop-filter:blur(18px) saturate(1.05)!important;
}

body.nexa-ui-rewrite .view{
  padding:0!important;
}

body.nexa-ui-rewrite .card,
body.nexa-ui-rewrite .post,
body.nexa-ui-rewrite .chat-panel,
body.nexa-ui-rewrite .chat-layout,
body.nexa-ui-rewrite .document-card,
body.nexa-ui-rewrite .settings-section,
body.nexa-ui-rewrite .row,
body.nexa-ui-rewrite .thread,
body.nexa-ui-rewrite .online-user,
body.nexa-ui-rewrite .video-card,
body.nexa-ui-rewrite .rabbit-dynamic-board,
body.nexa-ui-rewrite .rabbit-kpi-card,
body.nexa-ui-rewrite .rabbit-kanban-column,
body.nexa-ui-rewrite .meeting-create-card,
body.nexa-ui-rewrite .colleague-directory-panel,
body.nexa-ui-rewrite .call-floating-widget,
body.nexa-ui-rewrite .colleague-call-widget,
body.nexa-ui-rewrite .rabbit-command-box{
  background:rgba(255,255,255,.92)!important;
  border:1px solid var(--nx-border-soft)!important;
  border-radius:var(--nx-radius-lg)!important;
  box-shadow:var(--nx-shadow-xs)!important;
  overflow:hidden!important;
}

body.nexa-ui-rewrite .card:hover,
body.nexa-ui-rewrite .post:hover,
body.nexa-ui-rewrite .document-card:hover,
body.nexa-ui-rewrite .rabbit-work-card:hover{
  border-color:rgba(29,78,216,.14)!important;
  box-shadow:var(--nx-shadow-sm)!important;
}

body.nexa-ui-rewrite .rabbit-enterprise-hero,
body.nexa-ui-rewrite .video-suite-hero{
  border-radius:var(--nx-radius-xl)!important;
  padding:24px!important;
  min-height:200px!important;
  box-shadow:var(--nx-shadow-md)!important;
  background:
    radial-gradient(circle at 0% 0%, rgba(96,165,250,.24), transparent 34%),
    linear-gradient(135deg, #0f172a 0%, #17345f 52%, #1d4ed8 100%)!important;
}

body.nexa-ui-rewrite .rabbit-enterprise-hero h2,
body.nexa-ui-rewrite .video-suite-hero h2{
  font-size:clamp(30px,4vw,54px)!important;
  letter-spacing:-.07em!important;
  line-height:.96!important;
}

body.nexa-ui-rewrite .rabbit-enterprise-home,
body.nexa-ui-rewrite .video-suite-page{
  display:grid!important;
  gap:14px!important;
}

body.nexa-ui-rewrite .rabbit-kpi-strip{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:12px!important;
}

body.nexa-ui-rewrite .rabbit-kpi-card{
  padding:16px!important;
}

body.nexa-ui-rewrite .rabbit-kpi-card span{
  color:var(--nx-muted)!important;
  font-size:10.5px!important;
  text-transform:uppercase!important;
  letter-spacing:.08em!important;
  font-weight:900!important;
}

body.nexa-ui-rewrite .rabbit-kpi-card strong{
  margin-top:10px!important;
  color:var(--nx-title)!important;
  font-size:28px!important;
  letter-spacing:-.05em!important;
  line-height:1!important;
}

body.nexa-ui-rewrite .rabbit-kpi-card small{
  display:block!important;
  margin-top:8px!important;
  color:var(--nx-muted)!important;
  font-size:11.5px!important;
}

body.nexa-ui-rewrite .rabbit-dynamic-board{
  padding:14px!important;
}

body.nexa-ui-rewrite .rabbit-section-header{
  display:flex!important;
  justify-content:space-between!important;
  align-items:flex-start!important;
  gap:16px!important;
  margin:0 0 12px!important;
}

body.nexa-ui-rewrite .rabbit-section-header h3{
  margin:0!important;
  color:var(--nx-title)!important;
  font-size:15px!important;
  font-weight:900!important;
  letter-spacing:-.03em!important;
}

body.nexa-ui-rewrite .rabbit-section-header p{
  margin:4px 0 0!important;
  color:var(--nx-muted)!important;
  font-size:11.5px!important;
}

body.nexa-ui-rewrite .rabbit-section-tools{
  display:flex!important;
  gap:6px!important;
  flex-wrap:wrap!important;
}

body.nexa-ui-rewrite .rabbit-section-tools button{
  min-height:32px!important;
  border-radius:999px!important;
  padding:0 12px!important;
}

body.nexa-ui-rewrite .rabbit-kanban-board{
  gap:12px!important;
  padding-bottom:2px!important;
}

body.nexa-ui-rewrite .rabbit-kanban-column > header{
  padding:12px!important;
  min-height:48px!important;
  background:var(--nx-surface)!important;
  border-bottom:1px solid var(--nx-border-soft)!important;
}

body.nexa-ui-rewrite .rabbit-kanban-column > header strong{
  font-size:12.5px!important;
  color:var(--nx-title)!important;
}

body.nexa-ui-rewrite .rabbit-work-card{
  margin:10px!important;
  padding:12px!important;
  border-radius:var(--nx-radius)!important;
  background:#fff!important;
  border:1px solid rgba(15,23,42,.06)!important;
  box-shadow:var(--nx-shadow-xs)!important;
}

body.nexa-ui-rewrite .rabbit-work-card strong{
  font-size:12.75px!important;
  color:var(--nx-title)!important;
}

body.nexa-ui-rewrite .rabbit-work-card p{
  margin:7px 0 0!important;
  color:var(--nx-muted)!important;
  font-size:11.5px!important;
  line-height:1.45!important;
}

body.nexa-ui-rewrite .rabbit-work-card footer{
  margin-top:10px!important;
  padding-top:8px!important;
  border-top:1px solid var(--nx-border-soft)!important;
  color:var(--nx-muted)!important;
  font-size:10.75px!important;
}

body.nexa-ui-rewrite .rabbit-status,
body.nexa-ui-rewrite .meeting-badge,
body.nexa-ui-rewrite .meeting-live-chip{
  min-height:24px!important;
  border-radius:999px!important;
  padding:0 8px!important;
  font-size:10.5px!important;
  font-weight:900!important;
}

body.nexa-ui-rewrite .row,
body.nexa-ui-rewrite .document-card,
body.nexa-ui-rewrite .online-user,
body.nexa-ui-rewrite .thread{
  padding:14px!important;
}

body.nexa-ui-rewrite .post{
  padding:14px!important;
}

body.nexa-ui-rewrite .post + .post{
  margin-top:12px!important;
}

body.nexa-ui-rewrite .chat-layout{
  gap:0!important;
}

body.nexa-ui-rewrite .chat-head,
body.nexa-ui-rewrite .messenger-head,
body.nexa-ui-rewrite .rabbit-chat-head,
body.nexa-ui-rewrite .thread-head,
body.nexa-ui-rewrite .conversation-head,
body.nexa-ui-rewrite .panel-head{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:12px 14px!important;
  border-bottom:1px solid var(--nx-border-soft)!important;
  background:linear-gradient(180deg,#ffffff,#f8fafc)!important;
}

body.nexa-ui-rewrite .chat-body,
body.nexa-ui-rewrite .messenger-body,
body.nexa-ui-rewrite .thread-body{
  padding:14px!important;
  background:
    radial-gradient(circle at 0% 0%, rgba(29,78,216,.03), transparent 28%),
    #fbfcfe!important;
}

body.nexa-ui-rewrite .chat-foot,
body.nexa-ui-rewrite .messenger-foot,
body.nexa-ui-rewrite .thread-foot{
  padding:12px 14px!important;
  border-top:1px solid var(--nx-border-soft)!important;
  background:#fff!important;
}

body.nexa-ui-rewrite .topbar button,
body.nexa-ui-rewrite button,
body.nexa-ui-rewrite .call-action-btn,
body.nexa-ui-rewrite .colleague-call-btn,
body.nexa-ui-rewrite .meeting-primary-btn,
body.nexa-ui-rewrite .call-mini-btn,
body.nexa-ui-rewrite .colleague-icon-btn,
body.nexa-ui-rewrite .meeting-control,
body.nexa-ui-rewrite .colleague-call-control{
  border-radius:12px!important;
  border:1px solid var(--nx-border)!important;
  background:#fff!important;
  color:var(--nx-ink)!important;
  min-height:38px!important;
  font-size:12px!important;
  font-weight:820!important;
  box-shadow:var(--nx-shadow-xs)!important;
  transition:
    transform var(--nx-fast) var(--nx-ease),
    box-shadow var(--nx-fast) var(--nx-ease),
    border-color var(--nx-fast) var(--nx-ease),
    background var(--nx-fast) var(--nx-ease)!important;
}

body.nexa-ui-rewrite button:hover,
body.nexa-ui-rewrite .call-action-btn:hover,
body.nexa-ui-rewrite .colleague-call-btn:hover,
body.nexa-ui-rewrite .colleague-icon-btn:hover{
  transform:translateY(-1px)!important;
  border-color:rgba(29,78,216,.22)!important;
  box-shadow:var(--nx-shadow-sm)!important;
}

body.nexa-ui-rewrite button.primary,
body.nexa-ui-rewrite .meeting-primary-btn,
body.nexa-ui-rewrite .call-action-btn.primary,
body.nexa-ui-rewrite .call-mini-btn.primary,
body.nexa-ui-rewrite .colleague-call-btn.video,
body.nexa-ui-rewrite .colleague-icon-btn.video,
body.nexa-ui-rewrite .colleague-call-control.primary{
  background:var(--nx-primary)!important;
  color:#fff!important;
  border-color:var(--nx-primary)!important;
  box-shadow:0 14px 28px rgba(29,78,216,.20)!important;
}

body.nexa-ui-rewrite .call-action-btn.green,
body.nexa-ui-rewrite .call-mini-btn.green,
body.nexa-ui-rewrite .colleague-call-btn.audio,
body.nexa-ui-rewrite .colleague-icon-btn.audio,
body.nexa-ui-rewrite .colleague-call-control.green{
  background:var(--nx-green)!important;
  color:#fff!important;
  border-color:var(--nx-green)!important;
}

body.nexa-ui-rewrite .call-action-btn.red,
body.nexa-ui-rewrite .call-mini-btn.red,
body.nexa-ui-rewrite .colleague-call-control.end,
body.nexa-ui-rewrite .meeting-control.end{
  background:var(--nx-red)!important;
  color:#fff!important;
  border-color:var(--nx-red)!important;
}

body.nexa-ui-rewrite .meeting-control,
body.nexa-ui-rewrite .call-mini-btn,
body.nexa-ui-rewrite .colleague-icon-btn,
body.nexa-ui-rewrite .colleague-call-control{
  width:36px!important;
  height:36px!important;
  min-height:36px!important;
  min-width:36px!important;
  padding:0!important;
  border-radius:999px!important;
}

body.nexa-ui-rewrite .meeting-control,
body.nexa-ui-rewrite .call-mini-btn{
  width:40px!important;
  height:40px!important;
  min-height:40px!important;
  min-width:40px!important;
}

body.nexa-ui-rewrite input,
body.nexa-ui-rewrite select,
body.nexa-ui-rewrite textarea{
  width:100%!important;
  min-height:40px!important;
  border-radius:12px!important;
  border:1px solid var(--nx-border)!important;
  background:#fff!important;
  color:var(--nx-ink)!important;
  padding:8px 11px!important;
  box-shadow:inset 0 1px 2px rgba(15,23,42,.04)!important;
}

body.nexa-ui-rewrite textarea{
  min-height:96px!important;
  resize:vertical!important;
}

body.nexa-ui-rewrite input:focus,
body.nexa-ui-rewrite select:focus,
body.nexa-ui-rewrite textarea:focus{
  outline:none!important;
  border-color:rgba(29,78,216,.42)!important;
  box-shadow:0 0 0 4px rgba(29,78,216,.10)!important;
}

body.nexa-ui-rewrite table{
  width:100%!important;
  border-collapse:separate!important;
  border-spacing:0!important;
  overflow:hidden!important;
  border-radius:var(--nx-radius)!important;
  border:1px solid var(--nx-border-soft)!important;
  background:#fff!important;
}

body.nexa-ui-rewrite th,
body.nexa-ui-rewrite td{
  padding:12px!important;
  text-align:left!important;
  border-bottom:1px solid var(--nx-border-soft)!important;
  font-size:12px!important;
}

body.nexa-ui-rewrite th{
  background:#f8fafc!important;
  color:var(--nx-title)!important;
  font-weight:900!important;
}

body.nexa-ui-rewrite td{
  color:var(--nx-ink)!important;
}

body.nexa-ui-rewrite .meeting-create-head,
body.nexa-ui-rewrite .colleague-directory-head,
body.nexa-ui-rewrite .call-widget-head,
body.nexa-ui-rewrite .colleague-call-widget-head,
body.nexa-ui-rewrite .rabbit-context-header,
body.nexa-ui-rewrite .rabbit-command-head{
  padding:14px 16px!important;
  border-bottom:1px solid var(--nx-border-soft)!important;
  background:linear-gradient(180deg,#ffffff,#f8fafc)!important;
}

body.nexa-ui-rewrite .meeting-create-body,
body.nexa-ui-rewrite .call-widget-body,
body.nexa-ui-rewrite .colleague-call-widget-body,
body.nexa-ui-rewrite .rabbit-context-section{
  padding:16px!important;
}

body.nexa-ui-rewrite .meeting-form-grid,
body.nexa-ui-rewrite .meeting-options,
body.nexa-ui-rewrite .video-list,
body.nexa-ui-rewrite .colleague-directory-body{
  gap:10px!important;
}

body.nexa-ui-rewrite .video-list-item,
body.nexa-ui-rewrite .colleague-row,
body.nexa-ui-rewrite .meeting-option{
  border-radius:14px!important;
  background:var(--nx-surface-soft)!important;
  border:1px solid var(--nx-border-soft)!important;
  padding:10px!important;
}

body.nexa-ui-rewrite .meeting-room-preview{
  border-radius:18px!important;
  padding:12px!important;
  min-height:370px!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08)!important;
}

body.nexa-ui-rewrite .meeting-room-head{
  margin-bottom:4px!important;
}

body.nexa-ui-rewrite .meeting-grid{
  gap:10px!important;
}

body.nexa-ui-rewrite .meeting-tile{
  border-radius:16px!important;
}

body.nexa-ui-rewrite .meeting-tile.main{
  min-height:280px!important;
}

body.nexa-ui-rewrite .meeting-tile-label{
  left:10px!important;
  bottom:10px!important;
  min-height:24px!important;
  padding:0 8px!important;
  font-size:10.5px!important;
  border-radius:999px!important;
}

body.nexa-ui-rewrite .meeting-avatar,
body.nexa-ui-rewrite .video-list-avatar,
body.nexa-ui-rewrite .colleague-avatar{
  box-shadow:0 10px 24px rgba(29,78,216,.18)!important;
}

body.nexa-ui-rewrite .meeting-entry-toolbar,
body.nexa-ui-rewrite .colleague-call-entry,
body.nexa-ui-rewrite .call-injection-bar{
  border-radius:16px!important;
  padding:11px 12px!important;
  background:
    radial-gradient(circle at 0% 0%, rgba(29,78,216,.08), transparent 34%),
    linear-gradient(180deg,#ffffff,#f8fafc)!important;
  border:1px solid var(--nx-border-soft)!important;
  box-shadow:var(--nx-shadow-xs)!important;
}

body.nexa-ui-rewrite .meeting-entry-toolbar h3,
body.nexa-ui-rewrite .colleague-call-entry h3{
  color:var(--nx-title)!important;
  font-size:13.5px!important;
}

body.nexa-ui-rewrite .meeting-entry-toolbar p,
body.nexa-ui-rewrite .colleague-call-entry p,
body.nexa-ui-rewrite .call-injection-bar small{
  color:var(--nx-muted)!important;
  font-size:11.25px!important;
}

body.nexa-ui-rewrite .rabbit-command-palette,
body.nexa-ui-rewrite .meeting-create-panel{
  backdrop-filter:blur(9px)!important;
}

body.nexa-ui-rewrite .rabbit-command-box{
  border-radius:22px!important;
  box-shadow:var(--nx-shadow-lg)!important;
}

body.nexa-ui-rewrite .rabbit-command-result{
  border-radius:14px!important;
  padding:10px!important;
}

body.nexa-ui-rewrite .rabbit-command-result strong{
  color:var(--nx-title)!important;
  font-size:12.75px!important;
}

body.nexa-ui-rewrite .rabbit-command-result small{
  color:var(--nx-muted)!important;
}

body.nexa-ui-rewrite .rabbit-context-panel{
  background:rgba(255,255,255,.92)!important;
  border-left:1px solid var(--nx-border-soft)!important;
  box-shadow:var(--nx-shadow-lg)!important;
  backdrop-filter:blur(18px) saturate(1.05)!important;
}

body.nexa-ui-rewrite .rabbit-context-header h2{
  color:var(--nx-title)!important;
  font-size:19px!important;
  font-weight:940!important;
}

body.nexa-ui-rewrite .rabbit-eyebrow{
  color:var(--nx-muted)!important;
  font-size:10.5px!important;
  letter-spacing:.08em!important;
}

body.nexa-ui-rewrite .rabbit-quick-actions{
  gap:8px!important;
}

body.nexa-ui-rewrite .rabbit-quick-actions button{
  min-height:36px!important;
}

body.nexa-ui-rewrite .timeline{
  margin:0!important;
  padding-left:18px!important;
}

body.nexa-ui-rewrite .timeline li{
  color:var(--nx-muted)!important;
  font-size:12px!important;
  line-height:1.5!important;
  margin:0 0 10px!important;
}

body.nexa-ui-rewrite .timeline strong{
  display:block!important;
  color:var(--nx-title)!important;
  font-size:12.5px!important;
}

body.nexa-ui-rewrite .timeline small{
  color:var(--nx-muted)!important;
}

body.nexa-ui-rewrite .meeting-create-card,
body.nexa-ui-rewrite .colleague-call-widget,
body.nexa-ui-rewrite .call-floating-widget{
  box-shadow:var(--nx-shadow-lg)!important;
}

body.nexa-ui-rewrite .rabbit-command-trigger kbd,
body.nexa-ui-rewrite .rabbit-kbd{
  border-radius:8px!important;
  border:1px solid var(--nx-border)!important;
  background:#fff!important;
  color:var(--nx-muted)!important;
  font-size:10.5px!important;
  padding:2px 7px!important;
}

@media(max-width:1360px){
  body.nexa-ui-rewrite .rabbit-kpi-strip{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

@media(max-width:1180px){
  body.nexa-ui-rewrite .app{
    width:100%!important;
    max-width:100%!important;
    padding:0!important;
    display:block!important;
  }

  body.nexa-ui-rewrite .topbar{
    grid-template-columns:1fr!important;
    padding:12px!important;
    gap:12px!important;
  }

  body.nexa-ui-rewrite .main{
    padding:0 10px 96px!important;
  }

  body.nexa-ui-rewrite .rightbar{
    display:none!important;
  }

  body.nexa-ui-rewrite .sidebar{
    position:fixed!important;
    left:10px!important;
    right:10px!important;
    bottom:10px!important;
    top:auto!important;
    z-index:9000!important;
    height:66px!important;
    padding:8px!important;
    border-radius:22px!important;
    overflow-x:auto!important;
  }

  body.nexa-ui-rewrite .brand{
    display:none!important;
  }

  body.nexa-ui-rewrite .nav,
  body.nexa-ui-rewrite #nav{
    display:flex!important;
    gap:8px!important;
    width:100%!important;
  }

  body.nexa-ui-rewrite .nav button,
  body.nexa-ui-rewrite #nav button{
    min-width:48px!important;
    width:48px!important;
    height:48px!important;
    min-height:48px!important;
    padding:0!important;
    display:grid!important;
    place-items:center!important;
    grid-template-columns:1fr!important;
    gap:0!important;
  }

  body.nexa-ui-rewrite .nav button span:not(:first-child),
  body.nexa-ui-rewrite #nav button span:not(:first-child),
  body.nexa-ui-rewrite .nav button b,
  body.nexa-ui-rewrite #nav button b{
    display:none!important;
  }

  body.nexa-ui-rewrite .rabbit-context-panel{
    width:min(430px,100vw)!important;
  }
}

@media(max-width:860px){
  body.nexa-ui-rewrite .rabbit-enterprise-hero,
  body.nexa-ui-rewrite .video-suite-hero{
    grid-template-columns:1fr!important;
    padding:20px!important;
  }

  body.nexa-ui-rewrite .rabbit-section-header{
    flex-direction:column!important;
  }

  body.nexa-ui-rewrite .meeting-form-grid,
  body.nexa-ui-rewrite .meeting-options,
  body.nexa-ui-rewrite .rabbit-quick-actions{
    grid-template-columns:1fr!important;
  }

  body.nexa-ui-rewrite .meeting-grid{
    grid-template-columns:1fr!important;
  }
}

@media(max-width:720px){
  body.nexa-ui-rewrite .main{
    padding:0 8px 96px!important;
  }

  body.nexa-ui-rewrite .rabbit-kpi-strip{
    grid-template-columns:1fr!important;
  }

  body.nexa-ui-rewrite .rabbit-enterprise-hero h2,
  body.nexa-ui-rewrite .video-suite-hero h2{
    font-size:34px!important;
  }

  body.nexa-ui-rewrite .meeting-room-preview{
    min-height:320px!important;
  }

  body.nexa-ui-rewrite .meeting-tile.main{
    min-height:220px!important;
  }

  body.nexa-ui-rewrite table,
  body.nexa-ui-rewrite thead,
  body.nexa-ui-rewrite tbody,
  body.nexa-ui-rewrite th,
  body.nexa-ui-rewrite td,
  body.nexa-ui-rewrite tr{
    display:block!important;
  }

  body.nexa-ui-rewrite thead{
    display:none!important;
  }

  body.nexa-ui-rewrite tr{
    margin-bottom:10px!important;
    border-bottom:1px solid var(--nx-border-soft)!important;
  }

  body.nexa-ui-rewrite td{
    border-bottom:0!important;
    padding:8px 12px!important;
  }
}


/* =========================================================
   SPACING REGULARIZATION PATCH
   Uniforma spazi, allineamenti e griglia chat
   ========================================================= */
.main>.view.active{display:grid;gap:14px;align-content:start}
.hero{padding:18px 18px 16px!important;border-radius:18px!important;margin:0!important;min-height:auto!important}
.hero:after{font-size:50px!important;top:14px!important;right:18px!important}
.hero h2{font-size:clamp(28px,3vw,44px)!important;line-height:.98!important;max-width:760px!important;margin:10px 0 8px!important}
.hero p{margin:0!important;max-width:820px!important}
.hero .actions{margin-top:14px!important}
.topbar{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:12px!important;padding:10px 14px!important;border-radius:0 0 16px 16px!important}
.topbar .search{min-width:0!important;max-width:760px!important;width:100%!important}
.topbar .actions,.topbar>div:last-child{justify-self:end!important}
.topbar input{min-height:40px!important;padding:0 12px!important}
.sidebar,.rightbar,.main{min-width:0!important}
.rightbar{display:grid!important;align-content:start!important;gap:12px!important}
.rightbar .card,.rightbar .online-user,.rightbar .thread{margin:0!important}
.chat-layout.rabbit-messenger{display:grid!important;grid-template-columns:300px minmax(0,1fr) 260px!important;gap:12px!important;border:0!important;border-radius:0!important;background:transparent!important;min-height:auto!important;align-items:stretch!important}
.chat-layout.rabbit-messenger>.call-injection-bar{grid-column:1/-1!important;order:-1!important;margin:0!important}
.rabbit-chat-list,.rabbit-chat-main,.rabbit-chat-info{border:1px solid var(--line)!important;border-radius:16px!important;background:rgba(255,255,255,.94)!important;box-shadow:0 8px 24px rgba(16,24,40,.06)!important;min-height:620px!important}
.rabbit-chat-list{padding:14px!important;display:grid!important;grid-template-rows:auto auto 1fr!important;gap:10px!important;overflow:auto!important}
.rabbit-chat-list-head{margin:0!important}
.rabbit-chat-search{margin:0!important}
#messengerThreads{display:grid!important;gap:8px!important;align-content:start!important}
.rabbit-thread{margin:0!important}
.rabbit-chat-main{display:grid!important;grid-template-rows:auto 1fr auto!important;overflow:hidden!important}
.rabbit-chat-head,.rabbit-chat-input{padding:12px 14px!important}
.rabbit-chat-body{padding:14px!important;overflow:auto!important}
.rabbit-chat-info{padding:14px!important;display:grid!important;align-content:start!important;gap:10px!important;overflow:auto!important}
.rabbit-chat-info>*{margin:0!important}
.rabbit-chat-info-card{margin-top:0!important}
.call-injection-bar{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important;padding:12px 14px!important;border-radius:16px!important}
.call-injection-bar>div:first-child{min-width:0!important}
.call-injection-bar b{display:block!important;margin-bottom:2px!important}
.chat-call-toolbar{display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:wrap!important}
.online-user{padding:10px!important}
.row{margin:0!important}
.thread{margin:0!important}
.card,.post,.document-card,.knowledge-card,.settings-section{margin:0!important}
.grid,.social-layout,.page-layout,.settings-layout,.form-grid{gap:12px!important}
@media(max-width:1180px){
  .main>.view.active{gap:10px!important}
  .topbar{grid-template-columns:1fr!important}
  .topbar .actions,.topbar>div:last-child{justify-self:start!important}
  .chat-layout.rabbit-messenger{grid-template-columns:1fr!important}
  .chat-layout.rabbit-messenger>.call-injection-bar{grid-column:auto!important}
  .rabbit-chat-list,.rabbit-chat-main,.rabbit-chat-info{min-height:auto!important}
}


/* =========================================================
   ORDERED SPACING + CHAT GRID NORMALIZATION PATCH
   ========================================================= */
:root{
  --space-1:6px; --space-2:10px; --space-3:14px; --space-4:18px; --space-5:24px;
}
.main>.view.active{display:grid!important;gap:16px!important;align-content:start!important}
.topbar{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:14px!important;align-items:center!important;padding:10px 16px!important}
.topbar .search{width:100%!important;max-width:none!important;min-width:0!important}
.topbar .search input{width:100%!important}
.topbar>.actions,.topbar>div:last-child{justify-self:end!important;display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:wrap!important}
.hero{padding:20px!important;border-radius:16px!important}
.hero .actions{display:flex!important;gap:8px!important;flex-wrap:wrap!important;margin-top:16px!important}
.card,.post,.row,.online-user,.thread,.document-card,.knowledge-card,.settings-section{margin:0!important}
.rightbar{display:grid!important;align-content:start!important;gap:14px!important}
.rightbar > br{display:none!important}
#briefBox,.social-layout,.page-layout,.settings-layout,.form-grid,.grid{gap:14px!important}
#onlineBox,#quickThreads{display:grid!important;gap:10px!important}

/* Messenger layout */
.chat-layout.rabbit-messenger{
  display:grid!important;
  grid-template-columns:minmax(260px,292px) minmax(420px,1fr) minmax(280px,320px)!important;
  grid-auto-rows:min-content!important;
  gap:14px!important;
  align-items:start!important;
  border:0!important;
  background:transparent!important;
  overflow:visible!important;
}
.chat-layout.rabbit-messenger > .call-injection-bar,
.chat-layout.rabbit-messenger > .colleague-call-entry,
.chat-layout.rabbit-messenger > .colleague-directory-panel{
  grid-column:1 / -1!important;
  width:100%!important;
  margin:0!important;
}
.chat-layout.rabbit-messenger > .call-injection-bar{order:-3!important}
.chat-layout.rabbit-messenger > .colleague-call-entry{order:-2!important}
.chat-layout.rabbit-messenger > .colleague-directory-panel{order:-1!important}

.call-injection-bar,
.colleague-call-entry{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:16px!important;
  padding:14px 16px!important;
  border-radius:16px!important;
}
.call-injection-bar > div:first-child,
.colleague-call-entry > div:first-child{min-width:0!important;flex:1 1 auto!important}
.call-injection-bar h3,.call-injection-bar b,
.colleague-call-entry h3{margin:0!important}
.call-injection-bar small,
.colleague-call-entry p{margin:4px 0 0!important;line-height:1.45!important}
.chat-call-toolbar,.colleague-call-actions{display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:wrap!important;justify-content:flex-end!important}

.rabbit-chat-list,
.rabbit-chat-main,
.rabbit-chat-info{
  min-width:0!important;
  min-height:640px!important;
  border:1px solid var(--line)!important;
  border-radius:16px!important;
  background:rgba(255,255,255,.96)!important;
  box-shadow:0 10px 28px rgba(16,24,40,.06)!important;
  overflow:hidden!important;
}
.rabbit-chat-list{display:grid!important;grid-template-rows:auto auto 1fr!important;gap:10px!important;padding:14px!important;align-content:start!important}
.rabbit-chat-list-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;margin:0!important}
.rabbit-chat-search{margin:0!important}
.rabbit-chat-search input{min-height:40px!important}
#messengerThreads{display:grid!important;gap:8px!important;align-content:start!important}
.rabbit-thread{padding:12px!important;border-radius:12px!important;margin:0!important}
.rabbit-thread > div:nth-child(2){min-width:0!important}
.rabbit-thread b,.rabbit-thread small{display:block!important;white-space:normal!important;line-height:1.35!important}

.rabbit-chat-main{display:grid!important;grid-template-rows:auto 1fr auto!important}
.rabbit-chat-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;padding:14px 16px!important}
.rabbit-chat-person{display:flex!important;align-items:center!important;gap:10px!important;min-width:0!important;flex:1 1 auto!important}
.rabbit-chat-person > div{min-width:0!important}
.rabbit-chat-person b,.rabbit-chat-person small{display:block!important;overflow-wrap:anywhere!important;line-height:1.35!important}
.rabbit-chat-head .actions{display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:nowrap!important;flex-shrink:0!important}
.rabbit-chat-body{padding:16px!important;display:flex!important;flex-direction:column!important;gap:10px!important}
.rabbit-msg-row{margin:0!important}
.rabbit-chat-input{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;gap:8px!important;padding:12px 14px!important}

.rabbit-chat-info{padding:16px!important;display:grid!important;align-content:start!important;grid-auto-rows:min-content!important;gap:14px!important}
.rabbit-chat-info > div:first-child{display:grid!important;justify-items:center!important;gap:8px!important;text-align:center!important}
.rabbit-chat-info h3{margin:0!important;font-size:18px!important;line-height:1.25!important;white-space:normal!important;overflow-wrap:anywhere!important}
.rabbit-chat-info p{margin:0!important;line-height:1.45!important}
.rabbit-chat-info-card{margin:0!important;padding:14px!important;border-radius:14px!important}
.rabbit-chat-info-card p{line-height:1.55!important;word-break:break-word!important}
.rabbit-chat-info-card button{width:100%!important;justify-content:center!important}
.colleague-directory-panel{padding:0!important;overflow:hidden!important}
.colleague-directory-head{padding:12px 14px!important}
.colleague-directory-body{display:grid!important;gap:8px!important;padding:12px!important;max-height:300px!important}
.colleague-row{padding:10px 12px!important}
.colleague-row > div:nth-child(2){min-width:0!important}
.colleague-row b,.colleague-row small{line-height:1.35!important;overflow-wrap:anywhere!important}
.colleague-row-actions{display:flex!important;align-items:center!important;gap:6px!important;flex-wrap:nowrap!important}

@media (max-width:1280px){
  .chat-layout.rabbit-messenger{grid-template-columns:260px minmax(0,1fr)!important}
  .rabbit-chat-info{grid-column:1 / -1!important;min-height:auto!important}
}
@media (max-width:980px){
  .topbar{grid-template-columns:1fr!important}
  .topbar>.actions,.topbar>div:last-child{justify-self:start!important}
  .chat-layout.rabbit-messenger{grid-template-columns:1fr!important;gap:12px!important}
  .chat-layout.rabbit-messenger > *{grid-column:auto!important}
  .call-injection-bar,.colleague-call-entry{flex-direction:column!important;align-items:flex-start!important}
  .chat-call-toolbar,.colleague-call-actions{justify-content:flex-start!important}
  .rabbit-chat-list,.rabbit-chat-main,.rabbit-chat-info{min-height:auto!important}
}


/* =========================================================
   NEXAOS REAL WEBRTC CALLS
   Audio/video reali con WebRTC + Supabase signaling.
   ========================================================= */

.real-call-layer{
  position:fixed;
  inset:0;
  z-index:30000;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(15,23,42,.62);
  backdrop-filter:blur(12px);
}

.real-call-layer.show{
  display:flex;
}

.real-call-shell{
  width:min(1180px,100%);
  height:min(760px,calc(100vh - 36px));
  border-radius:24px;
  background:
    radial-gradient(circle at 0% 0%, rgba(37,99,235,.22), transparent 32%),
    linear-gradient(135deg,#0f172a,#111827 58%,#17345f);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 36px 120px rgba(0,0,0,.42);
  color:#fff;
  overflow:hidden;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
}

.real-call-head{
  min-height:62px;
  padding:14px 16px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  border-bottom:1px solid rgba(255,255,255,.10);
  background:rgba(15,23,42,.36);
}

.real-call-head h2{
  margin:0;
  color:#fff;
  font-size:17px;
  font-weight:950;
  letter-spacing:-.035em;
}

.real-call-head p{
  margin:3px 0 0;
  color:#cbd5e1;
  font-size:12px;
}

.real-call-status{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.14);
  color:#dbeafe;
  font-size:11px;
  font-weight:850;
}

.real-call-status::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:#22c55e;
  box-shadow:0 0 0 4px rgba(34,197,94,.15);
}

.real-call-stage{
  min-height:0;
  padding:14px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 280px;
  gap:14px;
}

.real-call-videos{
  min-height:0;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.real-video-tile{
  position:relative;
  min-height:220px;
  border-radius:18px;
  overflow:hidden;
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.16), transparent 28%),
    linear-gradient(135deg,#1e293b,#020617);
  border:1px solid rgba(255,255,255,.10);
  display:grid;
  place-items:center;
}

.real-video-tile.main{
  grid-column:1 / -1;
}

.real-video-tile video{
  width:100%;
  height:100%;
  object-fit:cover;
  background:#020617;
}

.real-video-placeholder{
  width:76px;
  height:76px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#1d4ed8,#0ea5e9);
  color:#fff;
  font-size:24px;
  font-weight:950;
  border:3px solid rgba(255,255,255,.18);
}

.real-video-label{
  position:absolute;
  left:12px;
  bottom:12px;
  min-height:28px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:0 10px;
  border-radius:999px;
  background:rgba(15,23,42,.66);
  color:#fff;
  font-size:11.5px;
  font-weight:850;
  backdrop-filter:blur(10px);
}

.real-call-side{
  min-width:0;
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  gap:12px;
}

.real-call-card{
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.08);
  padding:12px;
  min-width:0;
}

.real-call-card h3{
  margin:0 0 8px;
  color:#fff;
  font-size:13px;
  font-weight:900;
}

.real-call-card p,
.real-call-card small{
  color:#cbd5e1;
  font-size:11.5px;
}

.real-call-log{
  display:grid;
  gap:8px;
  align-content:start;
  overflow:auto;
  max-height:100%;
}

.real-call-log div{
  border-radius:12px;
  padding:9px;
  background:rgba(15,23,42,.38);
  color:#dbeafe;
  font-size:11.5px;
}

.real-call-controls{
  min-height:76px;
  padding:14px;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  border-top:1px solid rgba(255,255,255,.10);
  background:rgba(15,23,42,.42);
}

.real-control-btn{
  width:48px!important;
  height:48px!important;
  min-height:48px!important;
  min-width:48px!important;
  border-radius:50%!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
  border:1px solid rgba(255,255,255,.16)!important;
  background:rgba(255,255,255,.12)!important;
  color:#fff!important;
  box-shadow:none!important;
  font-size:17px!important;
}

.real-control-btn.active{
  background:#1d4ed8!important;
  border-color:#1d4ed8!important;
}

.real-control-btn.danger{
  background:#dc2626!important;
  border-color:#dc2626!important;
}

.real-control-btn:hover{
  transform:translateY(-1px)!important;
  background:rgba(255,255,255,.18)!important;
}

.real-incoming-call{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:31000;
  width:min(390px,calc(100vw - 28px));
  border-radius:22px;
  background:#fff;
  border:1px solid rgba(15,23,42,.10);
  box-shadow:0 32px 90px rgba(15,23,42,.26);
  overflow:hidden;
  display:none;
}

.real-incoming-call.show{
  display:block;
}

.real-incoming-head{
  padding:14px;
  background:#f8fafc;
  border-bottom:1px solid #e2e8f0;
}

.real-incoming-head strong{
  display:block;
  color:#0f172a;
  font-size:14px;
}

.real-incoming-head small{
  color:#667085;
}

.real-incoming-body{
  padding:14px;
  display:grid;
  gap:12px;
}

.real-incoming-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
}

.real-incoming-actions button{
  border-radius:999px!important;
  padding:0 14px!important;
}

.real-incoming-actions .accept{
  background:#047857!important;
  color:#fff!important;
  border-color:#047857!important;
}

.real-incoming-actions .reject{
  background:#be123c!important;
  color:#fff!important;
  border-color:#be123c!important;
}

@media(max-width:900px){
  .real-call-shell{
    height:calc(100vh - 24px);
    border-radius:18px;
  }

  .real-call-stage{
    grid-template-columns:1fr;
    overflow:auto;
  }

  .real-call-videos{
    grid-template-columns:1fr;
  }

  .real-video-tile.main{
    grid-column:auto;
  }

  .real-call-side{
    grid-template-rows:auto auto;
  }
}


/* =========================================================
   NEXAOS USERS & INVITES
   Impostazioni -> Utenti e permessi
   ========================================================= */
.users-admin-panel{display:grid;gap:14px}.users-admin-hero{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:16px;border:1px solid rgba(15,23,42,.08);border-radius:18px;background:radial-gradient(circle at 0% 0%,rgba(29,78,216,.10),transparent 34%),linear-gradient(180deg,#fff,#f8fafc);box-shadow:0 1px 2px rgba(15,23,42,.06)}.users-admin-hero h3{margin:0;color:#0f172a;font-size:18px;font-weight:950;letter-spacing:-.04em}.users-admin-hero p{margin:5px 0 0;color:#667085;font-size:12px;line-height:1.45}.users-admin-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.users-admin-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(320px,.9fr);gap:14px;align-items:start}.users-admin-card{background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:18px;box-shadow:0 1px 2px rgba(15,23,42,.06);overflow:hidden}.users-admin-card header{padding:14px 16px;border-bottom:1px solid #e2e8f0;background:#f8fafc;display:flex;align-items:center;justify-content:space-between;gap:12px}.users-admin-card header h3{margin:0;color:#0f172a;font-size:14px;font-weight:900}.users-admin-card header small{color:#667085}.users-admin-body{padding:14px;display:grid;gap:10px}.user-admin-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px;border:1px solid #e2e8f0;border-radius:14px;background:#f8fafc}.user-admin-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#1d4ed8,#0ea5e9);color:#fff;font-size:12px;font-weight:950}.user-admin-row b{display:block;color:#0f172a;font-size:13px}.user-admin-row small{display:block;color:#667085;margin-top:2px;font-size:11.5px}.user-admin-tags{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.user-pill{display:inline-flex;align-items:center;min-height:23px;padding:0 8px;border-radius:999px;border:1px solid #c7d8ff;background:#eef4ff;color:#174ea6;font-size:10.5px;font-weight:900}.user-pill.green{border-color:#bbf7d0;background:#ecfdf3;color:#047857}.user-pill.orange{border-color:#fde68a;background:#fffbeb;color:#92400e}.invite-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.invite-field.full{grid-column:1/-1}.invite-field label{display:block;margin-bottom:5px;color:#344054;font-size:11px;font-weight:900}.invite-field input,.invite-field select,.invite-field textarea{width:100%;min-height:40px;border:1px solid #d9e2ee;border-radius:12px;padding:8px 10px;background:#fff;color:#101828}.invite-field textarea{min-height:76px;resize:vertical}.invite-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;padding-top:10px;border-top:1px solid #e2e8f0}.invite-note{border:1px solid #c7d8ff;background:#eef4ff;color:#174ea6;border-radius:14px;padding:10px;font-size:11.5px;line-height:1.45}.users-settings-tab-btn{border-color:#c7d8ff!important;background:#eef4ff!important;color:#174ea6!important}@media(max-width:980px){.users-admin-grid{grid-template-columns:1fr}.users-admin-hero{flex-direction:column}.users-admin-actions{justify-content:flex-start}}@media(max-width:640px){.invite-form-grid{grid-template-columns:1fr}.user-admin-row{grid-template-columns:auto 1fr}.user-admin-tags{grid-column:2;justify-content:flex-start}}


/* =========================================================
   NEXAOS FRONTEND SUPABASE CONFIG
   Pannello configurazione Supabase URL + Anon Key
   ========================================================= */

.supabase-config-panel{
  position:fixed;
  inset:0;
  z-index:32000;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(15,23,42,.52);
  backdrop-filter:blur(10px);
}

.supabase-config-panel.show{
  display:flex;
}

.supabase-config-card{
  width:min(760px,100%);
  max-height:88vh;
  overflow:auto;
  background:#fff;
  border:1px solid rgba(255,255,255,.72);
  border-radius:24px;
  box-shadow:0 30px 90px rgba(15,23,42,.28);
}

.supabase-config-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  padding:18px;
  border-bottom:1px solid #e2e8f0;
  background:#f8fafc;
}

.supabase-config-head h2{
  margin:0;
  color:#0f172a;
  font-size:20px;
  line-height:1.1;
  letter-spacing:-.04em;
  font-weight:950;
}

.supabase-config-head p{
  margin:5px 0 0;
  color:#667085;
  font-size:12px;
  line-height:1.45;
}

.supabase-config-body{
  padding:18px;
  display:grid;
  gap:14px;
}

.supabase-config-grid{
  display:grid;
  gap:12px;
}

.supabase-config-field label{
  display:block;
  margin-bottom:5px;
  color:#344054;
  font-size:11px;
  font-weight:900;
}

.supabase-config-field input,
.supabase-config-field textarea{
  width:100%;
  min-height:42px;
  border:1px solid #d9e2ee;
  border-radius:12px;
  background:#fff;
  color:#101828;
  padding:8px 10px;
  font-family:inherit;
}

.supabase-config-field textarea{
  min-height:120px;
  resize:vertical;
}

.supabase-config-note{
  border:1px solid #c7d8ff;
  background:#eef4ff;
  color:#174ea6;
  border-radius:14px;
  padding:11px;
  font-size:12px;
  line-height:1.48;
}

.supabase-config-note.warning{
  border-color:#fde68a;
  background:#fffbeb;
  color:#92400e;
}

.supabase-config-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  padding-top:12px;
  border-top:1px solid #e2e8f0;
}

.supabase-config-actions button.primary,
.supabase-config-btn.primary{
  background:#1d4ed8!important;
  border-color:#1d4ed8!important;
  color:#fff!important;
}

.supabase-config-status{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  background:#eef4ff;
  border:1px solid #c7d8ff;
  color:#174ea6;
  font-size:11px;
  font-weight:900;
}

.supabase-config-status.ok{
  background:#ecfdf3;
  border-color:#bbf7d0;
  color:#047857;
}

.supabase-config-status.ko{
  background:#fff1f2;
  border-color:#fecdd3;
  color:#be123c;
}


/* =========================================================
   NEXAOS PROFILES LIVE SYNC
   ========================================================= */
.user-sync-mini{display:inline-flex;align-items:center;gap:6px;min-height:26px;padding:0 9px;border-radius:999px;background:#ecfdf3;border:1px solid #bbf7d0;color:#047857;font-size:10.5px;font-weight:900}
.user-sync-mini.ko{background:#fff7ed;border-color:#fed7aa;color:#9a3412}
.user-sync-empty{border:1px solid #c7d8ff;background:#eef4ff;color:#174ea6;border-radius:14px;padding:10px;font-size:11.5px;line-height:1.45}


/* =========================================================
   NEXAOS SAFE USERS SYNC
   Non svuota più la UI se public.profiles è vuota.
   ========================================================= */
.safe-sync-banner{
  border:1px solid #fed7aa;
  background:#fff7ed;
  color:#9a3412;
  border-radius:14px;
  padding:10px;
  font-size:11.5px;
  line-height:1.45;
}
.safe-sync-banner.ok{
  border-color:#bbf7d0;
  background:#ecfdf3;
  color:#047857;
}
.safe-sync-tools{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
.safe-sync-tools button{
  min-height:34px!important;
}


/* =========================================================
   NEXAOS USERS MERGE REPAIR
   Mostra utenti da profiles + inviti + online + fallback.
   ========================================================= */
.users-merge-source{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:22px;
  padding:0 7px;
  border-radius:999px;
  border:1px solid #c7d8ff;
  background:#eef4ff;
  color:#174ea6;
  font-size:10px;
  font-weight:900;
}
.users-merge-alert{
  border:1px solid #c7d8ff;
  background:#eef4ff;
  color:#174ea6;
  border-radius:14px;
  padding:10px;
  font-size:11.5px;
  line-height:1.45;
  margin-bottom:10px;
}
.users-merge-alert.warn{
  border-color:#fed7aa;
  background:#fff7ed;
  color:#9a3412;
}


/* NEXAOS SIGNUP + ADMIN APPROVAL */
.signup-modal{position:fixed;inset:0;z-index:33000;display:none;align-items:center;justify-content:center;padding:18px;background:rgba(15,23,42,.52);backdrop-filter:blur(10px)}
.signup-modal.show{display:flex}
.signup-modal-card,.signup-approval-card{width:min(760px,100%);max-height:88vh;overflow:auto;background:#fff;border:1px solid rgba(255,255,255,.72);border-radius:24px;box-shadow:0 30px 90px rgba(15,23,42,.28)}
.signup-approval-card{width:auto;max-height:none;margin-top:14px}
.signup-modal-head,.signup-approval-card header{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:18px;border-bottom:1px solid #e2e8f0;background:#f8fafc}
.signup-modal-head h2,.signup-approval-card h3{margin:0;color:#0f172a;font-size:20px;line-height:1.1;letter-spacing:-.04em;font-weight:950}
.signup-approval-card h3{font-size:14px;letter-spacing:-.02em}
.signup-modal-head p,.signup-approval-card small{margin:5px 0 0;color:#667085;font-size:12px;line-height:1.45}
.signup-request-body{padding:14px;display:grid;gap:10px}
.signup-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.signup-field.full{grid-column:1/-1}
.signup-field label{display:block;margin-bottom:5px;color:#344054;font-size:11px;font-weight:900}
.signup-field input,.signup-field select,.signup-field textarea{width:100%;min-height:40px;border:1px solid #d9e2ee;border-radius:12px;background:#fff;color:#101828;padding:8px 10px}
.signup-field textarea{min-height:78px;resize:vertical}
.signup-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;padding-top:10px;border-top:1px solid #e2e8f0}
.signup-note{border:1px solid #c7d8ff;background:#eef4ff;color:#174ea6;border-radius:14px;padding:10px;font-size:11.5px;line-height:1.45}
.signup-note.warn{border-color:#fed7aa;background:#fff7ed;color:#9a3412}
.signup-request-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px;border:1px solid #e2e8f0;border-radius:14px;background:#f8fafc}
.signup-request-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#1d4ed8,#0ea5e9);color:#fff;font-size:12px;font-weight:950}
.signup-request-row b{display:block;color:#0f172a;font-size:13px}.signup-request-row small{display:block;color:#667085;margin-top:2px;font-size:11.5px}
.signup-request-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.signup-pill{display:inline-flex;align-items:center;min-height:23px;padding:0 8px;border-radius:999px;border:1px solid #fde68a;background:#fffbeb;color:#92400e;font-size:10.5px;font-weight:900}
.signup-status-block{border:1px solid #fed7aa;background:#fff7ed;color:#9a3412;border-radius:16px;padding:14px;margin:12px 0;font-size:13px;line-height:1.5}
@media(max-width:720px){.signup-form-grid{grid-template-columns:1fr}.signup-request-row{grid-template-columns:auto 1fr}.signup-request-actions{grid-column:2;justify-content:flex-start}}


/* NEXAOS SIGNUP REQUESTS VISIBLE ROUTE */
.signup-requests-page{display:grid;gap:14px}
.signup-requests-hero{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:18px;border:1px solid rgba(15,23,42,.08);border-radius:18px;background:linear-gradient(180deg,#fff,#f8fafc);box-shadow:0 1px 2px rgba(15,23,42,.06)}
.signup-requests-hero h2{margin:0;color:#0f172a;font-size:28px;line-height:1.05;letter-spacing:-.05em;font-weight:950}
.signup-requests-hero p{margin:6px 0 0;color:#667085;font-size:13px;line-height:1.45}
.signup-requests-tools{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.signup-requests-card{background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:18px;box-shadow:0 1px 2px rgba(15,23,42,.06);overflow:hidden}
.signup-requests-card header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid #e2e8f0;background:#f8fafc}
.signup-requests-card h3{margin:0;color:#0f172a;font-size:14px;font-weight:900}
.signup-requests-card small{color:#667085}
.signup-requests-body{padding:14px;display:grid;gap:10px}
.signup-nav-badge{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;border-radius:999px;background:#fffbeb;border:1px solid #fde68a;color:#92400e;font-size:11px;font-weight:950}


/* =========================================================
   NEXAOS APPROVAL GATE FIX
   Blocca davvero utenti pending/rejected e rende richieste visibili.
   ========================================================= */
.approval-gate{
  position:fixed;
  inset:0;
  z-index:35000;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:
    radial-gradient(circle at 15% 10%, rgba(37,99,235,.18), transparent 32%),
    radial-gradient(circle at 85% 90%, rgba(14,165,233,.14), transparent 30%),
    #f5f7fb;
}
.approval-gate.show{display:flex}
.approval-gate-card{
  width:min(760px,100%);
  background:#fff;
  border:1px solid rgba(15,23,42,.08);
  border-radius:26px;
  box-shadow:0 30px 100px rgba(15,23,42,.25);
  overflow:hidden;
}
.approval-gate-head{
  padding:22px;
  border-bottom:1px solid #e2e8f0;
  background:linear-gradient(180deg,#ffffff,#f8fafc);
}
.approval-gate-kicker{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:0 10px;
  border-radius:999px;
  background:#fffbeb;
  border:1px solid #fde68a;
  color:#92400e;
  font-size:11px;
  font-weight:950;
  margin-bottom:10px;
}
.approval-gate-card h1{
  margin:0;
  color:#0f172a;
  font-size:32px;
  line-height:1.02;
  letter-spacing:-.055em;
  font-weight:950;
}
.approval-gate-card p{
  color:#667085;
  font-size:14px;
  line-height:1.55;
}
.approval-gate-body{
  padding:18px 22px 22px;
  display:grid;
  gap:12px;
}
.approval-gate-box{
  border:1px solid #c7d8ff;
  background:#eef4ff;
  color:#174ea6;
  border-radius:16px;
  padding:12px;
  font-size:13px;
  line-height:1.5;
}
.approval-gate-box.warn{
  border-color:#fed7aa;
  background:#fff7ed;
  color:#9a3412;
}
.approval-gate-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  padding-top:10px;
  border-top:1px solid #e2e8f0;
}
.approval-gate-actions button.primary{
  background:#1d4ed8!important;
  border-color:#1d4ed8!important;
  color:#fff!important;
}
.approval-admin-message{
  border:1px solid #e2e8f0;
  border-radius:14px;
  padding:10px;
  width:100%;
  min-height:86px;
  resize:vertical;
}
.approval-request-source{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:0 7px;
  border-radius:999px;
  background:#eef4ff;
  border:1px solid #c7d8ff;
  color:#174ea6;
  font-size:10px;
  font-weight:900;
}


/* =========================================================
   NEXAOS REAL DIRECTORY FROM PROFILES
   Utenti, colleghi, rubrica e online reali.
   ========================================================= */
.real-directory-page{display:grid;gap:14px}
.real-directory-hero{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:18px;border:1px solid rgba(15,23,42,.08);border-radius:18px;background:linear-gradient(180deg,#fff,#f8fafc);box-shadow:0 1px 2px rgba(15,23,42,.06)}
.real-directory-hero h2{margin:0;color:#0f172a;font-size:28px;line-height:1.05;letter-spacing:-.05em;font-weight:950}
.real-directory-hero p{margin:6px 0 0;color:#667085;font-size:13px;line-height:1.45}
.real-directory-tools{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.real-directory-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.real-directory-card{background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:18px;box-shadow:0 1px 2px rgba(15,23,42,.06);overflow:hidden}
.real-directory-card header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid #e2e8f0;background:#f8fafc}
.real-directory-card h3{margin:0;color:#0f172a;font-size:14px;font-weight:900}
.real-directory-card small{color:#667085}
.real-directory-body{padding:14px;display:grid;gap:10px}
.real-person-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px;border:1px solid #e2e8f0;border-radius:14px;background:#f8fafc}
.real-person-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#1d4ed8,#0ea5e9);color:#fff;font-size:12px;font-weight:950}
.real-person-row b{display:block;color:#0f172a;font-size:13px}
.real-person-row small{display:block;color:#667085;margin-top:2px;font-size:11.5px}
.real-person-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.real-person-pill{display:inline-flex;align-items:center;min-height:22px;padding:0 7px;border-radius:999px;background:#ecfdf3;border:1px solid #bbf7d0;color:#047857;font-size:10px;font-weight:900}
.real-person-empty{border:1px solid #c7d8ff;background:#eef4ff;color:#174ea6;border-radius:14px;padding:10px;font-size:11.5px;line-height:1.45}
.real-directory-search{width:100%;min-height:40px;border:1px solid #d9e2ee;border-radius:12px;background:#fff;color:#101828;padding:8px 10px}
@media(max-width:980px){.real-directory-grid{grid-template-columns:1fr}.real-person-row{grid-template-columns:auto 1fr}.real-person-actions{grid-column:2;justify-content:flex-start}}


/* =========================================================
   NEXAOS WORKSPACE SOURCE OF TRUTH
   Una sola fonte dati: public.profiles.
   ========================================================= */
.sot-badge{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 7px;border-radius:999px;background:#eef4ff;border:1px solid #c7d8ff;color:#174ea6;font-size:10px;font-weight:950}
.sot-badge.ok{background:#ecfdf3;border-color:#bbf7d0;color:#047857}
.sot-shell{display:grid;gap:14px}
.sot-hero{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;padding:18px;border:1px solid rgba(15,23,42,.08);border-radius:18px;background:linear-gradient(180deg,#fff,#f8fafc);box-shadow:0 1px 2px rgba(15,23,42,.06)}
.sot-hero h2{margin:0;color:#0f172a;font-size:30px;line-height:1.05;letter-spacing:-.055em;font-weight:950}
.sot-hero p{margin:6px 0 0;color:#667085;font-size:13px;line-height:1.45}
.sot-tools{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.sot-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr);gap:14px;align-items:start}
.sot-card{background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:18px;box-shadow:0 1px 2px rgba(15,23,42,.06);overflow:hidden}
.sot-card header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid #e2e8f0;background:#f8fafc}
.sot-card h3{margin:0;color:#0f172a;font-size:14px;font-weight:900}
.sot-card small{color:#667085}
.sot-body{padding:14px;display:grid;gap:10px}
.sot-search{width:100%;min-height:40px;border:1px solid #d9e2ee;border-radius:12px;background:#fff;color:#101828;padding:8px 10px}
.sot-person{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px;border:1px solid #e2e8f0;border-radius:14px;background:#f8fafc}
.sot-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#1d4ed8,#0ea5e9);color:#fff;font-size:12px;font-weight:950}
.sot-person b{display:block;color:#0f172a;font-size:13px}
.sot-person small{display:block;color:#667085;margin-top:2px;font-size:11.5px}
.sot-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.sot-pill{display:inline-flex;align-items:center;min-height:22px;padding:0 7px;border-radius:999px;background:#ecfdf3;border:1px solid #bbf7d0;color:#047857;font-size:10px;font-weight:900}
.sot-pill.pending{background:#fffbeb;border-color:#fde68a;color:#92400e}
.sot-empty{border:1px solid #c7d8ff;background:#eef4ff;color:#174ea6;border-radius:14px;padding:10px;font-size:11.5px;line-height:1.45}
.sot-chat-layout{display:grid;grid-template-columns:320px minmax(0,1fr);gap:12px;min-height:520px}
.sot-chat-list{display:grid;gap:8px;align-content:start}
.sot-thread{border:1px solid #e2e8f0;background:#fff;border-radius:14px;padding:10px;cursor:pointer;display:grid;grid-template-columns:auto 1fr;gap:9px;align-items:center}
.sot-thread.active{border-color:#1d4ed8;background:#eef4ff}
.sot-chat-window{display:grid;grid-template-rows:auto minmax(0,1fr) auto;border:1px solid #e2e8f0;border-radius:16px;overflow:hidden;background:#fff}
.sot-chat-head{padding:12px 14px;border-bottom:1px solid #e2e8f0;background:#f8fafc;display:flex;justify-content:space-between;gap:10px;align-items:center}
.sot-chat-messages{padding:14px;display:grid;gap:8px;align-content:start;overflow:auto;min-height:360px;background:#fbfdff}
.sot-msg{max-width:76%;padding:9px 11px;border:1px solid #e2e8f0;border-radius:14px;background:#fff;color:#0f172a;font-size:13px;line-height:1.4}
.sot-msg.me{justify-self:end;background:#1d4ed8;color:#fff;border-color:#1d4ed8}
.sot-chat-compose{display:flex;gap:8px;padding:12px;border-top:1px solid #e2e8f0;background:#f8fafc}
.sot-chat-compose input{flex:1;min-height:40px;border:1px solid #d9e2ee;border-radius:12px;padding:8px 10px}
@media(max-width:980px){.sot-grid{grid-template-columns:1fr}.sot-chat-layout{grid-template-columns:1fr}.sot-person{grid-template-columns:auto 1fr}.sot-actions{grid-column:2;justify-content:flex-start}}


/* =========================================================
   NEXAOS REAL CHAT SUPABASE
   Chat condivisa su DB + normalizzazione profili.
   ========================================================= */
.real-chat-status{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:0 8px;
  border-radius:999px;
  background:#ecfdf3;
  border:1px solid #bbf7d0;
  color:#047857;
  font-size:10px;
  font-weight:900;
}
.real-chat-status.warn{
  background:#fff7ed;
  border-color:#fed7aa;
  color:#9a3412;
}
.real-chat-unread{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  border-radius:999px;
  background:#1d4ed8;
  color:#fff;
  font-size:10px;
  font-weight:950;
}
.real-chat-notice{
  border:1px solid #c7d8ff;
  background:#eef4ff;
  color:#174ea6;
  border-radius:14px;
  padding:10px;
  font-size:11.5px;
  line-height:1.45;
}


/* =========================================================
   NEXAOS REAL CHAT BUTTON FIX
   Forza tutti i pulsanti Chat a usare la chat reale Supabase.
   ========================================================= */
.real-chat-fix-note{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:0 8px;
  border-radius:999px;
  background:#ecfdf3;
  border:1px solid #bbf7d0;
  color:#047857;
  font-size:10px;
  font-weight:900;
}


/* =========================================================
   NEXAOS CHAT PROFILE RESOLVER FIX
   Risolve il profilo reale partendo da email/nome della riga cliccata.
   ========================================================= */
.chat-resolver-badge{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:0 8px;
  border-radius:999px;
  background:#ecfdf3;
  border:1px solid #bbf7d0;
  color:#047857;
  font-size:10px;
  font-weight:900;
}


/* =========================================================
   NEXAOS CONTACT HUB + FLOATING REAL CHAT
   Un solo bottone Contatta + chat reale + permessi chiamata.
   ========================================================= */
.nexa-old-contact-action{display:none!important}
.nexa-contact-btn{min-height:38px!important;padding:0 14px!important;border-radius:12px!important;border:1px solid #1d4ed8!important;background:#1d4ed8!important;color:#fff!important;font-weight:900!important;cursor:pointer!important}.nexa-contact-btn:hover{filter:brightness(.96);transform:translateY(-1px)}
.nexa-floating-chat{position:fixed;right:18px;bottom:18px;width:min(420px,calc(100vw - 28px));height:min(640px,calc(100vh - 42px));z-index:42000;display:none;grid-template-rows:auto minmax(0,1fr) auto;background:#fff;border:1px solid rgba(15,23,42,.12);border-radius:24px;box-shadow:0 32px 120px rgba(15,23,42,.28);overflow:hidden}.nexa-floating-chat.show{display:grid}
.nexa-floating-head{padding:14px;border-bottom:1px solid #e2e8f0;background:linear-gradient(180deg,#fff,#f8fafc);display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.nexa-floating-head-left{display:flex;align-items:center;gap:10px;min-width:0}.nexa-floating-avatar{width:42px;height:42px;border-radius:50%;background:linear-gradient(135deg,#1d4ed8,#0ea5e9);color:#fff;display:grid;place-items:center;font-size:12px;font-weight:950;flex:0 0 auto}.nexa-floating-title{min-width:0}.nexa-floating-title b{display:block;color:#0f172a;font-size:14px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nexa-floating-title small{display:block;color:#667085;font-size:11.5px;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nexa-floating-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.nexa-floating-actions button{min-height:32px!important;padding:0 9px!important;border-radius:10px!important;font-size:11px!important}
.nexa-floating-body{padding:12px;overflow:auto;display:grid;gap:8px;align-content:start;background:#fbfdff}.nexa-floating-msg{max-width:82%;padding:9px 11px;border:1px solid #e2e8f0;border-radius:15px;background:#fff;color:#0f172a;font-size:13px;line-height:1.42}.nexa-floating-msg.me{justify-self:end;background:#1d4ed8;border-color:#1d4ed8;color:#fff}.nexa-floating-msg small{opacity:.75;display:block;margin-top:4px;font-size:10px}.nexa-floating-empty{border:1px solid #c7d8ff;background:#eef4ff;color:#174ea6;border-radius:14px;padding:10px;font-size:12px;line-height:1.45}.nexa-floating-compose{padding:12px;border-top:1px solid #e2e8f0;background:#f8fafc;display:flex;gap:8px}.nexa-floating-compose input{flex:1;min-height:40px;border:1px solid #d9e2ee;border-radius:12px;padding:8px 10px;background:#fff;color:#101828}.nexa-floating-compose button{min-height:40px!important;padding:0 14px!important;border-radius:12px!important;background:#1d4ed8!important;border-color:#1d4ed8!important;color:#fff!important;font-weight:900!important}
.nexa-floating-launcher{position:fixed;right:18px;bottom:18px;z-index:41990;display:none;align-items:center;gap:8px;min-height:46px;padding:0 14px;border-radius:999px;border:1px solid #1d4ed8;background:#1d4ed8;color:#fff;box-shadow:0 16px 50px rgba(29,78,216,.35);font-weight:900;cursor:pointer}.nexa-floating-launcher.show{display:flex}.nexa-contact-toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:43000;display:none;max-width:min(520px,calc(100vw - 26px));padding:12px 14px;border-radius:16px;background:#101828;color:#fff;box-shadow:0 18px 60px rgba(15,23,42,.32);font-size:13px;line-height:1.4}.nexa-contact-toast.show{display:block}
@media(max-width:700px){.nexa-floating-chat{inset:0;width:100vw;height:100vh;border-radius:0}}


/* =========================================================
   NEXAOS REALTIME NOTIFICATIONS + CHAT + CALLS
   Notifiche vere, chat attive reali, floating chat Facebook, WebRTC.
   ========================================================= */
.nexa-rt-hide{display:none!important}.nexa-rt-btn{min-height:34px!important;padding:0 12px!important;border-radius:12px!important;background:#1d4ed8!important;border-color:#1d4ed8!important;color:#fff!important;font-weight:900!important}.nexa-rt-pill{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 7px;border-radius:999px;background:#1d4ed8;color:#fff;font-size:10px;font-weight:950}.nexa-rt-pill.red{background:#ef4444}.nexa-fb-launcher{position:fixed;right:18px;bottom:18px;z-index:47000;min-width:54px;height:54px;border-radius:999px;border:1px solid rgba(29,78,216,.18);background:#1d4ed8;color:#fff;display:flex;align-items:center;justify-content:center;gap:7px;box-shadow:0 18px 60px rgba(29,78,216,.36);font-size:14px;font-weight:950;cursor:pointer;padding:0 15px}.nexa-fb-chat{position:fixed;right:18px;bottom:82px;z-index:47001;width:min(390px,calc(100vw - 28px));height:min(620px,calc(100vh - 104px));border-radius:22px;background:#fff;border:1px solid rgba(15,23,42,.12);box-shadow:0 28px 100px rgba(15,23,42,.28);overflow:hidden;display:none;grid-template-rows:auto minmax(0,1fr) auto}.nexa-fb-chat.show{display:grid}.nexa-fb-head{min-height:58px;padding:12px;background:linear-gradient(180deg,#fff,#f8fafc);border-bottom:1px solid #e2e8f0;display:flex;align-items:center;justify-content:space-between;gap:10px}.nexa-fb-peer{display:flex;align-items:center;gap:10px;min-width:0}.nexa-fb-avatar{width:40px;height:40px;border-radius:50%;background:linear-gradient(135deg,#1d4ed8,#0ea5e9);color:#fff;display:grid;place-items:center;font-size:12px;font-weight:950;flex:0 0 auto}.nexa-fb-title{min-width:0}.nexa-fb-title b{display:block;color:#0f172a;font-size:13px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nexa-fb-title small{display:block;color:#667085;font-size:11px;line-height:1.2;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nexa-fb-actions{display:flex;gap:5px;align-items:center}.nexa-fb-actions button{width:32px!important;height:32px!important;min-height:32px!important;padding:0!important;border-radius:999px!important;display:grid!important;place-items:center!important;font-size:13px!important}.nexa-fb-shell{display:grid;grid-template-columns:126px minmax(0,1fr);min-height:0;overflow:hidden}.nexa-fb-list{border-right:1px solid #e2e8f0;background:#f8fafc;overflow:auto;padding:8px;display:grid;gap:7px;align-content:start}.nexa-fb-thread{border:1px solid #e2e8f0;background:#fff;border-radius:14px;padding:8px;cursor:pointer;display:grid;gap:5px}.nexa-fb-thread.active{border-color:#1d4ed8;background:#eef4ff}.nexa-fb-thread b{color:#0f172a;font-size:11px;line-height:1.2}.nexa-fb-thread small{color:#667085;font-size:10px;line-height:1.2}.nexa-fb-messages{padding:12px;overflow:auto;display:grid;align-content:start;gap:8px;background:#fbfdff}.nexa-fb-msg{max-width:82%;padding:9px 11px;border:1px solid #e2e8f0;border-radius:16px;background:#fff;color:#0f172a;font-size:13px;line-height:1.42}.nexa-fb-msg.me{justify-self:end;background:#1d4ed8;border-color:#1d4ed8;color:#fff}.nexa-fb-msg small{display:block;opacity:.72;margin-top:4px;font-size:10px}.nexa-fb-empty{border:1px solid #c7d8ff;background:#eef4ff;color:#174ea6;border-radius:14px;padding:10px;font-size:12px;line-height:1.45}.nexa-fb-compose{border-top:1px solid #e2e8f0;padding:10px;background:#f8fafc;display:flex;gap:7px}.nexa-fb-compose input{flex:1;min-height:39px;border:1px solid #d9e2ee;border-radius:999px;padding:8px 13px;background:#fff;color:#101828}.nexa-fb-compose button{min-width:42px!important;min-height:39px!important;border-radius:999px!important;padding:0 13px!important;background:#1d4ed8!important;color:#fff!important;border-color:#1d4ed8!important;font-weight:950!important}.nexa-call-overlay{position:fixed;inset:0;z-index:48000;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(15,23,42,.62);backdrop-filter:blur(10px)}.nexa-call-overlay.show{display:flex}.nexa-call-card{width:min(780px,100%);background:#0f172a;color:#fff;border:1px solid rgba(255,255,255,.14);border-radius:24px;box-shadow:0 35px 130px rgba(0,0,0,.45);overflow:hidden}.nexa-call-head{padding:14px 16px;display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid rgba(255,255,255,.12)}.nexa-call-head b{display:block;font-size:16px}.nexa-call-head small{color:#cbd5e1}.nexa-call-videos{display:grid;grid-template-columns:1fr 220px;gap:12px;padding:14px}.nexa-call-videos video{width:100%;background:#020617;border-radius:18px;border:1px solid rgba(255,255,255,.12);object-fit:cover;min-height:210px}.nexa-call-videos video.local{min-height:150px}.nexa-call-actions{padding:14px;display:flex;justify-content:center;gap:9px;border-top:1px solid rgba(255,255,255,.12)}.nexa-call-incoming{position:fixed;right:18px;bottom:82px;z-index:48001;width:min(360px,calc(100vw - 28px));background:#fff;border:1px solid rgba(15,23,42,.12);border-radius:22px;box-shadow:0 24px 90px rgba(15,23,42,.25);padding:14px;display:none;gap:10px}.nexa-call-incoming.show{display:grid}.nexa-call-incoming b{color:#0f172a}.nexa-call-incoming small{color:#667085}.nexa-call-incoming-actions{display:flex;gap:8px;justify-content:flex-end}.nexa-toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:49000;display:none;max-width:min(560px,calc(100vw - 26px));padding:12px 14px;border-radius:16px;background:#101828;color:#fff;box-shadow:0 18px 60px rgba(15,23,42,.32);font-size:13px;line-height:1.4}.nexa-toast.show{display:block}@media(max-width:760px){.nexa-fb-chat{inset:0;width:100vw;height:100vh;border-radius:0}.nexa-fb-shell{grid-template-columns:104px minmax(0,1fr)}.nexa-call-videos{grid-template-columns:1fr}}


/* =========================================================
   NEXAOS UI CLEANUP — LOGO / SIDEBAR / RIGHTBAR / FLOATING CHAT
   ========================================================= */

/* Logo stabile in sidebar */
.nexa-logo-fixed{
  width:48px!important;
  height:48px!important;
  min-width:48px!important;
  min-height:48px!important;
  margin:16px auto 18px!important;
  border-radius:16px!important;
  display:grid!important;
  place-items:center!important;
  background:linear-gradient(135deg,#f8fafc 0%,#dbeafe 48%,#bfdbfe 100%)!important;
  border:1px solid rgba(255,255,255,.32)!important;
  box-shadow:0 16px 34px rgba(2,6,23,.35), inset 0 1px 0 rgba(255,255,255,.85)!important;
  color:#0f3b63!important;
  font-weight:950!important;
  font-size:20px!important;
  letter-spacing:-.06em!important;
  line-height:1!important;
  position:relative!important;
  overflow:hidden!important;
}
.nexa-logo-fixed::before{
  content:"";
  position:absolute;
  inset:8px;
  border-radius:12px;
  border:2px solid rgba(29,78,216,.38);
  transform:skewX(-12deg);
}
.nexa-logo-fixed::after{
  content:"N";
  position:relative;
  z-index:2;
  font-weight:950;
  color:#174ea6;
  text-shadow:0 1px 0 rgba(255,255,255,.9);
}
.nexa-logo-fixed img{
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
  position:relative!important;
  z-index:3!important;
}

/* Sidebar più pulita */
.nexa-sidebar-hidden,
.nexa-ui-clean-hidden{
  display:none!important;
}
.sidebar .nexa-logo-fixed,
aside .nexa-logo-fixed,
nav .nexa-logo-fixed{
  flex:0 0 auto!important;
}

/* Rightbar: un solo bottone Contatta, layout regolare */
.nexa-real-online-card{
  display:grid!important;
  gap:8px!important;
}
.nexa-real-online-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:8px!important;
  padding:10px!important;
  border:1px solid #e2e8f0!important;
  border-radius:13px!important;
  background:#fff!important;
  box-sizing:border-box!important;
}
.nexa-real-online-row b{
  display:block!important;
  color:#0f172a!important;
  font-size:12.5px!important;
  line-height:1.15!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.nexa-real-online-row small{
  display:block!important;
  color:#667085!important;
  font-size:10.5px!important;
  line-height:1.25!important;
  margin-top:3px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.nexa-real-contact-btn{
  min-height:32px!important;
  padding:0 10px!important;
  border-radius:10px!important;
  border:1px solid #1d4ed8!important;
  background:#1d4ed8!important;
  color:#fff!important;
  font-weight:900!important;
  font-size:11px!important;
  white-space:nowrap!important;
}
.online-user button + button,
.nexa-real-online-row button + button{
  display:none!important;
}

/* Floating chat stile Facebook: spazi ordinati */
#nexaFbChat,
.nexa-fb-chat,
.nexa-floating-chat{
  right:18px!important;
  bottom:82px!important;
  width:min(420px, calc(100vw - 32px))!important;
  height:min(590px, calc(100vh - 112px))!important;
  max-width:420px!important;
  max-height:590px!important;
  border-radius:22px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  box-shadow:0 30px 110px rgba(15,23,42,.30)!important;
}
#nexaFbChat .nexa-fb-head,
.nexa-fb-chat .nexa-fb-head,
.nexa-floating-chat .nexa-floating-head{
  min-height:62px!important;
  padding:12px!important;
  box-sizing:border-box!important;
}
#nexaFbChat .nexa-fb-shell,
.nexa-fb-chat .nexa-fb-shell{
  display:grid!important;
  grid-template-columns:112px minmax(0,1fr)!important;
  min-height:0!important;
  overflow:hidden!important;
}
#nexaFbChat .nexa-fb-list,
.nexa-fb-chat .nexa-fb-list{
  padding:8px!important;
  gap:7px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  min-width:0!important;
}
#nexaFbChat .nexa-fb-thread,
.nexa-fb-chat .nexa-fb-thread{
  padding:8px!important;
  min-width:0!important;
  overflow:hidden!important;
}
#nexaFbChat .nexa-fb-messages,
.nexa-fb-chat .nexa-fb-messages,
.nexa-floating-chat .nexa-floating-body{
  padding:12px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  min-width:0!important;
  min-height:0!important;
  align-content:start!important;
}
#nexaFbChat .nexa-fb-compose,
.nexa-fb-chat .nexa-fb-compose,
.nexa-floating-chat .nexa-floating-compose{
  padding:10px!important;
  box-sizing:border-box!important;
}
#nexaFbChat input,
.nexa-fb-chat input,
.nexa-floating-chat input{
  min-width:0!important;
  width:100%!important;
}
#nexaFbChat .nexa-fb-msg,
.nexa-fb-chat .nexa-fb-msg,
.nexa-floating-chat .nexa-floating-msg{
  max-width:86%!important;
  word-break:break-word!important;
}

/* Evita doppioni della chat launcher quando c'è la rightbar */
#nexaFbLauncher{
  right:22px!important;
  bottom:20px!important;
}

/* Mobile: chat a schermo, ma ordinata */
@media(max-width:760px){
  #nexaFbChat,
  .nexa-fb-chat,
  .nexa-floating-chat{
    inset:auto 0 0 0!important;
    width:100vw!important;
    max-width:100vw!important;
    height:78vh!important;
    max-height:78vh!important;
    border-radius:22px 22px 0 0!important;
  }
  #nexaFbChat .nexa-fb-shell,
  .nexa-fb-chat .nexa-fb-shell{
    grid-template-columns:96px minmax(0,1fr)!important;
  }
}


/* =========================================================
   NEXAOS FIX — FAVICON LOGO + CONTATTA + LIVEKIT PEER RESOLVER
   ========================================================= */

/* Logo nel riquadro corretto della sidebar, usando favicon */
.nexa-logo-dock{
  width:calc(100% - 12px)!important;
  min-height:62px!important;
  margin:8px 6px 12px!important;
  border-radius:14px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  padding:10px 12px!important;
  box-sizing:border-box!important;
  background:rgba(255,255,255,.055)!important;
  border:1px solid rgba(255,255,255,.12)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08), 0 10px 28px rgba(2,6,23,.22)!important;
  color:#fff!important;
  overflow:hidden!important;
}
.nexa-logo-dock img{
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  min-height:38px!important;
  object-fit:contain!important;
  display:block!important;
  border-radius:10px!important;
  background:rgba(255,255,255,.06)!important;
}
.nexa-logo-dock span{
  display:block!important;
  font-size:12px!important;
  font-weight:950!important;
  letter-spacing:.04em!important;
  color:#eaf2ff!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.nexa-logo-fixed{
  display:none!important;
}

/* Rimuove la vecchia card logo/home rotta ma conserva la voce Home nella nav */
.nexa-old-broken-logo-home{
  display:none!important;
}

/* Rightbar: un solo Contatta per ogni vero utente */
.nexa-rightbar-clean button,
.nexa-real-online-card button,
.online-user button{
  white-space:nowrap!important;
}
.nexa-rightbar-clean .nexa-duplicate-contact,
.nexa-real-online-card .nexa-duplicate-contact,
.online-user .nexa-duplicate-contact{
  display:none!important;
}
.nexa-real-contact-btn,
.nexa-lk-contact,
.nexa-contact-single{
  min-height:32px!important;
  padding:0 11px!important;
  border-radius:10px!important;
  border:1px solid #1d4ed8!important;
  background:#1d4ed8!important;
  color:#fff!important;
  font-size:11px!important;
  font-weight:900!important;
  cursor:pointer!important;
}

/* Floating chat: spazi corretti e bottoni call sempre chiari */
#nexaFbChat,
.nexa-fb-chat,
.nexa-floating-chat{
  right:18px!important;
  bottom:82px!important;
  width:min(410px, calc(100vw - 32px))!important;
  height:min(560px, calc(100vh - 112px))!important;
  max-width:410px!important;
  max-height:560px!important;
  min-width:330px!important;
  border-radius:22px!important;
  overflow:hidden!important;
}
#nexaFbChat .nexa-fb-head,
.nexa-fb-chat .nexa-fb-head,
.nexa-floating-chat .nexa-floating-head{
  padding:12px!important;
  min-height:62px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  box-sizing:border-box!important;
}
#nexaFbChat .nexa-fb-actions,
.nexa-fb-chat .nexa-fb-actions,
.nexa-floating-chat .nexa-floating-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:6px!important;
  flex:0 0 auto!important;
}
#nexaFbChat .nexa-fb-actions button,
.nexa-fb-chat .nexa-fb-actions button,
.nexa-floating-chat .nexa-floating-actions button{
  width:32px!important;
  height:32px!important;
  min-width:32px!important;
  min-height:32px!important;
  border-radius:999px!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
}
#nexaFbChat .nexa-fb-shell,
.nexa-fb-chat .nexa-fb-shell{
  grid-template-columns:116px minmax(0,1fr)!important;
  min-height:0!important;
  overflow:hidden!important;
}
#nexaFbChat .nexa-fb-list,
#nexaFbChat .nexa-fb-messages,
.nexa-fb-chat .nexa-fb-list,
.nexa-fb-chat .nexa-fb-messages,
.nexa-floating-chat .nexa-floating-body{
  min-width:0!important;
  overflow-x:hidden!important;
}
#nexaFbChat .nexa-fb-compose,
.nexa-fb-chat .nexa-fb-compose,
.nexa-floating-chat .nexa-floating-compose{
  padding:10px!important;
  gap:8px!important;
}
#nexaFbChat .nexa-fb-compose input,
.nexa-fb-chat .nexa-fb-compose input,
.nexa-floating-chat .nexa-floating-compose input{
  min-width:0!important;
}

/* Toast centrato meno invasivo */
.nexa-peer-fix-toast{
  position:fixed;
  left:50%;
  bottom:28px;
  transform:translateX(-50%);
  z-index:70000;
  display:none;
  max-width:min(560px,calc(100vw - 28px));
  padding:12px 14px;
  border-radius:16px;
  background:#101828;
  color:#fff;
  box-shadow:0 18px 60px rgba(15,23,42,.32);
  font:13px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.nexa-peer-fix-toast.show{
  display:block;
}

@media(max-width:760px){
  #nexaFbChat,
  .nexa-fb-chat,
  .nexa-floating-chat{
    min-width:0!important;
    width:100vw!important;
    max-width:100vw!important;
    height:78vh!important;
    max-height:78vh!important;
    inset:auto 0 0 0!important;
    border-radius:22px 22px 0 0!important;
  }
}


/* =========================================================
   NEXAOS INCOMING CALL — POPUP / RING / STATUS
   ========================================================= */

.nexa-call-incoming-pro{
  position:fixed;
  right:22px;
  bottom:96px;
  z-index:75000;
  width:min(390px,calc(100vw - 32px));
  display:none;
  border-radius:24px;
  background:#fff;
  border:1px solid rgba(15,23,42,.12);
  box-shadow:0 30px 110px rgba(15,23,42,.30);
  overflow:hidden;
  animation:nexaCallSlideIn .22s ease-out both;
}

.nexa-call-incoming-pro.show{
  display:block;
}

@keyframes nexaCallSlideIn{
  from{opacity:0;transform:translateY(18px) scale(.98)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

.nexa-call-incoming-head{
  padding:16px;
  display:flex;
  gap:12px;
  align-items:center;
  background:linear-gradient(135deg,#0f172a 0%,#1d4ed8 100%);
  color:#fff;
}

.nexa-call-incoming-avatar{
  width:52px;
  height:52px;
  border-radius:18px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.22);
  font-size:18px;
  font-weight:950;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18);
  animation:nexaCallPulse 1.15s infinite ease-in-out;
}

@keyframes nexaCallPulse{
  0%,100%{transform:scale(1);box-shadow:0 0 0 0 rgba(255,255,255,.30)}
  50%{transform:scale(1.045);box-shadow:0 0 0 9px rgba(255,255,255,0)}
}

.nexa-call-incoming-title{
  min-width:0;
}

.nexa-call-incoming-title b{
  display:block;
  font-size:15px;
  line-height:1.2;
  font-weight:950;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.nexa-call-incoming-title small{
  display:block;
  margin-top:4px;
  color:#dbeafe;
  font-size:12px;
  line-height:1.35;
}

.nexa-call-incoming-body{
  padding:14px 16px;
  color:#334155;
  font-size:13px;
  line-height:1.45;
  background:#fff;
}

.nexa-call-incoming-meta{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:10px;
}

.nexa-call-meta-pill{
  border:1px solid #e2e8f0;
  background:#f8fafc;
  border-radius:13px;
  padding:8px;
  min-width:0;
}

.nexa-call-meta-pill span{
  display:block;
  color:#64748b;
  font-size:10px;
  text-transform:uppercase;
  font-weight:900;
  letter-spacing:.04em;
}

.nexa-call-meta-pill b{
  display:block;
  margin-top:3px;
  color:#0f172a;
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.nexa-call-incoming-actions{
  padding:12px 16px 16px;
  display:flex;
  gap:8px;
  justify-content:flex-end;
  background:#f8fafc;
  border-top:1px solid #e2e8f0;
}

.nexa-call-incoming-actions button{
  min-height:40px!important;
  padding:0 14px!important;
  border-radius:999px!important;
  font-weight:950!important;
}

.nexa-call-accept-btn{
  background:#16a34a!important;
  color:#fff!important;
  border-color:#16a34a!important;
}

.nexa-call-reject-btn{
  background:#fff!important;
  color:#991b1b!important;
  border-color:#fecaca!important;
}

.nexa-call-status-toast{
  position:fixed;
  left:50%;
  bottom:26px;
  transform:translateX(-50%);
  z-index:76000;
  display:none;
  max-width:min(560px,calc(100vw - 28px));
  padding:12px 14px;
  border-radius:16px;
  background:#101828;
  color:#fff;
  box-shadow:0 18px 60px rgba(15,23,42,.32);
  font:13px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.nexa-call-status-toast.show{
  display:block;
}

.nexa-call-outgoing-chip{
  position:fixed;
  right:22px;
  bottom:96px;
  z-index:74999;
  min-height:52px;
  max-width:min(390px,calc(100vw - 32px));
  display:none;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(29,78,216,.16);
  background:#fff;
  color:#0f172a;
  box-shadow:0 18px 60px rgba(15,23,42,.22);
  font-weight:900;
}

.nexa-call-outgoing-chip.show{
  display:flex;
}

.nexa-call-outgoing-dot{
  width:12px;
  height:12px;
  border-radius:50%;
  background:#22c55e;
  animation:nexaCallDot 1s infinite;
}

@keyframes nexaCallDot{
  0%,100%{opacity:.35}
  50%{opacity:1}
}

@media(max-width:760px){
  .nexa-call-incoming-pro{
    left:14px;
    right:14px;
    bottom:92px;
    width:auto;
  }
  .nexa-call-outgoing-chip{
    left:14px;
    right:14px;
    width:auto;
  }
}


/* =========================================================
   NEXAOS CALL WATCHDOG — POPUP GUARANTEED FALLBACK
   ========================================================= */

.nexa-call-watchdog-toast{
  position:fixed;
  left:50%;
  bottom:26px;
  transform:translateX(-50%);
  z-index:88000;
  display:none;
  max-width:min(680px,calc(100vw - 28px));
  padding:12px 14px;
  border-radius:16px;
  background:#101828;
  color:#fff;
  box-shadow:0 18px 60px rgba(15,23,42,.32);
  font:13px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.nexa-call-watchdog-toast.show{
  display:block;
}

.nexa-call-watchdog-panel{
  position:fixed;
  right:18px;
  top:86px;
  z-index:87000;
  width:min(380px,calc(100vw - 28px));
  display:none;
  border-radius:18px;
  background:#fff;
  border:1px solid #dbe5f2;
  box-shadow:0 18px 70px rgba(15,23,42,.24);
  overflow:hidden;
}

.nexa-call-watchdog-panel.show{
  display:block;
}

.nexa-call-watchdog-panel header{
  padding:12px 14px;
  background:#0f172a;
  color:#fff;
  font-weight:950;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.nexa-call-watchdog-panel main{
  padding:12px 14px;
  color:#334155;
  font-size:12px;
  line-height:1.45;
  display:grid;
  gap:7px;
}

.nexa-call-watchdog-panel code{
  display:block;
  padding:8px;
  border-radius:10px;
  background:#f1f5f9;
  color:#0f172a;
  white-space:pre-wrap;
  word-break:break-word;
}


/* =========================================================
   NEXAOS MOBILE/TABLET ONLY RESPONSIVE
   IMPORTANTISSIMO:
   - Desktop/PC NON viene modificato.
   - Le regole partono solo sotto 1024px.
   - La struttura PC rimane quella originale della build stabile.
   ========================================================= */

/* Default desktop: nessun effetto */
.nexa-mobile-menu-btn,
.nexa-mobile-scrim{
  display:none;
}

/* Solo elementi creati per responsive mobile/tablet */
.nexa-mobile-menu-btn{
  position:fixed;
  left:12px;
  top:12px;
  z-index:92000;
  width:42px;
  height:42px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.14);
  background:#fff;
  color:#0f172a;
  box-shadow:0 12px 34px rgba(15,23,42,.18);
  font-weight:950;
  place-items:center;
  cursor:pointer;
}

.nexa-mobile-scrim{
  position:fixed;
  inset:0;
  z-index:89998;
  background:rgba(2,6,23,.42);
  backdrop-filter:blur(4px);
}

/* =========================================================
   TABLET ONLY — fino a 1024px
   ========================================================= */
@media (max-width:1024px){
  html,
  body{
    max-width:100%!important;
    overflow-x:hidden!important;
  }

  body{
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;
    background:#f3f6fb!important;
  }

  input,
  select,
  textarea,
  button{
    font-size:16px!important;
  }

  .nexa-mobile-menu-btn{
    display:grid!important;
  }

  body.nexa-mobile-menu-open .nexa-mobile-scrim{
    display:block!important;
  }

  /* Agisce SOLO sulla sidebar identificata via JS, non su tutti aside/nav */
  .nexa-mobile-sidebar{
    position:fixed!important;
    left:0!important;
    top:0!important;
    bottom:0!important;
    z-index:90000!important;
    width:min(292px,86vw)!important;
    max-width:292px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    transform:translateX(-110%)!important;
    transition:transform .24s cubic-bezier(.22,.61,.36,1)!important;
    box-shadow:24px 0 70px rgba(15,23,42,.28)!important;
  }

  body.nexa-mobile-menu-open .nexa-mobile-sidebar{
    transform:translateX(0)!important;
  }

  /* Contenuto: niente margine forzato da sidebar su mobile/tablet */
  .nexa-mobile-main{
    margin-left:0!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-x:hidden!important;
  }

  /* Topbar touch-friendly SOLO mobile/tablet */
  .nexa-mobile-topbar{
    position:sticky!important;
    top:0!important;
    z-index:60000!important;
    min-height:58px!important;
    padding-left:62px!important;
    padding-right:12px!important;
    display:flex!important;
    align-items:center!important;
    gap:8px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    white-space:nowrap!important;
    background:rgba(255,255,255,.92)!important;
    backdrop-filter:blur(14px)!important;
    -webkit-overflow-scrolling:touch!important;
  }

  .nexa-mobile-topbar::-webkit-scrollbar{
    display:none;
  }

  .nexa-mobile-topbar input{
    min-width:230px!important;
    max-width:360px!important;
    height:40px!important;
    min-height:40px!important;
    flex:0 0 auto!important;
  }

  .nexa-mobile-topbar button,
  .nexa-mobile-topbar a{
    min-height:40px!important;
    flex:0 0 auto!important;
    white-space:nowrap!important;
  }

  /* Nasconde rightbar solo su tablet/mobile, non desktop */
  .nexa-mobile-rightbar{
    display:none!important;
  }

  /* Griglie principali a colonna SOLO per contenuto app */
  .nexa-mobile-main .dashboard,
  .nexa-mobile-main .workspace-grid,
  .nexa-mobile-main .profile-grid,
  .nexa-mobile-main .settings-grid,
  .nexa-mobile-main .sot-grid,
  .nexa-mobile-main .nexa-grid{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
  }

  .nexa-mobile-main .card,
  .nexa-mobile-main .panel,
  .nexa-mobile-main .sot-card,
  .nexa-mobile-main .profile-card,
  .nexa-mobile-main .settings-card{
    max-width:100%!important;
    min-width:0!important;
  }

  /* Righe rubrica/utenti */
  .nexa-mobile-main .real-person-row,
  .nexa-mobile-main .sot-person,
  .nexa-mobile-main .user-admin-row,
  .nexa-mobile-main .nexa-real-online-row,
  .nexa-mobile-main .online-user{
    max-width:100%!important;
    min-width:0!important;
  }

  /* Floating chat tablet */
  #nexaFbChat,
  .nexa-fb-chat,
  .nexa-floating-chat{
    right:14px!important;
    bottom:72px!important;
    width:min(440px,calc(100vw - 28px))!important;
    max-width:440px!important;
    height:min(620px,calc(100vh - 92px))!important;
    max-height:620px!important;
    min-width:0!important;
    border-radius:24px!important;
  }

  #nexaFbLauncher{
    right:16px!important;
    bottom:16px!important;
  }

  /* Chiamata LiveKit tablet: stage verticale se serve */
  .lk-stage,
  .nexa-lk-stage{
    grid-template-columns:1fr!important;
    gap:10px!important;
  }

  .lk-card,
  .nexa-lk-card{
    width:min(760px,calc(100vw - 28px))!important;
    max-height:calc(100vh - 28px)!important;
  }

  .lk-remote,
  .nexa-lk-remote{
    min-height:360px!important;
  }

  .lk-local,
  .nexa-lk-local{
    min-height:180px!important;
  }
}

/* =========================================================
   SMARTPHONE ONLY — fino a 760px
   ========================================================= */
@media (max-width:760px){
  body{
    padding-bottom:calc(74px + env(safe-area-inset-bottom,0px))!important;
  }

  .nexa-mobile-menu-btn{
    left:10px!important;
    top:calc(10px + env(safe-area-inset-top,0px))!important;
    width:40px!important;
    height:40px!important;
    border-radius:13px!important;
  }

  .nexa-mobile-sidebar{
    width:min(310px,86vw)!important;
    max-width:310px!important;
  }

  .nexa-mobile-main{
    padding-left:10px!important;
    padding-right:10px!important;
  }

  .nexa-mobile-topbar{
    min-height:56px!important;
    padding:8px 10px 8px 58px!important;
  }

  .nexa-mobile-topbar input{
    flex:0 0 210px!important;
    height:40px!important;
  }

  .nexa-mobile-topbar button,
  .nexa-mobile-topbar a{
    min-height:40px!important;
    padding-left:12px!important;
    padding-right:12px!important;
    border-radius:12px!important;
  }

  .nexa-mobile-main h1{
    font-size:clamp(26px,8vw,38px)!important;
    line-height:1.05!important;
    word-break:break-word!important;
  }

  .nexa-mobile-main h2{
    font-size:22px!important;
  }

  .nexa-mobile-main h3{
    font-size:18px!important;
  }

  .nexa-mobile-main .card,
  .nexa-mobile-main .panel,
  .nexa-mobile-main .sot-card,
  .nexa-mobile-main .profile-card,
  .nexa-mobile-main .settings-card{
    border-radius:16px!important;
    padding:12px!important;
    width:100%!important;
  }

  .nexa-mobile-main input,
  .nexa-mobile-main select,
  .nexa-mobile-main textarea{
    width:100%!important;
    max-width:100%!important;
    min-height:42px!important;
    border-radius:12px!important;
  }

  .nexa-mobile-main textarea{
    min-height:92px!important;
  }

  .nexa-mobile-main table,
  .nexa-mobile-main .table{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }

  .nexa-mobile-main .real-person-row,
  .nexa-mobile-main .sot-person,
  .nexa-mobile-main .user-admin-row,
  .nexa-mobile-main .nexa-real-online-row,
  .nexa-mobile-main .online-user{
    display:grid!important;
    grid-template-columns:42px minmax(0,1fr)!important;
    gap:9px!important;
    padding:10px!important;
    border-radius:14px!important;
  }

  .nexa-mobile-main .nexa-real-contact-btn,
  .nexa-mobile-main .nexa-lk-contact,
  .nexa-mobile-main .nexa-contact-single{
    width:100%!important;
    margin-top:8px!important;
    grid-column:1 / -1!important;
  }

  /* Bottom nav solo se esiste */
  .bottom-nav,
  [class*="bottom-nav"],
  [id*="bottomNav"]{
    position:fixed!important;
    left:8px!important;
    right:8px!important;
    bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;
    z-index:65000!important;
    display:flex!important;
    gap:6px!important;
    overflow-x:auto!important;
    padding:8px!important;
    border-radius:18px!important;
    background:rgba(255,255,255,.94)!important;
    border:1px solid rgba(15,23,42,.12)!important;
    box-shadow:0 16px 50px rgba(15,23,42,.18)!important;
    backdrop-filter:blur(14px)!important;
  }

  .bottom-nav button,
  [class*="bottom-nav"] button,
  [id*="bottomNav"] button{
    min-width:92px!important;
    min-height:44px!important;
    flex:0 0 auto!important;
    border-radius:13px!important;
    font-size:13px!important;
  }

  /* Floating chat smartphone: bottom sheet */
  #nexaFbChat,
  .nexa-fb-chat,
  .nexa-floating-chat{
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    top:auto!important;
    width:100vw!important;
    max-width:100vw!important;
    height:78vh!important;
    max-height:78vh!important;
    min-width:0!important;
    border-radius:22px 22px 0 0!important;
    z-index:78000!important;
  }

  #nexaFbChat .nexa-fb-shell,
  .nexa-fb-chat .nexa-fb-shell{
    grid-template-columns:94px minmax(0,1fr)!important;
    height:calc(78vh - 62px)!important;
  }

  #nexaFbLauncher{
    right:14px!important;
    bottom:calc(82px + env(safe-area-inset-bottom,0px))!important;
    z-index:77000!important;
  }

  /* Popup chiamata in arrivo smartphone */
  .nexa-call-incoming-pro,
  .nexa-call-watchdog-panel{
    left:12px!important;
    right:12px!important;
    bottom:calc(88px + env(safe-area-inset-bottom,0px))!important;
    top:auto!important;
    width:auto!important;
    max-width:none!important;
  }

  .nexa-call-incoming-actions{
    justify-content:stretch!important;
  }

  .nexa-call-incoming-actions button{
    flex:1!important;
  }

  /* LiveKit smartphone full-screen */
  .lk-overlay.show,
  .nexa-lk-call.show,
  #lkOverlay.show,
  #nexaLkCall.show{
    padding:0!important;
    align-items:stretch!important;
    justify-content:stretch!important;
  }

  .lk-card,
  .nexa-lk-card{
    width:100vw!important;
    height:100dvh!important;
    max-height:100dvh!important;
    border-radius:0!important;
  }

  .lk-stage,
  .nexa-lk-stage{
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:minmax(0,1fr) 180px!important;
    gap:8px!important;
    height:calc(100dvh - 128px)!important;
    min-height:0!important;
    padding:8px!important;
  }

  .lk-remote,
  .nexa-lk-remote{
    min-height:0!important;
    height:100%!important;
    border-radius:16px!important;
  }

  .lk-local,
  .nexa-lk-local{
    min-height:0!important;
    height:180px!important;
    border-radius:16px!important;
  }

  .lk-actions,
  .nexa-lk-actions{
    padding:10px 10px calc(10px + env(safe-area-inset-bottom,0px))!important;
    gap:8px!important;
    overflow-x:auto!important;
  }

  .lk-actions button,
  .nexa-lk-actions button{
    flex:1!important;
    min-width:86px!important;
  }
}

/* Smartphone piccolo */
@media (max-width:420px){
  .nexa-mobile-topbar input{
    flex-basis:185px!important;
  }

  #nexaFbChat .nexa-fb-shell,
  .nexa-fb-chat .nexa-fb-shell{
    grid-template-columns:82px minmax(0,1fr)!important;
  }

  .bottom-nav button,
  [class*="bottom-nav"] button,
  [id*="bottomNav"] button{
    min-width:82px!important;
    font-size:12px!important;
  }
}

/* Landscape smartphone */
@media (max-width:900px) and (orientation:landscape){
  #nexaFbChat,
  .nexa-fb-chat,
  .nexa-floating-chat{
    height:88vh!important;
    max-height:88vh!important;
  }

  .lk-stage,
  .nexa-lk-stage{
    grid-template-columns:1fr 220px!important;
    grid-template-rows:1fr!important;
  }

  .lk-remote,
  .nexa-lk-remote,
  .lk-local,
  .nexa-lk-local{
    min-height:58vh!important;
    height:auto!important;
  }
}


/* =========================================================
   NEXAOS CLEAN LIVEKIT CALLS — SINGLE MODULE
   ========================================================= */

.nexa-clean-call-modal{
  position:fixed;
  inset:0;
  z-index:95000;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(2,6,23,.78);
  backdrop-filter:blur(12px);
}

.nexa-clean-call-modal.show{
  display:flex;
}

.nexa-clean-call-card{
  width:min(1120px,calc(100vw - 32px));
  height:min(720px,calc(100dvh - 32px));
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  border-radius:26px;
  background:#0f172a;
  color:#fff;
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 40px 140px rgba(0,0,0,.52);
  overflow:hidden;
}

.nexa-clean-call-head{
  min-height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 16px;
  border-bottom:1px solid rgba(255,255,255,.12);
  background:linear-gradient(180deg,#111827 0%,#0f172a 100%);
}

.nexa-clean-call-head b{
  display:block;
  font-size:16px;
  line-height:1.2;
}

.nexa-clean-call-head small{
  display:block;
  margin-top:4px;
  color:#cbd5e1;
  font-size:12px;
}

.nexa-clean-call-status{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  background:rgba(255,255,255,.10);
  color:#e5e7eb;
  border:1px solid rgba(255,255,255,.14);
  font-size:12px;
  font-weight:900;
}

.nexa-clean-call-status::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:#f59e0b;
}

.nexa-clean-call-status.connected::before{ background:#22c55e; }
.nexa-clean-call-status.waiting::before{ background:#f59e0b; }
.nexa-clean-call-status.error::before{ background:#ef4444; }

.nexa-clean-call-body{
  display:grid;
  grid-template-columns:minmax(0,1fr) 330px;
  min-height:0;
}

.nexa-clean-stage{
  display:grid;
  grid-template-columns:minmax(0,1fr) 250px;
  gap:12px;
  padding:12px;
  min-height:0;
  background:#020617;
}

.nexa-clean-remote,
.nexa-clean-local{
  position:relative;
  min-height:0;
  border-radius:20px;
  background:#030712;
  border:1px solid rgba(255,255,255,.12);
  overflow:hidden;
  display:grid;
  place-items:center;
  color:#94a3b8;
}

.nexa-clean-local{
  min-height:180px;
}

.nexa-clean-remote video,
.nexa-clean-local video{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.nexa-clean-remote audio,
.nexa-clean-local audio{
  display:none;
}

.nexa-clean-placeholder{
  padding:18px;
  text-align:center;
  font-size:14px;
  line-height:1.4;
  color:#94a3b8;
}

.nexa-clean-placeholder b{
  display:block;
  margin-bottom:5px;
  color:#e5e7eb;
}

.nexa-clean-pill{
  position:absolute;
  left:12px;
  top:12px;
  z-index:8;
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  background:rgba(15,23,42,.74);
  color:#fff;
  font-size:12px;
  font-weight:900;
  backdrop-filter:blur(10px);
}

.nexa-clean-pill::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:50%;
  background:#22c55e;
}

.nexa-clean-chat{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  min-width:0;
  background:#111827;
  border-left:1px solid rgba(255,255,255,.12);
}

.nexa-clean-chat-head{
  min-height:58px;
  padding:12px;
  border-bottom:1px solid rgba(255,255,255,.10);
  color:#fff;
  font-weight:950;
}

.nexa-clean-chat-head small{
  display:block;
  margin-top:3px;
  color:#94a3b8;
  font-size:11px;
}

.nexa-clean-chat-messages{
  min-height:0;
  overflow-y:auto;
  padding:10px;
  display:flex;
  flex-direction:column;
  gap:5px;
  background:linear-gradient(180deg,#0f172a 0%,#111827 100%);
}

.nexa-clean-chat-empty{
  margin:auto;
  color:#94a3b8;
  text-align:center;
  font-size:13px;
  line-height:1.4;
  padding:18px;
}

.nexa-clean-msg{
  max-width:96%;
  padding:6px 7px;
  border-radius:8px;
  color:#e5e7eb;
  font-size:13px;
  line-height:1.35;
  word-break:break-word;
}

.nexa-clean-msg:hover{
  background:rgba(255,255,255,.045);
}

.nexa-clean-msg b{
  color:#a78bfa;
  margin-right:6px;
  font-size:12px;
  font-weight:950;
}

.nexa-clean-msg.me{
  background:rgba(37,99,235,.18);
  border-left:3px solid #60a5fa;
}

.nexa-clean-msg.me b{
  color:#60a5fa;
}

.nexa-clean-chat-form{
  display:flex;
  gap:8px;
  padding:10px;
  border-top:1px solid rgba(255,255,255,.10);
  background:#111827;
}

.nexa-clean-chat-form input{
  flex:1;
  min-width:0;
  min-height:40px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.32);
  background:#0b1220;
  color:#fff;
  padding:0 12px;
  font-size:14px;
}

.nexa-clean-chat-form button{
  min-height:40px;
  border-radius:12px;
  border:1px solid #7c3aed;
  background:#7c3aed;
  color:#fff;
  padding:0 12px;
  font-weight:950;
}

.nexa-clean-controls{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px;
  border-top:1px solid rgba(255,255,255,.12);
  background:#0f172a;
  overflow-x:auto;
}

.nexa-clean-controls button{
  flex:0 0 auto;
  min-height:42px;
  padding:0 15px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:#fff;
  color:#0f172a;
  font-weight:950;
  cursor:pointer;
}

.nexa-clean-controls button.off{
  background:#334155;
  color:#fff;
  border-color:#475569;
}

.nexa-clean-controls button.danger{
  background:#dc2626;
  color:#fff;
  border-color:#dc2626;
}

.nexa-clean-incoming{
  position:fixed;
  right:22px;
  bottom:96px;
  z-index:95100;
  width:min(390px,calc(100vw - 32px));
  display:none;
  border-radius:24px;
  background:#fff;
  color:#0f172a;
  border:1px solid rgba(15,23,42,.12);
  box-shadow:0 30px 110px rgba(15,23,42,.30);
  overflow:hidden;
}

.nexa-clean-incoming.show{
  display:block;
}

.nexa-clean-incoming header{
  padding:16px;
  background:linear-gradient(135deg,#0f172a 0%,#1d4ed8 100%);
  color:#fff;
}

.nexa-clean-incoming header b{
  display:block;
  font-size:15px;
}

.nexa-clean-incoming header small{
  color:#dbeafe;
}

.nexa-clean-incoming main{
  padding:14px 16px;
  color:#334155;
  font-size:13px;
}

.nexa-clean-incoming footer{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  padding:12px 16px 16px;
  background:#f8fafc;
  border-top:1px solid #e2e8f0;
}

.nexa-clean-incoming button{
  min-height:40px;
  border-radius:999px;
  padding:0 14px;
  font-weight:950;
}

.nexa-clean-incoming .reject{
  background:#fff;
  border:1px solid #fecaca;
  color:#991b1b;
}

.nexa-clean-incoming .accept{
  background:#16a34a;
  border:1px solid #16a34a;
  color:#fff;
}

.nexa-clean-toast{
  position:fixed;
  left:50%;
  bottom:26px;
  transform:translateX(-50%);
  z-index:96000;
  display:none;
  max-width:min(720px,calc(100vw - 28px));
  padding:12px 14px;
  border-radius:16px;
  background:#101828;
  color:#fff;
  box-shadow:0 18px 60px rgba(15,23,42,.32);
  font:13px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.nexa-clean-toast.show{
  display:block;
}

@media(max-width:900px){
  .nexa-clean-call-body{
    grid-template-columns:1fr;
    grid-template-rows:minmax(0,1fr) minmax(210px,34vh);
  }

  .nexa-clean-chat{
    border-left:0;
    border-top:1px solid rgba(255,255,255,.12);
  }

  .nexa-clean-stage{
    grid-template-columns:1fr;
    grid-template-rows:minmax(0,1fr) 170px;
  }
}

@media(max-width:760px){
  .nexa-clean-call-modal{
    padding:0;
    align-items:stretch;
    justify-content:stretch;
  }

  .nexa-clean-call-card{
    width:100vw;
    height:100dvh;
    max-height:100dvh;
    border-radius:0;
  }

  .nexa-clean-call-head{
    min-height:58px;
    padding:calc(8px + env(safe-area-inset-top,0px)) 10px 8px;
  }

  .nexa-clean-call-body{
    grid-template-rows:minmax(0,1fr) minmax(190px,32vh);
  }

  .nexa-clean-stage{
    padding:8px;
    gap:8px;
    grid-template-rows:minmax(0,1fr) 126px;
  }

  .nexa-clean-local{
    min-height:126px;
  }

  .nexa-clean-chat-head{
    min-height:42px;
    padding:8px 10px;
  }

  .nexa-clean-chat-head small{
    display:none;
  }

  .nexa-clean-chat-form input{
    font-size:16px;
  }

  .nexa-clean-controls{
    justify-content:flex-start;
    padding:8px 8px calc(8px + env(safe-area-inset-bottom,0px));
    gap:7px;
  }

  .nexa-clean-controls button{
    min-width:105px;
    min-height:40px;
    padding:0 12px;
    font-size:12px;
  }

  .nexa-clean-incoming{
    left:12px;
    right:12px;
    bottom:calc(88px + env(safe-area-inset-bottom,0px));
    width:auto;
  }
}


/* =========================================================
   NEXAOS OFFICIAL CALL SYSTEM — HARD RESET
   Single lightweight LiveKit UI: incoming, call, chat, controls.
   ========================================================= */

.nexa-official-call-modal{
  position:fixed;
  inset:0;
  z-index:96000;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(2,6,23,.76);
  backdrop-filter:blur(12px);
}
.nexa-official-call-modal.show{display:flex;}

.nexa-official-card{
  width:min(1180px,calc(100vw - 32px));
  height:min(740px,calc(100dvh - 32px));
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  border-radius:26px;
  background:#0f172a;
  color:#fff;
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 40px 140px rgba(0,0,0,.52);
  overflow:hidden;
}

.nexa-official-head{
  min-height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 16px;
  border-bottom:1px solid rgba(255,255,255,.12);
  background:linear-gradient(180deg,#111827 0%,#0f172a 100%);
}
.nexa-official-head b{display:block;font-size:16px;line-height:1.2;}
.nexa-official-head small{display:block;margin-top:4px;color:#cbd5e1;font-size:12px;}

.nexa-official-status{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  background:rgba(255,255,255,.10);
  color:#e5e7eb;
  border:1px solid rgba(255,255,255,.14);
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}
.nexa-official-status::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:#f59e0b;
}
.nexa-official-status.connected::before{background:#22c55e;}
.nexa-official-status.error::before{background:#ef4444;}

.nexa-official-body{
  display:grid;
  grid-template-columns:minmax(0,1fr) 340px;
  min-height:0;
}

.nexa-official-stage{
  display:grid;
  grid-template-columns:minmax(0,1fr) 260px;
  gap:12px;
  padding:12px;
  min-height:0;
  background:#020617;
}

.nexa-official-remote,
.nexa-official-local{
  position:relative;
  min-height:0;
  border-radius:20px;
  background:#030712;
  border:1px solid rgba(255,255,255,.12);
  overflow:hidden;
  display:grid;
  place-items:center;
  color:#94a3b8;
}

.nexa-official-local{min-height:180px;}

.nexa-official-remote video,
.nexa-official-local video{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.nexa-official-remote audio,
.nexa-official-local audio{display:none;}

.nexa-official-placeholder{
  padding:18px;
  text-align:center;
  font-size:14px;
  line-height:1.4;
  color:#94a3b8;
}
.nexa-official-placeholder b{
  display:block;
  margin-bottom:5px;
  color:#e5e7eb;
}

.nexa-official-pill{
  position:absolute;
  left:12px;
  top:12px;
  z-index:8;
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  background:rgba(15,23,42,.74);
  color:#fff;
  font-size:12px;
  font-weight:900;
  backdrop-filter:blur(10px);
}
.nexa-official-pill::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:50%;
  background:#22c55e;
}

.nexa-official-chat{
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  min-width:0;
  background:#111827;
  border-left:1px solid rgba(255,255,255,.12);
}
.nexa-official-chat-head{
  min-height:58px;
  padding:12px;
  border-bottom:1px solid rgba(255,255,255,.10);
  color:#fff;
  font-weight:950;
}
.nexa-official-chat-head small{
  display:block;
  margin-top:3px;
  color:#94a3b8;
  font-size:11px;
}
.nexa-official-chat-messages{
  min-height:0;
  overflow-y:auto;
  padding:10px;
  display:flex;
  flex-direction:column;
  gap:5px;
  background:linear-gradient(180deg,#0f172a 0%,#111827 100%);
}
.nexa-official-chat-empty{
  margin:auto;
  color:#94a3b8;
  text-align:center;
  font-size:13px;
  line-height:1.4;
  padding:18px;
}
.nexa-official-msg{
  max-width:96%;
  padding:6px 7px;
  border-radius:8px;
  color:#e5e7eb;
  font-size:13px;
  line-height:1.35;
  word-break:break-word;
}
.nexa-official-msg:hover{background:rgba(255,255,255,.045);}
.nexa-official-msg b{
  color:#a78bfa;
  margin-right:6px;
  font-size:12px;
  font-weight:950;
}
.nexa-official-msg.me{
  background:rgba(37,99,235,.18);
  border-left:3px solid #60a5fa;
}
.nexa-official-msg.me b{color:#60a5fa;}

.nexa-official-chat-form{
  display:flex;
  gap:8px;
  padding:10px;
  border-top:1px solid rgba(255,255,255,.10);
  background:#111827;
}
.nexa-official-chat-form input{
  flex:1;
  min-width:0;
  min-height:40px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.32);
  background:#0b1220;
  color:#fff;
  padding:0 12px;
  font-size:14px;
}
.nexa-official-chat-form button{
  min-height:40px;
  border-radius:12px;
  border:1px solid #7c3aed;
  background:#7c3aed;
  color:#fff;
  padding:0 12px;
  font-weight:950;
}

.nexa-official-controls{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px;
  border-top:1px solid rgba(255,255,255,.12);
  background:#0f172a;
  overflow-x:auto;
}
.nexa-official-controls button{
  flex:0 0 auto;
  min-height:42px;
  padding:0 15px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:#fff;
  color:#0f172a;
  font-weight:950;
  cursor:pointer;
}
.nexa-official-controls button.off{
  background:#334155;
  color:#fff;
  border-color:#475569;
}
.nexa-official-controls button.danger{
  background:#dc2626;
  color:#fff;
  border-color:#dc2626;
}

.nexa-official-incoming{
  position:fixed;
  right:22px;
  bottom:96px;
  z-index:96100;
  width:min(390px,calc(100vw - 32px));
  display:none;
  border-radius:24px;
  background:#fff;
  color:#0f172a;
  border:1px solid rgba(15,23,42,.12);
  box-shadow:0 30px 110px rgba(15,23,42,.30);
  overflow:hidden;
}
.nexa-official-incoming.show{display:block;}
.nexa-official-incoming header{
  padding:16px;
  background:linear-gradient(135deg,#0f172a 0%,#1d4ed8 100%);
  color:#fff;
}
.nexa-official-incoming header b{display:block;font-size:15px;}
.nexa-official-incoming header small{color:#dbeafe;}
.nexa-official-incoming main{
  padding:14px 16px;
  color:#334155;
  font-size:13px;
}
.nexa-official-incoming footer{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  padding:12px 16px 16px;
  background:#f8fafc;
  border-top:1px solid #e2e8f0;
}
.nexa-official-incoming button{
  min-height:40px;
  border-radius:999px;
  padding:0 14px;
  font-weight:950;
}
.nexa-official-incoming .reject{
  background:#fff;
  border:1px solid #fecaca;
  color:#991b1b;
}
.nexa-official-incoming .accept{
  background:#16a34a;
  border:1px solid #16a34a;
  color:#fff;
}

.nexa-official-toast{
  position:fixed;
  left:50%;
  bottom:26px;
  transform:translateX(-50%);
  z-index:96200;
  display:none;
  max-width:min(720px,calc(100vw - 28px));
  padding:12px 14px;
  border-radius:16px;
  background:#101828;
  color:#fff;
  box-shadow:0 18px 60px rgba(15,23,42,.32);
  font:13px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.nexa-official-toast.show{display:block;}

@media(max-width:900px){
  .nexa-official-body{
    grid-template-columns:1fr;
    grid-template-rows:minmax(0,1fr) minmax(210px,34vh);
  }
  .nexa-official-chat{
    border-left:0;
    border-top:1px solid rgba(255,255,255,.12);
  }
  .nexa-official-stage{
    grid-template-columns:1fr;
    grid-template-rows:minmax(0,1fr) 170px;
  }
}

@media(max-width:760px){
  .nexa-official-call-modal{
    padding:0;
    align-items:stretch;
    justify-content:stretch;
  }
  .nexa-official-card{
    width:100vw;
    height:100dvh;
    max-height:100dvh;
    border-radius:0;
  }
  .nexa-official-head{
    min-height:58px;
    padding:calc(8px + env(safe-area-inset-top,0px)) 10px 8px;
  }
  .nexa-official-body{
    grid-template-rows:minmax(0,1fr) minmax(190px,32vh);
  }
  .nexa-official-stage{
    padding:8px;
    gap:8px;
    grid-template-rows:minmax(0,1fr) 126px;
  }
  .nexa-official-local{min-height:126px;}
  .nexa-official-chat-head{
    min-height:42px;
    padding:8px 10px;
  }
  .nexa-official-chat-head small{display:none;}
  .nexa-official-chat-form input{font-size:16px;}
  .nexa-official-controls{
    justify-content:flex-start;
    padding:8px 8px calc(8px + env(safe-area-inset-bottom,0px));
    gap:7px;
  }
  .nexa-official-controls button{
    min-width:105px;
    min-height:40px;
    padding:0 12px;
    font-size:12px;
  }
  .nexa-official-incoming{
    left:12px;
    right:12px;
    bottom:calc(88px + env(safe-area-inset-bottom,0px));
    width:auto;
  }
}


/* =========================================================
   RABBIT EMERGENCY RESTORE
   Safe mode: nessun click interceptor globale, login e bottoni liberi.
   ========================================================= */

#nexaRestoreChatLauncher,
#nexaRestoreChat,
#nexaUnifiedChatLauncher,
#nexaUnifiedChatPanel,
#nexaChatRescueFloating,
#nexaChatRescuePanel,
#nexaHardChatFloating,
#nexaHardChatPanel,
#nexaCompanyChatLauncher,
#nexaCompanyChatPanel,
#nexaFinalChatButton,
#nexaFinalChatPanel,
#rabbitChatFixedButton,
#rabbitChatFixedPanel,
#rabbitRealChatButton,
#rabbitRealChatPanel,
#nexaFbLauncher,
#nexaFbChat,
.nexa-fb-launcher,
.nexa-fb-chat,
.nexa-floating-launcher,
.nexa-floating-chat{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}


/* =========================================================
   RABBIT MESSENGER CLEAN CORE
   Un solo modulo: Messenger + chiamate audio/video WebRTC.
   No interceptor globali. No duplicati. Solo post-login.
   ========================================================= */

/* Vecchi resti noti: neutralizzati */
#rabbitBulletChatButton,#rabbitBulletChatPanel,#rabbitFbChatButton,#rabbitFbChatPanel,
#rabbitRealChatButton,#rabbitRealChatPanel,#rabbitChatFixedButton,#rabbitChatFixedPanel,
#nexaFinalChatButton,#nexaFinalChatPanel,#nexaChatRescueFloating,#nexaChatRescuePanel,
#nexaUnifiedChatLauncher,#nexaUnifiedChatPanel,#nexaCompanyChatLauncher,#nexaCompanyChatPanel,
#nexaRestoreChatLauncher,#nexaRestoreChat,#nexaHardChatFloating,#nexaHardChatPanel,
#nexaFbLauncher,#nexaFbChat,.nexa-fb-launcher,.nexa-fb-chat,.nexa-floating-launcher,.nexa-floating-chat{
  display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important;
}

/* Floating Messenger: nasce nascosto. Appare solo post-login. */
#rmccButton{
  position:fixed!important;
  right:22px!important;
  bottom:22px!important;
  z-index:2147482500!important;
  min-width:128px!important;
  min-height:58px!important;
  padding:0 18px!important;
  border-radius:999px!important;
  border:1px solid rgba(15,23,42,.12)!important;
  background:#ffffff!important;
  color:#0f172a!important;
  font:950 15px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  display:none;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
  box-shadow:0 22px 76px rgba(15,23,42,.24)!important;
  cursor:pointer!important;
  pointer-events:auto!important;
  user-select:none!important;
}

#rmccButton.rmcc-ready{
  display:flex!important;
}

#rmccButton:hover{transform:translateY(-1px);}
#rmccButton .rmcc-dot{width:10px;height:10px;border-radius:50%;background:#10b981;box-shadow:0 0 0 5px rgba(16,185,129,.16);}
#rmccButton .rmcc-badge{min-width:22px;height:22px;border-radius:999px;display:none;align-items:center;justify-content:center;background:#dc2626;color:#fff;font-size:12px;font-weight:950;padding:0 6px;}
#rmccButton .rmcc-badge.show{display:inline-flex!important;}

#rmccPanel{
  position:fixed!important;
  right:22px!important;
  bottom:92px!important;
  z-index:2147482501!important;
  width:min(900px,calc(100vw - 44px))!important;
  height:min(690px,calc(100dvh - 124px))!important;
  display:none;
  grid-template-columns:300px minmax(0,1fr)!important;
  border-radius:26px!important;
  background:#fff!important;
  border:1px solid rgba(15,23,42,.12)!important;
  box-shadow:0 36px 130px rgba(15,23,42,.34)!important;
  overflow:hidden!important;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  color:#0f172a!important;
}

#rmccPanel.open{display:grid!important;}

.rmcc-side{min-width:0;min-height:0;display:grid;grid-template-rows:auto auto minmax(0,1fr);background:#f8fafc;border-right:1px solid #e2e8f0;}
.rmcc-head{padding:14px;display:flex;justify-content:space-between;align-items:center;gap:10px;border-bottom:1px solid #e2e8f0;}
.rmcc-head h3{margin:0;font-size:17px;color:#0f172a;}
.rmcc-head small{display:block;color:#64748b;font-size:12px;margin-top:3px;}
.rmcc-head button,.rmcc-thread-head button{min-height:34px;border-radius:12px;border:1px solid #cbd5e1;background:#fff;color:#0f172a;font-weight:900;cursor:pointer;}
.rmcc-search{padding:10px 12px;border-bottom:1px solid #e2e8f0;}
.rmcc-search input{width:100%;min-height:40px;border-radius:14px;border:1px solid #cbd5e1;background:#fff;padding:0 12px;font-size:14px;outline:none;}
.rmcc-list{min-height:0;overflow:auto;padding:9px;}
.rmcc-contact{display:grid;grid-template-columns:42px minmax(0,1fr);gap:10px;align-items:center;padding:10px;border-radius:16px;border:1px solid transparent;color:#0f172a;cursor:pointer;}
.rmcc-contact.active,.rmcc-contact:hover{background:#fff;border-color:#dbeafe;box-shadow:0 8px 26px rgba(15,23,42,.06);}
.rmcc-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;color:#fff;font-weight:950;background:linear-gradient(135deg,#1d4ed8,#0f766e);position:relative;flex:0 0 auto;}
.rmcc-avatar::after{content:"";position:absolute;right:0;bottom:0;width:10px;height:10px;border-radius:50%;border:2px solid #fff;background:#10b981;}
.rmcc-contact b,.rmcc-contact small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.rmcc-contact small{color:#64748b;font-size:12px;}

.rmcc-thread{min-width:0;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:#fff;}
.rmcc-thread-head{min-height:72px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 15px;border-bottom:1px solid #e2e8f0;}
.rmcc-peer{display:flex;align-items:center;gap:10px;min-width:0;}
.rmcc-peer-title{min-width:0;}
.rmcc-peer-title b,.rmcc-peer-title small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.rmcc-peer-title small{color:#64748b;font-size:12px;margin-top:3px;}
.rmcc-tools{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end;}
.rmcc-tools button{min-height:34px;border-radius:999px;border:1px solid #cbd5e1;background:#fff;color:#0f172a;font-weight:950;padding:0 10px;cursor:pointer;}
.rmcc-tools button.call{background:#0f766e;border-color:#0f766e;color:#fff;}
.rmcc-tools button.video{background:#7c3aed;border-color:#7c3aed;color:#fff;}

.rmcc-messages{min-height:0;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:10px;background:linear-gradient(180deg,#f8fafc 0%,#eef2ff 100%);}
.rmcc-empty{margin:auto;text-align:center;color:#64748b;max-width:440px;line-height:1.45;}
.rmcc-bubble{max-width:min(78%,560px);padding:10px 12px;border-radius:18px;background:#fff;border:1px solid #e2e8f0;box-shadow:0 6px 20px rgba(15,23,42,.06);color:#0f172a;word-break:break-word;align-self:flex-start;}
.rmcc-bubble.me{align-self:flex-end;background:#1d4ed8;border-color:#1d4ed8;color:#fff;}
.rmcc-bubble small{display:block;margin-top:5px;opacity:.72;font-size:11px;}
.rmcc-compose{display:flex;gap:8px;padding:12px;border-top:1px solid #e2e8f0;background:#fff;}
.rmcc-compose input{flex:1;min-width:0;min-height:44px;border-radius:999px;border:1px solid #cbd5e1;padding:0 14px;font-size:14px;outline:none;}
.rmcc-compose button{min-height:44px;border-radius:999px;border:1px solid #1d4ed8;background:#1d4ed8;color:#fff;font-weight:950;padding:0 16px;cursor:pointer;}

#rmccToast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);z-index:2147482510;display:none;max-width:min(760px,calc(100vw - 28px));padding:12px 14px;border-radius:16px;background:#101828;color:#fff;box-shadow:0 18px 60px rgba(15,23,42,.32);font:13px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;}
#rmccToast.show{display:block;}

/* Incoming call popup */
#rmccIncoming{
  position:fixed;right:22px;bottom:92px;z-index:2147482509;width:min(380px,calc(100vw - 28px));
  background:#fff;border:1px solid rgba(15,23,42,.12);border-radius:24px;box-shadow:0 28px 100px rgba(15,23,42,.30);
  display:none;padding:16px;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#0f172a;
}
#rmccIncoming.show{display:block;}
#rmccIncoming h3{margin:0 0 5px;font-size:18px;}
#rmccIncoming p{margin:0 0 14px;color:#64748b;font-size:13px;line-height:1.4;}
#rmccIncoming .actions{display:flex;gap:8px;justify-content:flex-end;}
#rmccIncoming button{min-height:38px;border-radius:13px;border:1px solid #cbd5e1;background:#fff;font-weight:950;cursor:pointer;padding:0 12px;}
#rmccIncoming .accept{background:#16a34a;border-color:#16a34a;color:#fff;}
#rmccIncoming .reject{background:#fff;color:#dc2626;border-color:#fecaca;}

/* Call modal */
#rmccCallModal{
  position:fixed;inset:0;z-index:2147482508;display:none;align-items:center;justify-content:center;
  background:rgba(15,23,42,.62);backdrop-filter:blur(8px);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
#rmccCallModal.show{display:flex;}
.rmcc-call-card{width:min(980px,calc(100vw - 32px));height:min(680px,calc(100dvh - 32px));background:#0b1220;color:#fff;border-radius:28px;box-shadow:0 36px 130px rgba(0,0,0,.45);display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden;border:1px solid rgba(255,255,255,.12);}
.rmcc-call-top{padding:14px 16px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid rgba(255,255,255,.10);}
.rmcc-call-top h3{margin:0;font-size:16px;}
.rmcc-call-top small{display:block;color:#cbd5e1;margin-top:3px;}
.rmcc-call-stage{padding:14px;display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:12px;min-height:0;}
.rmcc-remote,.rmcc-local{position:relative;border-radius:18px;background:#020617;overflow:hidden;display:grid;place-items:center;border:1px solid rgba(255,255,255,.10);min-height:0;}
.rmcc-remote video,.rmcc-local video{width:100%;height:100%;object-fit:cover;background:#020617;}
.rmcc-video-placeholder{position:absolute;inset:0;display:grid;place-items:center;color:#94a3b8;text-align:center;padding:18px;}
.rmcc-tag{position:absolute;left:12px;top:12px;border-radius:999px;background:rgba(15,23,42,.82);color:#fff;padding:7px 10px;font-size:12px;font-weight:950;}
.rmcc-call-controls{padding:14px;display:flex;justify-content:center;gap:10px;border-top:1px solid rgba(255,255,255,.10);}
.rmcc-call-controls button{min-height:42px;border-radius:999px;border:1px solid rgba(255,255,255,.16);background:#fff;color:#0f172a;font-weight:950;padding:0 15px;cursor:pointer;}
.rmcc-call-controls .danger{background:#dc2626;color:#fff;border-color:#dc2626;}
.rmcc-call-controls .off{background:#334155;color:#fff;border-color:#334155;}

@media(max-width:900px){
  #rmccPanel{grid-template-columns:1fr!important;grid-template-rows:240px minmax(0,1fr)!important;right:10px!important;left:10px!important;width:auto!important;bottom:84px!important;}
  .rmcc-side{border-right:0;border-bottom:1px solid #e2e8f0;}
  .rmcc-call-stage{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) 190px;}
}
@media(max-width:640px){
  #rmccButton{right:14px!important;bottom:calc(82px + env(safe-area-inset-bottom,0px))!important;}
  #rmccPanel{inset:auto 0 0 0!important;width:100vw!important;height:84dvh!important;border-radius:22px 22px 0 0!important;grid-template-rows:225px minmax(0,1fr)!important;}
  .rmcc-thread-head{align-items:flex-start;flex-direction:column;}
  .rmcc-tools{justify-content:flex-start;}
  .rmcc-compose input{font-size:16px;}
  .rmcc-call-card{width:100vw;height:100dvh;border-radius:0;}
  .rmcc-call-stage{grid-template-rows:minmax(0,1fr) 160px;padding:10px;}
}


/* =========================================================
   RABBIT MESSENGER IDENTITY FIX
   Diagnostica identità corrente.
   ========================================================= */
.rmcc-identity-pill{
  margin-top:8px;
  padding:8px 10px;
  border-radius:12px;
  background:#ecfdf5;
  color:#065f46;
  font-size:12px;
  font-weight:800;
  border:1px solid rgba(16,185,129,.22);
}
.rmcc-identity-pill.warn{
  background:#fff7ed;
  color:#9a3412;
  border-color:#fed7aa;
}


/* =========================================================
   RABBIT MOBILE MENU MESSENGER FIX
   Un solo menu mobile ufficiale + accesso Messenger.
   ========================================================= */

/* Disattiva il secondo sistema mobile creato dalle patch precedenti */
.nexa-mobile-menu-btn,
.nexa-mobile-scrim{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

/* Drawer ufficiale */
#mobileDrawer.mobile-drawer{
  z-index:2147482400!important;
}

#mobileDrawer.mobile-drawer.show{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;
}

#mobileDrawer .mobile-drawer-panel{
  transform:none!important;
  display:block!important;
  pointer-events:auto!important;
}

#mobileDrawerNav.mobile-drawer-nav{
  display:grid!important;
  gap:8px!important;
}

#mobileDrawerNav.mobile-drawer-nav button{
  width:100%!important;
  min-height:48px!important;
  border-radius:14px!important;
  justify-content:space-between!important;
  display:flex!important;
  align-items:center!important;
  text-align:left!important;
}

#mobileDrawerNav .rabbit-mobile-menu-section{
  font-size:11px;
  font-weight:950;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.08em;
  padding:10px 4px 4px;
}

#mobileDrawerNav .rabbit-mobile-menu-chat{
  background:#1d4ed8!important;
  border-color:#1d4ed8!important;
  color:#fff!important;
}

#mobileDrawerNav .rabbit-mobile-menu-chat b{
  color:#fff!important;
}

@media(max-width:1180px){
  .mobile-menu-btn{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:44px!important;
    pointer-events:auto!important;
    cursor:pointer!important;
  }

  body.nexa-mobile-menu-open{
    overflow:auto!important;
  }

  /* Se il vecchio responsive aggiunge questa classe, non deve sostituire il drawer ufficiale */
  .nexa-mobile-sidebar{
    transform:none;
  }
}

@media(max-width:640px){
  .mobile-drawer-panel{
    width:min(94vw,420px)!important;
  }
}


/* =========================================================
   RABBIT MESSENGER FLOATING VISIBILITY FIX
   Il floating non sparisce più post-login.
   ========================================================= */

#rmccButton.rmcc-visible,
#rmccButton.rmcc-ready{
  display:flex!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;
}

#rmccButton.rmcc-login-hidden{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

#rmccPanel.rmcc-force-open{
  display:grid!important;
}

.rmcc-debug-open-note{
  margin:auto;
  max-width:460px;
  text-align:center;
  color:#64748b;
  line-height:1.45;
}

.rmcc-debug-open-note b{
  color:#0f172a;
}


/* =========================================================
   RABBIT MESSENGER CALL STABILITY FIX
   Stabilizzazione WebRTC mobile/NAT.
   ========================================================= */
.rmcc-call-quality{
  position:absolute;
  right:12px;
  top:12px;
  z-index:4;
  border-radius:999px;
  padding:7px 10px;
  font-size:11px;
  font-weight:950;
  color:#fff;
  background:rgba(15,23,42,.78);
  border:1px solid rgba(255,255,255,.14);
}
.rmcc-call-quality.ok{background:rgba(22,163,74,.86);}
.rmcc-call-quality.warn{background:rgba(245,158,11,.90);}
.rmcc-call-quality.bad{background:rgba(220,38,38,.90);}


/* =========================================================
   RABBIT MESSENGER TWITCH CALL CHAT
   Chat live dentro call/video-call, stile Twitch.
   ========================================================= */

#rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-card{
  width:min(1180px,calc(100vw - 32px));
}

#rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-stage{
  grid-template-columns:minmax(0,1fr) 230px 330px;
  align-items:stretch;
}

.rmcc-call-chat{
  min-width:0;
  min-height:0;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  border-radius:18px;
  overflow:hidden;
  background:#0f172a;
  border:1px solid rgba(255,255,255,.12);
  color:#e5e7eb;
}

.rmcc-call-chat-head{
  padding:12px 13px;
  border-bottom:1px solid rgba(255,255,255,.10);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background:rgba(15,23,42,.92);
}

.rmcc-call-chat-head b{
  display:block;
  color:#fff;
  font-size:13px;
}

.rmcc-call-chat-head small{
  display:block;
  color:#94a3b8;
  font-size:11px;
  margin-top:2px;
}

.rmcc-call-chat-head button{
  width:32px;
  height:32px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.06);
  color:#fff;
  font-weight:950;
  cursor:pointer;
}

.rmcc-call-chat-list{
  min-height:0;
  overflow:auto;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
  background:
    radial-gradient(circle at top right, rgba(124,58,237,.20), transparent 35%),
    linear-gradient(180deg,#111827 0%,#020617 100%);
}

.rmcc-call-chat-empty{
  margin:auto;
  text-align:center;
  color:#94a3b8;
  line-height:1.4;
  font-size:13px;
  padding:20px;
}

.rmcc-call-chat-message{
  display:grid;
  grid-template-columns:28px minmax(0,1fr);
  gap:8px;
  align-items:start;
  padding:8px;
  border-radius:14px;
  background:rgba(255,255,255,.045);
  border:1px solid rgba(255,255,255,.06);
}

.rmcc-call-chat-message.me{
  background:rgba(37,99,235,.22);
  border-color:rgba(96,165,250,.22);
}

.rmcc-call-chat-avatar{
  width:28px;
  height:28px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#2563eb,#7c3aed);
  color:#fff;
  font-size:11px;
  font-weight:950;
}

.rmcc-call-chat-body{
  min-width:0;
}

.rmcc-call-chat-meta{
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:3px;
  min-width:0;
}

.rmcc-call-chat-author{
  color:#c4b5fd;
  font-size:12px;
  font-weight:950;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.rmcc-call-chat-message.me .rmcc-call-chat-author{
  color:#93c5fd;
}

.rmcc-call-chat-time{
  color:#64748b;
  font-size:10px;
  flex:0 0 auto;
}

.rmcc-call-chat-text{
  color:#f8fafc;
  font-size:13px;
  line-height:1.35;
  word-break:break-word;
}

.rmcc-call-chat-system{
  align-self:center;
  max-width:92%;
  padding:7px 10px;
  border-radius:999px;
  background:rgba(148,163,184,.12);
  color:#cbd5e1;
  font-size:11px;
  font-weight:800;
  text-align:center;
}

.rmcc-call-chat-compose{
  padding:10px;
  border-top:1px solid rgba(255,255,255,.10);
  background:rgba(15,23,42,.95);
  display:flex;
  gap:8px;
}

.rmcc-call-chat-compose input{
  flex:1;
  min-width:0;
  min-height:38px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background:#020617;
  color:#fff;
  padding:0 11px;
  outline:none;
  font-size:13px;
}

.rmcc-call-chat-compose input::placeholder{
  color:#64748b;
}

.rmcc-call-chat-compose button{
  min-height:38px;
  border-radius:12px;
  border:1px solid #7c3aed;
  background:#7c3aed;
  color:#fff;
  font-weight:950;
  padding:0 12px;
  cursor:pointer;
}

.rmcc-call-controls .rmcc-chat-toggle{
  background:#7c3aed;
  color:#fff;
  border-color:#7c3aed;
}

.rmcc-call-controls .rmcc-chat-toggle.has-unread::after{
  content:attr(data-unread);
  display:inline-grid;
  place-items:center;
  min-width:18px;
  height:18px;
  margin-left:8px;
  padding:0 5px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  font-weight:950;
}

@media(max-width:980px){
  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-stage{
    grid-template-columns:1fr;
    grid-template-rows:minmax(0,1fr) 170px minmax(260px,36vh);
  }

  .rmcc-call-chat{
    min-height:260px;
  }
}

@media(max-width:640px){
  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-stage{
    grid-template-rows:minmax(0,1fr) 150px minmax(250px,34vh);
    gap:8px;
  }

  .rmcc-call-chat{
    border-radius:16px;
  }

  .rmcc-call-chat-head{
    padding:10px;
  }

  .rmcc-call-chat-list{
    padding:9px;
  }

  .rmcc-call-chat-compose input{
    font-size:16px;
  }

  .rmcc-call-chat-compose button{
    padding:0 10px;
  }
}


/* =========================================================
   RABBIT MESSENGER LIVE CHAT SYNC + RESPONSIVE CALL
   Rifinitura videocall: chat live condivisa + layout mobile/tablet.
   ========================================================= */

.rmcc-call-chat-sync-note{
  color:#94a3b8;
  font-size:11px;
  padding:7px 12px;
  border-top:1px solid rgba(255,255,255,.08);
  background:rgba(15,23,42,.72);
}

/* Desktop: la call deve restare leggibile e non troppo larga */
#rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-card{
  max-width:calc(100vw - 32px);
  max-height:calc(100dvh - 32px);
}

#rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-stage{
  min-height:0;
}

.rmcc-remote,
.rmcc-local,
.rmcc-call-chat{
  min-width:0;
  min-height:0;
}

.rmcc-remote video,
.rmcc-local video{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* Tablet: video principale sopra, locale + chat sotto */
@media(max-width:1100px){
  #rmccCallModal.rmcc-twitch-chat-enabled{
    align-items:stretch;
    justify-content:stretch;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-card{
    width:100vw;
    height:100dvh;
    max-width:100vw;
    max-height:100dvh;
    border-radius:0;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-stage{
    grid-template-columns:1fr 320px;
    grid-template-rows:minmax(0,1fr) minmax(250px,34dvh);
    grid-template-areas:
      "remote remote"
      "local chat";
    gap:10px;
    padding:10px;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-remote{
    grid-area:remote;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-local{
    grid-area:local;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-chat{
    grid-area:chat;
  }
}

/* Smartphone: tutto in verticale, controlli sticky e chat sotto i video */
@media(max-width:720px){
  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-card{
    width:100vw;
    height:100dvh;
    max-width:100vw;
    max-height:100dvh;
    border-radius:0;
    grid-template-rows:auto minmax(0,1fr) auto;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-top{
    padding:calc(10px + env(safe-area-inset-top,0px)) 12px 10px;
    min-height:auto;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-top h3{
    font-size:16px;
    line-height:1.2;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-top small{
    font-size:12px;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-stage{
    grid-template-columns:1fr;
    grid-template-rows:minmax(220px,42dvh) minmax(120px,20dvh) minmax(230px,1fr);
    grid-template-areas:
      "remote"
      "local"
      "chat";
    gap:8px;
    padding:8px;
    overflow:auto;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-remote,
  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-local,
  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-chat{
    border-radius:16px;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-chat{
    min-height:230px;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-chat-head{
    padding:9px 10px;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-chat-list{
    padding:8px;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-chat-compose{
    padding:8px;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-chat-compose input{
    min-height:42px;
    font-size:16px;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-chat-compose button{
    min-height:42px;
    padding:0 12px;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-controls{
    position:sticky;
    bottom:0;
    z-index:20;
    padding:10px 8px calc(10px + env(safe-area-inset-bottom,0px));
    gap:7px;
    flex-wrap:nowrap;
    overflow-x:auto;
    justify-content:flex-start;
    background:#0b1220;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-controls button{
    min-height:42px;
    flex:0 0 auto;
    padding:0 13px;
    font-size:13px;
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-controls .danger{
    margin-left:auto;
  }
}

/* Smartphone molto piccoli */
@media(max-width:430px){
  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-stage{
    grid-template-rows:minmax(190px,38dvh) minmax(110px,18dvh) minmax(230px,1fr);
  }

  #rmccCallModal.rmcc-twitch-chat-enabled .rmcc-call-controls button{
    font-size:12px;
    padding:0 10px;
  }

  .rmcc-call-chat-message{
    grid-template-columns:24px minmax(0,1fr);
    padding:7px;
  }

  .rmcc-call-chat-avatar{
    width:24px;
    height:24px;
    font-size:10px;
  }

  .rmcc-call-chat-text{
    font-size:12px;
  }
}
