a.nav-item, a.metric, a.tank-mini, a.text-button, a.button { text-decoration: none; color: inherit; }
.nav-item { text-decoration: none; }
details.nav-group > summary { list-style: none; }
details.nav-group > summary::-webkit-details-marker { display: none; }
details.nav-group > summary .when-open { display: none; }
details.nav-group[open] > summary .when-open { display: inline-flex; }
details.nav-group[open] > summary .when-closed { display: none; }
.nav-toggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.topbar form { margin: 0; }
.lang-switch { display: flex; gap: 4px; align-items: center; }
.lang-switch button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 8px; font-size: 10px; letter-spacing: .04em; color: var(--forest); }
.lang-switch button[data-current="true"] { background: var(--forest); color: #fff; border-color: var(--forest); }
.sheet { max-width: 760px; padding: 28px; }
.sheet h1 { margin-bottom: 18px; }
.sheet .field { margin-bottom: 14px; }
.sheet .outcome { margin-top: 16px; }
.lot-select { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.positions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.positions li { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: #fff; }
.outcome { margin: 12px 0; }
#vinea-dialog .e-input-group,
#vinea-dialog .e-control-wrapper { width: 100%; }
#vinea-dialog textarea.e-input { min-height: 72px; }
/* Sign-in — vineyard dawn composition */
.sign-in {
  --sign-ink: #1c2f26;
  --sign-muted: #4d6357;
  --sign-leaf: #3f6b4f;
  --sign-gold: #b08a4a;
  --sign-mist: #e8efe4;
  --sign-panel: rgba(247, 250, 245, 0.82);
  --sign-line: rgba(28, 47, 38, 0.14);
  --sign-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sign-ui: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  position: relative;
  isolation: isolate;
  margin: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: center;
  padding: clamp(28px, 5vw, 64px);
  overflow: hidden;
  color: var(--sign-ink);
  font-family: var(--sign-ui);
  background: #c5d4c0;
}

.sign-in__atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.sign-in__scene {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 48%;
  transform: scale(1.04);
  animation: sign-in-drift 22s ease-in-out infinite alternate;
}

.sign-in__wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(232, 239, 228, 0.88) 0%, rgba(232, 239, 228, 0.55) 38%, rgba(232, 239, 228, 0.2) 58%, rgba(36, 56, 44, 0.18) 100%),
    radial-gradient(ellipse 55% 50% at 78% 42%, rgba(250, 252, 248, 0.35), transparent 70%);
}

.sign-in__grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.sign-in__stage {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 400px);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  animation: sign-in-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sign-in__hero {
  display: grid;
  gap: 18px;
  align-content: center;
  justify-items: start;
  max-width: 28rem;
}

.sign-in__brand {
  display: grid;
  gap: 10px;
  justify-items: start;
  animation: sign-in-rise 0.9s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sign-in__mark {
  width: auto;
  height: clamp(42px, 7vw, 58px);
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(28, 47, 38, 0.12));
}

.sign-in__wordmark {
  margin: 0;
  font-family: var(--sign-display);
  font-size: clamp(3rem, 8vw, 4.6rem);
  font-weight: 650;
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--sign-ink);
}

.sign-in__headline {
  margin: 0;
  max-width: 14ch;
  font-family: var(--sign-display);
  font-size: clamp(1.55rem, 3.4vw, 2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--sign-ink);
  animation: sign-in-rise 0.9s 0.14s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sign-in__lede {
  margin: 0;
  max-width: 32ch;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--sign-muted);
  animation: sign-in-rise 0.9s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sign-in__form {
  --sign-panel-bg: rgba(250, 252, 248, 0.94);
  width: 100%;
  justify-self: end;
  margin-top: 0;
  padding: 28px 26px 26px;
  border: 1px solid rgba(28, 47, 38, 0.08);
  border-radius: 16px;
  background: var(--sign-panel-bg);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 22px;
  animation: sign-in-rise 0.95s 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sign-in__form-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sign-leaf);
}

.sign-in__outcome {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid #8f3b32;
  background: rgba(143, 59, 50, 0.08);
  color: #6e2e28;
  font-size: 0.92rem;
}

.sign-in__field {
  display: grid;
  gap: 8px;
  margin: 0;
}

.sign-in__field > span[data-code] {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sign-muted);
}

.sign-in__control {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 2px 10px;
  border: 0;
  border-bottom: 1.5px solid rgba(28, 47, 38, 0.55);
  background: transparent;
  transition: border-color 0.2s ease;
}

.sign-in__field:focus-within .sign-in__control {
  border-bottom-color: var(--sign-ink);
}

