/* Nexus Satin — shared material. Light surfaces only. Dark theme rules stay in their own sheets. */

html.light-theme body.nx-premium,
html.light-theme body.internal-docs-page{
  --nx-bg:#b7cfd9;
  --nx-surface:rgba(246,252,253,.74);
  --nx-surface-2:rgba(223,238,242,.92);
  --nx-text:#0b2230;
  --nx-muted:#2b4e61;
  --nx-line:rgba(10,58,74,.16);
  --nx-shadow:0 1px 0 rgba(255,255,255,.72) inset, 0 18px 40px -24px rgba(8,40,58,.48);
  --nx-sat-blur:18px;
  background:
    radial-gradient(1100px 520px at 0% -8%, rgba(255,255,255,.55), transparent 58%),
    radial-gradient(820px 460px at 100% 0%, rgba(20,168,158,.22), transparent 52%),
    radial-gradient(760px 420px at 78% 110%, rgba(16,104,186,.16), transparent 48%),
    linear-gradient(168deg, #b4ced8 0%, #d3e6e8 46%, #c5ddd4 100%) !important;
  color:var(--nx-text);
}

html.light-theme body.nx-premium .nx-topbar{
  background:rgba(232,244,247,.72);
  border-bottom:1px solid rgba(255,255,255,.55);
  box-shadow:0 1px 0 rgba(255,255,255,.65) inset, 0 16px 36px -22px rgba(8,48,68,.45);
  -webkit-backdrop-filter:blur(22px) saturate(1.35);
  backdrop-filter:blur(22px) saturate(1.35);
}
html.light-theme body.nx-premium .nx-primary-nav{
  background:rgba(255,255,255,.38);
  border-color:rgba(255,255,255,.62);
  -webkit-backdrop-filter:blur(14px);
  backdrop-filter:blur(14px);
}
html.light-theme body.nx-premium .nx-primary-nav a{color:#1c3e50}
html.light-theme body.nx-premium .nx-primary-nav a:hover{background:rgba(255,255,255,.55);color:#07507a}
html.light-theme body.nx-premium .nx-user-copy small,
html.light-theme body.nx-premium .nx-topbar .nx-bell{color:#2b4e61}

html.light-theme #nx-home{
  --nh-card:rgba(247,253,254,.76);
  --nh-soft:rgba(224,239,243,.9);
  --nh-text:#0b2230;
  --nh-muted:#2c5164;
  --nh-border:rgba(255,255,255,.62);
  --nh-shadow:0 1px 0 rgba(255,255,255,.75) inset, 0 16px 36px -22px rgba(8,42,60,.42);
}
html.light-theme body#nx-area-root.overview-mode,
html.light-theme body#nx-area-root.documents-mode,
html.light-theme body#nx-area-root.calendar-mode{
  background:
    radial-gradient(1100px 520px at 0% -8%, rgba(255,255,255,.5), transparent 58%),
    radial-gradient(820px 460px at 100% 0%, rgba(20,168,158,.2), transparent 52%),
    linear-gradient(168deg, #b4ced8 0%, #d3e6e8 46%, #c5ddd4 100%) !important;
}
html.light-theme #nx-home .nh-panel,
html.light-theme #nx-home .nh-kpi,
html.light-theme #nx-home .nh-date{
  -webkit-backdrop-filter:blur(16px) saturate(1.25);
  backdrop-filter:blur(16px) saturate(1.25);
}
html.light-theme #nx-home .nh-kpi-copy>span,
html.light-theme #nx-home .nh-kpi-copy small,
html.light-theme #nx-home .nh-links small{color:#2c5164}
html.light-theme #nx-home .nh-kpi-copy b,
html.light-theme #nx-home h2,
html.light-theme #nx-home h3{color:#0b2230}

html.light-theme body#nx-area-root.nx-premium.docs-authenticated:is(.documents-mode,.calendar-mode) .nx-topbar{
  background:linear-gradient(180deg, rgba(236,246,248,.92) 0%, rgba(212,232,245,.90) 100%) !important;
  border-bottom-color:#a9cde0 !important;
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated:is(.documents-mode,.calendar-mode) .nx-primary-nav{
  background:rgba(183,215,236,.88) !important;
}

/* Documents */
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.documents-mode #mainContent :is(.docs-folder-card,.nd-list,.nd-preview,.docs-upload-panel,.docs-search,.docs-controls,.docs-section){
  background:rgba(212,232,245,.94) !important;
  border-color:rgba(255,255,255,.62) !important;
  box-shadow:0 1px 0 rgba(255,255,255,.75) inset, 0 16px 34px -22px rgba(8,42,60,.4) !important;
  -webkit-backdrop-filter:blur(16px) saturate(1.2);
  backdrop-filter:blur(16px) saturate(1.2);
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.documents-mode #mainContent .docs-folder-card{border-radius:14px !important}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.documents-mode #mainContent .docs-upload-panel{border-radius:16px !important}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.documents-mode #mainContent .docs-folder-overview-head{
  border-color:rgba(255,255,255,.55) !important;
  box-shadow:0 1px 0 rgba(255,255,255,.55) inset, 0 18px 40px -24px rgba(8,42,60,.45) !important;
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.documents-mode #mainContent .docs-folder-total{
  background:rgba(201,224,240,.92) !important;
  border-color:rgba(255,255,255,.7) !important;
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.documents-mode #mainContent .nd-table th{
  background:rgba(201,224,240,.92);
  color:#1d4254;
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.documents-mode #mainContent :is(.nd-document b,.docs-folder-copy b){color:#0b2230}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.documents-mode #mainContent :is(.nd-document small,.docs-folder-copy small){color:#2b4e61}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.documents-mode #mainContent :is(.docs-folder-card:hover,.nd-table tr:hover){
  background:rgba(224,240,248,.96) !important;
}
@media (max-width:760px){
  html.light-theme body#nx-area-root.nx-premium.docs-authenticated.documents-mode #mainContent .docs-folder-overview-head{
    background:rgba(212,232,245,.94) !important;
    background-image:none !important;
  }
}

