/* FS Portal V368.1 · camada exclusiva para celular/tablet. O desktop original não é alterado. */
:root{--fs-touch-min:44px;--fs-safe-top:env(safe-area-inset-top,0px);--fs-safe-right:env(safe-area-inset-right,0px);--fs-safe-bottom:env(safe-area-inset-bottom,0px);--fs-safe-left:env(safe-area-inset-left,0px)}
@media (max-width:1366px){
  html.fs-mobile-ui{font-size:15px;-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:72px}html.fs-mobile-ui,html.fs-mobile-ui body{max-width:100%;overflow-x:hidden}html.fs-mobile-ui body{min-height:var(--fs-visual-height);padding-bottom:var(--fs-safe-bottom);overscroll-behavior-y:none}
  html.fs-mobile-ui button,html.fs-mobile-ui a,html.fs-mobile-ui input,html.fs-mobile-ui select,html.fs-mobile-ui textarea{touch-action:manipulation}html.fs-mobile-ui button,html.fs-mobile-ui [role="button"],html.fs-mobile-ui .btn,html.fs-mobile-ui .nav-item,html.fs-mobile-ui .row-action,html.fs-mobile-ui .mini-btn{min-height:var(--fs-touch-min)}html.fs-mobile-ui input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),html.fs-mobile-ui select,html.fs-mobile-ui textarea{font-size:16px!important;min-height:44px}html.fs-mobile-ui input[type="checkbox"],html.fs-mobile-ui input[type="radio"]{min-width:20px;min-height:20px}
  html.fs-mobile-ui img,html.fs-mobile-ui video,html.fs-mobile-ui canvas,html.fs-mobile-ui svg{max-width:100%}html.fs-mobile-ui canvas{height:auto}html.fs-mobile-ui .chart-container,html.fs-mobile-ui .chart-wrap,html.fs-mobile-ui [class*="chart-card"]{min-width:0}
  html.fs-mobile-ui .table-wrap,html.fs-mobile-ui .table-scroll,html.fs-mobile-ui .data-scroll,html.fs-mobile-ui .table-shell,html.fs-mobile-ui .appropriation-permission-table-wrap,html.fs-mobile-ui [class*="table-container"]{max-width:100%;overflow:auto!important;-webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain;scrollbar-width:thin}html.fs-mobile-ui table{white-space:nowrap}html.fs-mobile-ui td .cell-wrap,html.fs-mobile-ui td .cell-ellipsis{max-width:260px;white-space:normal}
  html.fs-mobile-ui .app-header,html.fs-mobile-ui header.app-header{min-height:64px;padding-top:var(--fs-safe-top);padding-left:max(12px,var(--fs-safe-left));padding-right:max(12px,var(--fs-safe-right));gap:8px}html.fs-mobile-ui .header-title h1,html.fs-mobile-ui .header-module-title,html.fs-mobile-ui .supplier-header-module-title{font-size:14px!important}html.fs-mobile-ui .header-meta,html.fs-mobile-ui .header-kpi,html.fs-mobile-ui .header-sync-cluster{min-width:0}html.fs-mobile-ui .header-account-copy{display:none}
  html.fs-mobile-ui .sidebar{z-index:1200;max-width:min(86vw,340px);padding-bottom:var(--fs-safe-bottom)}html.fs-mobile-ui .sidebar .nav-item{padding-block:10px}html.fs-mobile-ui .portal-sidebar{max-height:calc(var(--fs-visual-height) - 76px);overflow:auto}
  html.fs-mobile-ui .page-head{align-items:flex-start;gap:12px}html.fs-mobile-ui .page-head>.actions,html.fs-mobile-ui .page-actions,html.fs-mobile-ui .toolbar,html.fs-mobile-ui .filter-row,html.fs-mobile-ui .filters{flex-wrap:wrap}html.fs-mobile-ui .page-head>.actions>*{flex:1 1 auto}
  html.fs-mobile-ui .modal-backdrop,html.fs-mobile-ui .modal-overlay,html.fs-mobile-ui #modal:not([hidden]){padding:14px max(14px,var(--fs-safe-right)) calc(14px + var(--fs-safe-bottom)) max(14px,var(--fs-safe-left));align-items:center}html.fs-mobile-ui .modal,html.fs-mobile-ui .modal-card,html.fs-mobile-ui .fs-modal,html.fs-mobile-ui .modal-dialog{width:min(100%,780px)!important;max-width:100%!important;max-height:calc(var(--fs-visual-height) - 28px)!important;overflow:auto!important}html.fs-mobile-ui .modal-actions{position:sticky;bottom:0;z-index:4;margin-inline:-1px;padding-bottom:calc(12px + var(--fs-safe-bottom));background:inherit}
  html.fs-mobile-ui .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}html.fs-mobile-ui .form-grid .span-4,html.fs-mobile-ui .form-grid .full{grid-column:1/-1!important}
  html.fs-mobile-ui .kpi-grid,html.fs-mobile-ui .metric-grid,html.fs-mobile-ui .dashboard-grid,html.fs-mobile-ui .panel-grid,html.fs-mobile-ui .cards-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html.fs-mobile-ui .settings-grid{grid-template-columns:1fr!important}html.fs-mobile-ui .settings-section{min-width:0}html.fs-mobile-ui .global-settings-main{min-width:0;padding-inline:16px!important}
  html.fs-mobile-ui .employee-camera-stage video{width:100%;max-height:52dvh;object-fit:cover}html.fs-mobile-ui .employee-camera-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}html.fs-mobile-ui .biometric-summary,html.fs-mobile-ui .employee-photo-field{grid-template-columns:minmax(150px,220px) minmax(0,1fr)!important}
}

