:root {
  --amber: #d19a00;
  color-scheme: dark;
  --bg: #0b1117;
  --surface: #111a22;
  --surface-2: #17232d;
  --line: #263642;
  --text: #eef4f7;
  --muted: #8ea0ac;
  --cyan: #1f8f7e;
  --blue: #4aa3ff;
  --orange: #f3a83b;
  --red: #ff6b6b;
  --green: #38d0b5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 70% -20%, #15313d 0, transparent 35%), var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(1760px, 100%); margin: 0 auto; padding: 0 clamp(16px, 2.3vw, 44px) 48px; }
.topbar { height: 92px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}
.admin-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 0 0 18px;
}
.admin-kpi-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: 0 14px 34px #00000018;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-kpi-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-kpi-card-head span:first-child {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-kpi-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-kpi-icon.green { background: color-mix(in srgb, var(--cyan) 18%, transparent); color: var(--cyan); }
.admin-kpi-icon.blue { background: color-mix(in srgb, var(--blue) 18%, transparent); color: var(--blue); }
.admin-kpi-icon.purple { background: color-mix(in srgb, #7451c9 18%, transparent); color: #7451c9; }
.admin-kpi-icon.red { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.admin-kpi-card strong {
  font-size: 26px;
  letter-spacing: -.02em;
  color: var(--text);
}
.admin-kpi-card strong small {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.admin-filter-row { display: flex; justify-content: flex-end; margin: -8px 0 4px; }
.admin-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(320px, 100%);
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}
.admin-search-field input {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.admin-search-field input::placeholder { color: var(--muted); }

.admin-asset-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
}
.admin-asset-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.admin-asset-panel-head span { display: inline-flex; align-items: center; gap: 8px; }
.admin-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.admin-asset-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.admin-asset-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.admin-asset-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.admin-asset-dot.online { background: var(--cyan); }
.admin-asset-dot.connected { background: var(--orange); }
.admin-asset-dot.offline { background: var(--red); }
.admin-asset-card strong { margin-top: 2px; font-size: 15px; color: var(--text); }
.admin-asset-card > small { color: var(--muted); font-size: 11px; }
.admin-asset-card-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.admin-asset-card-status small { color: var(--muted); font-size: 11px; }
.admin-asset-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
}
.admin-asset-card .admin-row-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.admin-asset-card .secondary-button { width: auto; min-height: 34px; font-size: 12px; }

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 -4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.admin-breadcrumb-dot { color: var(--cyan); }
.admin-breadcrumb-current { color: var(--text); }

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 6px;
}
.admin-profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--cyan) 0%, #16665a 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex: 0 0 auto;
}
.admin-profile-info { display: flex; flex-direction: column; line-height: 1.2; }
.admin-profile-info strong { font-size: 13px; color: var(--text); }
.admin-profile-info small { font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }

.admin-info-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.admin-info-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-info-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-info-card-head span { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.admin-info-badge { font-style: normal; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: #173327; color: #85ebb8; }
[data-theme="light"] .admin-info-badge { background: #e8f8f0; color: #16665a; }
.admin-info-card p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.admin-info-card-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 800; color: var(--cyan); cursor: pointer; }

.admin-customer-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-customer-cnpj { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--muted); }

#adminSidebar .client-nav-button.active {
  border-color: transparent;
  border-left-color: transparent;
  background: linear-gradient(145deg, var(--cyan) 0%, #16665a 100%);
  box-shadow: 0 10px 24px #1f8f7e33;
}
#adminSidebar .client-nav-button.active .client-nav-icon,
#adminSidebar .client-nav-button.active span,
#adminSidebar .client-nav-button.active small {
  color: #ffffff !important;
}
#adminSidebar .client-nav-button.active small { color: #d5f2ea !important; }

