:root {
  color-scheme: light;
  --surface: #fff;
  --canvas: #f6f7fb;
  --ink: #1c2333;
  --muted: #596275;
  --line: #e5e8ef;
  --brand: #f39150;
  --dark: #191e2e;
  --orange-ink: #853b13;
  --focus: #96502c;
  font: 15px/1.45 Inter, Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); min-width: 320px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: fixed; z-index: 10; top: 8px; left: 8px; background: white; padding: 10px; transform: translateY(-140%); }
.skip:focus { transform: none; }
.shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  background: var(--dark); color: #fff; position: sticky; top: 0; align-self: start;
  min-height: 100dvh; display: flex; flex-direction: column; gap: 48px; padding: 31px 18px 22px;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand img { display: block; width: 76px; height: 76px; flex: none; border-radius: 16px; }
.brand-name { font-weight: 800; font-size: 1.04rem; line-height: 1.18; letter-spacing: -.01em; }
.brand-name small { display: block; margin-top: 3px; font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
nav { display: grid; gap: 5px; }
.nav-button { background: transparent; color: #c8ccd7; border: 0; text-align: left; padding: 10px 12px; min-height: 43px; display: flex; align-items: center; gap: 11px; border-radius: 9px; font-weight: 600; }
.nav-button:hover { background: #252b3b; color: white; }
.nav-button[aria-current="page"] { background: #342b2e; color: #ffc59e; }
.nav-button .icon { width: 19px; height: 19px; flex: none; }
.nav-count { margin-left: auto; background: #3a4154; border-radius: 20px; color: #fff; padding: 1px 7px; font-size: .73rem; font-variant-numeric: tabular-nums; }
.profile { margin: auto 3px 0; border-top: 1px solid #34394a; padding: 16px 5px 0; display: flex; align-items: center; gap: 9px; }
.profile:empty { display: none; }
.avatar { width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; background: #3a4051; color: #fff; font-weight: 750; flex: none; }
.profile strong, .profile small { display: block; }
.profile small { color: #c2c7d4; }
.profile-exit { margin-left: auto; color: #fff; border: 1px solid #666c7c; background: transparent; border-radius: 6px; padding: 4px 8px; }
#content { min-width: 0; }
.workspace { max-width: 1380px; margin: 0 auto; padding: 34px clamp(20px, 3.5vw, 52px) 60px; }
#heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.9rem, 3.35vw, 2.85rem); font-weight: 750; letter-spacing: -.058em; line-height: 1.08; margin-bottom: 7px; }
h2 { font-size: 1.2rem; letter-spacing: -.032em; line-height: 1.25; margin-bottom: 5px; }
h3 { font-size: 1rem; line-height: 1.3; margin-bottom: 3px; }
.sub, .muted { color: var(--muted); }
.sub { margin: 0; }
.muted { font-size: .86rem; }
.eyebrow { font-size: .72rem; letter-spacing: .08em; color: var(--muted); font-weight: 750; text-transform: uppercase; margin-bottom: 7px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 7px 12px; background: white; color: var(--ink); border: 1px solid #dce1ea; border-radius: 8px; font-size: .87rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #f5f7fb; border-color: #c4cbd8; }
.btn.primary { background: var(--dark); color: #fff; border-color: var(--dark); }
.btn.primary:hover { background: #31384b; }
.btn.secondary { background: #fff1e7; color: #7c3715; border-color: #ffddc6; }
.btn.danger { color: #942b35; }
.btn.icon-only { width: 38px; padding: 0; }
.icon { width: 17px; height: 17px; display: inline-block; vertical-align: middle; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 19px; }
.kpi {
  min-width: 0; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 14px; color: inherit;
}
.kpi:hover { border-color: #c7cdd9; }
.kpi-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 9px; background: #fff0e5; color: #934318; }
.kpi:nth-child(2) .kpi-icon { background: #e9efff; color: #3e53ac; }
.kpi:nth-child(3) .kpi-icon { background: #e7f5ed; color: #246e47; }
.kpi b { display: block; font-size: 1.47rem; font-weight: 750; line-height: 1.05; letter-spacing: -.045em; }
.kpi small { display: block; line-height: 1.22; color: var(--muted); margin-top: 4px; }
.kpi .arr { color: #646e80; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 19px; }
.card-head p { margin: 0; }
.card-body { padding: 0 19px 19px; }
.period-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.period-nav .range { font-size: .87rem; font-weight: 750; margin-right: 3px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
.schedule th, .schedule td { border-top: 1px solid var(--line); min-width: 88px; padding: 11px 7px; text-align: center; }
.schedule thead th { background: #f7f8fb; text-align: center; font-weight: 650; padding: 10px 7px; color: var(--muted); }
.schedule thead th strong { display: block; font-size: 1.06rem; color: var(--ink); line-height: 1.17; }
.schedule thead th.today, .schedule td.today { background: #fff8f2; }
.schedule th:first-child { text-align: left; padding-left: 19px; white-space: nowrap; min-width: 113px; }
.schedule tbody th { font-weight: 700; }
.schedule tfoot td, .schedule tfoot th { background: #f7f8fb; font-size: .8rem; }
.cell { min-height: 42px; display: flex; justify-content: center; align-content: center; align-items: center; gap: 4px; flex-wrap: wrap; }
.dot { color: #8991a1; }
.tag {
  display: inline-flex; align-items: center; justify-content: center; padding: 3px 6px; border-radius: 5px;
  min-height: 22px; font-size: .74rem; line-height: 1.18; font-weight: 720; white-space: nowrap;
}
.tag.lunch { background: #fdecc8; color: #6b4a00; }
.tag.dinner { background: #dcd2f4; color: #3d2a78; }
.tag.both { background: #cfe7d8; color: #1f5a38; }
.tag.extra { background: #e8803a; color: #fff; }
.tag.closed, .tag.wait { background: #eef0f4; color: #4b5364; }
.tag.warn { background: #ffd9c2; color: #8a3a10; }
.tag.pending { background: #fff2d9; color: #775117; }
.tag.approved { background: #e6f5eb; color: #2e6547; }
.legend { display: flex; gap: 9px 15px; align-items: center; flex-wrap: wrap; padding: 13px 19px; border-top: 1px solid var(--line); color: var(--muted); font-size: .81rem; }
.legend .tag { margin-right: 4px; }
.mobile-schedule { display: none; }
.rows { display: grid; }
.record { padding: 13px 19px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.record .record-main { min-width: 0; }
.record p { margin: 3px 0 0; overflow-wrap: anywhere; }
.record-name { font-weight: 730; }
.stack { display: grid; gap: 12px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.two .card { margin-top: 0; }
.empty { padding: 22px 19px; color: var(--muted); margin: 0; border-top: 1px solid var(--line); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
label { display: grid; gap: 5px; color: #353f51; font-size: .87rem; font-weight: 650; min-width: 0; }
label.full, .field-full, .fields > details.full, .fields > p.full, .fields > fieldset.full { grid-column: 1 / -1; }
label.check { display: flex; align-items: center; gap: 8px; }
input, select, textarea { min-width: 0; max-width: 100%; width: 100%; color: var(--ink); border: 1px solid #d9deea; background: #fff; border-radius: 8px; padding: 8px 9px; min-height: 40px; }
input[type="checkbox"] { width: 1.05rem; min-height: 0; height: 1.05rem; margin: 0; }
input[type="month"] { width: auto; }
textarea { resize: vertical; }
.field-help { color: var(--muted); font-size: .8rem; margin: -3px 0 0; }
.summary { padding: 13px 19px; border-top: 1px solid var(--line); background: #fafbfe; }
.summary strong { font-size: 1.05rem; }
.form-inline { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.form-inline select { width: auto; max-width: 100%; }
.tabs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.tab { border: 0; background: #f0f2f7; color: var(--muted); padding: 6px 9px; border-radius: 7px; font-size: .82rem; font-weight: 700; min-height: 35px; }
.tab[aria-pressed="true"] { background: #e1e7f4; color: var(--ink); }
dialog { width: min(540px, calc(100% - 24px)); color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 16px; padding: 0; box-shadow: 0 20px 70px #0d122141; max-height: min(90dvh, 740px); }
.backup-counts th, .backup-counts td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.backup-counts th:last-child, .backup-counts td:last-child { text-align: right; }
.backup-counts tbody th { font-weight: 500; }
dialog::backdrop { background: #14192ab0; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; }
.dialog-body { padding: 17px 20px; }
.dialog-note { font-size: .86rem; color: var(--muted); margin-bottom: 13px; }
.dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 17px; }
#status, .dialog-error { border-radius: 8px; background: #e7f5eb; color: #265e42; padding: 9px 12px; margin: 0 0 14px; font-size: .88rem; }
#status.error, .dialog-error { background: #ffeded; color: #822b30; }
.loading { margin-top: 25px; color: var(--muted); }
.access { padding: 26px 20px; }
.access p { margin-bottom: 13px; }
@media (max-width: 1080px) { .shell { grid-template-columns: 195px minmax(0, 1fr); } .sidebar { padding-inline: 12px; } }
@media (max-width: 880px) {
  .shell { display: block; }
  .sidebar { position: static; min-height: auto; padding: 11px 17px 0; gap: 10px; }
  .brand { gap: 10px; width: calc(100% - 52px); }
  .brand img { width: 56px; height: 56px; border-radius: 12px; }
  .brand-name { font-size: .95rem; }
  nav { display: flex; overflow-x: auto; gap: 3px; margin: 0 -5px 0; padding: 2px 5px 7px; scrollbar-width: thin; }
  .nav-button { min-height: 41px; white-space: nowrap; gap: 6px; font-size: .82rem; padding: 7px 8px; }
  .nav-button .icon { width: 15px; height: 15px; }
  .nav-count { padding-inline: 4px; }
  .profile { position: absolute; top: 11px; right: 15px; margin: 0; border: 0; padding: 0; }
  .profile > div:nth-child(2) { display: none; }
  .workspace { padding-top: 23px; }
}
@media (max-width: 650px) {
  .workspace { padding: 20px 13px 36px; }
  #heading { gap: 9px; margin-bottom: 15px; align-items: flex-start; }
  #heading .sub { font-size: .88rem; }
  #heading .btn { min-height: 37px; padding-inline: 8px; align-self: end; }
  .kpis { gap: 6px; margin-bottom: 12px; }
  .kpi { padding: 8px 7px; grid-template-columns: 1fr; gap: 5px; align-content: start; }
  .kpi-icon { width: 26px; height: 26px; border-radius: 6px; }
  .kpi b { font-size: 1.1rem; }
  .kpi small { font-size: .68rem; }
  .kpi .arr { display: none; }
  .card-head, .card-body, .record { padding-left: 13px; padding-right: 13px; }
  .card-head { flex-wrap: wrap; padding-top: 13px; padding-bottom: 12px; }
  .desktop-schedule { display: none; }
  .mobile-schedule { display: block; border-top: 1px solid var(--line); }
  .day-tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 8px; background: #f7f8fb; }
  .day-tabs button { border: 1px solid transparent; min-height: 46px; border-radius: 7px; background: transparent; color: var(--muted); font-size: .74rem; font-weight: 700; padding: 2px; }
  .day-tabs button strong { display: block; font-size: .93rem; line-height: 1.2; }
  .day-tabs button[aria-pressed="true"] { background: #fff0e5; color: #773615; border-color: #f7cfb4; }
  .mobile-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; padding: 11px; }
  .mobile-slots section { background: #f7f8fb; border-radius: 8px; padding: 9px; min-width: 0; }
  .mobile-slots h3 { margin-bottom: 7px; }
  .mobile-slots ul { list-style: none; margin: 0; padding: 0; }
  .mobile-slots li { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; padding: 4px 0; font-size: .82rem; overflow-wrap: anywhere; }
  .legend { gap: 6px 9px; padding: 10px; font-size: .69rem; }
  .record { align-items: start; flex-direction: column; gap: 8px; }
  .two { grid-template-columns: 1fr; gap: 12px; }
  .summary { padding: 10px 13px; }
  input, select, textarea { font-size: 16px; }
}

.order-products { margin-block: 8px 14px; }
.order-product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, minmax(0, clamp(4.6rem, 19vw, 8rem)));
  align-items: center;
  gap: clamp(5px, 2vw, 14px);
  padding-block: 4px;
  border-bottom: 1px solid #e4e8f0;
}
.order-product-row > div { min-width: 0; overflow-wrap: anywhere; }
.order-product-row small { display: block; color: #566178; }
.order-product-row input { min-height: 34px; padding: 4px 6px; }
.order-product-head { font-size: .76rem; font-weight: 700; }

.haccp-main { width: min(100% - 24px, 900px); margin: 24px auto; }
.haccp-main section, .haccp-main fieldset { margin-block: 12px; }
.haccp-main fieldset { min-width: 0; border: 1px solid #d9deea; border-radius: 8px; }
.haccp-main [hidden] { display: none; }
.haccp-main textarea { resize: vertical; }

.settings-groups { display: grid; gap: 14px; }
/* Banner delle impostazioni: freccia grande e ben visibile a destra, che gira quando si apre */
.personnel-settings > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; cursor: pointer; font-weight: 700; padding: 10px 0; min-height:44px; list-style:none; }
.personnel-settings > summary::-webkit-details-marker { display:none; }
.personnel-settings > summary::after { content:''; flex:none; width:12px; height:12px; margin:0 8px 4px 0; border-right:4px solid #234f93; border-bottom:4px solid #234f93; border-radius:2px; transform:rotate(45deg); transition:transform .15s; }
.personnel-settings[open] > summary::after { transform:rotate(225deg); margin-bottom:-4px; }
.personnel-settings > summary:focus-visible { outline:3px solid #f0a020; outline-offset:2px; border-radius:6px; }
.settings-content { margin-top: 18px; min-width: 0; }
.settings-content .card { box-shadow: none; margin-bottom: 12px; }
@media (max-width: 600px) {
  #heading .actions { justify-content: flex-end; flex-wrap: wrap; }
  .personnel-settings { padding: 16px; }
}

.haccp-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.haccp-banners { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin:28px 0; }
.haccp-banner { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; padding:32px 18px; min-height:160px; background:white; border:1px solid #d9deea; border-radius:16px; color:#181d2c; text-decoration:none; text-align:center; font-size:1.3rem; }
.haccp-banner span { font-size:2.5rem; }
.haccp-banner .status-badge { font-size:.85rem; }
.haccp-banner:focus-visible, .haccp-banner:hover { outline:3px solid #df8b3e; outline-offset:2px; }
@media(max-width:480px) { .haccp-banners { gap:12px; } .haccp-banner { padding:18px 16px; } }
/* Banner HACCP: titolo bianco su colore pieno, con lo stato del giorno */
.haccp-banners { grid-template-columns:1fr; gap:14px; }
.haccp-banner.tone-clean, .haccp-banner.tone-temp { flex-direction:row; justify-content:flex-start; gap:14px; min-height:0; padding:18px 20px; border:0; border-radius:18px; color:#fff; text-align:left; box-shadow:0 4px 14px #19223333; flex-wrap:wrap; }
.haccp-banner.tone-clean { background:linear-gradient(135deg,#14634a,#2a9d78); }
.haccp-banner.tone-temp { background:linear-gradient(135deg,#126b8c,#2aa6cf); }
.haccp-banner .tone-icon { font-size:2rem; line-height:1; flex:none; }
.haccp-banner .tone-text { flex:1; min-width:160px; font-size:1rem; }
.haccp-banner .tone-text strong { display:block; font-size:1.2rem; color:#fff; }
.haccp-banner .tone-text small { display:block; margin-top:2px; font-size:.88rem; color:#ffffffe6; }
.status-badge { flex:none; font-size:.85rem; font-weight:700; padding:6px 12px; border-radius:999px; background:#ffffff2e; color:#fff; border:1px solid #ffffff80; }
.status-badge.ok { background:#fff; color:#0f4a37; border-color:#fff; }
.status-badge.late { background:#c0262d; color:#fff; border-color:#ffb3b7; }

/* Supplier-order presentation is scoped to its own screen. */
.supplier-orders { --order-blue:#eaf5fc; --order-sand:#fbf4e4; --order-green:#eaf6ed; }
.supplier-orders > .card { border-radius:18px; box-shadow:0 3px 12px #18243806; }
.supplier-orders > .card:not(.order-disclosure):has([name="orderSupplier"]) { background:var(--order-blue); border-color:#c9e2f2; }
.supplier-orders > .card:has(#order-form) { border-color:#c4e1cb; }
.supplier-orders > .card:has(#order-form) > .card-head { background:var(--order-green); margin-bottom:16px; }
.supplier-orders .card-head h2 { font-size:1.12rem; }
.supplier-orders select, .supplier-orders input { font-size:16px; min-height:44px; }
.supplier-orders #reorder-settings > summary { cursor:pointer; font-weight:650; padding:8px 0; color:#fff; }
.supplier-orders .order-product-row { grid-template-columns:minmax(0,1fr) 105px 110px; gap:10px; padding:10px 0; align-items:center; border-bottom:1px solid #edf0f2; }
.supplier-orders .order-product-row > div:first-child { font-weight:600; line-height:1.4; }
.supplier-orders .order-product-row > div:nth-child(2) input { background:#f0f6fb; border-color:#c7d9e9; color:#244d6d; }
.supplier-orders .order-product-row > div:nth-child(3) input { background:#eff8f0; border-color:#b9d9c1; color:#205638; font-weight:700; }
.supplier-orders .order-product-head { border-bottom:2px solid #dce7df; font-size:.78rem; }
.supplier-orders .order-product-head > span:nth-child(2) { color:#244d6d; }
.supplier-orders .order-product-head > span:nth-child(3) { color:#205638; }
.supplier-orders .btn { min-height:44px; border-radius:10px; white-space:normal; text-align:center; }
.supplier-orders #order-form button[type="submit"],
.supplier-orders a[href^="https://wa.me/"] { background:#287549; border-color:#287549; color:white; }
.supplier-orders [data-order-action="newOrder"] { background:white; border-color:#90b99b; color:#205638; }
.supplier-orders [data-order-action="askSent"], .supplier-orders [data-send-order] button[type="submit"] { background:#e6f0fb; color:#24547c; border-color:#bbd2ec; }
.supplier-orders [data-order-action="openHistory"] { width:100%; background:#eaf0fa; border-color:#c9d6eb; color:#284d80; font-size:1rem; }
.supplier-orders .actions { flex-wrap:wrap; }
.supplier-orders .record { overflow-wrap:anywhere; }
.supplier-orders > .order-disclosure { padding:0; overflow:hidden; }
.supplier-orders .order-disclosure > summary { display:flex; align-items:center; justify-content:space-between; gap:14px; cursor:pointer; padding:20px 22px; min-height:64px; list-style:none; font-size:1.12rem; }
.supplier-orders .order-disclosure > summary::-webkit-details-marker { display:none; }
.supplier-orders .order-disclosure > summary::after, .supplier-orders .order-history-banner::after { content:''; width:9px; height:9px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); flex:none; margin:0 4px; }
.supplier-orders .order-disclosure[open] > summary::after { transform:rotate(225deg); }
.supplier-orders .order-disclosure > summary:focus-visible { outline:3px solid #dc8a4b; outline-offset:-3px; }
.supplier-orders .order-disclosure-body { padding:18px 22px; background:white; border-top:1px solid #dde4e8; }
.supplier-orders .order-disclosure-body > .actions { margin-bottom:16px; }
.supplier-orders .order-green { background:linear-gradient(135deg,#14634a,#2a9d78); border-color:#14634a; color:#fff; }
.supplier-orders .order-sand { background:linear-gradient(135deg,#9a5d00,#d9961a); border-color:#9a5d00; color:#fff; }
.supplier-orders .order-lilac { background:linear-gradient(135deg,#503490,#8261d0); border-color:#503490; color:#fff; }
.supplier-orders .order-blue { background:linear-gradient(135deg,#1c5d70,#3489a3); border-color:#1c5d70; color:#fff; }
.supplier-orders .order-peach { background:linear-gradient(135deg,#a8461a,#e8803a); border-color:#a8461a; color:#fff; }
.supplier-orders .order-disclosure > summary strong, .supplier-orders .order-history-banner strong { color:#fff; flex:1; font-size:1.15rem; }
.supplier-orders .order-disclosure > summary .banner-icon, .supplier-orders .order-history-banner .banner-icon { font-size:1.9rem; line-height:1; flex:none; }
.supplier-orders .order-disclosure > summary:focus-visible { outline-color:#fff; }
.supplier-orders .order-disclosure-body { color:var(--ink,#202735); }
.supplier-orders #reorder-settings > summary { padding:20px 22px; }
.supplier-orders .order-history-banner { background:linear-gradient(135deg,#234f93,#3f84d6); color:#fff; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:20px 22px; min-height:64px; border:1px solid #234f93; border-radius:18px; font-weight:700; cursor:pointer; text-align:left; width:100%; font-size:1.12rem; }
.supplier-orders .order-history-banner::after { transform:rotate(-45deg); }
@media(max-width:480px) {
  .supplier-orders .order-disclosure > summary, .supplier-orders #reorder-settings > summary, .supplier-orders .order-history-banner { padding:16px; }
  .supplier-orders .order-disclosure-body { padding:16px 12px; }
}
@media(max-width:600px) {
  .supplier-orders .order-product-row { grid-template-columns:minmax(0,1fr) 78px 82px; gap:6px; }
  .supplier-orders .order-product-head { font-size:.72rem; }
  .supplier-orders .order-product-row input { width:100%; padding:6px; }
  .supplier-orders #order-form > .actions { display:grid; grid-template-columns:1fr; }
  .supplier-orders .record { flex-wrap:wrap; }
  .supplier-orders .record > * { min-width:0; max-width:100%; }
}

.personnel-banners { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.personnel-banner { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:14px; min-height:200px; padding:26px; border:1px solid #cbdfea; border-radius:18px; text-align:left; color:#233a4b; background:#eaf5fc; }
.personnel-banner strong { font-size:1.4rem; }
.personnel-banner span { font-size:.95rem; line-height:1.5; }
.personnel-banner .icon { width:30px; height:30px; }
.personnel-covers { background:#eaf6ed; border-color:#c4e1cb; color:#245238; }
.personnel-extras { background:#fbf4e4; border-color:#eadcba; color:#624c2a; }
.personnel-banner:hover, .personnel-banner:focus-visible { outline:3px solid #a5bbc7; outline-offset:2px; }
@media(max-width:650px) { .personnel-banners { grid-template-columns:1fr; gap:12px; } .personnel-banner { min-height:140px; padding:22px; } }

.personnel-week { background:#f1eefb; border-color:#d9d0ee; color:#514278; }

.haccp-frame { display:block; width:100%; height:80vh; min-height:480px; border:0; border-radius:15px; }
.haccp-embedded .haccp-main { margin:0 auto; }
.haccp-embedded .haccp-heading.haccp { display:none; }
.haccp-tools { display:flex; gap:10px; margin-left:auto; }
.haccp-tools .btn { flex:1; white-space:normal; text-align:center; min-height:44px; }
@media(max-width:600px) { .haccp-tools { width:100%; margin-left:0; } .haccp-frame { height:78vh; } }

#save-feedback {
  position: fixed;
  z-index: 20;
  inset: max(12px, env(safe-area-inset-top)) 12px auto;
  margin: 0 auto;
  width: fit-content;
  max-width: min(28rem, calc(100% - 24px));
  box-sizing: border-box;
  pointer-events: none;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  background: #265e42;
  font-weight: 600;
  box-shadow: 0 4px 18px #0d122140;
}
#save-feedback:empty { visibility: hidden; }
#save-feedback[data-state="error"] { background: #822b30; }
#save-feedback[data-state="pending"] { background: #263754; }
#save-feedback[data-state="pending"]::before {
  content: '';
  display: inline-block;
  width: .8em;
  height: .8em;
  margin-inline-end: .5em;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: save-spin .8s linear infinite;
}
@keyframes save-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  #save-feedback[data-state="pending"]::before { animation: none; }
}


.haccp-banner { margin-block: 12px; }
.haccp-banner > summary, .production-register summary { cursor: pointer; font-weight: 600; }
.haccp-banner > summary { min-height: 44px; align-content: center; }
.production-register form, .lot-detail { margin-block: 12px; }
.production-register .lot-values { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 10px; }
.lot-values dt { font-weight: 600; }
.lot-values dd { margin: 2px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.lot-revision { padding-block: 8px; }
#lot-print { display: none; }
@media print {
  .production-register > a, .production-register > p, .production-register > header, #lots-error, #save-feedback,
  #lots-app > :not(#lot-print):not(#label-print) { display: none !important; }
  #lot-print { display: block; }
  #label-print { display: none; }
  body.printing-label #lot-print { display: none; }
  body.printing-label #label-print { display: block; margin: 0; }
  body.printing-label { margin: 0; padding: 0; background: #fff; }
  body.printing-label .production-register, body.printing-label .haccp-main { margin: 0; padding: 0; max-width: none; background: #fff; }
  .label { box-sizing: border-box; padding: 1.5mm 2mm; font-size: 8.5pt; overflow: hidden; break-after: page; page-break-after: always; color: #000; background: #fff;
    font-family: Arial, Helvetica, sans-serif; line-height: 1.15; }
  .label.s57x32 { width: 57mm; height: 32mm; }
  .label.s54x25 { width: 54mm; height: 25mm; font-size: 7pt; }
  .label.s89x36 { width: 89mm; height: 36mm; font-size: 10pt; }
  .label.s89x28 { width: 89mm; height: 28mm; font-size: 9pt; }
  .label-lot { font-size: 19pt; }
  .label.s54x25 .label-lot { font-size: 15pt; }
  .label.s89x36 .label-lot { font-size: 24pt; }
  .label.s89x28 .label-lot { font-size: 20pt; }
  .label:last-child { break-after: auto; page-break-after: auto; }
  .label-brand { font-size: .8em; text-transform: uppercase; letter-spacing: .02em; }
  .label-lot { font-weight: 700; margin: .5mm 0; line-height: 1.1; }
  .label-use { margin-top: .5mm; }
  #lot-print article { break-inside: avoid; border-bottom: 1px solid #ccc; }
}

/* Banner colorati per HACCP, pulizie e lotti di produzione */
.page-banner { display: flex; justify-content: flex-start; align-items: center; gap: 16px; padding: 20px 22px; margin: 14px 0 18px; border-radius: 18px; color: #fff;
  box-shadow: 0 6px 18px #19223326; }
.page-banner.haccp { background: linear-gradient(135deg, #1f2a44, #3b5385); }
.page-banner.clean { background: linear-gradient(135deg, #1b5f93, #3b9bd6); }
.page-banner.lots { background: linear-gradient(135deg, #a8461a, #e8803a); }
.page-banner .banner-icon { font-size: 2.5rem; line-height: 1; flex: none; }
.page-banner h1 { margin: 0; font-size: 1.65rem; color: #fff; }
.page-banner p { margin: 4px 0 0; color: #fff; font-size: .98rem; opacity: .96; }
.section-card { margin-block: 14px; border: 0; box-shadow: 0 4px 14px #19223322; }
.section-card > summary { display: flex; align-items: center; gap: 15px; padding: 17px 20px; color: #fff; cursor: pointer; list-style: none; font-weight: 600; }
.section-card > summary::-webkit-details-marker { display: none; }
.section-card > summary::after { content: '▾'; margin-left: auto; font-size: 1.3rem; transition: transform .15s; }
.section-card[open] > summary::after { transform: rotate(180deg); }
.section-card > summary .banner-icon { font-size: 2.1rem; line-height: 1; flex: none; }
.section-card > summary strong { display: block; font-size: 1.22rem; }
.section-card > summary small { display: block; margin-top: 3px; font-size: .9rem; font-weight: 500; opacity: .96; }
.section-card.ctl { background: #eef8f3; }
.section-card.ctl > summary { background: linear-gradient(135deg, #14634a, #2a9d78); }
.section-card.lots { background: #fff3e8; }
.section-card.lots > summary { background: linear-gradient(135deg, #a8461a, #e8803a); }
.section-card.latina { background: #eaf2fc; }
.section-card.latina > summary { background: linear-gradient(135deg, #234f93, #3f84d6); }
.section-card.mats { background: #eef8f3; }
.section-card.mats > summary { background: linear-gradient(135deg, #14634a, #2a9d78); }
.section-card.tags { background: #f2eefb; }
.section-card.tags > summary { background: linear-gradient(135deg, #503490, #8261d0); }
.latina-totals { width: 100%; border-collapse: collapse; margin-block: 12px; background: #fff; border-radius: 10px; overflow: hidden; }
.latina-totals th, .latina-totals td { padding: 9px 12px; border-bottom: 1px solid #d9e3f2; text-align: right; }
.latina-totals th:first-child { text-align: left; }
.latina-totals .latina-grand th, .latina-totals .latina-grand td { background: #234f93; color: #fff; font-weight: 700; border-bottom: 0; }
.section-card > :not(summary) { margin-inline: 18px; }
.section-card > :last-child { margin-bottom: 18px; }
.section-card > summary + * { margin-top: 16px; }
.production-register section.card > h2, .production-register #lot-form > h2 { margin: 0 0 12px; padding: 13px 18px; background: #fdebdc; color: #7a3410; border-bottom: 3px solid #e8803a; font-size: 1.15rem; }
.production-register #lot-form > .fields, .production-register #lot-form > .actions, .production-register #lot-form > p { margin-inline: 16px; }
.production-register #lot-form > .actions { margin-bottom: 16px; }
.production-register #lot-form.lot-delete > h2 { background: #fde7e9; color: #7e1f28; border-bottom-color: #c9414d; }
.production-register #lot-filters { padding: 0 16px 16px; }
.production-register .lot-record { border-left: 6px solid #e8803a; }
.production-register .lot-record > summary { padding: 13px 16px; }
.production-register .lot-detail { padding: 0 16px 16px; }
.production-register .lot-deleted { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border-top: 1px solid var(--line); }
.production-register details.card:not(.section-card) > summary { padding: 13px 16px; background: #f1f3f8; font-weight: 700; }
@media (max-width: 480px) { .page-banner { padding: 16px 16px; gap: 12px; } .page-banner .banner-icon { font-size: 2.1rem; } .page-banner h1 { font-size: 1.4rem; } }
.removed-staff { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.removed-staff > summary { cursor: pointer; font-weight: 700; color: var(--muted); min-height: 40px; align-content: center; }

#label-print { display: none; }

/* HACCP impostazioni: elenco esistente, aggiunta e programmazione ben distinti */
.card.haccp-list, .card.haccp-add, .card.haccp-sched { padding:0; overflow:hidden; }
.card.haccp-list > h2, .card.haccp-add > h2, .card.haccp-sched > h2 { margin:0; padding:14px 18px; color:#fff; font-size:1.12rem; }
.card.haccp-list > h2 { background:linear-gradient(135deg,#234f93,#3f84d6); }
.card.haccp-add > h2 { background:linear-gradient(135deg,#14634a,#2a9d78); }
.card.haccp-sched > h2 { background:linear-gradient(135deg,#503490,#8261d0); }
.card.haccp-list { border-color:#c9d6eb; } .card.haccp-add { border-color:#c4e1cb; } .card.haccp-sched { border-color:#dcd4ed; }
.card.haccp-list > :not(h2) { margin-left:18px; margin-right:18px; } .card.haccp-list > ul { margin-top:14px; margin-bottom:14px; }
.card.haccp-add > form, .card.haccp-sched > form { padding:16px 18px 18px; }
.card.haccp-add { background:#f1faf5; } .card.haccp-sched { background:#f6f3fc; }
.task-filter { margin-bottom:6px; } .task-count { color:#4a5568; font-size:.92rem; margin:4px 0 0; }
.haccp-list li[hidden], #task-list > li[hidden] { display:none; }
/* Consegne a Latina: data centrata in alto, un tipo per riga con pacchi e piadine affiancati */
.latina-form .latina-date { max-width:260px; margin:0 auto 14px; text-align:center; }
.latina-form .latina-date input { text-align:center; }
.latina-form .latina-type { border:1px solid #c9d6eb; border-radius:12px; margin:0 0 12px; padding:8px 12px 12px; }
.latina-form .latina-type legend { font-weight:700; padding:0 6px; }
.latina-form .latina-pair { display:grid; grid-template-columns:1fr 1fr; gap:12px; align-items:end; }
.latina-form .latina-pair small { display:block; font-weight:400; opacity:.8; }
.latina-form textarea { width:100%; box-sizing:border-box; margin-bottom:12px; }
/* Scelta del compilatore sul PC del locale: pulsanti grandi con i nomi sempre visibili */
.compiler { border:1px solid #c9d6eb; border-radius:12px; padding:8px 12px 12px; margin:0 0 14px; }
.compiler-title { font-weight:700; margin:0 0 8px; }
.compiler-list { display:flex; flex-wrap:wrap; gap:8px; }
.compiler-choice { position:relative; }
.compiler-choice input { position:absolute; opacity:0; inset:0; margin:0; cursor:pointer; }
.compiler-choice span { display:block; padding:10px 16px; border:2px solid #b8c6dc; border-radius:999px; background:#fff; color:#1b2a44; font-weight:600; }
.compiler-choice input:checked + span { background:#234f93; border-color:#234f93; color:#fff; }
.compiler-choice input:focus-visible + span { outline:3px solid #f0a020; outline-offset:2px; }
/* Ferie approvate: un banner per persona con nome e numero di giorni, si apre sull'elenco dei giorni */
.leave-approved { margin-top:18px; }
.leave-approved-title { margin:0 0 10px; font-size:1.1rem; }
.card.leave-person { padding:0; overflow:hidden; margin-bottom:10px; border-color:#14634a; }
.leave-person > summary { display:flex; align-items:center; gap:12px; cursor:pointer; list-style:none; padding:14px 18px; color:#fff; background:linear-gradient(135deg,#14634a,#2a9d78); }
.leave-person > summary::-webkit-details-marker { display:none; }
.leave-person > summary .banner-icon { font-size:1.6rem; line-height:1; }
.leave-person > summary strong { flex:1; font-size:1.12rem; color:#fff; }
.leave-person > summary .leave-count { background:rgba(255,255,255,.22); border-radius:999px; padding:4px 12px; font-weight:700; }
.leave-person > summary::after { content:''; width:9px; height:9px; border-right:2px solid #fff; border-bottom:2px solid #fff; transform:rotate(45deg); margin:0 4px; }
.leave-person[open] > summary::after { transform:rotate(225deg); }
.leave-person > summary:focus-visible { outline:3px solid #f0a020; outline-offset:-3px; }
.leave-days { padding:8px 14px 14px; background:#f1faf5; }
.cover-slots { display:flex; flex-wrap:wrap; gap:6px; margin:6px 0; }
/* Schema turni */
.schema-mode { display:flex; gap:8px; flex-wrap:wrap; margin:6px 0 10px; }
.schema-from { display:flex; gap:10px; align-items:center; flex-wrap:wrap; font-weight:600; margin-bottom:10px; }
.schema-table { border-collapse:separate; border-spacing:0; width:100%; font-size:.95rem; }
.schema-table th, .schema-table td { padding:7px 6px; border-bottom:1px solid #e2e8f0; text-align:center; }
.schema-table th:first-child { text-align:left; white-space:nowrap; }
.schema-table thead th { background:#234f93; color:#fff; border-bottom:0; }
.schema-table thead th strong { display:block; }
.schema-table thead th.today { background:#1b3f78; box-shadow:inset 0 -3px 0 #f0a020; }
.schema-need-row th, .schema-need-row td { background:#f5f0ff; }
.schema-need { width:46px; text-align:center; font:inherit; font-weight:700; border:2px solid #c3b3ea; border-radius:8px; padding:5px 2px; background:#fff; }
.schema-need:disabled { opacity:.5; }
.schema-select { font:inherit; font-weight:700; padding:6px 4px; border-radius:8px; border:2px solid #b8c6dc; background:#fff; min-width:62px; }
.schema-select.code-p { background:#fdecc8; color:#6b4a00; border-color:#fdecc8; }
.schema-select.code-c { background:#dcd2f4; color:#3d2a78; border-color:#dcd2f4; }
.schema-select.code-pc { background:#cfe7d8; color:#1f5a38; border-color:#cfe7d8; }
.schema-select.code-r { background:#eef0f4; color:#69738a; border-color:#eef0f4; }
.schema-total { display:inline-block; border-radius:10px; padding:6px 8px; min-width:62px; font-weight:800; }
.schema-total.ok { background:#e3f3e9; color:#1f6b45; }
.schema-total.low { background:#ffd9c2; color:#8a3a10; }
.schema-total.over { background:#fde2e4; color:#a1202c; }
.schema-total.muted-total { background:#eef0f4; color:#4b5364; }
.schema-note { display:block; font-size:.8rem; font-weight:600; }
.schema-alert { border-radius:12px; padding:10px 14px; margin:12px 0; font-weight:700; }
.schema-alert ul { margin:6px 0 0; padding-left:20px; font-weight:600; }
.schema-alert.over { background:#fde2e4; color:#a1202c; border:2px solid #d34a58; }
.schema-alert.low { background:#ffd9c2; color:#8a3a10; border:2px solid #e8803a; }
.schema-locked { display:inline-block; }
.schema-day { padding:10px 12px 14px; }
.schema-need-line { display:flex; justify-content:space-between; align-items:center; gap:8px; background:#f5f0ff; border-radius:12px; padding:10px; margin-bottom:8px; font-weight:700; }
.schema-line { display:flex; justify-content:space-between; align-items:center; padding:9px 0; border-bottom:1px solid #e2e8f0; font-weight:700; gap:8px; }
.schema-line > span:last-child { display:flex; gap:6px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.schema-totals { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; text-align:center; }
.schema-totals small { display:block; font-weight:600; margin-bottom:4px; }
.schema-totals .schema-total { display:block; }
.day-tabs button.day-over { box-shadow:inset 0 0 0 2px #d34a58; }
.day-tabs button.day-low { box-shadow:inset 0 0 0 2px #e8803a; }
@media (max-width: 560px) { .schema-table .schema-need { width:34px; padding:5px 0; } .schema-table th, .schema-table td { padding:6px 3px; } }
.schema-day-title { margin:4px 0 10px; font-size:1.25rem; }
.schema-slots { display:grid; gap:10px; margin-bottom:12px; }
.schema-slot { display:grid; grid-template-columns:auto 1fr; gap:4px 12px; align-items:center; border-radius:14px; padding:12px 14px; border:2px solid transparent; }
.schema-slot > strong { font-size:1.1rem; }
.schema-slot > label { display:flex; gap:8px; align-items:center; justify-content:flex-end; font-weight:600; }
.schema-slot > span { grid-column:1 / -1; font-weight:800; }
.schema-slot.ok { background:#e6f5eb; color:#1f6b45; border-color:#58a878; }
.schema-slot.low { background:#ffd9c2; color:#8a3a10; border-color:#e8803a; }
.schema-slot.over { background:#fde2e4; color:#a1202c; border-color:#d34a58; }
.schema-slot.none, .schema-slot.closed { background:#eef0f4; color:#4b5364; }
.schema-legend { background:#f7f8fb; border-radius:10px; padding:8px 12px; font-size:.9rem; margin:0 0 6px; }
.schema-line { font-size:1.05rem; }
.schema-line .schema-select { font-size:1.1rem; min-width:84px; padding:9px 8px; }
/* Storico ordini: un banner chiuso per ogni ordine */
.supplier-orders .history-order { margin:0 0 10px; border:1px solid #234f93; border-radius:16px; overflow:hidden; background:#eaf2fc; }
.supplier-orders .history-order > summary { display:flex; align-items:center; gap:12px; cursor:pointer; list-style:none; padding:14px 16px; color:#fff; background:linear-gradient(135deg,#234f93,#3f84d6); }
.supplier-orders .history-order > summary::-webkit-details-marker { display:none; }
.supplier-orders .history-order > summary .banner-icon { font-size:1.7rem; line-height:1; flex:none; }
.supplier-orders .history-order > summary > span:nth-child(2) { flex:1; min-width:0; }
.supplier-orders .history-order > summary strong { display:block; color:#fff; font-size:1.08rem; }
.supplier-orders .history-order > summary small { display:block; opacity:.95; font-size:.9rem; font-weight:500; }
.supplier-orders .history-order .history-status { background:rgba(255,255,255,.22); border-radius:999px; padding:4px 12px; font-weight:700; font-size:.88rem; white-space:nowrap; }
.supplier-orders .history-order > summary::after { content:''; width:10px; height:10px; border-right:3px solid #fff; border-bottom:3px solid #fff; transform:rotate(45deg); flex:none; margin:0 4px 4px 2px; }
.supplier-orders .history-order[open] > summary::after { transform:rotate(225deg); margin-bottom:-4px; }
.supplier-orders .history-order > summary:focus-visible { outline:3px solid #f0a020; outline-offset:-3px; }
.supplier-orders .history-order-body { padding:12px 16px 14px; }
/* Consegne a Latina: un banner chiuso per ogni consegna */
.latina-delivery { margin:0 0 10px; border:1px solid #234f93; border-radius:16px; overflow:hidden; background:#fff; }
.latina-delivery > summary { display:flex; align-items:center; gap:12px; cursor:pointer; list-style:none; padding:13px 16px; color:#fff; background:linear-gradient(135deg,#234f93,#3f84d6); }
.latina-delivery > summary::-webkit-details-marker { display:none; }
.latina-delivery > summary .banner-icon { font-size:1.6rem; line-height:1; flex:none; }
.latina-delivery > summary > span:nth-child(2) { flex:1; min-width:0; }
.latina-delivery > summary strong { display:block; color:#fff; font-size:1.08rem; }
.latina-delivery > summary small { display:block; font-size:.88rem; font-weight:500; opacity:.95; }
.latina-total-badge { background:rgba(255,255,255,.22); border-radius:999px; padding:5px 12px; font-weight:800; white-space:nowrap; }
.latina-delivery > summary::after { content:''; width:10px; height:10px; border-right:3px solid #fff; border-bottom:3px solid #fff; transform:rotate(45deg); flex:none; margin:0 4px 4px 2px; }
.latina-delivery[open] > summary::after { transform:rotate(225deg); margin-bottom:-4px; }
.latina-delivery > summary:focus-visible { outline:3px solid #f0a020; outline-offset:-3px; }
.latina-delivery-body { padding:10px 14px 14px; }
.latina-delivery-body .latina-totals { margin-block:6px 10px; }
/* Consegne a Latina: un banner per mese, i giorni dentro */
.latina-month { margin:0 0 12px; border:1px solid #234f93; border-radius:16px; overflow:hidden; background:#f4f8fe; }
.latina-month > summary { display:flex; align-items:center; gap:12px; cursor:pointer; list-style:none; padding:15px 16px; color:#fff; background:linear-gradient(135deg,#1c3f78,#2f6cc0); }
.latina-month > summary::-webkit-details-marker { display:none; }
.latina-month > summary .banner-icon { font-size:1.7rem; line-height:1; flex:none; }
.latina-month > summary > span:nth-child(2) { flex:1; min-width:0; }
.latina-month > summary strong { display:block; color:#fff; font-size:1.18rem; }
.latina-month > summary small { display:block; font-size:.9rem; font-weight:500; opacity:.95; }
.latina-month > summary::after { content:''; width:10px; height:10px; border-right:3px solid #fff; border-bottom:3px solid #fff; transform:rotate(45deg); flex:none; margin:0 4px 4px 2px; }
.latina-month[open] > summary::after { transform:rotate(225deg); margin-bottom:-4px; }
.latina-month > summary:focus-visible { outline:3px solid #f0a020; outline-offset:-3px; }
.latina-month-body { padding:12px 12px 6px; }
.latina-month-body .latina-delivery { border-color:#9db6dc; }
.latina-month-body .latina-delivery > summary { background:#e4ecff; color:#173a73; padding:11px 14px; }
.latina-month-body .latina-delivery > summary strong { color:#173a73; font-size:1rem; }
.latina-month-body .latina-delivery > summary::after { border-color:#173a73; }
.latina-month-body .latina-delivery > summary .latina-total-badge { background:#234f93; color:#fff; }
.latina-month-body > .actions { margin:6px 0 14px; }
.latina-none > summary { background:linear-gradient(135deg,#5d6b82,#7d8aa0); }
.latina-none { border-color:#5d6b82; }

.section-card.labels { background: #f6f0fb; }
.section-card.labels > summary { background: linear-gradient(135deg, #5b3a8c, #8b63c7); }
.section-card.history { background: #fdf3e8; }
.section-card.history > summary { background: linear-gradient(135deg, #a4561b, #e08a3c); }
.section-card.labels > form, .section-card.labels > p, .section-card.history > form, .section-card.history > #lot-results { margin: 14px 16px; }

.archive-body { padding: 14px 16px; }
.section-card.archive { background:#f2f5fb; }
.section-card.archive > summary { background: linear-gradient(135deg,#2c3f66,#4e6aa6); }
.record-banner { margin:10px 0; border:1px solid #c9d3e6; border-radius:14px; background:#fff; overflow:hidden; }
.record-banner > summary { display:flex; align-items:center; gap:12px; padding:11px 14px; cursor:pointer; list-style:none; background:#e8eefa; }
.record-banner > summary::-webkit-details-marker { display:none; }
.record-banner > summary::after { content:'▾'; margin-left:auto; font-size:1.2rem; }
.record-banner[open] > summary::after { transform:rotate(180deg); }
.record-banner > summary strong { display:block; }
.record-banner > summary small { display:block; color:#4a5670; }
.record-banner > summary .banner-icon { font-size:1.6rem; }
.record-body { padding:12px 14px; }
.haccp-top { margin:10px 0; }
.archive-body .actions { margin-top: 14px; }

.back-slot { margin: 6px 0 12px; }
.back-slot:empty { display:none; }
button.back-button { cursor:pointer; font:inherit; font-weight:700; }
.back-button { display:inline-flex; align-items:center; gap:4px; min-height:40px; padding:6px 14px; border:1px solid #cdd5e4; border-radius:999px; background:#fff; color:#181d2c; font-weight:700; text-decoration:none; }
.back-button:hover, .back-button:focus-visible { background:#eef2fa; outline:2px solid #3b5385; outline-offset:2px; }
.haccp-types { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:14px 16px; }
.haccp-types[hidden] { display:none; }
.type-btn { display:flex; align-items:center; justify-content:center; min-height:52px; padding:10px 12px; border-radius:14px; color:#fff; font-weight:700; text-align:center; text-decoration:none; box-shadow:0 3px 10px #19223326; }
.type-btn.fridge { background:linear-gradient(135deg,#126b8c,#2aa6cf); }
.type-btn.cleaning { background:linear-gradient(135deg,#14634a,#2a9d78); }
.type-btn[aria-current="page"] { box-shadow:0 0 0 3px #181d2c; }

/* Ordini: scelta del fornitore e "Prepara il mio ordine" grandi, "Scorte e stagioni" medio, il resto piccolo. */
.supplier-orders .supplier-pick { padding:22px; }
.supplier-orders .supplier-pick-head { display:flex; align-items:center; gap:14px; margin-bottom:14px; color:#12425a; }
.supplier-orders .supplier-pick-head .banner-icon { font-size:2.4rem; line-height:1; }
.supplier-orders .supplier-pick-head strong { font-size:1.5rem; }
.supplier-orders .supplier-pick-select { display:block; font-weight:600; color:#244d6d; }
.supplier-orders .supplier-pick-select span { display:block; margin-bottom:6px; font-size:.95rem; }
.supplier-orders .supplier-pick-select select { width:100%; min-height:58px; font-size:1.3rem; font-weight:700; }
.supplier-orders #order-preparation > summary { padding:28px 24px; min-height:88px; }
.supplier-orders #order-preparation > summary strong { font-size:1.55rem; }
.supplier-orders #order-preparation > summary .banner-icon { font-size:2.5rem; }
.supplier-orders #reorder-settings > summary { padding:20px 22px; min-height:68px; }
.supplier-orders #reorder-settings > summary strong { font-size:1.2rem; }
.supplier-orders #reorder-settings > summary .banner-icon { font-size:1.9rem; }
.supplier-orders #order-current > summary, .supplier-orders #order-catalog > summary, .supplier-orders #order-suppliers > summary,
.supplier-orders #order-admin > summary, .supplier-orders .order-history-banner { padding:10px 18px; min-height:46px; }
.supplier-orders #order-current > summary strong, .supplier-orders #order-catalog > summary strong, .supplier-orders #order-suppliers > summary strong,
.supplier-orders #order-admin > summary strong, .supplier-orders .order-history-banner strong { font-size:.98rem; }
.supplier-orders #order-current > summary .banner-icon, .supplier-orders #order-catalog > summary .banner-icon, .supplier-orders #order-suppliers > summary .banner-icon,
.supplier-orders #order-admin > summary .banner-icon, .supplier-orders .order-history-banner .banner-icon { font-size:1.3rem; }
.supplier-orders .order-history-banner { border-radius:14px; }
@media(max-width:480px) {
  .supplier-orders #order-preparation > summary { padding:22px 16px; }
  .supplier-orders #order-current > summary, .supplier-orders #order-catalog > summary, .supplier-orders #order-suppliers > summary,
  .supplier-orders #order-admin > summary, .supplier-orders .order-history-banner { padding:9px 14px; }
}
.supplier-orders #order-current, .supplier-orders #order-catalog, .supplier-orders #order-suppliers, .supplier-orders #order-admin, .supplier-orders .order-history-banner { margin-block: 8px; }

a.lots-link, .section-card.lots.lots-link { display:flex; align-items:center; gap:15px; padding:17px 20px; color:#fff; text-decoration:none; font-weight:600; background:linear-gradient(135deg,#a8461a,#e8803a); border:0; border-radius:18px; box-shadow:0 4px 14px #19223322; }
a.lots-link[hidden] { display:none; }
a.lots-link::after { content:'›'; margin-left:auto; font-size:1.8rem; }
a.lots-link .banner-icon { font-size:2.1rem; line-height:1; flex:none; }
a.lots-link strong { display:block; font-size:1.22rem; }
a.lots-link small { display:block; margin-top:3px; font-size:.9rem; font-weight:500; opacity:.96; }
a.lots-link:focus-visible { outline:3px solid #181d2c; outline-offset:2px; }

.haccp-embedded .page-banner.lots { display:none; }

.section-card.lotsmain { background:#fff3e8; }
.section-card.lotsmain > summary { background:linear-gradient(135deg,#a8461a,#e8803a); }
.lots-body { padding:12px 14px 16px; }
.lots-body .section-card { margin-block:12px; }

.haccp-embedded .haccp-heading { display:none; }

/* V49: banner un po' più piccoli (Personale, HACCP, Produzione), stesse proporzioni. */
.section-card > summary { padding:13px 17px; gap:12px; }
.section-card > summary::after { font-size:1.1rem; }
.section-card > summary .banner-icon { font-size:1.75rem; }
.section-card > summary strong { font-size:1.05rem; }
.section-card > summary small { margin-top:2px; font-size:.8rem; }
.page-banner { padding:15px 18px; gap:13px; margin:12px 0 14px; }
.page-banner .banner-icon { font-size:2.1rem; }
.page-banner h1 { font-size:1.4rem; }
.page-banner p { font-size:.88rem; }
.haccp-banner.tone-clean, .haccp-banner.tone-temp { padding:14px 17px; gap:12px; border-radius:16px; }
.haccp-banner .tone-icon { font-size:1.7rem; }
.haccp-banner .tone-text strong { font-size:1.05rem; }
.haccp-banner .tone-text small { font-size:.8rem; }
.status-badge { font-size:.78rem; padding:5px 10px; }

/* V49: banner Personale con scritte bianche e colori accesi (come Fornitori e Lotti); storico lotti più piccolo. */
.personnel-banner { color:#fff; border:0; box-shadow:0 4px 14px #19223333; }
.personnel-banner strong, .personnel-banner span { color:#fff; }
.personnel-banner .icon { stroke:#fff; color:#fff; }
.personnel-banner.personnel-week { background:linear-gradient(135deg,#503490,#8261d0); }
.personnel-banner.personnel-team { background:linear-gradient(135deg,#126b8c,#2aa6cf); }
.personnel-banner.personnel-leave { background:linear-gradient(135deg,#234f93,#3f84d6); }
.personnel-banner.personnel-covers { background:linear-gradient(135deg,#14634a,#2a9d78); }
.personnel-banner.personnel-extras { background:linear-gradient(135deg,#a8461a,#e8803a); }
.personnel-banner:hover, .personnel-banner:focus-visible { outline:3px solid #f0a020; }
.section-card.history > summary { padding:9px 15px; gap:10px; }
.section-card.history > summary .banner-icon { font-size:1.4rem; }
.section-card.history > summary strong { font-size:.95rem; }
.section-card.history > summary small { font-size:.74rem; margin-top:1px; }

/* V49: i tre pulsanti dei lotti (Nuovo lotto, Esporta PDF, Stampa registro) su una sola riga. */
.lots-body > .actions { display:flex; flex-wrap:nowrap; gap:8px; }
.lots-body > .actions .btn { flex:1 1 0; min-width:0; padding-inline:6px; font-size:.8rem; white-space:nowrap; }

/* V49: il pulsante "← Gestionale" non deve comparire nelle stampe (etichette e registri). */
@media print { .back-slot, .back-button, [data-back-button] { display:none !important; } }

/* V50: proposta dei turni automatici */
.proposal-table { border-collapse:collapse; width:100%; font-size:.95rem; }
.proposal-table th, .proposal-table td { padding:6px 8px; text-align:center; border:1px solid var(--line, #d8dfeb); }
.proposal-table tbody th { text-align:left; white-space:nowrap; }
.proposal-cell { font-weight:700; }
.proposal-cell.code-P { background:#fdecc8; color:#6b4a00; }
.proposal-cell.code-C { background:#dcd2f4; color:#3d2a78; }
.proposal-cell.code-PC { background:#cfe7d8; color:#1f5a38; }
.proposal-cell.code-R, .proposal-cell.closed { background:#eef0f4; color:#69738a; font-weight:500; }
.proposal-count td.low { background:#ffd9c2; color:#8a3a10; font-weight:700; }
.proposal-gaps { list-style:none; margin:10px 0; padding:0; }
.proposal-gaps li { margin:8px 0; padding:10px 12px; border-left:5px solid #e8803a; background:#fff3e8; border-radius:8px; }
.proposal-extra { display:inline-block; background:#e8803a; color:#fff; font-weight:700; font-size:.78rem; padding:2px 8px; border-radius:99px; margin-right:6px; }

.proposal-warn { margin:10px 0; padding:10px 12px 10px 28px; background:#fff8dc; border-left:5px solid #d9a400; border-radius:8px; font-size:.92rem; }

/* V51: banner della pagina Turni */
.section-card.sched { background: #eaf2fc; }
.section-card.sched > summary { background: linear-gradient(135deg, #234f93, #3f84d6); }
.section-card.need { background: #eef8f3; }
.section-card.need > summary { background: linear-gradient(135deg, #14634a, #2a9d78); }
.banner-body { padding-bottom: 6px; }

/* V52: scambio turno */
.tag.swap { background:#e2e8f4; color:#2d3f66; }
.proposal-select { font:inherit; font-weight:700; border:0; background:transparent; color:inherit; width:100%; min-width:46px; padding:4px 0; text-align:center; text-align-last:center; cursor:pointer; }
.proposal-cell.edited { box-shadow:inset 0 0 0 2px #234f93; }
.proposal-count td.over { background:#fde2e4; color:#a1202c; font-weight:700; }
.proposal-bonus { display:block; font-size:.68rem; font-weight:700; color:#fff; background:#e8803a; border-radius:99px; padding:0 6px; margin:2px auto 0; width:fit-content; }
.holiday-note { background:#eef3fb; border:1px solid #c9d8f0; border-radius:14px; padding:12px 16px; margin:0 0 14px; color:#1e3a6e; }
.holiday-note ul { margin:6px 0; padding-left:20px; }
.holiday-note small { color:#4b5a78; }
.warn-note { background:#fff3e8; border:1px solid #e8803a; color:#8a3a10; border-radius:10px; padding:8px 12px; }

/* Impostazioni: banner colorati per tema, grandi o piccoli per importanza */
.personnel-settings[class*="set-"] { border-left-width: 8px; border-left-style: solid; }
.personnel-settings.set-big > summary { font-size: 1.25rem; min-height: 64px; padding: 16px 0; }
.personnel-settings.set-small > summary { font-size: 1rem; min-height: 44px; padding: 6px 0; }
.personnel-settings.set-small { padding-top: 8px; padding-bottom: 8px; }
.personnel-settings.set-blue  { background:#e3edfb; border-left-color:#2f6fc4; }
.personnel-settings.set-teal  { background:#d9eff0; border-left-color:#1f8a90; }
.personnel-settings.set-rose  { background:#fbe3ea; border-left-color:#c2456b; }
.personnel-settings.set-slate { background:#e6eaf0; border-left-color:#66758c; }
.personnel-settings.set-sand  { background:#eeeae4; border-left-color:#9a8b78; }
.personnel-settings[class*="set-"] .card { background:#fff; }

/* Pranzo/Cena nella schermata Turni automatici: banner più piccoli, tutto su una riga */
.schema-slots { gap:6px; margin-bottom:8px; }
.schema-slot { grid-template-columns:auto 1fr auto; gap:2px 10px; padding:6px 10px; border-radius:10px; border-width:1.5px; }
.schema-slot > strong { font-size:.95rem; }
.schema-slot > span { grid-column:auto; order:2; font-size:.85rem; font-weight:700; }
.schema-slot > label { order:3; font-size:.85rem; gap:6px; }
.schema-slot .schema-need { width:52px; min-height:34px; padding:2px 6px; font-size:.95rem; text-align:center; }
.schema-slot.closed > span { grid-column:2 / -1; text-align:right; }

.lot-ingredients { border: 1px solid #d9dde8; border-radius: 12px; background: #f7f8fc; }
.lot-ingredients > summary { cursor: pointer; padding: 12px 14px; font-weight: 700; list-style: none; }
.lot-ingredients > summary::-webkit-details-marker { display: none; }
.lot-ingredients > summary::after { content: '▾'; float: right; }
.lot-ingredients[open] > summary::after { content: '▴'; }
.lot-ingredient-list { display: grid; gap: 4px; padding: 0 14px 12px; max-height: 320px; overflow-y: auto; }
.lot-use-by { margin: 0; padding: 10px 14px; border-radius: 12px; background: #eef6ef; }

.latina-days { margin-top: 12px; border: 1px solid #9db6dc; border-radius: 14px; background: #fff; }
.latina-days > summary { cursor: pointer; list-style: none; padding: 13px 14px; color: #173a73; font-weight: 600; }
.latina-days > summary::-webkit-details-marker { display: none; }
.latina-days > summary::after { content: '▾'; float: right; }
.latina-days[open] > summary::after { content: '▴'; }
.latina-days[open] > summary { border-bottom: 1px solid #d5e0f2; margin-bottom: 10px; }
.latina-days > .latina-delivery { margin-inline: 10px; }

/* Blocchi richiudibili nelle impostazioni HACCP e pulizie */
.card.fold > summary { cursor:pointer; list-style:none; margin:0; padding:14px 18px; color:#fff; font-size:1.12rem; font-weight:800; display:flex; justify-content:space-between; align-items:center; gap:10px; }
.card.fold > summary::-webkit-details-marker { display:none; }
.card.fold > summary::after { content:'▾'; flex:none; }
.card.fold[open] > summary::after { content:'▴'; }
.card.haccp-list > summary { background:linear-gradient(135deg,#234f93,#3f84d6); }
.card.haccp-add > summary { background:linear-gradient(135deg,#14634a,#2a9d78); }
.card.haccp-sched > summary { background:linear-gradient(135deg,#503490,#8261d0); }
.card.fold.haccp-list > :not(summary) { margin-left:18px; margin-right:18px; }
.card.fold.haccp-list > ul { margin-top:14px; margin-bottom:14px; }
.card.fold.haccp-add > form, .card.fold.haccp-sched > form { padding:16px 18px 18px; }
.banner-body > .banner-actions { padding: 12px 16px 0; }
.banner-body .holiday-note { background: none; border: 0; margin: 0; }
