:root {
  --bg: #f5f8fb;
  --ink: #0b1f3a;
  --muted: #596b78;
  --line: #d7e4ec;
  --panel: #fff;
  --soft: #edf7fb;
  --green: #0b1f3a;
  --green-dark: #07182d;
  --dark: #07182d;
  --sky: #83d7f0;
  --sky-soft: #dff6ff;
  --gold: #e4b551;
  --red: #9c3036;
  --amber: #9a5b1c;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  background: linear-gradient(to right, var(--dark) 0 290px, var(--bg) 290px 100%);
}

.hidden { display: none !important; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f5f8fb 0%, #e7f5fb 100%);
}

.auth-card {
  width: min(480px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(31,42,36,.12);
  padding: 26px;
}

.auth-brand {
  color: var(--ink);
  margin-bottom: 22px;
  background: transparent;
  border-color: transparent;
  padding: 0;
}

.auth-brand .logo-mark {
  box-shadow: none;
  filter: drop-shadow(0 12px 24px rgba(7,24,45,.18));
}

.auth-brand small { color: var(--muted); }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: 8px;
  background: var(--soft);
}

.auth-tab {
  background: transparent;
  color: var(--muted);
}

.auth-tab.active {
  background: var(--green);
  color: white;
}

.link-button {
  min-height: auto;
  padding: 4px 0;
  justify-self: start;
  background: transparent;
  color: var(--green-dark);
  font-weight: 800;
}

.link-button:hover {
  filter: none;
  text-decoration: underline;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: grid;
}

.auth-form h1 {
  font-size: 28px;
  margin-bottom: 4px;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
}

.form-message.success {
  color: var(--green-dark);
}

.form-message.status-card {
  min-height: auto;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #f0c8c8;
  border-radius: 8px;
  background: #fff2f2;
}

.form-message.status-card.success {
  border-color: #aad8c0;
  background: #edf9f2;
  color: var(--green-dark);
}

.form-message.status-card.pending {
  border-color: #cfe2ec;
  background: #f0f8fc;
  color: var(--ink);
}

button:disabled {
  cursor: wait;
  opacity: .65;
  filter: none;
}

aside {
  position: sticky;
  top: 0;
  min-height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--dark);
  color: white;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-bottom: 26px;
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(131, 215, 240, .28);
  border-radius: 18px;
  background: rgba(255, 255, 255, .07);
}

.logo-mark {
  width: 62px;
  height: 62px;
  display: block;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,.22));
}

.brand strong {
  font-size: 22px;
  line-height: 1.05;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: #c9e4ee;
}

button, input, select { font: inherit; }

button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  background: var(--green);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:hover { filter: brightness(.92); }

.secondary {
  background: #e6f0f5;
  color: var(--ink);
}

.danger {
  background: #f3d2d4;
  color: var(--red);
}

.nav {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  text-align: left;
  background: transparent;
  color: #eaf6fb;
  white-space: normal;
  line-height: 1.2;
  overflow-wrap: anywhere;
  min-height: 46px;
}

.nav.active,
.nav:hover {
  background: var(--sky);
  color: var(--ink);
}

.brand { order: 0; }
.nav[data-view="dashboard"] { order: 1; }
.nav[data-view="fornitori"] { order: 2; }
.nav[data-view="materie"] { order: 3; }
.nav[data-view="ricette"] { order: 4; }
.nav[data-view="menu"] { order: 5; }
.nav[data-view="lotti"] { order: 6; }
.nav[data-view="preparazioni"] { order: 7; }
.nav[data-view="magazzino"] { order: 8; }
.nav[data-view="registrazioni"] { order: 9; }
.nav[data-view="infestanti"] { order: 10; }
.nav[data-view="pulizie"] { order: 11; }
.nav[data-view="dipendenti"] { order: 12; }
.nav[data-view="campionamenti"] { order: 13; }
.nav[data-view="richiami"] { order: 14; }
.nav[data-view="trace"] { order: 15; }
.nav[data-view="nonConformita"] { order: 16; }
.nav[data-view="fascicolo"] { order: 17; }
.nav[data-view="audit"] { order: 18; }
.nav[data-view="auditTrail"] { order: 19; }
.nav[data-view="acque"] { order: 40; }
.nav[data-view="igiene"] { order: 41; }
.nav[data-view="manutenzioni"] { order: 42; }
.nav[data-view="rifiuti"] { order: 43; }
.nav[data-view="trasporto"] { order: 44; }
.nav[data-view="moca"] { order: 45; }
.nav[data-view="cultura"] { order: 46; }

