/* Nexus System v14 — shared full-width canvas, topbars and dashboard chat card */
:root { --nx-page-gutter:clamp(16px,2.45vw,42px); }
html { min-width:0; }
body { width:100%;min-width:0; }
body > .main, body > .system-page {
 flex:1 1 0%; width:0;min-width:0;max-width:none!important;margin:0!important;
 box-sizing:border-box;
}
body > .main {padding-inline:var(--nx-page-gutter)!important;}
body > .system-page {display:flex;flex-direction:column;}
body > .system-page > .layout {
 width:100%;max-width:none!important;margin:0!important;
 padding:24px var(--nx-page-gutter) 26px!important;
 flex:1 0 auto;
}
body > .system-page > footer {margin-top:auto;}
body > .main > .users-page,body > .main > .orders-page,
body > .main > .clients-page {width:100%;max-width:none;}
/* Common headers, same outer gutters and surface across all modules */
body > .main > .topbar,
body > .system-page > .topbar {
 display:flex!important;justify-content:space-between!important;align-items:center!important;
 gap:18px;min-height:114px!important;padding:14px 0!important;
 background:transparent!important;border:0!important;border-bottom:1px solid var(--line,#282e38)!important;
 position:relative;overflow:visible!important;margin:0;
}
body > .system-page > .topbar{margin:0 var(--nx-page-gutter)!important;}
body > .main > .topbar::after,
body > .system-page > .topbar::after {
 content:""!important;position:absolute!important;left:0!important;right:auto!important;
 top:auto!important;bottom:-1px!important;width:132px!important;height:2px!important;
 transform:none!important;background:linear-gradient(90deg,#f52a45,transparent)!important;pointer-events:none;
}
.nx-topbar-heading {min-width:0;flex:1;}
.topbar .eyebrow{margin:0 0 7px!important;font-size:10px!important;line-height:1.4;letter-spacing:1.7px!important;color:#ec3952!important;}
.topbar h1 {color:var(--text,var(--ink,#f3f5f8))!important;margin:0!important;
 font-size:clamp(23px,2.2vw,31px)!important;font-weight:800!important;line-height:1.19!important;}
.topbar .nx-topbar-subtitle{margin:7px 0 0;color:var(--muted,#9ca4b0);font-size:12px;line-height:1.5;}
.topbar .top-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex:0 0 auto;flex-wrap:wrap;}
.topbar .top-actions .btn {min-height:40px;white-space:nowrap;}
.topbar .top-actions .theme-btn{background:var(--panel2,var(--subcard,#171a20))!important;
 color:var(--text,var(--ink,#f3f5f8))!important;border-color:var(--line,#30353d)!important;}
/* chat-dashboard block used to depend on chat.css, which the dashboard did not load */
.chat-dashboard-strip {display:block;width:100%;margin:0 0 20px;}
.chat-dashboard-link {display:flex;align-items:center;gap:16px;width:100%;min-width:0;padding:17px 20px;
 text-decoration:none!important;color:var(--text,var(--ink,#f3f5f8))!important;
 background:var(--panel,var(--card,#101318));border:1px solid var(--line,#282e38);
 border-radius:14px;box-shadow:0 10px 30px rgba(0,0,0,.08);
 transition:border-color .18s,transform .18s;}
.chat-dashboard-link:hover{border-color:rgba(237,36,54,.45);transform:translateY(-1px);}
.chat-dashboard-icon {width:48px;height:48px;flex:0 0 48px;display:grid;place-items:center;
 border-radius:13px;background:rgba(242,11,37,.12);color:#f23b51;font-size:24px;}
.chat-dashboard-link>div {display:flex;flex:1;min-width:0;flex-direction:column;gap:5px;}
.chat-dashboard-link strong {font-size:14px;font-weight:800;line-height:1.4;}
.chat-dashboard-link small {font-size:11px;color:var(--muted,#909aab);line-height:1.4;}
.chat-dashboard-link>b {font-size:12px;color:#f34b60;font-weight:800;white-space:nowrap;}
/* Assigned staff in orders */
.nx-assignees {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;
 border:1px solid var(--line,#303741);background:var(--panel2,var(--subcard,#111419));
 border-radius:12px;padding:15px;margin:14px 0 18px;}
.nx-assignees .nx-assignee-title {grid-column:1/-1;color:var(--text,var(--ink,#fff));font-size:12px;margin:0 0 2px;font-weight:800;}
.nx-assignees label {display:flex;flex-direction:column;gap:7px;font-size:11px;margin:0;min-width:0;}
.nx-assignees select {width:100%;min-width:0;}
.nx-assignee-summary {display:flex;flex-wrap:wrap;gap:7px;line-height:1.4;margin:9px 0 0;}
.nx-assignee-summary span {border:1px solid var(--line,#303741);border-radius:7px;padding:6px 9px;
 color:var(--muted,#a0a9b8);background:var(--panel,var(--subcard,#11151b));font-size:10px;}
.nx-assignee-summary b {color:var(--text,var(--ink,#fff));}
@media (max-width:1024px){
 :root{--nx-page-gutter:clamp(14px,3vw,24px)}
 body > .main,body > .system-page{width:100%!important;flex:1 1 auto!important;}
 body > .main > .topbar,body > .system-page > .topbar{min-height:114px!important;}
 .nx-assignees{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:680px){
 body > .main > .topbar,body > .system-page > .topbar {align-items:flex-start!important;
 flex-direction:column!important;gap:13px;min-height:0!important;padding:19px 0!important;}
 .topbar .top-actions {width:100%;justify-content:flex-start!important;}
 .topbar .top-actions .btn {flex:0 1 auto!important;}
 .topbar .nx-topbar-subtitle{font-size:11px;}
 .chat-dashboard-link{gap:12px;padding:14px;}
 .chat-dashboard-icon{height:40px;width:40px;flex-basis:40px;font-size:20px;}
 .chat-dashboard-link>b{font-size:10px;}
 .nx-assignees{grid-template-columns:1fr;gap:12px;}
}

/* Mostrar interface apenas após validação da sessão no backend. */
html.nexus-auth-pending body{visibility:hidden}
