/* Neutral surfaces with restrained blue actions. */
@media screen {
  :root {
    --ui-canvas: #1a1a1a;
    --ui-panel: #242424;
    --ui-raised: #2d2d2d;
    --ui-hover: #363636;
    --ui-input: rgb(18 18 19 / 92%);
    --ui-border: rgb(255 255 255 / 9%);
    --ui-border-strong: rgb(255 255 255 / 17%);
    --ui-text: #f7f7f7;
    --ui-secondary: #dedede;
    --ui-muted: #b3b3b3;
    --ui-subtle: #8b8b8b;
    --ui-accent: #d4d4d8;
    --ui-accent-soft: #14263f;
    --ui-primary: #142e54;
    --ui-primary-hover: #1c3c69;
    --ui-shadow: 0 12px 32px rgb(0 0 0 / 28%);
  }

  :root[data-theme='light'] {
    --ui-canvas: #f3f3f4;
    --ui-panel: #fff;
    --ui-raised: #f1f1f2;
    --ui-hover: #e9e9eb;
    --ui-input: #fff;
    --ui-border: #e1e1e3;
    --ui-border-strong: #c8c8cb;
    --ui-text: #202023;
    --ui-secondary: #414146;
    --ui-muted: #65656c;
    --ui-subtle: #77777e;
    --ui-accent: #142e54;
    --ui-accent-soft: #e8edf7;
    --ui-primary: #142e54;
    --ui-primary-hover: #1c3c69;
    --ui-shadow: 0 8px 24px rgb(20 20 24 / 7%);
  }

  :root .ops-app[data-theme] {
    background: var(--ui-canvas);
  }

  :root .ops-app[data-theme] .ops-home-content { background: var(--ui-canvas); }

  :root[data-theme='light'] .ops-app[data-theme] .ops-home-content {
    background: var(--ui-canvas);
  }

  :root .ops-app[data-theme] .ops-header {
    border-bottom-color: var(--ui-border);
    background: #111;
    box-shadow: 0 1px 0 rgb(255 255 255 / 2%);
    backdrop-filter: none;
  }

  :root[data-theme='light'] .ops-app[data-theme] .ops-header {
    background: var(--ui-panel);
  }

  :root .ops-app[data-theme] .ops-brand-mark {
    border: 0;
    color: #fff;
    background: var(--ui-primary);
    font-family: 'DM Sans', sans-serif;
    font-style: normal;
    font-weight: 700;
  }

  :root .ops-app[data-theme] :is(.ops-operations-links a[aria-current='page'], .ops-production-link[aria-current='page']) {
    color: var(--ui-accent);
    background: var(--ui-accent-soft);
  }

  :root .ops-app[data-theme] .ops-overline {
    color: var(--ui-accent);
  }

  :root .ops-app[data-theme] .ops-brand-wordmark,
  :root .login-brand .ops-brand-wordmark {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    font-family: 'New Rocker', 'Arial Black', serif;
    font-size: .94em;
    font-style: normal;
    font-weight: 400;
    letter-spacing: .015em;
    line-height: 1.16;
    transform: skewX(-2deg);
    filter: drop-shadow(0 0 7px color-mix(in srgb, var(--ui-accent, #36c7ff) 18%, transparent));
  }
  :root .ops-app[data-theme] .ops-brand-wordmark::before,
  :root .ops-app[data-theme] .ops-brand-wordmark::after,
  :root .login-brand .ops-brand-wordmark::before,
  :root .login-brand .ops-brand-wordmark::after { position: absolute; content: ''; pointer-events: none; }
  :root .ops-app[data-theme] .ops-brand-wordmark::before,
  :root .login-brand .ops-brand-wordmark::before { top: -4px; left: -6px; width: 6px; height: 14px; background: var(--ui-accent, #36c7ff); clip-path: polygon(45% 0, 100% 29%, 62% 43%, 100% 100%, 24% 66%, 0 100%, 31% 39%); }
  :root .ops-app[data-theme] .ops-brand-wordmark::after,
  :root .login-brand .ops-brand-wordmark::after { right: -9px; bottom: -4px; width: 22px; height: 5px; background: var(--ui-accent, #36c7ff); clip-path: polygon(0 48%, 61% 0, 100% 0, 65% 44%, 100% 44%, 31% 100%); opacity: .9; }
  :root .ops-app[data-theme] .ops-brand-wordmark > span:first-child,
  :root .login-brand .ops-brand-wordmark > span:first-child { color: var(--ui-text, #edf6ff); text-shadow: 0 0 12px color-mix(in srgb, var(--ui-accent, #36c7ff) 22%, transparent); }
  :root .ops-app[data-theme] .ops-brand-wordmark > span:last-child,
  :root .login-brand .ops-brand-wordmark > span:last-child { margin-left: 2px; color: var(--ui-accent, #36c7ff); text-shadow: 0 0 14px color-mix(in srgb, var(--ui-accent, #36c7ff) 28%, transparent); }

  :root .ops-app[data-theme] :is(.weighings-panel, .ops-metric-card, .dosage-chart-card, .production-chat, .ops-panel, .ops-reports-panel, .erp-panel, .erp-metrics article) {
    border-color: var(--ui-border);
    border-radius: 12px;
    background-color: var(--ui-panel);
    box-shadow: var(--ui-shadow);
  }

  :root .ops-app[data-theme] :is(.ops-metric-card, .erp-metrics article) {
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
  }

  :root .ops-app[data-theme] :is(.ops-metric-card:hover, .erp-metrics article:hover) {
    transform: translateY(-2px);
    border-color: var(--ui-border-strong);
    background-color: var(--ui-raised);
  }

  :root .ops-app[data-theme] .ops-button-primary,
  :root .login-page .ops-button-primary {
    border-color: var(--ui-primary);
    color: #fff;
    background: var(--ui-primary);
    font-weight: 700;
  }

  :root .ops-app[data-theme] .ops-button-primary:hover:not(:disabled),
  :root .login-page .ops-button-primary:hover:not(:disabled) {
    border-color: var(--ui-primary-hover);
    background: var(--ui-primary-hover);
  }

  :root .ops-app[data-theme] :is(.weighings-tab.is-active, .ops-nav-item[aria-current='page']) {
    color: var(--ui-accent);
  }

  :root .ops-app[data-theme] :is(.weighings-table tbody tr:hover, .billing-table tbody tr:hover, .erp-table tbody tr:hover) {
    background: color-mix(in srgb, var(--ui-accent) 7%, var(--ui-panel));
  }

  :root .ops-app[data-theme] :is(.erp-panel, .erp-filters, .erp-map-search) {
    border-radius: 12px;
  }

  :root .ops-app[data-theme] .erp-map-node.is-search-match rect {
    stroke: var(--ui-accent);
  }

  :root .ops-app[data-theme] .production-live-status {
    display: flex;
    min-height: 38px;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: -8px 0 18px;
    color: var(--ui-muted);
    font-size: 11px;
  }

  :root .ops-app[data-theme] .production-live-status > span:last-child { color: var(--ui-subtle); }
  :root .ops-app[data-theme] .production-live-status.has-error { color: var(--ui-warning); }
  :root .ops-app[data-theme] .production-live-indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--ui-accent); box-shadow: 0 0 0 4px var(--ui-accent-soft); }

  :root .ops-app[data-theme] .production-material-consumption-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
    align-items: end;
    gap: 16px;
    margin: 0;
    padding: 20px 22px;
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    background: linear-gradient(135deg, var(--ui-panel), color-mix(in srgb, var(--ui-primary) 24%, var(--ui-panel)));
    box-shadow: var(--ui-shadow);
  }

  :root .ops-app[data-theme] .erp-loading-quiet { display: flex; align-items: center; gap: 10px; margin: 18px 2px; padding: 8px 2px; color: var(--ui-muted); font-size: 12px; }
  :root .ops-app[data-theme] .erp-loading-quiet .weighings-spinner { width: 18px; height: 18px; flex-basis: 18px; border-width: 2px; }

  :root .ops-app[data-theme] .production-material-filter-heading { grid-column: 1 / -1; display: grid; gap: 5px; }
  :root .ops-app[data-theme] .production-material-filter-heading > span,
  :root .ops-app[data-theme] .production-material-section-kicker { color: var(--ui-accent); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
  :root .ops-app[data-theme] .production-material-filter-heading > p { margin: 0; color: var(--ui-muted); font-size: 12px; line-height: 1.5; }
  :root .ops-app[data-theme] .production-material-consumption-filters label { gap: 8px; color: var(--ui-secondary); font-size: 12px; }
  :root .ops-app[data-theme] .production-material-consumption-filters input { width: 100%; min-width: 0; border: 1px solid var(--ui-border); border-radius: 10px; background: var(--ui-input); }
  :root .ops-app[data-theme] .production-material-filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
  :root .ops-app[data-theme] .production-material-filter-actions .ops-button { min-height: 42px; }
  :root .ops-app[data-theme] .production-material-period-note { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; margin: 12px 2px 20px; padding: 11px 14px; border: 1px solid var(--ui-border); border-radius: 12px; background: color-mix(in srgb, var(--ui-panel) 76%, transparent); color: var(--ui-muted); font-size: 11px; }
  :root .ops-app[data-theme] .production-material-period-note > span:first-child { color: var(--ui-secondary); font-weight: 600; }
  :root .ops-app[data-theme] .production-material-period-note strong { color: var(--ui-text); font-size: 12px; font-variant-numeric: tabular-nums; }
  :root .ops-app[data-theme] .production-material-period-note i { color: var(--ui-subtle); font-size: 10px; font-style: normal; font-weight: 400; }
  :root .ops-app[data-theme] .production-material-period-note > span:last-child { margin-left: auto; }
  :root .ops-app[data-theme] .production-material-consumption-report > .erp-metrics { gap: 12px; margin: 20px 0 24px; }
  :root .ops-app[data-theme] .production-material-consumption-report > .erp-metrics article { min-height: 104px; align-content: space-between; gap: 12px; padding: 17px 18px; border: 1px solid var(--ui-border); border-radius: 14px; background: var(--ui-panel); box-shadow: var(--ui-shadow); }
  :root .ops-app[data-theme] .production-material-consumption-report > .erp-metrics article > span { color: var(--ui-muted); font-size: 11px; }
  :root .ops-app[data-theme] .production-material-consumption-report > .erp-metrics article > strong { color: var(--ui-text); font-size: clamp(20px, 2vw, 25px); line-height: 1.1; }
  :root .ops-app[data-theme] .production-material-consumption-report > .erp-metrics article > strong small { color: var(--ui-accent); font-size: 12px; font-weight: 600; }
  :root .ops-app[data-theme] .production-material-consumption-report > .erp-metrics article.production-material-metric-primary { border-color: color-mix(in srgb, var(--ui-accent) 36%, var(--ui-border)); background: linear-gradient(140deg, color-mix(in srgb, var(--ui-primary) 76%, var(--ui-panel)), var(--ui-panel)); }
  :root .ops-app[data-theme] .production-material-consumption-report > .erp-metrics article.production-material-metric-primary > strong { font-size: clamp(24px, 2.4vw, 30px); }
  :root .ops-app[data-theme] .production-material-consumption-report .erp-panel { padding: 22px; border: 1px solid var(--ui-border); border-radius: 16px; background: var(--ui-panel); box-shadow: var(--ui-shadow); }
  :root .ops-app[data-theme] .production-material-section-heading { align-items: center; margin-bottom: 20px; }
  :root .ops-app[data-theme] .production-material-section-heading h2,
  :root .ops-app[data-theme] .production-material-table-intro h2 { margin: 4px 0 3px; color: var(--ui-text); font-size: 17px; letter-spacing: -.02em; }
  :root .ops-app[data-theme] .production-material-section-heading p,
  :root .ops-app[data-theme] .production-material-table-intro p { margin: 0; color: var(--ui-muted); font-size: 11px; line-height: 1.5; }
  :root .ops-app[data-theme] .production-material-unit-badge { flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--ui-border); border-radius: 999px; color: var(--ui-secondary); background: var(--ui-raised); font-size: 10px; font-weight: 600; }
  :root .ops-app[data-theme] .production-material-line-chart-scroll { width: 100%; overflow-x: auto; border-radius: 10px; scrollbar-color: var(--ui-border-strong) transparent; }
  :root .ops-app[data-theme] .production-material-line-chart { display: block; width: 100%; height: auto; min-width: 640px; color: var(--ui-muted); }
  :root .ops-app[data-theme] .production-material-chart-grid,
  :root .ops-app[data-theme] .production-material-chart-zero { stroke: var(--ui-border-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
  :root .ops-app[data-theme] .production-material-chart-grid { opacity: .42; }
  :root .ops-app[data-theme] .production-material-chart-zero { opacity: .8; }
  :root .ops-app[data-theme] .production-material-line-chart text { fill: currentColor; font-size: 10px; }
  :root .ops-app[data-theme] .production-material-chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
:root .ops-app[data-theme] .production-material-chart-line.is-executed { stroke: #3b82f6; }
  :root .ops-app[data-theme] .production-material-chart-line.is-planned { stroke: #c1ccd9; stroke-dasharray: 5 4; }
  :root .ops-app[data-theme] .production-material-chart-point { stroke: var(--ui-panel); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
:root .ops-app[data-theme] .production-material-chart-point.is-executed { fill: #3b82f6; }
  :root .ops-app[data-theme] .production-material-chart-point.is-planned { fill: #c1ccd9; }
  :root .ops-app[data-theme] .production-material-chart-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--ui-muted); font-size: 10px; }
  :root .ops-app[data-theme] .production-material-chart-legend > span { display: inline-flex; align-items: center; gap: 6px; }
:root .ops-app[data-theme] .production-material-chart-legend i { width: 12px; height: 3px; border-radius: 999px; background: #3b82f6; }
  :root .ops-app[data-theme] .production-material-chart-legend i.is-planned { background: #c1ccd9; }
  :root .ops-app[data-theme] .production-material-table-toolbar { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(220px, 1.1fr) auto; align-items: end; gap: 16px; margin-bottom: 18px; }
  :root .ops-app[data-theme] .production-material-table-intro { align-self: center; }
  :root .ops-app[data-theme] .production-material-table-toolbar .erp-search { min-width: 0; gap: 7px; color: var(--ui-secondary); font-size: 11px; }
  :root .ops-app[data-theme] .production-material-table-toolbar input { width: 100%; min-height: 42px; border-radius: 10px; }
  :root .ops-app[data-theme] .production-material-export-actions { justify-content: flex-end; }
  :root .ops-app[data-theme] .production-material-consumption-table { min-width: max-content; }
  :root .ops-app[data-theme] .production-material-consumption-table th:first-child,
  :root .ops-app[data-theme] .production-material-consumption-table td:first-child { min-width: 220px; text-align: left; }
  :root .ops-app[data-theme] .production-material-consumption-table thead th:not(:first-child) { text-align: center; }
  :root .ops-app[data-theme] .production-material-consumption-table td.erp-numeric { text-align: right; }
  :root .ops-app[data-theme] .production-material-consumption-table tbody tr:hover td:first-child { background: var(--ui-raised); }
  :root .ops-app[data-theme] .production-material-consumption-table td:first-child strong { color: var(--ui-text); }
  :root .ops-app[data-theme] .production-material-consumption-table td:first-child small { color: var(--ui-subtle); }
  :root .ops-app[data-theme] .production-material-consumption-table .production-material-incomplete { color: var(--ui-warning); font-size: 10px; font-weight: 600; white-space: nowrap; }
  :root .ops-app[data-theme] .production-material-consumption-table td.is-over-plan { color: var(--ui-warning); }
  :root .ops-app[data-theme] .production-material-consumption-table td.is-under-plan { color: var(--ui-accent); }
  :root .ops-app[data-theme] .production-action-cell,
  :root .ops-app[data-theme] .production-action-cell.has-production-order { width: 132px; vertical-align: top; }
  :root .ops-app[data-theme] .production-row-menu-trigger { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; border-radius: 9px; color: var(--ui-secondary); white-space: nowrap; }
  :root .ops-app[data-theme] .production-row-menu-trigger[aria-expanded='true'] { border-color: var(--ui-border-strong); background: var(--ui-raised); color: var(--ui-text); }
  :root .ops-app[data-theme] .production-row-menu-trigger svg { transition: transform .16s ease; }
  :root .ops-app[data-theme] .production-row-menu-trigger[aria-expanded='true'] svg { transform: rotate(180deg); }
  :root .ops-app[data-theme] .production-actions-popover { position: fixed; z-index: 1400; display: grid; width: 190px; gap: 6px; padding: 8px; border: 1px solid var(--ui-border-strong); border-radius: 12px; background: var(--ui-panel); box-shadow: 0 16px 40px rgb(0 0 0 / 42%); }
  :root .ops-app[data-theme] .production-actions-popover > .ops-button { display: inline-flex; width: 100%; min-height: 36px; align-items: center; justify-content: flex-start; gap: 9px; padding: 0 10px; border-radius: 8px; font-size: 11px; text-decoration: none; white-space: nowrap; }
  :root .ops-app[data-theme] .production-material-consumption-report .ops-breadcrumb { margin: 0 12px 36px; padding-inline: 4px; }
  :root .ops-app[data-theme] .production-material-consumption-report .ops-breadcrumb { margin: 0 12px 36px; padding-inline: 4px; }
  :root .ops-app[data-theme] .production-material-consumption-report .erp-report-heading { padding: 12px 12px 20px; }
  :root .ops-app[data-theme] .production-material-consumption-report .erp-report-heading > div { min-width: 0; padding: 10px 12px 4px; }
  :root .ops-app[data-theme] .production-material-consumption-report .erp-report-heading .ops-overline { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: var(--ui-accent-soft); }
  :root .ops-app[data-theme] .production-material-consumption-report .erp-report-heading h1 { max-width: 100%; overflow-wrap: anywhere; }
  :root .ops-app[data-theme] .production-material-export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  :root .ops-app[data-theme] .production-material-export-actions .ops-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
  :root .ops-app[data-theme] .production-material-quantity-pair { display: inline-flex; align-items: baseline; justify-content: center; gap: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
  :root .ops-app[data-theme] .production-material-quantity-pair > strong { color: var(--ui-text); }
  :root .ops-app[data-theme] .production-material-quantity-pair > small { color: var(--ui-subtle); font-size: 9px; font-weight: 500; }
  :root .ops-app[data-theme] .production-material-quantity-pair > i { color: var(--ui-subtle); font-size: 10px; font-style: normal; }

  :root .ops-app[data-theme] .production-material-consumption-table th:first-child,
  :root .ops-app[data-theme] .production-material-consumption-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 230px;
    background: var(--ui-panel);
    box-shadow: 8px 0 12px -12px rgb(0 0 0 / 75%);
  }

  :root .ops-app[data-theme] .production-material-consumption-table thead th:first-child { z-index: 3; background: var(--ui-raised); }
  :root .ops-app[data-theme] .production-material-consumption-table tfoot th,
  :root .ops-app[data-theme] .production-material-consumption-table tfoot td { border-top: 2px solid var(--ui-border-strong); background: var(--ui-raised); }
  :root .ops-app[data-theme] .production-material-consumption-table tfoot th:first-child { background: var(--ui-raised); }

  /* Shared screen system for operational, report and account pages. */
  :root .ops-app[data-theme] .ops-main:not(.production-stats-main) {
    width: min(calc(100% - 48px), 1440px);
    padding: 32px 0 52px;
  }

  :root .ops-app[data-theme] .ops-page-heading {
    align-items: center;
    gap: 22px;
    margin-top: 26px;
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid color-mix(in srgb, var(--ui-border) 38%, transparent);
  }

  :root .ops-app[data-theme] .production-stats-heading {
    align-items: flex-start;
    text-align: left;
  }

  :root .ops-app[data-theme] .production-stats-heading > div { text-align: left; }

  :root .ops-app[data-theme] .ops-page-heading h1 {
    font-size: clamp(27px, 3vw, 38px);
    letter-spacing: -1.35px;
  }

  :root .ops-app[data-theme] .ops-page-heading p {
    max-width: 720px;
    font-size: 13px;
  }

  :root .ops-app[data-theme] :is(.ops-panel, .weighings-panel, .dosage-chart-card, .production-chat, .ops-reports-panel, .erp-panel, .users-profile-card) {
    border-radius: 14px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 12%);
  }

  :root .ops-app[data-theme] :is(.weighings-panel-heading h2, .dosage-chart-heading h2, .ops-panel-heading h2, .ops-reports-heading h2, .production-chat-header h2, .erp-toolbar h2) {
    font-size: 16px;
    letter-spacing: -.35px;
  }

  :root .ops-app[data-theme] .ops-metrics {
    gap: 16px;
    margin-top: 24px;
    margin-bottom: 24px;
  }

  :root .ops-app[data-theme] :is(.ops-metric-card, .erp-metrics article) {
    padding: 20px;
    border-radius: 14px;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
  }

  :root .ops-app[data-theme] :is(.ops-metric-card:hover, .erp-metrics article:hover) {
    transform: translateY(-2px);
    border-color: var(--ui-border-strong);
    background-color: var(--ui-raised);
  }

  :root .ops-app[data-theme] :is(.ops-button, .weighings-page-button, .almox-branches button, .weighings-tab) {
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  }

  :root .ops-app[data-theme] .ops-button:active:not(:disabled) { transform: scale(.98); }
  :root .ops-app[data-theme] .ops-button-secondary { border-radius: 999px; }

  :root .ops-app[data-theme] :is(input:not([type='checkbox']):not([type='radio']), select, textarea) {
    border-radius: 9px;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
  }

  :root .ops-app[data-theme] :is(input:not([type='checkbox']):not([type='radio']), select, textarea):focus-visible {
    border-color: var(--ui-accent);
    outline: 0;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 22%, transparent);
  }

  :root .ops-app[data-theme] :is(.weighings-table-wrap, .billing-table-scroll, .almox-table-scroll, .lineup-analysis-table-scroll, .erp-table-scroll) {
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: var(--ui-panel);
  }

  :root .ops-app[data-theme] :is(.weighings-table, .billing-table, .almox-table, .lineup-analysis-table, .erp-table) thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid var(--ui-border);
    background: var(--ui-raised);
    letter-spacing: .045em;
  }

  :root .ops-app[data-theme] :is(.weighings-table, .billing-table, .almox-table, .lineup-analysis-table, .erp-table) tbody tr {
    transition: background-color 120ms ease;
  }

  :root .ops-app[data-theme] :is(.weighings-table td, .billing-table td, .almox-table td, .lineup-analysis-table td, .erp-table td) {
    border-color: var(--ui-border);
  }

  :root .ops-app[data-theme] :is(.ops-search, .weighings-date-filter, .erp-map-search, .billing-search) { border-radius: 999px; }
  :root .ops-app[data-theme] :is(.weighings-tabs, .almox-branches) { gap: 8px; }
  :root .ops-app[data-theme] .weighings-tab.is-active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-accent) 30%, transparent); }

  :root .ops-app[data-theme] .ops-operations-dropdown {
    padding: 9px;
    border-radius: 14px;
    backdrop-filter: blur(18px);
  }

  :root .ops-app[data-theme] :is(.ops-operations-group-trigger, .ops-operations-links a, .ops-menu-search-result) { border-radius: 9px; }
  :root .ops-app[data-theme] .weighing-modal-backdrop { backdrop-filter: none; }

  :root .ops-app[data-theme] .weighing-process-modal {
    border: 1px solid var(--ui-border-strong);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgb(0 0 0 / 40%);
  }

  :root .ops-app[data-theme] :is(.weighings-state, .almox-alert, .erp-notice, .production-export-error) { border-radius: 12px; }
  :root .ops-app[data-theme] :is(.it-server-card, .it-summary-card, .it-history-section, .stoppage-workspace, .billing-filter-panel, .production-process-map, .production-process-order, .production-process-observation, .production-stoppages-entry) {
    border-color: var(--ui-border);
    border-radius: 14px;
  }

  :root .ops-app[data-theme] :is(.it-server-card, .it-summary-card, .production-process-order, .production-process-observation) {
    background: var(--ui-panel);
    box-shadow: var(--ui-shadow);
  }

  :root .ops-app[data-theme] :is(.production-process-node, .it-server-card, .almox-branches button) {
    transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
  }

  :root .ops-app[data-theme] .production-process-node:hover {
    transform: translateY(-2px);
    border-color: var(--ui-accent);
  }

  :root .ops-app[data-theme] :is(.stoppage-table, .it-incidents) thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--ui-raised);
  }

  :root .ops-app[data-theme] ::-webkit-scrollbar { width: 10px; height: 10px; }
  :root .ops-app[data-theme] ::-webkit-scrollbar-thumb { border: 2px solid var(--ui-panel); border-radius: 999px; background: var(--ui-border-strong); }
  :root .ops-app[data-theme] ::-webkit-scrollbar-thumb:hover { background: var(--ui-subtle); }

  :root .login-page {
    background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--ui-primary) 40%, transparent), transparent 58%), var(--ui-canvas);
  }

  :root .login-card {
    border: 1px solid var(--ui-border);
    border-radius: 18px;
    background: var(--ui-panel);
    box-shadow: 0 24px 80px rgb(0 0 0 / 28%);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root .ops-app[data-theme] :is(.ops-metric-card, .erp-metrics article, .ops-button, .weighings-tab) {
    transition: none;
  }
}

@media screen and (max-width: 760px) {
  :root .ops-app[data-theme] .ops-main:not(.production-stats-main) {
    width: min(calc(100% - 28px), 1440px);
    padding-top: 22px;
    padding-bottom: 36px;
  }

  :root .ops-app[data-theme] .ops-page-heading {
    align-items: flex-start;
    margin-top: 20px;
    margin-bottom: 18px;
    padding-bottom: 18px;
  }

  :root .ops-app[data-theme] .ops-heading-actions { width: 100%; flex-wrap: wrap; }
  :root .ops-app[data-theme] .ops-heading-actions .ops-button { flex: 1 1 auto; }
  :root .ops-app[data-theme] .production-material-line-chart { min-width: 620px; }
  :root .ops-app[data-theme] .production-material-consumption-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 13px; padding: 17px 15px; }
  :root .ops-app[data-theme] .production-material-filter-actions { grid-column: 1 / -1; }
  :root .ops-app[data-theme] .production-material-filter-actions .ops-button { flex: 1 1 150px; }
  :root .ops-app[data-theme] .production-material-period-note { gap: 5px 9px; padding: 10px 12px; }
  :root .ops-app[data-theme] .production-material-period-note > span:last-child { width: 100%; margin: 0; }
  :root .ops-app[data-theme] .production-material-consumption-report > .erp-metrics article { min-height: 92px; padding: 14px; }
  :root .ops-app[data-theme] .production-material-consumption-report .erp-panel { padding: 17px 14px; }
  :root .ops-app[data-theme] .production-material-section-heading { align-items: flex-start; gap: 10px; }
  :root .ops-app[data-theme] .production-material-section-heading .production-material-unit-badge { margin-top: 2px; }
  :root .ops-app[data-theme] .production-material-table-toolbar { grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 13px; }
  :root .ops-app[data-theme] .production-material-export-actions { justify-content: flex-start; }
  :root .ops-app[data-theme] .production-material-export-actions .ops-button { flex: 1 1 130px; }
  :root .ops-app[data-theme] .production-material-consumption-table th:first-child,
  :root .ops-app[data-theme] .production-material-consumption-table td:first-child { min-width: 180px; }
  :root .ops-app[data-theme] .production-material-consumption-report .erp-report-heading { padding: 10px 6px 16px; }
  :root .ops-app[data-theme] .production-material-consumption-report .ops-breadcrumb { margin: 0 0 30px; }
  :root .ops-app[data-theme] .production-row-menu-trigger { min-height: 36px; }
}

/* Compact segmented navigation inspired by the supplied header reference. */
:root .ops-app[data-theme] .ops-primary-nav {
  width: max-content;
  max-width: 100%;
  height: auto;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-panel) 68%, #000);
}

:root .ops-app[data-theme] .ops-header {
  gap: clamp(16px, 2.1vw, 28px);
}

:root .ops-app[data-theme] .ops-primary-nav > .ops-nav-item,
:root .ops-app[data-theme] .ops-primary-nav .ops-operations-trigger {
  height: 36px;
  flex: 0 0 auto;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 150ms ease, background-color 150ms ease;
}

:root .ops-app[data-theme] .ops-primary-nav > .ops-nav-item:hover,
:root .ops-app[data-theme] .ops-primary-nav .ops-operations-trigger:hover,
:root .ops-app[data-theme] .ops-primary-nav .ops-operations-trigger[aria-expanded='true'] {
  color: var(--ui-text);
  background: var(--ui-hover);
}

:root .ops-app[data-theme] .ops-primary-nav > .ops-nav-item[aria-current='page'],
:root .ops-app[data-theme] .ops-primary-nav .ops-operations-trigger.is-active {
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}

:root[data-theme='light'] .ops-app[data-theme] .ops-primary-nav > .ops-nav-item[aria-current='page'],
:root[data-theme='light'] .ops-app[data-theme] .ops-primary-nav .ops-operations-trigger.is-active {
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}

:root .ops-app[data-theme] .ops-primary-nav .ops-operations-menu {
  display: flex;
  height: auto;
  align-items: center;
}

@media screen and (max-width: 1200px) {
  :root .ops-app[data-theme] .ops-header {
    column-gap: 16px;
    row-gap: 0;
  }

  :root .ops-app[data-theme] .ops-primary-nav {
    width: max-content;
    max-width: 100%;
    height: auto;
    min-height: 42px;
    justify-content: flex-start;
    border-top: 1px solid var(--ui-border);
  }
}

@media screen and (max-width: 680px) {
  :root .ops-app[data-theme] .ops-header {
    column-gap: 6px;
  }

  :root .ops-app[data-theme] .ops-primary-nav {
    width: max-content;
    max-width: 100%;
    min-height: 40px;
    gap: 1px;
    padding: 3px;
  }

  :root .ops-app[data-theme] .ops-primary-nav > .ops-nav-item,
  :root .ops-app[data-theme] .ops-primary-nav .ops-operations-trigger {
    height: 32px;
    gap: 5px;
    padding-inline: 8px;
    font-size: 10px;
  }
}

@page {
  size: landscape;
  margin: 12mm;
}

@media print {
  html, body, #root, .ops-app { color: #111 !important; background: #fff !important; }
  .ops-header { display: none !important; }
  .production-material-consumption-report {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #111 !important;
    background: #fff !important;
    font: 9pt/1.35 Arial, sans-serif !important;
  }

  .production-material-consumption-report .ops-breadcrumb,
  .production-material-consumption-report .production-material-consumption-filters,
  .production-material-consumption-report .production-material-table-toolbar,
  .production-material-consumption-report .ops-overline { display: none !important; }

  .production-material-consumption-report .erp-report-heading {
    display: block !important;
    margin: 0 0 10mm !important;
    padding: 0 0 5mm !important;
    border-bottom: 1px solid #c8cdd4 !important;
  }

  .production-material-consumption-report .erp-report-heading > div { padding: 0 !important; }
  .production-material-consumption-report .erp-report-heading h1 { margin: 0 0 3mm !important; padding: 0 !important; color: #14233b !important; font-size: 21pt !important; overflow-wrap: normal !important; }
  .production-material-consumption-report .erp-report-heading p,
  .production-material-consumption-report .production-material-period-note { color: #485466 !important; font-size: 9pt !important; }
  .production-material-consumption-report .erp-panel,
  .production-material-consumption-report .erp-metrics article { break-inside: avoid; border: 1px solid #d7dce3 !important; border-radius: 5px !important; color: #111 !important; background: #fff !important; box-shadow: none !important; }
  .production-material-consumption-report .erp-panel { margin: 0 0 6mm !important; padding: 4mm !important; }
  .production-material-consumption-report .erp-toolbar h2,
  .production-material-consumption-report .erp-panel h2 { color: #14233b !important; font-size: 12pt !important; }
  .production-material-consumption-report .erp-muted { color: #4b5563 !important; }
  .production-material-consumption-report .erp-metrics { grid-template-columns: repeat(5, 1fr) !important; gap: 3mm !important; margin: 4mm 0 6mm !important; }
  .production-material-consumption-report .erp-metrics article { padding: 3mm !important; }
  .production-material-consumption-report .erp-metrics article > span { color: #596579 !important; font-size: 8pt !important; }
  .production-material-consumption-report .erp-metrics article > strong { color: #14233b !important; font-size: 13pt !important; }
  .production-material-consumption-report .erp-table-scroll { overflow: visible !important; border-color: #cfd5dd !important; }
  .production-material-consumption-report .production-material-consumption-table { width: 100% !important; border-collapse: collapse !important; font-size: 7pt !important; }
  .production-material-consumption-report .production-material-consumption-table th,
  .production-material-consumption-report .production-material-consumption-table td { position: static !important; min-width: 0 !important; padding: 2mm 1.5mm !important; color: #111 !important; background: #fff !important; box-shadow: none !important; border-color: #d8dde4 !important; white-space: normal !important; overflow-wrap: anywhere !important; }
  .production-material-consumption-report .production-material-consumption-table thead th { color: #26364f !important; background: #eef1f5 !important; }
  .production-material-consumption-report .production-material-consumption-table tfoot th,
  .production-material-consumption-report .production-material-consumption-table tfoot td { background: #e8edf3 !important; }
  .production-material-consumption-report .production-material-consumption-table tr { break-inside: avoid; }
  .production-material-consumption-report .production-material-day-track { background: #e7ebf0 !important; }
  .production-material-consumption-report .production-material-day-track i { background: #2563eb !important; print-color-adjust: exact; }
}

/* Keep keyboard focus clear while the rest follows Spotify's restrained surfaces. */
:root .ops-app[data-theme] :is(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline-color: var(--ui-accent);
  outline-offset: 3px;
}

:root .ops-app[data-theme] ::selection {
  color: var(--ui-text);
  background: color-mix(in srgb, var(--ui-accent) 36%, transparent);
}

/* A quieter, neutral treatment for the global header and account identity. */
:root .ops-app[data-theme] .ops-header {
  border-bottom: 1px solid color-mix(in srgb, var(--ui-border) 62%, transparent);
  box-shadow: 0 5px 18px rgb(0 0 0 / 8%);
}

:root .ops-app[data-theme] .ops-account-menu .ops-user-profile {
  max-width: 240px;
  gap: 9px;
  padding: 4px 8px 4px 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ui-secondary);
  background: transparent;
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

:root .ops-app[data-theme] .ops-account-menu .ops-user-profile:hover,
:root .ops-app[data-theme] .ops-account-menu .ops-user-profile[aria-expanded='true'] {
  border-color: var(--ui-border);
  color: var(--ui-text);
  background: color-mix(in srgb, var(--ui-raised) 72%, transparent);
}

:root .ops-app[data-theme] .ops-account-menu .ops-user-profile .ops-avatar {
  border: 1px solid var(--ui-border-strong);
  color: var(--ui-secondary);
  background: color-mix(in srgb, var(--ui-raised) 82%, var(--ui-panel));
}

:root .ops-app[data-theme] .ops-account-menu .ops-user-name {
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media screen and (max-width: 680px) {
  :root .ops-app[data-theme] .ops-account-menu .ops-user-profile { max-width: 180px; }
}

:root .ops-app[data-theme] {
  --home-map-state: #20242a;
  --home-map-production: #254a75;
  --home-map-stroke: #626b76;
}

:root[data-theme='light'] .ops-app[data-theme] {
  --home-map-state: #e1e3e6;
  --home-map-production: #193a66;
  --home-map-stroke: #a2a8af;
}

.ops-home-content.home-production-shell {
  min-height: calc(100vh - 68px);
  background: var(--ui-canvas);
}

.home-production-page { width: min(100%, 1380px); margin: 0 auto; padding: 44px 32px 60px; }
.home-production-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.home-production-heading h1 { margin: 7px 0 5px; color: var(--ui-text); font-size: clamp(26px, 3vw, 36px); font-weight: 600; letter-spacing: -1.2px; }
.home-production-heading p { margin: 0; color: var(--ui-muted); font-size: 13px; }
.home-production-date-range { display: flex; align-items: end; gap: 10px; }
.home-production-date { display: grid; min-width: 190px; gap: 6px; color: var(--ui-muted); font-size: 10px; font-weight: 600; }
.home-production-date input { min-height: 40px; padding: 8px 11px; border: 1px solid var(--ui-border); border-radius: 9px; color: var(--ui-text); background: var(--ui-panel); font: inherit; font-size: 12px; }
.home-production-panel { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.home-production-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 1px; margin-bottom: 8px; border: 0; }
.home-production-panel-heading .ops-overline { font-size: 9px; letter-spacing: .1em; }
.home-production-panel-heading h2 { margin: 4px 0 0; color: var(--ui-text); font-size: 17px; font-weight: 600; letter-spacing: -.35px; }
.home-production-refresh { color: var(--ui-subtle); font-size: 10px; }
.home-production-content { display: grid; grid-template-columns: 660px minmax(0, 1fr); align-items: center; gap: clamp(22px, 3vw, 42px); padding: 10px 0 12px; }
.home-brazil-map-wrap { position: relative; grid-row: 1 / 3; width: min(100%, 660px); align-self: center; justify-self: center; padding: 8px; overflow: visible; }
.home-brazil-map { position: relative; z-index: 1; display: block; width: 100%; height: auto; overflow: visible; }
.home-brazil-state { fill: var(--home-map-state); stroke: var(--home-map-stroke); stroke-width: .72; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: fill 160ms ease; }
.home-brazil-state.is-production { fill: var(--home-map-production); }
.home-brazil-map-wrap {
  --home-delivery-line: #4f83db;
  --home-delivery-route-accent: #78a5f0;
  --home-delivery-accent: var(--home-delivery-route-accent);
}
:root[data-theme='light'] .home-brazil-map-wrap { --home-delivery-line: #2563eb; --home-delivery-route-accent: #4f83db; }
.home-delivery-route, .home-delivery-route-flow { fill: none; stroke: var(--home-delivery-line); stroke-linecap: round; vector-effect: non-scaling-stroke; }
.home-delivery-route { stroke-width: 1.5; stroke-dasharray: none; opacity: .78; pointer-events: stroke; }
.home-delivery-route-flow { stroke: var(--home-delivery-route-accent); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; pointer-events: none; animation: home-delivery-connect 4.8s linear infinite; }
@keyframes home-delivery-connect {
  0% { stroke-dashoffset: 1; opacity: 0; }
  4% { stroke-dashoffset: .94; opacity: 1; }
  70% { stroke-dashoffset: 0; opacity: 1; }
  90% { stroke-dashoffset: 0; opacity: .8; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
.home-delivery-marker circle { vector-effect: non-scaling-stroke; }
.home-delivery-marker-halo { fill: var(--home-delivery-accent); opacity: .12; }
.home-delivery-marker-ring { fill: var(--ui-panel); stroke: var(--home-delivery-accent); stroke-width: 1; }
.home-delivery-marker-pulse { fill: none; stroke: var(--home-delivery-accent); stroke-width: 1; opacity: 0; transform-box: fill-box; transform-origin: center; animation: home-delivery-end-pulse 2.4s ease-out infinite; }
.home-delivery-marker-pulse.is-delayed { animation-delay: -1.2s; }
.home-delivery-marker-core { fill: var(--home-delivery-accent); animation: home-delivery-dot-blink 2.4s ease-in-out infinite; }
@keyframes home-delivery-dot-blink { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes home-delivery-end-pulse {
  0% { opacity: 0; transform: scale(.75); }
  12% { opacity: .5; }
  75% { opacity: .08; }
  100% { opacity: 0; transform: scale(2.2); }
}
.home-map-delivery-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 5px 9px 0; color: var(--ui-muted); font-size: 10px; }
.home-map-delivery-key { width: 24px; height: 0; border-top: 2px solid var(--home-delivery-line); }
.home-map-delivery-error { color: var(--ui-danger); }
.home-brazil-map-stage { position: relative; width: 100%; }
.home-factory-pin { filter: drop-shadow(0 4px 7px rgb(0 0 0 / 32%)); }
.home-factory-pin.is-bom-jesus { opacity: .72; }
.home-factory-pin-marker { fill: #f5f7fa; stroke-width: 4; }
.home-factory-pin.is-paranagua .home-factory-pin-marker { stroke: #4f83db; }
.home-factory-pin.is-barcarena .home-factory-pin-marker { stroke: #df5a5a; }
.home-factory-pin-pulse { fill: none; stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; animation: home-factory-pin-pulse 1.45s ease-out infinite; }
.home-factory-pin-pulse.is-subtle { stroke-width: 1.5; animation: home-factory-pin-soft-pulse 3.6s ease-in-out infinite; }
.home-factory-pin.is-paranagua .home-factory-pin-pulse { stroke: #4f83db; }
.home-factory-pin.is-barcarena .home-factory-pin-pulse { stroke: #df5a5a; }
.home-factory-pin.is-bom-jesus .home-factory-pin-marker, .home-factory-pin.is-bom-jesus .home-factory-pin-pulse { stroke: #9aa2ab; }
.home-factory-leader { fill: none; stroke-width: 1.15; opacity: .68; vector-effect: non-scaling-stroke; }
.home-factory-leader.is-paranagua { stroke: #4f83db; }
.home-factory-leader.is-barcarena { stroke: #df5a5a; }
.home-factory-leader.is-bom-jesus { stroke: #9aa2ab; }
@keyframes home-factory-pin-pulse { 0% { opacity: .95; transform: scale(.8); } 78%, 100% { opacity: 0; transform: scale(2.65); } }
@keyframes home-factory-pin-soft-pulse { 0%, 100% { opacity: .06; transform: scale(.8); } 50% { opacity: .26; transform: scale(1.35); } }
.home-factory-pin-core { fill: var(--ui-panel); }
.home-factory-pin > path { fill: none; stroke: #f5f7fa; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-factory-pin > rect { fill: color-mix(in srgb, var(--ui-panel) 92%, #08090b); stroke-width: 1.1; }
.home-factory-pin.is-paranagua > rect { stroke: color-mix(in srgb, #4f83db 72%, var(--ui-border-strong)); }
.home-factory-pin.is-barcarena > rect { stroke: color-mix(in srgb, #df5a5a 72%, var(--ui-border-strong)); }
.home-factory-pin > text { fill: #b6bdc7; font-family: inherit; font-size: 9px; font-weight: 600; }
.home-factory-pin > .home-factory-pin-date { fill: #8994a3; font-size: 8px; font-weight: 500; }
.home-factory-pin > .home-factory-pin-share { font-size: 9px; font-weight: 750; }
.home-factory-pin > .home-factory-pin-share.is-paranagua { fill: #78a5f0; }
.home-factory-pin > .home-factory-pin-share.is-barcarena { fill: #ef8181; }
.home-factory-pin > .home-factory-pin-value { fill: #f5f7fa; font-size: 12px; font-weight: 700; }
.home-map-callout { cursor: grab; touch-action: none; user-select: none; outline: none; }
.home-map-callout:active { cursor: grabbing; }
.home-map-callout-frame { fill: color-mix(in srgb, var(--ui-panel) 94%, #08090b); stroke: var(--ui-border-strong); stroke-width: .8; }
.home-map-callout.is-paranagua .home-map-callout-frame { stroke: color-mix(in srgb, #4f83db 72%, var(--ui-border-strong)); }
.home-map-callout.is-barcarena .home-map-callout-frame { stroke: color-mix(in srgb, #df5a5a 72%, var(--ui-border-strong)); }
.home-map-callout.is-bom-jesus .home-map-callout-frame { stroke: color-mix(in srgb, #9aa2ab 62%, var(--ui-border-strong)); }
.home-map-callout:focus-visible .home-map-callout-frame { stroke-width: 2; }
.home-map-callout-title { fill: #b6bdc7; font-family: inherit; font-size: 9px; font-weight: 650; }
.home-map-callout-date { fill: #8994a3; font-family: inherit; font-size: 8px; }
.home-map-callout-value { fill: #f5f7fa; font-family: inherit; font-size: 12px; font-weight: 700; }
.home-map-callout-share.is-paranagua { fill: #78a5f0; }
.home-map-callout-share.is-barcarena { fill: #ef8181; }
.home-map-callout-value.is-bom-jesus { fill: #f5f7fa; font-size: 11px; }
.home-map-callout-share { fill: #c4c9d0; font-family: inherit; font-size: 8px; font-weight: 700; }
.home-map-callout-dot.is-paranagua { fill: #4f83db; }
.home-map-callout-dot.is-barcarena { fill: #df5a5a; }
.home-map-callout-dot.is-bom-jesus { fill: #9aa2ab; }
.home-map-callout-grip { fill: #9aa2ab; opacity: .8; }
.home-factory-list { display: grid; grid-column: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 10px; }
.home-factory-card { padding: 15px 16px 13px; border: 1px solid color-mix(in srgb, var(--ui-border-strong) 42%, transparent); border-radius: 0; background: color-mix(in srgb, var(--ui-canvas) 94%, transparent); box-shadow: inset 0 1px 0 rgb(255 255 255 / 3%), 0 7px 22px rgb(0 0 0 / 8%); transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.home-factory-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, #142e54 68%, var(--ui-border-strong)); box-shadow: 0 12px 26px rgb(0 0 0 / 18%), 0 0 0 1px rgb(20 46 84 / 18%); }
.home-factory-card-heading { display: flex; align-items: center; gap: 10px; }
.home-factory-status { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--ui-border-strong); }
.home-factory-status.ready { background: #aeb4b0; box-shadow: 0 0 0 3px color-mix(in srgb, #aeb4b0 16%, transparent); }
.home-factory-status.error { background: var(--ui-danger); }
.home-factory-status.no-access { background: #8f969f; box-shadow: 0 0 0 3px color-mix(in srgb, #8f969f 16%, transparent); }
.home-factory-status.is-paranagua { background: #4f83db; box-shadow: 0 0 0 3px color-mix(in srgb, #4f83db 16%, transparent); }
.home-factory-status.is-barcarena { background: #df5a5a; box-shadow: 0 0 0 3px color-mix(in srgb, #df5a5a 16%, transparent); }
.home-factory-card-heading > div { display: grid; min-width: 0; gap: 2px; }
.home-factory-card-heading strong { color: var(--ui-text); font-size: 12px; font-weight: 600; }
.home-factory-card-heading small { color: var(--ui-subtle); font-size: 9px; }
.home-factory-code { display: grid; width: 27px; height: 27px; place-items: center; margin-left: auto; border: 1px solid var(--ui-border); border-radius: 8px; color: var(--ui-muted); font-size: 9px; font-weight: 700; }
.home-factory-total { margin-top: 11px; color: var(--ui-text); font-size: 24px; font-weight: 600; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.home-factory-total-row { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-top: 11px; }
.home-factory-total-row .home-factory-total { margin-top: 0; }
.home-factory-share { display: grid; flex: 0 0 auto; gap: 3px; justify-items: end; min-width: 68px; padding: 5px 8px; border-left: 2px solid var(--ui-border-strong); background: color-mix(in srgb, var(--ui-raised) 78%, transparent); text-align: right; }
.home-factory-share small { color: var(--ui-subtle); font-size: 8px; }
.home-factory-share strong { color: var(--ui-secondary); font-size: 14px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.home-factory-share.is-paranagua { border-color: #4f83db; background: color-mix(in srgb, #4f83db 10%, transparent); }
.home-factory-share.is-paranagua strong { color: #78a5f0; }
.home-factory-share.is-barcarena { border-color: #df5a5a; background: color-mix(in srgb, #df5a5a 10%, transparent); }
.home-factory-share.is-barcarena strong { color: #ef8181; }
.home-factory-total small { color: var(--ui-muted); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.home-factory-card p { min-height: 14px; margin: 2px 0 0; color: var(--ui-subtle); font-size: 9px; }
.home-factory-total-card { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: baseline; gap: 5px 12px; padding: 13px 16px; border: 1px solid color-mix(in srgb, var(--ui-border-strong) 50%, transparent); border-radius: 0; background: color-mix(in srgb, var(--ui-raised) 94%, transparent); box-shadow: inset 0 1px 0 rgb(255 255 255 / 4%), 0 8px 24px rgb(0 0 0 / 9%); transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.home-factory-total-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, #142e54 68%, var(--ui-border-strong)); box-shadow: 0 14px 28px rgb(0 0 0 / 18%), 0 0 0 1px rgb(20 46 84 / 18%); }
.home-factory-total-card > span { color: var(--ui-secondary); font-size: 10px; font-weight: 600; }
.home-factory-total-card > strong { color: var(--ui-text); font-size: 20px; font-variant-numeric: tabular-nums; }
.home-factory-total-card > strong small { color: var(--ui-muted); font-size: 10px; font-weight: 500; }
.home-factory-total-card > small { grid-column: 1 / -1; color: var(--ui-subtle); font-size: 9px; }
.home-production-source { margin: 7px 2px 0; color: var(--ui-subtle); font-size: 9px; line-height: 1.5; }
.home-production-panel .home-production-trend { min-width: 0; align-self: stretch; margin: 0; padding: 22px; border: 1px solid color-mix(in srgb, var(--ui-border-strong) 42%, transparent); border-radius: 16px; background: var(--ui-panel); box-shadow: inset 0 1px 0 rgb(255 255 255 / 3%), 0 7px 22px rgb(0 0 0 / 8%); }
.home-production-trend-heading h2 { margin: 0; color: var(--ui-text); font-size: 14px; font-weight: 600; }
.home-production-trend-heading p { margin: 6px 0 16px; color: var(--ui-muted); font-size: 10px; line-height: 1.5; }
.home-chart-legend i.is-paranagua { background: #4f83db; }
.home-chart-legend i.is-barcarena { background: #df5a5a; }
.home-chart-legend strong { color: var(--dosage-chart-text); font-size: 11px; font-weight: 500; }
.home-trend-message { margin: 0; padding: 35px 10px; color: var(--ui-muted); font-size: 11px; text-align: center; }
.home-trend-message.is-error { color: var(--ui-danger); }

@media (prefers-reduced-motion: reduce) {
  .home-delivery-route-flow { animation: none; display: none; }
  .home-delivery-route { opacity: .85; }
  .home-delivery-marker-core { animation: none; opacity: 1; }
  .home-delivery-marker-pulse { animation: none; display: none; }
  .home-factory-pin-pulse { animation: none; opacity: .5; transform: scale(1.15); }
  .home-factory-pin-pulse.is-subtle { animation: none; opacity: .16; transform: scale(1); }
}

@media screen and (max-width: 1200px) {
  .home-production-content { grid-template-columns: minmax(0, 1fr); }
  .home-brazil-map-wrap { grid-row: auto; width: min(100%, 660px); }
  .home-factory-list { grid-column: 1 / -1; }
  .home-production-trend { grid-column: 1 / -1; }
}

@media screen and (max-width: 1000px) {
  .home-production-page { padding: 34px 22px 42px; }
  .home-production-heading { align-items: stretch; flex-direction: column; gap: 16px; }
  .home-production-date-range { justify-content: flex-start; }
  .home-production-content { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .home-brazil-map-wrap { grid-row: auto; width: min(100%, 660px); }
  .home-factory-list { width: min(100%, 580px); grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-self: center; }
  .home-factory-total-card { grid-column: 1 / -1; }
  .home-production-trend { grid-column: 1 / -1; }
}

@media screen and (max-width: 560px) {
  .home-production-page { padding: 28px 14px 32px; }
  .home-production-heading { align-items: stretch; flex-direction: column; gap: 16px; margin-bottom: 18px; }
  .home-production-date-range { align-items: end; flex-direction: row; gap: 8px; }
  .home-production-date { min-width: 0; flex: 1 1 0; }
  .home-production-panel { padding: 0; border-radius: 0; }
  .home-production-panel .home-production-trend { padding: 16px; border-radius: 14px; }
  .home-brazil-map-wrap { padding: 11px; border-radius: 14px; }
  .home-production-panel-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .home-factory-list { grid-template-columns: minmax(0, 1fr); }
  .home-factory-total-card { grid-column: auto; }
}

@media screen and (max-width: 650px) {
  .home-map-callout-title { font-size: 8px; }
  .home-map-callout-date, .home-map-callout-share { font-size: 7px; }
  .home-map-callout-value { font-size: 10px; }
}

/* Neutral translucent surfaces across the dark-mode screens. */
:root[data-theme='dark'] #root :is(
  [class*='-panel'],
  [class*='-card'],
  [class*='-modal'],
  [class*='-popover'],
  [class*='-dropdown'],
  [class*='-drawer']
):not(.home-production-panel):not(.weighing-modal-backdrop):not(.machinery-modal-backdrop):not(.machinery-modal-dialog):not([class*='heading']):not([class*='header']):not([class*='title']) {
  background-color: var(--ui-panel) !important;
  background-image: none !important;
}

/* Keep Home on the same base palette as every other page. */
:root[data-theme='dark'] #root .ops-app:has(.home-production-page) {
  --ui-canvas: #181a1d;
  --ui-panel: #212429;
  --ui-raised: #292d33;
  --ui-hover: #32373f;
  --ui-input: #15171a;
  --ui-border: #343a42;
  --ui-border-strong: #4a525d;
  --ui-text: #f4f5f6;
  --ui-secondary: #d6d9de;
  --ui-muted: #b5bbc4;
  --ui-subtle: #929aa5;
  --ui-accent: #d6d9de;
  --ui-accent-soft: #1d2d42;
  --ui-primary: #24466f;
  --ui-primary-hover: #2d5685;
  --ui-shadow: 0 8px 24px rgb(0 0 0 / 22%);
}

:root[data-theme='light'] #root .ops-app:has(.home-production-page) {
  --ui-canvas: #f4f4f5;
  --ui-panel: #fff;
  --ui-raised: #f7f7f8;
  --ui-hover: #eeeef1;
  --ui-input: #fff;
  --ui-border: #e4e4e7;
  --ui-border-strong: #c4c4cc;
  --ui-text: #18181b;
  --ui-secondary: #3f3f46;
  --ui-muted: #62626c;
  --ui-subtle: #71717a;
  --ui-accent: #142e54;
  --ui-accent-soft: #e8edf7;
  --ui-primary: #142e54;
  --ui-primary-hover: #1c3c69;
  --ui-shadow: 0 4px 16px rgb(25 25 25 / 7%);
}

:root[data-theme='dark'] #root .ops-app:has(.home-production-page) .ops-header {
  --ui-accent: #d4d4d8;
  --ui-accent-soft: #14263f;
  --ui-primary: #142e54;
  --ui-primary-hover: #1c3c69;
}

:root[data-theme='light'] #root .ops-app:has(.home-production-page) .ops-header {
  --ui-accent: #142e54;
  --ui-accent-soft: #e8edf7;
  --ui-primary: #142e54;
  --ui-primary-hover: #1c3c69;
}

:root[data-theme='dark'] #root .ops-app:has(.home-production-page) .ops-home-content {
  background: transparent !important;
  background-image: none !important;
}

:root[data-theme='light'] #root .ops-app:has(.home-production-page) .ops-home-content {
  background: transparent !important;
  background-image: none !important;
}

:root #root .ops-app .home-production-page {
  background: transparent !important;
  background-image: none !important;
}

:root[data-theme='dark'] #root .ops-app .home-production-panel,
:root[data-theme='light'] #root .ops-app .home-production-panel {
  background: transparent !important;
  background-image: none !important;
}

:root[data-theme='dark'] #root .ops-app .home-production-panel {
  background-color: transparent !important;
}

:root[data-theme='dark'] #root .ops-app .home-production-panel-heading,
:root[data-theme='light'] #root .ops-app .home-production-panel-heading {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

:root[data-theme='dark'] #root .ops-app .home-production-panel-heading .ops-overline {
  color: var(--home-map-production);
}

:root[data-theme='dark'] #root .ops-app .home-factory-card {
  background: var(--ui-panel) !important;
  background-image: none !important;
}

:root[data-theme='dark'] #root .ops-app .home-factory-total-card {
  background: var(--ui-raised) !important;
  background-image: none !important;
}

/* Spotify-inspired visual language shared by every page. */
:root #root .ops-app[data-theme] :is(
  [class*='-card'], [class*='-panel'], [class*='-modal'], [class*='-dialog']
):not(.weighing-modal-backdrop):not([class*='heading']):not([class*='header']):not([class*='title']):not([class*='body']):not([class*='footer']) {
  border-radius: 14px !important;
}
:root #root .ops-app[data-theme] :is(dialog, [role='dialog'], [class$='-modal'], [class$='-dialog']) {
  border-radius: 18px !important;
}
:root #root .ops-app[data-theme] :is(.ops-button, .weighings-page-button, [class*='-button']) {
  border-radius: 999px;
}
:root #root .ops-app[data-theme] :is(
  .ops-metric-icon, .weighings-database-icon, .weighings-empty-icon,
  .weighing-modal-heading-icon, .ops-icon-button
) { border-radius: 50% !important; }
:root #root .ops-app[data-theme] :is(.it-server-icon, .ops-report-icon, .ops-menu-search-result-icon) {
  border-radius: 12px !important;
}
:root #root .ops-app[data-theme] :is(input, select, textarea) { border-radius: 10px; }
:root #root .ops-app[data-theme] :is(.ops-icon-green, .ops-icon-purple, .ops-icon-orange) {
  border-color: var(--ui-border);
  color: #d4d4d8;
  background: rgb(255 255 255 / 8%);
}
:root #root .ops-app[data-theme] .ops-icon-blue {
  border-color: transparent;
  color: #a8bfdc;
  background: rgb(20 46 84 / 40%);
}
:root #root .ops-app[data-theme] :is(
  [class*='-card'], [class*='-panel'], [class*='-modal'], [class*='-dialog'],
  .home-production-trend, .it-metrics, .workforce-calendar
):not(.home-production-panel):not(.weighing-modal-backdrop):not(.machinery-modal-backdrop):not(.machinery-modal-dialog):not([class*='heading']):not([class*='header']):not([class*='title']):not([class*='body']):not([class*='footer']) {
  border-color: var(--ui-border) !important;
  background-color: var(--ui-panel) !important;
  background-image: none !important;
  box-shadow: none !important;
}
:root #root .ops-app[data-theme] :is(.it-summary-card, .workforce-shift-card):hover {
  background-color: var(--ui-hover) !important;
}
:root[data-theme='dark'] #root .ops-app[data-theme] .home-production-panel {
  background-color: transparent !important;
  background-image: none !important;
}
:root #root .ops-app[data-theme] .production-stats-layout { border-radius: 20px !important; }
:root #root .ops-app[data-theme] .production-stats-main .ops-metric-card,
:root #root .ops-app[data-theme] .production-stats-main .dosage-chart-card {
  border-radius: 18px !important;
}
:root #root .ops-app[data-theme] :is(.production-stats-layout, .production-batches-report, .production-stats-main) {
  background-color: var(--ui-canvas) !important;
  background-image: none !important;
}
:root #root .login-page {
  background: var(--ui-canvas) !important;
  background-image: none !important;
}
:root #root .login-page .login-card {
  border: 1px solid var(--ui-border) !important;
  border-radius: 16px !important;
  background: var(--ui-panel) !important;
  box-shadow: none !important;
}
:root #root .ops-app[data-theme] :is([class*='table-scroll'], [class*='table-wrap'], [class*='table-container']) {
  border-radius: 12px;
}
:root #root .ops-app[data-theme] .production-stats-main .ops-metric-card:hover {
  border-color: #505050;
  box-shadow: 0 12px 30px rgb(0 0 0 / 18%);
}

/* Menus and floating popovers keep their rounded containers. */
:root #root .ops-app .ops-operations-dropdown { border-radius: 14px !important; }
:root #root .ops-app .ops-production-dropdown { border-radius: 10px !important; }
:root #root .ops-app .ops-account-dropdown { border-radius: 12px !important; }
:root #root .ops-app .ops-menu-search-dropdown { border-radius: 16px !important; }
:root #root .ops-app .ops-notification-panel { border-radius: 12px !important; }
:root #root .ops-app .production-actions-popover { border-radius: 12px !important; }

@media screen and (max-width: 680px) {
  :root #root .ops-app .ops-menu-search-dropdown { border-radius: 12px !important; }
}

:root #root .ops-app .ops-primary-nav { border-radius: 999px !important; }
:root #root .ops-app .ops-primary-nav > .ops-nav-item,
:root #root .ops-app .ops-primary-nav .ops-operations-trigger { border-radius: 999px !important; }
:root #root .ops-app:has(.home-production-page) .ops-primary-nav,
:root #root .ops-app:has(.home-production-page) .ops-primary-nav > .ops-nav-item,
:root #root .ops-app:has(.home-production-page) .ops-primary-nav .ops-operations-trigger { border-radius: 999px !important; }


:root[data-theme='dark'] #root .ops-app .home-production-date-label {
  color: #a9bbcd;
}

:root[data-theme='light'] #root .ops-app .home-production-date-label {
  color: #68839c;
}
