/* Loaded after legacy module styles so every screen shares the Nexo shell. */
body.nexo {
  --sidebar-width: 196px;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.nexo a { color: var(--ink); }
.nexo a:hover { text-decoration: none; }
.nexo a.text-link:hover, .nexo a.back:hover { text-decoration: underline; }
.nexo :focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.nexo .skip:focus { left: 12px; top: 12px; border: 1px solid var(--ink); }
.nexo .sidebar {
  display: flex;
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  height: 100dvh;
  padding: 0 18px;
  align-items: stretch;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  scrollbar-width: thin;
}
.nexo .brand {
  display: block;
  margin: 26px 10px 30px;
  width: auto;
  height: auto;
  padding: 0;
  background: none;
  color: var(--ink);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.1;
  text-align: left;
  border-radius: 0;
}
.nexo .brand > span { position: static; width: auto; font: inherit; color: inherit; letter-spacing: inherit; }
.nexo .brand small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: .35px;
  text-transform: uppercase;
}
.nexo .sidebar nav {
  display: grid;
  padding: 0;
  width: 100%;
  gap: 7px;
  overflow: visible;
}
.nexo .sidebar nav a {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  flex: initial;
  min-width: 0;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  box-shadow: none;
}
.nexo .sidebar nav a:hover { background: var(--soft); color: var(--ink); }
.nexo .sidebar nav a.selected, .nexo .sidebar nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--surface);
  font-weight: 650;
  box-shadow: none;
}
.nexo .nexo-module-nav { margin-top: auto; padding: 30px 0 0; }
.nexo .nexo-module-nav > summary {
  padding: 12px 14px;
  min-height: 44px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  border-radius: 5px;
}
.nexo .nexo-module-nav > summary:hover { color: var(--ink); background: var(--soft); }
.nexo .nexo-module-nav[open] > summary { margin-bottom: 8px; }
.nexo .nexo-module-nav nav { gap: 3px; }
.nexo .nexo-module-nav nav a { font-size: 11px; }
.nexo .sidebar-foot {
  display: block;
  margin-top: 16px;
  padding: 12px 14px 24px;
  border: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: 0;
}
.nexo .sidebar-foot small { margin-top: 4px; font-size: 10px; }
.nexo .app { margin-left: var(--sidebar-width); padding-bottom: 0; }
.nexo .app.guest { margin-left: 0; }
.nexo .topbar {
  height: 72px;
  min-height: 72px;
  padding: 0 32px;
  border: 0;
  background: var(--surface);
  gap: 18px;
}
.nexo .breadcrumb { gap: 10px; color: var(--ink); font-size: 11px; font-weight: 600; }
.nexo .breadcrumb b { letter-spacing: .3px; }
.nexo .breadcrumb > span { display: inline; }
.nexo .header-right { gap: 18px; }
.nexo .demo-label {
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
}
.nexo .identity { gap: 12px; }
.nexo .identity b { font-size: 11px; font-weight: 600; }
.nexo .identity small { color: var(--muted); font-size: 10px; }
.nexo .identity .quiet { font-size: 11px; padding: 8px 12px; background: transparent; }
.nexo .identity .quiet:hover { background: var(--soft); }
.nexo .nexo-mobile-menu, .nexo .nexo-mobile-nav { display: none; }
.nexo main {
  width: 100%;
  max-width: 1540px;
  padding: 30px 32px 36px;
  min-height: calc(100dvh - 132px);
}
.nexo .footer { padding: 20px 32px; font-size: 10px; letter-spacing: 0; }
.nexo h1 { font-weight: 750; letter-spacing: -.8px; }
.nexo h2 { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.nexo .eyebrow { color: var(--muted); letter-spacing: .45px; }
.nexo .card, .nexo .metric, .nexo .evaluation-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
  background: var(--surface);
}
.nexo .metric.highlight { background: var(--surface); border-color: var(--line); }
.nexo .button {
  border-color: var(--ink);
  border-radius: 5px;
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  font-weight: 600;
}
.nexo .button:hover { filter: none; background: #303838; border-color: #303838; }
.nexo .button.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.nexo .button.secondary:hover { background: var(--soft); border-color: #C3C7C7; }
.nexo .button-row { flex-wrap: wrap; }
.nexo .quiet { border-radius: 5px; }
.nexo input::placeholder, .nexo textarea::placeholder { color: #717878; }
.nexo textarea { font: inherit; color: var(--ink); border: 1px solid var(--line); background: var(--surface); border-radius: 7px; max-width: 100%; }
.nexo :is(input, select, textarea):focus-visible { outline-offset: 2px; }
.nexo .note:not(.warning), .nexo .board-note { background: var(--soft); }
.nexo .state-rail > div { background: var(--support); }
.nexo .state-dot:not(.running,.reported,.paused) { background: #8A9191; }
.nexo .garment-visual, .nexo .preview-large { background: var(--soft); }
.nexo .garment-orbit { border-color: #C9CDCD; }
.nexo .product-dialog { box-shadow: 0 20px 80px #18202033; }
.nexo .product-dialog::backdrop { background: #18202088; }
.nexo .order-review-dialog::backdrop { background: #18202066; }
.nexo .route-node { background: var(--soft); }
.nexo .badge.neutral, .nexo .badge.info { color: var(--ink); background: var(--support); }
.nexo .counter { background: var(--support); color: var(--ink); border-radius: 4px; }
.nexo .evaluation-banner { background: var(--soft); }

/* Decision centre: the approved visual hierarchy, using available data. */
.nexo-dashboard { min-width: 0; }
.nexo-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.nexo-hero .eyebrow { color: var(--ink); font-size: 9px; margin-bottom: 8px; }
.nexo-hero h1 { font-size: 34px; line-height: 1.2; margin: 0 0 8px; }
.nexo-hero p { margin: 0; font-size: 13px; color: var(--muted); }
.nexo-hero > .button { flex-shrink: 0; }
.nexo-hero .heading-actions { flex-shrink: 0; }
.nexo-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.nexo-metric {
  min-width: 0;
  min-height: 116px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.nexo-metric > span { display: block; color: var(--muted); font-size: 11px; }
.nexo-metric strong { display: block; margin: 8px 0 6px; font-size: 28px; font-weight: 750; letter-spacing: -.5px; line-height: 1.2; overflow-wrap: anywhere; }
.nexo-metric small { display: block; color: var(--muted); font-size: 10px; line-height: 1.5; }
.nexo-metric strong small { display: inline; color: inherit; font-size: 17px; font-weight: 650; }
.nexo-metric strong em { font-size: 18px; font-style: normal; font-weight: 600; }
.nexo-metric .nexo-unavailable { color: var(--muted); font-size: 21px; letter-spacing: -.2px; }
.nexo-metric strong[aria-label="Ainda sem dados"] { color: var(--muted); }
.nexo-pipeline { padding: 18px 20px 20px; margin-bottom: 18px; }
.nexo-section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.nexo-section-head h2 { margin: 0; }
.nexo-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.nexo-section-head .text-link { font-size: 11px; }
.nexo-pipeline > .nexo-stages, .nexo-pipeline > .nexo-pipeline-stages {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 10px;
}
.nexo-stage {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: baseline;
  column-gap: 14px;
  border-bottom: 3px solid var(--support);
  padding: 0 0 12px;
  min-width: 0;
  color: var(--ink);
}
.nexo-stage:hover { border-bottom-color: var(--ink); }
.nexo-stage strong { min-width: 0; font-size: 28px; font-weight: 750; line-height: 1.2; overflow-wrap: anywhere; }
.nexo-stage > span { font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.nexo-stage small { grid-column: 1/-1; color: var(--muted); font-size: 10px; margin-top: 5px; }
.nexo-layout { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1.1fr); gap: 18px; margin-bottom: 22px; align-items: stretch; }
.nexo-layout > .card { margin-bottom: 0; }
.nexo-cash-card, .nexo-attention { padding: 20px; min-width: 0; }
.nexo-cash-empty {
  display: flex;
  min-height: 216px;
  padding: 26px 24px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--soft);
  border-radius: 5px;
  text-align: center;
}
.nexo-empty-chart { display: block; width: 100%; max-width: 320px; height: 60px; stroke: var(--support); stroke-width: 1.5; margin: 0 0 18px; }
.nexo-cash-empty strong, .nexo-cash-empty h3 { font-size: 16px; font-weight: 650; margin: 0 0 8px; }
.nexo-cash-empty p { color: var(--muted); font-size: 12px; max-width: 360px; margin: 0 0 10px; }
.nexo-cash-empty small { color: var(--muted); font-size: 10px; max-width: 360px; }
.nexo-cash-empty .button { margin-top: 16px; }
.nexo-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--ink);
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.nexo-alert:last-child { border-bottom: 0; }
.nexo-alert .counter { width: 24px; height: 24px; font-size: 11px; flex-shrink: 0; }
.nexo-alert > div { min-width: 0; flex: 1; }
.nexo-alert b, .nexo-alert strong { display: block; font-size: 12px; line-height: 1.5; }
.nexo-alert p, .nexo-alert small { display: block; color: var(--muted); font-size: 10px; line-height: 1.6; margin: 4px 0 0; }
.nexo-alert > .text-link, .nexo-alert > .nexo-alert-action { margin-left: auto; font-size: 10px; padding: 4px 0 4px 6px; flex-shrink: 0; }
.nexo-alert > .chevron { font-size: 10px; line-height: 24px; color: var(--muted); }
.nexo .nexo-pipeline > .help { margin: 14px 0 0; font-size: 10px; }
.nexo-attention .empty { font-size: 12px; padding: 28px 12px; }
.nexo-details { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 0 20px; margin: 20px 0; }
.nexo-details > summary { min-height: 52px; padding: 16px 0; font-size: 12px; color: var(--ink); }
.nexo-details[open] > summary { margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.nexo-details[open] { padding-bottom: 20px; }
.nexo-details .evaluation-panel { margin-top: 0; }
.nexo-details .overview-layout { margin-bottom: 0; }

.nexo-login { margin: 60px auto; max-width: 1000px; gap: 8%; grid-template-columns: 1.15fr 1fr; }
.nexo-login .login-intro { padding-top: 30px; }
.nexo-login .login-intro .brand { margin: 0 0 40px; }
.nexo-login .login-intro h1 { font-size: 39px; line-height: 1.2; margin-bottom: 16px; }
.nexo-login .login-intro > p { color: var(--muted); font-size: 14px; }
.nexo-login .login-card { padding: 32px; }
.nexo-login .login-card h2 { font-size: 24px; }
.nexo-login .reference-note { border-left-color: var(--support); }

@media (max-width: 1180px) {
  .nexo main { padding: 26px 24px 32px; }
  .nexo .topbar, .nexo .footer { padding-left: 24px; padding-right: 24px; }
  .nexo .header-right { gap: 12px; }
  .nexo-hero h1 { font-size: 30px; }
  .nexo-metric { padding: 16px; }
  .nexo-metric strong { font-size: 24px; }
  .nexo-stage { display: block; }
  .nexo-stage strong, .nexo-stage > span, .nexo-stage small { display: block; }
  .nexo-stage > span { margin-top: 7px; }
  .nexo-layout { grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); }
}
@media (min-width: 761px) and (max-width: 970px) {
  .nexo-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .nexo-layout { grid-template-columns: 1fr; }
  .nexo .demo-label { display: none; }
  .nexo-hero { align-items: flex-start; flex-direction: column; gap: 16px; }
  .nexo .breadcrumb > span { display: inline; }
}
@media (max-width: 760px) {
  .nexo-dashboard { display: flex; flex-direction: column; }
  .nexo-dashboard > .nexo-hero { order: 0; }
  .nexo-dashboard > .nexo-metrics { order: 1; }
  .nexo-dashboard > .nexo-pipeline { order: 3; }
  .nexo-dashboard > .nexo-details { order: 5; }
  .nexo .sidebar { display: none; }
  .nexo .app { margin-left: 0; padding-bottom: 76px; }
  .nexo .app.guest { padding-bottom: 0; }
  .nexo .topbar { height: 64px; min-height: 64px; padding: 0 16px; gap: 10px; position: relative; z-index: 20; }
  .nexo .breadcrumb { font-size: 11px; gap: 7px; }
  .nexo .breadcrumb > span { display: none; }
  .nexo .breadcrumb b { font-size: 23px; font-weight: 800; letter-spacing: -.6px; text-transform: lowercase; }
  .nexo .header-right { gap: 8px; }
  .nexo .demo-label { display: none; }
  .nexo .identity { gap: 5px; }
  .nexo .identity b { font-size: 10px; max-width: 94px; }
  .nexo .identity small { font-size: 9px; }
  .nexo .identity .quiet { min-width: 44px; min-height: 44px; font-size: 10px; padding: 8px; }
  .nexo .nexo-mobile-menu { display: block; }
  .nexo-mobile-menu > summary { min-height: 44px; display: flex; align-items: center; padding: 8px; color: var(--muted); font-size: 11px; list-style: none; }
  .nexo-mobile-menu > summary::-webkit-details-marker { display: none; }
  .nexo-mobile-menu[open] > summary { margin-bottom: 0; background: var(--soft); border-radius: 4px; }
  .nexo-mobile-menu nav { position: absolute; top: 60px; left: 12px; right: 12px; padding: 10px; display: grid; gap: 4px; max-height: calc(100dvh - 144px); overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 24px #18202016; }
  .nexo-mobile-menu nav a { display: flex; min-height: 44px; align-items: center; padding: 10px 12px; font-size: 12px; border-radius: 4px; color: var(--muted); }
  .nexo-mobile-menu nav a[aria-current="page"], .nexo-mobile-menu nav a.selected { background: var(--ink); color: var(--surface); }
  .nexo-mobile-menu nav a:hover { background: var(--support); color: var(--ink); }
  .nexo .nexo-mobile-nav { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); position: fixed; inset: auto 0 0; z-index: 30; gap: 4px; min-height: 64px; padding: 6px 10px calc(6px + env(safe-area-inset-bottom,0px)); background: var(--surface); border-top: 1px solid var(--line); }
  .nexo-mobile-nav a { display: flex; justify-content: center; align-items: center; min-width: 0; min-height: 46px; padding: 8px 4px; color: var(--muted); font-size: 11px; border-radius: 4px; text-align: center; overflow-wrap: anywhere; }
  .nexo-mobile-nav a.selected, .nexo-mobile-nav a[aria-current="page"] { background: var(--support); color: var(--ink); font-weight: 650; }
  .nexo main { padding: 24px 16px 26px; min-height: calc(100dvh - 190px); }
  .nexo .footer { padding: 16px; font-size: 9px; }
  .nexo .page-heading h1 { font-size: 28px; }
  .nexo .card { padding: 18px; border-radius: 8px; }
  .nexo .card-heading .text-link { margin-top: 0; }
  .nexo .button { min-height: 44px; }
  .nexo-hero { display: block; margin-bottom: 22px; }
  .nexo-hero h1 { font-size: 29px; max-width: 440px; }
  .nexo-hero p { font-size: 12px; }
  .nexo-hero > .button { margin-top: 16px; }
  .nexo-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
  .nexo-metric { padding: 14px; min-height: 110px; border-radius: 6px; }
  .nexo-metric > span { font-size: 10px; }
  .nexo-metric strong { font-size: 23px; margin: 8px 0 6px; }
  .nexo-metric small { font-size: 10px; }
  .nexo-metric .nexo-unavailable { font-size: 18px; }
  .nexo-metric-production { grid-column: 1/-1; min-height: 0; background: transparent; border: 0; padding: 2px 0 6px; }
  .nexo-metric-production strong { margin: 0 0 4px; font-size: 22px; }
  .nexo-metric-production > span { color: var(--ink); font-weight: 600; margin-bottom: 4px; }
  .nexo-metric-production strong small { font-size: 14px; }
  .nexo-metric-production strong em { font-size: 14px; }
  .nexo-metrics:has(.nexo-metric-production) .nexo-metric:last-child { grid-column: 1/-1; min-height: 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 10px 14px; }
  .nexo-metrics:has(.nexo-metric-production) .nexo-metric:last-child strong { margin: 0; font-size: 21px; text-align: right; }
  .nexo-metrics:has(.nexo-metric-production) .nexo-metric:last-child > small { grid-column: 1/-1; font-size: 9px; }
  .nexo .nexo-pipeline { padding: 16px; margin-bottom: 18px; }
  .nexo-section-head { gap: 9px; margin-bottom: 14px; align-items: flex-start; }
  .nexo-section-head h2 { font-size: 16px; }
  .nexo-section-head .text-link { font-size: 10px; min-height: 24px; }
  .nexo-pipeline > .nexo-stages, .nexo-pipeline > .nexo-pipeline-stages { gap: 7px; }
  .nexo-stage { padding-bottom: 10px; border-bottom-width: 2px; }
  .nexo-stage strong { font-size: 23px; }
  .nexo-stage > span { font-size: 9px; margin-top: 8px; line-height: 1.5; }
  .nexo-stage small { display: none; }
  .nexo-dashboard > .nexo-layout { display: contents; }
  .nexo .nexo-dashboard .nexo-attention { order: 2; margin-bottom: 18px; }
  .nexo .nexo-dashboard .nexo-cash-card { order: 4; margin-bottom: 22px; }
  .nexo-alert { padding: 17px 0; }
  .nexo-alert b, .nexo-alert strong { font-size: 12px; }
  .nexo-alert p, .nexo-alert small { font-size: 11px; }
  .nexo-alert > .text-link, .nexo-alert > .nexo-alert-action { min-height: 44px; display: flex; align-items: center; margin-top: -6px; font-size: 11px; }
  .nexo-alert > .chevron { font-size: 11px; }
  .nexo-cash-empty { min-height: 180px; padding: 24px 16px; }
  .nexo-empty-chart { max-width: 250px; height: 48px; }
  .nexo-details { padding: 0 16px; }
  .nexo-details > summary { font-size: 12px; }
  .nexo-login { display: block; max-width: 440px; margin: 6px auto; }
  .nexo-login .login-intro { padding-top: 0; }
  .nexo-login .login-intro .brand { margin: 0 0 24px; }
  .nexo-login .login-intro h1 { font-size: 30px; margin-bottom: 12px; }
  .nexo-login .login-intro > p { font-size: 13px; margin-bottom: 24px; }
  .nexo-login .login-card { padding: 24px; }
}
@media (max-width: 360px) {
  .nexo .topbar { padding: 0 12px; gap: 6px; }
  .nexo .identity b { max-width: 76px; font-size: 9px; }
  .nexo main { padding: 22px 12px; }
  .nexo-hero h1 { font-size: 27px; }
  .nexo-metric { padding: 12px; }
  .nexo-metric strong { font-size: 21px; }
  .nexo .nexo-pipeline { padding: 14px; }
  .nexo-stage strong { font-size: 21px; }
  .nexo-stage > span { font-size: 8px; }
  .nexo-mobile-nav a { font-size: 10px; }
}
