/*
 * Carga Máquina — padrão visual corporativo
 * Paleta, cabeçalho, sombras e raios alinhados ao CSS de referência.
 * Compatível com o HTML e o JavaScript da versão premium.
 */

:root {
  color-scheme: light;

  /* Padrão visual corporativo */
  --bg: #edf2f6;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --surface-strong: #eef5f8;
  --ink: #071a33;
  --muted: #5d6b7c;
  --line: #d7e1ea;
  --line-strong: #b8c8d7;
  --blue: #1769d2;
  --teal: #00806f;
  --green: #13a36f;
  --amber: #e99a16;
  --red: #d83a3a;
  --shadow: 0 16px 34px rgba(7, 26, 51, 0.08);
  --shadow-soft: 0 10px 24px rgba(7, 26, 51, 0.06);
  --radius: 8px;

  /* Compatibilidade com os componentes existentes */
  --navy-950: #071a33;
  --navy-900: #071a33;
  --navy-800: #12375f;
  --blue-600: var(--blue);
  --blue-500: #2d7bd9;
  --cyan-400: #3db9d2;
  --orange-600: #c7780f;
  --orange-500: var(--amber);
  --green-700: #0d855b;
  --green-600: var(--green);
  --ink-900: var(--ink);
  --ink-700: #30445c;
  --ink-500: var(--muted);
  --page: var(--bg);
  --danger: var(--red);
  --warning: var(--amber);
  --success: var(--green);
  --shadow-lg: var(--shadow);
  --shadow-md: var(--shadow-soft);
  --shadow-sm: 0 6px 18px rgba(7, 26, 51, 0.06);
  --radius-xl: var(--radius);
  --radius-lg: var(--radius);
  --radius-md: var(--radius);
  /* Fonte única de todo o site. Segoe UI é limpa, elegante e fácil de ler. */
  --font-site: "Segoe UI Variable", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: linear-gradient(180deg, #f8fbfd 0, var(--bg) 320px, var(--bg) 100%);
  font-family: var(--font-site);
  font-size: 14px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a, input, select {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
img { max-width: 100%; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--navy-950);
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: relative;
  min-height: 176px;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 105, 210, 0.07), rgba(0, 128, 111, 0.08) 46%, rgba(255, 255, 255, 0) 76%),
    var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--blue) 42%, var(--amber) 76%, var(--red));
}
.site-header__grid {
  position: absolute;
  inset: 0;
  opacity: .24;
  background-image:
    linear-gradient(rgba(23, 105, 210, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 105, 210, .035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, transparent, #000 48%, #000 100%);
}
.header-inner {
  position: relative;
  z-index: 1;
  /* Ocupa toda a largura para aproximar as informações da lateral esquerda. */
  width: 100%;
  min-height: 176px;
  margin: 0;
  padding: 22px 24px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}
.header-copy {
  min-width: 0;
  max-width: 820px;
}
.eyebrow,
.section-kicker,
.machine-card__eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--teal);
}
.eyebrow__dot {
  width: 9px;
  height: 9px;
  border: 2px solid rgba(19, 163, 111, .24);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(19, 163, 111, .10);
}
h1 {
  margin: 10px 0 7px;
  color: var(--ink);
  font-size: clamp(2.2rem, 3vw, 2.75rem);
  font-weight: 850;
  line-height: 1.06;
  letter-spacing: -.035em;
}
.header-subtitle {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.updated-card {
  position: relative;
  width: fit-content;
  min-width: 205px;
  margin-top: 13px;
  padding: 9px 13px 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(184, 200, 215, .85);
  border-radius: 10px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(238, 245, 248, .94));
  box-shadow: 0 8px 20px rgba(7, 26, 51, .07), inset 0 1px 0 #fff;
  transform: translateY(0);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.updated-card:hover {
  border-color: color-mix(in srgb, var(--blue) 48%, var(--line));
  background: linear-gradient(135deg, #fff, color-mix(in srgb, var(--blue) 7%, #eef5f8));
  box-shadow: 0 13px 26px rgba(23, 105, 210, .14), inset 0 1px 0 #fff;
  transform: translateY(-3px);
}
.updated-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--blue), var(--teal));
}
.updated-card__icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: rgba(23, 105, 210, .09);
  transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
}
.updated-card:hover .updated-card__icon {
  background: rgba(23, 105, 210, .14);
  box-shadow: 0 0 0 4px rgba(23, 105, 210, .08);
  transform: scale(1.08) rotate(-3deg);
}
.updated-card__icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.updated-card__content { display: grid; gap: 1px; }
.updated-card__label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.updated-card__date {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: .01em;
  transition: color .22s ease;
}
.updated-card:hover .updated-card__date { color: var(--blue); }
.updated-card.is-updated { animation: date-card-update .55s ease-out; }
.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
}
.brand-lockup {
  position: relative;
  width: 250px;
  height: 104px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent;
  box-shadow: none !important;
  outline: 0;
  transform: translateY(0);
  transition: transform .22s ease;
}
.brand-lockup::before,
.brand-lockup::after { display: none !important; content: none !important; }
.brand-lockup img {
  position: relative;
  z-index: 1;
  width: 230px;
  height: 96px;
  max-width: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  border: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
  filter: none;
  transform: scale(1);
  transform-origin: center;
  transition: transform .25s ease;
}
.brand-lockup:hover { transform: translateY(-2px); }
.brand-lockup:hover img {
  transform: scale(1.05);
  filter: none;
}
.brand-lockup__fallback {
  position: absolute;
  color: var(--blue);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .08em;
}
.brand-lockup.has-logo .brand-lockup__fallback { display: none; }

.button {
  min-height: 42px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: .52; }