.admin-sla-card {
  margin: 8px 4px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
}
.admin-sla-card-head { display: flex; align-items: center; justify-content: space-between; }
.admin-sla-card-head span { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.admin-sla-card-head strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 800; color: var(--cyan); }
.admin-sla-bar { margin-top: 10px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.admin-sla-bar-fill { width: 99.98%; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cyan) 0%, #16665a 100%); }
.admin-sla-card small { display: block; margin-top: 8px; font-size: 10.5px; color: var(--muted); }

.admin-info-sparkline { width: 100%; height: 44px; color: var(--cyan); }
.admin-info-sparkline polyline { stroke: currentColor; }
.admin-info-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0; font-size: 12px; color: var(--muted); font-weight: 700; }
.admin-info-card-foot span { color: var(--cyan); }
.admin-panel-title-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-panel-title-actions .secondary-button { width: auto; display: inline-flex; align-items: center; gap: 8px; }
.admin-kpi-card small.admin-kpi-footnote {
  display: block;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.client-layout { display: block; }
.client-layout.logged-in {
  display: grid;
  grid-template-columns: minmax(214px, 238px) minmax(0, 1fr);
  gap: clamp(18px, 1.6vw, 28px);
  align-items: start;
}
.client-main { min-width: 0; }
.client-sidebar {
  position: sticky;
  top: 18px;
  margin-top: 48px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: 0 14px 40px #00000018;
}
.client-sidebar-fill {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 126px);
}
.client-sidebar-fill .client-sync-card { margin-top: auto; }
#adminSidebar.client-sidebar,
#clientSidebar.client-sidebar {
  top: 108px;
  margin-top: 0;
}
.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
}
.admin-sidebar-brand-icon { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto; }
.admin-sidebar-brand strong { display: block; font-size: 15px; letter-spacing: -.01em; color: var(--text); }
.admin-sidebar-brand span { display: block; margin-top: 2px; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.client-sidebar-title {
  padding: 8px 8px 14px;
  border-bottom: 1px solid var(--line);
}
.client-sidebar-title span,
.client-nav-button small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.client-sidebar-title strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
}
.client-nav {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.client-nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 12px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.client-nav-button:hover {
  border-color: var(--line);
  border-left-color: var(--line);
  background: #ffffff0f;
}
.client-nav-button.active {
  border-color: var(--cyan);
  border-left-color: var(--cyan);
  background: #1f8f7e26;
  box-shadow: inset 0 0 0 1px #1f8f7e40;
}
.client-nav-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--muted);
}
.client-nav-button.active .client-nav-icon,
.client-nav-button:hover .client-nav-icon {
  color: var(--cyan);
}
.client-nav-text { min-width: 0; }
.client-nav-button span {
  display: block;
  font-size: 14px;
  font-weight: 900;
}
.client-nav-button small {
  margin-top: 4px;
  letter-spacing: 0;
  text-transform: none;
}
.brand, .top-actions, .card-heading, .panel-title, .metric-footer, .dialog-header, .dialog-actions { display: flex; align-items: center; justify-content: space-between; }
.brand { gap: 14px; justify-content: flex-start; min-width: 0; }
.brand > div { min-width: 0; }
.brand-logo { display: block; width: 132px; max-width: 34vw; height: auto; object-fit: contain; flex: 0 0 auto; }
.eyebrow, .section-kicker { margin: 0 0 4px; color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.brand h1 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.top-actions { gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.top-actions .secondary-button { width: auto; }
.account-menu { position: relative; display: flex; align-items: center; gap: 10px; }
.account-menu-trigger {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .04em;
}
.account-menu-trigger:hover { background: #ffffff70; }
.account-menu-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: 0 14px 40px #00000022;
}
.account-menu-identity { display: flex; flex-direction: column; line-height: 1.3; }
.account-menu-identity strong { font-size: 13px; font-weight: 800; color: var(--text); }
.account-menu-identity span { font-size: 11px; color: var(--muted); }
.account-menu-plan {
  display: flex;
  flex-direction: column;
  margin: 12px 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
}
.account-menu-plan span { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.account-menu-plan strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.account-menu-item {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  text-align: left;
}
.account-menu-item:hover { background: #ffffff70; border-color: var(--line); }
.account-menu-item.danger { color: var(--red); }
.connection-pill { display: flex; gap: 9px; align-items: center; min-width: 132px; padding: 10px 14px; border: 1px solid #28413c; border-radius: 100px; background: #10221f; color: #8ee8bb; font-size: 12px; font-weight: 800; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px #38d0b520; }
.connection-pill.offline { color: #ff9999; border-color: #4c2929; background: #251617; }
.connection-pill.offline .status-dot { background: var(--red); box-shadow: 0 0 0 5px #ff6b6b20; }
.connection-pill.stale { color: #ffd590; border-color: #4f3e24; background: #251f14; }
.connection-pill.stale .status-dot { background: var(--orange); box-shadow: 0 0 0 5px #f3a83b20; }
.icon-button, .close-button { border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.icon-button { width: 42px; height: 42px; border-radius: 11px; padding: 10px; }
.icon-button svg { width: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; }

.hero { padding: 48px 0 30px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.hero h2 { margin: 0; font-size: clamp(26px, 4vw, 42px); letter-spacing: -.045em; }
.hero-copy { margin: 11px 0 0; color: var(--muted); }
.hero-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
.hero-actions-group { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }
.last-update { text-align: right; }
.last-update span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.last-update strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; }

.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.asset-dashboard { display: grid; grid-template-columns: minmax(260px, .75fr) minmax(0, 1.8fr); gap: 18px; }
.asset-dashboard.no-telemetry { grid-template-columns: minmax(0, 640px); justify-content: center; }
.asset-dashboard.no-telemetry .asset-telemetry-grid { display: none; }
#dashboardPanel.mode-scale #selectedMetrics,
#dashboardPanel.mode-scale #runtimePanel,
#dashboardPanel.mode-scale #stopEventsPanel,
#dashboardPanel.mode-scale #qualityEventsPanel,
#dashboardPanel.mode-asset #scaleDashboard {
  display: none !important;
}
.asset-status-panel,
.asset-telemetry-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, #15212a 0%, #101820 100%);
  box-shadow: 0 14px 40px #00000022;
}
.asset-status-panel { min-height: 350px; padding: 26px; text-align: center; }
.asset-status-panel h3 { margin: 0; font-size: clamp(24px, 4vw, 34px); letter-spacing: -.04em; }
.asset-illustration { display: grid; place-items: center; min-height: 145px; margin: 22px 0 18px; }
.equipment-icon-large { width: 132px; height: 132px; border-radius: 50%; box-shadow: inset 0 0 0 1px #0000000f, 0 12px 30px #00000022; }
.equipment-icon-large svg { width: 64px; height: 64px; }
.asset-illustration.online .equipment-icon-large { background: #173327; color: #85ebb8; }
.asset-illustration.connected .equipment-icon-large { background: #3a2d19; color: #ffd590; }
.asset-illustration.offline .equipment-icon-large { background: #361d1f; color: #ffaaaa; }
.equipment-illustration-photo { display: block; width: 100%; max-width: 340px; border-radius: 16px; box-shadow: 0 12px 30px #00000022; }
.asset-illustration.online .equipment-illustration-photo { outline: 3px solid var(--green); outline-offset: 4px; }
.asset-illustration.connected .equipment-illustration-photo { outline: 3px solid var(--orange); outline-offset: 4px; }
.asset-illustration.offline .equipment-illustration-photo { outline: 3px solid var(--red); outline-offset: 4px; }
.asset-run-state { display: block; margin-top: 8px; color: var(--green); font-size: 32px; font-weight: 500; }
.asset-run-state.on { color: var(--green); }
.asset-run-state.off { color: var(--red); }
.asset-fault-state,
.asset-emergency-state { display: block; margin-top: 18px; color: var(--text); font-size: 22px; }
.asset-emergency-state { font-weight: 850; }
.asset-fault-state.fault { color: var(--orange); }
.asset-fault-state.ok { color: var(--text); }
.asset-emergency-state.emergency { color: var(--red); }
.asset-emergency-state.ok { color: var(--text); }
.asset-telemetry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.asset-telemetry-card {
  min-width: 0;
  min-height: 166px;
  padding: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.asset-telemetry-card span { color: var(--text); font-size: 18px; font-weight: 850; }
.asset-telemetry-card strong { min-width: 0; color: var(--text); overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(28px, 4vw, 40px); }
.asset-telemetry-card small { color: inherit; font-size: .55em; }
.truck-log-card {
  width: 100%;
  margin-top: 18px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, #15212a 0%, #101820 100%);
  box-shadow: 0 14px 40px #00000022;
}
.truck-log-card-header {
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted, var(--text));
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.truck-log-card-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px;
}
.truck-log-stat span { display: block; color: var(--text); font-size: 20px; font-weight: 800; }
.truck-log-stat strong {
  display: block;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(48px, 7vw, 76px);
  line-height: 1;
}
.truck-log-transported { color: var(--text); font-size: 22px; font-weight: 700; }
.truck-log-transported b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.1em; }
.truck-log-runtime {
  padding: 16px 26px 22px;
  border-top: 1px solid var(--line);
}
.truck-log-runtime-title { margin: 0 0 14px; color: var(--cyan); font-size: 20px; font-weight: 800; }
.truck-log-runtime-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.truck-log-runtime-grid span { display: block; color: var(--text); font-size: 15px; font-weight: 700; opacity: .75; }
.truck-log-runtime-grid strong { display: block; margin-top: 6px; color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(20px, 2.4vw, 30px); overflow-wrap: anywhere; }
.nominal-value {
  width: 100%;
  margin: -8px 0 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
}

/* Padrão de cor dos indicadores: ideal (turquesa), média (laranja), abaixo (vermelho), nominal (azul). */
.indicator-ideal { color: var(--green); }
.indicator-media { color: var(--orange); }
.indicator-baixo { color: var(--red); }
.oee-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.oee-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, #13202a 0%, #0f171f 100%); box-shadow: 0 14px 40px #00000018; }
.oee-card span,
.oee-card small { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.oee-card strong { display: block; margin: 8px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.06em; }
.oee-card small { font-weight: 700; letter-spacing: 0; text-transform: none; }
.oee-card span[title] { width: fit-content; border-bottom: 1px dotted var(--muted); cursor: help; }
.oee-gauge { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; margin: 6px 0; }
.oee-gauge-svg { width: 100%; max-width: 280px; }
.oee-gauge-track { fill: none; stroke: var(--line); stroke-width: 12; stroke-linecap: round; }
.oee-gauge-fill { fill: none; stroke: url(#gaugeArcGradient); stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray .4s ease; }
.gauge-gradient-stop-low { stop-color: var(--red); }
.gauge-gradient-stop-mid { stop-color: var(--orange); }
.gauge-gradient-stop-high { stop-color: var(--green); }
.oee-card .oee-gauge-value {
  position: absolute;
  right: 0;
  bottom: 3%;
  left: 0;
  margin: 0;
  padding: 0 8px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(22px, 3.2vw, 42px);
  letter-spacing: -.03em;
}
.scale-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.customer-config-title { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.inline-select { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.inline-select select { min-height: 36px; }
.shift-multiselect { position: relative; display: flex; align-items: center; gap: 10px; }
.shift-multiselect-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  min-width: 190px;
  padding: 0 12px;
  border: 1px solid #31434e;
  border-radius: 8px;
  background: #0c141a;
  color: var(--text);
  font: inherit;
  text-align: left;
}
.shift-multiselect-trigger span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shift-multiselect-chevron { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); }
.shift-multiselect-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: 0 14px 40px #00000022;
}
.shift-multiselect-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.shift-multiselect-option:hover { background: #ffffff70; }
.shift-multiselect-option input { width: 16px; height: 16px; min-height: 0; }
.shift-multiselect-divider { margin: 6px 4px; border: none; border-top: 1px solid var(--line); }
.compact-select { display: flex; align-items: center; gap: 8px; width: auto; color: var(--muted); font-size: 11px; font-weight: 800; }
.compact-select select { min-width: 190px; min-height: 34px; padding: 0 9px; font-size: 12px; }
.scale-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: linear-gradient(145deg, #13202a 0%, #0f171f 100%); }
.scale-select-card { width: 100%; color: inherit; text-align: left; }
.scale-select-card:hover { border-color: #3b6866; transform: translateY(-1px); transition: border-color .18s ease, transform .18s ease; }
.scale-select-card.selected { border-color: var(--cyan); box-shadow: inset 0 0 0 1px #1f8f7e55, 0 14px 40px #0000001f; }
.scale-card.online { border-color: #2d5c49; }
.scale-card.connected { border-color: #5f4724; background: linear-gradient(145deg, #231f15 0%, #11171d 100%); }
.scale-card.offline { border-color: #553030; background: linear-gradient(145deg, #211617 0%, #11171d 100%); }
.scale-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.admin-customer-toggle { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 0; border: none; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.admin-customer-toggle-icon { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; color: var(--muted); transition: transform .15s ease; }
.admin-customer-toggle:hover .admin-customer-toggle-icon { transform: translateX(3px); color: var(--cyan); }
.admin-customer-detail-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 15px; }
#adminCustomerDetailBack,
.admin-customer-detail-head .admin-edit-cnpj,
.admin-customer-detail-head .compact-select select {
  width: 220px;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  justify-content: center;
}
#adminCustomerDetailBack { display: inline-flex; align-items: center; gap: 8px; }
.admin-customer-detail-head .admin-row-actions { align-items: center; flex-wrap: nowrap; }
@media (max-width: 1100px) {
  .admin-customer-detail-head .admin-row-actions { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  #adminCustomerDetailBack,
  .admin-customer-detail-head .admin-edit-cnpj,
  .admin-customer-detail-head .compact-select,
  .admin-customer-detail-head .compact-select select { width: 100%; }
}
.admin-module-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; padding-top: 4px; }
.admin-module-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.admin-module-option input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--cyan); }
.admin-module-option strong { display: block; font-size: 13px; }
.admin-module-option small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.admin-module-option:has(input:checked) { border-color: var(--cyan); }
.admin-customer-detail-head strong { display: block; font-size: 18px; }
.admin-customer-detail-head > div:first-child > span:last-child { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.scale-card-head strong { display: block; font-size: 15px; }
.scale-card-head span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.scale-card-head em { padding: 5px 8px; border-radius: 999px; background: #173327; color: #85ebb8; font-size: 10px; font-style: normal; font-weight: 850; text-transform: uppercase; }
.scale-card.connected .scale-card-head em { background: #3a2d19; color: #ffd590; }
.scale-card.offline .scale-card-head em { background: #361d1f; color: #ffaaaa; }
.scale-card-identity { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.admin-table-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.equipment-icon { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; background: #173327; color: #85ebb8; }
.equipment-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.scale-card.connected .equipment-icon,
.admin-table-identity.connected .equipment-icon { background: #3a2d19; color: #ffd590; }
.scale-card.offline .equipment-icon,
.admin-table-identity.offline .equipment-icon { background: #361d1f; color: #ffaaaa; }
.scale-card-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
/* Card de 4 valores: mantém a fonte original e reorganiza as colunas conforme a
   largura (4 em tela larga, 2 em média, 1 no celular) para o texto caber inteiro. */
.scale-card { container-type: inline-size; }
.scale-card-values.four-values { grid-template-columns: repeat(2, 1fr); }
/* As colunas dependem da largura do próprio card (dois cards lado a lado ficam
   estreitos mesmo em tela larga): 4 colunas só quando o card comporta o texto. */
@container (min-width: 760px) {
  .scale-card-values.four-values { grid-template-columns: repeat(4, 1fr); }
}
@container (max-width: 340px) {
  .scale-card-values.four-values { grid-template-columns: 1fr; }
}

.scale-card-values div { min-width: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.scale-card-values span, .scale-card-values small { display: block; color: var(--muted); font-size: 10px; }
.scale-card-values b { display: block; margin: 4px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; }
.scale-error { margin: 12px 0 0; color: #ffaaaa; font-size: 11px; line-height: 1.45; }
.scale-ok { margin: 12px 0 0; color: var(--green); font-size: 11px; line-height: 1.45; }
.scale-empty { grid-column: 1 / -1; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.metric-card, .panel { border: 1px solid var(--line); background: linear-gradient(145deg, #15212a 0%, #101820 100%); border-radius: 18px; box-shadow: 0 14px 40px #00000022; }
.metric-card { min-height: 250px; padding: 26px; position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -70px; bottom: -110px; width: 260px; height: 260px; border-radius: 50%; filter: blur(5px); opacity: .09; }
.flow-card::after { background: var(--cyan); }
.total-card::after { background: var(--blue); }
.card-heading { position: relative; z-index: 1; }
.card-heading p { margin: 0 0 7px; color: #c8d5db; font-size: 12px; font-weight: 850; letter-spacing: .1em; }
.card-heading span { color: var(--muted); font-size: 13px; }
.metric-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; }
.metric-icon svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.flow-icon { color: var(--cyan); background: #1f8f7e17; }
.total-icon { color: var(--blue); background: #4aa3ff17; }
.metric-value { min-width: 0; display: flex; align-items: baseline; gap: 12px; margin: 37px 0 30px; position: relative; z-index: 1; }
.metric-value strong { min-width: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(42px, 6vw, 68px); line-height: .9; letter-spacing: -.07em; }
.metric-value span { color: var(--muted); font-size: 18px; font-weight: 700; }
.metric-footer { position: relative; z-index: 1; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.live-badge { color: #80e8bd; font-weight: 800; }
.live-badge i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--green); }

.content-grid { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, .7fr); gap: 18px; }
.content-grid.single-column { grid-template-columns: 1fr; }
.runtime-panel { grid-column: 1 / -1; }
.runtime-bars { display: grid; grid-template-columns: 1fr; gap: 9px; margin: 22px 0 16px; }
.runtime-bar { height: 34px; overflow: hidden; border-radius: 7px; background: #0d151c; border: 1px solid var(--line); }
.runtime-bar span { display: block; min-width: 2px; height: 100%; border-radius: inherit; }
.runtime-running span { background: linear-gradient(90deg, #31df4a, #31df4a88); }
.runtime-stopped span { background: linear-gradient(90deg, #ff4438, #ff443888); }
.runtime-fault span { background: linear-gradient(90deg, #f3a83b, #f3a83b88); }
.runtime-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; color: var(--muted); font-size: 12px; }
.runtime-legend span,
.runtime-legend b { display: block; }
.runtime-legend b { margin-top: 4px; color: var(--text); font-size: 18px; }
.runtime-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }
.runtime-dot.running { background: #31df4a; }
.runtime-dot.stopped { background: #ff4438; }
.runtime-dot.fault { background: #f3a83b; }
.panel { padding: 24px; }

body.auth-mode { display: flex; min-height: 100vh; }
body.auth-mode .app-shell { width: 100%; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; }
body.auth-mode #topbar,
body.auth-mode #hero { display: none; }
body.auth-mode .client-layout,
body.auth-mode .client-main { width: 100%; display: flex; justify-content: center; }

.login-screen { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 400px; padding: 24px; }
.login-logo { height: 72px; width: auto; margin-bottom: 36px; }
.login-card { width: 100%; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 14px 40px #00000022; }
.login-card h3 { margin: 0 0 6px; font-size: 22px; }
.login-subtitle { margin: 0 0 26px; color: var(--muted); font-size: 13px; }
.login-form { display: grid; gap: 18px; }
.login-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.input-icon-wrap { position: relative; display: flex; align-items: center; }
.input-icon-wrap .input-icon { position: absolute; left: 13px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.input-icon-wrap input { padding-left: 38px; }
.input-icon-wrap input#password { padding-right: 40px; }
.password-toggle { position: absolute; right: 4px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--muted); border-radius: 6px; padding: 0; }
.password-toggle:hover { color: var(--text); }
.password-toggle svg { width: 17px; height: 17px; }
.primary-button.login-submit { width: 100%; min-height: 48px; border-radius: 999px; background: var(--green); color: #04241a; font-size: 15px; }
#dashboardPanel { padding-bottom: 12px; }
#dashboardPanel .scale-summary { margin-bottom: 0; }
#guidedPanel { margin-top: 18px; }
.panel h3 { margin: 0; font-size: 18px; }
.range-chip { padding: 7px 10px; border: 1px solid #274742; border-radius: 8px; color: var(--cyan); font-size: 9px; font-weight: 850; letter-spacing: .12em; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; color: var(--muted); font-size: 11px; font-weight: 700; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.chart-legend-dot.medium { background: var(--orange); }
.chart-legend-dot.low { background: var(--red); }
.chart-legend-dot.nominal { border-radius: 2px; background: var(--blue); }
.chart-wrap { height: 260px; margin-top: 14px; position: relative; }
#flowChart, #cloudFlowChart, #truckTripYearChart { width: 100%; height: 100%; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.diagnostic-list { margin: 19px 0; }
.diagnostic-list div { display: flex; justify-content: space-between; gap: 15px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.diagnostic-list dt { color: var(--muted); font-size: 12px; }
.diagnostic-list dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; text-align: right; }
.ok-text { color: var(--green); }
.warning-text { color: var(--orange); }
.error-box { padding: 13px; margin-bottom: 14px; border: 1px solid #633333; border-radius: 10px; background: #2a1718; color: #ffaaaa; }
.error-box strong { font-size: 12px; }
.error-box p { margin: 6px 0 0; font-size: 11px; line-height: 1.45; }
.hidden { display: none !important; }

.primary-button, .secondary-button, .danger-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 9px;
  font-weight: 800;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, border-color .12s ease, opacity .12s ease;
}
.primary-button { border: 0; background: var(--cyan); color: #071315; box-shadow: 0 2px 10px #1f8f7e40; }
.secondary-button { width: 100%; border: 1px solid var(--line); background: #17232d; color: var(--text); }
.danger-button { width: auto; border: 1px solid var(--red); background: transparent; color: var(--red); margin-right: auto; }

.primary-button:hover:not(:disabled) { box-shadow: 0 4px 16px #1f8f7e5c; transform: translateY(-1px); }
.secondary-button:hover:not(:disabled) { border-color: var(--cyan); transform: translateY(-1px); }
.danger-button:hover:not(:disabled) { background: var(--red); color: #1a0707; transform: translateY(-1px); }

.primary-button:active:not(:disabled),
.secondary-button:active:not(:disabled),
.danger-button:active:not(:disabled) { transform: translateY(0) scale(.98); box-shadow: none; }

.primary-button:focus-visible,
.secondary-button:focus-visible,
.danger-button:focus-visible,
.icon-button:focus-visible,
.compact-button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

dialog { width: min(900px, calc(100% - 28px)); max-height: 92vh; padding: 0; overflow: hidden; border: 1px solid #344a57; border-radius: 18px; background: #101820; color: var(--text); box-shadow: 0 30px 100px #000c; }
dialog > form { max-height: 92vh; padding: 26px; overflow: auto; }
.asset-edit-dialog {
  width: min(1480px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
}
.asset-edit-dialog > form {
  max-height: calc(100vh - 40px);
  padding: clamp(22px, 2.6vw, 36px);
}
.asset-edit-dialog .form-grid {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
}
.asset-edit-dialog .asset-variable-list {
  grid-template-columns: 1fr;
}
.asset-edit-dialog .asset-variable-row {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}
#passwordDialog,
#adminPasswordDialog,
#resetPasswordDialog { width: min(760px, calc(100% - 28px)); }
#passwordForm,
#adminPasswordForm,
#resetPasswordForm { padding: 30px; }
#passwordForm .form-grid,
#adminPasswordForm .form-grid,
#resetPasswordForm .form-grid { grid-template-columns: 1fr; }
.wide-dialog { width: calc(100% - 24px); height: calc(100% - 24px); max-height: calc(100% - 24px); padding: 26px; overflow: auto; box-sizing: border-box; }

.production-report-trigger { display: flex; justify-content: flex-end; margin: 4px 0 12px; }
.production-report-trigger .secondary-button { width: auto; }
.production-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 16px; }
.production-summary .oee-card { padding: 14px 16px; }
.production-summary .oee-card span:first-child { display: block; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.production-summary .oee-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.production-summary .oee-row div span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.production-summary .oee-row strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 19px; letter-spacing: -.03em; }
.production-summary .oee-row strong.negative { color: var(--red); }
.production-summary .oee-row strong.positive { color: var(--cyan); }
.production-summary-note { display: block; margin-top: 10px; color: var(--orange); font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.ai-summary-note { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; background: var(--panel-alt, #17352c11); border: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--text); }
.production-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.production-toolbar .inline-select input { min-height: 38px; }
.production-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.production-table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.production-table thead th { position: sticky; top: 0; text-align: left; padding: 10px 12px; background: var(--surface-2); color: var(--muted); font-weight: 800; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
.production-table thead th:hover { color: var(--text); }
.production-table tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.production-table tbody td.production-text { font-family: Inter, sans-serif; }
.production-table tbody tr:last-child td { border-bottom: none; }
.production-table input[type="checkbox"] { width: 17px; min-height: 17px; height: 17px; padding: 0; margin: 0; vertical-align: middle; accent-color: var(--cyan); cursor: pointer; }
.production-table .production-empty { font-family: Inter, sans-serif; color: var(--muted); text-align: center; padding: 24px 12px; }
.production-pagination { display: flex; justify-content: center; align-items: center; gap: 14px; padding-top: 14px; color: var(--muted); font-size: 13px; }
.production-yearly-chart { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.production-pagination select { width: auto; min-height: 34px; padding: 4px 8px; }
dialog::backdrop { background: #03070ac9; backdrop-filter: blur(6px); }
#settingsForm, #scaleForm { padding: 26px; overflow: auto; max-height: 92vh; }
.dialog-header { gap: 18px; }
.dialog-header h2 { margin: 0; font-size: clamp(22px, 4vw, 32px); line-height: 1.05; letter-spacing: -.04em; }
.dialog-header > div { min-width: 0; }
.close-button { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px; font-size: 26px; line-height: 1; }
.warning-banner { margin: 22px 0; padding: 14px 16px; border: 1px solid #604822; border-radius: 11px; background: #2b2214; color: #ffd799; }
.warning-banner strong { font-size: 12px; }
.warning-banner p { margin: 5px 0 0; font-size: 11px; line-height: 1.5; }
.compact-warning { margin: 14px 0 0; }
.guided-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.guide-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #0d151c; }
.guide-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.guide-card h4 { margin: 0; font-size: 16px; }
.guide-subtitle { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.guided-record-card { margin-top: 18px; }
.config-subsection { margin-top: 8px; padding-top: 26px; border-top: 1px solid var(--line); }
.config-subsection:first-of-type { margin-top: 22px; padding-top: 0; border-top: 0; }
.config-subsection-head { margin-bottom: 14px; }
.config-subsection-head h4 { margin: 0; font-size: 18px; }
.config-subsection-head .guide-subtitle { margin-top: 5px; }
.production-goals-section-title {
  margin: 22px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
#productionGoalsScheduleFields { margin-top: 4px; }
.schedule-label-field { display: block; margin-bottom: 16px; }
.shifts-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.shift-row { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.shift-row-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.shift-row .shift-name {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}
.shift-remove {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  font-size: 18px;
  line-height: 1;
  color: var(--red);
  border-color: var(--line);
  background: var(--surface);
}
.shift-days-label { display: block; margin-bottom: 6px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.shift-days { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.shift-day-toggle {
  min-width: 42px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
.shift-day-toggle:hover { border-color: var(--cyan); }
.shift-day-toggle.active { border-color: var(--cyan); background: var(--cyan); color: #071315; }
.shift-time-row { display: flex; flex-wrap: wrap; gap: 10px; }
.shift-time-field { flex: 1 1 140px; display: flex; flex-direction: column; gap: 5px; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.shift-time-field input {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
}
.add-shift-button { width: 100%; border-style: dashed; }
#productionGoalsForm .dialog-actions { margin-top: 20px; align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }
#productionGoalsFeedback { color: var(--muted); font-size: 12px; }
.guided-form { margin-top: 16px; }
.record-history { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.record-list { display: grid; gap: 8px; margin-top: 12px; }
.record-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #101a22; }
.record-row.selected { border-color: var(--cyan); background: #102326; }
.record-row strong, .record-row span { display: block; }
.record-row strong { font-size: 12px; }
.record-row span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.record-actions { display: flex; align-items: center; gap: 8px; }
.stop-event-active { display: grid; gap: 5px; margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: #101a22; }
.stop-event-active hr { grid-column: 1 / -1; width: 100%; margin: 5px 0; border: 0; border-top: 1px solid var(--line); }
.stop-event-active strong { font-size: 13px; }
.stop-event-active span { color: var(--muted); font-size: 12px; }
.stop-event-active.active-stop { border-color: #604822; background: #2b2214; color: #ffd799; }
.stop-event-active.active-stop span { color: #946200; }
.stop-event-form { align-items: end; }
.stop-event-pending-notice { margin: 0 0 4px; padding: 10px 14px; border: 1px solid #604822; border-radius: 10px; background: #2b2214; color: #ffd799; font-size: 12px; }
.quality-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.quality-summary div { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #101a22; }
.quality-summary span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.quality-summary strong { display: block; margin-top: 7px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; }
.compact-button { width: auto; min-height: 34px; padding: 0 12px; white-space: nowrap; }
.pending-badge { font-style: normal; font-weight: 800; font-size: 10px; letter-spacing: .04em; color: #d8912b; background: #2b2214; border: 1px solid #604822; border-radius: 999px; padding: 2px 8px; margin-left: 6px; }
.config-list { display: grid; gap: 8px; margin: 15px 0 0; }
.config-list div { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.config-list dt { color: var(--muted); font-size: 11px; }
.config-list dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; text-align: right; }
.checklist { display: grid; gap: 8px; margin-top: 15px; }
.checklist-section { margin: 14px 0 2px; color: var(--cyan); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.checklist-section:first-child { margin-top: 0; }
.check-row { display: grid; grid-template-columns: auto 1fr; align-items: flex-start; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #101a22; color: var(--text); font-size: 12px; line-height: 1.45; }
.check-row input { width: 17px; min-height: 17px; margin-top: 1px; accent-color: var(--cyan); }
.check-row-text { display: flex; flex-direction: column; gap: 4px; }
.check-row-text small { color: var(--muted); font-weight: 400; line-height: 1.5; }
.check-row:has(input:checked) { border-color: #2d5c49; background: #10221f; color: #c9f6df; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-grid .wide { grid-column: span 3; }
label { display: grid; gap: 7px; color: #aab8c1; font-size: 11px; font-weight: 700; }
.toggle-field { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 11px; border: 1px solid #31434e; border-radius: 8px; background: #0c141a; color: var(--text); }
.toggle-field input { width: 17px; min-height: 17px; padding: 0; accent-color: var(--cyan); }
.asset-telemetry-fieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.asset-telemetry-fieldset legend {
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.asset-telemetry-fieldset .toggle-field {
  padding: 10px 11px;
}
.admin-form-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, #13202a 0%, #0f171f 100%);
  overflow: hidden;
}
.admin-form-section-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}
.admin-form-section .asset-telemetry-fieldset {
  border: none;
  border-radius: 0;
  margin: 0;
  padding: 0 14px 14px;
}
.admin-form-section .asset-telemetry-fieldset[hidden] {
  display: none;
}
.fieldset-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
/* .form-grid é um grid de 3 colunas por si só; sem isso, aninhado dentro
   do grid de 3 colunas do .asset-telemetry-fieldset, ele ficava espremido
   em 1/3 da largura e o próprio conteúdo (os campos) estourava essa
   largura, invadindo visualmente a coluna dos parágrafos de ajuda ao
   lado. Aqui ele (e cada parágrafo de ajuda) ocupa a largura inteira do
   fieldset, empilhados um abaixo do outro. */
.asset-telemetry-fieldset > .form-grid,
.asset-telemetry-fieldset > .fieldset-help {
  grid-column: 1 / -1;
}
.sensor-scale-fieldset {
  grid-template-columns: 1fr;
}
.sensor-scale-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) repeat(4, minmax(92px, 1fr));
  gap: 9px;
  align-items: center;
}
.sensor-scale-grid strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.sensor-scale-grid span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}
.sensor-scale-grid input {
  min-height: 38px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.asset-variable-fieldset {
  grid-template-columns: 1fr;
}
.asset-variable-list {
  display: grid;
  gap: 12px;
}
.asset-variable-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101a22;
}
.asset-variable-row label {
  min-width: 0;
}
.asset-variable-row input,
.asset-variable-row select {
  min-height: 38px;
}
.asset-variable-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.asset-variable-actions .toggle-field,
.asset-variable-actions .secondary-button {
  width: auto;
}
.keeper-json-template {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c141a;
}
.keeper-json-template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.keeper-json-template-head strong,
.keeper-json-template-head small {
  display: block;
}
.keeper-json-template-head strong {
  color: var(--text);
  font-size: 13px;
}
.keeper-json-template-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.keeper-json-template pre {
  overflow: auto;
  max-height: 260px;
  margin: 0;
  padding: 12px;
  border: 1px solid #31434e;
  border-radius: 10px;
  background: #071016;
  color: #b9f8ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
}
input, select, textarea { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid #31434e; border-radius: 8px; outline: none; background: #0c141a; color: var(--text); }
textarea { padding-top: 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px #1f8f7e15; }
.register-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 19px; }
.register-grid fieldset:last-child { grid-column: span 2; grid-template-columns: repeat(4, 1fr); }
fieldset { margin: 0; padding: 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 1px solid var(--line); border-radius: 12px; }
legend { padding: 0 7px; color: var(--text); font-size: 12px; font-weight: 850; }
.dialog-actions { justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 22px; }
.dialog-actions .secondary-button { width: auto; }
.form-error { padding: 12px; border-radius: 8px; color: #ffaaaa; background: #2a1718; font-size: 12px; }
.form-success { padding: 12px; border-radius: 8px; color: #99f3c1; background: #10221f; font-size: 12px; }

.admin-grid { display: grid; gap: 16px; }
.admin-customer-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: linear-gradient(145deg, #13202a 0%, #0f171f 100%); }
.admin-add-scale { width: auto; min-height: 34px; }
.admin-table { display: grid; gap: 8px; margin-top: 14px; }
.admin-users { display: grid; gap: 8px; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #0d151c; }
.admin-users-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-users-head strong { color: #c8d5db; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.admin-users-head .secondary-button { width: auto; min-height: 32px; padding: 0 12px; font-size: 12px; }
.admin-user-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.admin-user-row span, .admin-user-row small { display: block; }
.admin-user-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.admin-user-row .secondary-button { width: auto; min-height: 34px; }
.admin-user-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.admin-table-head, .admin-table-row { display: grid; grid-template-columns: 1.4fr .9fr .5fr .8fr 1fr auto; gap: 12px; align-items: center; }
.admin-table-head { padding: 0 10px 6px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.admin-table-row { min-height: 54px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #0d151c; }
.admin-table-row b, .admin-table-row small { display: block; }
.admin-table-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.admin-table-row code { color: var(--cyan); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.admin-table-row .secondary-button { width: auto; min-height: 34px; }
.admin-row-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.admin-empty-row { padding: 14px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 12px; }
.admin-status-badge { display: inline-block; width: fit-content; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 850; letter-spacing: .04em; }
.admin-status-badge.online { background: #173327; color: #85ebb8; }
.admin-status-badge.connected { background: #3a2d19; color: #ffd590; }
.admin-status-badge.offline { background: #361d1f; color: #ffaaaa; }
.ticket-status { display: inline-block; width: fit-content; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 850; letter-spacing: .04em; white-space: nowrap; }
.ticket-status.open { background: #3a2d19; color: #ffd590; }
.ticket-status.in_progress { background: #1a2c40; color: #8ec4ff; }
.ticket-status.resolved,
.ticket-status.closed { background: #173327; color: #85ebb8; }
.ticket-status.warning { background: #3a2d19; color: #ffd590; }
.ticket-status.critical { background: #361d1f; color: #ffaaaa; }
.support-ticket-row { flex-direction: column; align-items: stretch; gap: 10px; }
.support-ticket-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 0; border: none; background: transparent; color: inherit; text-align: left; }
.support-ticket-thread { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.support-ticket-message { padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #0d151c; }
.support-ticket-message.admin { border-color: #2d5c49; background: #10221f; }
.support-ticket-message strong { display: inline-block; font-size: 12px; }
.support-ticket-message span { margin-left: 8px; color: var(--muted); font-size: 10px; }
.support-ticket-message p { margin: 6px 0 0; font-size: 12px; line-height: 1.5; }
.support-ticket-reply-form { display: grid; gap: 8px; }
.support-ticket-reply-form textarea { width: 100%; resize: vertical; }
.support-ticket-reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.support-ticket-reply-actions .secondary-button { width: auto; min-height: 34px; }
.support-ticket-status-select { min-height: 34px; }
.system-health-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.system-health-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #0d151c; }
.system-health-card.wide { grid-column: span 2; }
.system-health-card.ok { border-color: #2d5c49; background: #10221f; }
.system-health-card.danger { border-color: #633333; background: #2a1718; }
.system-health-card span { display: block; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.system-health-card strong { display: block; margin: 8px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(22px, 3vw, 32px); letter-spacing: -.06em; }
.system-health-card small { display: block; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; line-height: 1.4; }
.health-alert { display: grid; gap: 4px; margin-top: 14px; padding: 13px 14px; border: 1px solid #633333; border-radius: 12px; background: #2a1718; color: #ffaaaa; }
.health-alert strong { font-size: 12px; }
.health-alert span { font-size: 11px; line-height: 1.45; }

.report-body { background: #e7edf1; color: #14202a; }
.report-page { width: min(1180px, 100%); margin: 0 auto; padding: 24px; }
.report-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 18px; border: 1px solid #c9d3db; border-radius: 16px; background: #101820; color: var(--text); }
.report-sheet { min-height: 900px; padding: 34px; border: 1px solid #c8d2da; border-radius: 18px; background: #fff; box-shadow: 0 18px 60px #12202a22; }
.report-loading { padding: 22px; color: #65737e; }
.report-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid #17232d; }
.report-logo { display: block; width: 190px; max-width: 60vw; height: auto; margin: 0 0 16px; }
.report-header h2 { margin: 0; color: #101820; font-size: 30px; letter-spacing: -.04em; }
.report-header-side { display: grid; justify-items: end; gap: 8px; color: #61707b; font-size: 11px; font-weight: 800; }
.report-muted { margin: 8px 0 0; color: #61707b; }
.report-status { min-width: 130px; padding: 9px 12px; border-radius: 999px; background: #e8f5ee; color: #137144; text-align: center; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.report-status.pending { background: #fff2d8; color: #925d00; }
.report-status.rejected { background: #ffe1e1; color: #a83232; }
.report-status.draft { background: #e8eef3; color: #516270; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.report-card { break-inside: avoid; padding: 18px; border: 1px solid #d6e0e7; border-radius: 14px; background: #fbfdfe; }
.report-card h3 { margin: 0 0 14px; color: #101820; font-size: 16px; }
.report-list { display: grid; gap: 8px; margin: 0; }
.report-list div { display: grid; grid-template-columns: minmax(130px, .75fr) minmax(0, 1fr); gap: 12px; padding-bottom: 8px; border-bottom: 1px solid #e2e9ee; }
.report-list dt { color: #667580; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.report-list dd { margin: 0; color: #182733; font-size: 12px; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.compact-report-list { margin-top: 12px; }
.report-checklist { display: grid; gap: 8px; }
.report-check-row { display: grid; grid-template-columns: 24px 1fr; gap: 9px; align-items: flex-start; padding: 9px; border: 1px solid #e0e8ee; border-radius: 10px; background: #fff; color: #42515d; font-size: 12px; line-height: 1.4; }
.report-check-row strong { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #eef3f6; color: #788793; font-size: 12px; }
.report-check-row.checked { border-color: #bce7d0; background: #f2fbf6; color: #172b22; }
.report-check-row.checked strong { background: #1c8f58; color: #fff; }
.report-notes { min-height: 80px; margin: 0; white-space: pre-wrap; color: #243541; font-size: 13px; line-height: 1.55; }
.report-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 54px; }
.report-signatures span { display: block; height: 1px; margin-bottom: 10px; background: #17232d; }
.report-signatures strong { color: #243541; font-size: 12px; }
.report-signatures small { display: block; margin-top: 4px; color: #667580; font-size: 10px; }

/* Tema claro (opcional, ligado via [data-theme="light"] no <html>) */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f8fb;
  --surface: #ffffff;
  --surface-2: #edf4f7;
  --line: #d7e4eb;
  --text: #12202a;
  --muted: #617482;
  --cyan: #1f8f7e;
  --blue: #2478d4;
  --orange: #b96b00;
  --red: #c93434;
  --green: #38d0b5;
}

[data-theme="light"] body {
  background: radial-gradient(circle at 74% -18%, #d9f7f4 0, transparent 34%), var(--bg);
  color: var(--text);
}
[data-theme="light"] .client-nav-button:hover {
  background: #ffffff70;
}
[data-theme="light"] .client-nav-button.active {
  border-color: #64d5cf;
  background: #e7fbf8;
  box-shadow: inset 0 0 0 1px #1f8f7e28;
}

[data-theme="light"] .topbar { border-bottom-color: var(--line); }
[data-theme="light"] .brand h1,
[data-theme="light"] .hero h2,
[data-theme="light"] .panel h3,
[data-theme="light"] .guide-card h4,
[data-theme="light"] .dialog-header h2 { color: var(--text); }
[data-theme="light"] .eyebrow,
[data-theme="light"] .section-kicker { color: var(--cyan); }

[data-theme="light"] .connection-pill {
  border-color: #bce5d2;
  background: #edfdf5;
  color: #106c41;
}
[data-theme="light"] .connection-pill.offline {
  border-color: #f3c8c8;
  background: #fff1f1;
  color: #9f2626;
}
[data-theme="light"] .connection-pill.stale {
  border-color: #f1d9ab;
  background: #fff7e8;
  color: #8c5600;
}

[data-theme="light"] .icon-button,
[data-theme="light"] .close-button,
[data-theme="light"] .secondary-button {
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}
[data-theme="light"] .secondary-button:hover,
[data-theme="light"] .icon-button:hover,
[data-theme="light"] .close-button:hover { background: #eef6f8; }
[data-theme="light"] .primary-button {
  background: var(--cyan);
  color: #ffffff;
}

[data-theme="light"] .metric-card,
[data-theme="light"] .panel,
[data-theme="light"] .scale-card,
[data-theme="light"] .oee-card,
[data-theme="light"] .system-health-card,
[data-theme="light"] .asset-status-panel,
[data-theme="light"] .asset-telemetry-card,
[data-theme="light"] .truck-log-card,
[data-theme="light"] .admin-customer-card,
[data-theme="light"] .admin-form-section {
  border-color: var(--line);
  background: linear-gradient(145deg, #ffffff 0%, #f8fbfd 100%);
  box-shadow: 0 14px 34px #19313f14;
}
[data-theme="light"] .system-health-card.ok {
  border-color: #bce5d2;
  background: linear-gradient(145deg, #f1fff8 0%, #ffffff 100%);
}
[data-theme="light"] .system-health-card.danger,
[data-theme="light"] .health-alert {
  border-color: #efc5c5;
  background: #fff0f0;
  color: #a32323;
}
[data-theme="light"] .asset-telemetry-card span,
[data-theme="light"] .asset-fault-state,
[data-theme="light"] .asset-emergency-state { color: var(--text); }
[data-theme="light"] .runtime-bar { background: #eef5f8; }
[data-theme="light"] .scale-card.connected {
  border-color: #e6c98f;
  background: linear-gradient(145deg, #fff8eb 0%, #ffffff 100%);
}
[data-theme="light"] .scale-card.offline {
  border-color: #efc5c5;
  background: linear-gradient(145deg, #fff2f2 0%, #ffffff 100%);
}
[data-theme="light"] .scale-select-card.selected {
  border-color: var(--cyan);
  box-shadow: inset 0 0 0 1px #1f8f7e40, 0 14px 34px #19313f14;
}
[data-theme="light"] .scale-select-card:hover { border-color: #63bbb6; }
[data-theme="light"] .scale-card-head em {
  background: #e8f8f0;
  color: #38d0b5;
}
[data-theme="light"] .scale-card.connected .scale-card-head em {
  background: #fff0cf;
  color: #8c5600;
}
[data-theme="light"] .scale-card.offline .scale-card-head em {
  background: #ffe5e5;
  color: #b12b2b;
}
[data-theme="light"] .equipment-icon {
  background: #e8f8f0;
  color: #38d0b5;
}
[data-theme="light"] .scale-card.connected .equipment-icon,
[data-theme="light"] .admin-table-identity.connected .equipment-icon {
  background: #fff0cf;
  color: #8c5600;
}
[data-theme="light"] .scale-card.offline .equipment-icon,
[data-theme="light"] .admin-table-identity.offline .equipment-icon {
  background: #ffe5e5;
  color: #b12b2b;
}
[data-theme="light"] .asset-illustration.online .equipment-icon-large {
  background: #e8f8f0;
  color: #38d0b5;
}
[data-theme="light"] .asset-illustration.connected .equipment-icon-large {
  background: #fff0cf;
  color: #8c5600;
}
[data-theme="light"] .asset-illustration.offline .equipment-icon-large {
  background: #ffe5e5;
  color: #b12b2b;
}
[data-theme="light"] .scale-error { color: #b12b2b; }
[data-theme="light"] .scale-ok,
[data-theme="light"] .ok-text,
[data-theme="light"] .live-badge { color: var(--green); }
[data-theme="light"] .warning-text { color: var(--orange); }

[data-theme="light"] .card-heading p,
[data-theme="light"] .admin-users-head strong {
  color: #314755;
}
[data-theme="light"] .metric-footer,
[data-theme="light"] .scale-card-values div,
[data-theme="light"] .diagnostic-list div,
[data-theme="light"] .config-list div,
[data-theme="light"] .record-history,
[data-theme="light"] .admin-user-row {
  border-color: var(--line);
}
[data-theme="light"] .flow-icon { color: var(--cyan); background: #e6f8f6; }
[data-theme="light"] .total-icon { color: var(--blue); background: #eaf3ff; }
[data-theme="light"] .range-chip {
  border-color: #bce5e1;
  background: #f0fbfa;
  color: var(--cyan);
}

[data-theme="light"] .guide-card,
[data-theme="light"] .record-row,
[data-theme="light"] .stop-event-active,
[data-theme="light"] .quality-summary div,
[data-theme="light"] .admin-users,
[data-theme="light"] .admin-table-row,
[data-theme="light"] .check-row,
[data-theme="light"] .support-ticket-message {
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}
[data-theme="light"] .support-ticket-message.admin {
  border-color: #bce5d2;
  background: #edfdf5;
}
[data-theme="light"] .record-row.selected {
  border-color: var(--cyan);
  background: #effbf9;
}
[data-theme="light"] .stop-event-active.active-stop {
  border-color: #f1d9ab;
  background: #fff7e8;
  color: #7a4b00;
}
[data-theme="light"] .stop-event-active.active-stop span { color: #8c5600; }
[data-theme="light"] .stop-event-pending-notice { border-color: #f1d9ab; background: #fff7e8; color: #7a4b00; }
[data-theme="light"] .check-row:has(input:checked) {
  border-color: #bce5d2;
  background: #edfdf5;
  color: #173c2b;
}

[data-theme="light"] dialog {
  border-color: #c8dae3;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 30px 100px #0f24364a;
}
[data-theme="light"] dialog::backdrop {
  background: #10202b85;
  backdrop-filter: blur(6px);
}
[data-theme="light"] label { color: #536875; }
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea,
[data-theme="light"] .toggle-field,
[data-theme="light"] .shift-multiselect-trigger {
  border-color: #c9d9e2;
  background: #ffffff;
  color: var(--text);
}
[data-theme="light"] .asset-telemetry-fieldset {
  border-color: var(--line);
}
[data-theme="light"] .asset-telemetry-fieldset .toggle-field {
  border-color: #c9d9e2;
  background: #ffffff;
}
[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px #1f8f7e20;
}

[data-theme="light"] .warning-banner {
  border-color: #e8cd94;
  background: #fff8e9;
  color: #7b5000;
}
[data-theme="light"] .error-box,
[data-theme="light"] .form-error {
  border-color: #efc5c5;
  background: #fff0f0;
  color: #a32323;
}
[data-theme="light"] .form-success {
  background: #eaf9f1;
  color: #116b41;
}
[data-theme="light"] .admin-status-badge.online { background: #e8f8f0; color: #38d0b5; }
[data-theme="light"] .admin-status-badge.connected { background: #fff0cf; color: #8c5600; }
[data-theme="light"] .admin-status-badge.offline { background: #ffe5e5; color: #b12b2b; }
[data-theme="light"] .ticket-status.open { background: #fff0cf; color: #8c5600; }
[data-theme="light"] .ticket-status.in_progress { background: #eaf3ff; color: #1d5fb0; }
[data-theme="light"] .ticket-status.resolved,
[data-theme="light"] .ticket-status.closed { background: #e8f8f0; color: #38d0b5; }
[data-theme="light"] .ticket-status.warning { background: #fff0cf; color: #8c5600; }
[data-theme="light"] .ticket-status.critical { background: #ffe5e5; color: #b12b2b; }

[data-theme="light"] .report-toolbar {
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}

@media (min-width: 1800px) {
  .app-shell { width: min(1920px, 100%); }
  .client-layout.logged-in {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 32px;
  }
  .client-sidebar { padding: 20px; }
  .scale-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metric-card { min-height: 300px; }
  .asset-telemetry-card { min-height: 220px; padding: 36px; }
  .asset-telemetry-card strong { font-size: clamp(40px, 3vw, 60px); }
  .chart-wrap { height: 360px; }
}

@media (max-width: 1500px) {
  .client-layout.logged-in {
    grid-template-columns: minmax(204px, 220px) minmax(0, 1fr);
    gap: 18px;
  }
  .client-sidebar { padding: 14px; }
  .client-nav-button { padding: 12px 10px; }
  .scale-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-dashboard { grid-template-columns: 1fr; }
  .asset-status-panel { min-height: auto; }
}

@media (max-width: 1180px) {
  .client-layout.logged-in { display: block; }
  .client-sidebar {
    position: static;
    margin: 18px 0 0;
    padding: 12px;
  }
  .client-sidebar-fill { display: block; min-height: auto; }
  .client-sidebar-fill .client-sync-card { margin-top: 18px; }
  .client-sidebar-title { display: none; }
  .client-sidebar.collapsed { width: auto; }
  .client-sidebar.collapsed .client-nav-text,
  .client-sidebar.collapsed .client-sync-card-label,
  .client-sidebar.collapsed .client-sync-card-row,
  .client-sidebar.collapsed .client-sync-card small { display: revert; }
  .client-nav {
    display: flex;
    gap: 8px;
    margin-top: 0;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .client-nav-button {
    flex: 0 0 178px;
    min-height: 66px;
  }
  .content-grid { grid-template-columns: 1fr; }
  .metrics-grid,
  .guided-grid,
  .report-grid { grid-template-columns: 1fr; }
  .system-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .app-shell { padding: 0 18px 30px; }
  .client-layout.logged-in { display: block; }
  .client-sidebar {
    position: static;
    margin: 18px 0 0;
    padding: 12px;
  }
  .client-sidebar-title { display: none; }
  .client-nav {
    display: flex;
    gap: 8px;
    margin-top: 0;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .client-nav-button {
    flex: 0 0 168px;
    min-height: 66px;
  }
  .hero { align-items: flex-start; flex-direction: column; padding-top: 34px; }
  .last-update { text-align: left; }
  .metrics-grid, .asset-dashboard, .content-grid, .scale-summary, .guided-grid, .report-grid { grid-template-columns: 1fr; }
  .asset-telemetry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .runtime-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .system-health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .asset-edit-dialog .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .wide { grid-column: span 2; }
  .sensor-scale-grid { grid-template-columns: 1fr 1fr; }
  .sensor-scale-grid strong { display: none; }
  .sensor-scale-grid span { grid-column: span 2; margin-top: 10px; }
  .asset-variable-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-edit-dialog .asset-variable-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .topbar {
    height: auto;
    min-height: 80px;
    padding: 16px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .top-actions .secondary-button {
    flex: 1 1 120px;
  }
  .brand { gap: 10px; }
  .brand-logo { width: 104px; max-width: 38vw; }
  .brand .eyebrow { display: none; }
  .brand h1 { font-size: 15px; }
  .connection-pill {
    justify-content: center;
    min-width: auto;
    flex: 1 1 100%;
  }
  .account-menu-panel {
    left: 0;
    right: auto;
    width: min(220px, calc(100vw - 48px));
  }
  .client-sidebar:not(.hidden),
  #adminSidebar.client-sidebar:not(.hidden),
  #clientSidebar.client-sidebar:not(.hidden) {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    margin: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 -8px 24px #00000022;
  }
  .client-nav {
    display: flex;
    gap: 2px;
    margin-top: 0;
    overflow-x: auto;
    padding-bottom: 0;
  }
  .client-nav-button {
    flex: 1 1 0;
    min-height: auto;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    border-left: none;
    text-align: center;
  }
  .client-nav-icon { width: 22px; height: 22px; }
  .client-nav-text { text-align: center; }
  .client-nav-button span { font-size: 10px; font-weight: 800; }
  .client-nav-button small { display: none; }
  .client-main {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }
  /* Nesta largura a barra lateral vira uma barra de abas fixa no rodapé -
     não há espaço pro card de Sincronismo IoT nem sentido no botão de
     recolher (não existe conceito de "recolher" numa barra de abas). */
  .client-sync-card { display: none; }
  .quality-summary { grid-template-columns: 1fr; }
  .metric-card { min-height: 230px; padding: 21px; }
  .asset-telemetry-grid { grid-template-columns: 1fr; }
  .asset-status-panel { min-height: auto; }
  .runtime-legend { grid-template-columns: 1fr; }
  .oee-grid { grid-template-columns: 1fr; }
  .system-health-grid { grid-template-columns: 1fr; }
  .system-health-card.wide { grid-column: auto; }
  .scale-card-values { grid-template-columns: 1fr; }
  .admin-table-head { display: none; }
  .admin-table-row { grid-template-columns: 1fr; }
  .form-grid, .register-grid, fieldset, .register-grid fieldset:last-child, .sensor-scale-grid, .asset-variable-row { grid-template-columns: 1fr; }
  .asset-edit-dialog .form-grid,
  .asset-edit-dialog .asset-variable-row { grid-template-columns: 1fr; }
  .record-row, .record-actions { align-items: stretch; flex-direction: column; }
  .register-grid fieldset:last-child { grid-column: auto; }
  .form-grid .wide, .sensor-scale-grid span { grid-column: auto; }
}

@media (max-width: 380px) {
  .app-shell { padding: 0 12px 26px; }
  .brand-logo { width: 94px; }
  .brand h1 { font-size: 14px; }
  .hero h2 { font-size: 30px; }
  .panel,
  .metric-card,
  .scale-card,
  .asset-status-panel,
  .asset-telemetry-card { border-radius: 14px; }
  .metric-value strong { font-size: 40px; }
  .asset-telemetry-card { padding: 22px; }
  .asset-telemetry-card strong { font-size: 34px; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .report-page { width: 100%; padding: 0; }
  .report-sheet { min-height: auto; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .report-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
  .report-card { padding: 12px; }
  .report-header h2 { font-size: 24px; }
  .report-list div { grid-template-columns: .8fr 1fr; }
  .report-check-row { padding: 7px; font-size: 10.5px; }
  .report-signatures { margin-top: 36px; }
}

@media (max-width: 700px) {
  .truck-log-runtime-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

#stopReportSummaryCards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  #stopReportSummaryCards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #stopReportReasons { grid-template-columns: 1fr; }
}

/* Suporte: conversa no estilo WhatsApp, ocupando toda a largura do quadro. As
   cores são fixas, iguais nos temas claro e escuro. */
.support-ticket-thread.support-chat {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: none;
  margin: 6px 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d1d7db;
  border-radius: 12px;
  background: #efeae2;
}
.support-chat-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #008069; color: #ffffff; }
.support-chat-header .support-chat-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: #d9fdd3; color: #075e54; font-weight: 800; }
.support-chat-title { display: grid; min-width: 0; }
.support-chat-header .support-chat-title strong { color: #ffffff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.support-chat-header .support-chat-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d3efe8; font-size: 12px; }
.support-chat-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 220px;
  max-height: 55vh;
  padding: 12px 12px 8px;
  overflow-y: auto;
  background-color: #efeae2;
  background-image: radial-gradient(#00000009 1px, transparent 1px);
  background-size: 14px 14px;
}
.support-chat-day { align-self: center; margin: 6px 0; }
.support-chat-day span { padding: 4px 10px; border-radius: 8px; background: #ffffffd9; color: #54656f; font-size: 11px; font-weight: 600; box-shadow: 0 1px 1px #0000001a; }
.support-ticket-thread.support-chat .support-ticket-message {
  position: relative;
  max-width: min(82%, 640px);
  padding: 6px 9px 6px;
  border: none;
  border-radius: 9px;
  background: #ffffff;
  color: #111b21;
  box-shadow: 0 1px 1px #0000001f;
}
.support-ticket-thread.support-chat .support-ticket-message.mine { align-self: flex-end; border-top-right-radius: 2px; background: #d9fdd3; }
.support-ticket-thread.support-chat .support-ticket-message.theirs { align-self: flex-start; border-top-left-radius: 2px; }
.support-ticket-thread.support-chat .support-ticket-message p { margin: 0; padding-right: 44px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.support-ticket-thread.support-chat .support-chat-author { display: block; margin-bottom: 2px; color: #06846f; font-size: 12px; font-weight: 700; }
.support-ticket-thread.support-chat .support-chat-time { position: absolute; right: 8px; bottom: 4px; margin: 0; color: #667781; font-size: 10px; }
.support-chat-composer { display: grid; gap: 6px; padding: 8px 10px 10px; background: #f0f2f5; }
.support-chat-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #54656f; font-size: 11px; font-weight: 700; }
.support-chat-status select { width: auto; min-height: 30px; padding: 0 8px; border: 1px solid #d1d7db; border-radius: 8px; background: #ffffff; color: #111b21; font-size: 12px; }
.support-chat-input-row { display: flex; align-items: flex-end; gap: 8px; }
.support-chat-input-row textarea {
  flex: 1;
  min-height: 42px;
  max-height: 110px;
  padding: 11px 14px;
  border: none;
  border-radius: 22px;
  background: #ffffff;
  color: #111b21;
  font: inherit;
  font-size: 14px;
  resize: none;
}
.support-chat-input-row textarea::placeholder { color: #667781; }
.support-chat-composer .support-chat-send { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; border: none; border-radius: 50%; background: #00a884; color: #ffffff; cursor: pointer; }
.support-chat-composer .support-chat-send:hover { background: #019a7a; }

/* Suporte (cliente): janela de tamanho próprio, formulário alinhado e lista de chamados separada. */
dialog.support-dialog { width: min(720px, calc(100% - 24px)); height: auto; max-height: 92vh; padding: 28px; overflow: auto; box-sizing: border-box; }
.support-dialog .dialog-header { align-items: flex-start; margin-bottom: 18px; }
dialog.support-dialog > form { max-height: none; padding: 0; overflow: visible; }
.support-dialog-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.support-form { display: grid; gap: 14px; }
.support-form-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
.support-form label { display: grid; gap: 7px; }
.support-form label small { color: var(--muted); font-weight: 600; }
.support-form input, .support-form select { width: 100%; min-height: 44px; box-sizing: border-box; }
.support-form textarea { width: 100%; min-height: 110px; box-sizing: border-box; resize: vertical; }
.support-form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.support-form-actions .secondary-button, .support-form-actions .primary-button { width: auto; min-width: 120px; }
.support-tickets { display: grid; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.support-tickets .section-kicker { margin: 0; }
@media (max-width: 620px) {
  .support-form-row { grid-template-columns: 1fr; }
  .support-form-actions { flex-direction: column-reverse; }
  .support-form-actions .secondary-button, .support-form-actions .primary-button { width: 100%; }
}

/* Aviso de chamado sem resposta no botão Suporte do Admin. */
.client-nav-button { position: relative; }
.nav-alert-badge { margin-left: auto; min-width: 22px; padding: 2px 7px; border-radius: 999px; background: #e5484d; color: #ffffff; font-size: 12px; font-weight: 800; text-align: center; }
.client-nav-button.has-alert { animation: support-alert-pulse 1.6s ease-in-out infinite; }
@keyframes support-alert-pulse {
  0%, 100% { box-shadow: 0 0 0 0 #e5484d00; }
  50% { box-shadow: 0 0 0 4px #e5484d55; }
}
@media (prefers-reduced-motion: reduce) {
  .client-nav-button.has-alert { animation: none; box-shadow: 0 0 0 2px #e5484d88; }
}
.support-ticket-row.needs-reply { border-color: #e5484d88; }

/* Filtro de período (popover com opções e Aplicar). */
.period-filter { position: relative; }
.period-trigger { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: #ffffff; color: #12202a; font-size: 16px; font-weight: 800; cursor: pointer; }
.period-caret { font-size: 12px; }
.period-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: min(300px, calc(100vw - 32px)); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #ffffff; color: #111827; box-shadow: 0 18px 50px #0f172a30; }
.period-options { display: grid; padding: 8px 0; }
.period-option { display: flex; align-items: center; gap: 16px; padding: 12px 24px; color: #111827; font-size: 17px; font-weight: 800; cursor: pointer; }
.period-option:hover { background: #f3f6f8; }
.period-option input[type="radio"] { width: 22px; height: 22px; min-height: 22px; margin: 0; padding: 0; accent-color: #2f6df6; }
.period-custom { display: grid; gap: 10px; padding: 4px 24px 14px; }
.period-custom label { display: grid; gap: 6px; color: #475569; font-size: 12px; font-weight: 700; }
.period-custom input { width: 100%; min-height: 40px; box-sizing: border-box; }
.period-footer { display: flex; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid #e5eaee; }
.period-footer .secondary-button, .period-footer .primary-button { width: auto; min-width: 96px; }
.period-option span { color: #111827; }

/* Estado no card do ativo: verde quando em operação (Ligado/Descarregando),
   vermelho quando parado. */
.scale-card-values b.run-state.on { color: var(--green); }
.scale-card-values b.run-state.off { color: var(--red); }

/* Estado (Descarregando/Parado) no cabeçalho do card de Apontamento. */
.truck-log-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.truck-log-state { font-size: 15px; letter-spacing: .04em; text-transform: none; }
.truck-log-state.on { color: var(--green); }
.truck-log-state.off { color: var(--red); }

/* Responsivo (celular): popover do período alinhado à esquerda (o botão fica à
   esquerda e o painel saía da tela), título do painel com o seletor de ativo
   embaixo, cartões de resumo dos relatórios em uma coluna. */
@media (max-width: 700px) {
  .period-panel { left: 0; right: auto; }
  .panel-title { flex-wrap: wrap; gap: 12px; }
  .panel-title .compact-select { width: 100%; }
  .panel-title .compact-select select { width: 100%; }
  .guide-card-head { flex-wrap: wrap; gap: 10px; }
  .production-summary { grid-template-columns: 1fr; }
}

/* Sensor de presença possivelmente travado (apontamento). */
.scale-card-values b.run-state.warn { color: var(--orange); }
.truck-log-state.warn { color: var(--orange); }
.truck-log-note { margin: 12px 0 0; color: var(--orange); font-size: 13px; font-weight: 700; }

/* Painel do cliente: cabeçalho fixo, contagem de dispositivos, notificações,
   perfil do usuário, barra lateral recolhível, card de sincronismo IoT e
   cabeçalho de página fixo com Ao vivo/Hoje/Sincronizar. */
.admin-topbar, .client-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}
.client-device-count {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text);
}
.client-notify-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
}
.client-notify-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.client-notify-button:hover { color: var(--text); }
.client-notify-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--red);
  color: #2a0a0a;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 15px;
  text-align: center;
}
.client-brand-customer {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cyan);
}
.client-profile { display: flex; align-items: center; gap: 10px; padding: 0 2px; }
.client-profile-info { display: flex; flex-direction: column; text-align: right; line-height: 1.2; }
.client-profile-info strong { font-size: 13px; color: var(--text); }
.client-profile-info small { font-size: 10.5px; color: var(--muted); }
.client-profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--cyan) 0%, #16665a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  flex: 0 0 auto;
}

.client-sidebar-toggle {
  position: absolute;
  top: 14px;
  right: -13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px #00000030;
}
.client-sidebar-toggle svg { width: 12px; height: 12px; fill: none; stroke: var(--muted); stroke-width: 2.4; transition: transform .18s ease; }
/* O recolhimento do menu só existe no layout de barra lateral (desktop); em telas menores a navegação é horizontal e a preferência salva não pode afetá-la. */
@media (min-width: 1181px) {
  .client-layout.logged-in.sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .client-sidebar.collapsed { width: 76px; padding-left: 10px; padding-right: 10px; }
  .client-sidebar.collapsed .client-sidebar-title,
  .client-sidebar.collapsed .client-nav-text,
  .client-sidebar.collapsed .client-sync-card-label,
  .client-sidebar.collapsed .client-sync-card-row,
  .client-sidebar.collapsed .client-sync-card small { display: none; }
  .client-sidebar.collapsed .client-nav-button { justify-content: center; gap: 0; padding: 13px 0; }
  .client-sidebar.collapsed .client-sidebar-toggle svg { transform: rotate(180deg); }
}

.client-sync-card {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: 0 14px 34px #00000018;
}
.client-sync-card-label { display: block; margin-bottom: 8px; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.client-sync-card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.client-sync-card-row strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; color: var(--text); }
.client-sync-card-row svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--cyan); stroke-width: 2; }
.client-sync-card small { display: block; margin-top: 6px; font-size: 10.5px; color: var(--muted); }

.client-page-header {
  position: sticky;
  top: 92px;
  z-index: 15;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  padding: 14px 0 20px;
  margin: 0;
}
.client-page-header-row { width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.client-page-header-subtitle { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.period-trigger-icon { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: #617482; stroke-width: 2; }
.client-live-indicator { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--cyan); }
.client-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); }
.client-sync-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--cyan) 0%, #16665a 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 24px #1f8f7e33;
}
.client-sync-button svg { width: 14px; height: 14px; fill: none; stroke: #ffffff; stroke-width: 2.2; }
.client-sync-button.spinning svg { animation: client-sync-spin .6s linear; }
@keyframes client-sync-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* KPIs do cliente reaproveitam o estilo dos KPIs do Admin (.admin-kpi-row/
   .admin-kpi-card), com as variantes de cor do ícone recalculadas a partir
   dos tokens de tema para funcionarem no modo escuro (padrão do cliente) e
   no modo claro. */
/* O painel de visão geral do cliente não deve parecer um card único
   envolvendo os KPIs e a lista de ativos (cada KPI e cada ativo já tem seu
   próprio card) - remove o card externo do .panel só aqui. */
.client-overview-panel { padding: 0; border: none; background: none; box-shadow: none; display: flex; flex-direction: column; gap: 18px; }
#clientKpiRow { margin-bottom: 0; }

/* Rodapé dos cards de ativo: última leitura + chamada para a telemetria
   detalhada (o card inteiro já é clicável). */
.asset-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.asset-card-footer-time { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 700; }
.asset-card-footer-time svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; flex: 0 0 auto; }
.asset-card-cta { display: inline-flex; align-items: center; gap: 4px; color: var(--cyan); font-weight: 800; }
.asset-card-cta svg { width: 12px; height: 12px; fill: none; stroke: var(--cyan); stroke-width: 2.4; }
.scale-select-card:hover .asset-card-cta { text-decoration: underline; }
.scale-select-card:hover { box-shadow: 0 18px 40px #00000030; }

@media (max-width: 900px) {
  .client-page-header { position: static; backdrop-filter: none; }
}

/* Abaixo de 1180px a barra lateral vira uma faixa de navegação horizontal
   (ou, abaixo de 560px, uma barra de abas fixa no rodapé) - "recolher" não
   faz sentido nesses layouts, então o botão some. Fica depois da regra base
   do botão (acima) de propósito: com a mesma especificidade, a declaração
   que vem depois no arquivo é que vale. */
@media (max-width: 1180px) {
  .client-sidebar-toggle { display: none; }
  #adminSidebar.client-sidebar,
  #clientSidebar.client-sidebar {
    top: auto;
    margin-top: 18px;
  }
}

/* Tela de telemetria do ativo selecionado: badge de alerta de parada,
   seletor de ativo no cabeçalho, botão de exportar relatório, pills de
   status nos cards de tempo e grupo de botões do período do histórico. */
.client-page-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.client-alert-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff3e0;
  color: #8c5600;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.client-asset-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.client-asset-switcher select {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  outline: none;
}
.client-export-button { width: auto; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; }
.client-export-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

.oee-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.oee-state-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e8f8f0;
  color: #16665a;
  font-size: 10px;
  font-weight: 850;
  font-style: normal;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.oee-state-pill.warn { background: #fff3e0; color: #8c5600; }

.range-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.range-toggle-button {
  border: none;
  background: transparent;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.range-toggle-button.active { background: var(--cyan); color: #ffffff; }

/* Tela de Paradas: badge de eventos em andamento, alarme ativo com ícone
   e cronômetro, ações do formulário, filtro Todos/Pendentes/Justificados
   e rodapé de métricas. */
.stop-title-badges { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stop-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #2b2214;
  color: #ffd799;
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
}
.stop-active-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #d8912b; }
[data-theme="light"] .stop-active-badge { background: #fff3e0; color: #8c5600; }
[data-theme="light"] .stop-active-badge::before { background: #d3821b; }

.stop-alarm-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.stop-alarm-item + .stop-alarm-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.stop-alarm-body { display: flex; gap: 12px; min-width: 0; }
.stop-alarm-icon { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; background: #604822; color: #ffd799; display: flex; align-items: center; justify-content: center; }
[data-theme="light"] .stop-alarm-icon { background: #fce3ba; color: #8c5600; }
.stop-alarm-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.stop-alarm-timer { flex: 0 0 auto; text-align: right; padding: 8px 14px; border-radius: 10px; background: #2b221488; border: 1px solid #604822; }
[data-theme="light"] .stop-alarm-timer { background: #ffffffb0; border-color: #f1c98a; }
.stop-alarm-timer span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.stop-alarm-timer strong { display: block; margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; }

.stop-form-actions { display: flex; align-items: center; gap: 16px; padding-top: 4px; }
.stop-form-actions .primary-button { width: auto; }
.link-button { border: none; background: transparent; padding: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.link-button:hover { color: var(--text); text-decoration: underline; }

.stop-list-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.stop-list-title { margin: 0; font-size: 15px; color: var(--text); }
.stop-filter-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.stop-filter-tab { border: none; background: transparent; padding: 7px 13px; border-radius: 8px; font-size: 11.5px; font-weight: 800; color: var(--muted); }
.stop-filter-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 6px #00000022; }

.stop-footer-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.stop-footer-metric { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.stop-footer-metric span { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.stop-footer-metric strong { display: block; margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; color: var(--text); }

/* Alertas de parada não resolvida piscam (mesma animação já usada no
   item "Suporte" da barra lateral pra resposta não lida) até o evento
   ser justificado - nesse ponto o elemento correspondente some do DOM
   (badge escondida, "pendente" vira o motivo real), então a piscada para
   sozinha, sem precisar de lógica extra pra "desligar" a animação. */
.client-alert-badge,
.stop-active-badge,
.stop-alarm-icon,
.pending-badge {
  animation: stop-alert-pulse 1.6s ease-in-out infinite;
}
@keyframes stop-alert-pulse {
  0%, 100% { box-shadow: 0 0 0 0 #d8912b00; }
  50% { box-shadow: 0 0 0 4px #d8912b55; }
}
@media (prefers-reduced-motion: reduce) {
  .client-alert-badge,
  .stop-active-badge,
  .stop-alarm-icon,
  .pending-badge {
    animation: none;
    box-shadow: 0 0 0 2px #d8912b88;
  }
}

/* Módulo de Manutenção (painel do cliente) */
#maintenancePanel .admin-kpi-row { margin-bottom: 16px; }
.maint-hourmeter { display: flex; flex-direction: column; margin-left: auto; text-align: right; }
.maint-hourmeter small { color: var(--muted); font-size: 10.5px; font-weight: 800; text-transform: uppercase; }
.maint-hourmeter strong { font-size: 18px; }
.maint-form-title { grid-column: 1 / -1; font-size: 14px; }
.maint-hint { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: none; }
.maint-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.maint-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 14px; background: color-mix(in srgb, var(--muted) 14%, transparent); }
.maint-tab { width: auto; min-height: 38px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 800; }
.maint-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 6px #0003; }
.maint-count { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 25%, transparent); font-size: 11px; }
.maint-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.maint-pill.ok { background: color-mix(in srgb, var(--cyan) 18%, transparent); color: var(--cyan); }
.maint-pill.soon { background: color-mix(in srgb, var(--orange) 20%, transparent); color: var(--orange); }
.maint-pill.overdue { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.maint-pill.off { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }
.maint-asset-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.maint-asset-bar label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.maint-asset-bar select { min-width: 280px; }
.maint-section-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.maint-section-head h4 { margin: 0; font-size: 16px; }
.maint-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.maint-section-head .secondary-button { width: auto; }
.maint-table, .maint-list { display: flex; flex-direction: column; gap: 10px; }
.maint-row { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1.2fr 1.4fr 1.6fr; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; }
.maint-row.maint-head { padding: 0 16px; border: 0; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.maint-history-table .maint-row { grid-template-columns: 1fr 1fr 1.4fr 1.4fr 2.4fr; }
.os-evidence { flex-wrap: wrap; }
.os-evidence input[type=file] { width: 100%; font-size: 12px; }
input.os-field { width: 100%; box-sizing: border-box; color: inherit; font: inherit; }
.maint-row small, .maint-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.maint-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.maint-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.maint-actions button { width: auto; min-height: 34px; padding: 0 12px; font-size: 12px; }
.maint-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.maint-chip { padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--muted); font-size: 11px; font-weight: 800; }
.maint-chip.ok { background: color-mix(in srgb, var(--cyan) 18%, transparent); color: var(--cyan); }
.maint-chip.warn { background: color-mix(in srgb, var(--orange) 20%, transparent); color: var(--orange); }
.maint-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; padding: 16px; margin-bottom: 16px; border: 1px dashed var(--cyan); border-radius: 14px; }
.maint-form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.maint-form .maint-check { flex-direction: row; align-items: center; gap: 8px; text-transform: none; font-size: 13px; color: var(--text); }
.maint-form .maint-check input { width: 16px; height: 16px; accent-color: var(--cyan); }
.maint-inline { display: flex; gap: 8px; }
.maint-form-actions { grid-column: 1 / -1; display: flex; gap: 10px; }
.maint-form-actions button { width: auto; }
.maint-error { margin-bottom: 14px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); font-size: 13px; }
@media (max-width: 900px) {
  .maint-row, .maint-history-table .maint-row { grid-template-columns: 1fr; }
  .maint-row.maint-head { display: none; }
  .maint-actions { justify-content: flex-start; }
  .maint-item { flex-wrap: wrap; }
}
.admin-module-actions { display: inline-flex; align-items: center; gap: 12px; }
.admin-module-actions .primary-button { width: auto; min-height: 34px; padding: 0 16px; font-size: 12px; }
.admin-module-actions .primary-button:disabled { opacity: .45; cursor: default; }
.admin-module-status { color: var(--cyan); font-size: 12px; font-weight: 800; }
.admin-module-status.error { color: var(--red); }
.maint-section-gap { margin-top: 24px; }
.maint-scope { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.maint-scope legend { padding: 0 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.maint-scope .maint-hint { flex-basis: 100%; }
.maint-form .maint-wide { grid-column: 1 / -1; }
.maint-chip.maint-file { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--cyan); }
.maint-thumb { width: 56px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.maint-form input[type="file"] { padding: 8px; font-size: 12px; }
.maint-asset-bar .secondary-button { width: auto; min-height: 36px; }

/* Submenu da Manutenção (menu lateral do cliente) */
.client-subnav { display: flex; flex-direction: column; gap: 2px; margin: -2px 0 4px 18px; padding-left: 14px; border-left: 2px solid var(--line); }
.client-subnav-button { display: flex; align-items: center; gap: 8px; width: auto; min-height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; text-align: left; }
.client-subnav-button svg { width: 15px; height: 15px; flex: 0 0 auto; }
@media (min-width: 1181px) {
  .client-sidebar.collapsed .client-subnav { margin: 0; padding: 0; border-left: 0; align-items: stretch; }
  .client-sidebar.collapsed .client-subnav-label { display: none; }
  .client-sidebar.collapsed .client-subnav-button { justify-content: center; padding: 0; }
}
.client-subnav-button:hover { color: var(--text); background: color-mix(in srgb, var(--cyan) 8%, transparent); }
.client-subnav-button.active { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 14%, transparent); }
@media (max-width: 1180px) {
  .client-subnav { flex-direction: row; flex: 0 0 auto; margin: 0; padding: 0 0 0 6px; border-left: 0; align-items: center; }
  .client-subnav-button { white-space: nowrap; }
}

/* Manutenção > Visão Geral */
.mo-screen { display: flex; flex-direction: column; gap: 16px; }
.mo-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 26px 28px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, #0a6f60 0%, #12a08a 100%); box-shadow: 0 14px 34px #0a6f6040; }
.mo-hero-text { flex: 1 1 420px; min-width: 0; }
.mo-hero-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 10.5px; letter-spacing: .06em; }
.mo-tag { padding: 4px 10px; border-radius: 6px; background: #ffffff26; }
.mo-online { display: inline-flex; align-items: center; gap: 6px; }
.mo-online i { width: 7px; height: 7px; border-radius: 50%; background: #7dffd9; box-shadow: 0 0 0 4px #7dffd933; }
.mo-online.off i { background: #ffb4b4; box-shadow: none; }
.mo-hero h2 { margin: 0; font-size: 28px; letter-spacing: -.01em; }
.mo-hero h2 span { color: #8ff3de; }
.mo-trail { margin: 6px 0 14px; font-size: 13px; opacity: .92; }
.mo-quote { margin: 0; max-width: 620px; font-size: 14px; line-height: 1.55; opacity: .95; }
.mo-hero-actions { display: flex; flex-direction: column; gap: 10px; min-width: 210px; }
.mo-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; padding: 0 18px; border: 0; border-radius: 12px; font-size: 14px; font-weight: 800; cursor: default; }
.mo-btn svg { width: 17px; height: 17px; }
.mo-btn.light { background: #fff; color: #0a6f60; }
.mo-btn.ghost { background: #ffffff26; color: #fff; }
.mo-btn.solid { background: linear-gradient(145deg, #1f8f7e 0%, #0f6b5d 100%); color: #fff; }
.mo-btn.icon { width: 48px; min-width: 48px; padding: 0; background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }

.mo-kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.mo-kpi { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); min-width: 0; }
.mo-kpi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .05em; }
.mo-kpi-icon svg { width: 18px; height: 18px; }
.mo-kpi-value { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mo-kpi-value strong { font-size: 30px; line-height: 1; }
.mo-kpi-value small, .mo-kpi-sub { color: var(--muted); font-size: 11px; }
.mo-kpi-bar { height: 5px; margin-top: auto; border-radius: 99px; background: color-mix(in srgb, var(--muted) 20%, transparent); overflow: hidden; }
.mo-kpi-bar i { display: block; height: 100%; border-radius: 99px; background: var(--cyan); }
.mo-kpi.normal .mo-kpi-icon { color: var(--cyan); }
.mo-kpi.attention .mo-kpi-icon { color: var(--amber); }
.mo-kpi.schedule .mo-kpi-icon { color: var(--orange); }
.mo-kpi.attention .mo-kpi-bar i { background: var(--amber); }
.mo-kpi.schedule .mo-kpi-bar i { background: var(--orange); }
.mo-kpi.critical .mo-kpi-icon { color: var(--red); }
.mo-kpi.critical .mo-kpi-bar i { background: var(--red); }
.mo-kpi.expired { background: #1c2434; border-color: #2a3550; color: #fff; }
.mo-kpi.expired .mo-kpi-head, .mo-kpi.expired .mo-kpi-value small { color: #b8c3d9; }
.mo-kpi.expired .mo-kpi-icon { color: #ff6b6b; }
.mo-kpi.expired .mo-kpi-bar i { background: #ff4d4d; }
.mo-kpi-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; color: var(--muted); font-size: 11px; }
.mo-kpi-foot .mono { margin-left: auto; }
.mo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); }
.mo-dot.high { background: var(--orange); }
.mo-dot.urgent { background: var(--red); }
.mo-dot.low { background: var(--muted); }

.mo-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.mo-main, .mo-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mo-card { border: 1px solid var(--line); border-radius: 20px; padding: 22px; background: var(--surface); min-width: 0; }
.mo-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.mo-card-head h3 { margin: 4px 0 6px; font-size: 22px; }
.mo-card-head p { margin: 0; max-width: 520px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mo-kicker { color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.mo-kicker b { margin-right: 6px; }
.mo-filter { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--muted); font-size: 11px; font-weight: 800; }
.mo-filter svg { width: 15px; height: 15px; }
.mo-filter select { width: auto; min-width: 150px; min-height: 30px; border: 0; background: transparent; color: var(--text); font-weight: 700; }
.mo-table-wrap { overflow-x: auto; }
.mo-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.mo-table th { padding: 12px 14px; background: color-mix(in srgb, var(--muted) 10%, transparent); color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-align: left; }
.mo-table th:first-child { border-radius: 12px 0 0 12px; }
.mo-table th:last-child { border-radius: 0 12px 12px 0; }
.mo-table td { padding: 16px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.mo-table tr:last-child td { border-bottom: 0; }
.mo-table small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.mo-asset { display: flex; align-items: center; gap: 12px; }
.mo-asset strong { font-size: 15px; }
.mo-rank { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; font-size: 12px; font-weight: 800; }
.mo-rank.normal { background: color-mix(in srgb, var(--cyan) 20%, transparent); color: var(--cyan); }
.mo-rank.attention { background: color-mix(in srgb, var(--amber) 22%, transparent); color: var(--amber); }
.mo-rank.schedule { background: color-mix(in srgb, var(--orange) 22%, transparent); color: var(--orange); }
.mo-rank.critical, .mo-rank.expired { background: color-mix(in srgb, var(--red) 20%, transparent); color: var(--red); }
.mo-life { min-width: 150px; }
.mo-life span { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 800; }
.mo-life em { font-style: normal; font-size: 10.5px; letter-spacing: .05em; }
.mo-bar { height: 7px; margin-top: 6px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 20%, transparent); overflow: hidden; }
.mo-bar i { display: block; height: 100%; border-radius: 99px; background: var(--cyan); }
.mo-life.normal span { color: var(--cyan); }
.mo-life.attention span { color: var(--amber); }
.mo-life.schedule span { color: var(--orange); }
.mo-life.attention .mo-bar i { background: var(--amber); }
.mo-life.schedule .mo-bar i { background: var(--orange); }
.mo-life.critical span, .mo-life.expired span { color: var(--red); }
.mo-life.critical .mo-bar i, .mo-life.expired .mo-bar i { background: var(--red); }
.mo-left { font-size: 17px; }
.mo-left.critical, .mo-left.expired { color: var(--red); }
.mo-forecast { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 10px; background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); font-size: 12px; font-weight: 800; white-space: nowrap; }
.mo-forecast svg { width: 14px; height: 14px; }
.mo-forecast.attention { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.mo-forecast.schedule { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.mo-forecast.critical, .mo-forecast.expired { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.mo-empty { padding: 28px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.mo-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.mo-live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--cyan); }
.mo-link { display: inline-flex; align-items: center; gap: 8px; width: auto; min-height: 0; padding: 0; border: 0; background: none; color: var(--cyan); font-size: 13px; font-weight: 800; }
.mo-link svg { width: 14px; height: 14px; }

.mo-alert { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); border-top: 3px solid var(--red); }
.mo-alert-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; color: var(--red); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.mo-alert-head span { display: inline-flex; align-items: center; gap: 8px; }
.mo-alert-head svg { width: 18px; height: 18px; }
.mo-alert-head em { padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--red) 16%, transparent); font-size: 10px; font-style: normal; }
.mo-alert-body { padding: 16px; border-radius: 14px; background: color-mix(in srgb, var(--red) 6%, var(--surface-2)); }
.mo-alert-title { display: flex; justify-content: space-between; gap: 10px; }
.mo-alert-title small { color: var(--red); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; }
.mo-alert-title h4 { margin: 4px 0; font-size: 20px; }
.mo-alert-title p { margin: 0; color: var(--muted); font-size: 12px; }
.mo-alert-icon { color: var(--red); }
.mo-alert-icon svg { width: 22px; height: 22px; }
.mo-facts { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface); }
.mo-facts div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13px; }
.mo-facts dt { color: var(--muted); }
.mo-facts dd { margin: 0; font-weight: 800; }
.mo-facts .bad { color: var(--red); }
.mo-facts dd svg { width: 14px; height: 14px; vertical-align: -2px; }
.mo-channels-title { margin: 14px 0 8px; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .05em; }
.mo-channels { display: flex; flex-wrap: wrap; gap: 8px; }
.mo-channels span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 10px; background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); font-size: 11px; font-weight: 800; }
.mo-channels svg { width: 14px; height: 14px; }
.mo-alert-actions { display: flex; gap: 10px; margin-top: 16px; }

.mo-focus-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.mo-photo { display: flex; flex-direction: column; justify-content: space-between; min-height: 190px; padding: 14px; border-radius: 14px; color: #fff; background: radial-gradient(circle at 70% 20%, #2a7f73 0%, transparent 55%), linear-gradient(160deg, #1b2b33 0%, #0e171c 100%); }
.mo-photo-top span { display: inline-block; padding: 4px 10px; border-radius: 8px; background: #00000066; font-size: 11px; }
.mo-photo-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.mo-photo-bottom strong { font-size: 20px; line-height: 1.15; }
.mo-flow { display: flex; flex-direction: column; align-items: flex-end; padding: 8px 12px; border-radius: 10px; background: #00000066; }
.mo-flow b { font-size: 20px; color: #7dffd9; }
.mo-flow small { font-size: 10px; }
.mo-flow em { font-size: 9px; font-style: normal; opacity: .8; }
.mo-sensors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.mo-sensors div { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--muted) 10%, transparent); }
.mo-sensors small { display: block; color: var(--muted); font-size: 10.5px; }
.mo-sensors b { display: block; margin-top: 3px; font-size: 13px; }
.mo-wide-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; min-height: 44px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); font-size: 13px; font-weight: 800; }
.mo-wide-btn svg { width: 16px; height: 16px; }

.mo-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; }
.mo-logic-head, .mo-profile-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.mo-logic-head span { display: inline-flex; align-items: center; gap: 8px; }
.mo-logic-head svg { width: 17px; height: 17px; }
.mo-logic-head em { padding: 4px 10px; border-radius: 8px; background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--cyan); font-style: normal; font-size: 11px; }
.mo-logic-rules { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--muted) 10%, transparent); }
.mo-logic-rules div { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.mo-logic-rules i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.mo-logic-rules i.on { background: var(--cyan); }
.mo-logic-rules b { margin-left: auto; color: var(--muted); font-size: 11px; text-align: right; }
.mo-logic-foot { display: flex; justify-content: space-between; gap: 10px; margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.mo-logic-foot b { color: var(--cyan); }
.mo-profile-numbers { display: flex; flex-wrap: wrap; gap: 32px; margin-bottom: 14px; }
.mo-profile-numbers strong { display: block; font-size: 30px; color: var(--cyan); }
.mo-profile-numbers small { color: var(--muted); font-size: 12px; }
.mo-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.mo-days div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mo-days i { position: relative; width: 100%; height: 22px; border-radius: 6px; background: color-mix(in srgb, var(--muted) 18%, transparent); overflow: hidden; }
.mo-days i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--fill); background: var(--cyan); }
.mo-days span { color: var(--muted); font-size: 10px; font-weight: 800; }

.mo-trace { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.mo-trace-icon { color: var(--cyan); }
.mo-trace-icon svg { width: 24px; height: 24px; }
.mo-trace > div:nth-child(2) { flex: 1 1 320px; min-width: 0; }
.mo-trace strong { font-size: 13px; }
.mo-trace p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mo-trace-next { text-align: right; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .05em; }
.mo-trace-next span { display: block; margin-top: 3px; font-size: 12px; color: var(--text); }
.mo-logs { width: auto; min-height: 42px; padding: 0 18px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .04em; cursor: default; }

@media (max-width: 1280px) {
  .mo-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .mo-grid, .mo-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .mo-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mo-hero { padding: 20px; }
  .mo-hero h2 { font-size: 22px; }
  .mo-hero-actions { width: 100%; }
  .mo-trace-next { text-align: left; }
}

/* Manutenção > Ativos */
.ma-screen { display: flex; flex-direction: column; gap: 16px; }
.ma-card { border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: var(--surface); min-width: 0; }
.ma-crumbs { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.ma-crumbs i { margin: 0 6px; font-style: normal; opacity: .6; }
.ma-crumbs-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ma-select { display: inline-flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 800; }
.ma-select select { width: auto; min-width: 190px; min-height: 34px; padding: 0 10px; font-size: 12px; }
.ma-sync { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); font-size: 10.5px; font-weight: 800; }
.ma-sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }
.ma-sync.off { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.ma-sync.off i { background: var(--red); }
.ma-pdf { width: auto; min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); font-size: 10.5px; font-weight: 800; }

.ma-head { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr); gap: 16px; }
.ma-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 11px; }
.ma-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; font-weight: 800; letter-spacing: .03em; }
.ma-chip.tag { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--text); }
.ma-chip.state { background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); }
.ma-chip.state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ma-chip.state.stopped { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.ma-chip.state.offline { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.ma-chip.state.maintenance { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }
.ma-chip.state.unavailable { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.ma-meta { color: var(--muted); font-size: 11px; }
.ma-id h2 { margin: 0; font-size: 30px; letter-spacing: -.01em; }
.ma-id h2 span { color: var(--muted); font-size: 20px; font-weight: 500; }
.ma-desc { margin: 12px 0 18px; max-width: 640px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.ma-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0; }
.ma-fields dt { color: var(--muted); font-size: 9.5px; font-weight: 800; letter-spacing: .06em; }
.ma-fields dd { margin: 4px 0 0; font-size: 13px; font-weight: 700; }
.ma-origin { background: color-mix(in srgb, var(--cyan) 5%, var(--surface)); }
.ma-origin-head { display: flex; justify-content: space-between; gap: 10px; color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.ma-origin-head b { display: inline-flex; flex-direction: column; align-items: flex-end; font-size: 14px; }
.ma-origin-head small { color: var(--muted); font-size: 9px; }
.ma-origin p { margin: 10px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.ma-origin dl { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface); font-size: 11.5px; }
.ma-origin dl div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.ma-origin dt { color: var(--muted); }
.ma-origin dd { margin: 0; font-weight: 700; text-align: right; }

.ma-hours { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ma-stat { display: flex; flex-direction: column; gap: 8px; padding: 18px; }
.ma-stat small { color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .05em; }
.ma-stat strong { display: flex; align-items: baseline; gap: 6px; font-size: 28px; }
.ma-stat strong em { color: var(--muted); font-size: 14px; font-style: normal; font-weight: 600; }
.ma-stat strong b { margin-left: auto; padding: 3px 8px; border-radius: 8px; background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); font-size: 11px; }
.ma-stat.idle strong b { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.ma-stat p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.ma-bar { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 20%, transparent); overflow: hidden; }
.ma-bar i { display: block; height: 100%; border-radius: 99px; background: var(--cyan); }
.ma-stat.idle .ma-bar i { background: var(--muted); }
.ma-stat-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--muted) 10%, transparent); color: var(--muted); font-size: 10.5px; }
.ma-stat-foot b { color: var(--text); font-weight: 700; text-align: right; }

.ma-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ma-section-head small { color: var(--cyan); font-size: 10.5px; font-weight: 800; letter-spacing: .07em; }
.ma-section-head h3 { margin: 4px 0 0; font-size: 22px; }
.ma-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.ma-counts span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 11px; font-weight: 800; }
.ma-counts i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ma-counts .critical { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.ma-counts .attention { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.ma-counts .schedule { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.ma-counts .normal { background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); }
.ma-comps { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ma-comp-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ma-chip.band { font-size: 10px; background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); }
.ma-chip.band.attention { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }
.ma-chip.band.schedule { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }
.ma-chip.band.critical, .ma-chip.band.expired { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.ma-chip.band.none { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); }
.ma-pct { display: flex; align-items: center; gap: 8px; text-align: right; }
.ma-pct strong { font-size: 28px; }
.ma-pct small { color: var(--muted); font-size: 9px; font-weight: 800; line-height: 1.2; }
.ma-comp.critical .ma-pct strong, .ma-comp.expired .ma-pct strong { color: var(--red); }
.ma-comp.attention .ma-pct strong { color: var(--amber); }
.ma-comp.schedule .ma-pct strong { color: var(--orange); }
.ma-comp.normal .ma-pct strong { color: var(--cyan); }
.ma-comp h4 { margin: 10px 0 4px; font-size: 18px; }
.ma-spec { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.ma-life { height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 20%, transparent); overflow: hidden; }
.ma-life i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f3c23b 0%, #f08a24 50%, #d93a3a 100%); background-size: 300px 100%; }
.ma-comp.normal .ma-life i { background: var(--cyan); }
.ma-scale { display: flex; justify-content: space-between; gap: 6px; margin: 6px 0 12px; color: var(--muted); font-size: 10px; }
.ma-comp-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--muted) 10%, transparent); }
.ma-comp-stats dt { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; }
.ma-comp-stats dd { margin: 3px 0 0; font-size: 13px; font-weight: 800; }
.ma-last { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.ma-last b { color: var(--text); }
.ma-comp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ma-btn { width: auto; min-height: 38px; padding: 0 14px; border: 0; border-radius: 10px; font-size: 12px; font-weight: 800; cursor: default; }
.ma-btn.ghost { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--text); }
.ma-btn.solid { background: linear-gradient(145deg, #1f8f7e 0%, #0f6b5d 100%); color: #fff; }
.ma-btn.light { background: var(--surface); color: var(--text); border: 1px solid var(--line); }

.ma-compare-head { color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.ma-compare-head b { margin-right: 10px; color: var(--cyan); }
.ma-compare h3 { margin: 8px 0 10px; font-size: 20px; }
.ma-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 14px; color: var(--muted); font-size: 11px; }
.ma-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; }
.ma-legend .hours { background: var(--cyan); }
.ma-legend .tons { background: var(--blue); }
.ma-compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ma-measure { padding: 16px; border-radius: 14px; background: color-mix(in srgb, var(--muted) 8%, transparent); }
.ma-measure > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.ma-measure small { color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }
.ma-measure strong { font-size: 26px; }
.ma-measure strong.hours { color: var(--cyan); }
.ma-measure strong.tons { color: var(--blue); }
.ma-measure p { margin: 8px 0 12px; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.ma-bar.tons i { background: var(--blue); }
.ma-measure-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.ma-measure-foot b { color: var(--text); text-align: right; }
.ma-converge { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 14px; padding: 16px; border-radius: 14px; background: color-mix(in srgb, var(--blue) 8%, transparent); }
.ma-converge-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--cyan); color: #fff; }
.ma-converge-icon svg { width: 22px; height: 22px; }
.ma-converge > div:nth-child(2) { flex: 1 1 280px; min-width: 0; }
.ma-converge strong { font-size: 15px; }
.ma-converge p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.ma-media-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ma-media-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }
.ma-media-head b { color: var(--red); font-size: 10px; }
.ma-media-empty { display: flex; align-items: center; justify-content: center; min-height: 150px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 12px; }
.ma-media-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.ma-media-foot b { color: var(--cyan); font-weight: 800; }

@media (max-width: 1100px) {
  .ma-head, .ma-compare-grid { grid-template-columns: 1fr; }
  .ma-hours { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ma-media-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ma-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ma-hours { grid-template-columns: 1fr; }
  .ma-id h2 { font-size: 24px; }
}

/* Manutenção > Manutenções (PCM preditivo) */
.mp-screen { display: flex; flex-direction: column; gap: 16px; }
.mp-card { border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: var(--surface); min-width: 0; }
.mp-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.mp-crumb { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: var(--muted); }
.mp-module { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 8px; background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); font-size: 10.5px; font-weight: 800; letter-spacing: .05em; }
.mp-module svg { width: 14px; height: 14px; }
.mp-top h2 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.mp-engine { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); font-size: 10.5px; font-weight: 800; vertical-align: middle; }
.mp-engine i, .mp-engine-on i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-btn { display: inline-flex; align-items: center; gap: 8px; width: auto; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; font-weight: 700; line-height: 1.2; text-align: left; cursor: default; }
.mp-btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.mp-btn.ghost { background: var(--surface); color: var(--text); }
.mp-btn.solid { border-color: transparent; background: linear-gradient(145deg, #1f8f7e 0%, #0f6b5d 100%); color: #fff; }

.mp-algo { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; padding: 18px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, #0a6f60 0%, #12a08a 100%); box-shadow: 0 14px 34px #0a6f6040; }
.mp-algo-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 10.5px; opacity: .95; }
.mp-algo-tag { padding: 6px 10px; border-radius: 6px; background: #ffffff26; font-size: 10px; }
.mp-algo h3 { margin: 14px 0 8px; font-size: 24px; line-height: 1.2; }
.mp-algo p { margin: 0; font-size: 12px; line-height: 1.5; opacity: .92; }
.mp-formula { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 14px; border-radius: 14px; background: #ffffff1f; }
.mp-formula-head { display: flex; justify-content: space-between; gap: 8px; color: #8ff3de; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; }
.mp-formula-head svg { width: 16px; height: 16px; }
.mp-formula code { display: block; padding: 12px; border-radius: 10px; background: #00000030; font-size: 13px; line-height: 1.5; }
.mp-formula code b { color: #8ff3de; font-weight: 700; }
.mp-formula-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; opacity: .85; }

.mp-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.mp-main, .mp-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mp-title { display: flex; align-items: center; gap: 12px; }
.mp-title-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.mp-title-icon svg { width: 20px; height: 20px; }
.mp-title small { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .05em; }
.mp-title h3 { margin: 3px 0 0; font-size: 18px; }
.mp-plans-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.mp-plans-count { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.mp-crit { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); font-size: 10.5px; }
.mp-crit i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mp-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.mp-table th { padding: 12px 14px; background: color-mix(in srgb, var(--muted) 10%, transparent); color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-align: left; }
.mp-table td { padding: 16px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 12.5px; }
.mp-table tr:last-child td { border-bottom: 0; }
.mp-asset { display: flex; flex-direction: column; gap: 1px; }
.mp-asset strong { font-size: 13.5px; }
.mp-asset small { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.mp-service { display: inline-block; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); font-size: 11.5px; font-weight: 600; }
.mp-consumed { min-width: 150px; }
.mp-consumed span { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.mp-consumed em { font-style: normal; font-weight: 800; }
.mp-bar { height: 6px; margin-top: 6px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 20%, transparent); overflow: hidden; }
.mp-bar i { display: block; height: 100%; border-radius: 99px; background: var(--cyan); }
.mp-consumed.normal span { color: var(--cyan); }
.mp-consumed.attention span { color: var(--amber); }
.mp-consumed.schedule span { color: var(--orange); }
.mp-consumed.attention .mp-bar i { background: var(--amber); }
.mp-consumed.schedule .mp-bar i { background: var(--orange); }
.mp-consumed.critical span, .mp-consumed.expired span { color: var(--red); }
.mp-consumed.critical .mp-bar i, .mp-consumed.expired .mp-bar i { background: var(--red); }
.mp-left.critical, .mp-left.expired { color: var(--red); }
.mp-forecast { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--cyan); white-space: nowrap; }
.mp-forecast svg { width: 14px; height: 14px; }
.mp-forecast.attention { color: var(--amber); }
.mp-forecast.schedule { color: var(--orange); }
.mp-forecast.critical, .mp-forecast.expired { color: var(--red); }
.mp-plans-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.mp-legend { display: inline-flex; align-items: center; gap: 6px; }
.mp-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }
.mp-legend i.critical { background: var(--red); }
.mp-legend i.attention { background: var(--amber); }
.mp-legend i.schedule { background: var(--orange); }
.mp-last { margin-left: auto; }

.mp-sim-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mp-sim-head h3 { margin: 0; font-size: 18px; flex: 1 1 140px; }
.mp-sim-chip { padding: 5px 10px; border-radius: 6px; background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); font-size: 10.5px; font-weight: 800; }
.mp-sim p { margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mp-sim p b { color: var(--text); }
.mp-regime { padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--blue) 8%, transparent); }
.mp-regime > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.mp-regime small { color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .05em; }
.mp-regime strong { color: var(--cyan); font-size: 22px; text-align: right; line-height: 1.2; }
.mp-regime em { font-style: normal; font-size: 18px; }
.mp-slider { position: relative; height: 6px; margin: 14px 0 8px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 22%, transparent); }
.mp-slider i { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--cyan); }
.mp-slider-marks { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 9.5px; }
.mp-sim-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.mp-sim-grid > div { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--muted) 8%, transparent); }
.mp-sim-grid small { color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .04em; }
.mp-sim-grid strong { font-size: 18px; }
.mp-sim-grid span { color: var(--muted); font-size: 10.5px; }
.mp-sim-grid .bad { color: var(--red); }
.mp-curve-head { display: flex; justify-content: space-between; gap: 10px; margin: 14px 0 6px; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.mp-curve-head b { color: var(--red); font-size: 11px; text-align: right; }
.mp-curve { width: 100%; height: auto; padding: 6px; border: 1px solid var(--line); border-radius: 10px; }
.mp-curve line { stroke: var(--line); stroke-width: 1; }
.mp-curve line.limit { stroke: var(--red); opacity: .6; }
.mp-curve path.solid { fill: none; stroke: var(--cyan); stroke-width: 2.2; }
.mp-curve path.dashed { fill: none; stroke: var(--cyan); stroke-width: 1.6; opacity: .7; }
.mp-curve .dot { fill: var(--red); }
.mp-curve text { fill: var(--muted); font-size: 7px; }
.mp-curve text.limit { fill: var(--red); }
.mp-curve-empty { padding: 28px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; font-size: 12px; }

.mp-equip { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.mp-equip-photo { position: relative; min-height: 130px; background: linear-gradient(160deg, #1b2b33 0%, #0e171c 100%); }
.mp-equip-empty { display: flex; align-items: center; justify-content: center; min-height: 130px; color: #8aa0a8; font-size: 12px; }
.mp-equip-label { position: absolute; inset: auto 0 0 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: linear-gradient(0deg, #000000aa, transparent); color: #fff; }
.mp-equip-label strong { font-size: 13px; }
.mp-equip-label span { padding: 3px 8px; border-radius: 6px; background: #1f8f7e; font-size: 10px; }
.mp-equip-foot { display: flex; justify-content: space-between; gap: 8px; padding: 12px 14px; color: var(--muted); font-size: 11.5px; }
.mp-equip-foot svg { width: 13px; height: 13px; vertical-align: -2px; color: var(--cyan); }

.mp-bottom { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.mp-auto-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.mp-engine-on { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); font-size: 10px; font-weight: 800; line-height: 1.2; }
.mp-auto p { margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mp-auto-box { padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--muted) 8%, transparent); }
.mp-auto-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--surface); }
.mp-bolt { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.mp-bolt svg { width: 17px; height: 17px; }
.mp-auto-row > div:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.mp-auto-row strong { font-size: 13px; }
.mp-auto-row strong .bad { color: var(--red); }
.mp-auto-row p { margin: 4px 0; color: var(--text); font-size: 13px; }
.mp-auto-row small { color: var(--muted); font-size: 11px; }
.mp-os { min-width: 130px; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--blue) 8%, transparent); text-align: right; }
.mp-os small { display: block; font-size: 10px; }
.mp-os strong { display: block; color: var(--blue); font-size: 20px; }
.mp-os span { color: var(--red); font-size: 10.5px; font-weight: 700; }
.mp-auto-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px 0; font-size: 13px; }
.mp-sla { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.mp-sla b { color: var(--text); font-size: 12px; text-align: right; }
.mp-auto-empty { padding: 20px; color: var(--muted); font-size: 12.5px; text-align: center; }
.mp-auto-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 11.5px; }
.mp-auto-links svg, .mp-link svg { width: 13px; height: 13px; vertical-align: -2px; }
.mp-link { color: var(--cyan); font-weight: 800; }
.mp-channels p { margin: 12px 0; color: var(--muted); font-size: 12px; }
.mp-channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mp-channel { padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--muted) 8%, transparent); }
.mp-channel > div { display: flex; align-items: center; gap: 8px; }
.mp-channel-icon { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 8px; background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); }
.mp-channel-icon svg { width: 14px; height: 14px; }
.mp-channel strong { flex: 1 1 auto; font-size: 12px; }
.mp-channel > div > i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.mp-channel > div > i.on { background: var(--cyan); }
.mp-channel p { display: flex; justify-content: space-between; gap: 6px; margin: 10px 0 0; color: var(--muted); font-size: 10.5px; }
.mp-channel p b { color: var(--muted); font-size: 9.5px; letter-spacing: .03em; }
.mp-channel p b.on { color: var(--cyan); }
.mp-channels-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 11px; }

.mp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 14px 20px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--cyan) 5%, var(--surface)); }
.mp-foot-icon { color: var(--cyan); }
.mp-foot-icon svg { width: 22px; height: 22px; }
.mp-foot > div:nth-child(2) { flex: 1 1 280px; min-width: 0; }
.mp-foot strong { font-size: 12.5px; }
.mp-foot p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.mp-foot-stat { text-align: right; }
.mp-foot-stat small { display: block; color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .04em; }
.mp-foot-stat b { font-size: 15px; color: var(--cyan); }
.mp-foot-stat em { font-style: normal; font-size: 11px; color: var(--muted); }

@media (max-width: 1280px) {
  .mp-algo { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .mp-grid, .mp-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .mp-top h2 { font-size: 20px; }
  .mp-channel-grid { grid-template-columns: 1fr; }
  .mp-auto-row { flex-wrap: wrap; }
  .mp-os { width: 100%; text-align: left; }
}

/* Manutenção > Ordens de Serviço */
.os-screen { display: flex; flex-direction: column; gap: 16px; }
.os-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; }
.os-kicker { margin: 0 0 6px; color: var(--muted); font-size: 10.5px; letter-spacing: .04em; }
.os-kicker b { padding: 3px 8px; border-radius: 4px; background: color-mix(in srgb, var(--cyan) 18%, transparent); color: var(--cyan); }
.os-top h2 { margin: 0; font-size: 28px; letter-spacing: -.01em; }
.os-sub { margin: 6px 0 0; max-width: 520px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.os-top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.os-toggle { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.os-toggle button { display: inline-flex; align-items: center; gap: 8px; width: auto; min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.os-toggle button.active { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--text); }
.os-toggle svg, .os-btn svg { width: 15px; height: 15px; }
.os-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 800; }
.os-btn:disabled { opacity: .45; cursor: default; }
.os-btn.ghost { border-color: var(--line); background: var(--surface); color: var(--text); font-weight: 700; }
.os-btn.solid { background: linear-gradient(145deg, #1f8f7e 0%, #0f6b5d 100%); color: #fff; }
.os-btn.soft { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.os-btn.dark { background: #0f4d44; color: #fff; }

.os-new { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 16px; border: 1px dashed var(--cyan); border-radius: 14px; background: var(--surface); }
.os-new strong { grid-column: 1 / -1; }
.os-new label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.os-new .wide { grid-column: 1 / -1; }
.os-new-actions { grid-column: 1 / -1; display: flex; gap: 10px; }

.os-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.os-stage { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.os-stage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.os-stage-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 19px; }
.os-stage-head h3 i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.os-stage.scheduled h3 i { background: var(--blue); }
.os-stage.running h3 i { background: var(--cyan); }
.os-check { display: inline-flex; color: var(--cyan); }
.os-check svg { width: 18px; height: 18px; }
.os-badge { padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); font-size: 11px; font-weight: 800; white-space: nowrap; }
.os-stage.scheduled .os-badge { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.os-stage.running .os-badge, .os-stage.done .os-badge { background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); }
.os-stage-foot { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.os-stage-foot b { color: var(--text); font-size: 11px; }
.os-stage-bar { height: 3px; margin-top: -10px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 20%, transparent); overflow: hidden; }
.os-stage-bar i { display: block; height: 100%; background: var(--red); }
.os-stage.scheduled .os-stage-bar i { background: var(--blue); }
.os-stage.running .os-stage-bar i, .os-stage.done .os-stage-bar i { background: var(--cyan); }

.os-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.os-main, .os-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.os-card { border: 1px solid var(--line); border-radius: 18px; padding: 22px; background: var(--surface); min-width: 0; }
.os-detail { border-top: 3px solid var(--red); }
.os-detail.normal, .os-detail.low { border-top-color: var(--cyan); }
.os-detail-id { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 11px; }
.os-num { font-size: 17px; font-weight: 800; }
.os-prio { padding: 3px 8px; border-radius: 6px; background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); font-weight: 800; }
.os-tag { padding: 3px 8px; border-radius: 6px; background: color-mix(in srgb, var(--blue) 10%, transparent); color: var(--blue); }
.os-detail h3 { margin: 10px 0 6px; font-size: 24px; letter-spacing: -.01em; }
.os-equip { margin: 0; color: var(--muted); font-size: 13px; }
.os-equip b { color: var(--text); }
.os-equip span { color: var(--cyan); font-weight: 700; }
.os-status { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 14px 0; }
.os-status small { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.os-status-chip { padding: 6px 14px; border-radius: 99px; background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); font-size: 12.5px; font-weight: 800; }
.os-status-chip.in_progress { background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--cyan); }
.os-status-chip.done, .os-status-chip.cancelled { background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--muted); }
.os-origin { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--blue) 5%, var(--surface)); }
.os-origin-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; color: var(--blue); font-size: 12.5px; font-weight: 700; }
.os-origin-head span { display: inline-flex; align-items: center; gap: 8px; }
.os-origin-head svg { width: 15px; height: 15px; }
.os-origin-head b { padding: 5px 10px; border-radius: 8px; background: color-mix(in srgb, var(--blue) 12%, transparent); font-size: 11px; }
.os-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.os-metric { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.os-metric small { color: var(--muted); font-size: 9.5px; font-weight: 800; letter-spacing: .04em; line-height: 1.3; }
.os-metric strong { display: block; margin-top: 6px; font-size: 24px; }
.os-metric em { margin-left: 4px; color: var(--muted); font-size: 12px; font-style: normal; font-weight: 600; }
.os-metric.bad { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.os-metric.bad strong { color: var(--red); }
.os-wear > div:first-child { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.os-wear b { color: var(--text); }
.os-wear-bar { height: 8px; margin: 8px 0 6px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 20%, transparent); overflow: hidden; }
.os-wear-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #1f8f7e 0%, #1f8f7e 70%, #d93a3a 100%); background-size: 300px 100%; }
.os-wear-marks { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 10.5px; }
.os-wear-marks .bad { color: var(--red); }
.os-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.os-people > div { display: flex; align-items: center; gap: 12px; }
.os-people svg { width: 38px; height: 38px; padding: 9px; border-radius: 50%; background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); }
.os-people small { display: block; color: var(--muted); font-size: 9.5px; font-weight: 800; letter-spacing: .05em; }
.os-people strong { display: block; margin-top: 2px; font-size: 13.5px; }
.os-people em { color: var(--muted); font-size: 11px; font-style: normal; }
.os-media-title { margin: 16px 0 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; }
.os-media { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.os-media .empty, .os-media .gauge { display: flex; align-items: center; justify-content: center; min-height: 110px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 11.5px; }
.os-media .gauge { flex-direction: column; gap: 6px; border-style: solid; background: color-mix(in srgb, var(--blue) 6%, transparent); }
.os-media .gauge svg { width: 22px; height: 22px; }
.os-homolog { display: flex; align-items: center; gap: 8px; margin: 14px 0; color: var(--muted); font-size: 12px; }
.os-homolog svg { width: 15px; height: 15px; color: var(--cyan); }
.os-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.os-integration { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.os-wave { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 10px; background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); }
.os-wave svg { width: 20px; height: 20px; }
.os-integration > div:nth-child(2) { flex: 1 1 220px; }
.os-integration strong { font-size: 13px; }
.os-integration p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.os-integration-hours { text-align: right; }
.os-integration-hours b { display: block; color: var(--blue); }
.os-integration-hours small { color: var(--muted); font-size: 10px; }

.os-conclusion-head { display: flex; justify-content: space-between; gap: 10px; }
.os-conclusion-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.os-conclusion-head h3 i { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); }
.os-conclusion-head span { color: var(--muted); font-size: 10.5px; }
.os-conclusion > p { margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.os-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.os-conclusion small { display: block; margin: 12px 0 6px; color: var(--muted); font-size: 9.5px; font-weight: 800; letter-spacing: .05em; }
.os-field { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--muted) 8%, transparent); font-size: 12.5px; }
.os-field.muted { color: var(--muted); }
.os-notes { min-height: 70px; white-space: pre-wrap; }
.os-evidence { display: flex; align-items: center; gap: 8px; border-style: dashed; }
.os-evidence svg { width: 16px; height: 16px; }
.os-conclusion textarea { width: 100%; min-height: 96px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; resize: vertical; }
.os-auto { margin-top: 16px; padding: 14px; border: 1px solid color-mix(in srgb, var(--cyan) 35%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--cyan) 7%, var(--surface)); }
.os-auto h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--cyan); font-size: 11.5px; letter-spacing: .03em; }
.os-auto h4 svg { width: 16px; height: 16px; }
.os-auto p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.os-auto p b { color: var(--text); }
.os-auto-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 10.5px; color: var(--muted); }
.os-auto-foot b { color: var(--cyan); }
.os-finish { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; margin-top: 16px; border: 0; border-radius: 12px; background: linear-gradient(145deg, #1f8f7e 0%, #0f6b5d 100%); color: #fff; font-size: 14px; font-weight: 800; }
.os-finish svg { width: 18px; height: 18px; }
.os-finish:disabled { opacity: .45; cursor: default; }

.os-history-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.os-history-head h3 { margin: 0; font-size: 20px; }
.os-history-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.os-search { display: flex; align-items: center; gap: 8px; min-width: 260px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--muted) 8%, transparent); }
.os-search svg { width: 15px; height: 15px; color: var(--muted); }
.os-search input { width: 100%; min-height: 40px; border: 0; background: transparent; color: var(--text); font-size: 12.5px; }
.os-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.os-table th { padding: 12px 14px; background: color-mix(in srgb, var(--muted) 10%, transparent); color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-align: left; }
.os-table td { padding: 16px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 12.5px; }
.os-table tr.selected td { background: color-mix(in srgb, var(--cyan) 6%, transparent); }
.os-table small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.os-table small.bad { color: var(--red); }
.os-cell-os { display: flex; align-items: center; gap: 8px; color: var(--cyan); font-weight: 800; }
.os-cell-os i { padding: 2px 6px; border-radius: 4px; background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--muted); font-size: 9px; font-style: normal; }
.os-cell-os i.auto { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }
.os-pill { display: inline-block; padding: 5px 12px; border-radius: 99px; background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); font-size: 11px; font-weight: 800; }
.os-pill.in_progress { background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--cyan); }
.os-pill.done, .os-pill.cancelled { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); }
.os-row-btn { width: auto; min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--blue) 10%, transparent); color: var(--blue); font-size: 11.5px; font-weight: 800; }
.os-row-btn.manage { background: #0f4d44; color: #fff; }
.os-history-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 11.5px; }
.os-pager { display: flex; gap: 6px; }
.os-pager button { width: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 700; }
.os-pager button.active { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }

@media (max-width: 1280px) {
  .os-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .os-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .os-top h2 { font-size: 22px; }
  .os-funnel, .os-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .os-people, .os-media, .os-grid2 { grid-template-columns: 1fr; }
}
.mp-btn.active, .os-btn.active { outline: 2px solid var(--cyan); outline-offset: 1px; }
.ma-btn:disabled { opacity: .5; cursor: not-allowed; }
.mp-link[data-mact] { cursor: pointer; }