main {
  min-width: 0;
  padding: 28px;
  background: var(--bg);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

header p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: var(--gold);
  color: var(--dark);
  font-size: 16px;
  font-weight: 700;
}

.user-badge small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1;
  opacity: .8;
}

.user-badge:hover {
  filter: brightness(.95);
}

.settings-gear {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 1.55V21a2 2 0 0 1-4 0v-.05a1.7 1.7 0 0 0-1-1.55 1.7 1.7 0 0 0-1.88.34l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-1.55-1H3a2 2 0 0 1 0-4h.05A1.7 1.7 0 0 0 4.6 9a1.7 1.7 0 0 0-.34-1.88l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.7 1.7 0 0 0 9 4.6a1.7 1.7 0 0 0 1-1.55V3a2 2 0 0 1 4 0v.05a1.7 1.7 0 0 0 1 1.55 1.7 1.7 0 0 0 1.88-.34l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.7 1.7 0 0 0 19.4 9a1.7 1.7 0 0 0 1.55 1H21a2 2 0 0 1 0 4h-.05A1.7 1.7 0 0 0 19.4 15Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 1.55V21a2 2 0 0 1-4 0v-.05a1.7 1.7 0 0 0-1-1.55 1.7 1.7 0 0 0-1.88.34l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-1.55-1H3a2 2 0 0 1 0-4h.05A1.7 1.7 0 0 0 4.6 9a1.7 1.7 0 0 0-.34-1.88l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.7 1.7 0 0 0 9 4.6a1.7 1.7 0 0 0 1-1.55V3a2 2 0 0 1 4 0v.05a1.7 1.7 0 0 0 1 1.55 1.7 1.7 0 0 0 1.88-.34l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.7 1.7 0 0 0 19.4 9a1.7 1.7 0 0 0 1.55 1H21a2 2 0 0 1 0 4h-.05A1.7 1.7 0 0 0 19.4 15Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

h1, h2 { margin: 0; }
h1 { font-size: 34px; }
h2 { margin-bottom: 18px; font-size: 19px; }

.view { display: none; }
.view.active { display: block; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stats article, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(31,42,36,.08);
}

.stats article {
  display: grid;
  place-content: center;
  justify-items: center;
  min-height: 92px;
  padding: 16px 14px;
  text-align: center;
}

.stat-card {
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.stat-card:hover,
.stat-card:focus-visible {
  border-color: var(--sky);
  box-shadow: 0 18px 44px rgba(11,31,58,.14);
  outline: none;
  transform: translateY(-1px);
}

.stats strong {
  display: block;
  color: var(--green);
  font-size: 36px;
  line-height: 1;
}

.stats span {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.15;
  white-space: normal;
}

.panel {
  min-width: 0;
  padding: 22px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 560px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.recipe-layout {
  grid-template-columns: 1fr;
}

.employee-layout {
  grid-template-columns: 1fr;
}

.supplier-layout {
  grid-template-columns: 1fr;
}

.material-layout {
  grid-template-columns: 1fr;
}

.registrations-layout {
  grid-template-columns: 1fr;
}

.device-form {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  align-items: end;
  margin-bottom: 16px;
}

.device-form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.device-form-actions button {
  justify-self: start;
}

#supplierForm {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  align-items: end;
}

#supplierForm h2,
#supplierForm input[name="id"],
#supplierCertificateStatus,
#supplierForm .item-actions {
  grid-column: 1 / -1;
}

.lots-layout {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  row-gap: 10px;
}

.lots-received-panel {
  grid-column: 1 / -1;
  margin-top: 0;
}

.form-column {
  display: grid;
  gap: 18px;
}

#lotti .form-column {
  display: contents;
}

#lotForm,
#ddtImportForm {
  height: 100%;
}

#lotForm button,
#ddtImportForm button {
  align-self: end;
}

#ddtImportPreview {
  grid-column: 1 / -1;
}

