/*
 * Harvestor SmartFarm premium design system
 * -----------------------------------------
 * This file is intentionally loaded after the legacy app.css bundle. It is a
 * reversible presentation layer: application IDs, data attributes, role
 * guards, event handlers and workflow markup remain untouched.
 */

html[data-design-system="smartfarm"] {
  color-scheme: light;
  --sf-canvas: #eef2ef;
  --sf-surface: #ffffff;
  --sf-surface-soft: #f7f9f7;
  --sf-surface-muted: #edf3ef;
  --sf-ink: #17211d;
  --sf-heading: #101a16;
  --sf-muted: #506058;
  --sf-label: #465a51;
  --sf-line: #d9e2dd;
  --sf-line-strong: #b7c8bf;
  --sf-forest: #153f34;
  --sf-forest-hover: #1d5546;
  --sf-mint: #dcefe7;
  --sf-mint-strong: #c9e6d9;
  --sf-success: #17683f;
  --sf-success-soft: #e1f1e9;
  --sf-blue: #287ba1;
  --sf-blue-soft: #dcecf3;
  --sf-amber: #78510d;
  --sf-amber-soft: #f5ead4;
  --sf-coral: #94382d;
  --sf-coral-soft: #f7e4df;
  --sf-focus: rgba(32, 112, 77, 0.22);
  --sf-shadow-sm: 0 5px 18px rgba(22, 46, 38, 0.06);
  --sf-shadow-md: 0 14px 36px rgba(22, 46, 38, 0.09);
  --sf-radius-xs: 5px;
  --sf-radius-sm: 7px;
  --sf-radius-md: 9px;
  --sf-radius-lg: 12px;
  font-family: "DM Sans", "Avenir Next", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html[data-design-system="smartfarm"][data-theme="dark"] {
  color-scheme: dark;
  --sf-canvas: #0d1512;
  --sf-surface: #14201a;
  --sf-surface-soft: #18271f;
  --sf-surface-muted: #1c2d24;
  --sf-ink: #e6ede9;
  --sf-heading: #f7faf8;
  --sf-muted: #b8c5be;
  --sf-label: #bac9c1;
  --sf-line: #2b3b33;
  --sf-line-strong: #476156;
  --sf-forest: #65b98b;
  --sf-forest-hover: #79c99b;
  --sf-mint: #203a2f;
  --sf-mint-strong: #29493b;
  --sf-success: #8bd8ad;
  --sf-success-soft: #1d392c;
  --sf-blue: #77b8d2;
  --sf-blue-soft: #1c3440;
  --sf-amber: #e0bc69;
  --sf-amber-soft: #3b321e;
  --sf-coral: #f09281;
  --sf-coral-soft: #40251f;
  --sf-focus: rgba(112, 200, 149, 0.27);
  --sf-shadow-sm: 0 5px 18px rgba(0, 0, 0, 0.17);
  --sf-shadow-md: 0 14px 38px rgba(0, 0, 0, 0.24);
}

html[data-design-system="smartfarm"][data-theme="high-contrast"] {
  color-scheme: light;
  --sf-canvas: #ffffff;
  --sf-surface: #ffffff;
  --sf-surface-soft: #ffffff;
  --sf-surface-muted: #ffffff;
  --sf-ink: #000000;
  --sf-heading: #000000;
  --sf-muted: #111111;
  --sf-label: #000000;
  --sf-line: #000000;
  --sf-line-strong: #000000;
  --sf-forest: #000000;
  --sf-forest-hover: #000000;
  --sf-mint: #ffffff;
  --sf-mint-strong: #ffffff;
  --sf-success: #000000;
  --sf-success-soft: #ffffff;
  --sf-blue: #000000;
  --sf-blue-soft: #ffffff;
  --sf-amber: #000000;
  --sf-amber-soft: #ffffff;
  --sf-coral: #000000;
  --sf-coral-soft: #ffffff;
  --sf-focus: #ffde00;
  --sf-shadow-sm: none;
  --sf-shadow-md: none;
}

html[data-design-system="smartfarm"] body {
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}

html[data-design-system="smartfarm"] :is(button, input, select, textarea) {
  font: inherit;
}

html[data-design-system="smartfarm"] :is(button, a, input, select, textarea) {
  -webkit-tap-highlight-color: transparent;
}

/* ------------------------------------------------------------------------- */
/* Application shell                                                         */
/* ------------------------------------------------------------------------- */

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) {
  --hv-theme-canvas: var(--sf-canvas);
  --hv-theme-surface: var(--sf-surface);
  --hv-theme-surface-soft: var(--sf-surface-soft);
  --hv-theme-surface-raised: var(--sf-surface);
  --hv-theme-border: var(--sf-line);
  --hv-theme-border-strong: var(--sf-line-strong);
  --hv-theme-text: var(--sf-ink);
  --hv-theme-heading: var(--sf-heading);
  --hv-theme-muted: var(--sf-muted);
  --hv-theme-label: var(--sf-label);
  --hv-theme-accent: var(--sf-forest);
  --hv-theme-accent-strong: var(--sf-forest);
  --hv-theme-success: var(--sf-success);
  --hv-theme-warning: var(--sf-amber);
  --hv-theme-focus: var(--sf-focus);
  --hv-theme-shadow: var(--sf-shadow-sm);
  --hv-theme-input: var(--sf-surface);
  --hv-theme-danger: var(--sf-coral);
  --panel: var(--sf-surface);
  --panel-soft: var(--sf-surface-soft);
  --line: var(--sf-line);
  --text: var(--sf-ink);
  --muted: var(--sf-muted);
  --hv-text: var(--sf-ink);
  --hv-heading: var(--sf-heading);
  --hv-label: var(--sf-label);
  --hv-muted: var(--sf-muted);
  --hv-panel-title: var(--sf-heading);
  --hv-content-bg: var(--sf-canvas);
  --hv-card-bg: var(--sf-surface);
  --hv-card-border: var(--sf-line);
  min-width: 320px;
  background: var(--sf-canvas);
  color: var(--sf-ink);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen)::before {
  content: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .shell {
  width: min(1640px, calc(100vw - 40px));
  min-height: 100vh;
  margin-inline: auto;
  padding: 14px 0 32px;
  background: transparent;
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app {
  grid-template-columns: 252px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 14px;
}

/* Compact SmartFarm-style command bar. */
html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card {
  position: sticky;
  top: 8px;
  z-index: 30;
  grid-column: 1 / -1;
  grid-template-areas: "brand identity workspace actions";
  grid-template-columns: 200px minmax(210px, 1fr) minmax(178px, 230px) max-content;
  min-height: 70px;
  max-height: none;
  gap: 14px;
  margin: 0;
  padding: 8px 12px;
  overflow: visible;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-md);
  background: color-mix(in srgb, var(--sf-surface) 94%, transparent);
  color: var(--sf-ink);
  box-shadow: var(--sf-shadow-sm);
  backdrop-filter: blur(16px);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-brand-block {
  grid-area: brand;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 0 14px 0 0;
  border-right: 1px solid var(--sf-line);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-logo {
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #f8f6f0;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 4px 12px rgba(21, 63, 52, 0.1);
  filter: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-brand-block span {
  color: var(--sf-heading);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-transform: none;
  text-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-identity {
  grid-area: identity;
  align-self: center;
  min-width: 0;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card h2 {
  display: block;
  margin: 0;
  overflow: hidden;
  color: var(--sf-heading);
  font-family: "Manrope", "Avenir Next", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(18px, 1.35vw, 22px);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.025em;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card .copy {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--sf-muted);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .sandbox-context-badge,
  .context-farm-switcher
) {
  grid-area: workspace;
  align-self: center;
  width: 100%;
  max-width: 230px;
  min-height: 40px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .sandbox-context-badge {
  grid-template-columns: 10px auto minmax(0, 1fr);
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--sf-amber) 34%, var(--sf-line));
  border-radius: var(--sf-radius-sm);
  background: var(--sf-amber-soft);
  color: var(--sf-ink);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .sandbox-context-badge::before {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--sf-amber);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--sf-amber) 18%, transparent);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .sandbox-context-badge::after {
  content: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .sandbox-context-badge strong {
  grid-column: 2;
  grid-row: 1 / 3;
  color: var(--sf-amber);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .sandbox-context-badge span {
  grid-column: 3;
  grid-row: 1 / 3;
  display: block;
  overflow: hidden;
  color: var(--sf-muted);
  font-size: 10px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-farm-switcher {
  gap: 2px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-farm-switcher label {
  gap: 3px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-farm-switcher :is(span, small) {
  color: var(--sf-label);
  font-size: 9px;
  letter-spacing: 0.06em;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) #context-farm-select {
  min-height: 40px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface);
  color: var(--sf-heading);
  font-size: 12px;
  font-weight: 700;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-pills {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch {
  display: grid;
  width: 144px;
  height: 40px;
  flex: 0 0 144px;
  grid-template-columns: repeat(4, 36px);
  overflow: hidden;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch button {
  min-width: 0;
  min-height: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--sf-line);
  border-radius: 0;
  background: transparent;
  color: var(--sf-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch button:last-child {
  border-right: 0;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch button.active {
  border: 0;
  background: var(--sf-forest);
  color: var(--sf-surface);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .header-icon,
  .header-logout,
  #header-theme-toggle
) {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface);
  color: var(--sf-heading);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .header-icon,
  .header-logout
) svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) #header-theme-toggle {
  gap: 0;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .header-theme-label,
html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .header-logout span {
  display: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .header-icon,
  .header-logout,
  #header-theme-toggle
):hover {
  border-color: var(--sf-line-strong);
  background: var(--sf-surface-soft);
  color: var(--sf-forest);
  box-shadow: none;
}

/* ------------------------------------------------------------------------- */
/* Navigation                                                                */
/* ------------------------------------------------------------------------- */

@media (min-width: 1025px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-grid {
    grid-column: 1;
    grid-row: 2 / span 30;
    position: sticky;
    top: 92px;
    max-height: calc(100dvh - 108px);
    gap: 3px;
    margin: 0;
    padding: 8px;
    overflow-y: auto;
    border: 1px solid var(--sf-line);
    border-radius: var(--sf-radius-md);
    background: var(--sf-surface);
    box-shadow: var(--sf-shadow-sm);
    scrollbar-gutter: stable;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item {
    min-height: 62px;
    align-content: center;
    gap: 2px;
    padding: 7px 28px 7px 46px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: var(--sf-radius-sm);
    background: transparent;
    color: var(--sf-muted);
    box-shadow: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item:nth-child(7) {
    margin-top: 7px;
    box-shadow: 0 -8px 0 -7px var(--sf-line);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item::before {
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--sf-forest);
    opacity: 0;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item.active::before {
    opacity: 1;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item::after {
    right: 10px;
    color: var(--sf-muted);
    font-size: 17px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-icon {
    left: 13px;
    width: 21px;
    height: 21px;
    background-color: currentColor;
    background-image: none;
    filter: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item strong {
    color: var(--sf-heading);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -0.005em;
    text-transform: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item > span:not(.menu-icon):not(.nav-unread-badge) {
    display: -webkit-box;
    overflow: hidden;
    color: var(--sf-muted);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.15;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item:is(:hover, .active) {
    border-color: color-mix(in srgb, var(--sf-forest) 18%, var(--sf-line));
    background: var(--sf-mint);
    color: var(--sf-forest);
    box-shadow: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item:is(:hover, .active)::after {
    color: var(--sf-forest);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view {
    grid-column: 2;
    min-width: 0;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .bottom-tabs {
    display: none;
  }
}

/* ------------------------------------------------------------------------- */
/* Content, forms and reusable components                                    */
/* ------------------------------------------------------------------------- */

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view {
  gap: 14px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view > .panel,
html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view > article.panel,
html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  #worker-detail-panel,
  .detail-form,
  .communication-thread-panel
) {
  padding: clamp(18px, 1.6vw, 24px);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-md);
  background: var(--sf-surface);
  color: var(--sf-ink);
  box-shadow: var(--sf-shadow-sm);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .section-head {
  align-items: flex-start;
  gap: 18px;
  margin: 0 0 18px;
  padding: 0 0 15px;
  border-bottom: 1px solid var(--sf-line);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .section-head,
  .dashboard-card-head
) h3 {
  margin: 0;
  color: var(--sf-heading);
  font-family: "Manrope", "Avenir Next", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(21px, 1.8vw, 27px);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .eyebrow,
html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .detail-label {
  margin-bottom: 6px;
  color: var(--sf-label);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .copy,
  .muted,
  .status-line,
  .row-copy span,
  .row-copy small
) {
  color: var(--sf-muted);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .section-head .muted {
  max-width: 72ch;
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .stack {
  gap: 14px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .two-col {
  gap: 14px 16px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view label {
  gap: 6px;
  color: var(--sf-label);
  font-size: 12px;
  font-weight: 700;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view label > span {
  color: var(--sf-label);
  font-weight: 700;
  text-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea),
html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) #context-farm-select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--sf-line-strong);
  border-radius: var(--sf-radius-xs);
  background: var(--sf-surface);
  color: var(--sf-heading);
  font-size: 14px;
  font-weight: 550;
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view textarea {
  min-height: 112px;
  line-height: 1.5;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view :is(input, textarea)::placeholder {
  color: var(--sf-muted);
  opacity: 0.72;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  button,
  a,
  input,
  select,
  textarea,
  summary
):focus-visible {
  outline: 3px solid var(--sf-focus);
  outline-offset: 2px;
  border-color: var(--sf-forest);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .button {
  min-height: 42px;
  padding: 9px 14px;
  border-radius: var(--sf-radius-xs);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .button.primary {
  border: 1px solid var(--sf-forest);
  background: var(--sf-forest);
  color: var(--sf-surface);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .button.primary:hover {
  border-color: var(--sf-forest-hover);
  background: var(--sf-forest-hover);
  transform: none;
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .button.ghost {
  border: 1px solid var(--sf-line);
  background: var(--sf-surface);
  color: var(--sf-forest);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .button.ghost:hover {
  border-color: var(--sf-line-strong);
  background: var(--sf-surface-soft);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .button.danger-soft {
  border-color: color-mix(in srgb, var(--sf-coral) 36%, var(--sf-line));
  background: var(--sf-coral-soft);
  color: var(--sf-coral);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(button, input, select, textarea):disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .form-actions {
  gap: 8px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .list-row,
  .detail-card,
  .stat-card,
  .health-box,
  .report-filter-card,
  .report-schedule-row,
  .worker-calendar-panel,
  .worker-hours-editor-panel,
  .worker-hours-row,
  .worker-hours-create-form,
  .worker-collections-panel,
  .communication-notification-panel,
  .communication-channel-button,
  .advance-request-panel,
  .report-form-section
) {
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface-soft);
  color: var(--sf-ink);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .list {
  gap: 8px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .list-row {
  min-height: 60px;
  padding: 12px 13px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .list-row,
  .detail-card,
  .stat-card
) strong {
  color: var(--sf-heading);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .empty {
  min-height: 104px;
  display: grid;
  place-items: center;
  padding: 22px;
  border: 1px dashed var(--sf-line-strong);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface-soft);
  color: var(--sf-muted);
  line-height: 1.5;
  text-align: center;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .status-chip {
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--sf-line);
  border-radius: 999px;
  background: var(--sf-surface-muted);
  color: var(--sf-label);
  font-size: 10px;
  font-weight: 800;
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .status-chip.ok {
  border-color: color-mix(in srgb, var(--sf-success) 30%, var(--sf-line));
  background: var(--sf-success-soft);
  color: var(--sf-success);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .status-chip.warn {
  border-color: color-mix(in srgb, var(--sf-amber) 35%, var(--sf-line));
  background: var(--sf-amber-soft);
  color: var(--sf-amber);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .status-chip.error {
  border-color: color-mix(in srgb, var(--sf-coral) 35%, var(--sf-line));
  background: var(--sf-coral-soft);
  color: var(--sf-coral);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view :is(table, .hv-table) {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  color: var(--sf-ink);
  font-size: 13px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view :is(th, td) {
  padding: 12px 13px;
  border-bottom: 1px solid var(--sf-line);
  text-align: left;
  vertical-align: middle;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view th {
  color: var(--sf-label);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------------- */
/* Dashboard                                                                 */
/* ------------------------------------------------------------------------- */

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-panel {
  padding: clamp(18px, 1.7vw, 24px);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head {
  margin-bottom: 16px;
  padding-bottom: 15px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head h3 {
  font-size: clamp(25px, 2vw, 31px);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-refresh-actions {
  align-items: center;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-refresh-actions .status-line {
  max-width: 230px;
  margin: 0;
  font-size: 11px;
  text-align: right;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) #refresh-btn {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--sf-radius-xs);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card {
  --kpi-accent: var(--sf-forest);
  min-height: 106px;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding: 15px 14px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--sf-line);
  border-radius: 0;
  background: var(--sf-surface);
  color: var(--sf-ink);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card:last-child {
  border-right: 0;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card.is-green {
  --kpi-accent: var(--sf-success);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card.is-gold {
  --kpi-accent: var(--sf-amber);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card::after {
  content: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-icon {
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--kpi-accent) 34%, var(--sf-line));
  border-radius: var(--sf-radius-sm);
  background: color-mix(in srgb, var(--kpi-accent) 8%, var(--sf-surface));
  color: var(--kpi-accent);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-icon::before {
  width: 19px;
  height: 19px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card .detail-label {
  margin: 0;
  color: var(--sf-label);
  font-size: 10px;
  letter-spacing: 0.04em;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card strong {
  color: var(--sf-heading);
  font-family: "Manrope", "Avenir Next", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(26px, 2vw, 33px);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.035em;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card small {
  color: var(--sf-muted);
  font-size: 10px;
  font-weight: 550;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-grid {
  grid-template-columns: minmax(0, 1.58fr) minmax(290px, 0.9fr);
  gap: 12px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-card {
  padding: 15px;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface-soft);
  color: var(--sf-ink);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-card-head {
  min-height: 34px;
  margin-bottom: 10px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-card-head .detail-label {
  color: var(--sf-label);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-card-head strong {
  color: var(--sf-heading);
  font-family: "Manrope", "Avenir Next", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(22px, 1.8vw, 29px);
  letter-spacing: -0.03em;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-chart {
  height: clamp(185px, 22vh, 248px);
  gap: 9px;
  padding: 13px 9px 8px;
  overflow: hidden;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-xs);
  background-color: var(--sf-surface);
  background-image: repeating-linear-gradient(
    to top,
    color-mix(in srgb, var(--sf-line) 76%, transparent) 0 1px,
    transparent 1px 25%
  );
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-chart > .dashboard-empty-state {
  min-height: 100%;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-empty-state {
  min-height: 118px;
  border: 1px dashed var(--sf-line-strong);
  border-radius: var(--sf-radius-xs);
  background: var(--sf-surface);
  color: var(--sf-muted);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-chart-bar > span {
  background: var(--sf-success);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-chart-bar.is-today > span {
  background: var(--sf-amber);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .dashboard-product-row,
  .dashboard-labor-metric
) {
  border-color: var(--sf-line);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-product-icon {
  background: var(--sf-mint);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-worker-avatar {
  background: var(--sf-mint);
  color: var(--sf-forest);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-worker-chip {
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-action-button {
  min-height: 64px;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-xs);
  background: var(--sf-surface);
  color: var(--sf-forest);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-action-button:hover {
  border-color: var(--sf-line-strong);
  background: var(--sf-mint);
}

/* ------------------------------------------------------------------------- */
/* Dense operational surfaces                                                */
/* ------------------------------------------------------------------------- */

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .manual-session-panel,
  .manual-rfid-panel,
  .manual-stepper-card,
  .manual-tare-panel,
  .manual-queue-panel,
  .manual-worker-fallback
) {
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface-soft);
  color: var(--sf-ink);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .manual-stepper-card {
  padding: 16px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .manual-quantity-field {
  border-color: var(--sf-line);
  background: var(--sf-surface);
  color: var(--sf-heading);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .manual-quantity-field input {
  border-color: var(--sf-line);
  background: transparent;
  color: var(--sf-heading);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .manual-stepper-button,
  .manual-quick-add button,
  .manual-box-count-controls button
) {
  border: 1px solid var(--sf-line-strong);
  border-radius: var(--sf-radius-xs);
  background: var(--sf-surface);
  color: var(--sf-forest);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .manual-stepper-button,
  .manual-quick-add button,
  .manual-box-count-controls button
):hover {
  background: var(--sf-mint);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .manual-session-product {
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-xs);
  background: var(--sf-surface);
  color: var(--sf-ink);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .manual-session-product.is-selected {
  border-color: var(--sf-forest);
  background: var(--sf-mint);
  box-shadow: 0 0 0 2px var(--sf-focus);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .worker-calendar-day,
  .worker-calendar-totals span,
  .worker-hours-row
) {
  border-color: var(--sf-line);
  border-radius: var(--sf-radius-xs);
  background: var(--sf-surface);
  color: var(--sf-ink);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .worker-calendar-day.is-today {
  border-color: var(--sf-forest);
  box-shadow: inset 0 0 0 1px var(--sf-forest);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .worker-calendar-day.has-activity {
  background: var(--sf-success-soft);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .communication-lists {
  grid-template-columns: minmax(250px, 0.66fr) minmax(0, 1.7fr);
  gap: 14px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .communication-channel-button {
  min-height: 56px;
  padding: 11px 12px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .communication-channel-button:is(:hover, .active) {
  border-color: color-mix(in srgb, var(--sf-forest) 34%, var(--sf-line));
  background: var(--sf-mint);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .communication-thread-shell {
  min-height: min(64vh, 720px);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .communication-bubble {
  border: 1px solid var(--sf-line);
  border-radius: 12px;
  background: var(--sf-surface-soft);
  color: var(--sf-ink);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .communication-message-row.is-mine .communication-bubble {
  border-color: color-mix(in srgb, var(--sf-forest) 28%, var(--sf-line));
  background: var(--sf-mint);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .communication-compose {
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .advance-request-row {
  border-color: var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface-soft);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .report-form-section {
  padding: 11px 13px;
  background: var(--sf-surface-soft);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .worker-admin-tool-menu {
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface);
  color: var(--sf-ink);
  box-shadow: var(--sf-shadow-md);
}

/* ------------------------------------------------------------------------- */
/* Sign-in, workspace selection and onboarding                               */
/* ------------------------------------------------------------------------- */

html[data-design-system="smartfarm"][data-theme] body.auth-screen,
html[data-design-system="smartfarm"][data-theme].entity-onboarding-route body {
  min-width: 320px;
  background: var(--sf-canvas);
  color: var(--sf-ink);
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen .login-bg,
html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .login-bg {
  display: block;
  inset: 68px 0 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--sf-canvas) 82%, transparent), color-mix(in srgb, var(--sf-canvas) 62%, transparent)),
    url("/assets/login/harvestor-bg-light-2026.webp") center / cover no-repeat;
  filter: saturate(0.82) contrast(0.96);
  opacity: 0.42;
  animation: none;
}

html[data-design-system="smartfarm"][data-theme="dark"] body.auth-screen .login-bg,
html[data-design-system="smartfarm"][data-theme="dark"].entity-onboarding-route .login-bg {
  background:
    linear-gradient(90deg, rgba(13, 21, 18, 0.82), rgba(13, 21, 18, 0.64)),
    url("/assets/login/harvestor-bg-2026.png") center / cover no-repeat;
  filter: saturate(0.72) contrast(1.02);
  opacity: 0.52;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen::before,
html[data-design-system="smartfarm"][data-theme].entity-onboarding-route body::before {
  content: "";
  background: linear-gradient(180deg, transparent 68px, color-mix(in srgb, var(--sf-canvas) 14%, transparent));
  animation: none;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen .login-particles,
html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .login-particles {
  display: none;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen .shell,
html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .shell {
  width: min(1180px, calc(100vw - 36px));
  min-height: 100vh;
  padding: 14px 0 34px;
  grid-template-rows: auto 1fr;
  gap: 22px;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen .topbar,
html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .topbar {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 9px 11px 9px 18px;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-md);
  background: color-mix(in srgb, var(--sf-surface) 94%, transparent);
  color: var(--sf-ink);
  box-shadow: var(--sf-shadow-sm);
  text-shadow: none;
  backdrop-filter: blur(16px);
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen .topbar > .topbar-brand-block {
  display: grid;
  gap: 1px;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen .topbar .brand,
html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .topbar .brand {
  margin: 0;
  color: var(--sf-heading);
  font-size: 18px;
  font-weight: 780;
  letter-spacing: -0.02em;
  text-transform: none;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen .topbar h1,
html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .topbar h1 {
  display: block;
  margin: 0;
  color: var(--sf-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen .language-switch,
html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .language-switch {
  display: grid;
  width: 176px;
  height: 42px;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface);
  box-shadow: none;
  clip-path: none;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen .language-switch button,
html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .language-switch button {
  min-height: 40px;
  border-left: 1px solid var(--sf-line);
  background: transparent;
  color: var(--sf-muted);
  font-size: 11px;
  text-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen .language-switch button.active,
html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .language-switch button.active {
  border: 0;
  background: var(--sf-forest);
  color: var(--sf-surface);
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen :is(#auth-panel, #password-change-panel, #workspace-panel),
html[data-design-system="smartfarm"][data-theme] body.work-screen :is(#password-change-panel, #workspace-panel) {
  justify-self: center;
  width: min(500px, 100%);
  padding: 30px 34px;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-lg);
  background: color-mix(in srgb, var(--sf-surface) 96%, transparent);
  color: var(--sf-ink);
  box-shadow: var(--sf-shadow-md);
  backdrop-filter: blur(16px);
  clip-path: none;
  animation: none;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen .login-logo-badge {
  display: grid;
  width: 88px;
  min-height: 88px;
  margin: 0 auto 16px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: #f8f6f0;
  box-shadow: 0 8px 22px rgba(21, 63, 52, 0.12);
  clip-path: none;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen .login-logo-badge::after {
  content: none;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen .login-logo {
  width: 100%;
  height: 88px;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
  filter: none;
}

/*
 * Restore the login hierarchy hidden by the legacy cinematic auth skin.
 * The SmartFarm layer uses the translated eyebrow and title as the primary
 * orientation cue, so the decorative legacy divider is no longer needed.
 */
html[data-design-system="smartfarm"][data-theme] body.auth-screen #auth-panel .login-divider {
  display: none;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen #auth-panel.panel .section-head {
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 16px;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen #auth-panel.panel .section-head > div {
  display: grid;
  justify-items: center;
  gap: 4px;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen #auth-panel .eyebrow {
  display: block;
  margin: 0;
  color: var(--sf-forest);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen #auth-panel h2 {
  display: block;
  margin: 0;
  line-height: 1.1;
  text-shadow: none;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen #auth-panel .copy {
  max-width: 410px;
  margin: 0;
  line-height: 1.45;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen #login-form {
  gap: 12px;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen #auth-panel .status-line {
  margin-top: 2px;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen :is(#auth-panel, #password-change-panel, #workspace-panel) .section-head {
  display: grid;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--sf-line);
  text-align: center;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen :is(#auth-panel, #password-change-panel, #workspace-panel) :is(h2, h3) {
  color: var(--sf-heading);
  font-family: "Manrope", "Avenir Next", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(25px, 4vw, 31px);
  letter-spacing: -0.03em;
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen :is(#auth-panel, #password-change-panel, #workspace-panel) :is(.copy, .status-line) {
  color: var(--sf-muted);
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen :is(input, select) {
  min-height: 48px;
  border: 1px solid var(--sf-line-strong);
  border-radius: var(--sf-radius-xs);
  background: var(--sf-surface);
  color: var(--sf-heading);
}

html[data-design-system="smartfarm"][data-theme] body.auth-screen .button.primary {
  min-height: 48px;
  border: 1px solid var(--sf-forest);
  border-radius: var(--sf-radius-xs);
  background: var(--sf-forest);
  color: var(--sf-surface);
}

html[data-design-system="smartfarm"][data-theme].entity-onboarding-route :is(
  .premium-entity-onboarding,
  .premium-registration-request
) {
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-lg);
  background: color-mix(in srgb, var(--sf-surface) 97%, transparent);
  color: var(--sf-ink);
  box-shadow: var(--sf-shadow-md);
}

html[data-design-system="smartfarm"][data-theme].entity-onboarding-route :is(
  .premium-onboarding-hero,
  .premium-form-head
) {
  border-color: var(--sf-line);
  background: var(--sf-surface-soft);
}

html[data-design-system="smartfarm"][data-theme].entity-onboarding-route :is(h2, h3, label, .premium-subtitle, .premium-intro, .copy) {
  color: var(--sf-ink);
}

html[data-design-system="smartfarm"][data-theme].entity-onboarding-route :is(input, select, textarea) {
  border: 1px solid var(--sf-line-strong);
  border-radius: var(--sf-radius-xs);
  background: var(--sf-surface);
  color: var(--sf-heading);
}

html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .premium-stepper .active {
  color: var(--sf-forest);
}

html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .premium-stepper .active span {
  background: var(--sf-forest);
  color: var(--sf-surface);
}

html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .premium-continue-button.button.primary {
  border-color: var(--sf-forest);
  border-radius: var(--sf-radius-xs);
  background: var(--sf-forest);
  color: var(--sf-surface);
  box-shadow: none;
}

/* ------------------------------------------------------------------------- */
/* 2026 brand mark                                                           */
/* ------------------------------------------------------------------------- */

html[data-design-system="smartfarm"][data-theme] body.sysadmin-screen :is(
  .sysadmin-password-logo,
  .hv-admin-logo
) {
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: #f8f6f0;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.24);
  filter: none;
}

html[data-design-system="smartfarm"][data-theme] body.sysadmin-screen .sysadmin-password-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

html[data-design-system="smartfarm"][data-theme] body.sysadmin-screen .hv-admin-logo,
html[data-design-system="smartfarm"][data-theme] body.sysadmin-screen .hv-admin-identity .hv-admin-logo {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
}

html[data-design-system="smartfarm"][data-theme] body.terminal-kiosk-screen .terminal-logo {
  width: clamp(78px, 7vw, 106px);
  height: clamp(78px, 7vw, 106px);
  padding: 0;
  border: 0;
  border-radius: clamp(12px, 1.2vw, 18px);
  background: #f8f6f0;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
  filter: none;
}

html[data-design-system="smartfarm"][data-theme="dark"] body.auth-screen .login-logo-badge,
html[data-design-system="smartfarm"][data-theme="dark"] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-logo {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

/* ------------------------------------------------------------------------- */
/* High contrast                                                             */
/* ------------------------------------------------------------------------- */

html[data-design-system="smartfarm"][data-theme="high-contrast"] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .context-card,
  .menu-grid,
  .view > .panel,
  .view > article.panel,
  .menu-item,
  .list-row,
  .detail-card,
  .dashboard-kpi-grid,
  .dashboard-kpi-card,
  .dashboard-card,
  .dashboard-chart,
  .dashboard-empty-state,
  .manual-session-panel,
  .manual-rfid-panel,
  .manual-stepper-card,
  .manual-tare-panel,
  .manual-queue-panel,
  .communication-bubble,
  .communication-compose
) {
  border: 2px solid #000000;
  background: #ffffff;
  color: #000000;
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme="high-contrast"] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .button.primary,
  .menu-item.active,
  .menu-item:hover,
  .app-language-switch button.active
) {
  border: 2px solid #000000;
  background: #000000;
  color: #ffffff;
}

html[data-design-system="smartfarm"][data-theme="high-contrast"] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .menu-item.active,
  .menu-item:hover,
  .dashboard-action-button:active
) :is(strong, span:not(.nav-unread-badge)) {
  color: #ffffff;
}

html[data-design-system="smartfarm"][data-theme="high-contrast"] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  input,
  select,
  textarea,
  button,
  .status-chip
) {
  border-color: #000000;
}

html[data-design-system="smartfarm"][data-theme="high-contrast"] :is(
  .login-logo-badge,
  .work-logo,
  .terminal-logo,
  .sysadmin-password-logo,
  .hv-admin-logo
) {
  border: 0;
  box-shadow: 0 0 0 2px #000000;
}

/* ------------------------------------------------------------------------- */
/* Responsive layout                                                         */
/* ------------------------------------------------------------------------- */

@media (min-width: 1025px) and (max-width: 1280px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .shell {
    width: min(100%, calc(100vw - 24px));
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app {
    grid-template-columns: 218px minmax(0, 1fr);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card {
    grid-template-areas: "brand identity workspace actions";
    grid-template-columns: 176px minmax(180px, 1fr) minmax(150px, 190px) max-content;
    gap: 10px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-brand-block {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-logo {
    width: 40px;
    height: 40px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch {
    width: 128px;
    flex-basis: 128px;
    grid-template-columns: repeat(4, 32px);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    padding-inline: 11px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-icon {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 1024px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .shell {
    width: min(100%, calc(100vw - 18px));
    padding: 9px 0 calc(78px + env(safe-area-inset-bottom));
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card {
    top: 6px;
    grid-template-areas:
      "brand identity"
      "workspace actions";
    grid-template-columns: 190px minmax(0, 1fr);
    min-height: auto;
    gap: 8px 12px;
    padding: 9px 11px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
    .sandbox-context-badge,
    .context-farm-switcher
  ) {
    max-width: 100%;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-pills {
    display: grid;
    grid-template-columns: minmax(144px, 1fr) repeat(4, 44px);
    width: 100%;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch {
    width: 100%;
    height: 44px;
    flex-basis: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch button,
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
    .header-icon,
    .header-logout,
    #header-theme-toggle
  ) {
    width: 100%;
    min-width: 0;
    height: 44px;
    min-height: 44px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen.mobile-menu-open:not(.terminal-kiosk-screen):not(.sysadmin-screen)::after {
    background: rgba(16, 26, 22, 0.3);
    backdrop-filter: blur(4px);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen.mobile-menu-open:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-grid {
    bottom: calc(70px + env(safe-area-inset-bottom));
    width: min(430px, calc(100vw - 18px));
    max-height: calc(100dvh - 154px);
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--sf-line);
    border-radius: var(--sf-radius-md);
    background: var(--sf-surface);
    box-shadow: var(--sf-shadow-md);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen.mobile-menu-open:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item {
    min-height: 54px;
    padding: 8px 36px 8px 52px;
    border: 1px solid transparent;
    border-radius: var(--sf-radius-sm);
    background: transparent;
    color: var(--sf-ink);
    box-shadow: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen.mobile-menu-open:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item:is(:hover, .active) {
    border-color: var(--sf-line);
    background: var(--sf-mint);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen.mobile-menu-open:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item strong {
    color: var(--sf-heading);
    font-size: 14px;
    text-transform: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen.mobile-menu-open:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item > span:not(.menu-icon):not(.nav-unread-badge) {
    display: block;
    color: var(--sf-muted);
    font-size: 10px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .bottom-tabs {
    left: 50%;
    width: min(560px, 100vw);
    min-height: calc(62px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    border-top: 1px solid var(--sf-line);
    background: color-mix(in srgb, var(--sf-surface) 94%, transparent);
    box-shadow: 0 -8px 28px rgba(22, 46, 38, 0.09);
    backdrop-filter: blur(16px);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .bottom-tab {
    min-height: 62px;
    border-color: var(--sf-line);
    color: var(--sf-muted);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .bottom-tab svg {
    width: 22px;
    height: 22px;
    color: var(--sf-forest);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .bottom-tab.active {
    background: var(--sf-mint);
    color: var(--sf-heading);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "chart"
      "products"
      "employees"
      "labor"
      "actions";
  }
}

@media (max-width: 720px) {
  html[data-design-system="smartfarm"][data-theme] body.sysadmin-screen .sysadmin-password-logo {
    width: 48px;
    height: 48px;
    border-radius: 11px;
  }

  html[data-design-system="smartfarm"][data-theme] body.sysadmin-screen .hv-admin-logo,
  html[data-design-system="smartfarm"][data-theme] body.sysadmin-screen .hv-admin-identity .hv-admin-logo {
    width: 40px;
    height: 40px;
  }

  html[data-design-system="smartfarm"][data-theme] body.terminal-kiosk-screen .terminal-logo {
    width: 44px;
    height: 44px;
    border-radius: 9px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .shell {
    width: 100%;
    padding: 7px 7px calc(76px + env(safe-area-inset-bottom));
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app {
    gap: 9px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card {
    grid-template-areas:
      "brand identity workspace"
      "actions actions actions";
    grid-template-columns: 42px minmax(0, 1fr) minmax(72px, 116px);
    gap: 7px 9px;
    padding: 8px 9px;
    border-radius: var(--sf-radius-sm);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-brand-block {
    display: grid;
    grid-template-columns: 40px;
    padding: 0;
    border: 0;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-logo {
    width: 40px;
    height: 40px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-brand-block span {
    display: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card h2 {
    font-size: clamp(15px, 4.7vw, 19px);
    line-height: 1.1;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card .copy {
    margin-top: 2px;
    font-size: 10px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
    .sandbox-context-badge,
    .context-farm-switcher
  ) {
    width: 100%;
    max-width: 116px;
    min-height: 38px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .sandbox-context-badge {
    grid-template-columns: 8px minmax(0, 1fr);
    padding: 7px 8px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .sandbox-context-badge strong {
    grid-column: 2;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .sandbox-context-badge span,
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-farm-switcher :is(label > span, small) {
    display: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) #context-farm-select {
    min-height: 44px;
    padding: 0 28px 0 8px;
    font-size: 10px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-pills {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch,
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch button,
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
    .header-icon,
    .header-logout,
    #header-theme-toggle
  ) {
    height: 44px;
    min-height: 44px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view {
    margin-top: 0;
    gap: 9px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view > .panel,
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view > article.panel {
    padding: 14px;
    border-radius: var(--sf-radius-sm);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .section-head {
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .section-head h3 {
    font-size: 21px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .two-col {
    grid-template-columns: 1fr;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-refresh-actions {
    width: 100%;
    justify-content: space-between;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) #refresh-btn {
    min-width: 44px;
    min-height: 44px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-refresh-actions .status-line {
    text-align: left;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card {
    min-height: 92px;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    padding: 11px;
    border: 1px solid var(--sf-line);
    border-radius: var(--sf-radius-sm);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-icon {
    width: 34px;
    height: 34px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card strong {
    font-size: clamp(24px, 7vw, 29px);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-card {
    padding: 12px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-chart {
    height: 205px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
    padding-inline: 4px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-chart-bar {
    grid-template-rows: 24px 1fr 36px;
    gap: 4px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-chart-bar small {
    max-width: 100%;
    font-size: 8px;
    line-height: 1.08;
    overflow-wrap: anywhere;
    text-align: center;
    white-space: normal;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .communication-lists {
    grid-template-columns: 1fr;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .communication-thread-shell {
    min-height: 520px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .communication-bubble {
    width: min(90%, 720px);
  }

  html[data-design-system="smartfarm"][data-theme] body.auth-screen .shell,
  html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .shell {
    width: min(100%, calc(100vw - 16px));
    padding-top: 8px;
  }

  html[data-design-system="smartfarm"][data-theme] body.auth-screen .topbar,
  html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 58px;
    padding: 7px 9px 7px 13px;
  }

  html[data-design-system="smartfarm"][data-theme] body.auth-screen .language-switch,
  html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .language-switch {
    grid-column: auto;
    width: 160px;
    height: 42px;
  }

  html[data-design-system="smartfarm"][data-theme] body.auth-screen :is(#auth-panel, #password-change-panel, #workspace-panel) {
    width: min(100%, 500px);
    padding: 24px 20px;
  }
}

@media (max-width: 360px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-pills {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch {
    grid-column: 1 / -1;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }

  html[data-design-system="smartfarm"][data-theme] body.auth-screen .topbar,
  html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .topbar {
    grid-template-columns: 1fr;
  }

  html[data-design-system="smartfarm"][data-theme] body.auth-screen .language-switch,
  html[data-design-system="smartfarm"][data-theme].entity-onboarding-route .language-switch {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-design-system="smartfarm"] *,
  html[data-design-system="smartfarm"] *::before,
  html[data-design-system="smartfarm"] *::after {
    scroll-behavior: auto;
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
  }
}

@media (forced-colors: active) {
  html[data-design-system="smartfarm"] :is(button, input, select, textarea, a) {
    forced-color-adjust: auto;
  }
}

@media print {
  html[data-design-system="smartfarm"] body.work-screen {
    background: #ffffff;
  }

  html[data-design-system="smartfarm"] body.work-screen :is(.context-card, .menu-grid, .bottom-tabs, .form-actions) {
    display: none;
  }

  html[data-design-system="smartfarm"] body.work-screen .app {
    display: block;
  }

  html[data-design-system="smartfarm"] body.work-screen .view {
    width: 100%;
  }
}
html[data-theme] body.work-screen .detail-card.is-warning {
  border-color: color-mix(in srgb, var(--hv-gold, #bd8a2e) 48%, transparent);
  background: color-mix(in srgb, var(--hv-gold, #bd8a2e) 9%, var(--surface, #fff));
}

html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .support-ticket-row {
  align-items: flex-start;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .support-attachments {
  display: grid;
  gap: 8px;
  width: min(100%, 760px);
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line, rgba(24, 68, 51, 0.16));
}

html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .support-attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--sf-line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--sf-surface) 90%, var(--sf-mint));
  color: var(--sf-ink);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .support-attachment-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .support-attachment-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .support-attachment-copy small,
html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .support-attachment-actions > small {
  color: var(--sf-muted);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .support-attachment-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .button.compact {
  min-height: 44px;
  padding: 9px 12px;
  font-size: 12px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .button.compact.danger {
  color: var(--sf-coral);
  border-color: color-mix(in srgb, var(--sf-coral) 42%, transparent);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .support-attachment-add {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 44px;
  overflow: hidden;
  cursor: pointer;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .support-attachment-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .support-attachment-add:focus-within {
  outline: 3px solid var(--sf-focus);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .support-attachment-row {
    align-items: stretch;
    flex-direction: column;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .support-attachment-copy strong {
    display: -webkit-box;
    overflow-wrap: anywhere;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen #view-support .support-attachment-actions {
    flex-wrap: wrap;
  }
}

/* ------------------------------------------------------------------------- */
/* Workspace 2.1 — boardroom polish + field ergonomics                       */
/* ------------------------------------------------------------------------- */

html[data-design-system="smartfarm"] {
  --sf-canvas: #f1f5f2;
  --sf-surface-soft: #f7faf8;
  --sf-surface-muted: #eaf1ed;
  --sf-line: #d6e0da;
  --sf-line-strong: #aec1b7;
  --sf-heading: #0c1913;
  --sf-ink: #17231d;
  --sf-muted: #52635a;
  --sf-label: #3f594d;
  --sf-forest: #124c3c;
  --sf-forest-hover: #0f5e47;
  --sf-mint: #e3f1eb;
  --sf-mint-strong: #cce7db;
  --sf-shadow-sm: 0 1px 2px rgba(13, 46, 34, 0.04), 0 9px 28px rgba(13, 46, 34, 0.055);
  --sf-shadow-md: 0 2px 5px rgba(13, 46, 34, 0.06), 0 22px 58px rgba(13, 46, 34, 0.12);
  --sf-radius-xs: 8px;
  --sf-radius-sm: 12px;
  --sf-radius-md: 16px;
  --sf-radius-lg: 20px;
  font-family:
    "Segoe UI Variable Text",
    "SF Pro Text",
    "Aptos",
    "Noto Sans",
    "Segoe UI",
    system-ui,
    sans-serif;
}

html[data-design-system="smartfarm"][data-theme="dark"] {
  --sf-canvas: #0b1410;
  --sf-surface: #121f19;
  --sf-surface-soft: #17261f;
  --sf-surface-muted: #1d3027;
  --sf-line: #2b4036;
  --sf-line-strong: #4d685b;
  --sf-heading: #f5faf7;
  --sf-ink: #e4eee9;
  --sf-muted: #afc0b7;
  --sf-label: #bfd0c7;
  --sf-forest: #72c99b;
  --sf-forest-hover: #88d8ad;
  --sf-mint: #203a2f;
  --sf-mint-strong: #2b4b3d;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) {
  --hv-workspace-rail: 272px;
  --hv-workspace-gap: 18px;
  --hv-workspace-header-pad: 12px;
  background:
    radial-gradient(circle at 12% -8%, color-mix(in srgb, var(--sf-forest) 7%, transparent), transparent 31rem),
    var(--sf-canvas);
  font-variant-numeric: tabular-nums;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  h1,
  h2,
  h3,
  h4,
  .work-brand-block span,
  .dashboard-kpi-card strong,
  .dashboard-card-head strong
) {
  font-family:
    "Segoe UI Variable Display",
    "SF Pro Display",
    "Avenir Next",
    "Noto Sans",
    "Segoe UI",
    system-ui,
    sans-serif;
  font-optical-sizing: auto;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .shell {
  width: min(1880px, calc(100vw - 32px));
  padding: 16px 0 38px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app {
  grid-template-columns: var(--hv-workspace-rail) minmax(0, 1fr);
  gap: var(--hv-workspace-gap);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card {
  top: 12px;
  grid-template-columns:
    calc(var(--hv-workspace-rail) - var(--hv-workspace-header-pad))
    minmax(230px, 1fr)
    minmax(180px, 230px)
    max-content;
  min-height: 84px;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--sf-surface) 96%, transparent);
  box-shadow: var(--sf-shadow-sm);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-brand-block {
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  padding-right: 20px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-logo {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  box-shadow: 0 7px 20px rgba(16, 62, 45, 0.12);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-brand-block span {
  font-size: 20px;
  font-weight: 730;
  letter-spacing: -0.025em;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-identity .eyebrow {
  display: none;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card h2 {
  font-size: clamp(19px, 1.4vw, 24px);
  font-weight: 730;
  letter-spacing: -0.035em;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card .copy {
  margin-top: 4px;
  font-size: 12px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .sandbox-context-badge,
  .context-farm-switcher
) {
  max-width: 230px;
  min-height: 44px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .sandbox-context-badge {
  min-height: 44px;
  padding: 8px 11px;
  border-radius: 11px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) #context-farm-select {
  min-height: 44px;
  border-radius: 11px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-pills {
  gap: 7px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch {
  width: 164px;
  height: 44px;
  flex-basis: 164px;
  grid-template-columns: repeat(4, 41px);
  border-radius: 11px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch button {
  height: 42px;
  min-height: 42px;
  font-size: 12px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .header-icon,
  .header-logout,
  #header-theme-toggle
) {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 11px;
}

/* Clean icon tiles. Legacy SVG glow is deliberately ignored through masks. */
html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-icon {
  position: relative;
  left: auto;
  top: auto;
  display: grid;
  width: 38px;
  height: 38px;
  transform: none;
  place-items: center;
  border: 1px solid color-mix(in srgb, currentColor 18%, var(--sf-line));
  border-radius: 11px;
  background: color-mix(in srgb, currentColor 7%, var(--sf-surface)) !important;
  filter: none;
  -webkit-mask: none !important;
  mask: none !important;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-icon::before {
  content: "" !important;
  display: block;
  width: 19px;
  height: 19px;
  background: currentColor;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-icon.dashboard::before {
  -webkit-mask: url("assets/menu-icons/dashboard.svg") center / contain no-repeat;
  mask: url("assets/menu-icons/dashboard.svg") center / contain no-repeat;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-icon.people::before {
  -webkit-mask: url("assets/menu-icons/people.svg") center / contain no-repeat;
  mask: url("assets/menu-icons/people.svg") center / contain no-repeat;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-icon.work::before {
  -webkit-mask: url("assets/menu-icons/tractor.svg") center / contain no-repeat;
  mask: url("assets/menu-icons/tractor.svg") center / contain no-repeat;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-icon.messages::before {
  -webkit-mask: url("assets/menu-icons/messages.svg") center / contain no-repeat;
  mask: url("assets/menu-icons/messages.svg") center / contain no-repeat;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-icon.reports::before {
  -webkit-mask: url("assets/menu-icons/report.svg") center / contain no-repeat;
  mask: url("assets/menu-icons/report.svg") center / contain no-repeat;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-icon.payments::before {
  -webkit-mask: url("assets/menu-icons/payments.svg") center / contain no-repeat;
  mask: url("assets/menu-icons/payments.svg") center / contain no-repeat;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-icon.settings::before {
  -webkit-mask: url("assets/menu-icons/target.svg") center / contain no-repeat;
  mask: url("assets/menu-icons/target.svg") center / contain no-repeat;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-icon.devices::before {
  -webkit-mask: url("assets/menu-icons/device.svg") center / contain no-repeat;
  mask: url("assets/menu-icons/device.svg") center / contain no-repeat;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-icon.support::before {
  -webkit-mask: url("assets/menu-icons/support.svg") center / contain no-repeat;
  mask: url("assets/menu-icons/support.svg") center / contain no-repeat;
}

@media (min-width: 1025px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-grid {
    top: 114px;
    align-self: start;
    align-content: start;
    height: max-content;
    max-height: none;
    grid-auto-rows: auto;
    gap: 5px;
    padding: 12px;
    overflow: visible;
    border-radius: 18px;
    background: var(--sf-surface);
    box-shadow: var(--sf-shadow-sm);
    scrollbar-gutter: auto;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-grid::-webkit-scrollbar {
    display: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item {
    display: grid;
    height: 62px;
    min-height: 62px;
    max-height: 62px;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: 19px 24px;
    column-gap: 12px;
    row-gap: 1px;
    align-content: center;
    align-items: center;
    padding: 9px 34px 9px 10px;
    border-radius: 12px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item:nth-child(7) {
    margin-top: 0;
    box-shadow: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-grid:has([data-view="settings"]:not(.hidden)) [data-view="settings"],
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-grid:not(:has([data-view="settings"]:not(.hidden))) [data-view="scan"],
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-grid:not(:has([data-view="settings"]:not(.hidden))):not(:has([data-view="scan"]:not(.hidden))) [data-view="support"] {
    margin-top: 8px;
    box-shadow: 0 -9px 0 -8px var(--sf-line);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item::after {
    right: 13px;
    font-size: 18px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item strong {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item > span:not(.menu-icon):not(.nav-unread-badge) {
    display: -webkit-box;
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    overflow: hidden;
    color: var(--sf-muted);
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.15;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item:is(:hover, .active) .menu-icon {
    border-color: color-mix(in srgb, var(--sf-forest) 30%, var(--sf-line));
    background: var(--sf-forest) !important;
    color: var(--sf-surface);
  }
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view {
  gap: 18px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view > .panel,
html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view > article.panel,
html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  #worker-detail-panel,
  .detail-form,
  .communication-thread-panel
) {
  padding: clamp(22px, 2vw, 30px);
  border-radius: 20px;
  box-shadow: var(--sf-shadow-sm);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .section-head {
  gap: 22px;
  margin-bottom: 22px;
  padding-bottom: 18px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .section-head h3 {
  font-size: clamp(25px, 2.1vw, 34px);
  font-weight: 720;
  letter-spacing: -0.04em;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .eyebrow,
html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .detail-label {
  font-size: 10.5px;
  font-weight: 760;
  letter-spacing: 0.075em;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view .muted {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view :is(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea
) {
  min-height: 48px;
  border-radius: 10px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .button {
  min-height: 46px;
  border-radius: 10px;
  font-weight: 700;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .list-row,
  .detail-card,
  .stat-card,
  .health-box,
  .report-filter-card,
  .report-schedule-row,
  .worker-calendar-panel,
  .worker-hours-editor-panel,
  .worker-hours-row,
  .worker-hours-create-form,
  .worker-collections-panel,
  .communication-notification-panel,
  .communication-channel-button,
  .advance-request-panel,
  .report-form-section
) {
  border-radius: 13px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .status-chip.ok,
  .status-chip.success
) {
  border-color: color-mix(in srgb, var(--sf-success) 32%, var(--sf-line));
  background: var(--sf-success-soft);
  color: var(--sf-success);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .status-chip.warn,
  .status-chip.warning
) {
  border-color: color-mix(in srgb, var(--sf-amber) 34%, var(--sf-line));
  background: var(--sf-amber-soft);
  color: var(--sf-amber);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
  .status-chip.danger,
  .status-chip.error
) {
  border-color: color-mix(in srgb, var(--sf-coral) 34%, var(--sf-line));
  background: var(--sf-coral-soft);
  color: var(--sf-coral);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view :is(th, td) {
  padding: 14px 15px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view th {
  background: var(--sf-surface-muted);
  font-size: 10.5px;
}

/* Dashboard now follows the SmartFarm reference: compact field hero + cards. */
html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-panel {
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head {
  position: relative;
  min-height: 166px;
  align-items: flex-end;
  margin: 0;
  padding: 30px 30px 48px;
  overflow: hidden;
  border: 0;
  background: #06241b;
  color: #ffffff;
  isolation: isolate;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(6, 36, 27, 0.94) 0%, rgba(8, 47, 35, 0.86) 43%, rgba(8, 47, 35, 0.44) 100%),
    url("/assets/login/harvestor-bg-light-2026.webp") center 58% / cover no-repeat;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head::after {
  content: "";
  position: absolute;
  inset: auto -7% -72% 43%;
  z-index: -1;
  height: 180px;
  transform: rotate(-5deg);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head h3 {
  color: #ffffff;
  font-size: clamp(31px, 2.55vw, 42px);
  font-weight: 680;
  letter-spacing: -0.045em;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head .eyebrow {
  color: #bfe8d5;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head .muted {
  color: rgba(255, 255, 255, 0.78);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-refresh-actions {
  align-items: flex-end;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-refresh-actions .status-line {
  max-width: 260px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) #refresh-btn {
  min-height: 44px;
  border-color: rgba(255, 255, 255, 0.46);
  background: #ffffff;
  color: #103f33;
  box-shadow: 0 8px 22px rgba(3, 23, 17, 0.18);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-grid {
  position: relative;
  z-index: 2;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: -28px 22px 18px;
  overflow: visible;
  border: 0;
  background: transparent;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card {
  min-height: 118px;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--sf-line);
  border-radius: 15px;
  background: var(--sf-surface);
  box-shadow: 0 1px 2px rgba(14, 42, 32, 0.04), 0 12px 30px rgba(14, 42, 32, 0.09);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card:last-child {
  border-right: 1px solid var(--sf-line);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card .detail-label {
  font-size: 10.5px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card strong {
  font-size: clamp(29px, 2.25vw, 38px);
  font-weight: 690;
  letter-spacing: -0.045em;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card small {
  font-size: 10.5px;
  line-height: 1.25;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.92fr);
  grid-template-areas:
    "chart products"
    "employees labor"
    "employees actions";
  gap: 14px;
  margin: 0 22px 22px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-card {
  padding: 18px;
  border-radius: 15px;
  background: var(--sf-surface-soft);
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-card-head {
  min-height: 38px;
  margin-bottom: 12px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-chart {
  height: clamp(190px, 23vh, 260px);
  border-radius: 12px;
}

html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-empty-state {
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--sf-forest) 8%, transparent), transparent 86px),
    var(--sf-surface);
}

/* Laptop/high-DPI mode: never turn the navigation into a scrollable chimney. */
@media (min-width: 1025px) and (max-width: 1320px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) {
    --hv-workspace-rail: 236px;
    --hv-workspace-gap: 14px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .shell {
    width: min(100%, calc(100vw - 22px));
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app {
    grid-template-columns: var(--hv-workspace-rail) minmax(0, 1fr);
    gap: var(--hv-workspace-gap);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card {
    grid-template-columns:
      calc(var(--hv-workspace-rail) - var(--hv-workspace-header-pad))
      minmax(190px, 1fr)
      minmax(150px, 190px)
      max-content;
    gap: 10px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-brand-block {
    grid-template-columns: 44px minmax(0, 1fr);
    padding-right: 12px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-logo {
    width: 44px;
    height: 44px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch {
    width: 144px;
    flex-basis: 144px;
    grid-template-columns: repeat(4, 36px);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
    padding: 15px 13px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-icon {
    width: 38px;
    height: 38px;
  }
}

@media (min-width: 1025px) and (max-height: 740px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .shell {
    padding-top: 10px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card {
    top: 8px;
    min-height: 68px;
    padding-block: 7px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-logo {
    width: 42px;
    height: 42px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-grid {
    top: 88px;
    gap: 3px;
    padding: 9px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item {
    height: 49px;
    min-height: 49px;
    max-height: 49px;
    grid-template-rows: 1fr;
    padding-block: 5px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-grid:has([data-view="settings"]:not(.hidden)) [data-view="settings"],
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-grid:not(:has([data-view="settings"]:not(.hidden))) [data-view="scan"] {
    margin-top: 4px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-icon {
    grid-row: 1;
    width: 34px;
    height: 34px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item strong {
    grid-row: 1;
    align-self: center;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item > span:not(.menu-icon):not(.nav-unread-badge) {
    display: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head {
    min-height: 142px;
    padding-top: 22px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card {
    min-height: 104px;
    padding-block: 14px;
  }
}

@media (max-width: 1024px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .shell {
    width: min(100%, calc(100vw - 20px));
    padding: 10px 0 calc(80px + env(safe-area-inset-bottom));
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card {
    position: relative;
    top: auto;
    grid-template-areas:
      "brand identity workspace"
      "actions actions actions";
    grid-template-columns: 52px minmax(0, 1fr) minmax(132px, 190px);
    gap: 9px 12px;
    min-height: auto;
    padding: 10px 12px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-brand-block {
    grid-template-columns: 46px;
    padding: 0;
    border: 0;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-brand-block span {
    display: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-logo {
    width: 46px;
    height: 46px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-pills {
    display: grid;
    grid-template-columns: minmax(176px, 1fr) repeat(4, 44px);
    width: 100%;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-pills:has(.action-terminal.hidden) {
    grid-template-columns: minmax(176px, 1fr) repeat(3, 44px);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch {
    width: 100%;
    height: 46px;
    flex-basis: auto;
    grid-template-columns: repeat(4, minmax(44px, 1fr));
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch button,
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
    .header-icon,
    .header-logout,
    #header-theme-toggle
  ) {
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen.mobile-menu-open:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-grid {
    gap: 5px;
    padding: 10px;
    border-radius: 18px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen.mobile-menu-open:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item {
    display: grid;
    min-height: 58px;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 1px 11px;
    align-items: center;
    padding: 8px 36px 8px 9px;
    border-radius: 12px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen.mobile-menu-open:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-icon {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen.mobile-menu-open:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item strong {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen.mobile-menu-open:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item > span:not(.menu-icon):not(.nav-unread-badge) {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .bottom-tabs {
    min-height: calc(64px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .bottom-tab > span:not(.bottom-unread-badge) {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding-inline: 3px;
    font-size: clamp(12px, 2vw, 14px);
    font-weight: 600;
    line-height: 1.1;
    overflow-wrap: anywhere;
    text-align: center;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "chart"
      "products"
      "employees"
      "labor"
      "actions";
  }
}

@media (min-width: 900px) and (max-width: 1024px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card {
    grid-template-areas: "brand identity workspace actions";
    grid-template-columns: 48px minmax(170px, 1fr) minmax(138px, 174px) minmax(352px, 392px);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-pills {
    grid-template-columns: minmax(176px, 1fr) repeat(4, 44px);
    gap: 4px;
  }
}

@media (max-width: 720px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .shell {
    width: 100%;
    padding: 7px 7px calc(78px + env(safe-area-inset-bottom));
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app {
    gap: 10px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card {
    grid-template-areas:
      "brand identity workspace"
      "actions actions actions";
    grid-template-columns: 42px minmax(0, 1fr) minmax(82px, 112px);
    gap: 7px 9px;
    padding: 8px 9px;
    border-radius: 14px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-brand-block {
    grid-template-columns: 40px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .work-logo {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card h2 {
    display: -webkit-box;
    overflow: hidden;
    font-size: clamp(15px, 4.65vw, 19px);
    line-height: 1.12;
    white-space: normal;
    text-overflow: clip;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
    .sandbox-context-badge,
    .context-farm-switcher
  ) {
    max-width: 112px;
    min-height: 40px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-pills {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-pills:has(.action-terminal.hidden) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch {
    grid-column: 1 / -1;
    width: 100%;
    height: 46px;
    grid-template-columns: repeat(4, minmax(44px, 1fr));
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .app-language-switch button {
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) :is(
    .header-icon,
    .header-logout,
    #header-theme-toggle
  ) {
    height: 44px;
    min-height: 44px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view {
    gap: 10px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view > .panel,
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .view > article.panel {
    padding: 16px;
    border-radius: 15px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-panel {
    padding: 0;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head {
    min-height: 136px;
    align-items: flex-end;
    flex-direction: row;
    gap: 12px;
    margin: 0;
    padding: 20px 18px 38px;
    border: 0;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head h3 {
    font-size: clamp(27px, 8vw, 33px);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head .muted {
    margin-top: 4px;
    font-size: 12px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-refresh-actions {
    width: auto;
    flex: 0 0 auto;
    gap: 7px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-refresh-actions .status-line {
    display: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) #refresh-btn {
    min-width: 44px;
    padding-inline: 12px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: -23px 10px 14px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card {
    min-height: 104px;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
    padding: 13px 11px;
    border-radius: 13px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card strong {
    font-size: clamp(26px, 8vw, 33px);
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-grid {
    gap: 10px;
    margin: 0 10px 10px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-card {
    padding: 14px;
    border-radius: 13px;
  }
}

@media (min-width: 721px) and (max-width: 860px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 341px) and (max-width: 380px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-card {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 7px;
    padding-inline: 9px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-icon {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 340px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head {
    padding-inline: 15px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1025px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card:has(
    .sandbox-context-badge:not(.hidden)
  ):has(.context-farm-switcher:not(.hidden)) {
    grid-template-areas: "brand identity workspace switcher actions";
    grid-template-columns:
      calc(var(--hv-workspace-rail) - var(--hv-workspace-header-pad))
      minmax(170px, 1fr)
      minmax(112px, 140px)
      minmax(150px, 190px)
      max-content;
    grid-template-rows: auto;
    min-height: 84px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card:has(
    .sandbox-context-badge:not(.hidden)
  ):has(.context-farm-switcher:not(.hidden)) .context-farm-switcher {
    grid-area: switcher;
    max-width: 190px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card:has(
    .sandbox-context-badge:not(.hidden)
  ):has(.context-farm-switcher:not(.hidden)) .sandbox-context-badge {
    max-width: 140px;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card:has(
    .sandbox-context-badge:not(.hidden)
  ):has(.context-farm-switcher:not(.hidden)) .sandbox-context-badge span {
    display: none;
  }
}

@media (max-width: 1024px) {
  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card:has(
    .sandbox-context-badge:not(.hidden)
  ):has(.context-farm-switcher:not(.hidden)) .sandbox-context-badge {
    z-index: 2;
    width: 16px;
    max-width: 16px;
    height: 16px;
    min-height: 16px;
    justify-self: start;
    margin-left: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card:has(
    .sandbox-context-badge:not(.hidden)
  ):has(.context-farm-switcher:not(.hidden)) .sandbox-context-badge::before {
    grid-column: 1;
    grid-row: 1;
    width: 8px;
    height: 8px;
    justify-self: center;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card:has(
    .sandbox-context-badge:not(.hidden)
  ):has(.context-farm-switcher:not(.hidden)) .sandbox-context-badge :is(strong, span) {
    display: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .context-card:has(
    .sandbox-context-badge:not(.hidden)
  ):has(.context-farm-switcher:not(.hidden)) #context-farm-select {
    padding-left: 28px;
  }
}

html[data-design-system="smartfarm"][data-theme="high-contrast"] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head {
  border-bottom: 2px solid #000000;
  background: #ffffff;
  color: #000000;
}

html[data-design-system="smartfarm"][data-theme="high-contrast"] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head::before {
  display: none;
}

html[data-design-system="smartfarm"][data-theme="high-contrast"] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .dashboard-command-head :is(
  h3,
  .eyebrow,
  .muted,
  .status-line
) {
  color: #000000;
}

html[data-design-system="smartfarm"][data-theme="high-contrast"] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) #refresh-btn {
  border: 2px solid #000000;
  background: #ffffff;
  color: #000000;
  box-shadow: none;
}

html[data-design-system="smartfarm"][data-theme="high-contrast"] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item {
  border-color: #000000;
  background: #ffffff;
  color: #000000;
}

html[data-design-system="smartfarm"][data-theme="high-contrast"] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item :is(strong, span:not(.nav-unread-badge)) {
  color: #000000;
}

html[data-design-system="smartfarm"][data-theme="high-contrast"] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item:is(.active, :hover) {
  background: #000000;
  color: #ffffff;
}

html[data-design-system="smartfarm"][data-theme="high-contrast"] body.work-screen:not(.terminal-kiosk-screen):not(.sysadmin-screen) .menu-item:is(.active, :hover) :is(strong, span:not(.nav-unread-badge)) {
  color: #ffffff;
}

@media print {
  html[data-design-system="smartfarm"][data-theme] body.work-screen :is(.context-card, .menu-grid, .bottom-tabs) {
    display: none;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen .dashboard-command-head {
    min-height: auto;
    padding: 18px;
    background: #ffffff;
    color: #000000;
  }

  html[data-design-system="smartfarm"][data-theme] body.work-screen .dashboard-command-head :is(h3, .eyebrow, .muted) {
    color: #000000;
  }
}
