:root{
  --fs-system-green:#0b6b50;
  --fs-system-deep:#0d4637;
  --fs-system-mint:#e8f4ef;
  --fs-system-line:#d7e4de;
  --fs-system-bg:#f5f8f7;
  --fs-system-text:#153b31;
  --fs-system-muted:#667a73;
  --fs-system-footer-height:36px;
}
body{padding-bottom:var(--fs-system-footer-height)!important}
.app-footer{display:none!important}
.fs-system-footer{
  position:fixed;left:0;right:0;bottom:0;z-index:880;height:var(--fs-system-footer-height);
  display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;padding:0 18px;
  box-sizing:border-box;background:rgba(249,251,250,.96);border-top:1px solid var(--fs-system-line);
  box-shadow:0 -2px 12px rgba(14,70,55,.04);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  color:var(--fs-system-muted);font:600 10px/1.15 Montserrat,Arial,sans-serif;letter-spacing:.01em;
}
.fs-system-footer strong{color:var(--fs-system-deep);font-weight:800}
.fs-system-footer-center{justify-self:center;white-space:nowrap}
.fs-system-footer-right{justify-self:end;display:flex;align-items:center;gap:4px}
.fs-system-footer-link{appearance:none;border:0;background:transparent;color:var(--fs-system-green);font:800 10px/1 Montserrat,Arial,sans-serif;padding:7px 8px;border-radius:8px;cursor:pointer}
.fs-system-footer-link:hover,.fs-system-footer-link:focus-visible{background:var(--fs-system-mint);outline:none}
.fs-system-footer-sep{opacity:.45}