#preparazioni .layout {
  grid-template-columns: minmax(420px, 640px) minmax(0, 1fr);
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(320px, .8fr);
  gap: 18px;
  align-items: start;
}

.settings-column {
  display: grid;
  gap: 18px;
}

form { display: grid; gap: 14px; }

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  background: white;
  color: var(--ink);
  min-width: 0;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

legend {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.field-help {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.list { display: grid; gap: 10px; }

.alert-list {
  display: grid;
  gap: 12px;
}

.audit-list {
  display: grid;
  gap: 12px;
}

.item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.item strong { display: block; margin-bottom: 5px; }
.item small { color: var(--muted); line-height: 1.45; }
.item ul { margin: 10px 0 0; padding-left: 20px; }

.dashboard-focus {
  display: grid;
  gap: 18px;
}

#dashboard h2,
#dashboard .stats span {
  text-transform: uppercase;
}

.dashboard-task-card strong {
  color: var(--red);
}

.alert-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.alert-tile {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.alert-tile strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 6px;
}

.alert-tile span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.alert-tile.warn strong { color: var(--amber); }
.alert-tile.blocked strong { color: var(--red); }
.alert-tile.ok strong { color: var(--green-dark); }

.alert-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 12px;
  align-items: center;
  background: white;
}

.alert-marker {
  width: 12px;
  height: 100%;
  min-height: 58px;
  border-radius: 999px;
  background: var(--sky);
}

.alert-marker.warn { background: var(--amber); }
.alert-marker.blocked { background: var(--red); }

.audit-item {
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: start;
}

.audit-item .badge {
  margin-top: 0;
}

.alert-item h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.alert-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.item-actions button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 13px;
}

.badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #d7eadf;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.badge.warn { background: #f3e2ca; color: var(--amber); }
.badge.blocked { background: #f3d2d4; color: var(--red); }

.checks {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  padding-top: 8px;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
}

.checks input {
  width: 18px;
  min-height: 18px;
}

.procedure-checks {
  display: grid;
  gap: 10px;
  margin: 10px 0 14px;
}

.procedure-check {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
}

.procedure-check input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.procedure-check span {
  display: grid;
  gap: 4px;
}

.procedure-check small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.35;
}

.procedure-preview-card p,
.procedure-preview-card ul {
  margin: 8px 0 0;
}

.procedure-preview-card ul {
  padding-left: 20px;
  color: var(--muted);
}

.haccp-procedure-hub {
  border-color: rgba(126, 206, 226, .42);
  background: linear-gradient(180deg, #f8fcff 0%, #eef7fb 100%);
}

.haccp-procedure-head {
  align-items: flex-start;
  margin-bottom: 16px;
}

.procedure-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.procedure-hub-card {
  display: grid;
  gap: 8px;
  grid-template-rows: auto auto 1fr auto;
  min-height: 184px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.procedure-hub-card strong {
  color: var(--navy);
  font-size: 18px;
}

.procedure-hub-card span {
  justify-self: start;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  background: #e8f6fb;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.procedure-hub-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.procedure-hub-card button {
  align-self: end;
  width: 100%;
  margin-top: 4px;
}

.recipe-materials {
  display: grid;
  gap: 14px;
  padding-top: 8px;
}

.recipe-search-help,
.recipe-selected-empty,
.recipe-draft-total {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 700;
}

.recipe-search-results {
  display: grid;
  gap: 8px;
}

.recipe-search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.recipe-search-result strong,
.recipe-search-result small {
  display: block;
  overflow-wrap: anywhere;
}

.recipe-search-result small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.recipe-selected-title {
  margin: 4px 0 -4px;
  font-size: 16px;
}

.recipe-draft-table {
  min-width: 980px;
}

.recipe-draft-table input {
  width: 130px;
  min-height: 40px;
  padding: 8px 10px;
}

.recipe-draft-total {
  justify-self: end;
}

.lot-use-row {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
  width: 100%;
}

.lot-use-main {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.ingredient-lot-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  min-width: 0;
}

.ingredient-lot-group h3 {
  margin: 0;
  font-size: 15px;
}

.ingredient-lot-group .meta {
  color: var(--muted);
  font-size: 13px;
}

#preparazioni .checks {
  max-height: 360px;
  padding-right: 6px;
}

#preparazioni select[name="recipeId"] {
  overflow: hidden;
  text-overflow: ellipsis;
}