/* Calendar */
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent :is(.calendar-command-bar,.calendar-surface,.calendar-side-card,.docs-module-tab){
  background:rgba(212,232,245,.94) !important;
  border-color:rgba(255,255,255,.6) !important;
  box-shadow:0 1px 0 rgba(255,255,255,.72) inset, 0 18px 40px -24px rgba(8,42,60,.42) !important;
  -webkit-backdrop-filter:blur(16px) saturate(1.2);
  backdrop-filter:blur(16px) saturate(1.2);
  color:#0b2230 !important;
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent .calendar-command-bar{
  background:
    linear-gradient(90deg,rgba(212,232,245,.94),rgba(201,224,240,.62) 55%,rgba(197,221,212,.18)),
    url('nexus-calendario-2007.webp') center/cover !important;
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent .docs-module-tab.active{
  background:rgba(201,224,240,.96) !important;
  border-color:rgba(12,140,150,.45) !important;
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent .calendar-weekdays{
  background:rgba(191,217,231,.96) !important;
  border-color:rgba(10,50,66,.1) !important;
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent .calendar-weekdays span{color:#1a4252 !important}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent .calendar-day{
  background:rgba(230,242,248,.92) !important;
  border-color:rgba(12,55,70,.1) !important;
  color:#0b2230 !important;
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent .calendar-day.outside{
  background:rgba(191,217,231,.9) !important;
  color:#3d5d6e !important;
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent .calendar-day.today{
  background:rgba(212,232,245,.98) !important;
  box-shadow:inset 0 0 0 1.5px #0c7c88 !important;
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent .calendar-day:hover{
  background:rgba(220,236,246,.98) !important;
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent :is(.calendar-title-block h2,.calendar-title-block h1,.calendar-side-head h3,.docs-module-tab b){color:#0b2230 !important}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent :is(.calendar-title-block p,.docs-module-tab small){color:#2b4e61 !important}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent :is(.docs-event-dialog,.calendar-day-view-dialog){
  background:rgba(212,232,245,.97) !important;
  color:#0b2230 !important;
  border-color:rgba(255,255,255,.7) !important;
  -webkit-backdrop-filter:blur(18px);
  backdrop-filter:blur(18px);
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent :is(.docs-event-head,.docs-event-footer,.calendar-day-view-head,.calendar-day-view-footer){
  background:rgba(201,224,240,.96) !important;
  border-color:rgba(10,58,74,.14) !important;
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent :is(.event-field input,.event-field select,.event-field textarea){
  background:rgba(230,242,248,.96) !important;
  border-color:rgba(10,58,74,.18) !important;
  color:#0b2230 !important;
}
html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent :is(.event-field>span,.event-check>span){color:#1c4254 !important}

/* CRM light. Dark stays on html[data-theme="dark"] in app.css. */
html[data-theme="light"] body{
  --txt:#0b2230;
  --muted:#2b4e61;
  background:
    radial-gradient(1100px 520px at 0% -8%, rgba(255,255,255,.5), transparent 58%),
    radial-gradient(820px 460px at 100% 0%, rgba(20,168,158,.2), transparent 52%),
    linear-gradient(168deg, #b4ced8 0%, #d3e6e8 46%, #c5ddd4 100%) !important;
  color:#0b2230;
}
html[data-theme="light"] :is(.card,.hero-card,.metric){
  background:linear-gradient(180deg, rgba(248,253,254,.78), rgba(226,242,246,.88)) !important;
  border-color:rgba(255,255,255,.62) !important;
  box-shadow:0 1px 0 rgba(255,255,255,.7) inset, 0 16px 36px -22px rgba(8,42,60,.4) !important;
  -webkit-backdrop-filter:blur(14px) saturate(1.15);
  backdrop-filter:blur(14px) saturate(1.15);
}
html[data-theme="light"] .metric-label,
html[data-theme="light"] .metric-foot,
html[data-theme="light"] .muted{color:#2b4e61 !important}
html[data-theme="light"] :is(h1,h2,h3,.value){color:#0b2230}

/* ERP light */
html[data-theme="light"] body{
  background:
    radial-gradient(1100px 520px at 0% -8%, rgba(255,255,255,.5), transparent 58%),
    radial-gradient(820px 460px at 100% 0%, rgba(20,168,158,.18), transparent 52%),
    linear-gradient(168deg, #b4ced8 0%, #d3e6e8 46%, #c5ddd4 100%) !important;
  color:#0b2230;
}
html[data-theme="light"] .nx-card,
html[data-theme="light"] .nx-panel,
html[data-theme="light"] .nx-table-wrap{
  background:rgba(246,252,253,.74) !important;
  border:1px solid rgba(255,255,255,.6) !important;
  box-shadow:0 1px 0 rgba(255,255,255,.72) inset, 0 16px 36px -22px rgba(8,42,60,.4) !important;
  -webkit-backdrop-filter:blur(14px) saturate(1.15);
  backdrop-filter:blur(14px) saturate(1.15);
  color:#0b2230;
}
html[data-theme="light"] .nx-topbar{
  background:rgba(232,244,247,.72);
  -webkit-backdrop-filter:blur(18px) saturate(1.3);
  backdrop-filter:blur(18px) saturate(1.3);
}
html[data-theme="light"] .nx-sidebar{
  background:linear-gradient(180deg, rgba(236,246,248,.92) 0%, rgba(212,232,245,.90) 100%);
  -webkit-backdrop-filter:blur(16px);
  backdrop-filter:blur(16px);
}
html[data-theme="light"] .nx-kpi b,
html[data-theme="light"] .nx-page-head h1{color:#0b2230}
html[data-theme="light"] .nx-kpi span,
html[data-theme="light"] .nx-kpi small,
html[data-theme="light"] .nx-page-head small{color:#2b4e61}

/* Nexus AI panel. Injected sheet has no !important, so these win. */
#nexus-ai-agent-panel{
  background:rgba(236,246,248,.9) !important;
  border:1px solid rgba(255,255,255,.62) !important;
  box-shadow:0 1px 0 rgba(255,255,255,.7) inset, 0 28px 70px -24px rgba(6,28,42,.55) !important;
  -webkit-backdrop-filter:blur(20px) saturate(1.3);
  backdrop-filter:blur(20px) saturate(1.3);
}
#nexus-ai-agent-panel .nxai-tools,
#nexus-ai-agent-panel .nxai-body,
#nexus-ai-agent-panel .nxai-compose,
#nexus-ai-agent-panel .nxai-status,
#nexus-ai-agent-panel .nxai-privacy{
  background:transparent !important;
  color:#0b2230 !important;
}
#nexus-ai-agent-panel .nxai-msg{background:rgba(255,255,255,.72) !important;color:#0b2230 !important;border-color:rgba(12,70,88,.12) !important}
#nexus-ai-agent-panel .nxai-msg.user{background:#0c5f86 !important;color:#fff !important}
#nexus-ai-agent-panel .nxai-tool,
#nexus-ai-agent-panel .nxai-chip{background:rgba(255,255,255,.7) !important;color:#163848 !important}
#nexus-ai-agent-panel .nxai-input{background:rgba(255,255,255,.8) !important;color:#0b2230 !important}

@supports not ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))){
  html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent .calendar-day{background:#e6f2f8 !important}
  html.light-theme body#nx-area-root.nx-premium.docs-authenticated.documents-mode #mainContent .docs-folder-card,
  html.light-theme body#nx-area-root.nx-premium.docs-authenticated.calendar-mode #mainContent .calendar-surface{background:#d4e8f5 !important}
}

@media (prefers-reduced-motion: reduce){
  html.light-theme #nx-home .nh-kpi,
  html.light-theme .docs-folder-card,
  html.light-theme .calendar-day,
  .nx-card{transition:none !important}
}

/* ========== Visual Excellence Marathon 20261005 (CSS-only) ========== */
:root{
  --nx-primary:#0759b7;
  --nx-primary-hover:#064792;
  --nx-success:#087553;
  --nx-warning:#936c00;
  --nx-danger:#b33a4c;
  --nx-cyan-accent:#0a8fa8;
  --nx-surface-elevated:rgba(255,253,250,.92);
  --nx-border-warm:rgba(58,48,36,.11);
  --nx-radius-sm:10px;
  --nx-radius-md:14px;
  --nx-radius-lg:20px;
  --nx-shadow-sm:0 1px 0 rgba(255,255,255,.68) inset,0 10px 28px -20px rgba(18,44,56,.32);
  --nx-shadow-md:0 1px 0 rgba(255,255,255,.74) inset,0 20px 44px -26px rgba(8,38,52,.42);
  --nx-motion-fast:150ms ease;
  --nx-focus-ring:0 0 0 3px rgba(7,89,183,.24);
  --nx-canvas-light:linear-gradient(168deg,#ebe6dc 0%,#f3efe6 42%,#e8e5da 100%);
  --nx-canvas-light-radial:radial-gradient(1100px 520px at 0% -8%,rgba(255,252,247,.58),transparent 58%),radial-gradient(780px 440px at 100% 0%,rgba(28,130,148,.12),transparent 52%);
  --nx-canvas-dark:linear-gradient(152deg,#0c151d 0%,#101f2a 46%,#0f2429 100%);
}

html.light-theme body.nx-premium,
html.light-theme body.internal-docs-page,
html[data-theme="light"] body{
  --nx-bg:#ebe6dc;
  --nx-surface:rgba(252,250,246,.86);
  --nx-surface-2:rgba(241,236,228,.9);
  --nx-text:#1a252f;
  --nx-muted:#5a6470;
  --nx-line:rgba(58,48,36,.12);
  background:var(--nx-canvas-light-radial),var(--nx-canvas-light)!important;
  color:var(--nx-text);
}

html.light-theme body#nx-area-root.overview-mode,
html.light-theme body#nx-area-root.documents-mode,
html.light-theme body#nx-area-root.calendar-mode{
  background:var(--nx-canvas-light-radial),var(--nx-canvas-light)!important;
}

html.light-theme #nx-home{
  --nh-card:rgba(252,250,246,.82);
  --nh-soft:rgba(241,236,228,.92);
  --nh-text:#1a252f;
  --nh-muted:#5a6470;
  --nh-border:rgba(58,48,36,.1);
}

html.light-theme body.nx-premium .nx-topbar,
html[data-theme="light"] .nx-topbar,
html[data-theme="light"] .topbar{
  background:var(--nx-chrome-topbar-bg,linear-gradient(180deg,rgba(236,246,248,.94) 0%,rgba(212,232,245,.92) 100%))!important;
  border-bottom-color:var(--nx-chrome-topbar-border,rgba(169,205,224,.85))!important;
  box-shadow:var(--nx-chrome-topbar-shadow,0 1px 0 rgba(255,255,255,.65) inset,0 16px 36px -22px rgba(8,48,68,.32))!important;
  -webkit-backdrop-filter:blur(20px) saturate(1.28)!important;
  backdrop-filter:blur(20px) saturate(1.28)!important;
}

html[data-theme="light"] :is(.card,.hero-card,.metric,.nx-card,.nx-panel,.nx-table-wrap){
  border-color:rgba(68,58,44,.09)!important;
  box-shadow:var(--nx-shadow-md)!important;
}

html[data-theme="dark"] body,
html:not(.light-theme) body.nx-premium,
html:not(.light-theme) body#nx-area-root{
  background:var(--nx-canvas-dark)!important;
}

html[data-theme="dark"] :is(.nx-card,.nx-panel,.nx-table-wrap,.card,.hero-card,.metric){
  background:rgba(14,32,44,.94)!important;
  border-color:rgba(108,164,198,.14)!important;
  box-shadow:0 1px 0 rgba(255,255,255,.04) inset,0 16px 40px -28px rgba(0,0,0,.45)!important;
}

html[data-theme="dark"] .nx-table th,
html[data-theme="dark"] table th{
  background:rgba(12,32,46,.98)!important;
  color:#b8d4e8!important;
}

html[data-theme="light"] .metric .value,
html[data-theme="light"] .nx-kpi b,
body.nx-premium #mainContent .docs-home-kpi b,
#nx-home .nh-kpi-copy b{
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum" 1;
}

html[data-theme="light"] .metric-label,
html[data-theme="light"] .nx-kpi span,
body.nx-premium #mainContent .docs-home-kpi span{
  font-size:12px!important;
  font-weight:650!important;
  letter-spacing:.02em;
}

html[data-theme="light"] table tbody tr,
html[data-theme="light"] .nx-table tbody tr,
body.nx-premium #mainContent .nd-table tbody tr{
  transition:background-color var(--nx-motion-fast);
}

html[data-theme="light"] table tbody tr:hover,
html[data-theme="light"] .nx-table tbody tr:hover,
body.nx-premium #mainContent .nd-table tbody tr:hover{
  background:rgba(255,255,255,.55)!important;
}

html[data-theme="dark"] table tbody tr,
html[data-theme="dark"] .nx-table tbody tr{
  transition:background-color var(--nx-motion-fast);
}

html[data-theme="light"] :is(input,select,textarea):focus-visible,
html.light-theme body.nx-premium #mainContent :is(input,select,textarea):focus-visible,
html[data-theme="light"] .field input:focus-visible,
html[data-theme="light"] .field select:focus-visible,
html[data-theme="light"] .field textarea:focus-visible,
html[data-theme="light"] .nx-field input:focus-visible,
html[data-theme="light"] .nx-field select:focus-visible,
html[data-theme="light"] .nx-field textarea:focus-visible{
  outline:none!important;
  border-color:#5a9fd4!important;
  box-shadow:var(--nx-focus-ring)!important;
}

html[data-theme="dark"] :is(input,select,textarea):focus-visible,
html[data-theme="dark"] .nx-field input:focus-visible,
html[data-theme="dark"] .nx-field select:focus-visible,
html[data-theme="dark"] .nx-field textarea:focus-visible{
  outline:none!important;
  border-color:rgba(110,180,220,.55)!important;
  box-shadow:0 0 0 3px rgba(40,120,170,.28)!important;
}

html[data-theme="light"] :is(.btn,.nx-btn,a.btn){
  transition:background-color var(--nx-motion-fast),border-color var(--nx-motion-fast),transform var(--nx-motion-fast),box-shadow var(--nx-motion-fast);
}

html[data-theme="light"] :is(.btn,.nx-btn):not(:disabled):hover{
  transform:translateY(-1px);
}

html[data-theme="light"] :is(h1,.nx-page-head h1,.page-actions h1,.topbar h1){
  letter-spacing:-.035em;
  line-height:1.15;
}

html[data-theme="dark"] #nexus-ai-agent-panel{
  background:rgba(12,28,38,.94)!important;
  border-color:rgba(100,160,192,.16)!important;
  box-shadow:0 1px 0 rgba(255,255,255,.05) inset,0 24px 60px -24px rgba(0,0,0,.55)!important;
}

html[data-theme="dark"] #nexus-ai-agent-panel :is(.nxai-tools,.nxai-body,.nxai-compose,.nxai-status,.nxai-privacy){
  color:#e6f2f8!important;
}

html[data-theme="dark"] #nexus-ai-agent-panel .nxai-msg{
  background:rgba(18,42,56,.88)!important;
  color:#e8f4fa!important;
  border-color:rgba(100,160,192,.14)!important;
}

html[data-theme="dark"] #nexus-ai-agent-panel .nxai-input{
  background:rgba(8,22,32,.92)!important;
  color:#edf6fc!important;
  border-color:rgba(100,160,192,.22)!important;
}

html[data-theme="dark"] :is(.nx-btn.primary,.btn.primary){
  box-shadow:0 6px 16px rgba(0,0,0,.28)!important;
}

@media (max-width:820px){
  html[data-theme="light"] :is(.btn,.nx-btn,.topbar .btn){
    min-height:44px;
  }
}

@media (prefers-reduced-motion:reduce){
  html[data-theme="light"] :is(.btn,.nx-btn){transition:none!important;transform:none!important}
}

/* Visual Excellence continue 20261005 — centro notifiche sopra topbar (tablet ERP/CRM) */
#nxUnifiedNotifications.nxun-root:not([hidden]){
  position:fixed!important;
  inset:0!important;
  z-index:110000!important;
  isolation:isolate;
}
#nxUnifiedNotifications.nxun-root:not([hidden]) .nxun-panel{
  z-index:2!important;
}
#nxUnifiedNotifications.nxun-root:not([hidden]) button[data-nxun-close]{
  position:relative;
  z-index:4!important;
  pointer-events:auto!important;
}
body:has(#nxUnifiedNotifications.nxun-root:not([hidden])) :is(.topbar,.nx-topbar,header.topbar,.crm-suite-bar){
  pointer-events:none!important;
}

/* Visual Excellence cycle L — logo suite: presenza visiva desktop allineata all'app Area */
@media (min-width:821px){
  a.crm-suite-brand,
  .nx-topbar a.nx-brand{
    align-items:center!important;
    gap:12px!important;
  }
  a.crm-suite-brand > img,
  .nx-topbar a.nx-brand > img{
    display:block!important;
    flex:0 0 auto!important;
    width:104px!important;
    height:69px!important;
    max-width:104px!important;
    object-fit:cover!important;
    object-position:50% 42%!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
    filter:none!important;
  }
}
@media (max-width:820px){
  .nx-topbar a.nx-brand > img{
    filter:none!important;
    pointer-events:none!important;
  }
}
.enterprise-sidebar .brand-mark,
html[data-theme="dark"] .enterprise-sidebar .brand-mark{
  filter:none!important;
}
html[data-theme="dark"] :is(a.crm-suite-brand > img,.nx-topbar a.nx-brand > img){
  filter:none!important;
}
body.nx-premium .nx-logo-frame img{
  filter:none!important;
}

/* P0 Sidebar/Logo unification 20261006 — shared chrome tokens (CSS-only) */
:root{
  --nx-chrome-sidebar-bg:linear-gradient(180deg, rgba(236,246,248,.92) 0%, rgba(212,232,245,.90) 100%);
  --nx-chrome-sidebar-border:rgba(255,255,255,.48);
  --nx-chrome-topbar-bg:linear-gradient(180deg, rgba(236,246,248,.94) 0%, rgba(212,232,245,.92) 100%);
  --nx-chrome-topbar-border:rgba(169,205,224,.85);
  --nx-chrome-topbar-shadow:0 1px 0 rgba(255,255,255,.65) inset, 0 16px 36px -22px rgba(8,48,68,.32);
  --nx-chrome-sidebar-w:246px;
  --side:var(--nx-chrome-sidebar-w);
  --nx-suite-logo-w:104px;
  --nx-suite-logo-h:69px;
}

html:not([data-theme="dark"]) .nx-sidebar{
  background:var(--nx-chrome-sidebar-bg)!important;
}

html[data-theme="light"] .nx-sidebar,
html:not([data-theme="dark"]) body .nx-shell .nx-sidebar{
  background:var(--nx-chrome-sidebar-bg)!important;
  border-right:1px solid var(--nx-chrome-sidebar-border)!important;
  box-shadow:12px 0 32px rgba(12,48,64,.10)!important;
}

html[data-theme="light"] aside.sidebar.enterprise-sidebar,
html[data-theme="light"] .sidebar.enterprise-sidebar{
  background:var(--nx-chrome-sidebar-bg)!important;
  border-right:1px solid rgba(18,105,183,.12)!important;
  box-shadow:18px 0 42px rgba(40,107,158,.08)!important;
}

@media (min-width:821px){
  html.light-theme body#nx-area-root.nx-premium.docs-authenticated .nx-logo-frame,
  html[data-theme="light"] body.nx-premium.chat-page.docs-authenticated .nx-logo-frame{
    display:block!important;
    position:relative!important;
    width:var(--nx-suite-logo-w)!important;
    height:var(--nx-suite-logo-h)!important;
    min-width:var(--nx-suite-logo-w)!important;
    max-width:var(--nx-suite-logo-w)!important;
    max-height:var(--nx-suite-logo-h)!important;
    overflow:hidden!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
  }
  html.light-theme body#nx-area-root.nx-premium.docs-authenticated .nx-logo-frame img,
  html[data-theme="light"] body.nx-premium.chat-page.docs-authenticated .nx-logo-frame img,
  html[data-theme="light"] body.nx-premium.docs-authenticated .nx-logo-frame img{
    position:static!important;
    display:block!important;
    left:auto!important;
    top:auto!important;
    width:var(--nx-suite-logo-w)!important;
    height:var(--nx-suite-logo-h)!important;
    max-width:var(--nx-suite-logo-w)!important;
    max-height:var(--nx-suite-logo-h)!important;
    margin:0!important;
    object-fit:cover!important;
    object-position:50% 42%!important;
    filter:none!important;
    transform:none!important;
  }
  .enterprise-sidebar .brand{
    display:flex!important;
    align-items:center!important;
    min-height:var(--nx-suite-logo-h)!important;
    padding:4px 8px!important;
    margin:0 0 2px!important;
  }
  .enterprise-sidebar .brand-mark{
    display:block!important;
    width:var(--nx-suite-logo-w)!important;
    height:var(--nx-suite-logo-h)!important;
    max-width:var(--nx-suite-logo-w)!important;
    margin:0!important;
    transform:none!important;
    object-fit:cover!important;
    object-position:50% 42%!important;
    filter:none!important;
  }
}

@media (max-height:760px) and (min-width:1001px){
  .enterprise-sidebar .brand-mark{
    width:var(--nx-suite-logo-w)!important;
    height:var(--nx-suite-logo-h)!important;
    margin:0!important;
  }
}

@media (min-width:821px){
  html[data-theme="light"] :is(aside.sidebar.enterprise-sidebar,.sidebar.enterprise-sidebar,.enterprise-sidebar),
  html:not([data-theme="dark"]) body .nx-shell .nx-sidebar,
  html[data-theme="light"] .nx-sidebar{
    width:var(--nx-chrome-sidebar-w)!important;
    max-width:var(--nx-chrome-sidebar-w)!important;
    min-width:var(--nx-chrome-sidebar-w)!important;
    box-sizing:border-box!important;
  }
  html[data-theme="light"] :is(aside.sidebar.enterprise-sidebar,.sidebar.enterprise-sidebar,.enterprise-sidebar){
    padding:5px 11px 8px!important;
  }
  body.nx-shell .nx-main{
    padding:calc(var(--top) + 1px) 0 0 var(--nx-chrome-sidebar-w)!important;
  }
  html[data-theme="light"] body>main{
    margin-left:var(--nx-chrome-sidebar-w)!important;
  }
}

@media (min-width:821px) and (max-width:1200px){
  :root{
    --nx-chrome-sidebar-w:246px;
    --side:246px;
  }
}

@media (min-width:821px) and (min-height:760px){
  html body.nx-premium.chat-page.docs-authenticated .nx-chat-contact-all[href*="documents"],
  html body#nx-area-root.chat-page .nx-chat-contact-all[href*="documents"]{
    transform:translateY(-84px)!important;
  }
}