@media (max-width:767px){
  html.fs-mobile-ui{font-size:14px}html.fs-mobile-ui .app-header,html.fs-mobile-ui header.app-header{min-height:58px}html.fs-mobile-ui .header-kpi,html.fs-mobile-ui .header-meta,html.fs-mobile-ui .supplier-header-search{display:none!important}
  html.fs-mobile-ui .page-head{display:block!important;margin-bottom:14px}html.fs-mobile-ui .page-head h1,html.fs-mobile-ui .page-head h2{font-size:22px!important;line-height:1.15}html.fs-mobile-ui .page-head>.actions{display:grid!important;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}html.fs-mobile-ui .page-head>.actions>*{width:100%;margin:0!important}
  html.fs-mobile-ui .form-grid,html.fs-mobile-ui .kpi-grid,html.fs-mobile-ui .metric-grid,html.fs-mobile-ui .dashboard-grid,html.fs-mobile-ui .panel-grid,html.fs-mobile-ui .cards-grid{grid-template-columns:1fr!important}html.fs-mobile-ui .form-grid>*{grid-column:1!important}
  html.fs-mobile-ui main,html.fs-mobile-ui .main,html.fs-mobile-ui .main-content,html.fs-mobile-ui .content-area,html.fs-mobile-ui #viewRoot{min-width:0}html.fs-mobile-ui .main-content,html.fs-mobile-ui .content-area{padding:12px!important}
  html.fs-mobile-ui .modal-backdrop,html.fs-mobile-ui .modal-overlay,html.fs-mobile-ui #modal:not([hidden]){padding:0;align-items:flex-end!important}html.fs-mobile-ui .modal,html.fs-mobile-ui .modal-card,html.fs-mobile-ui .fs-modal,html.fs-mobile-ui .modal-dialog{width:100%!important;max-height:94dvh!important;border-radius:20px 20px 0 0!important}html.fs-mobile-ui .modal-header{position:sticky;top:0;z-index:5;background:inherit}html.fs-mobile-ui .modal-actions{display:grid!important;grid-template-columns:1fr!important}html.fs-mobile-ui .modal-actions>*{width:100%;margin:0!important}
  html.fs-mobile-ui .toolbar,html.fs-mobile-ui .filter-row,html.fs-mobile-ui .filters,html.fs-mobile-ui .bulk-toolbar{display:grid!important;grid-template-columns:1fr!important}html.fs-mobile-ui .toolbar>*,html.fs-mobile-ui .filter-row>*,html.fs-mobile-ui .filters>*{width:100%!important;min-width:0!important}
  html.fs-mobile-ui .row-actions,html.fs-mobile-ui .actions{gap:7px}html.fs-mobile-ui .row-actions button,html.fs-mobile-ui .employee-row-actions button{min-width:44px;padding-inline:10px}
  html.fs-mobile-ui .biometric-summary,html.fs-mobile-ui .employee-photo-field{grid-template-columns:1fr!important}html.fs-mobile-ui .employee-photo-preview{margin-inline:auto}html.fs-mobile-ui .employee-photo-actions,html.fs-mobile-ui .employee-camera-controls{display:grid!important;grid-template-columns:1fr!important}html.fs-mobile-ui .employee-camera-controls>*{width:100%}
}

