/* SaaS visual system, scoped away from printable documents. */
:root{--shell-width:248px;--shell-top:72px;--bg:#f4f6fa;--ink:#23324a;--muted:#708096;--line:#e3e9f1;--shell-shadow:0 8px 30px #1f386408}
.shell-icon{vertical-align:middle;flex-shrink:0;display:inline-block;pointer-events:none}
[hidden]{display:none!important}.shell-sr,#cloudChip,#tenantChip{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important}
#shellSidebar{display:none;position:fixed;inset:0 auto 0 0;width:var(--shell-width);background:#142c50;color:#fff;z-index:45;flex-direction:column;border-right:1px solid #ffffff0c}
.shell-authenticated #shellSidebar{display:flex}.shell-brand{display:flex;align-items:center;gap:12px;padding:22px 19px 19px;min-height:84px;box-sizing:border-box}.shell-brand img{width:42px;height:42px;object-fit:contain;border-radius:12px;background:#fff;padding:3px}.shell-brand-text{font-size:21px;letter-spacing:.5px;font-weight:750;white-space:nowrap}.shell-brand-text span{font-size:13px;font-weight:500;letter-spacing:2px}.shell-brand small{display:block;font-size:10px;font-weight:400;letter-spacing:.2px;color:#a9bad0;margin-top:4px}
#shellSidebar nav.tabs{position:static;display:flex;flex-direction:column;background:transparent;border:0;overflow-y:auto;overflow-x:hidden;gap:14px;padding:8px 12px 22px;scrollbar-width:thin;scrollbar-color:#46607f transparent;min-height:0}
.shell-nav-group{display:flex;flex-direction:column;gap:3px}.shell-nav-group h2{font-size:10px;letter-spacing:1.5px;text-transform:uppercase;color:#94abc8;margin:12px 12px 7px;font-weight:600}
#shellSidebar nav button{display:flex;align-items:center;gap:11px;flex-shrink:0;min-height:39px;width:100%;text-align:left;white-space:normal;border:0;border-radius:7px;background:transparent;color:#c3d0e1;padding:9px 12px;font-size:12px;font-weight:500;line-height:1.4;cursor:pointer}
#shellSidebar nav button:hover{background:#ffffff0b;color:white}#shellSidebar nav button.active{color:#fff;background:#e8731c;box-shadow:0 4px 12px #0001;font-weight:600}#shellSidebar nav button.active .shell-icon{stroke-width:2.2}
header.top{height:var(--shell-top);box-sizing:border-box;background:#fff;color:var(--ink);border-bottom:1px solid var(--line);box-shadow:none;display:flex;align-items:center;gap:18px;padding:14px 26px;z-index:40}
.shell-authenticated header.top,.shell-authenticated main#app{margin-left:var(--shell-width)}
#shellPageName{font-size:14px;white-space:nowrap}#shellSearch{display:flex;align-items:center;border:1px solid var(--line);border-radius:9px;background:#f7f9fc;max-width:370px;flex:1;margin-left:12px;min-width:100px}#shellSearch input{background:transparent;border:0;box-shadow:none!important;min-width:0;width:100%;padding:11px 13px;font-size:12px}#shellSearch button{background:transparent;border:0;color:#7d8aa0;padding:8px;cursor:pointer}
.shell-header-right{display:flex;align-items:center;gap:14px;margin-left:auto;min-width:0}.shell-icon-button{border:1px solid transparent;border-radius:8px;background:transparent;color:#61728b;width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0}.shell-icon-button:hover{background:#f0f3f8;color:var(--navy)}
#shellCompany{font-size:12px;font-weight:600;max-width:180px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}#shellSync{font-size:10px;color:#698273;white-space:nowrap;display:flex;align-items:center;gap:6px;cursor:pointer}#shellSync:before{content:'';width:6px;height:6px;border-radius:50%;background:#35a17b}#shellSync[data-state=pending]:before{background:#e8731c}#shellSync[data-state=offline]:before{background:#8a95a6}#shellSync[data-state=error]{color:#b32737}#shellSync[data-state=error]:before{background:#cf3b3b}
#shellProfile{padding:0;border:0;background:transparent;cursor:pointer}#shellAvatar{width:36px;height:36px;display:grid;place-items:center;border-radius:50%;background:#edf2f9;border:1px solid #dee6f0;color:var(--navy);font-size:11px;font-weight:700}
.shell-popover{position:absolute;right:24px;top:62px;width:300px;max-width:calc(100vw - 32px);background:#fff;border:1px solid var(--line);box-shadow:0 16px 48px #132c5026;padding:10px;border-radius:12px;color:var(--ink);max-height:70dvh;overflow:auto}.shell-popover button{display:flex;align-items:center;gap:10px;width:100%;background:transparent!important;border:0!important;color:var(--ink)!important;box-shadow:none!important;text-align:left;padding:11px 12px;border-radius:7px;cursor:pointer;white-space:normal}.shell-popover button:hover{background:#f3f6fa!important}.shell-profile-heading{padding:10px 12px 15px;margin-bottom:7px;border-bottom:1px solid var(--line)}.shell-profile-heading small{display:block;color:var(--muted);margin-top:5px;overflow-wrap:anywhere}.shell-popover h2{font-size:16px;margin:10px}.shell-popover>.mini{margin:10px}.shell-empty{padding:20px 12px;line-height:1.7;color:var(--muted);font-size:13px}
main#app{max-width:none;min-width:0;padding:28px 32px 64px;box-sizing:border-box;min-height:calc(100dvh - var(--shell-top))}.shell-page-head{gap:24px;margin-bottom:26px!important;align-items:center!important;flex-wrap:wrap}.shell-page-intro{min-width:0;flex:1}.shell-breadcrumb{color:#8491a3;font-size:11px;margin-bottom:11px}.shell-page-intro h1{font-size:25px!important;line-height:1.3;letter-spacing:-.65px;color:#1e3555;margin:0!important;font-weight:700}.shell-page-intro h1 .shell-icon{display:none}.shell-page-intro p{margin:8px 0 0;color:var(--muted);font-size:12px;line-height:1.6}.shell-page-actions{display:flex;flex-wrap:wrap;align-items:center;gap:9px}.shell-page-actions:empty{display:none}
:is(#app,#modalRoot) .btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;border-radius:7px;font-size:12px;padding:9px 13px;font-weight:600;line-height:1.3;white-space:normal}.btn .shell-icon{width:16px;height:16px}:is(#app,#modalRoot) .btn-accent{background:#e8731c;border-color:#e8731c;color:white;box-shadow:0 3px 7px #e8731c18}:is(#app,#modalRoot) .btn-accent:hover{background:#cf6215}:is(#app,#modalRoot) .btn-ghost{background:#fff;border:1px solid #dce4ee;color:#435976}:is(#app,#modalRoot) .btn-primary{background:#213e68}
:is(#app,#modalRoot) :is(input,select,textarea){border-color:#dce4ee;border-radius:7px;font-family:inherit;min-height:36px;box-sizing:border-box;max-width:100%}:is(#app,#modalRoot) input:is([type=checkbox],[type=radio]){min-height:0}:is(#app,#modalRoot) label{color:#52627b}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #e8731c88;outline-offset:3px}
#app :is(.card,.panel,.kpi){border:1px solid var(--line);border-radius:11px;box-shadow:var(--shell-shadow);min-width:0}#app .kpi{padding:20px!important;border-top:3px solid #e7edf5}#app .kpi .v{font-size:25px;letter-spacing:-.6px}#app .kpi .t{color:var(--muted);font-size:11px}#app .kpi .shell-icon{color:#7488a4}#app .table-wrap{border:1px solid var(--line);border-radius:10px;background:white;max-width:100%;min-width:0;overscroll-behavior-x:contain}#app table.grid{font-size:12px}#app table.grid th{background:#f8fafd;color:#748196;font-size:10px;letter-spacing:.45px;text-transform:uppercase;font-weight:650;padding:14px 12px;border-bottom:1px solid var(--line);white-space:nowrap}#app table.grid td{padding:15px 12px;border-bottom:1px solid #edf1f6}#app table.grid tbody tr:hover{background:#f8faff}#app .inline-actions{gap:6px;display:flex;flex-wrap:wrap}#app .badge{border-radius:5px;font-size:10px;padding:4px 8px}#app .view-head:not(.shell-page-head){flex-wrap:wrap;gap:10px}#app :is(.grid-f,.grid-f3)>*{min-width:0}#app .hint{line-height:1.7}
#modalRoot .modal{border-radius:14px;box-shadow:0 24px 80px #142c5033}#modalRoot .modal-h{background:#fff;border-bottom:1px solid var(--line);color:var(--ink);padding:20px 24px}#modalRoot .modal-h h3{font-size:17px}#modalRoot .modal-b{padding:24px}#modalRoot .modal-f{padding:16px 24px;background:#f8fafd;border-top:1px solid var(--line)}.toast{border-radius:9px;box-shadow:0 10px 32px #122b5030}
#shellOverlay{display:none}body:not(.shell-authenticated) :is(#shellMenu,#shellSearch,#shellNotifications,#shellProfile,#shellCompany,#shellSync){display:none}body:not(.shell-authenticated) #shellPageName:before{content:'HD · ';color:#e8731c}
@media(min-width:901px){.shell-collapsed{--shell-width:76px}.shell-collapsed .shell-brand{padding:22px 16px}.shell-collapsed .shell-brand-text,.shell-collapsed .shell-nav-group h2,.shell-collapsed #tabs button span{display:none}.shell-collapsed #shellSidebar nav button{justify-content:center;padding:10px}.shell-collapsed #tabs{gap:16px}.shell-collapsed #tabs .shell-nav-group+.shell-nav-group{border-top:1px solid #ffffff13;padding-top:16px}}
@media(max-width:1200px){header.top{gap:12px;padding:14px 20px}.shell-header-right{gap:9px}#shellSync{display:none}#shellCompany{max-width:120px}main#app{padding:24px}.shell-page-intro h1{font-size:23px!important}}
@media(max-width:900px){.shell-authenticated header.top,.shell-authenticated main#app{margin-left:0}#shellSidebar{transform:translateX(-100%);width:264px;transition:transform .18s ease}.shell-drawer-open #shellSidebar{transform:translateX(0)}.shell-drawer-open{overflow:hidden}.shell-drawer-open #shellOverlay{display:block;position:fixed;inset:0;border:0;background:#10254170;z-index:44;width:100%;height:100%}#shellCompany{display:none}#shellSearch{max-width:none}.shell-page-actions{width:100%}.shell-page-head{gap:18px}}
@media(max-width:600px){:root{--shell-top:64px}header.top{padding:10px 14px;gap:7px}#shellPageName{font-size:12px;max-width:115px;overflow:hidden;text-overflow:ellipsis}#shellSearch{margin-left:auto;flex:0 0 34px;min-width:34px;border:0;background:transparent}#shellSearch input{display:none}#shellSearch button{padding:6px}.shell-header-right{gap:3px;margin-left:0}.shell-header-support{display:none}main#app{padding:22px 16px 42px}.shell-page-intro h1{font-size:23px!important}.shell-page-actions .btn{flex:1;min-width:130px}.shell-breadcrumb{font-size:10px}#app .kpi{padding:16px!important}#app .kpi .v{font-size:22px}#app .inline-actions{min-width:125px}#modalRoot .modal-b{padding:16px}#modalRoot .modal-h{padding:16px}#modalRoot .modal-f{padding:12px 16px}.shell-popover{right:12px;top:58px}}
@media(prefers-reduced-motion:reduce){#shellSidebar{transition:none}}
body.saas-admin-mode #shellSidebar,body.saas-admin-mode #shellOverlay{display:none!important}body.saas-admin-mode main#app{margin-left:0!important}
#app .kpi .lbl{font-size:10px;letter-spacing:.4px;color:#7a8aa3}#app .kpi .val{font-size:24px;letter-spacing:-.5px;margin-top:10px}
#app[data-shell-view=folha] table.grid{min-width:1180px}#app[data-shell-view=folha] .inline-actions{flex-wrap:nowrap}#app[data-shell-view=folha] table.grid td{white-space:nowrap}#app[data-shell-view=folha] table.grid tr[style]{background:#fff!important}#app[data-shell-view=folha] table.grid tr[style]:hover{background:#f8faff!important}
@media(min-width:1201px){#app .kpi-grid{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(min-width:601px) and (max-width:1200px){#app .kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media print{#shellSidebar,header.top,#shellOverlay{display:none!important}.shell-authenticated main#app{margin:0!important}}

/* Mobile navigation overrides the legacy <=680px static/wrapping header.
   The desktop navigation and mobile drawer share the same #tabs element. */
#shellDrawerClose,#shellMobileBrand,.shell-mobile-menu-icon,.shell-mobile-secondary{display:none}
@media screen and (max-width:900px){
  :root{--shell-top:calc(64px + env(safe-area-inset-top))}
  html.shell-scroll-locked{overflow:hidden;overscroll-behavior:none}
  body.shell-drawer-open{position:fixed;top:var(--shell-scroll-y,0px);left:0;right:0;width:100%;overflow:hidden;overscroll-behavior:none}
  header.top{position:sticky;top:0;flex-wrap:nowrap;height:var(--shell-top);padding:calc(10px + env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 10px max(12px,env(safe-area-inset-left));gap:8px;z-index:40}
  .shell-authenticated #shellMenu{display:inline-flex;visibility:visible;flex:0 0 44px}
  #shellMenu .shell-desktop-menu-icon,#shellPageName,#shellSearch,#shellCompany,#shellSync,.shell-header-support{display:none}
  #shellMobileBrand{display:block;font-size:15px;line-height:1.3;white-space:nowrap;color:var(--navy)}
  .shell-mobile-menu-icon{display:block;width:24px;height:24px}
  .shell-header-right{margin-left:auto;gap:4px;flex:0 0 auto}
  :is(#shellMenu,#shellNotifications,#shellProfile){width:44px;height:44px;min-width:44px;display:inline-flex;align-items:center;justify-content:center}
  .shell-popover .shell-mobile-secondary{display:flex}
  #shellSidebar{width:min(85vw,320px);max-width:85vw;height:100vh;height:100dvh;inset:0 auto auto 0;box-sizing:border-box;z-index:1001;overflow:hidden;visibility:hidden;transition:transform .18s ease,visibility .18s;overscroll-behavior:contain}
  .shell-drawer-open #shellSidebar{visibility:visible}
  #shellSidebar .shell-brand{flex:0 0 auto;min-height:84px;padding:calc(14px + env(safe-area-inset-top)) 12px 14px;gap:8px}
  #shellSidebar .shell-brand img{width:34px;height:34px}
  #shellSidebar .shell-brand-text{font-size:18px;min-width:0}
  #shellSidebar .shell-brand-text span{font-size:11px;letter-spacing:1px}
  #shellSidebar .shell-brand-text small{font-size:9px}
  #shellDrawerClose{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;margin-left:auto;border:1px solid #ffffff30;border-radius:8px;background:#ffffff0c;color:#fff;cursor:pointer}
  #shellDrawerClose span{display:none}
  #shellSidebar nav.tabs{flex:1 1 0;min-height:0;width:100%;box-sizing:border-box;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;padding-bottom:calc(24px + env(safe-area-inset-bottom));scrollbar-width:thin}
  #shellSidebar nav.tabs::-webkit-scrollbar{display:block;width:4px}
  #shellSidebar .shell-nav-group{flex:0 0 auto}
  #shellSidebar nav button{min-height:44px;font-size:13px}
  .shell-drawer-open #shellOverlay{z-index:1000;height:100vh;height:100dvh;touch-action:pan-y}
  main#app{width:100%;min-width:0;overflow-x:visible;box-sizing:border-box}
  #app .shell-page-intro{flex:1 1 100%;width:100%;overflow-wrap:anywhere}
  #app .shell-page-actions{min-width:0;width:100%}
  #app :is(.kpi-grid,.cols2,.grid-f,.grid-f3),#modalRoot :is(.grid-f,.grid-f3){grid-template-columns:minmax(0,1fr)!important}
  #app :is(.kpi,.card,.panel){max-width:100%;box-sizing:border-box;overflow-wrap:anywhere}
  :is(#app,#modalRoot) .btn{min-height:44px;min-width:44px}
  #app .shell-page-actions .btn{flex:1 1 100%;min-width:0}
  :is(#app,#modalRoot) :is(input,select,textarea){font-size:16px}
  #modalRoot .modal-bg{padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}
  #modalRoot :is(.modal,.modal.lg){width:100%;min-width:0;max-width:100%;max-height:calc(100vh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
  #modalRoot .modal-h h3{min-width:0;overflow-wrap:anywhere}#modalRoot .modal-h .x{flex-shrink:0;min-width:44px;min-height:44px}
  #modalRoot .modal-b{min-width:0}#modalRoot .table-wrap{max-width:100%;overflow:auto}
  #app .table-wrap{touch-action:pan-x pan-y}
  .shell-popover{box-sizing:border-box;top:calc(var(--shell-top) - 6px);right:12px;max-width:calc(100vw - 24px)}
  button,a{touch-action:manipulation}
  #shellSidebar{user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
}
@media screen and (max-width:900px) and (prefers-reduced-motion:reduce){#shellSidebar{transition:none}}