.fs-system-modal-backdrop{position:fixed;inset:0;z-index:10050;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(5,36,28,.42);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
.fs-system-modal-backdrop[hidden]{display:none!important}
.fs-system-modal{width:min(780px,96vw);max-height:min(830px,92vh);overflow:auto;background:#fff;border:1px solid var(--fs-system-line);border-radius:20px;box-shadow:0 28px 80px rgba(5,45,34,.24);color:var(--fs-system-text);font-family:Montserrat,Arial,sans-serif}
.fs-system-modal-header{position:sticky;top:0;z-index:2;display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:22px 24px 18px;background:rgba(255,255,255,.97);border-bottom:1px solid #e6efeb}
.fs-system-kicker{display:block;margin-bottom:6px;color:var(--fs-system-green);font-size:10px;font-weight:900;letter-spacing:.14em}
.fs-system-modal-header h2{margin:0;color:var(--fs-system-deep);font-size:22px;line-height:1.15}
.fs-system-modal-header p{margin:6px 0 0;color:var(--fs-system-muted);font-size:12px;line-height:1.5}
.fs-system-close{width:34px;height:34px;flex:0 0 34px;border:1px solid var(--fs-system-line);border-radius:10px;background:#fff;color:var(--fs-system-deep);font-size:20px;cursor:pointer}
.fs-system-modal-body{padding:22px 24px 24px}
.fs-system-category-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:18px}
.fs-system-category{min-height:82px;padding:12px;border:1px solid var(--fs-system-line);border-radius:14px;background:#fbfdfc;text-align:left;cursor:pointer;color:var(--fs-system-text)}
.fs-system-category:hover{border-color:#9ac9b7;background:#f4faf7}.fs-system-category.is-active{border-color:var(--fs-system-green);background:var(--fs-system-mint);box-shadow:0 0 0 2px rgba(11,107,80,.08)}
.fs-system-category b{display:block;font-size:12px;margin:7px 0 3px}.fs-system-category small{display:block;color:var(--fs-system-muted);font-size:10px;line-height:1.35}
.fs-system-category-icon{font-size:17px}
.fs-system-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.fs-system-field{display:flex;flex-direction:column;gap:6px}.fs-system-field.full{grid-column:1/-1}
.fs-system-field label{font-size:10px;font-weight:900;letter-spacing:.07em;color:#547068;text-transform:uppercase}
.fs-system-field input,.fs-system-field select,.fs-system-field textarea{width:100%;box-sizing:border-box;border:1px solid #cfddd7;border-radius:11px;background:#fff;color:var(--fs-system-deep);padding:11px 12px;font:600 12px/1.4 Montserrat,Arial,sans-serif;outline:none}
.fs-system-field textarea{min-height:118px;resize:vertical}.fs-system-field input:focus,.fs-system-field select:focus,.fs-system-field textarea:focus{border-color:#60a98e;box-shadow:0 0 0 3px rgba(11,107,80,.09)}
.fs-system-user-card{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0;padding:14px;border:1px solid #dce9e4;border-radius:13px;background:#f7faf9}
.fs-system-user-card span{display:flex;flex-direction:column;gap:2px;min-width:0}.fs-system-user-card small{font-size:9px;font-weight:800;color:#71847d;text-transform:uppercase;letter-spacing:.06em}.fs-system-user-card strong{font-size:11px;color:var(--fs-system-deep);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fs-system-consent{display:flex;align-items:flex-start;gap:8px;margin:14px 0 0;color:var(--fs-system-muted);font-size:10px;line-height:1.45}.fs-system-consent input{margin-top:2px;accent-color:var(--fs-system-green)}
.fs-system-actions{display:flex;justify-content:flex-end;align-items:center;gap:9px;margin-top:18px}.fs-system-btn{min-height:38px;padding:0 15px;border-radius:11px;border:1px solid var(--fs-system-line);background:#fff;color:var(--fs-system-deep);font:800 11px Montserrat,Arial,sans-serif;cursor:pointer}.fs-system-btn.primary{border-color:var(--fs-system-green);background:var(--fs-system-green);color:#fff}.fs-system-btn:hover{filter:brightness(.98)}
.fs-system-status{margin-top:12px;padding:10px 12px;border-radius:10px;background:#f6faf8;color:#55726a;font-size:10px;line-height:1.45}.fs-system-status:empty{display:none}.fs-system-status.success{background:#e8f5ef;color:#0b6b50}.fs-system-status.warning{background:#fff8e9;color:#8a5c00}.fs-system-status.error{background:#fff0f0;color:#9b2c2c}.fs-system-status a{color:inherit;font-weight:900}
.fs-system-about-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.fs-system-about-item{padding:14px;border:1px solid var(--fs-system-line);border-radius:13px;background:#f9fbfa}.fs-system-about-item small{display:block;margin-bottom:4px;color:#71847d;font-size:9px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.fs-system-about-item strong{display:block;color:var(--fs-system-deep);font-size:13px}.fs-system-about-description{margin:0 0 18px;color:#5f746d;font-size:12px;line-height:1.6}

.fs-home-system-card{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr);gap:16px;margin-top:18px;padding:18px;border:1px solid #cfe0d9;border-radius:18px;background:linear-gradient(135deg,#ffffff 0%,#f4faf7 100%);box-shadow:0 10px 30px rgba(17,76,60,.05)}
.fs-home-system-eyebrow{display:block;color:var(--fs-system-green);font-size:9px;font-weight:900;letter-spacing:.13em;margin-bottom:7px}.fs-home-system-card h3{margin:0 0 6px;color:var(--fs-system-deep);font-size:17px}.fs-home-system-card p{margin:0;color:#60756d;font-size:11px;line-height:1.55}.fs-home-system-meta{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}.fs-home-system-meta span{padding:6px 9px;border:1px solid #d4e4de;border-radius:999px;background:#fff;color:#4c6a60;font-size:9px;font-weight:800}.fs-home-system-support{display:flex;flex-direction:column;justify-content:center;padding:15px;border-radius:14px;background:#0d503e;color:#fff}.fs-home-system-support small{font-size:9px;font-weight:900;letter-spacing:.11em;opacity:.78}.fs-home-system-support strong{font-size:15px;margin:4px 0 6px}.fs-home-system-support p{color:rgba(255,255,255,.78);font-size:10px}.fs-home-system-support-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.fs-home-system-support button{border:1px solid rgba(255,255,255,.35);border-radius:9px;background:#fff;color:#0d503e;padding:8px 10px;font:800 9px Montserrat,Arial,sans-serif;cursor:pointer}.fs-home-system-support button.secondary{background:transparent;color:#fff}

@media(max-width:780px){
  .fs-system-footer{grid-template-columns:1fr auto;padding:0 10px}.fs-system-footer-center{display:none}.fs-system-footer-left{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.fs-system-footer-right{gap:0}.fs-system-footer-link{padding:7px 5px}.fs-system-footer-sep{display:none}
  .fs-system-category-grid{grid-template-columns:1fr 1fr}.fs-system-form-grid,.fs-system-user-card,.fs-system-about-grid{grid-template-columns:1fr}.fs-system-modal-header,.fs-system-modal-body{padding-left:17px;padding-right:17px}.fs-home-system-card{grid-template-columns:1fr}
}


/* V370.5 · interface única clara, notificações e camadas administrativas */
:root{
  --fs-ui-page:#f4f8f6;
  --fs-ui-surface:#ffffff;
  --fs-ui-surface-2:#f8fbf9;
  --fs-ui-surface-3:#eef5f1;
  --fs-ui-text:#153b31;
  --fs-ui-text-strong:#0d392c;
  --fs-ui-muted:#667a73;
  --fs-ui-line:#d7e4de;
  --fs-ui-shadow:rgba(13,61,46,.10);
}
.fs-ui-icon{width:18px;height:18px;display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.fs-notification-center{position:relative;display:inline-flex;align-items:center;flex:0 0 auto;font-family:Montserrat,Arial,sans-serif}
.fs-notification-center.is-floating{position:fixed;top:14px;right:76px;z-index:12000}
.fs-notification-button{position:relative;display:grid;place-items:center;width:38px;height:38px;padding:0;border:1px solid var(--fs-ui-line);border-radius:11px;background:var(--fs-ui-surface);color:var(--fs-system-green);box-shadow:0 4px 16px var(--fs-ui-shadow);cursor:pointer;transition:.16s ease}
.fs-notification-button:hover{border-color:#80b59f;background:var(--fs-ui-surface-2);transform:translateY(-1px)}
.fs-notification-button b{position:absolute;top:-5px;right:-5px;display:grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border:2px solid #fff;border-radius:999px;background:#d44c3d;color:#fff;font:900 8px/1 Montserrat,Arial,sans-serif;box-sizing:border-box}
.fs-notification-popover{position:absolute;top:calc(100% + 10px);right:0;z-index:20020;width:min(390px,calc(100vw - 24px));padding:0;overflow:hidden;border:1px solid var(--fs-ui-line);border-radius:15px;background:var(--fs-ui-surface);box-shadow:0 22px 65px rgba(3,32,24,.22);color:var(--fs-ui-text)}
.fs-notification-popover[hidden]{display:none!important}
.fs-notification-popover>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 15px;border-bottom:1px solid var(--fs-ui-line);background:var(--fs-ui-surface-2)}
.fs-notification-popover>header small{display:block;color:var(--fs-system-green);font-size:8px;font-weight:900;letter-spacing:.09em}.fs-notification-popover>header strong{display:block;margin-top:2px;color:var(--fs-ui-text-strong);font-size:14px}.fs-notification-popover>header button{border:0;background:transparent;color:var(--fs-system-green);font:800 9px Montserrat,Arial,sans-serif;cursor:pointer}
.fs-notification-list{max-height:min(460px,65vh);overflow:auto;background:var(--fs-ui-surface)}.fs-notification-empty{padding:22px 16px;color:var(--fs-ui-muted);font-size:10px;text-align:center}
.fs-notification-item{position:relative;width:100%;display:grid;grid-template-columns:36px minmax(0,1fr);gap:10px;align-items:flex-start;padding:12px 14px;border:0;border-bottom:1px solid var(--fs-ui-line);background:var(--fs-ui-surface);color:inherit;text-align:left;cursor:pointer;text-decoration:none;box-sizing:border-box}
.fs-notification-item:hover{background:var(--fs-ui-surface-2)}.fs-notification-item.is-unread{background:#eef9f4}.fs-notification-item.is-unread:after{content:"";position:absolute;right:9px;top:12px;width:6px;height:6px;border-radius:50%;background:#15986c}
.fs-notification-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:var(--fs-ui-surface-3);color:var(--fs-system-green)}.fs-notification-icon .fs-ui-icon{width:18px;height:18px;stroke-width:1.9}
.fs-notification-item strong{display:block;padding-right:12px;color:var(--fs-ui-text-strong);font-size:10px}.fs-notification-item small{display:block;margin-top:2px;color:var(--fs-ui-muted);font-size:8px}.fs-notification-item em{display:block;margin-top:5px;color:var(--fs-ui-muted);font-size:9px;line-height:1.4;font-style:normal;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.fs-notification-popover>footer{padding:10px 14px;background:var(--fs-ui-surface-2);text-align:center}.fs-notification-popover>footer a{color:var(--fs-system-green);font:900 9px Montserrat,Arial,sans-serif;text-decoration:none}
.fs-native-chat-notifications .notification-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;text-decoration:none;color:inherit}.fs-native-chat-notifications .notification-item strong{display:block}.fs-native-chat-notifications .notification-item small{display:block;margin-top:5px}.fs-native-chat-notifications .notification-item.unread{background:#eef9f4}

/* Modais/configurações sempre em primeiro plano e dentro da viewport. */
.modal-backdrop,.decision-backdrop,.fs-system-modal-backdrop,.chat-modal-backdrop{position:fixed!important;inset:0!important;z-index:20000!important;align-items:center!important;justify-content:center!important;place-items:center!important;overflow:auto!important;padding:clamp(10px,2vw,24px)!important}
.modal-backdrop[hidden],.decision-backdrop[hidden],.fs-system-modal-backdrop[hidden],.chat-modal-backdrop[hidden]{display:none!important}
.modal-card,.decision-card,.fs-system-modal,.chat-modal{position:relative!important;z-index:20001!important;max-height:calc(100dvh - 32px)!important;overflow:auto!important;margin:auto!important}
.toast-stack,.chat-toast-stack{z-index:21050!important;bottom:calc(var(--fs-system-footer-height,36px) + 14px)!important}

/* Correção da rosca "Lançamentos por unidade": integralmente contida no card. */
.kob-impact-unit-donut-card{overflow:hidden!important;grid-template-columns:78px minmax(0,1fr)!important;grid-template-rows:auto minmax(76px,1fr)!important;min-height:126px!important;align-content:center!important;row-gap:6px!important}
.kob-impact-donut-copy{grid-column:1/-1!important}
.kob-impact-donut-body{display:grid!important;grid-column:1/-1!important;grid-template-columns:76px minmax(0,1fr)!important;align-items:center!important;gap:8px!important;min-height:76px!important}
.kob-impact-donut-svg-wrap{width:70px!important;height:70px!important;overflow:hidden!important;justify-self:center!important;align-self:center!important}
.kob-impact-donut-svg-wrap svg{width:70px!important;height:70px!important;overflow:hidden!important;max-width:70px!important;max-height:70px!important}
.kob-impact-donut-legend-list{max-height:72px!important;overflow:auto!important}
.chat-empty-icon svg{display:block;margin:auto}

@media(max-width:820px){
  .kob-impact-unit-donut-card{grid-template-columns:72px minmax(0,1fr)!important;min-height:120px!important}
  .kob-impact-donut-body{grid-template-columns:70px minmax(0,1fr)!important}
  .kob-impact-donut-svg-wrap,.kob-impact-donut-svg-wrap svg{width:66px!important;height:66px!important;max-width:66px!important;max-height:66px!important}
}
@media(max-width:780px){
  .fs-notification-popover{position:fixed;top:72px;right:10px;left:10px;width:auto;max-width:none}
  .modal-card,.decision-card,.fs-system-modal,.chat-modal{width:100%!important;max-height:calc(100dvh - 18px)!important;border-radius:16px!important}
  .modal-backdrop,.decision-backdrop,.fs-system-modal-backdrop,.chat-modal-backdrop{padding:9px!important;align-items:center!important;place-items:center!important}
}

/* ========================================================================== */
/* V371.4 · FS Command Surface                                                */
/* Reformulação visual e responsiva transversal, preservando a paleta FS.    */
/* ========================================================================== */

:root{
  --fsx-green:var(--fs-green,var(--green,var(--chat-green,#187b56)));
  --fsx-green-dark:var(--fs-green-dark,var(--green-dark,var(--chat-green-deep,#0f5b40)));
  --fsx-green-deep:#0d4637;
  --fsx-green-soft:var(--fs-green-soft,var(--green-soft,var(--chat-green-soft,#e8f3ee)));
  --fsx-yellow:var(--fs-yellow,var(--yellow,#f5cf1a));
  --fsx-page:var(--bg,var(--chat-bg,#f4f6f5));
  --fsx-surface:var(--surface,var(--chat-surface,#ffffff));
  --fsx-surface-2:var(--surface-2,var(--chat-surface-2,#f9faf9));
  --fsx-line:var(--line,var(--chat-line,#dde3df));
  --fsx-line-strong:var(--line-strong,var(--chat-line-strong,#cbd4cf));
  --fsx-text:var(--text,var(--ink,var(--chat-text,#2f3438)));
  --fsx-muted:var(--muted,var(--chat-muted,#737a7f));
  --fsx-danger:var(--danger,var(--chat-danger,#b42318));
  --fsx-font:"Montserrat","Aptos","Calibri","Segoe UI",Arial,sans-serif;
  --fsx-display:"Space Grotesk","Montserrat","Aptos Display","Calibri",sans-serif;
  --fsx-mono:"Aptos Mono","Cascadia Mono","Consolas",monospace;
  --fsx-r-xs:8px;
  --fsx-r-sm:10px;
  --fsx-r-md:14px;
  --fsx-r-lg:18px;
  --fsx-r-xl:22px;
  --fsx-shadow-xs:0 1px 2px rgba(13,70,55,.035),0 3px 10px rgba(13,70,55,.035);
  --fsx-shadow-sm:0 1px 2px rgba(13,70,55,.04),0 9px 24px rgba(13,70,55,.055);
  --fsx-shadow-md:0 2px 5px rgba(13,70,55,.045),0 16px 42px rgba(13,70,55,.08);
  --fsx-shadow-lg:0 26px 80px rgba(5,45,34,.22);
  --fsx-focus:0 0 0 3px rgba(24,123,86,.22);
  --fsx-fast:120ms;
  --fsx-normal:190ms;
  --fsx-slow:280ms;
  --fsx-ease:cubic-bezier(0,.55,.2,1);
  --fsx-footer-h:40px;
}

html{
  min-height:100%;
  background:var(--fsx-page);
  color-scheme:light;
  scrollbar-gutter:stable;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

body,
button,
input,
select,
textarea{
  font-family:var(--fsx-font)!important;
}

body{
  background-color:var(--fsx-page);
  color:var(--fsx-text);
  font-feature-settings:"kern" 1,"liga" 1,"tnum" 1;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
  padding-bottom:var(--fsx-footer-h)!important;
}

::selection{background:rgba(245,207,26,.42);color:var(--fsx-green-deep)}

:where(button,a,input,select,textarea,summary,[tabindex]):focus-visible{
  outline:2px solid var(--fsx-green)!important;
  outline-offset:2px!important;
  box-shadow:var(--fsx-focus)!important;
}

:where(button,a,[role="button"]){-webkit-tap-highlight-color:transparent}

:where(button,.btn,.button,.primary-button,.secondary-button,.ghost-button,.danger-button,.icon-button,.small-button,.compact-button,.mini,.mini-btn,.row-action,.table-action,.portal-card-button,.portal-outline-button,.chat-outline-button,.chat-icon-button){
  transition:background-color var(--fsx-fast) var(--fsx-ease),border-color var(--fsx-fast) var(--fsx-ease),color var(--fsx-fast) var(--fsx-ease),box-shadow var(--fsx-normal) var(--fsx-ease),transform var(--fsx-fast) var(--fsx-ease),opacity var(--fsx-fast) var(--fsx-ease)!important;
}

:where(button,.btn,.button,.primary-button,.secondary-button,.ghost-button,.danger-button,.icon-button,.small-button,.compact-button,.mini,.mini-btn,.row-action,.table-action,.portal-card-button,.portal-outline-button,.chat-outline-button,.chat-icon-button):active:not(:disabled){
  transform:translateY(1px) scale(.985)!important;
}

button:disabled,[aria-disabled="true"]{filter:saturate(.6);cursor:not-allowed!important}

/* Acessibilidade estrutural */
.fs-skip-link{
  position:fixed;left:16px;top:10px;z-index:30000;
  transform:translateY(-160%);padding:10px 14px;border-radius:10px;
  background:var(--fsx-green-dark);color:#fff;text-decoration:none;font-size:12px;font-weight:850;
  box-shadow:var(--fsx-shadow-md);transition:transform var(--fsx-normal) var(--fsx-ease);
}
.fs-skip-link:focus{transform:none}

/* Fundo técnico muito sutil, sem introduzir novas cores. */
body:not([data-fs-module="communication"]):not(.strategy-pgm-page)::before{
  content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;
  background:
    radial-gradient(circle at 94% 2%,rgba(24,123,86,.055),transparent 25rem),
    linear-gradient(rgba(13,70,55,.018) 1px,transparent 1px),
    linear-gradient(90deg,rgba(13,70,55,.018) 1px,transparent 1px);
  background-size:auto,32px 32px,32px 32px;
}

/* Cabeçalhos: hierarquia limpa, profundidade discreta e leitura contínua. */
:where(.app-header,.chat-topbar,.module-header){
  border-bottom:1px solid rgba(13,70,55,.11)!important;
  box-shadow:0 1px 0 rgba(255,255,255,.82),0 7px 24px rgba(13,70,55,.055)!important;
  backdrop-filter:saturate(1.12) blur(14px);
  -webkit-backdrop-filter:saturate(1.12) blur(14px);
}

:where(.app-header,.chat-topbar,.module-header) :where(h1,h2,strong){letter-spacing:-.018em}

:where(.header-account,.chat-account){
  border-radius:14px!important;
  transition:border-color var(--fsx-fast) var(--fsx-ease),background var(--fsx-fast) var(--fsx-ease),box-shadow var(--fsx-normal) var(--fsx-ease)!important;
}
:where(.header-account,.chat-account):hover{
  border-color:rgba(24,123,86,.30)!important;background:var(--fsx-surface-2)!important;box-shadow:var(--fsx-shadow-xs)!important;
}

:where(.header-account-avatar,.avatar,.chat-avatar,.conversation-avatar,.conversation-row-avatar){
  box-shadow:inset 0 0 0 1px rgba(13,70,55,.09),0 3px 10px rgba(13,70,55,.08);
}

/* Navegação lateral: mesma identidade, linguagem única entre os módulos. */
:where(.sidebar,.portal-sidebar){
  background:
    radial-gradient(circle at 28% -6%,rgba(255,255,255,.10),transparent 17rem),
    linear-gradient(180deg,#0f5b40 0%,#0d4637 54%,#073e30 100%)!important;
  border-right:1px solid rgba(255,255,255,.08)!important;
  box-shadow:12px 0 40px rgba(5,36,28,.14)!important;
}

:where(.sidebar,.portal-sidebar) :where(nav,.portal-side-menu){scrollbar-color:rgba(255,255,255,.26) transparent}
:where(.sidebar,.portal-sidebar) :where(nav,.portal-side-menu)::-webkit-scrollbar{width:6px;height:6px}
:where(.sidebar,.portal-sidebar) :where(nav,.portal-side-menu)::-webkit-scrollbar-thumb{background:rgba(255,255,255,.25);border-radius:999px}

:where(.sidebar .nav-item,.portal-side-menu button,.portal-side-menu a){
  position:relative;border:1px solid transparent!important;border-radius:12px!important;
  transition:background var(--fsx-fast) var(--fsx-ease),border-color var(--fsx-fast) var(--fsx-ease),color var(--fsx-fast) var(--fsx-ease),transform var(--fsx-fast) var(--fsx-ease),box-shadow var(--fsx-normal) var(--fsx-ease)!important;
}

:where(.sidebar .nav-item,.portal-side-menu button,.portal-side-menu a):hover{
  border-color:rgba(255,255,255,.10)!important;background:rgba(255,255,255,.095)!important;transform:translateX(2px)!important;
}

:where(.sidebar .nav-item.active,.portal-side-menu button.active){
  border-color:rgba(255,255,255,.78)!important;background:#fff!important;color:var(--fsx-green-dark)!important;
  box-shadow:inset 4px 0 0 var(--fsx-yellow),0 10px 26px rgba(3,31,23,.19)!important;
}

:where(.sidebar .nav-item.active,.portal-side-menu button.active) :where(.nav-icon,svg){color:var(--fsx-green-dark)!important}

:where(.sidebar-collapse,.header-menu,.portal-side-toggle){
  border:1px solid rgba(255,255,255,.14)!important;background:rgba(255,255,255,.09)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.07)!important;
}

.sidebar-footer,.portal-side-foot{
  border:1px solid rgba(255,255,255,.10)!important;background:rgba(255,255,255,.07)!important;backdrop-filter:blur(8px);
}

/* Navegação superior do portal. */
.main-nav{
  background:rgba(255,255,255,.94)!important;border-bottom:1px solid rgba(13,70,55,.10)!important;
  box-shadow:0 7px 20px rgba(13,70,55,.045)!important;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
}
.main-nav .nav-item{border-radius:10px 10px 0 0!important}
.main-nav .nav-item.active{background:linear-gradient(180deg,rgba(232,243,238,.76),rgba(232,243,238,.25))!important}
.main-nav .nav-item.active::after{height:3px!important;background:var(--fsx-green)!important;box-shadow:0 -2px 8px rgba(24,123,86,.16)}

/* Títulos e áreas de trabalho. */
:where(.view-root,.main-content,.portal-main,.app-shell,.page,.chat-monitor){isolation:isolate}

:where(.page-head,.view-head,.portal-welcome,.monitor-heading){
  position:relative;
}

:where(.page-head,.view-head)::after{
  content:"";position:absolute;left:0;bottom:-9px;width:72px;height:2px;border-radius:999px;
  background:linear-gradient(90deg,var(--fsx-green),var(--fsx-yellow));opacity:.88;
}

:where(.page-head,.view-head) :where(h1,h2){
  color:var(--fsx-green-deep)!important;font-family:var(--fsx-display)!important;font-weight:820!important;letter-spacing:-.035em!important;
}

:where(.page-head,.view-head,.portal-welcome) :where(p){color:var(--fsx-muted)!important;line-height:1.5}

:where(.eyebrow,.portal-eyebrow,.modal-kicker,.fs-system-kicker,.module-kicker,.section-kicker,.table-kicker){
  color:var(--fsx-green)!important;font-weight:900!important;letter-spacing:.12em!important;text-transform:uppercase;
}

/* Superfícies e cartões: densidade executiva com uma profundidade consistente. */
:where(.panel,.kpi-card,.kpi,.settings-section,.settings-card,.module-block,.table-section,.table-shell,.fs-team-panel,.readiness-premium-card,.portal-home-overview-card,.portal-executive-context,.portal-home-modules-section,.portal-generated-card,.portal-primary-row,.monitor-feed-card,.monitor-permissions-card,.monitor-metric,.year-chart-card,.chart-card,.chart-panel,.dashboard-card,.card){
  border-color:rgba(13,70,55,.12)!important;
  box-shadow:var(--fsx-shadow-sm)!important;
}

:where(.panel,.kpi-card,.kpi,.settings-section,.settings-card,.fs-team-panel,.readiness-premium-card,.portal-home-overview-card,.portal-executive-context,.portal-generated-card,.portal-primary-row,.monitor-metric,.year-chart-card,.chart-card,.chart-panel,.dashboard-card,.card){
  background-color:var(--fsx-surface)!important;
}

:where(.panel,.settings-section,.settings-card,.module-block,.table-section,.table-shell,.fs-team-panel,.readiness-premium-card,.portal-home-overview-card,.portal-executive-context,.portal-home-modules-section,.portal-generated-card,.portal-primary-row,.monitor-feed-card,.monitor-permissions-card,.year-chart-card,.chart-card,.chart-panel,.dashboard-card,.card){
  border-radius:var(--fsx-r-lg)!important;
}

:where(.kpi-card,.kpi,.monitor-metric,.fs-team-kpi){
  min-width:0;border-radius:var(--fsx-r-md)!important;overflow:hidden;
}

:where(.kpi-card,.kpi,.monitor-metric,.fs-team-kpi) :where(strong,b){
  font-family:var(--fsx-display)!important;font-variant-numeric:tabular-nums;letter-spacing:-.035em;
}

:where(.kpi-card,.kpi,.monitor-metric,.fs-team-kpi)::after{
  content:"";position:absolute;inset:0 0 auto;height:1px;pointer-events:none;background:linear-gradient(90deg,transparent,rgba(255,255,255,.85),transparent);
}

@media (hover:hover){
  :where(.kpi-card,.kpi,.portal-home-module-card,.portal-generated-card,.portal-primary-row,.responsible-card,.record-card,.readiness-premium-card,.monitor-metric){
    transition:transform var(--fsx-normal) var(--fsx-ease),box-shadow var(--fsx-normal) var(--fsx-ease),border-color var(--fsx-fast) var(--fsx-ease)!important;
  }
  :where(.kpi-card,.kpi,.portal-home-module-card,.portal-generated-card,.portal-primary-row,.responsible-card,.record-card,.readiness-premium-card,.monitor-metric):hover{
    transform:translateY(-2px);border-color:rgba(24,123,86,.24)!important;box-shadow:var(--fsx-shadow-md)!important;
  }
}

/* Página inicial: ecossistema mais claro e com leitura por módulos. */
body.portal-home .portal-main{max-width:1840px!important;padding-top:clamp(22px,2.4vw,38px)!important}
body.portal-home .portal-welcome{margin-bottom:22px!important}
body.portal-home .portal-welcome h2{font-size:clamp(30px,2.6vw,42px)!important;font-weight:850!important;letter-spacing:-.05em!important}
body.portal-home .portal-welcome-badge{
  border-color:rgba(24,123,86,.18)!important;border-radius:14px!important;box-shadow:var(--fsx-shadow-xs)!important;
}

.portal-home-modules-section{position:relative;overflow:hidden;padding:20px!important}
.portal-home-modules-section::before{
  content:"";position:absolute;left:0;right:0;top:0;height:3px;background:linear-gradient(90deg,var(--fsx-green-dark),var(--fsx-green),var(--fsx-yellow));
}
.portal-home-modules-grid{gap:13px!important}
.portal-home-module-card{
  position:relative;min-height:206px!important;border:1px solid rgba(13,70,55,.12)!important;border-radius:16px!important;
  background:linear-gradient(145deg,#fff 0%,#f8fbf9 100%)!important;box-shadow:var(--fsx-shadow-xs)!important;overflow:hidden;
}
.portal-home-module-card::after{
  content:"";position:absolute;left:0;top:18px;bottom:18px;width:3px;border-radius:0 99px 99px 0;background:var(--fsx-green);opacity:.78;
}
.portal-home-module-card.is-favorite::after{background:var(--fsx-yellow);opacity:1}
.portal-home-module-icon{border-radius:13px!important;background:var(--fsx-green-soft)!important;color:var(--fsx-green-dark)!important}
.portal-home-module-open{border-radius:10px!important}
.portal-home-favorite-toggle{transition:transform var(--fsx-fast) var(--fsx-ease),background var(--fsx-fast) var(--fsx-ease)!important}
.portal-home-favorite-toggle:hover{transform:rotate(-8deg) scale(1.06)}

.portal-executive-context,.portal-home-overview-card{overflow:hidden}
.portal-executive-context::before,.portal-home-overview-card::before{
  content:"";position:absolute;inset:0 0 auto;height:2px;background:linear-gradient(90deg,var(--fsx-green),transparent);opacity:.42;pointer-events:none;
}

/* Botões e controles · V371.7 contraste semântico global.
   Regra: superfícies fortes (verde/vermelho) sempre usam texto/ícones brancos;
   superfícies claras usam texto escuro para manter contraste e legibilidade. */
:where(.primary-button,.btn-primary,.btn.primary,.button.primary,.portal-card-button.primary,.chat-new-button,.fs-system-btn.primary,.emergency-sync-btn-v63.primary){
  background:var(--fsx-green)!important;border-color:var(--fsx-green)!important;color:#fff!important;
  box-shadow:0 6px 16px rgba(24,123,86,.15)!important;
}
:where(.primary-button,.btn-primary,.btn.primary,.button.primary,.portal-card-button.primary,.chat-new-button,.fs-system-btn.primary,.emergency-sync-btn-v63.primary) :where(svg,path,use,i,span,b,strong){
  color:inherit!important;
}
:where(.primary-button,.btn-primary,.btn.primary,.button.primary,.portal-card-button.primary,.chat-new-button,.fs-system-btn.primary,.emergency-sync-btn-v63.primary):hover:not(:disabled){
  background:var(--fsx-green-dark)!important;border-color:var(--fsx-green-dark)!important;color:#fff!important;box-shadow:0 9px 22px rgba(15,91,64,.21)!important;transform:translateY(-1px);
}

:where(.secondary-button,.btn-secondary,.btn:not(.primary):not(.danger):not(.btn-primary):not(.btn-danger),.button:not(.primary):not(.danger),.ghost-button,.portal-outline-button,.chat-outline-button,.table-action:not(.danger),.compact-button){
  border-color:var(--fsx-line-strong)!important;background:var(--fsx-surface)!important;color:var(--fsx-text)!important;
}
:where(.secondary-button,.btn-secondary,.btn:not(.primary):not(.danger):not(.btn-primary):not(.btn-danger),.button:not(.primary):not(.danger),.ghost-button,.portal-outline-button,.chat-outline-button,.table-action:not(.danger),.compact-button):hover:not(:disabled){
  border-color:rgba(24,123,86,.40)!important;background:var(--fsx-green-soft)!important;color:var(--fsx-green-dark)!important;
}

:where(.danger-button,.btn-danger,.btn.danger,.button.danger,.table-action.danger,.mini.danger,.mini-btn.danger){
  background:var(--fsx-danger)!important;border-color:var(--fsx-danger)!important;color:#fff!important;
}
:where(.danger-button,.btn-danger,.btn.danger,.button.danger,.table-action.danger,.mini.danger,.mini-btn.danger) :where(svg,path,use,i,span,b,strong){
  color:inherit!important;
}
:where(.danger-button,.btn-danger,.btn.danger,.button.danger,.table-action.danger,.mini.danger,.mini-btn.danger):hover:not(:disabled){
  background:#9f2a23!important;border-color:#9f2a23!important;color:#fff!important;
}
:where(.danger-button,.btn-danger,.btn.danger,.button.danger,.table-action.danger,.mini.danger,.mini-btn.danger):disabled{
  background:#d8a09b!important;border-color:#d8a09b!important;color:#fff!important;opacity:.62!important;
}

/* Botões de alerta/amarelos usam texto escuro: branco sobre amarelo não possui contraste suficiente. */
:where(.warning-button,.btn-warning,.button.warning,.btn.warning){
  background:var(--fsx-yellow)!important;border-color:var(--fsx-yellow)!important;color:#17332f!important;
}

:where(.icon-button,.chat-icon-button,.row-action,.mini,.mini-btn,.compact-button){border-radius:10px!important}

/* Formulários: estados consistentes e áreas confortáveis para mouse ou toque. */
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea){
  border-color:var(--fsx-line-strong)!important;border-radius:10px!important;background-color:#fff!important;color:var(--fsx-text)!important;
  transition:border-color var(--fsx-fast) var(--fsx-ease),box-shadow var(--fsx-fast) var(--fsx-ease),background var(--fsx-fast) var(--fsx-ease)!important;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea):hover:not(:disabled){border-color:rgba(24,123,86,.36)!important}
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea):focus{
  border-color:var(--fsx-green)!important;outline:0!important;box-shadow:var(--fsx-focus)!important;
}
:where(input,select,textarea)::placeholder{color:#8b9792;opacity:1}
:where(input[type="checkbox"],input[type="radio"]){accent-color:var(--fsx-green)}
:where(.field,.form-grid label,.fs-system-field) > :where(label,span):first-child{letter-spacing:.01em}

/* Toolbars: uma única faixa de comando, sem perder ações em telas menores. */
:where(.toolbar,.filter-bar,.filter-strip,.fs-team-toolbar,.monitor-filters,.dashboard-toolbar,.module-toolbar,.table-toolbar,.bulk-toolbar){
  border-color:rgba(13,70,55,.12)!important;background:rgba(255,255,255,.96)!important;border-radius:14px!important;box-shadow:var(--fsx-shadow-xs)!important;
}

:where(.segmented-control,.portal-view-toggle,.view-toggle,.chart-mode-switch,.chat-filter-tabs){
  border-radius:12px!important;background:var(--fsx-surface-2)!important;
}

/* Tabelas: cabeçalhos fixos, leitura horizontal e ações estáveis. */
:where(.table-wrap,.table-scroll,.data-scroll,.table-shell,.wide-table-scroll,.preview-scroll,.appropriation-permission-table-wrap,.fs-team-table-wrap,[class*="table-container"]){
  scrollbar-width:thin;scrollbar-color:rgba(24,123,86,.34) transparent;
  overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;
}
:where(.table-wrap,.table-scroll,.data-scroll,.table-shell,.wide-table-scroll,.preview-scroll,.appropriation-permission-table-wrap,.fs-team-table-wrap,[class*="table-container"])::-webkit-scrollbar{height:9px;width:9px}
:where(.table-wrap,.table-scroll,.data-scroll,.table-shell,.wide-table-scroll,.preview-scroll,.appropriation-permission-table-wrap,.fs-team-table-wrap,[class*="table-container"])::-webkit-scrollbar-thumb{background:rgba(24,123,86,.30);border:2px solid transparent;border-radius:999px;background-clip:padding-box}

:where(.table-shell,.table-section,.fs-team-table-wrap,.preview-scroll){overflow:hidden;border-color:rgba(13,70,55,.13)!important}

:where(table){font-variant-numeric:tabular-nums}
:where(thead th){
  font-weight:850!important;letter-spacing:.02em!important;text-wrap:balance;
}

/* Cabeçalhos já escuros permanecem na paleta; claros ganham contraste verde. */
:where(.data-table,.appropriation-table,.fs-team-table,.preview-table) thead th{
  box-shadow:inset 0 -1px 0 rgba(13,70,55,.13);
}

:where(tbody tr){transition:background-color var(--fsx-fast) ease}
:where(tbody tr:hover) > td{background-color:#f4faf7!important}
:where(tbody tr:focus-within) > td{background-color:#eef7f2!important}
:where(tbody td){line-height:1.4}

.fs-scroll-region{position:relative}
.fs-scroll-region.fs-can-scroll:not(.fs-scroll-acknowledged)::after{
  content:"DESLIZE PARA VER MAIS  →";position:absolute;top:8px;right:10px;z-index:30;pointer-events:none;
  padding:6px 9px;border:1px solid rgba(255,255,255,.24);border-radius:999px;background:rgba(13,70,55,.92);color:#fff;
  box-shadow:0 5px 15px rgba(5,45,34,.18);font:850 8px/1 var(--fsx-font);letter-spacing:.055em;
  animation:fsScrollHintOut .3s ease 3.4s forwards;
}
@keyframes fsScrollHintOut{to{opacity:0;visibility:hidden;transform:translateY(-4px)}}

/* Status e pílulas permanecem semânticos e mais legíveis. */
:where(.status-pill,.priority-pill,.schedule-pill,.tag-pill,.tag,.chip,.pill,.unit-chip,.sync-chip,.live-pill,.unread-pill){
  border-radius:999px!important;font-weight:820!important;letter-spacing:.015em;
}

/* Gráficos: contenção, tipografia numérica e feedback de hover. */
:where(.chart-container,.chart-wrap,.chart-body,.line-chart,.trend-chart,.exportable-chart,.appropriation-chart,.kob-ledger-evolution-chart){min-width:0;max-width:100%}
:where(.chart-container,.chart-wrap,.chart-body,.line-chart,.trend-chart,.exportable-chart,.appropriation-chart,.kob-ledger-evolution-chart) text{font-family:var(--fsx-font)!important}
:where(.chart-track,.progress-track,.portal-progress,.bar-track,.cost-bar-track){box-shadow:inset 0 1px 2px rgba(13,70,55,.08)}

/* Modais: contexto preservado, cabeçalho/ações fixos e dimensões previsíveis. */
:where(.modal-backdrop,.decision-backdrop,.confirm-backdrop,.fs-system-modal-backdrop,.chat-modal-backdrop,.taskModal,.system-modal-layer,.fs-modal-backdrop,.access-modal-backdrop,.settings-access-backdrop,.audit-email-backdrop,.rcpo-layout-modal){
  background:rgba(5,36,28,.48)!important;backdrop-filter:blur(8px) saturate(.9)!important;-webkit-backdrop-filter:blur(8px) saturate(.9)!important;
}
:where(.modal-card,.decision-card,.confirm-card,.fs-system-modal,.chat-modal,.taskModalCard,.system-confirm-modal,.fs-modal,.modal,.access-card,.settings-access-card,.audit-email-card,.rcpo-layout-dialog){
  border:1px solid rgba(255,255,255,.74)!important;border-radius:var(--fsx-r-xl)!important;box-shadow:var(--fsx-shadow-lg)!important;
}
:where(.modal-header,.fs-system-modal-header,.chat-modal>header,.taskModalHeader,.system-confirm-modal>header,.fs-modal-header,.modal-head,.access-card-header,.settings-access-header,.audit-email-header,.rcpo-layout-head){
  background:rgba(255,255,255,.97)!important;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
}
:where(.modal-actions,.taskModalFooter,.rcpo-layout-foot,.system-confirm-modal>footer,.fs-modal-footer,.modal-footer,.access-actions,.settings-access-actions,.audit-email-actions){
  background:rgba(255,255,255,.98);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
}

/* Rodapé global mais discreto. */
.fs-system-footer{
  height:var(--fsx-footer-h)!important;background:rgba(249,251,250,.965)!important;border-top-color:rgba(13,70,55,.11)!important;
  box-shadow:0 -7px 22px rgba(13,70,55,.04)!important;font-family:var(--fsx-font)!important;
}

/* Comunicação interna: experiência de mensagens com maior profundidade. */
html[data-fs-module="communication"] .chat-page{background:var(--chat-bg)}
html[data-fs-module="communication"] .chat-workspace{background:var(--chat-surface-2)!important}
html[data-fs-module="communication"] .chat-sidebar{box-shadow:8px 0 28px rgba(13,70,55,.055);z-index:2}
html[data-fs-module="communication"] .conversation-row{border-radius:14px!important}
html[data-fs-module="communication"] .conversation-row.is-active{
  background:linear-gradient(90deg,var(--chat-green-soft),#f6faf8)!important;border-color:rgba(24,123,86,.22)!important;
  box-shadow:inset 4px 0 0 var(--fsx-green),var(--fsx-shadow-xs)!important;
}
html[data-fs-module="communication"] .message-list{
  background:
    radial-gradient(circle at 90% 0,rgba(24,123,86,.04),transparent 24rem),
    linear-gradient(rgba(13,70,55,.017) 1px,transparent 1px),
    linear-gradient(90deg,rgba(13,70,55,.017) 1px,transparent 1px);
  background-size:auto,28px 28px,28px 28px;
}
html[data-fs-module="communication"] .message-bubble{border-radius:16px!important;box-shadow:0 4px 14px rgba(13,70,55,.055)!important}
html[data-fs-module="communication"] .message-bubble.is-own,
html[data-fs-module="communication"] .message-bubble.mine{box-shadow:0 5px 18px rgba(24,123,86,.12)!important}
html[data-fs-module="communication"] .chat-composer{box-shadow:0 -8px 24px rgba(13,70,55,.055)}

/* Estratégia PGM: Gantt com moldura de sala de controle. */
html[data-fs-module="strategyPgm"] body.strategy-pgm-page{
  background:
    radial-gradient(circle at 92% 0,rgba(24,123,86,.055),transparent 28rem),
    var(--fsx-page)!important;color:var(--fsx-text)!important;
}
html[data-fs-module="strategyPgm"] .topbar{
  padding:14px 16px!important;border:1px solid rgba(13,70,55,.12)!important;border-radius:18px!important;background:#fff!important;box-shadow:var(--fsx-shadow-sm)!important;
}
html[data-fs-module="strategyPgm"] .controls{
  padding:10px!important;border:1px solid rgba(13,70,55,.12)!important;border-radius:14px!important;background:#fff!important;box-shadow:var(--fsx-shadow-xs)!important;
}
html[data-fs-module="strategyPgm"] .wrap{
  border-color:rgba(13,70,55,.16)!important;border-radius:18px!important;box-shadow:var(--fsx-shadow-md)!important;background:#fff!important;
}
html[data-fs-module="strategyPgm"] :where(.taskHead,.timelineHead){box-shadow:inset 0 -1px 0 rgba(13,70,55,.14)}

/* RC/PO: aplica a mesma hierarquia ao módulo monolítico sem alterar sua lógica. */
html[data-fs-module="rcpo"] .page{max-width:none!important}
html[data-fs-module="rcpo"] .module-nav{
  border:0!important;
  border-right:1px solid rgba(255,255,255,.08)!important;
  border-radius:0!important;
  background:linear-gradient(180deg,#0d4a37 0%,#083326 100%)!important;
  color:#fff!important;
  box-shadow:14px 0 36px rgba(5,24,18,.18)!important;
}
html[data-fs-module="rcpo"] .module-nav::before{color:rgba(255,255,255,.58)!important}
html[data-fs-module="rcpo"] .module-nav .module-tab{
  background:rgba(255,255,255,.06)!important;
  color:#e6f0ec!important;
  border-color:rgba(255,255,255,.08)!important;
  box-shadow:none!important;
}
html[data-fs-module="rcpo"] .module-nav .module-tab:hover{
  background:rgba(255,255,255,.10)!important;
  color:#fff!important;
}
html[data-fs-module="rcpo"] .module-nav .module-tab .desc{color:rgba(230,240,236,.68)!important}
html[data-fs-module="rcpo"] .module-nav .module-tab.active{
  background:#fff!important;
  color:#0d4a37!important;
  border-color:#fff!important;
  box-shadow:0 12px 26px rgba(0,0,0,.18)!important;
}
html[data-fs-module="rcpo"] .module-nav .module-tab.active .desc{color:#5f7067!important}
html[data-fs-module="rcpo"] :where(.module-tab,.tab-btn){border-radius:10px!important}
html[data-fs-module="rcpo"] :where(.panel,.table-panel,.metric-card,.footer-panel){border-color:rgba(13,70,55,.12)!important;box-shadow:var(--fsx-shadow-sm)!important;border-radius:18px!important}

/* Entrada inicial: somente movimento, para o conteúdo nunca perder visibilidade. */
html.fs-command-ready .fs-view-enter > :first-child,html.fs-command-ready .fs-view-enter > .page-head:first-child,html.fs-command-ready .fs-view-enter > .view-head:first-child{
  animation:fsViewEnter var(--fsx-slow) var(--fsx-ease) both;
}
@keyframes fsViewEnter{from{transform:translateY(7px)}to{transform:none}}

/* V371.4 · Compatibilidade com a camada responsiva V370.6/V370.7.
   Deliberadamente não converte sidebars de tablet em drawer: a navegação
   adaptativa existente permanece como fonte de verdade. */
@media (max-width:1366px){
  :root{--fsx-footer-h:42px}
  body{overflow-x:hidden}
  :where(.view-root,.main-content,.portal-main,.app-shell,.page){max-width:100%;min-width:0}
  :where(button,a,[role="button"],summary,.btn,.button,.primary-button,.secondary-button,.ghost-button,.danger-button,.icon-button,.row-action,.mini,.mini-btn,.table-action){touch-action:manipulation}
  :where(.toolbar,.filter-bar,.filter-strip,.fs-team-toolbar,.monitor-filters,.dashboard-toolbar,.module-toolbar,.table-toolbar,.bulk-toolbar){gap:9px!important}
  :where(.table-wrap,.table-scroll,.data-scroll,.table-shell,.wide-table-scroll,.preview-scroll,.appropriation-permission-table-wrap,.fs-team-table-wrap,[class*="table-container"]){max-width:100%;overflow:auto!important}
  .fs-scroll-region.fs-can-scroll{box-shadow:inset -12px 0 18px -18px rgba(13,70,55,.5)!important}
}
@media (max-width:767px){
  :root{--fsx-footer-h:44px}
  :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea){font-size:16px!important}
  :where(button,.btn,.button,.primary-button,.secondary-button,.ghost-button,.danger-button,.icon-button,.small-button,.compact-button,.mini,.mini-btn,.row-action,.table-action,.portal-card-button,.portal-outline-button,.chat-outline-button,.chat-icon-button){min-height:44px}
  .fs-system-footer{grid-template-columns:minmax(0,1fr) auto!important;padding:0 9px!important}
  .fs-system-footer-center{display:none!important}
  .fs-system-footer-left{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px!important}
  .fs-system-footer-link{font-size:9px!important;padding-inline:5px!important}
  .fs-system-footer-sep{display:none}
  html[data-fs-module="communication"] .chat-filter-tabs{overflow-x:auto;scrollbar-width:none;flex-wrap:nowrap!important}
  html[data-fs-module="communication"] .chat-filter-tabs::-webkit-scrollbar{display:none}
  html[data-fs-module="communication"] .chat-filter-tabs button{flex:0 0 auto;min-height:38px}
  html[data-fs-module="communication"] .message-bubble{max-width:94%!important}
  html[data-fs-module="communication"] .chat-composer{padding-bottom:calc(10px + env(safe-area-inset-bottom))!important}
}
@media (max-width:430px){
  .fs-system-category-grid{grid-template-columns:1fr!important}
  .fs-system-footer-right .fs-system-footer-link:first-child{display:none}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
  .fs-view-enter > :first-child{animation:none!important}
}
@media print{
  .fs-skip-link,.fs-system-footer,.sidebar,.portal-sidebar,.main-nav{display:none!important}
  body{padding:0!important;background:#fff!important}
  body::before{display:none!important}
  :where(.main-content,.portal-main,.view-root){margin:0!important;padding:0!important;max-width:none!important}
  :where(.panel,.kpi-card,.kpi,.table-shell,.table-section,.card){box-shadow:none!important;break-inside:avoid}
}

/* Perfil global no módulo Comunicação: mesmo bloco de identificação dos demais módulos. */
html[data-fs-module="communication"] .chat-account.header-account{
  min-height:52px;min-width:250px;display:flex;align-items:center;gap:9px;padding:5px 12px 5px 6px;
  border:1px solid var(--fsx-line)!important;border-radius:15px!important;background:#fff!important;box-shadow:var(--fsx-shadow-xs)!important;
}
html[data-fs-module="communication"] .chat-account.header-account .fs-notification-center{margin-right:1px}
html[data-fs-module="communication"] .chat-account.header-account .fs-notification-button{width:38px;height:38px;box-shadow:none}
html[data-fs-module="communication"] .chat-account.header-account .chat-avatar{width:42px;height:42px;flex:0 0 42px}
html[data-fs-module="communication"] .chat-account.header-account .chat-account-copy{min-width:0;display:grid;gap:2px}
html[data-fs-module="communication"] .chat-account.header-account .chat-account-copy strong{font-size:11px;line-height:1.15;max-width:210px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-fs-module="communication"] .chat-account.header-account .chat-account-copy small{font-size:9px;line-height:1.2;color:var(--fsx-muted)}
@media (min-width:768px) and (max-width:1180px){
  html[data-fs-module="communication"] .chat-account.header-account{min-width:54px;width:auto;max-width:205px;padding-right:7px}
}
@media (max-width:820px){
  html[data-fs-module="communication"] .chat-account.header-account{min-width:52px;width:52px;padding:5px}
  html[data-fs-module="communication"] .chat-account.header-account .chat-account-copy{display:none}
  html[data-fs-module="communication"] .chat-account.header-account .fs-notification-center{position:absolute;right:64px}
}


/* V371.7 · guardas de contraste para componentes coloridos legados. */
:where(.saveTask,.addActivity,.chat-primary-button,.send-button,.profile-editor-btn-v55.primary,.profile-editor-btn-v54.primary,.profile-editor-simple-btn-v51.primary){color:#fff!important;}
:where(.portal-danger-button){background:#fff8f7!important;color:#a62c22!important;border-color:#f0c9c5!important;}

/* V371.8 PERFORMANCE STABILITY -------------------------------------------------
   Evita reanimação estrutural durante renders/Realtime. Modal/toast continuam
   com feedback próprio; a superfície principal permanece estável. */
.fs-view-enter{animation:none!important;transform:none!important;opacity:1!important}
.fs-scroll-cue{animation:none!important;opacity:.92}


/* V371.10 · Cabeçalhos de tabelas centralizados + classificação por clique */
:where(table):not([data-no-center-headers]) thead th{
  text-align:center!important;
  vertical-align:middle!important;
}
:where(table) thead th.fs-sortable-header{
  cursor:pointer;
  user-select:none;
  position:relative;
  padding-right:28px!important;
}
:where(table) thead th.fs-sortable-header::after{
  content:'↕';
  position:absolute;
  right:9px;
  top:50%;
  transform:translateY(-50%);
  font-size:11px;
  line-height:1;
  opacity:.62;
}
:where(table) thead th.fs-sortable-header:hover,
:where(table) thead th.fs-sortable-header:focus-visible{
  filter:brightness(1.06);
}
:where(table) thead th.fs-sortable-header.is-active{
  box-shadow:inset 0 -3px 0 rgba(245,207,26,.95);
}
:where(table) thead th.fs-sortable-header.is-active[data-sort-dir='asc']::after{content:'↑';opacity:1}
:where(table) thead th.fs-sortable-header.is-active[data-sort-dir='desc']::after{content:'↓';opacity:1}


/* V371.10 · superfície geral e notificação integrada ao cabeçalho */
:root{--fsx-page:#f4f6f5}
body:not([data-fs-module="communication"]):not([data-fs-module="rcpo"]):not(.strategy-pgm-page){
  background-color:var(--fsx-page);
}
body:not([data-fs-module="communication"]):not([data-fs-module="rcpo"]):not(.strategy-pgm-page)::before{
  background:
    radial-gradient(circle at 92% 0%,rgba(24,123,86,.055),transparent 30rem),
    linear-gradient(180deg,rgba(255,255,255,.72) 0%,rgba(238,243,240,.96) 42%,#eef3f0 100%)!important;
  background-size:auto!important;
}
.app-header .header-right-zone>.fs-notification-center{
  position:relative!important;
  inset:auto!important;
  z-index:55!important;
  margin:0 2px!important;
  align-self:center!important;
}
.app-header .header-right-zone>.fs-notification-center .fs-notification-button{
  width:40px!important;
  height:40px!important;
  border-radius:12px!important;
  box-shadow:none!important;
  background:#f7faf8!important;
  border-color:#d5e2dc!important;
}
.app-header .header-right-zone>.fs-notification-center .fs-notification-button:hover{
  background:#edf6f1!important;
  border-color:#9dc9b5!important;
}
@media(max-width:820px){
  .app-header .header-right-zone>.fs-notification-center{order:8!important;flex:0 0 auto!important}
}


/* V371.24 · normalização de fundo e hierarquia de superfícies
   Correção exclusivamente visual. Mantém a identidade própria de cada módulo
   e evita que toolbars de cabeçalho sejam renderizadas como grandes faixas brancas. */
:root{--fsx-page:#f4f6f5}

/* Cada módulo recupera a superfície originalmente prevista em seu design. */
body[data-fs-module="portal"]{background-color:#f4f6f5!important}
body[data-fs-module="cost2627"]{background-color:#f3f6f4!important}
body[data-fs-module="appropriation"]{background-color:#f4f6f5!important}
body[data-fs-module="suppliers"]{background-color:#f3f6f4!important}
body[data-fs-module="teamfs"]{background-color:#f3f6f4!important}
body[data-fs-module="moc"]{background-color:#f2f6f4!important}
body[data-fs-module="lessons"]{background-color:#f3f6f4!important}
body[data-fs-module="strategyPgm"]{background-color:#f6faf8!important}

/* Remove o gradiente global que sobrescrevia a linguagem visual dos módulos operacionais. */
body[data-fs-module]:not([data-fs-module="portal"]):not([data-fs-module="communication"])::before{
  display:none!important;
  content:none!important;
}

/* Portal mantém apenas uma profundidade ambiental muito discreta. */
body[data-fs-module="portal"]:not(.strategy-pgm-page)::before{
  background:
    radial-gradient(circle at 94% 0%,rgba(24,123,86,.04),transparent 30rem),
    linear-gradient(180deg,rgba(255,255,255,.38) 0%,rgba(244,246,245,.72) 42%,#f4f6f5 100%)!important;
  background-size:auto!important;
}

/* Toolbars ligadas diretamente ao cabeçalho são grupos de ações, não cartões. */
body:not([data-fs-module="communication"]):not([data-fs-module="rcpo"]) :where(.view-head,.page-head) > :where(.toolbar,.module-toolbar,.dashboard-toolbar,.actions){
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
  border-radius:0!important;
}

/* Superfícies operacionais reais permanecem destacadas, porém sem branco excessivo. */
body:not([data-fs-module="communication"]):not([data-fs-module="rcpo"]) :where(.filter-bar,.filter-strip,.fs-team-toolbar,.monitor-filters,.table-toolbar,.bulk-toolbar){
  background:#f8faf9!important;
  border-color:rgba(13,70,55,.12)!important;
  box-shadow:0 3px 10px rgba(13,70,55,.035)!important;
}

/* Toolbars genéricas fora do cabeçalho usam a mesma superfície suave. */
body:not([data-fs-module="communication"]):not([data-fs-module="rcpo"]) :where(.toolbar):not(.module-toolbar):not(.dashboard-toolbar){
  background:#f8faf9!important;
}

/* Gestão de Custos: remove especificamente a faixa branca vazia da barra de ações. */
body[data-fs-module="cost2627"] .view-head > .module-toolbar,
body[data-fs-module="cost2627"] .view-head > .dashboard-toolbar{
  padding-left:0!important;
  padding-right:0!important;
}

