/* Revisão do modo noturno. As regras só atuam quando o tema escuro está ativo. */
html[data-nx-panel-theme=dark]{color-scheme:dark;--ink:#e0eafa;--dark:#e4edfc;--text:#c6d5ea;--muted:#a0b5d0;--line:#344963;--line-2:#2c405a;--pale:#1b2d44;--soft:#1b2d44;--bg:#101b2c;--card:#17273d;--blue:#216bd7;--blue-2:#1c5fbf;--blue-soft:#243e61;--green:#78dab1;--green-soft:#163f35;--red:#ff9da8;--red-soft:#482832;--amber:#f1cb7d;--amber-soft:#42371f;--purple:#c8adff;--purple-soft:#352b50;--nx-night-bg:#101b2c;--nx-night-card:#17273d;--nx-night-raised:#20334c;--nx-night-input:#112037;--nx-night-text:#e0eafa;--nx-night-muted:#a0b5d0;--nx-night-line:#344963}
html[data-nx-panel-theme=dark] body{background:var(--nx-night-bg);color:var(--nx-night-text)}
html[data-nx-panel-theme=dark] :is(.dashboard,.ad){--ink:#e0eafa;--dark:#e4edfc;--text:#c6d5ea;--muted:#a0b5d0;--line:#344963;--pale:#1b2d44;--card:#17273d;--soft:#1b2d44;--blue-soft:#243e61;color:var(--nx-night-text);color-scheme:dark}
html[data-nx-panel-theme=dark] :is(.sidebar-logo,.ad-logo,.settings-company strong){color:#e3edfc}
html[data-nx-panel-theme=dark] .sidebar-logo>span{color:#80b1ff}
html[data-nx-panel-theme=dark] :is(.side-link,.side-link .lucide,.side-label,.availability,.workspace-switch small){color:#a8bdd8}
html[data-nx-panel-theme=dark] :is(.side-link.active,.side-link:hover){color:#d4e6ff;background:#294363}
html[data-nx-panel-theme=dark] .side-link>span:not(.orange){background:#2c4461;color:#d3e4fc;border-color:#3d5878}
html[data-nx-panel-theme=dark] :is(.sidebar-spacer,.availability,.config-toggle,.settings-line,.nx-spam-toggle,.nx-spam-number){border-color:var(--nx-night-line)}
html[data-nx-panel-theme=dark] :is(.room-search,.room-tabs,.invite-card,.code-block,.tip,.form-builder,.draft-preview,.feature-search,.feature-detail-head,.secondary-conversation>header,.secondary-conversation>form,.saved-filter-controls details[open]){background:var(--nx-night-card);color:var(--nx-night-text);border-color:var(--nx-night-line)}
html[data-nx-panel-theme=dark] :is(.room:hover,.room.selected,.room-tabs button:hover,.saved-filter-controls button:hover){background:#294363;color:#d6e8ff}
html[data-nx-panel-theme=dark] :is(.room-tabs span,.step-pill,.queue-tag,.closed-tag,.status-chip.gray,.pill,.message-location,.agent-filter-tag){background:#2b405b;color:#c0d5ef;border-color:#405975}
html[data-nx-panel-theme=dark] :is(.data-table th,.table-card th,.data-table td,.data-table tr,.form-builder-field,.department-bars>div){border-color:var(--nx-night-line)}
html[data-nx-panel-theme=dark] :is(.data-table th,.table-card th,.data-table tbody tr:hover){background:#1c304a;color:#c4d8f3}
html[data-nx-panel-theme=dark] :is(.widget-form input:not([type=checkbox]):not([type=color]):not([type=range]),.widget-form textarea,.widget-form select,.form-builder input:not([type=checkbox]):not([type=color]):not([type=range]),.form-builder select,.personal-preferences input:not([type=checkbox]):not([type=color]):not([type=range]),.personal-preferences select,.feature-search input,.visitor-section select){background:var(--nx-night-input);color:var(--nx-night-text);border-color:#465d7a}
html[data-nx-panel-theme=dark] :is(input,textarea)::placeholder{color:#96acc9;opacity:1}
html[data-nx-panel-theme=dark] :is(.configuration-fields,.nx-spam-page){color:var(--nx-night-text)}
html[data-nx-panel-theme=dark] :is(.configuration-tabs button:hover,.preview-devices button){background:#233d5b;color:#c6dcfa;border-color:#476386}
html[data-nx-panel-theme=dark] :is(.preview-devices button.active,.configuration-tabs button.active){background:#304f77;color:#edf5ff;border-color:#7dacf2}
html[data-nx-panel-theme=dark] :is(.invite-preview,.launcher-demo){background:#20344d;border-color:#385574}
html[data-nx-panel-theme=dark] .invite-preview>div>small{color:#b1c5e0}
html[data-nx-panel-theme=dark] :is(.widget-form .field small,.widget-form label>small,.config-toggle small,.settings-line small,.nx-spam-help,.nx-spam-toggle small,.nx-spam-heading p){color:#a0b5d0}
html[data-nx-panel-theme=dark] :is(.nx-spam-warning,.tip.warning,.waiting-alert){background:#40351f;border-color:#766039;color:#f0d299}
html[data-nx-panel-theme=dark] :is(.nx-spam-blocked,.nx-spam-error,.error-banner){background:#442a34;border-color:#795060;color:#ffc0c7}
html[data-nx-panel-theme=dark] .nx-spam-preview{background:var(--nx-night-card);border-color:var(--nx-night-line)}
html[data-nx-panel-theme=dark] :is(.reaction-picker,.message-reactions button,.composer-emoji-panel,.reaction-choices){background:#20344d;color:#e0ecff;border-color:#496384}
html[data-nx-panel-theme=dark] .reaction-picker button:hover{background:#345478}
html[data-nx-panel-theme=dark] :is(.note-mode,.urgency){background:#40351f;color:#f0d299;border-color:#766039}
html[data-nx-panel-theme=dark] .resolve-btn.delete-conv{background:#442a34;color:#ffc0c7;border-color:#795060}
html[data-nx-panel-theme=dark] .resolve-btn.delete-conv:hover{background:#57343f}
html[data-nx-panel-theme=dark] :is(.feature-form pre,.app-install-guide pre,.nx-flow-message:not(.nx-flow-visitor),.nx-flow-reset){background:#20344d!important;color:#d6e7ff!important;border-color:#496384}
/* Profile/team dialogs are mounted on body, outside .dashboard. */
html[data-nx-panel-theme=dark] :is(.nx-pf-dialog,.nx-pf-dialog.nx-pf-form){--ink:#e0eafa;--muted:#a0b5d0;--line:#344963;--soft:#20334c;--card:#17273d;--blue:#82b5ff;--blue-soft:#243e61;--green:#78dab1;--green-soft:#163f35;--red:#ff9da8;--red-soft:#482832;background:#17273d;color:#e0eafa;border:1px solid #3b536f;box-shadow:0 25px 75px #0007}
html[data-nx-panel-theme=dark] :is(.nx-pf-modal,.nx-calendar-overlay,.nxq-overlay,.nx-kb-modal-backdrop){background:#030a16a6}
html[data-nx-panel-theme=dark] .nx-pf-dialog :is(h2,h3,b,strong,.nx-pf-field>span,.nx-pf-switch b){color:#e0eafa}
html[data-nx-panel-theme=dark] .nx-pf-dialog :is(p,small,.nx-pf-switch small,.nx-pm-people small){color:#a0b5d0}
html[data-nx-panel-theme=dark] .nx-pf-dialog :is(.nx-pf-in,.nx-pf-switch){background:#112037;border-color:#465d7a}
html[data-nx-panel-theme=dark] .nx-pf-dialog :is(input,textarea,select){color:#e0eafa;background:transparent;border-color:#465d7a}
html[data-nx-panel-theme=dark] :is(.nx-pf-dialog button:not(.danger):not(.nx-pf-btn),.nx-pf-dialog button.nx-pf-btn.ghost,.nx-pm-people button){background:#20344d;color:#d8e8ff;border-color:#496384}
html[data-nx-panel-theme=dark] :is(.nx-pf-dialog .nx-pf-seg button.on,.nx-pm-people button.on){background:#2c4b70;color:#cce1ff;border-color:#82adf0}
html[data-nx-panel-theme=dark] .nx-pf-dialog button.nx-pf-btn:not(.ghost){background:#2374e8;color:#fff;border-color:#2374e8}
html[data-nx-panel-theme=dark] .nx-pf-dialog button.danger{background:#aa384a;color:#fff;border-color:#bc4a5b}
html[data-nx-panel-theme=dark] .nx-pf-av.t1{background:#21493d;color:#9ee5c5}
html[data-nx-panel-theme=dark] .nx-pf-av.t2{background:#4c3b21;color:#f2cd8e}
html[data-nx-panel-theme=dark] .nx-pf-av.t3{background:#403356;color:#d3b8fc}
html[data-nx-panel-theme=dark] :is(.nx-pf-av:not(.t1):not(.t2):not(.t3),.workspace-person-avatar){background:#2a4468;color:#c4ddff}
/* Quotes, security, calendar and checkout loading surfaces. */
html[data-nx-panel-theme=dark] :is(.nxq-card,.nxq-modal){--nq-bg:#17273d;--nq-text:#e0eafa;--nq-muted:#a0b5d0;--nq-border:#3b536f;--nq-soft:#20344d}
html[data-nx-panel-theme=dark] :is(.nxq-badge,.nxq-status){background:#40351f;color:#f0d299}
html[data-nx-panel-theme=dark] :is(.nx-calendar-modal,.nx-kb-modal,.nx-pay-box,.nx-pay-wait){background:#17273d;color:#dce8f9;border-color:#3b536f}
html[data-nx-panel-theme=dark] .nx-pay-wait i{border-color:#3b536f;border-top-color:#82b5ff}
html[data-nx-panel-theme=dark] :is(.nx-calendar-modal,.nx-kb-modal) :is(input,select,textarea){background:#112037;color:#e0eafa;border-color:#465d7a}
html[data-nx-panel-theme=dark] #chatpro-image-editor .image-editor-content{background:#17273d;color:#e0eafa;border-color:#3b536f}
html[data-nx-panel-theme=dark] #chatpro-image-editor :is(.image-editor-toolbar,.image-editor-bottom){background:#20344d;color:#dce8f9;border-color:#3b536f}
html[data-nx-panel-theme=dark] #chatpro-image-editor :is(button,select){background:#284464;color:#d8e8ff;border-color:#496384}
html[data-nx-panel-theme=dark] :is(.nxm-modal,.nxm-card){--ink:#e0eafa;--text:#c6d5ea;--muted:#a0b5d0;--line:#344963;--bg:#112037;--card:#17273d;--soft:#20344d}
/* Top notifications also live outside the panel root. */
html[data-nx-panel-theme=dark] .nx-panel-notification{--nx-feedback-ink:#e3ecfa;--nx-feedback-muted:#a5bad5;--nx-feedback-bg:#192b43;--nx-feedback-line:#405977;--nx-feedback-soft:#243d5c;box-shadow:0 8px 25px -12px #0008}
html[data-nx-panel-theme=dark] .nx-panel-notification.is-success{--nx-feedback-accent:#74d9ad;--nx-feedback-soft:#1c463b}
html[data-nx-panel-theme=dark] .nx-panel-notification.is-error{--nx-feedback-accent:#ff9faa;--nx-feedback-soft:#482832}
html[data-nx-panel-theme=dark] .nx-panel-notification.is-warning{--nx-feedback-accent:#f1cb7d;--nx-feedback-soft:#42371f}
/* Admin follows the last selected panel appearance. */
html[data-nx-panel-theme=dark] .ad-top{background:#17273d;color:#dce8f9;border-color:#344963}
html[data-nx-panel-theme=dark] :is(.ad-me,.ad-icon-btn,.chip,.sp-avail){background:#20344d;color:#d8e8ff;border-color:#496384}
html[data-nx-panel-theme=dark] :is(.ad .card,.ad .table-wrap,.ad-modal-card,.ad-drawer-card,.ad-menu,.ad .switch,.ad .opt-row,.ad .settings-nav,.ad .nx-email-schedule,.ad .tk-item){background:#17273d;color:#dce8f9;border-color:#344963}
html[data-nx-panel-theme=dark] :is(.ad th,.ad tbody tr.click:hover,.ad .seg button.on,.ad .opt-row.locked,.ad .tk-item:hover,.ad .tk-item.on,.ad .ad-menu a:hover,.ad .ad-menu button:hover){background:#20344d;color:#d8e8ff;border-color:#3c5675}
html[data-nx-panel-theme=dark] :is(.ad .btn.ghost,.ad-modal-card .btn.ghost,.ad-drawer-card .btn.ghost,.ad .cron-cmd .btn){background:#20344d;color:#d8e8ff;border-color:#496384}
html[data-nx-panel-theme=dark] .ad .btn.danger-ghost{background:#442a34;color:#ffc0c7;border-color:#795060}
html[data-nx-panel-theme=dark] :is(.ad .field input,.ad .field select,.ad .field textarea,.ad .search input,.ad .opt-row select,.ad .tk-search,.ad .tk-select,.ad .nx-coupon-search,.ad .sp-code){background:#112037;color:#e0eafa;border-color:#465d7a}
html[data-nx-panel-theme=dark] :is(.ad .sp-msgs,.ad .sp-composer,.ad .sp-info,.ad .sp-closed,.ad .sp-msg,.ad .cfp-composer,.ad .chat-foot-preview,.ad-drawer-card header){background:#17273d;color:#dce8f9;border-color:#344963}
html[data-nx-panel-theme=dark] .ad .sp-msg.note{background:#40351f;color:#f0d299}
html[data-nx-panel-theme=dark] .ad .sp-msg.mine{background:#1c62c7;color:#fff}
html[data-nx-panel-theme=dark] :is(.ad .msg.error,.ad .preview-banner.error){background:#442a34;color:#ffc0c7;border-color:#795060}
html[data-nx-panel-theme=dark] .ad .preview-banner.warning{background:#40351f;color:#f0d299;border-color:#766039}
html[data-nx-panel-theme=dark] :is(.ad .msg,.ad .settings-nav a:hover){background:#20344d;color:#c4dbfa;border-color:#496384}
html[data-nx-panel-theme=dark] .ad :is(.tag.green,.chip.green){background:#163f35;color:#9ee5c5}
html[data-nx-panel-theme=dark] .ad :is(.tag.amber,.chip.amber){background:#42371f;color:#f1cb7d}
html[data-nx-panel-theme=dark] .ad :is(.tag.red,.chip.red){background:#482832;color:#ffb8c1}
/* Native inputs and neutral keyboard focus remain visible in both panel roots and portals. */
html[data-nx-panel-theme=dark] :is(.dashboard,.ad,.nx-pf-dialog,.nxq-modal,.nx-calendar-modal) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea):focus{border-color:#7e94af!important;box-shadow:none!important}
html[data-nx-panel-theme=dark] :is(.dashboard,.ad,.nx-pf-dialog,.nxq-modal,.nx-calendar-modal) :is(input,select,textarea):focus-visible{outline:2px solid #9db6d7!important;outline-offset:2px}
html[data-nx-panel-theme=dark] ::selection{background:#355b8d;color:#f0f6ff}

html[data-nx-panel-theme=dark] .dashboard .text-link{color:#91bcff}
html[data-nx-panel-theme=dark] .dashboard .nx-pf{--blue:#8bbcff;--green:#83ddba;--amber:#f1cb7d;--red:#ff9da8}
html[data-nx-panel-theme=dark] :is(.nx-pf .nx-pf-btn:not(.ghost),.nx-pf-dialog button.nx-pf-btn:not(.ghost)){background:#216bd7;color:#fff;border-color:#216bd7}
html[data-nx-panel-theme=dark] .nx-tm-stat .nx-pf-ico{background:#243e61!important;color:#bfd9ff!important}
html[data-nx-panel-theme=dark] .nx-tm-stat:nth-child(2) .nx-pf-ico{background:#21493d!important;color:#9ee5c5!important}
html[data-nx-panel-theme=dark] .nx-tm-stat:nth-child(3) .nx-pf-ico{background:#4c3b21!important;color:#f2cd8e!important}
html[data-nx-panel-theme=dark] .nx-tm-stat:nth-child(4) .nx-pf-ico{background:#403356!important;color:#d3b8fc!important}
html[data-nx-panel-theme=dark] .nxm-card{background:#17273d;color:#e0eafa;border:1px solid #3b536f}
html[data-nx-panel-theme=dark] :is(.nxm-x,.nxm-ico,.nxm-steps li:before){background:#243e61;color:#bdd8ff}
html[data-nx-panel-theme=dark] :is(.nxm-card p,.nxm-steps li,.nxm-field,.nxm-check,.nxm-note){color:#adbed5}
html[data-nx-panel-theme=dark] :is(.nxm-qr,.nxm-codes,.nxm-status){background:#112037;color:#dce8f9;border-color:#465d7a}
html[data-nx-panel-theme=dark] :is(.nxm-secret,.nxm-codes code){background:#20344d;color:#e0eafa;border-color:#465d7a}
html[data-nx-panel-theme=dark] :is(.nxm-code,.nxm-field input[type=password],.nxm-btn){background:#112037;color:#e0eafa;border-color:#465d7a}
html[data-nx-panel-theme=dark] .nxm-btn.pri{background:#216bd7;color:#fff;border-color:#216bd7}
html[data-nx-panel-theme=dark] :is(.nxm-btn.red,.nxm-err){background:#482832;color:#ffbdc5;border-color:#795060}
html[data-nx-panel-theme=dark] :is(.nxm-status.on,.nxm-ico.ok){background:#163f35;color:#9ee5c5;border-color:#336655}
html[data-nx-panel-theme=dark] .nxm-link{color:#91bcff}
html[data-nx-panel-theme=dark] .nx-kb-modal :is(.nx-kb-modal-head,.nx-kb-modal-intro){border-color:#3b536f;background:#1b2e47;color:#e0eafa}
html[data-nx-panel-theme=dark] .nx-kb-modal :is(p,small,label){color:#b2c5df}
html[data-nx-panel-theme=dark] :is(.ad-modal-card,.ad-drawer-card) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea){background:#112037;color:#e0eafa;border-color:#465d7a}
html[data-nx-panel-theme=dark] :is(.ad-modal-card,.ad-drawer-card) :is(.switch,.opt-row,.table-wrap){background:#17273d;color:#dce8f9;border-color:#344963}
html[data-nx-panel-theme=dark] .nx-lang>button{background:#20344d;color:#d0e3ff;border-color:#496384}
html[data-nx-panel-theme=dark] .nx-lang>button:hover{background:#294767;border-color:#6989b2}
html[data-nx-panel-theme=dark] :is(.nx-lang-menu,.nx-lang-list){background:#17273d;color:#d0e3ff;border-color:#496384}
html[data-nx-panel-theme=dark] .nx-lang-menu button:hover{background:#294767;color:#e5f0ff}
html[data-nx-panel-theme=dark] .nx-pf-dialog .nx-pf-mhead{border-color:#344963}
html[data-nx-panel-theme=dark] .nx-pf-dialog .nx-pf-ico{background:#243e61;color:#bfd9ff}
html[data-nx-panel-theme=dark] .nx-lang-menu button{color:#d0e3ff}
html[data-nx-panel-theme=dark] .nx-lang-menu button.on{background:#294767;color:#d6e8ff}
html[data-nx-panel-theme=dark] .nx-lang-menu button.on em{color:#b6d4ff}
html[data-nx-panel-theme=dark] .nx-spam-success{background:#163f35;color:#9ee5c5;border-color:#336655}
html[data-nx-panel-theme=dark] :is(.nxq-card,.nxq-modal){background:var(--nq-bg);color:var(--nq-text)}
html[data-nx-panel-theme=dark] .nxq-modal .nxq-secondary{background:#20344d;color:#d8e8ff;border-color:#496384}
html[data-nx-panel-theme=dark] .nxm-card .nxm-btn.pri{background:#216bd7;color:#fff;border-color:#216bd7}