@media (min-width:821px) and (max-height:759px){
  html body.nx-premium.chat-page.docs-authenticated .nx-chat-contact-rail,
  html body#nx-area-root.chat-page .nx-chat-contact-rail{
    max-height:calc(100dvh - 96px)!important;
  }
  html body.nx-premium.chat-page.docs-authenticated .nx-chat-contact-list,
  html body#nx-area-root.chat-page .nx-chat-contact-list{
    flex:1 1 0!important;
    min-height:0!important;
    overflow-y:auto!important;
  }
  html body.nx-premium.chat-page.docs-authenticated .nx-chat-contact-all,
  html body#nx-area-root.chat-page .nx-chat-contact-all{
    display:none!important;
  }
}

/* P0 Chrome topbar azzurro Nexus 20261006 — coerenza suite (vince su regole warm legacy) */
html.light-theme body.nx-premium .nx-topbar,
html.light-theme body#nx-area-root.nx-premium.docs-authenticated:is(.documents-mode,.calendar-mode,.overview-mode) .nx-topbar,
html[data-theme="light"] :is(.nx-topbar,.topbar,.crm-suite-bar,header.topbar){
  background:var(--nx-chrome-topbar-bg)!important;
  border-bottom:1px solid var(--nx-chrome-topbar-border)!important;
  box-shadow:var(--nx-chrome-topbar-shadow)!important;
  -webkit-backdrop-filter:blur(20px) saturate(1.28)!important;
  backdrop-filter:blur(20px) saturate(1.28)!important;
}
html.light-theme body.nx-premium .nx-primary-nav,
html.light-theme body#nx-area-root.nx-premium.docs-authenticated:is(.documents-mode,.calendar-mode) .nx-primary-nav{
  background:rgba(183,215,236,.88)!important;
  border-color:rgba(169,205,224,.55)!important;
}
html:not([data-theme="dark"]) .nx-sidebar,
html[data-theme="light"] :is(aside.sidebar.enterprise-sidebar,.sidebar.enterprise-sidebar,.enterprise-sidebar),
html[data-theme="light"] .nx-sidebar{
  background:var(--nx-chrome-sidebar-bg)!important;
}