.warehouse-section {
  display: grid;
  gap: 10px;
}

.warehouse-section + .warehouse-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.warehouse-section h3 {
  margin: 0;
  font-size: 17px;
}

.warehouse-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.warehouse-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 14px;
}

.supplier-table {
  min-width: 1460px;
}

.employees-table {
  min-width: 1120px;
}

.materials-table {
  min-width: 1180px;
}

.registrations-table {
  min-width: 1080px;
}

.semis-table {
  min-width: 980px;
}

.nonconformity-table {
  min-width: 1220px;
}

.cleaning-table {
  min-width: 980px;
}

.cleaning-plan-table {
  min-width: 1060px;
}

.maintenance-table {
  min-width: 1160px;
}

.pest-table {
  min-width: 1120px;
}

.pest-records-table {
  min-width: 940px;
}

.devices-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 13px;
}

.devices-table th:nth-child(1),
.devices-table td:nth-child(1) {
  width: 18%;
}

.devices-table th:nth-child(2),
.devices-table td:nth-child(2) {
  width: 13%;
}

.devices-table th:nth-child(3),
.devices-table td:nth-child(3) {
  width: 13%;
}

.devices-table th:nth-child(4),
.devices-table td:nth-child(4) {
  width: 14%;
}

.devices-table th:nth-child(5),
.devices-table td:nth-child(5) {
  width: 13%;
}

.devices-table th:nth-child(6),
.devices-table td:nth-child(6) {
  width: 14%;
}

.devices-table th:nth-child(7),
.devices-table td:nth-child(7) {
  width: 15%;
}

.devices-table td,
.devices-table th {
  overflow-wrap: anywhere;
  padding: 9px 10px;
}

.device-table-section .warehouse-table-wrap {
  overflow-x: hidden;
}

.devices-table .table-actions {
  gap: 6px;
}

.devices-table button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 12px;
}

.lots-table {
  min-width: 1210px;
}

.recipes-table {
  min-width: 1080px;
}

.alert-table {
  min-width: 1180px;
}

.menu-table {
  min-width: 1240px;
}

.menu-table .badge {
  margin-right: 5px;
  margin-bottom: 4px;
}

.warehouse-table th,
.warehouse-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.warehouse-table th {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.warehouse-table tr:last-child td {
  border-bottom: 0;
}

.warehouse-table button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
  white-space: nowrap;
}

.warehouse-table .badge {
  margin-top: 0;
  margin-right: 4px;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1;
  padding: 5px 8px;
}

.warehouse-table .badge + .badge {
  margin-top: 0;
  margin-left: 4px;
}

.lots-table td:nth-child(8),
.lots-table td:nth-child(9) {
  min-width: 150px;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

.ddt-preview-table {
  min-width: 980px;
}

.ddt-preview-table input,
.ddt-preview-table select {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.muted-cell {
  color: var(--muted);
}

.archive-title {
  display: inline-block;
  cursor: pointer;
}

.archive-title:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.table-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 22px;
  background: rgba(7, 24, 45, .58);
}

.table-modal-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}