.sign-in__icon {
  width: 20px;
  height: 20px;
  fill: var(--sign-ink);
  opacity: 0.9;
}

.sign-in__control input {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sign-ink);
  font: inherit;
  font-size: 1rem;
  box-shadow: none;
}

.sign-in__control input:hover,
.sign-in__control input:focus {
  outline: none;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sign-in__reveal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sign-ink);
  cursor: pointer;
}

.sign-in__reveal:hover {
  background: rgba(28, 47, 38, 0.06);
}

.sign-in__reveal:focus-visible {
  outline: 2px solid rgba(176, 138, 74, 0.55);
  outline-offset: 2px;
}

.sign-in__eye {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.sign-in__submit {
  margin-top: 4px;
  width: 100%;
  justify-self: stretch;
  padding: 14px 22px;
  border: 0;
  border-radius: 8px;
  background: var(--sign-ink);
  color: #f4f7f1;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.sign-in__submit:hover {
  background: #243a30;
}

.sign-in__submit:active {
  transform: translateY(1px);
}

.sign-in__submit:focus-visible {
  outline: 3px solid rgba(176, 138, 74, 0.55);
  outline-offset: 3px;
}

@keyframes sign-in-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sign-in-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.2%, -0.6%, 0); }
}

@media (max-width: 900px) {
  .sign-in__stage {
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: stretch;
  }

  .sign-in__form {
    justify-self: stretch;
    max-width: 420px;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .sign-in {
    align-items: end;
    padding: 24px 20px max(28px, env(safe-area-inset-bottom));
  }

  .sign-in__wash {
    background:
      linear-gradient(180deg, rgba(232, 239, 228, 0.25) 0%, rgba(232, 239, 228, 0.55) 38%, rgba(232, 239, 228, 0.94) 68%, #e8efe4 100%),
      radial-gradient(ellipse 90% 50% at 70% 18%, rgba(255, 255, 255, 0.28), transparent 65%);
  }

  .sign-in__stage {
    width: 100%;
  }

  .sign-in__hero {
    max-width: none;
  }

  .sign-in__wordmark {
    font-size: clamp(2.6rem, 12vw, 3.4rem);
  }

  .sign-in__form {
    max-width: none;
    padding: 22px 18px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sign-in__scene,
  .sign-in__stage,
  .sign-in__brand,
  .sign-in__headline,
  .sign-in__lede,
  .sign-in__form {
    animation: none;
  }
}

@media (max-width: 640px) {
  .nav-toggle:checked + .sidebar { transform: translateX(0); }
}

.stage-harvest-chart { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 6px; text-align: center; }
.production-stage .harvest-gauge { --share: 0; width: 88px; height: 88px; margin: 2px auto 0; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--forest) calc(var(--share) * 1%), #e6ebe3 0); }
.production-stage .harvest-gauge > span { width: 64px; height: 64px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--forest); }
.production-stage .harvest-gauge b { font-size: 18px; line-height: 1; }
.production-stage .harvest-gauge small { margin-top: 2px; font-size: 11px; color: var(--muted); }
.production-stage .harvest-caption,
.production-stage .harvest-kilos { margin: 0; font-size: 11px; color: var(--muted); }
.production-stage .harvest-kilos b { color: var(--forest); font-size: 14px; }

/* SaaS Processi control center */
.process-next { margin-bottom: 22px; }
.process-next-list { display: grid; gap: 8px; padding: 0 18px 18px; }
.process-severity { display: inline-block; margin-top: 4px; font-size: 11px; color: var(--amber); font-style: normal; letter-spacing: .02em; }
.alert-dot[data-severity="process.severity.blocked"] { background: #9b3b2e; }
.alert-dot[data-severity="process.severity.attention"] { background: var(--amber); }
.alert-dot[data-severity="process.severity.upcoming"] { background: #36564b; }
.production-stage[data-status="process.status.blocked"] { border-color: rgba(155, 59, 46, .45); }
.production-stage[data-status="process.status.attention"] { border-color: rgba(164, 120, 53, .45); }
.production-stage[data-status="process.status.ready"] { border-color: rgba(54, 86, 75, .35); }
.process-stage-action { display: block; margin-top: 8px; font-size: 12px; color: var(--forest); font-weight: 600; }
.process-timeline { display: none; list-style: none; margin: 16px 0 0; padding: 0; gap: 8px; }
.process-timeline a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid rgba(32, 62, 53, .12); border-radius: 12px; text-decoration: none; min-height: 44px; align-items: center; }
.process-guide-secondary { margin-top: 28px; }
.process-onboarding .action-strip { padding: 0 18px 18px; }
.process-watch { margin-bottom: 16px; }
.process-guide-body { margin-top: 28px; display: grid; gap: 22px; }
.process-guide-group-title { margin: 0 0 10px; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-family: inherit; font-weight: 700; }
.process-guide-list { display: grid; gap: 10px; }
.process-guide-card { padding: 0; overflow: hidden; }
.process-guide-card-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 16px 18px; }
.process-guide-icon { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; background: var(--soft); color: var(--forest); }
.process-guide-step { display: inline-flex; min-width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; background: var(--forest); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.process-guide-production-timeline { display: none; list-style: none; margin: 0 0 14px; padding: 0; gap: 8px; }
.process-guide-production-timeline a { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; min-height: 44px; padding: 10px 12px; border: 1px solid rgba(32, 62, 53, .12); border-radius: 12px; text-decoration: none; }
.process-guide-production-timeline em { font-style: normal; font-size: 11px; color: var(--amber); }
.process-guide-card-copy h4 { margin: 0 0 4px; font-size: 17px; }
.process-guide-card-copy p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.process-guide-status { display: inline-block; margin-top: 8px; font-size: 11px; font-style: normal; letter-spacing: .02em; color: var(--amber); }
.process-guide-status[data-status="process.status.blocked"] { color: #9b3b2e; }
.process-guide-status[data-status="process.status.ready"],
.process-guide-status[data-status="process.status.completed"] { color: var(--forest); }
.process-guide-open { white-space: nowrap; align-self: center; }
.process-guide-detail { border-top: 1px solid rgba(32, 62, 53, .1); padding: 0 18px 14px; }
.process-guide-detail > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--forest); list-style: none; }
.process-guide-detail > summary::-webkit-details-marker { display: none; }
.process-guide-fields { display: grid; gap: 10px; margin: 0; }
.process-guide-fields > div { display: grid; gap: 2px; }
.process-guide-fields dt { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.process-guide-fields dd { margin: 0; font-size: 13px; line-height: 1.45; }
@media (max-width: 900px) {
  .process-guide-card-head { grid-template-columns: auto 1fr; }
  .process-guide-open { grid-column: 1 / -1; justify-self: start; }
  .process-guide-production-timeline { display: grid; }
  .process-guide-group[data-kind="Production"] .process-guide-list { display: none; }
}
.dashboard-exceptions { margin-bottom: 22px; }
.lot-header-status { margin: 10px 0 14px; color: var(--muted); font-size: 13px; }
.lot-overflow { position: relative; }
.lot-overflow > summary { list-style: none; }
.lot-overflow > summary::-webkit-details-marker { display: none; }
.lot-overflow-menu { position: absolute; z-index: 5; display: grid; gap: 6px; min-width: 180px; padding: 10px; margin-top: 6px; background: #fff; border: 1px solid rgba(32, 62, 53, .14); border-radius: 12px; box-shadow: 0 10px 30px rgba(32, 62, 53, .12); }
.trace-panel { margin: 12px 0; border: 1px solid rgba(32, 62, 53, .12); border-radius: 12px; padding: 8px 12px; background: var(--paper); }
.trace-panel > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.production-mobile-badge { display: inline-block; margin-top: 6px; padding: 4px 8px; border-radius: 999px; background: var(--soft); color: var(--forest); font-size: 11px; font-weight: 600; }
@media (max-width: 900px) {
  .process-map-flow { display: none; }
  .process-timeline { display: grid; }
}

/* Entry dialog validation: error left of Annulla/Salva, invalid field borders. */
:root { --field-invalid: #C9A27A; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
}
.modal-footer-error {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 220px);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--forest-light, #075F55);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  word-break: break-word;
}
.modal-footer-spacer {
  flex: 1 1 auto;
  min-width: 0;
}
.modal-footer-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  align-items: center;
  margin-left: auto;
}
.modal label.is-invalid > :is(input, select, textarea),
.modal label.is-invalid .e-input-group,
.modal label.is-invalid .e-control-wrapper {
  border-color: var(--field-invalid) !important;
  box-shadow: 0 0 0 1px var(--field-invalid);
}
@media (max-width: 640px) {
  .modal-footer {
    flex-wrap: wrap;
    align-items: stretch;
  }
  .modal-footer-error,
  .modal-footer-spacer {
    max-width: none;
    flex: 1 1 100%;
    order: -1;
  }
  .modal-footer-actions {
    width: 100%;
    margin-left: 0;
  }
  .modal-footer-actions > .button {
    flex: 1;
    justify-content: center;
  }
}