@media (orientation:landscape) and (max-height:600px) and (any-pointer:coarse){html.fs-mobile-ui .modal,html.fs-mobile-ui .modal-card,html.fs-mobile-ui .fs-modal,html.fs-mobile-ui .modal-dialog{max-height:96dvh!important}html.fs-mobile-ui .employee-camera-stage video{max-height:44dvh}}

/* Estratégia PGM V368 · reforço de usabilidade touch sem alterar o layout desktop. */
@media (max-width:1366px){
  html.fs-mobile-ui body.strategy-pgm-page{max-width:100%;overflow-x:hidden}
  html.fs-mobile-ui body.strategy-pgm-page .app{max-width:100%;padding:14px max(12px,var(--fs-safe-right)) calc(24px + var(--fs-safe-bottom)) max(12px,var(--fs-safe-left))}
  html.fs-mobile-ui body.strategy-pgm-page .topbar{gap:12px;flex-wrap:wrap}
  html.fs-mobile-ui body.strategy-pgm-page .actions{width:100%;justify-content:flex-start}
  html.fs-mobile-ui body.strategy-pgm-page .controls{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
  html.fs-mobile-ui body.strategy-pgm-page .wrap{max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
  html.fs-mobile-ui body.strategy-pgm-page button{min-height:44px;touch-action:manipulation}
  html.fs-mobile-ui body.strategy-pgm-page select,
  html.fs-mobile-ui body.strategy-pgm-page input{min-height:44px;font-size:16px}
  html.fs-mobile-ui body.strategy-pgm-page .taskModal{padding:14px max(14px,var(--fs-safe-right)) calc(14px + var(--fs-safe-bottom)) max(14px,var(--fs-safe-left))}
}
@media (max-width:767px){
  html.fs-mobile-ui body.strategy-pgm-page .app{padding:10px max(9px,var(--fs-safe-right)) calc(22px + var(--fs-safe-bottom)) max(9px,var(--fs-safe-left))}
  html.fs-mobile-ui body.strategy-pgm-page .title{width:100%}
  html.fs-mobile-ui body.strategy-pgm-page .title h1{font-size:20px}
  html.fs-mobile-ui body.strategy-pgm-page .title p{font-size:12px}
  html.fs-mobile-ui body.strategy-pgm-page .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  html.fs-mobile-ui body.strategy-pgm-page .actions>*{width:100%;margin:0}
  html.fs-mobile-ui body.strategy-pgm-page .controls{align-items:flex-start;gap:10px}
  html.fs-mobile-ui body.strategy-pgm-page .taskModal{padding:0;align-items:flex-end}
  html.fs-mobile-ui body.strategy-pgm-page .taskModalCard{width:100%;max-width:100%;max-height:94dvh;border-radius:20px 20px 0 0;overflow:auto}
}

/* V368.2 · Tela inicial do Portal - composicao exclusiva para telefone.
   Mantem desktop/tablet intactos e corrige a aparencia de "desktop comprimido". */
@media (max-width:767px){
  html.fs-mobile-ui body.portal-home{overflow-x:hidden!important}
  html.fs-mobile-ui body.portal-home .portal-layout,
  html.fs-mobile-ui body.portal-home .portal-layout.portal-sidebar-expanded,
  html.fs-mobile-ui body.portal-home .portal-layout.portal-sidebar-collapsed{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
  }

  /* Cabecalho enxuto: logo + titulo + perfil, sem metadados financeiros. */
  html.fs-mobile-ui body.portal-home .app-header{
    grid-template-columns:64px minmax(0,1fr) 48px!important;
    grid-template-areas:"brand title account"!important;
    min-height:68px!important;
    padding:7px 10px!important;
    gap:8px!important;
  }
  html.fs-mobile-ui body.portal-home .brand-box,
  html.fs-mobile-ui body.portal-home .brand-home-button{width:58px!important;min-width:58px!important;height:52px!important}
  html.fs-mobile-ui body.portal-home .brand-logo{width:58px!important;max-width:58px!important;height:46px!important;object-fit:contain!important}
  html.fs-mobile-ui body.portal-home .header-primary{min-width:0!important;align-self:center!important}
  html.fs-mobile-ui body.portal-home .header-title{text-align:center!important;min-width:0!important}
  html.fs-mobile-ui body.portal-home .mobile-project-title{display:block!important;font-size:18px!important;font-weight:850!important;line-height:1.1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;color:#202723!important}
  html.fs-mobile-ui body.portal-home .header-title h1,
  html.fs-mobile-ui body.portal-home .header-meta,
  html.fs-mobile-ui body.portal-home .header-total{display:none!important}
  html.fs-mobile-ui body.portal-home .header-account>summary{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:2px!important;border-radius:13px!important}
  html.fs-mobile-ui body.portal-home .header-account-avatar{width:38px!important;height:38px!important}

  /* Navegacao mobile real: hamburger + menu vertical. Nada de faixa horizontal maior que a tela. */
  html.fs-mobile-ui body.portal-home .portal-sidebar,
  html.fs-mobile-ui body.portal-home .portal-sidebar.is-expanded,
  html.fs-mobile-ui body.portal-home .portal-sidebar.is-collapsed{
    position:sticky!important;
    top:0!important;
    z-index:95!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:54px!important;
    max-height:none!important;
    padding:6px 10px!important;
    background:#075238!important;
    overflow:visible!important;
    box-sizing:border-box!important;
    box-shadow:0 5px 16px rgba(7,65,45,.12)!important;
  }
  html.fs-mobile-ui body.portal-home .portal-side-toggle-wrap{
    display:flex!important;
    justify-content:flex-start!important;
    align-items:center!important;
    margin:0!important;
    height:42px!important;
  }
  html.fs-mobile-ui body.portal-home .portal-side-toggle{
    display:flex!important;
    width:auto!important;
    min-width:104px!important;
    height:42px!important;
    min-height:42px!important;
    flex-direction:row!important;
    justify-content:flex-start!important;
    gap:5px!important;
    padding:0 13px!important;
    border:1px solid rgba(255,255,255,.18)!important;
    border-radius:11px!important;
    background:rgba(255,255,255,.09)!important;
    color:#fff!important;
  }
  html.fs-mobile-ui body.portal-home .portal-side-toggle::after{content:"Menu";margin-left:6px;font-size:12px;font-weight:800;letter-spacing:.02em}
  html.fs-mobile-ui body.portal-home .portal-side-toggle span{width:17px!important;height:2px!important;flex:0 0 17px!important}
  html.fs-mobile-ui body.portal-home .portal-sidebar.is-expanded .portal-side-toggle::after{content:"Fechar menu"}
  html.fs-mobile-ui body.portal-home .portal-side-menu{
    display:none!important;
    width:100%!important;
    max-width:100%!important;
    max-height:min(66dvh,520px)!important;
    margin-top:7px!important;
    padding:6px!important;
    grid-template-columns:1fr!important;
    gap:4px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    scroll-snap-type:none!important;
    border-top:1px solid rgba(255,255,255,.12)!important;
    box-sizing:border-box!important;
  }
  html.fs-mobile-ui body.portal-home .portal-sidebar.is-expanded .portal-side-menu{display:grid!important}
  html.fs-mobile-ui body.portal-home .portal-side-menu::before,
  html.fs-mobile-ui body.portal-home .portal-side-menu::after{display:none!important}
  html.fs-mobile-ui body.portal-home .portal-side-menu button,
  html.fs-mobile-ui body.portal-home .portal-side-menu a,
  html.fs-mobile-ui body.portal-home .portal-sidebar.is-collapsed .portal-side-menu button,
  html.fs-mobile-ui body.portal-home .portal-sidebar.is-collapsed .portal-side-menu a{
    width:100%!important;
    min-width:0!important;
    min-height:44px!important;
    justify-content:flex-start!important;
    gap:10px!important;
    padding:0 12px!important;
    border-radius:9px!important;
    font-size:12px!important;
    white-space:normal!important;
    overflow:visible!important;
    scroll-snap-align:none!important;
  }
  html.fs-mobile-ui body.portal-home .portal-side-menu button span,
  html.fs-mobile-ui body.portal-home .portal-side-menu a span{display:block!important;max-width:none!important;opacity:1!important;overflow:visible!important}
  html.fs-mobile-ui body.portal-home .portal-side-menu button.active{box-shadow:inset 3px 0 0 #f5cf1a!important;background:rgba(255,255,255,.12)!important}
  html.fs-mobile-ui body.portal-home .portal-side-foot{display:none!important}

  /* Conteudo ocupa de fato toda a largura do telefone. */
  html.fs-mobile-ui body.portal-home .portal-main,
  html.fs-mobile-ui body.portal-home .portal-home-dashboard,
  html.fs-mobile-ui body.portal-home .portal-home-executive{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:18px 16px calc(28px + env(safe-area-inset-bottom))!important;
    box-sizing:border-box!important;
    overflow:visible!important;
  }
  html.fs-mobile-ui body.portal-home .portal-main>*{max-width:100%!important;min-width:0!important;box-sizing:border-box!important}

  /* Hero compacto, sem coluna invisivel e sem texto cortado. */
  html.fs-mobile-ui body.portal-home .portal-welcome,
  html.fs-mobile-ui body.portal-home .portal-home-heading{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0 0 14px!important;
    padding:0!important;
  }
  html.fs-mobile-ui body.portal-home .portal-home-heading>div:first-child{width:100%!important;max-width:100%!important;min-width:0!important;flex:none!important}
  html.fs-mobile-ui body.portal-home .portal-eyebrow{font-size:10px!important;line-height:1.25!important;letter-spacing:1.35px!important;margin-bottom:7px!important}
  html.fs-mobile-ui body.portal-home .portal-welcome h2{margin:0 0 7px!important;font-size:32px!important;line-height:1.02!important;letter-spacing:-.8px!important}
  html.fs-mobile-ui body.portal-home .portal-welcome p{width:100%!important;max-width:100%!important;margin:0!important;font-size:14px!important;line-height:1.45!important;white-space:normal!important;overflow:visible!important;overflow-wrap:anywhere!important}
  html.fs-mobile-ui body.portal-home .portal-welcome-actions{display:flex!important;width:100%!important;max-width:100%!important;margin-top:13px!important;gap:8px!important;flex-wrap:wrap!important}
  html.fs-mobile-ui body.portal-home .portal-home-safras-button{width:100%!important;min-height:44px!important;justify-content:center!important}
  html.fs-mobile-ui body.portal-home .portal-welcome-badge{display:none!important}

  /* Cards da Home aparecem imediatamente apos o hero e nunca extrapolam a tela. */
  html.fs-mobile-ui body.portal-home .portal-dedicated-module,
  html.fs-mobile-ui body.portal-home .portal-executive-context,
  html.fs-mobile-ui body.portal-home .portal-home-strategy-grid,
  html.fs-mobile-ui body.portal-home .portal-home-overview-card{width:100%!important;max-width:100%!important;min-width:0!important;margin-left:0!important;margin-right:0!important}
  html.fs-mobile-ui body.portal-home .portal-dedicated-module{margin-bottom:11px!important}
  html.fs-mobile-ui body.portal-home .portal-dedicated-module-card{display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;gap:10px!important;padding:14px!important;min-width:0!important;border-radius:14px!important}
  html.fs-mobile-ui body.portal-home .portal-dedicated-module-icon{width:42px!important;height:42px!important;min-width:42px!important}
  html.fs-mobile-ui body.portal-home .portal-dedicated-module-copy{min-width:0!important}
  html.fs-mobile-ui body.portal-home .portal-dedicated-module-copy h3{font-size:15px!important;line-height:1.25!important;overflow-wrap:anywhere!important}
  html.fs-mobile-ui body.portal-home .portal-dedicated-module-copy p{font-size:11px!important;line-height:1.45!important}
  html.fs-mobile-ui body.portal-home .portal-dedicated-module-tags{gap:5px!important}
  html.fs-mobile-ui body.portal-home .portal-dedicated-module-tags span{font-size:9px!important;padding:5px 7px!important}
  html.fs-mobile-ui body.portal-home .portal-dedicated-module-button{grid-column:1/-1!important;width:100%!important;min-height:42px!important;justify-content:center!important;margin:2px 0 0!important}
  html.fs-mobile-ui body.portal-home .portal-home-strategy-grid{display:grid!important;grid-template-columns:1fr!important;gap:11px!important}
  html.fs-mobile-ui body.portal-home .portal-home-overview-card,
  html.fs-mobile-ui body.portal-home .portal-executive-context{padding:14px!important;border-radius:14px!important}

  /* Defesa contra larguras desktop herdadas dentro da tela inicial. */
  html.fs-mobile-ui body.portal-home .portal-home-executive *{min-width:0}
  html.fs-mobile-ui body.portal-home .portal-home-executive img,
  html.fs-mobile-ui body.portal-home .portal-home-executive svg,
  html.fs-mobile-ui body.portal-home .portal-home-executive canvas{max-width:100%!important}
}


/* ========================================================================== */
/* V370.6 · Tablet adaptativo · retrato e paisagem                             */
/* Mantem desktop inalterado e preserva toda a funcionalidade em touch.        */
/* ========================================================================== */
@media (min-width:768px) and (max-width:1366px){
  html.fs-tablet-ui{
    --fs-touch-min:46px;
    --fs-tablet-gutter:18px;
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;
  }
  html.fs-tablet-ui,html.fs-tablet-ui body{width:100%;max-width:100%;overflow-x:hidden}
  html.fs-tablet-ui body{min-height:var(--fs-visual-height);overscroll-behavior-y:none}
  html.fs-tablet-ui button,html.fs-tablet-ui [role="button"],html.fs-tablet-ui a{touch-action:manipulation}
  html.fs-tablet-ui button,html.fs-tablet-ui [role="button"],html.fs-tablet-ui .btn,html.fs-tablet-ui .button,html.fs-tablet-ui .nav-item,html.fs-tablet-ui .mini-btn{min-height:44px}
  html.fs-tablet-ui input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),html.fs-tablet-ui select,html.fs-tablet-ui textarea{min-height:44px;font-size:16px!important}
  html.fs-tablet-ui .main-content,html.fs-tablet-ui .content-area,html.fs-tablet-ui .portal-main,html.fs-tablet-ui #viewRoot{min-width:0;max-width:100%;box-sizing:border-box}
  html.fs-tablet-ui .page-head,html.fs-tablet-ui .view-head{gap:12px}
  html.fs-tablet-ui .page-actions,html.fs-tablet-ui .page-head>.actions,html.fs-tablet-ui .view-head>.actions,html.fs-tablet-ui .toolbar,html.fs-tablet-ui .filters,html.fs-tablet-ui .filter-row,html.fs-tablet-ui .bulk-toolbar{flex-wrap:wrap;max-width:100%}
  html.fs-tablet-ui .toolbar>*{max-width:100%}
  html.fs-tablet-ui .table-wrap,html.fs-tablet-ui .table-scroll,html.fs-tablet-ui .data-scroll,html.fs-tablet-ui .table-shell,html.fs-tablet-ui .wide-table-scroll,html.fs-tablet-ui .preview-scroll,html.fs-tablet-ui .appropriation-permission-table-wrap,html.fs-tablet-ui [class*="table-container"]{max-width:100%;overflow:auto!important;-webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain;scrollbar-width:thin}
  html.fs-tablet-ui table{white-space:nowrap}
  html.fs-tablet-ui .modal-backdrop,html.fs-tablet-ui .modal-overlay,html.fs-tablet-ui #modal:not([hidden]){padding:18px!important;align-items:center!important}
  html.fs-tablet-ui .modal,html.fs-tablet-ui .modal-card,html.fs-tablet-ui .fs-modal,html.fs-tablet-ui .modal-dialog{width:min(92vw,860px)!important;max-width:92vw!important;max-height:calc(var(--fs-visual-height) - 36px)!important;overflow:auto!important}
  html.fs-tablet-ui .modal-actions{position:sticky;bottom:0;z-index:5;background:inherit;padding-bottom:max(12px,var(--fs-safe-bottom))}
  html.fs-tablet-ui .kpi-grid,html.fs-tablet-ui .metric-grid,html.fs-tablet-ui .dashboard-grid,html.fs-tablet-ui .panel-grid,html.fs-tablet-ui .cards-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html.fs-tablet-ui .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html.fs-tablet-ui .form-grid .full,html.fs-tablet-ui .form-grid .span-3,html.fs-tablet-ui .form-grid .span-4{grid-column:1/-1!important}
  html.fs-tablet-ui img,html.fs-tablet-ui svg,html.fs-tablet-ui canvas,html.fs-tablet-ui video{max-width:100%}
  html.fs-tablet-ui .chart-container,html.fs-tablet-ui .chart-wrap,html.fs-tablet-ui [class*="chart-card"]{min-width:0;max-width:100%}

  /* Home */
  html.fs-tablet-ui body.portal-home .portal-main{padding:20px var(--fs-tablet-gutter) calc(34px + var(--fs-safe-bottom))!important}
  html.fs-tablet-ui body.portal-home .portal-executive-top-grid{grid-template-columns:1fr!important;gap:14px!important}
  html.fs-tablet-ui body.portal-home .portal-executive-context-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html.fs-tablet-ui body.portal-home .portal-home-modules-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html.fs-tablet-ui body.portal-home .portal-home-module-card{min-height:164px!important}
  html.fs-tablet-ui body.portal-home .portal-home-module-copy h3{font-size:14px!important}
  html.fs-tablet-ui body.portal-home .portal-home-module-copy p{font-size:10px!important}

  /* Headers e barras superiores: nao cortar usuario, botoes ou titulos. */
  html.fs-tablet-ui .app-header,html.fs-tablet-ui header.app-header{min-width:0!important;gap:8px!important;padding-left:max(12px,var(--fs-safe-left))!important;padding-right:max(12px,var(--fs-safe-right))!important}
  html.fs-tablet-ui .header-account-copy,html.fs-tablet-ui .account-copy{max-width:150px;min-width:0}
  html.fs-tablet-ui .header-account-copy strong,html.fs-tablet-ui .account-copy strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}

@media (min-width:768px) and (max-width:1366px) and (orientation:portrait){
  html.fs-tablet-ui.fs-tablet-portrait{--fs-tablet-gutter:14px}
  html.fs-tablet-ui.fs-tablet-portrait .page-head,html.fs-tablet-ui.fs-tablet-portrait .view-head{align-items:flex-start!important;flex-wrap:wrap!important}
  html.fs-tablet-ui.fs-tablet-portrait .page-head>.actions,html.fs-tablet-ui.fs-tablet-portrait .view-head>.actions{width:100%;justify-content:flex-start!important}
  html.fs-tablet-ui.fs-tablet-portrait .toolbar{justify-content:flex-start!important;overflow-x:auto;flex-wrap:nowrap!important;padding-bottom:4px;-webkit-overflow-scrolling:touch}
  html.fs-tablet-ui.fs-tablet-portrait .toolbar>*{flex:0 0 auto}
  html.fs-tablet-ui.fs-tablet-portrait .kpi-grid,html.fs-tablet-ui.fs-tablet-portrait .metric-grid,html.fs-tablet-ui.fs-tablet-portrait .dashboard-grid,html.fs-tablet-ui.fs-tablet-portrait .panel-grid,html.fs-tablet-ui.fs-tablet-portrait .cards-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html.fs-tablet-ui.fs-tablet-portrait body.portal-home .portal-layout,html.fs-tablet-ui.fs-tablet-portrait body.portal-home .portal-layout.portal-sidebar-expanded,html.fs-tablet-ui.fs-tablet-portrait body.portal-home .portal-layout.portal-sidebar-collapsed{grid-template-columns:76px minmax(0,1fr)!important}
  html.fs-tablet-ui.fs-tablet-portrait body.portal-home .portal-sidebar{width:76px!important;max-width:76px!important;padding-inline:8px!important;overflow-y:auto!important}
  html.fs-tablet-ui.fs-tablet-portrait body.portal-home .portal-side-menu button,html.fs-tablet-ui.fs-tablet-portrait body.portal-home .portal-side-menu a{width:56px!important;min-width:56px!important;max-width:56px!important;height:52px!important;justify-content:center!important;padding:0!important;margin-inline:auto!important}
  html.fs-tablet-ui.fs-tablet-portrait body.portal-home .portal-side-menu button span,html.fs-tablet-ui.fs-tablet-portrait body.portal-home .portal-side-menu a span{display:none!important}
  html.fs-tablet-ui.fs-tablet-portrait body.portal-home .portal-side-toggle{margin-inline:auto!important}
  html.fs-tablet-ui.fs-tablet-portrait body.portal-home .portal-side-foot{display:none!important}
  html.fs-tablet-ui.fs-tablet-portrait body.portal-home .portal-home-modules-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

@media (min-width:900px) and (max-width:1366px) and (orientation:landscape){
  html.fs-tablet-ui.fs-tablet-landscape{--fs-tablet-gutter:20px}
  html.fs-tablet-ui.fs-tablet-landscape body.portal-home .portal-home-modules-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html.fs-tablet-ui.fs-tablet-landscape .kpi-grid,html.fs-tablet-ui.fs-tablet-landscape .metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html.fs-tablet-ui.fs-tablet-landscape .modal,html.fs-tablet-ui.fs-tablet-landscape .modal-card,html.fs-tablet-ui.fs-tablet-landscape .fs-modal,html.fs-tablet-ui.fs-tablet-landscape .modal-dialog{width:min(88vw,980px)!important;max-width:88vw!important}
}

/* V370.6.1 · Tablet retrato: trilho lateral compacto nos módulos com sidebar. */
@media (min-width:821px) and (max-width:1100px) and (orientation:portrait){
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .sidebar{
    width:82px!important;
    max-width:82px!important;
    padding-left:8px!important;
    padding-right:8px!important;
    overflow-x:hidden!important;
  }
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .sidebar .sidebar-tools,
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .sidebar nav{align-items:center!important}
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .sidebar .nav-item{
    width:60px!important;
    min-width:60px!important;
    max-width:60px!important;
    min-height:56px!important;
    grid-template-columns:1fr!important;
    justify-items:center!important;
    align-content:center!important;
    gap:0!important;
    padding:0!important;
    margin-inline:auto!important;
  }
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .sidebar .nav-item>span:nth-child(2),
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .sidebar .nav-item>b,
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .sidebar .sidebar-footer>div,
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .sidebar .sidebar-organize-button span:last-child{display:none!important}
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .sidebar .nav-item svg,
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .sidebar .nav-icon{margin:0 auto!important}
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .sidebar .sidebar-footer{left:8px!important;right:8px!important;justify-content:center!important}
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .main-content,
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .sidebar.collapsed~.main-content,
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .sidebar+.main-content,
  html.fs-tablet-ui.fs-tablet-portrait body:not(.portal-home) .sidebar~.main-content{
    margin-left:82px!important;
    width:calc(100% - 82px)!important;
    max-width:calc(100% - 82px)!important;
    padding-left:14px!important;
    padding-right:14px!important;
  }
}