.table-modal-head {
  margin: 0;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.table-modal-head h2 {
  margin: 0;
}

.table-modal-body {
  min-width: 0;
  overflow: auto;
  padding: 18px;
}

.table-modal-body .warehouse-table-wrap {
  overflow: visible;
}

.recipe-material-row input[type="checkbox"],
.lot-use-row input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

.recipe-material-row .recipe-qty,
.lot-use-row .lot-use-qty {
  min-height: 36px;
  padding: 7px 8px;
  width: 100%;
}

.search {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 10px;
  margin-bottom: 18px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.steps span {
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.section-head p {
  margin: -8px 0 18px;
  color: var(--muted);
}

.sampling-calendar-head {
  align-items: center;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  justify-content: flex-end;
}

.calendar-controls strong {
  min-width: 130px;
  text-align: center;
  text-transform: capitalize;
}

.calendar-controls button {
  min-width: 42px;
  padding: 0 12px;
}

.sampling-calendar {
  overflow-x: auto;
}

.sampling-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 1px;
  min-width: 1050px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}

.sampling-weekday,
.sampling-day {
  background: white;
}

.sampling-weekday {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sampling-day {
  min-height: 132px;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.sampling-day.muted {
  background: #f6f9f5;
}

.sampling-day.today {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.sampling-day-number {
  font-weight: 800;
  color: var(--muted);
}

.sampling-empty {
  color: #a5b0aa;
}

.sampling-event {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 7px;
  background: var(--soft);
  border-left: 4px solid var(--green);
  font-size: 12px;
  line-height: 1.25;
}

.sampling-event strong,
.sampling-event span,
.sampling-event em {
  overflow-wrap: anywhere;
}

.sampling-event em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.sampling-event.warn {
  background: #fbf0df;
  border-left-color: var(--amber);
}

.sampling-event.blocked {
  background: #f7dfe1;
  border-left-color: var(--red);
}

.sampling-event-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.sampling-event-actions button,
.sample-upload-button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.sample-upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--green);
  color: white;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
}

.sample-upload-button:hover {
  filter: brightness(.92);
}

.sample-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.sample-archive-years {
  display: grid;
  gap: 18px;
}

.sample-year-section {
  display: grid;
  gap: 10px;
}

.sample-year-section h3 {
  margin: 0;
  font-size: 18px;
}

.sample-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.sample-report-card {
  display: grid;
  gap: 7px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.pest-map {
  position: relative;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(11, 31, 58, .07) 1px, transparent 1px),
    linear-gradient(rgba(11, 31, 58, .07) 1px, transparent 1px),
    #f7fbff;
  background-size: 48px 48px;
  touch-action: none;
}

.pest-map img {
  display: block;
  width: 100%;
  min-height: 360px;
  max-height: 620px;
  object-fit: contain;
  background: white;
}

.pest-map-placeholder {
  min-height: 360px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}

.pest-map-placeholder strong {
  color: var(--ink);
  font-size: 24px;
}

.pest-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 2px solid white;
  background: var(--green);
  color: white;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(8, 22, 40, .18);
  cursor: grab;
  user-select: none;
  z-index: 2;
}

.pest-marker.dragging {
  cursor: grabbing;
  z-index: 4;
  box-shadow: 0 14px 28px rgba(8, 22, 40, .28);
}

.pest-marker.warn {
  background: var(--amber);
}

.pest-marker.blocked {
  background: var(--red);
}

.coordinate-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.coordinate-preview input[readonly] {
  background: #eef7fc;
}

.recall-card {
  gap: 12px;
}

.recall-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 8px;
}

.recall-step {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-weight: 700;
}

.recall-step.done {
  background: var(--soft);
  color: var(--muted);
}

.recall-linked-nc {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: #f7fbff;
}

.recall-linked-nc.warn {
  border-left-color: var(--amber);
  background: #fff8e6;
}

.recall-linked-nc span {
  color: var(--muted);
  font-weight: 700;
}

.nonconformity-card {
  border-left: 5px solid var(--gold);
}

.nonconformity-steps .recall-step input {
  width: 18px;
  min-height: 18px;
}

.haccp-panel {
  display: grid;
  gap: 18px;
}

.haccp-preview {
  max-height: 72vh;
  overflow: auto;
  padding-right: 6px;
}

.haccp-dossier {
  display: grid;
  gap: 18px;
  color: var(--ink);
}

.haccp-doc-section {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  break-inside: avoid;
}

.haccp-doc-section h1,
.haccp-doc-section h2,
.haccp-doc-section h3,
.haccp-doc-section h4,
.haccp-doc-section p {
  margin: 0;
}

.haccp-cover > div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-size: 18px;
}

.report-print-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 10px;
  object-fit: contain;
}

.haccp-cover .report-print-logo {
  width: 72px;
  height: 72px;
  flex-basis: 72px;
}

.haccp-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft-blue);
}

.haccp-flow-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 170px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.haccp-flow-step span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--navy);
  color: white;
  font-weight: 800;
}

.haccp-flow-step strong {
  margin: 0;
  overflow-wrap: anywhere;
}

.haccp-flow-arrow {
  color: var(--muted);
  font-weight: 800;
}

.haccp-assessment-table {
  min-width: 1160px;
}

.haccp-mini-table {
  min-width: 720px;
}

.haccp-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.sample-report-card strong,
.sample-report-card span,
.sample-report-card small {
  overflow-wrap: anywhere;
}