.button__icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.button.is-loading .button__icon { animation: spin .8s linear infinite; }
.button--light {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-strong);
}
.button--light:hover:not(:disabled) {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: var(--shadow-soft);
}

.page-shell {
  position: relative;
  z-index: 2;
  /* Usa melhor a largura de monitores grandes. */
  width: min(calc(100% - 32px), 1800px);
  margin: 20px auto 0;
}
.overview-panel,
.workspace {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}
.overview-panel {
  padding: 25px;
  border-radius: var(--radius-xl);
}
.overview-panel__heading,
.workspace__header,
.machine-card__header,
.machine-nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.section-kicker {
  color: var(--blue-600);
  animation: title-kicker-in .55s ease-out both;
}
.overview-panel h2,
.workspace h2 {
  position: relative;
  width: fit-content;
  padding-bottom: 7px;
  margin: 4px 0 0;
  color: var(--navy-900);
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.15;
  letter-spacing: -.025em;
  animation: section-title-in .65s .08s cubic-bezier(.2, .75, .25, 1) both;
}
.overview-panel h2::after,
.workspace h2::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  transform: scaleX(.18);
  transform-origin: left;
  opacity: .7;
  transition: transform .35s ease, opacity .35s ease;
}
.overview-panel__heading:hover h2::after,
.workspace__header:hover h2::after {
  transform: scaleX(1);
  opacity: 1;
}
.overview-panel__note {
  margin: 0;
  color: var(--ink-500);
  font-size: 12px;
}
.summary-cards {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.summary-card {
  --card-accent: var(--blue-600);
  position: relative;
  min-height: 124px;
  overflow: hidden;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, #fff 0%, #f8fbfe 100%);
  box-shadow: var(--shadow-sm);
  transform: translateY(0);
  color: inherit;
  font-family: inherit;
  text-decoration: none;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.summary-card::after {
  content: "";
  position: absolute;
  top: -48px;
  right: -36px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--card-accent) 9%, transparent);
  transform: scale(1);
  transition: transform .3s ease, background .3s ease;
}
.summary-card:not(.summary-card--skeleton):hover {
  z-index: 2;
  border-color: color-mix(in srgb, var(--card-accent) 52%, var(--line));
  background: linear-gradient(150deg, #fff 0%, color-mix(in srgb, var(--card-accent) 5%, #f8fbfe) 100%);
  box-shadow: 0 14px 28px color-mix(in srgb, var(--card-accent) 16%, rgba(7, 26, 51, .10));
  transform: translateY(-4px);
}
.summary-card:not(.summary-card--skeleton):hover::after {
  background: color-mix(in srgb, var(--card-accent) 15%, transparent);
  transform: scale(1.12);
}
.summary-card[href] { cursor: pointer; }
.summary-card[href]:focus-visible {
  z-index: 3;
  outline: 3px solid color-mix(in srgb, var(--card-accent) 40%, transparent);
  outline-offset: 3px;
  border-color: var(--card-accent);
  box-shadow: 0 14px 28px color-mix(in srgb, var(--card-accent) 18%, rgba(7, 26, 51, .12));
}
.summary-card[href]:active { transform: translateY(-1px); }
.summary-card--3k { --card-accent: var(--blue-600); }
.summary-card--6k { --card-accent: var(--orange-500); }
.summary-card--30k { --card-accent: var(--green-600); }
.summary-card--3k,
.summary-card--6k,
.summary-card--30k {
  min-height: 124px;
  display: flex;
  flex-direction: column;
}
.summary-card--total { --card-accent: #6daeff; color: #fff; border-color: transparent; background: linear-gradient(145deg, #12375f, var(--ink)); }
.summary-card--total::after { background: rgb(255 255 255 / 7%); }
.summary-card--total:not(.summary-card--skeleton):hover {
  border-color: rgba(109, 174, 255, .72);
  background: linear-gradient(145deg, #174675, #092441);
  box-shadow: 0 16px 32px rgba(7, 26, 51, .25);
}
.summary-card--total:not(.summary-card--skeleton):hover::after { background: rgb(255 255 255 / 12%); }
.summary-card__top,
.summary-card__footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.summary-card__machine {
  margin: 0;
  color: var(--card-accent);
  font-size: 16.5px;
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.summary-card--total .summary-card__machine { color: #b7d2f1; font-weight: 720; letter-spacing: .065em; }
.summary-card__count {
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--ink-700);
  background: #eef3f8;
  font-size: 10.5px;
  font-weight: 720;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.summary-card__load-label {
  position: relative;
  z-index: 1;
  margin: 11px 0 1px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.summary-card__load {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--navy-900);
  font-size: clamp(1.25rem, 1.5vw, 1.65rem);
  font-weight: 760;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.summary-card--total .summary-card__load-label { color: #9fb6d0; }
.summary-card--total .summary-card__load { color: #fff; font-size: clamp(1.5rem, 1.85vw, 1.95rem); font-weight: 760; letter-spacing: -.035em; }
.summary-card__footer { margin-top: 9px; }
.summary-metric { min-width: 0; }
.summary-metric span { display: block; color: var(--ink-500); font-size: 9.5px; font-weight: 650; letter-spacing: .045em; text-transform: uppercase; }
.summary-metric strong { display: block; margin-top: 2px; color: var(--ink-900); font-size: 12.5px; font-weight: 720; }
.summary-card--total .summary-metric span { color: #8fa5bf; }
.summary-card--total .summary-metric strong { color: #e9f2fb; }
.summary-card__link {
  position: relative;
  z-index: 1;
  width: fit-content;
  margin-top: auto;
  color: var(--card-accent);
  font-size: 16.5px;
  font-weight: 720;
  letter-spacing: .005em;
  text-decoration: none;
  transition: transform .2s ease, filter .2s ease;
}
.summary-card:hover .summary-card__link { transform: translateX(4px); filter: brightness(.9); }
.summary-card:hover .summary-card__link,
.summary-card:focus-visible .summary-card__link { text-decoration: underline; }
.summary-card--skeleton {
  border-color: #e5ebf1;
  background: linear-gradient(100deg, #f2f5f8 30%, #fafcfd 45%, #f2f5f8 60%);
  background-size: 240% 100%;
  animation: shimmer 1.3s linear infinite;
}

.legend {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  box-shadow: 0 4px 14px rgba(7, 26, 51, .03);
  transform: translateY(0);
  font-family: inherit;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.legend:hover {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  background: color-mix(in srgb, var(--blue) 2%, var(--surface-soft));
  box-shadow: 0 12px 26px rgba(23, 105, 210, .10);
  transform: translateY(-3px);
}
.legend summary {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-900);
  font-size: 12.5px;
  font-weight: 720;
  line-height: 1.25;
  letter-spacing: -.005em;
  cursor: pointer;
  list-style: none;
}
.legend summary::-webkit-details-marker { display: none; }
.legend__title { min-width: 0; }
.legend summary::before {
  content: "+";
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--blue-600);
  background: #e5f1ff;
  font-size: 24px;
  line-height: 1;
  transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
}
.legend:hover summary::before { background: #dbeeff; box-shadow: 0 0 0 4px rgba(23, 105, 210, .08); transform: scale(1.06); }
.legend[open] summary::before { content: "−"; }
.legend__summary-hint {
  margin-left: auto;
  color: var(--ink-500);
  font-size: 15px;
  font-weight: 580;
  letter-spacing: .015em;
}
.legend__list {
  margin: 0;
  padding: 0 15px 15px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
}
.legend__list li {
  --legend-accent: var(--blue);
  min-height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e3eaf1;
  border-radius: var(--radius);
  color: #263b54;
  background: var(--surface);
  font-size: 15px;
  font-weight: 620;
  line-height: 1.3;
  letter-spacing: -.005em;
  transform: translateY(0);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.legend-status-link {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: inherit;
  color: inherit;
  background: transparent;
  font: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}
.legend-status-link::after {
  content: "↓";
  margin-left: auto;
  color: var(--legend-accent);
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .16s ease, transform .16s ease;
}
.legend__list li:hover .legend-status-link::after,
.legend-status-link:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.legend-status-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--legend-accent) 28%, transparent);
  outline-offset: 2px;
}
.legend__list li:has(.status--waiting-client) { --legend-accent: #d2aa00; }
.legend__list li:has(.status--purchased) { --legend-accent: #0b8fca; }
.legend__list li:has(.status--purchasing) { --legend-accent: #d9468f; }
.legend__list li:has(.status--invoice) { --legend-accent: #07995a; }
.legend__list li:has(.status--nonconforming) { --legend-accent: #d73543; }
.legend__list li:has(.status--commercial) { --legend-accent: #9148c4; }
.legend__list li:has(.status--detailing) { --legend-accent: #dd6614; }
.legend__list li:hover {
  z-index: 1;
  border-color: color-mix(in srgb, var(--legend-accent) 48%, #e3eaf1);
  background: color-mix(in srgb, var(--legend-accent) 4%, white);
  box-shadow: 0 7px 16px color-mix(in srgb, var(--legend-accent) 14%, rgba(7, 26, 51, .06));
  transform: translateY(-2px);
}
.legend-swatch {
  flex: 0 0 11px;
  width: 11px;
  height: 11px;
  border-radius: 4px;
  background: var(--status-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color) 13%, transparent);
  transition: transform .2s ease, box-shadow .2s ease;
}
.legend__list li:hover .legend-swatch {
  transform: scale(1.18);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--status-color) 16%, transparent);
}

.workspace {
  margin-top: 18px;
  padding: 25px;
  border-radius: var(--radius-xl);
}
.workspace__actions { display: flex; align-items: center; gap: 10px; }
.search-field {
  min-width: min(390px, 36vw);
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search-field:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgb(22 131 239 / 11%); }
.search-field svg { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: var(--ink-500); stroke-width: 2; stroke-linecap: round; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink-900); background: transparent; }
.search-field input::placeholder { color: #8895a6; }
.machine-nav-wrap {
  position: sticky;
  top: 10px;
  z-index: 20;
  margin-top: 22px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  transform: translateY(0);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.machine-nav-wrap:hover {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  background: rgb(255 255 255 / 97%);
  box-shadow: 0 12px 26px rgba(23, 105, 210, .11);
  transform: translateY(-3px);
}
.machine-nav {
  margin: -5px;
  padding: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.machine-nav::-webkit-scrollbar { display: none; }
.machine-nav__link {
  --nav-accent: var(--blue);
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius);
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
  transform: translateY(0);
  transition: color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.machine-nav__link[data-machine-link="3K"] { --nav-accent: #2d7bd9; }
.machine-nav__link[data-machine-link="6K"] { --nav-accent: #e99a16; }
.machine-nav__link[data-machine-link="30K"] { --nav-accent: #13a36f; }
.machine-nav__link:hover {
  color: var(--nav-accent);
  background: color-mix(in srgb, var(--nav-accent) 9%, white);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--nav-accent) 14%, transparent);
  transform: translateY(-1px);
}
.machine-nav__link.is-active {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 7px 16px rgba(23, 105, 210, .22);
}
.machine-nav__link.is-active:hover { color: #fff; background: #0f5dbf; box-shadow: 0 7px 16px rgba(23, 105, 210, .26); }
.machine-nav__dot { width: 8px; height: 8px; border-radius: 50%; transition: transform .18s ease, box-shadow .18s ease; }
.machine-nav__link:hover .machine-nav__dot { transform: scale(1.28); box-shadow: 0 0 0 4px color-mix(in srgb, var(--nav-accent) 15%, transparent); }
.machine-nav__dot--3k { background: #45a0ff; }
.machine-nav__dot--6k { background: #ff9c4b; }
.machine-nav__dot--30k { background: #43c47a; }
.filter-result { margin: 0 8px 0 auto; color: var(--ink-500); font-size: 11px; font-weight: 750; white-space: nowrap; }

.machine-card {
  --machine-accent: var(--blue-600);
  margin-top: 10px;
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  scroll-margin-top: 90px;
}
.machine-card--6k { --machine-accent: var(--orange-500); }
.machine-card--30k { --machine-accent: var(--green-600); }
.machine-card__header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--machine-accent) 8%, white), #fff 44%);
  box-shadow: inset 5px 0 var(--machine-accent);
}
.machine-card__eyebrow { color: var(--machine-accent); font-size: 9px; }
.machine-card h3 { margin: 2px 0 0; color: var(--navy-900); font-size: 1.35rem; line-height: 1; letter-spacing: -.025em; }
.machine-card__meta { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.machine-hours {
  display: flex;
  min-width: 92px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--machine-accent) 24%, var(--line));
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  background: rgb(255 255 255 / 78%);
}
.machine-hours__value {
  color: var(--navy-900);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .015em;
  white-space: nowrap;
}
.count-badge {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.count-badge { color: var(--machine-accent); background: color-mix(in srgb, var(--machine-accent) 10%, white); }
.table-scroll {
  width: 100%;
  max-width: 100%;
  max-height: none;
  margin-top: 0;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  /* A barra permite acessar as colunas quando a tela for menor que a tabela. */
  scrollbar-width: thin;
}
.mobile-cell-label { display: none; }
.table-scroll:focus-visible { outline: 3px solid rgb(22 131 239 / 25%); outline-offset: -3px; }
.table-scroll::-webkit-scrollbar { height: 10px; }
.table-scroll::-webkit-scrollbar-thumb { border-radius: 999px; background: #b8c8d7; }
.table-scroll::-webkit-scrollbar-track { background: #eef3f7; }
.machine-table {
  width: 100%;
  /* Evita comprimir os valores longos das 17 colunas. */
  min-width: 2200px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  color: #17263c;
  background: var(--surface);
  font-family: inherit;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.machine-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.machine-table th,
.machine-table td {
  min-height: 32px;
  padding: 5px 4px;
  border: 0;
  border-right: 1px solid #e2e8ef;
  border-bottom: 1px solid #e2e8ef;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
  white-space: normal;
}
.machine-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  height: 42px;
  padding: 7px 5px;
  color: #f7fbff;
  background: linear-gradient(180deg, #12375f, var(--ink));
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
  text-wrap: balance;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .18);
  box-shadow: inset 0 -1px rgb(255 255 255 / 9%);
}
.machine-table thead th:first-child { left: 0; z-index: 8; }
.machine-table tbody tr { --row-status: transparent; background: var(--surface); transition: background .14s ease; }
.machine-table tbody tr:nth-child(even) { background: #f8fafc; }
.machine-table tbody tr:hover { background: #edf6ff; }
.machine-table tbody tr.is-legend-target {
  background: color-mix(in srgb, var(--target-color) 15%, white);
  box-shadow:
    inset 4px 0 var(--target-color),
    inset 0 0 0 2px color-mix(in srgb, var(--target-color) 58%, transparent);
  animation: legend-target-pulse .7s ease 2;
}
.machine-table tbody tr[data-status] { box-shadow: inset 4px 0 var(--row-status); }
.machine-table tbody th[scope="row"] {
  position: sticky;
  left: 0;
  z-index: 4;
  width: auto;
  min-width: 0;
  color: var(--navy-900);
  background: inherit;
  font-weight: 900;
  box-shadow: 1px 0 0 #d9e2eb;
}
.machine-table td.wrap { max-width: none; white-space: normal; line-height: 1.25; }
.machine-table td.client-cell { min-width: 0; text-align: left; font-weight: 750; }
.machine-table td.status-cell { min-width: 0; text-align: center; }
.machine-table td.nest-cell { overflow: visible; }
.machine-table th:nth-child(1) { width: 4%; }
.machine-table th:nth-child(2) { width: 4%; }
.machine-table th:nth-child(3) { width: 6.5%; }
/* Pedido: largura maior para sequências longas de números. */
.machine-table th:nth-child(4) { width: 15%; }
.machine-table th:nth-child(5) { width: 5%; }
.machine-table th:nth-child(6) { width: 5.5%; }
.machine-table th:nth-child(7) { width: 3.5%; }
.machine-table th:nth-child(8) { width: 5%; }
.machine-table th:nth-child(9) { width: 4%; }
.machine-table th:nth-child(10) { width: 5%; }
.machine-table th:nth-child(11) { width: 5%; }
.machine-table th:nth-child(12) { width: 5.5%; }
.machine-table th:nth-child(13) { width: 9%; }
/* Coluna Status da MP: recebe mais espaço para evitar que textos curtos quebrem. */
.machine-table th:nth-child(14) { width: 10%; }
.machine-table th:nth-child(15) { width: 4%; }
.machine-table th:nth-child(16),
.machine-table th:nth-child(17) { width: 4.5%; }
.machine-table th:nth-child(1), .machine-table td:nth-child(1),
.machine-table th:nth-child(2), .machine-table td:nth-child(2),
.machine-table th:nth-child(5), .machine-table td:nth-child(5),
.machine-table th:nth-child(6), .machine-table td:nth-child(6),
.machine-table th:nth-child(7), .machine-table td:nth-child(7),
.machine-table th:nth-child(8), .machine-table td:nth-child(8),
.machine-table th:nth-child(9), .machine-table td:nth-child(9),
.machine-table th:nth-child(10), .machine-table td:nth-child(10),
.machine-table th:nth-child(11), .machine-table td:nth-child(11),
.machine-table th:nth-child(12), .machine-table td:nth-child(12) { white-space: nowrap; }
/* Pedidos longos quebram dentro da célula sem invadir a coluna de data. */
.machine-table td:nth-child(4) {
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.25;
}
/* O tamanho da chapa permanece inteiro em uma única linha. */
.machine-table td:nth-child(13) {
  overflow-wrap: normal;
  white-space: nowrap;
}
/* Cria uma pequena folga nas laterais dos pedidos longos. */
.machine-table th:nth-child(4),
.machine-table td:nth-child(4) { padding-right: 8px; padding-left: 8px; }
.sequence-badge,
.machine-badge,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 850;
}
.sequence-badge { min-width: 28px; padding: 3px 6px; color: var(--navy-800); background: #e8f1fb; }
.machine-badge { min-width: 0; padding: 4px 6px; color: var(--machine-accent); background: color-mix(in srgb, var(--machine-accent) 11%, white); }
.machine-table td.nest-cell--highlighted {
  position: relative;
  z-index: 1;
  color: #17263c;
  background: color-mix(in srgb, var(--os-highlight-color) 25%, white);
  font-weight: 900;
  cursor: help;
  transition: background .15s ease, box-shadow .15s ease;
}
.machine-table td.nest-cell--highlighted:hover,
.machine-table td.nest-cell--highlighted:focus,
.machine-table td.nest-cell--highlighted:focus-visible {
  z-index: 12;
  outline: none;
  background: color-mix(in srgb, var(--os-highlight-color) 35%, white);
  box-shadow: inset 0 0 0 2px var(--os-highlight-color);
}
.machine-table td.nest-cell--highlighted::before,
.machine-table td.nest-cell--highlighted::after {
  position: absolute;
  z-index: 20;
  left: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 5px);
  transition: opacity .15s ease, transform .15s ease;
}
.machine-table td.nest-cell--highlighted::before {
  content: "";
  bottom: calc(100% + 4px);
  border: 6px solid transparent;
  border-top-color: #102f52;
}
.machine-table td.nest-cell--highlighted::after {
  content: attr(data-tooltip);
  bottom: calc(100% + 16px);
  width: max-content;
  max-width: 280px;
  padding: 9px 12px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 7px;
  color: #fff;
  background: #102f52;
  box-shadow: 0 10px 24px rgb(7 26 51 / 28%);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: .005em;
  white-space: normal;
}
.machine-table td.nest-cell--highlighted:hover::before,
.machine-table td.nest-cell--highlighted:hover::after,
.machine-table td.nest-cell--highlighted:focus::before,
.machine-table td.nest-cell--highlighted:focus::after,
.machine-table td.nest-cell--highlighted:focus-visible::before,
.machine-table td.nest-cell--highlighted:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.status-chip {
  max-width: 100%;
  /* Mantém somente o ponto e o texto, sem a cápsula ao redor. */
  padding: 2px 0;
  justify-content: center;
  gap: 7px;
  border-radius: 0;
  color: var(--status-text, var(--ink-700));
  background: transparent;
  white-space: normal;
  text-align: left;
  line-height: 1.25;
}
.status-chip::before { content: ""; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--status-color, #8995a5); }
.status--waiting-client { --status-color: #d2aa00; --status-bg: #fff8c7; --status-text: #6c5700; }
.status--purchased { --status-color: #0b8fca; --status-bg: #dff5ff; --status-text: #075c82; }
.status--purchasing { --status-color: #d9468f; --status-bg: #fce7f3; --status-text: #9d174d; }
.status--invoice { --status-color: #07995a; --status-bg: #dcf7e9; --status-text: #066b40; }
.status--nonconforming { --status-color: #d73543; --status-bg: #ffe3e6; --status-text: #8c1e29; }
.status--commercial { --status-color: #9148c4; --status-bg: #f1e4fb; --status-text: #63228e; }
.status--detailing { --status-color: #dd6614; --status-bg: #ffe8da; --status-text: #8d3a00; }
.status--stock { --status-color: #07995a; --status-bg: #dcf7e9; --status-text: #066b40; }
/* Mantém "MP CMB - Estoque" completo em uma única linha. */
.status-chip.status--stock { white-space: nowrap; }
.status--neutral { --status-color: #7b8796; --status-bg: #edf1f5; --status-text: #4d5968; }
.machine-table tbody tr[data-status="waiting-client"] { --row-status: #d2aa00; }
.machine-table tbody tr[data-status="purchased"] { --row-status: #0b8fca; }
.machine-table tbody tr[data-status="purchasing"] { --row-status: #d9468f; }
.machine-table tbody tr[data-status="invoice"] { --row-status: #07995a; }
.machine-table tbody tr[data-status="nonconforming"] { --row-status: #d73543; }
.machine-table tbody tr[data-status="commercial"] { --row-status: #9148c4; }
.machine-table tbody tr[data-status="detailing"] { --row-status: #dd6614; }
.machine-table tbody tr[data-status="stock"] { --row-status: #07995a; }

.app-tabs {
  width: fit-content;
  padding: 5px;
  display: flex;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgb(255 255 255 / 90%);
  box-shadow: var(--shadow-sm);
}
.app-tab {
  min-height: 42px;
  padding: 9px 16px;
  border: 0;
  border-radius: 7px;
  color: var(--ink-700);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.app-tab:hover { color: var(--blue); background: #edf6ff; }
.app-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #0f5dbf);
  box-shadow: 0 7px 16px rgba(23, 105, 210, .2);
}
#view-current > .overview-panel { margin-top: 12px; }

.history-panel {
  margin-top: 12px;
  padding: 25px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
  scroll-margin-top: 20px;
}
.history-panel__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.history-panel h2 {
  position: relative;
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -.025em;
}
.history-panel h2::after {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 0;
  width: 86px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}
.history-panel__description {
  margin: 20px 0 0;
  color: var(--ink-500);
  font-size: 12px;
}
.history-filters {
  margin-top: 22px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.history-field {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
}
.history-field--wide { grid-column: span 2; }
.history-field > span,
.history-pagination label > span {
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .025em;
}
.history-field input,
.history-field select,
.history-pagination select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.history-field input:focus,
.history-field select:focus,
.history-pagination select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgb(22 131 239 / 11%);
}
.history-field input:disabled,
.history-field select:disabled,
.history-clear:disabled { cursor: wait; opacity: .62; }
.history-clear {
  min-height: 42px;
  padding: 8px 13px;
  align-self: end;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--blue);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.history-clear:hover { color: #fff; border-color: var(--blue); background: var(--blue); }

.history-state {
  min-height: 104px;
  margin-top: 15px;
  padding: 22px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-500);
  background: #fbfcfd;
  text-align: center;
}
.history-state[data-kind="error"] {
  border-color: #efb3b8;
  color: #8c1e29;
  background: #fff5f6;
}
.history-state[data-kind="empty"] {
  border-color: #e4cf93;
  color: #6c5700;
  background: #fffdf2;
}
.history-state[data-kind="loading"] { color: var(--blue); }

.history-table-scroll {
  width: 100%;
  margin-top: 15px;
  overflow: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}
.history-scroll-hint {
  display: none;
  margin: 13px 0 5px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
}
.history-table {
  width: 100%;
  min-width: 1500px;
  border-collapse: separate;
  border-spacing: 0;
  color: #17263c;
  background: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.history-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.history-table th,
.history-table td {
  padding: 9px 8px;
  border-right: 1px solid #e2e8ef;
  border-bottom: 1px solid #e2e8ef;
  text-align: center;
  vertical-align: middle;
}
.history-table th:last-child,
.history-table td:last-child { border-right: 0; }
.history-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #2a415d;
  background: #edf4fa;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.history-data-row:nth-of-type(4n + 3) { background: #f8fafc; }
.history-data-row:hover { background: #edf6ff; }
.history-client-cell {
  min-width: 180px;
  font-weight: 750;
  text-align: left !important;
}
.history-date-cell,
.history-identifier-cell,
.history-size-cell,
.history-duration-cell { white-space: nowrap; }
.history-identifier-cell { font-weight: 750; }
.history-size-cell { min-width: 165px; }
.history-material-cell { min-width: 130px; }
.history-pagination {
  margin-top: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.history-pagination label {
  width: 130px;
  display: grid;
  gap: 5px;
}
.history-pagination__controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.history-pagination__controls button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--blue);
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.history-pagination__controls button:hover:not(:disabled) {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}
.history-pagination__controls button:disabled {
  cursor: not-allowed;
  opacity: .45;
}
#history-page-info {
  min-width: 190px;
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.empty-row td,
.filter-empty-row td,
.loading-row td {
  height: 110px;
  color: var(--ink-500);
  background: #fbfcfd;
  font-style: italic;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  max-width: min(390px, calc(100% - 36px));
  padding: 12px 15px;
  border: 1px solid #cdd9e6;
  border-radius: var(--radius);
  color: #fff;
  background: var(--ink);
  box-shadow: 0 18px 48px rgb(4 20 42 / 28%);
  font-size: 12px;
  font-weight: 750;
}
.toast[hidden] { display: none; }
.site-footer { padding: 20px; color: #7a8798; text-align: center; font-size: 11px; }
.site-footer p { margin: 0; }
.noscript-warning { padding: 14px; border-radius: var(--radius); color: #7b2700; background: #fff0df; font-weight: 750; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible { outline: 3px solid rgba(23, 105, 210, .42); outline-offset: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes legend-target-pulse {
  0%, 100% { filter: none; }
  50% { filter: brightness(.96) saturate(1.18); }
}
@keyframes date-card-update {
  0% { transform: translateY(2px); box-shadow: 0 0 0 rgba(23, 105, 210, 0); }
  45% { box-shadow: 0 0 0 4px rgba(23, 105, 210, .10), 0 10px 24px rgba(7, 26, 51, .09); }
  100% { transform: translateY(0); }
}
@keyframes shimmer { to { background-position: -240% 0; } }
@keyframes title-kicker-in {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes section-title-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace__header { align-items: flex-start; }
  .workspace__actions { width: min(100%, 560px); }
  .search-field { min-width: 0; flex: 1; }
}

@media (max-width: 820px) {
  .header-inner {
    width: 100%;
    min-height: 176px;
    padding: 20px 16px 18px;
    align-items: flex-start;
  }
  .header-actions { padding-top: 0; }
  .brand-lockup { width: 200px; height: 84px; }
  .brand-lockup img { width: 186px; height: 78px; }
  .page-shell { width: calc(100% - 20px); }
  .overview-panel, .workspace { padding: 16px; }
  .overview-panel__heading, .workspace__header { align-items: flex-start; flex-direction: column; }
  .overview-panel__note { max-width: 520px; }
  .workspace__actions { width: 100%; }
  .machine-nav-wrap { align-items: flex-start; flex-direction: column; }
  .filter-result { margin: 0 6px 3px; }
  .legend-status-link { min-height: 44px; }
  .history-panel { padding: 16px; }
  .history-panel__heading { flex-direction: column; }
  .history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-field--wide { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  html { scroll-padding-top: 82px; }
  body { padding-bottom: env(safe-area-inset-bottom); }
  .site-header {
    min-height: 0;
    padding-top: env(safe-area-inset-top);
  }
  .header-inner {
    min-height: 0;
    padding: 16px 14px 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }
  .header-copy { max-width: none; }
  .eyebrow { gap: 7px; font-size: 9px; }
  .eyebrow__dot { width: 7px; height: 7px; }
  h1 {
    margin: 8px 0 0;
    font-size: clamp(1.85rem, 10vw, 2.15rem);
  }
  .header-subtitle { display: none; }
  .updated-card {
    min-width: 0;
    margin-top: 11px;
    padding: 7px 9px 7px 8px;
    gap: 8px;
  }
  .updated-card__icon { flex-basis: 28px; width: 28px; height: 28px; }
  .updated-card__label { font-size: 8.5px; }
  .updated-card__date { font-size: 11.5px; }
  .header-actions {
    width: auto;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
  }
  .brand-lockup { width: 112px; height: 52px; }
  .brand-lockup img { width: 108px; height: 48px; }
  .brand-lockup__fallback { font-size: 14px; }

  .page-shell {
    width: calc(100% - 16px);
    margin-top: 10px;
  }
  .overview-panel,
  .workspace {
    padding: 13px;
    box-shadow: 0 8px 20px rgba(7, 26, 51, .06);
  }
  .app-tabs {
    width: 100%;
    padding: 4px;
  }
  .app-tab {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding-inline: 8px;
    font-size: 12px;
  }
  #view-current > .overview-panel { margin-top: 10px; }
  .overview-panel h2,
  .workspace h2 { font-size: 1.4rem; }
  .overview-panel__note { font-size: 11px; }

  .summary-cards {
    margin: 12px -13px 0;
    padding: 3px 13px 11px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-padding-inline: 13px;
    scroll-snap-type: inline mandatory;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .summary-cards::-webkit-scrollbar { display: none; }
  .summary-card {
    flex: 0 0 min(82vw, 300px);
    min-height: 112px;
    padding: 13px 14px;
    scroll-snap-align: start;
  }
  .summary-card__machine,
  .summary-card__link { font-size: 15px; }

  .legend { margin-top: 12px; }
  .legend summary {
    min-height: 46px;
    padding: 10px 11px;
    justify-content: flex-start;
  }
  .legend summary::before { flex: 0 0 22px; }
  .legend__title {
    flex: 1;
    font-size: 12px;
    overflow-wrap: anywhere;
  }
  .legend__list {
    padding: 0 9px 10px;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .legend__list li { min-height: 44px; font-size: 13px; }
  .legend-status-link { min-height: 44px; padding: 8px 9px; }
  .legend__summary-hint { display: none; }

  .workspace { margin-top: 12px; }
  .workspace__actions { align-items: stretch; flex-direction: column; }
  .search-field {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding-inline: 13px;
  }
  .search-field input { font-size: 16px; }

  .machine-nav-wrap {
    top: max(4px, env(safe-area-inset-top));
    z-index: 30;
    margin-top: 14px;
    padding: 6px;
    align-items: stretch;
    gap: 6px;
  }
  .machine-nav {
    width: 100%;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
  }
  .machine-nav__link {
    min-width: 0;
    min-height: 44px;
    padding: 8px 6px;
    justify-content: center;
    font-size: 11px;
  }
  .filter-result {
    margin: 0;
    padding: 1px 4px 2px;
    text-align: center;
    white-space: normal;
  }

  .machine-card {
    margin-top: 12px;
    overflow: visible;
    scroll-margin-top: 84px;
  }
  .machine-card__header {
    padding: 10px 11px;
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }
  .machine-card h3 { font-size: 1.2rem; }
  .machine-card__meta {
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 5px;
  }
  .machine-hours { min-width: 78px; padding: 5px 7px; }
  .machine-hours__value { font-size: 11.5px; }
  .count-badge { padding: 5px 7px; font-size: 10px; white-space: nowrap; }

  .table-scroll {
    overflow: visible;
    scrollbar-width: auto;
  }
  .machine-table {
    min-width: 0;
    display: block;
    background: transparent;
    font-size: 13px;
  }
  .machine-table thead { display: none; }
  .machine-table tbody {
    padding: 10px;
    display: grid;
    gap: 10px;
    background: #eef3f7;
  }
  .machine-table tbody tr[data-searchable] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    box-shadow:
      inset 4px 0 var(--row-status),
      0 4px 12px rgba(7, 26, 51, .055);
  }
  .machine-table tbody tr[data-searchable][hidden] { display: none; }
  .machine-table tbody tr[data-searchable]:nth-child(even) { background: #fff; }
  .machine-table tbody tr[data-searchable]:hover { background: #fff; }
  .machine-table tbody tr[data-searchable].is-legend-target {
    background: color-mix(in srgb, var(--target-color) 11%, white);
    box-shadow:
      inset 4px 0 var(--target-color),
      inset 0 0 0 2px color-mix(in srgb, var(--target-color) 58%, transparent),
      0 7px 18px color-mix(in srgb, var(--target-color) 15%, transparent);
  }
  .machine-table tbody tr[data-searchable] > th,
  .machine-table tbody tr[data-searchable] > td {
    position: static;
    z-index: auto;
    width: auto !important;
    min-width: 0;
    min-height: 54px;
    padding: 8px 9px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    overflow: visible;
    border-right: 1px solid #e5ebf1;
    border-bottom: 1px solid #e5ebf1;
    color: #17263c;
    background: transparent;
    box-shadow: none;
    text-align: left;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  .machine-table tbody tr[data-searchable] > :nth-child(even) { border-right: 0; }
  .machine-table tbody tr[data-searchable] > :nth-last-child(-n + 2) { border-bottom: 0; }
  .machine-table tbody tr[data-searchable] > [data-key="sequencia"],
  .machine-table tbody tr[data-searchable] > [data-key="cliente"],
  .machine-table tbody tr[data-searchable] > [data-key="pedido"],
  .machine-table tbody tr[data-searchable] > [data-key="tamanhoChapa"],
  .machine-table tbody tr[data-searchable] > [data-key="mp"] {
    grid-column: 1 / -1;
    border-right: 0;
  }
  .machine-table tbody tr[data-searchable] > [data-key="sequencia"] {
    min-height: 42px;
    padding: 6px 10px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    color: var(--navy-900);
    background: #f5f9fc;
  }
  .machine-table tbody tr[data-searchable] > [data-key="maquina"] { display: none; }
  .machine-table tbody tr[data-searchable] > .is-empty { display: none; }
  .mobile-cell-label {
    display: block;
    color: #708096;
    font-size: 9px;
    font-weight: 850;
    line-height: 1.1;
    letter-spacing: .055em;
    text-transform: uppercase;
  }
  [data-key="sequencia"] .mobile-cell-label { margin-right: auto; }
  .sequence-badge { min-width: 32px; padding: 4px 8px; }
  .status-chip {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }
  .machine-table td.nest-cell--highlighted {
    position: relative;
    z-index: 2;
    background: color-mix(in srgb, var(--os-highlight-color) 25%, white) !important;
  }
  .machine-table td.nest-cell--highlighted::before {
    top: calc(100% + 4px);
    bottom: auto;
    border-top-color: transparent;
    border-bottom-color: #102f52;
  }
  .machine-table td.nest-cell--highlighted::after {
    top: calc(100% + 16px);
    bottom: auto;
    width: max-content;
    max-width: min(260px, calc(100vw - 42px));
  }
  .machine-table tbody tr.empty-row,
  .machine-table tbody tr.filter-empty-row,
  .machine-table tbody tr.loading-row {
    display: block;
    border: 1px solid var(--line);
    border-radius: 9px;
    overflow: hidden;
  }
  .machine-table tbody tr.empty-row > td,
  .machine-table tbody tr.filter-empty-row > td,
  .machine-table tbody tr.loading-row > td {
    width: 100%;
    height: auto;
    min-height: 100px;
    padding: 20px;
    display: grid;
    place-items: center;
    border: 0;
  }

  .toast {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    max-width: none;
    padding: 12px 14px;
  }
  .site-footer {
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
  }

  .history-panel {
    margin-top: 10px;
    padding: 13px;
    overflow: hidden;
  }
  .history-panel h2 { font-size: 1.5rem; }
  .history-panel__description { margin-top: 18px; }
  .history-filters {
    margin-top: 16px;
    padding: 10px;
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .history-field--wide { grid-column: auto; }
  .history-field input,
  .history-field select,
  .history-clear {
    min-height: 46px;
    font-size: 16px;
  }
  .history-table-scroll {
    margin-top: 5px;
    margin-right: -1px;
    scrollbar-width: thin;
  }
  .history-scroll-hint { display: block; }
  .history-table { min-width: 1500px; }
  .history-table th,
  .history-table td { padding: 9px 7px; }
  .history-pagination {
    align-items: stretch;
    flex-direction: column;
  }
  .history-pagination label { width: 100%; }
  .history-pagination select { min-height: 44px; font-size: 16px; }
  .history-pagination__controls {
    display: grid;
    grid-template-columns: 1fr;
  }
  .history-pagination__controls button {
    min-height: 44px;
    font-size: 12px;
  }
  #history-page-info {
    min-width: 0;
    grid-row: 1;
    padding: 5px;
  }
}

@media (max-width: 380px) {
  .header-inner { padding-inline: 11px; }
  h1 { font-size: 1.8rem; }
  .brand-lockup { width: 96px; }
  .brand-lockup img { width: 94px; }
  .page-shell { width: calc(100% - 12px); }
  .overview-panel, .workspace { padding: 11px; }
  .history-panel { padding: 11px; }
  .summary-cards { margin-inline: -11px; padding-inline: 11px; }
  .summary-card { flex-basis: 86vw; }
  .machine-nav__link { font-size: 10px; }
  .machine-nav__dot { width: 6px; height: 6px; }
}

@media (hover: none) and (pointer: coarse) {
  .summary-card:not(.summary-card--skeleton):hover,
  .legend:hover,
  .machine-nav-wrap:hover,
  .updated-card:hover,
  .brand-lockup:hover {
    transform: none;
  }
  .legend-status-link::after { opacity: .7; transform: none; }
}


@media (prefers-contrast: more) {
  :root { --line: #aebccc; --line-strong: #8798aa; }
  .machine-table th, .machine-table td { border-color: #aebccc; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  body { background: var(--surface); }
  .site-header { min-height: auto; color: #000; background: var(--surface); }
  .site-header__grid, .site-header::before, .header-actions, .workspace__actions, .machine-nav-wrap, .toast { display: none !important; }
  .header-inner { min-height: auto; padding: 18px 0; }
  .eyebrow, .header-subtitle, .updated-card { color: #333; }
  .page-shell { width: 100%; margin: 0; }
  .overview-panel, .workspace, .machine-card { border: 1px solid #aaa; box-shadow: none; break-inside: avoid; }
  .table-scroll { max-height: none; overflow: visible; }
  .machine-table { min-width: 0; font-size: 7px; }
  .machine-table thead th, .machine-table tbody th[scope="row"] { position: static; }
}
