/* Total Gest Nexus. Scoped to the saved Aurora option; other layouts keep their styles. */
body.tg-nexus{--nx-bg:#f4f6fa;--nx-surface:#fff;--nx-text:#17243d;--nx-muted:#65728a;--nx-border:#e3e8f0;--nx-accent:#315bdb;--nx-tint:#edf2ff;--nx-pad:16px;padding:0!important;background:var(--nx-bg)!important;color:var(--nx-text);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body.tg-nexus.dark-mode{--nx-bg:#101827;--nx-surface:#192437;--nx-text:#e6ecf6;--nx-muted:#a4b2c8;--nx-border:#2b3950;--nx-accent:#9bb5ff;--nx-tint:#253658}
body.tg-nexus.nx-comfortable{--nx-pad:24px}
body.tg-nexus #tgSidebar{width:228px;background:#111e34;border:0;color:#bcc8dc}
body.tg-nexus .tg-side-brand{padding:20px 18px 12px;border-bottom:0;min-height:100px}
body.tg-nexus .tg-side-brand .tg-logo-clone{max-height:76px!important;max-width:150px!important;object-fit:contain;background:#fff;border-radius:12px;padding:6px}
body.tg-nexus #tgSidebarToggle{background:#25334a;color:#d6dff0;border:0;width:30px;height:30px}
body.tg-nexus #tgSidebarNav{padding:12px}
body.tg-nexus #tgSidebarNav .tg-nav-item,body.tg-nexus #tgSidebarNav .tg-nav-grupo-btn{color:#bdc9df!important;font-size:.83rem;padding:11px 12px;border-radius:9px;min-height:44px;gap:11px;margin:3px 0;width:100%;text-align:left;cursor:pointer}
body.tg-nexus #tgSidebarNav .tg-nav-item i,body.tg-nexus #tgSidebarNav .tg-nav-grupo-btn i:not(.chev){color:#8097ba!important;font-size:.92rem}
body.tg-nexus #tgSidebarNav .tg-nav-item:hover,body.tg-nexus #tgSidebarNav .tg-nav-grupo-btn:hover{background:#1c2d47!important}
body.tg-nexus #tgSidebarNav .tg-nav-item.ativo,body.tg-nexus #tgSidebarNav .tg-nav-grupo-btn.ativo{background:#294b8b!important;color:#fff!important}
body.tg-nexus #tgSidebarNav .tg-nav-item.ativo i,body.tg-nexus #tgSidebarNav .tg-nav-grupo-btn.ativo i:not(.chev){color:#b5ccff!important}
body.tg-nexus #tgSidebarNav .tg-nav-submenu{border-left:1px solid #35465f;margin:0 0 0 18px;padding-left:8px}
body.tg-nexus .tg-side-foot{border-color:#293950;color:#bdc9df;font-size:.8rem;padding:16px}
body.tg-nexus.com-sidebar>header.header,body.tg-nexus.com-sidebar>#cardsGrid,body.tg-nexus.com-sidebar>.section-container,body.tg-nexus.com-sidebar>#tgHome{margin-left:228px}
body.tg-nexus.tg-sidebar-collapsed #tgSidebar{width:72px}
body.tg-nexus.tg-sidebar-collapsed.com-sidebar>header.header,body.tg-nexus.tg-sidebar-collapsed.com-sidebar>#cardsGrid,body.tg-nexus.tg-sidebar-collapsed.com-sidebar>.section-container,body.tg-nexus.tg-sidebar-collapsed.com-sidebar>#tgHome{margin-left:72px}
body.tg-nexus.tg-sidebar-collapsed .tg-nav-grupo-btn span,body.tg-nexus.tg-sidebar-collapsed .tg-nav-grupo-btn .chev,body.tg-nexus.tg-sidebar-collapsed .tg-nav-submenu,body.tg-nexus.tg-sidebar-collapsed .nx-side-search span{display:none}
body.tg-nexus.tg-sidebar-collapsed #tgSidebarNav .tg-nav-grupo-btn{justify-content:center;padding:12px 0}
body.tg-nexus.tg-sidebar-collapsed .nx-side-search{margin:8px 12px;justify-content:center}
body.tg-nexus.tg-sidebar-collapsed .tg-side-brand{min-height:52px;padding:8px}
body.tg-nexus>header.header{border:0;border-bottom:1px solid var(--nx-border);border-radius:0;box-shadow:none;background:var(--nx-surface);padding:12px 24px!important;min-height:72px;gap:14px}
body.tg-nexus .header-title h2{font-size:1rem;color:var(--nx-text)}
body.tg-nexus .header-logo{max-height:42px!important;max-width:80px;object-fit:contain}
body.tg-nexus .tg-breadcrumb{font-size:.72rem}
body.tg-nexus .header-title .sub{font-size:.72rem}
body.tg-nexus #userDisplay{font-size:.82rem;color:var(--nx-text)}
body.tg-nexus #tgHome{padding:24px 28px 32px;max-width:none;min-width:0}
body.tg-nexus .section-container{background:var(--nx-surface);border:1px solid var(--nx-border);box-shadow:0 3px 16px #17243d04;border-radius:14px;padding:var(--nx-pad);min-width:0}
body.tg-nexus .section-header{margin-bottom:16px}
body.tg-nexus .section-header h2{font-size:1.16rem}
body.tg-nexus table{font-size:.85rem}
body.tg-nexus th{font-size:.73rem;letter-spacing:.02em}
body.tg-nexus td,body.tg-nexus th{padding:10px 12px}
body.tg-nexus .btn{border-radius:9px;font-size:.84rem;min-height:38px;padding:9px 13px}
body.tg-nexus #tgHome .tgm-panel,body.tg-nexus #tgHome .home-card{background:var(--nx-surface)!important;border:1px solid var(--nx-border);border-radius:14px;box-shadow:0 3px 16px #17243d04;padding:var(--nx-pad);color:var(--nx-text);min-width:0;overflow:hidden}
body.tg-nexus #tgHome .tgm-panel::after{display:none}
body.tg-nexus #tgHome .tgm-title{font-size:1.1rem;display:flex;align-items:center;gap:8px;margin-bottom:12px;color:var(--nx-text)}
body.tg-nexus #tgHome .tgm-eyebrow{font-size:.65rem;color:var(--nx-muted);letter-spacing:.1em}
body.tg-nexus #tgHome .tgm-lista,body.tg-nexus #tgHome .tgm-resumo-lista{max-height:340px;overflow:auto;scrollbar-width:thin}
body.tg-nexus.nx-comfortable #tgHome .tgm-lista,body.tg-nexus.nx-comfortable #tgHome .tgm-resumo-lista{max-height:460px}
body.tg-nexus #tgHome .tgm-title [data-nx-fold]{margin-left:auto;flex:none;width:32px;height:32px;border:1px solid var(--nx-border);background:var(--nx-bg);color:var(--nx-muted);border-radius:8px;cursor:pointer}
body.tg-nexus #tgHome .nx-folded{align-self:start;height:auto!important}
body.tg-nexus #tgHome .nx-folded>:not(.tgm-eyebrow):not(.tgm-title):not(.tgm-panel-head){display:none!important}
body.tg-nexus #tgHome .nx-folded .tgm-panel-head>:not(:has(.tgm-title)):not(.tgm-title){display:none!important}
body.tg-nexus #homeFavoritos .nx-favorites{margin-bottom:16px;color:var(--nx-muted);font-size:.8rem}
body.tg-nexus #homeFavoritos summary{cursor:pointer;min-height:36px;padding:10px 0}
body.tg-nexus #homeKpis:empty{display:none}
body.tg-nexus #homeKpis{gap:10px;margin-bottom:16px}
body.tg-nexus .home-kpi{padding:14px;border-color:var(--nx-border);background:var(--nx-surface)}
body.tg-nexus .home-kpi .k-val{font-size:1.35rem;color:var(--nx-text)}
body.tg-nexus .home-kpi .k-ic{width:38px;height:38px}
body.tg-nexus #homeAgendaWrap #omeudia{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr)!important;gap:14px!important;align-items:start!important}
body.tg-nexus #homeAgendaWrap #omeudia>*{min-width:0}
.nx-workspace-head{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:22px}
.nx-eyebrow{font-size:.64rem;font-weight:750;letter-spacing:.15em;color:var(--nx-muted)}
.nx-brand-tag{letter-spacing:.09em;color:var(--nx-accent);margin-left:6px}
.nx-workspace-head h1{font-size:clamp(1.4rem,2.2vw,1.85rem);font-weight:750;letter-spacing:-.04em;margin:6px 0;color:var(--nx-text);line-height:1.2}
.nx-workspace-head p{margin:0;color:var(--nx-muted);font-size:.8rem}
.nx-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.nx-search,.nx-density,.nx-side-search{display:flex;align-items:center;gap:9px;border:1px solid var(--nx-border);border-radius:10px;background:var(--nx-surface);color:var(--nx-muted);padding:11px 13px;cursor:pointer;font:inherit;font-size:.8rem;min-height:44px}
.nx-search kbd{font:inherit;font-size:.62rem;background:var(--nx-bg);border:1px solid var(--nx-border);border-radius:4px;padding:3px;margin-left:20px}
.nx-side-search{background:#1c2d47;border-color:#35465f;color:#bdc9df;margin:8px 18px;text-align:left}
.nx-overview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:22px}
.nx-module{min-width:0;display:flex;flex-direction:column;gap:8px;text-align:left;background:var(--nx-surface);border:1px solid var(--nx-border);border-radius:12px;padding:15px 13px;cursor:pointer;transition:transform .15s,border-color .15s,box-shadow .15s;font:inherit;color:var(--nx-text)}
.nx-module:hover{border-color:var(--nx-accent);box-shadow:0 5px 18px #315bdb12;transform:translateY(-2px)}
.nx-module-top{display:flex;align-items:center;justify-content:space-between;color:var(--nx-accent);margin-bottom:3px}
.nx-tone-1 .nx-module-top{color:#15867e}.nx-tone-2 .nx-module-top{color:#c06d24}
.nx-module .nx-arrow{font-size:.65rem;opacity:.45}
.nx-module strong{font-size:.8rem;font-weight:650;line-height:1.25;overflow-wrap:anywhere}
.nx-module small{font-size:.72rem;color:var(--nx-muted);line-height:1.4;overflow-wrap:anywhere}
body:not(.tg-nexus) #nexusWorkspace,body:not(.tg-nexus) #nexusSideSearch,body:not(.tg-nexus) [data-nx-fold]{display:none!important}
.nx-dialog{--nx-surface:#fff;--nx-text:#17243d;--nx-muted:#65728a;--nx-border:#e3e8f0;--nx-bg:#f4f6fa;border:1px solid var(--nx-border);border-radius:18px;padding:22px;width:min(620px,calc(100% - 24px));max-width:calc(100% - 24px);max-height:calc(100dvh - 40px);color:var(--nx-text);background:var(--nx-surface);box-sizing:border-box;box-shadow:0 30px 100px #0b172c40;position:fixed;inset:0;margin:auto;font-family:Inter,system-ui,sans-serif}
body.dark-mode .nx-dialog{--nx-surface:#192437;--nx-text:#e6ecf6;--nx-muted:#a4b2c8;--nx-border:#2b3950;--nx-bg:#101827}
.nx-dialog::backdrop{background:#0f1d3580;backdrop-filter:blur(5px)}
.nx-dialog-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}
.nx-dialog-head h2{font-size:1.3rem;margin:6px 0 0;color:var(--nx-text)}
.nx-dialog-head button{border:1px solid var(--nx-border);border-radius:9px;background:var(--nx-bg);color:var(--nx-text);width:40px;height:40px;cursor:pointer;flex:none}
.nx-query{display:flex;align-items:center;gap:12px;border:1px solid var(--nx-border);border-radius:10px;background:var(--nx-bg);padding:0 14px;color:var(--nx-muted)}
body.tg-nexus .nx-query input{min-width:0;width:100%;border:0!important;box-shadow:none!important;background:transparent!important;color:var(--nx-text);font-size:16px;padding:14px 0}
.nx-dialog-meta{display:flex;justify-content:space-between;gap:8px;font-size:.67rem;color:var(--nx-muted);padding:12px 0}
.nx-results{max-height:min(440px,50dvh);overflow:auto;scrollbar-width:thin}
.nx-result{width:100%;display:flex;align-items:center;gap:12px;text-align:left;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--nx-text);padding:13px;min-height:60px;cursor:pointer;font:inherit}
.nx-result>i:first-child{width:28px;text-align:center;color:var(--nx-muted)}
.nx-result>i:last-child{margin-left:auto;font-size:.7rem;color:var(--nx-muted)}
.nx-result span{min-width:0}.nx-result strong{display:block;font-size:.87rem}.nx-result small{display:block;font-size:.72rem;margin-top:4px;color:var(--nx-muted);overflow-wrap:anywhere}
.nx-result:hover,.nx-result.nx-selected{border-color:var(--nx-border);background:var(--nx-bg)}
.nx-empty{padding:20px;font-size:.85rem;color:var(--nx-muted)}
body.tg-nexus :is(button,a,input,select,summary):focus-visible{outline:2px solid var(--nx-accent);outline-offset:3px}
@media(min-width:901px){body.tg-nexus .header .user-info{gap:8px}body.tg-nexus #headerMorada:empty{display:none}}
@media(max-width:1200px){.nx-overview{grid-template-columns:repeat(3,minmax(0,1fr))}.nx-workspace-head{align-items:flex-start;flex-wrap:wrap}.nx-search kbd{display:none}}
@media(max-width:900px){
 body.tg-nexus.com-sidebar>header.header,body.tg-nexus.com-sidebar>#cardsGrid,body.tg-nexus.com-sidebar>.section-container,body.tg-nexus.com-sidebar>#tgHome{margin-left:0!important}
 body.tg-nexus #tgSidebar,body.tg-nexus.tg-sidebar-collapsed #tgSidebar{width:min(280px,85vw)}
 body.tg-nexus #tgSidebarToggle{display:none}body.tg-nexus.tg-sidebar-collapsed #tgSidebar .tg-logo-clone,body.tg-nexus.tg-sidebar-collapsed #tgSidebarNav .tg-nav-item span,body.tg-nexus.tg-sidebar-collapsed .tg-nav-grupo-btn span,body.tg-nexus.tg-sidebar-collapsed .tg-nav-grupo-btn .chev,body.tg-nexus.tg-sidebar-collapsed .nx-side-search span{display:initial}
 body.tg-nexus.tg-sidebar-collapsed .tg-nav-submenu{display:block}body.tg-nexus.tg-sidebar-collapsed #tgSidebarNav .tg-nav-item,body.tg-nexus.tg-sidebar-collapsed #tgSidebarNav .tg-nav-grupo-btn{justify-content:flex-start;padding:11px 12px}
 body.tg-nexus>header.header{padding:12px 14px!important;padding-top:calc(12px + env(safe-area-inset-top))!important;gap:8px}
 body.tg-nexus #tgHome{padding:18px 14px 80px}
 body.tg-nexus #homeAgendaWrap #omeudia{grid-template-columns:minmax(0,1fr)!important}
 .nx-workspace-head{gap:15px;margin-bottom:16px}.nx-tools{width:100%}.nx-search{flex:1}.nx-density span{display:none}
 .nx-overview{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:16px}.nx-module{padding:12px 10px}.nx-module strong{font-size:.75rem}.nx-module small{font-size:.68rem}
 body.tg-nexus .section-container{margin:12px 10px;padding:14px}body.tg-nexus{padding-bottom:0!important}
 .nx-dialog{padding:16px}.nx-dialog-meta>span:last-child{display:none}
}
@media(max-width:380px){.nx-overview{grid-template-columns:repeat(2,minmax(0,1fr))}body.tg-nexus #userDisplay{font-size:.72rem}}
@media(prefers-reduced-motion:reduce){.nx-module{transition:none}.nx-module:hover{transform:none}}
/* Explicit mobile shell also covers browsers restoring the desktop drawer state. */
@media(max-width:900px){
 body.tg-nexus #tgSidebar{transform:translateX(-100%);transition:transform .2s ease}
 body.tg-nexus #tgSidebar.aberta{transform:translateX(0)}
 body.tg-nexus .tg-burger{display:inline-flex!important;align-items:center;justify-content:center;min-width:40px;min-height:40px;color:var(--nx-text)}
 body.tg-nexus.sidebar-aberta #tgSidebarOverlay{display:block}
 body.tg-nexus #homeAgendaWrap #omeudia{grid-template-areas:"alertas" "dia" "admin" "equipa" "obras"!important}
}
body.tg-nexus .nx-workspace-head,body.tg-nexus .nx-eyebrow,body.tg-nexus #tgHome .tgm-eyebrow{text-align:left}
body.tg-nexus #homeAgendaWrap #omeudia>:is(.tgm-panel--dia,.tgm-panel--admin,.tgm-panel--equipa){height:auto!important;min-height:0}
body.tg-nexus>header.header{margin-bottom:0}
body.tg-nexus #homeAlertas .alertas-card{padding:var(--nx-pad);background:var(--nx-surface);border:1px solid var(--nx-border);border-radius:14px;box-shadow:0 3px 16px #17243d04;text-align:left}
body.tg-nexus #homeAlertas .alertas-h,body.tg-nexus #homeAlertas h3{color:var(--nx-text);font-size:1.05rem;text-align:left}
body.tg-nexus #homeAlertas .alerta-t{color:var(--nx-text);font-size:.85rem}
body.tg-nexus #homeAlertas .alerta-s{color:var(--nx-muted);font-size:.75rem}
body.tg-nexus #homeAlertas .alerta-linha{padding:11px;border-color:var(--nx-border);background:var(--nx-bg);text-align:left}
body.tg-nexus #homeAlertas .alerta-linha.danger{border-color:#d9606055;background:#d9606010}
body.tg-nexus #homeAlertas .alertas-card{max-height:390px;overflow:auto;scrollbar-width:thin}
body.tg-nexus #tgHome .tgm-alerta-admin{background:var(--nx-bg);color:var(--nx-text)}

.nx-shortcut-toolbar{display:flex;justify-content:flex-end;margin:-6px 0 10px}
.nx-shortcut-toolbar button,.nx-shortcut-actions button,.nx-shortcut-row button{font:inherit;font-size:.8rem;border:1px solid var(--nx-border);border-radius:9px;background:var(--nx-surface);color:var(--nx-text);min-height:44px;padding:8px 12px;cursor:pointer}
.nx-shortcuts-help{color:var(--nx-muted);font-size:.85rem;line-height:1.5}
.nx-shortcut-row{display:grid;grid-template-columns:20px minmax(0,1fr) 44px 44px;gap:8px;align-items:center;margin:10px 0}
.nx-shortcut-row label{color:var(--nx-muted);font-weight:600}
.nx-shortcut-row select{min-width:0;width:100%;font:inherit;font-size:16px;min-height:44px;border:1px solid var(--nx-border);border-radius:9px;background:var(--nx-bg);color:var(--nx-text);padding:8px}
.nx-shortcut-row button{padding:8px;font-size:1.1rem}
.nx-shortcut-row button:disabled{opacity:.35;cursor:default}
.nx-shortcut-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;margin-top:18px}
.nx-shortcut-actions [data-nx-shortcuts-save]{background:#315bdb;color:white;border-color:#315bdb}
#nexusShortcutsStatus{font-size:.8rem;color:var(--nx-muted)}
@media(max-width:380px){.nx-shortcut-row{gap:5px;grid-template-columns:16px minmax(0,1fr) 40px 40px}.nx-shortcut-row button{min-width:0}}

/* Keep header notifications visible on the light Nexus header and in dark mode. */
body.tg-nexus #btnSino{width:44px;height:44px;flex:none;background:var(--nx-bg);color:var(--nx-text);border:1px solid var(--nx-border);border-radius:10px}
body.tg-nexus #btnSino:hover{background:var(--nx-tint);color:var(--nx-accent)}
body.tg-nexus #btnSino .fa-bell{color:inherit;font-size:1.15rem}
body.tg-nexus #sinoBadge{background:#ef4444;color:#fff;box-shadow:0 0 0 2px var(--nx-surface);pointer-events:none}