.sample-report-card small {
  color: var(--muted);
}

.sample-report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sample-report-card button {
  justify-self: start;
}

.file-inline {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.file-inline input {
  width: min(240px, 100%);
}

.report-card {
  background: white;
}

.trace-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.trace-status-panel {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 280px;
}

.trace-status-panel .badge {
  margin-top: 0;
}

.trace-status-panel small {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.corrective-flag {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.corrective-flag input {
  width: 18px;
  min-height: 18px;
  flex: 0 0 auto;
}

.user-table {
  display: grid;
  gap: 8px;
}

.user-row {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(180px, .7fr);
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.audit-trail-table {
  min-width: 1180px;
}

.user-row strong,
.user-row span {
  overflow-wrap: anywhere;
}

.user-row small {
  color: var(--muted);
}

.print-area {
  display: none;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    background: var(--bg);
  }
  aside {
    min-height: auto;
    max-height: none;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 20;
    box-shadow: 0 8px 22px rgba(7,24,45,.16);
  }
  aside .brand {
    flex: 0 0 auto;
    margin: 0 8px 0 0;
    width: auto;
    padding: 7px 12px 7px 8px;
  }
  aside .logo-mark {
    width: 46px;
    height: 46px;
  }
  aside .brand strong {
    white-space: nowrap;
  }
  aside .brand small {
    display: none;
  }
  .nav {
    flex: 0 0 auto;
    width: auto;
    min-height: 40px;
    margin: 0;
    padding: 0 13px;
    white-space: nowrap;
    text-align: center;
  }
  main { padding: 18px; }
  header, .layout, .settings-layout, .stats, .search, .steps, .alert-summary, .section-head, .device-form { grid-template-columns: 1fr; }
  header, .section-head { display: grid; }
  #supplierForm { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }
  .header-actions button { width: 100%; }
  .alert-item { grid-template-columns: 1fr; }
  .alert-marker { width: 100%; height: 8px; min-height: 8px; }
  .recipe-search-result,
  .lot-use-main { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: 1fr; }
  .table-actions {
    flex-wrap: wrap;
  }
  .devices-table {
    min-width: 820px;
    table-layout: auto;
  }
  .device-table-section .warehouse-table-wrap {
    overflow-x: auto;
  }
  .sampling-calendar-grid {
    grid-template-columns: repeat(7, minmax(108px, 1fr));
    min-width: 756px;
  }
  .sampling-weekday {
    padding: 8px;
    font-size: 11px;
  }
  .sampling-day {
    min-height: 118px;
    padding: 8px;
    gap: 6px;
  }
  .calendar-controls {
    justify-content: stretch;
    min-width: 0;
  }
  .calendar-controls strong {
    flex: 1;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 238px minmax(0, 1fr);
    background: linear-gradient(to right, var(--dark) 0 238px, var(--bg) 238px 100%);
  }
  aside {
    padding: 18px 16px;
  }
  main {
    padding: 22px;
  }
  h1 {
    font-size: 30px;
  }
  .nav {
    min-height: 42px;
    padding-inline: 12px;
    font-size: 14px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .panel {
    padding: 18px;
  }
}

@media (max-width: 1280px) {
  #preparazioni .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .auth-screen {
    padding: 14px;
  }
  .auth-card {
    padding: 20px;
  }
  main {
    padding: 14px;
  }
  header {
    gap: 14px;
    margin-bottom: 18px;
  }
  h1 {
    font-size: 28px;
    line-height: 1.05;
  }
  h2 {
    font-size: 18px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stats article {
    min-height: 86px;
    padding: 14px 10px;
  }
  .stats strong {
    font-size: 30px;
  }
  .stats span {
    font-size: 13px;
  }
  .panel {
    padding: 14px;
  }
  .layout,
  .settings-layout {
    gap: 14px;
  }
  form {
    gap: 12px;
  }
  button,
  input,
  select,
  textarea {
    min-height: 44px;
  }
  .header-actions {
    grid-template-columns: 1fr;
  }
  .section-head {
    gap: 10px;
  }
  .section-head p {
    margin-bottom: 12px;
  }
  .item-actions,
  .table-actions,
  .sampling-event-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .item-actions button,
  .table-actions button,
  .sampling-event-actions button,
  .sample-upload-button {
    width: 100%;
    min-height: 38px;
  }
  .warehouse-table {
    font-size: 13px;
  }
  .warehouse-table th,
  .warehouse-table td {
    padding: 9px 10px;
  }
  .sample-report-grid {
    grid-template-columns: 1fr;
  }
  .recipe-draft-table {
    min-width: 760px;
  }
  .recipe-draft-table input {
    width: 110px;
  }
  .checks {
    max-height: 280px;
  }
  #preparazioni .checks {
    max-height: 420px;
  }
  .sampling-calendar-grid {
    grid-template-columns: repeat(7, minmax(96px, 1fr));
    min-width: 672px;
  }
  .sampling-event {
    padding: 7px;
    font-size: 11px;
  }
}

@media (max-width: 460px) {
  aside {
    padding: 10px;
  }
  aside .brand {
    gap: 8px;
    padding: 7px 10px 7px 7px;
  }
  aside .logo-mark {
    width: 40px;
    height: 40px;
  }
  aside .brand strong {
    font-size: 16px;
  }
  .nav {
    min-height: 38px;
    padding: 0 11px;
    font-size: 13px;
  }
  main {
    padding: 10px;
  }
  h1 {
    font-size: 24px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 12px;
  }
  fieldset {
    padding: 10px;
  }
  .calendar-controls {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }
  .calendar-controls button {
    min-width: 38px;
    padding: 0 8px;
  }
}

@media print {
  .auth-screen,
  .app-shell {
    display: none !important;
  }

  body {
    display: block;
    background: white;
    color: #000;
  }

  .print-area {
    display: block !important;
    padding: 24px;
    font-size: 12px;
  }

  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  @page supplier-landscape {
    size: A4 landscape;
    margin: 9mm;
  }

  .landscape-print {
    page: supplier-landscape;
  }

  .print-area h1 {
    font-size: 24px;
    margin-bottom: 4px;
  }

  .print-area h1:empty {
    display: none;
  }

  .print-area h2 {
    font-size: 16px;
    margin: 24px 0 10px;
  }

  .print-meta {
    margin: 0 0 18px;
    color: #555;
  }

  .report-print-head {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #0b1f3a;
  }

  .report-print-head div {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0b1f3a;
    font-size: 18px;
  }

  .report-print-logo {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    object-fit: contain;
  }

  .print-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 18px 0;
  }

  .print-box {
    border: 1px solid #999;
    padding: 10px;
  }

  .print-box strong {
    display: block;
    font-size: 20px;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #999;
    padding: 7px;
    text-align: left;
    vertical-align: top;
  }

  .print-table th {
    background: #eee;
  }

  .supplier-print-report {
    font-size: 9px;
  }

  .supplier-print-report .report-print-head {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .supplier-print-report .print-meta {
    margin-bottom: 10px;
  }

  .supplier-print-report h1 {
    font-size: 20px;
  }

  .supplier-print-table {
    table-layout: fixed;
    width: 100%;
  }

  .supplier-print-table th,
  .supplier-print-table td {
    padding: 4px;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.18;
  }

  .supplier-print-table th:nth-child(1) { width: 10%; }
  .supplier-print-table th:nth-child(2) { width: 11%; }
  .supplier-print-table th:nth-child(3) { width: 8%; }
  .supplier-print-table th:nth-child(4) { width: 7%; }
  .supplier-print-table th:nth-child(5) { width: 9%; }
  .supplier-print-table th:nth-child(6) { width: 10%; }
  .supplier-print-table th:nth-child(7) { width: 10%; }
  .supplier-print-table th:nth-child(8) { width: 12%; }
  .supplier-print-table th:nth-child(9) { width: 13%; }
  .supplier-print-table th:nth-child(10) { width: 10%; }

  .haccp-dossier {
    display: block;
  }

  .haccp-doc-section {
    margin-bottom: 18px;
    padding: 0 0 12px;
    border: 0;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    background: white;
    break-inside: avoid;
  }

  .haccp-recipe-section {
    break-before: page;
  }

  .haccp-flow {
    background: #f4f4f4;
    border: 1px solid #ccc;
  }

  .haccp-flow-step {
    border-color: #999;
  }

  .haccp-flow-step span {
    background: #111;
  }

  .haccp-assessment-table,
  .haccp-mini-table {
    min-width: 0;
  }

  .haccp-signatures {
    grid-template-columns: repeat(3, 1fr);
  }

  .menu-print {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 12px;
    color: #2e2723;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
  }

  .menu-print-head {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 58px;
  }

  .print-area .menu-print h1 {
    margin: 0;
    font-size: 36px;
    font-weight: 400;
    line-height: 1;
  }

  .menu-print-head p {
    margin: 18px 0 0;
    font-size: 16px;
  }

  .menu-print-body {
    width: min(430px, 100%);
    margin-left: 210px;
  }

  .menu-print-category {
    margin-bottom: 28px;
    break-inside: avoid;
  }

  .print-area .menu-print-category h2 {
    margin: 0 0 2px;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .menu-print-recipe {
    margin: 0 0 28px;
    break-inside: avoid;
  }

  .menu-print-recipe h3 {
    margin: 0 0 2px;
    font-size: 21px;
    font-weight: 400;
    line-height: 1.1;
  }

  .menu-print-recipe p {
    margin: 3px 0;
    line-height: 1.25;
  }

  .menu-print-recipe strong {
    font-weight: 400;
  }

  .menu-print-empty {
    margin: 0;
  }

  .menu-print {
    max-width: none;
    min-height: calc(297mm - 24mm);
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 18px;
    margin: 0;
    padding: 0;
    color: #07182d;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
  }

  .menu-print-cover {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 12px;
    background: #07182d;
    color: white;
  }

  .menu-print-brand {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .menu-print-brand img {
    width: 58px;
    height: 58px;
    object-fit: contain;
  }

  .menu-print-brand strong,
  .menu-print-brand span,
  .menu-print-company strong,
  .menu-print-company span {
    display: block;
  }

  .menu-print-brand strong {
    font-size: 26px;
    line-height: 1;
  }

  .menu-print-brand span,
  .menu-print-company span {
    margin-top: 4px;
    color: #dff6ff;
    font-size: 12px;
  }

  .menu-print-company {
    text-align: right;
  }

  .menu-print-company strong {
    margin-top: 6px;
    color: white;
    font-size: 14px;
    letter-spacing: 0;
  }

  .menu-print-head {
    display: block;
    margin: 0;
    padding: 14px 0 10px;
    border-bottom: 2px solid #83d7f0;
  }

  .menu-print-head p {
    margin: 0 0 6px;
    color: #0b6f95;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .print-area .menu-print h1 {
    margin: 0;
    color: #07182d;
    font-size: 0;
    font-weight: 900;
    line-height: 1;
  }

  .print-area .menu-print h1::after {
    content: "Piatti e preparazioni";
    font-size: 34px;
  }

  .menu-print-head small {
    display: block;
    width: min(540px, 100%);
    margin-top: 8px;
    color: #566b78;
    font-size: 12px;
    line-height: 1.35;
  }

  .menu-print-body {
    width: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    align-content: start;
  }

  .menu-print-category {
    display: grid;
    gap: 10px;
    margin: 0;
    break-inside: avoid;
  }

  .print-area .menu-print-category h2 {
    margin: 0;
    padding: 7px 10px;
    border-radius: 8px;
    background: #e6f8ff;
    color: #07182d;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .menu-print-recipe {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1px solid #d5e5ef;
    border-left: 5px solid #e4b551;
    border-radius: 10px;
    background: #fbfdff;
    break-inside: avoid;
  }

  .menu-print-recipe h3 {
    margin: 0 0 5px;
    color: #07182d;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.08;
  }

  .menu-print-recipe p {
    margin: 0;
    color: #31485a;
    font-size: 11px;
    line-height: 1.32;
  }

  .menu-print-recipe strong {
    display: block;
    margin-bottom: 3px;
    color: #07182d;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .menu-print-allergens {
    display: grid;
    gap: 6px;
  }

  .menu-print-allergens > span {
    color: #07182d;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .menu-print-allergens div {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .menu-print-allergens b,
  .menu-print-allergens em {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #07182d;
    color: white;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
  }

  .menu-print-allergens em {
    background: #e6f8ff;
    color: #07182d;
  }

  .menu-print-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px solid #d5e5ef;
    color: #566b78;
    font-size: 10px;
    font-weight: 800;
  }
}
