/* Victus · 80_Victus_piano alimentare/App/frontend/assets/style.css */
/* Stile visore planner read-only: barra comandi 1.8, piatti a spicchi, banda regole, footer. */
:root { --bar:#d6d0c8; --ink:#2b241f; --muted:#7a7a7a; --line:#cfc8be; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background:#fbfaf7; color:var(--ink); font-family:-apple-system,"Helvetica Neue",Arial,sans-serif;
  display:flex; flex-direction:column; min-height:100vh; }
/* NIENTE BOLD per nessuna scritta */
body, body *, svg text { font-weight: 400 !important; }

/* barra titolo (riga 1, nella banda bianca dei 3 pallini): revisione (sx) · Victus centro · W/AI (dx) */
#titlestrip { display:grid; grid-template-columns:1fr auto 1fr; align-items:center;
  background:#ffffff; padding:5px 12px; border-bottom:1px solid #e6e1d8; min-height:34px; }
.ts-rev { justify-self:start; color:#8a8275; font-size:9px; }           /* -30% */
.ts-title { justify-self:center; font-size:15px; color:#3a332b; letter-spacing:.5px; } /* +10% */
.ts-right { justify-self:end; display:flex; gap:6px; }
.ts-btn { cursor:pointer; border:none; border-radius:8px; width:34px; height:26px; font-size:12px; color:#fff; }
.ts-w { background:#2faa55; }
.ts-w:hover { background:#268a45; }
.ts-ai { background:#7c3aed; }
.ts-ai:hover { background:#6d28d9; }
.ts-notes { width:auto; padding:0 9px; background:#c2722e; }
.ts-notes:hover { background:#a85f22; }
.pn-in { width:100%; box-sizing:border-box; min-height:50vh; resize:vertical; font-size:14px; line-height:1.45;
  padding:10px; border:1px solid #cfcabf; border-radius:8px; font-family:inherit; color:#2b241f; }
.ts-btn:disabled { opacity:.4; cursor:not-allowed; }

/* ---------- barra comandi ---------- */
#toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px;
  background:var(--bar); padding:6px 10px; flex-wrap:wrap; }
.tb-left, .tb-right { display:flex; align-items:center; gap:6px; }
.tb-center { flex:1; display:flex; align-items:center; justify-content:center; gap:8px; }
.tb-uondo { padding:2px 7px; min-width:0; min-height:0; display:inline-flex; align-items:center; justify-content:center; }
.tb-uondo svg { width:16px; height:16px; display:block; }
.tb-center .tb-uondo { color:#2a6fb0; }            /* annulla = blu (batte .tb-btn) */
.tb-center .tb-uondo.tb-redo { color:#2e8b57; }    /* ripristina = verde */
.tb-uondo:not(:disabled):hover { background:#fff; }
.tb-uondo:not(:disabled):active { transform:scale(0.94); }
.tb-center .tb-uondo:disabled { color:#cdc8bc; cursor:default; background:#f4f1ec; }  /* disattivo = grigio (ultimo → vince) */
/* gruppo zoom: − [livello] + */
.tb-zoom { display:inline-flex; align-items:center; gap:0; margin-left:6px; }
.tb-zbtn { font-size:16px; font-weight:700; line-height:1; padding:4px 10px; min-height:0; color:#5a5249; }
.tb-zlevel { font-size:12px; font-weight:600; padding:4px 8px; min-height:0; min-width:46px; text-align:center; color:#3a322a; }
.tb-zoom .tb-zbtn { border-radius:0; }
.tb-zoom .tb-zbtn:first-child { border-radius:8px 0 0 8px; }
.tb-zoom .tb-zbtn:last-child { border-radius:0 8px 8px 0; }
.tb-zoom .tb-zlevel { border-radius:0; border-left:none; border-right:none; }
.logo { font-weight:800; letter-spacing:1px; color:#6b5e4f; font-size:15px; padding-right:4px; }
.tb-btn { cursor:pointer; border:1px solid #b9b1a5; background:#f4f1ec; border-radius:8px;
  padding:5px 9px; font-size:13px; line-height:1.05; color:#2b241f; min-height:34px; }
.tb-btn:hover { background:#fff; }
.tb-btn.wide { font-weight:700; text-align:center; }
#weekPicker { width:0; height:0; opacity:0; position:absolute; pointer-events:none; }
.wk { margin-left:6px; line-height:1.1; }
.wk-num { font-weight:800; font-size:13px; color:#3a332b; }
.wk-range { font-size:12px; color:#5d564c; }
/* pulsante azzurro unico (selettore utente + badge), alto come PIETANZA */
.userbtn { cursor:pointer; border:1px solid #cfe0f5; background:#eaf3ff; border-radius:8px;
  min-height:34px; padding:2px 11px; line-height:1.02; text-align:center; color:#2b241f; min-width:90px; } /* -10% (2.2.35) */
.userbtn:hover { background:#e0eefb; }
.ub-admin { color:#0a6b2b; font-size:11px; }
.ub-name { font-size:10px; color:#2b241f; }
.ub-mail { font-size:8px; color:#666; }
.ub-sel { font-size:10px; color:#1a5fb4; }
/* popup selettore utenti */
#userpicker { position:absolute; z-index:80; background:#f3f1ec; border:1px solid #9a9384;
  border-radius:6px; box-shadow:0 8px 24px rgba(0,0,0,.25); min-width:200px; padding:4px 0; max-height:60vh; overflow:auto; }
#userpicker .upi { padding:8px 16px; cursor:pointer; color:#2b241f; line-height:1.15; }
#userpicker .upi:hover { background:#e2ddd3; }
#userpicker .upi .un { font-size:14px; }
#userpicker .upi .um { font-size:11px; color:#777; }
#platemenu { position:absolute; z-index:60; background:#f3f1ec; border:1px solid #9a9384;
  border-radius:8px; box-shadow:0 4px 14px rgba(0,0,0,.18); overflow:hidden; min-width:150px; }
#platemenu .pmi { padding:9px 16px; cursor:pointer; color:#2b241f; font-size:14px; }
#platemenu .pmi:hover { background:#e2ddd3; }
.ro-badge { font-size:11px; background:#fff3cd; color:#8a6d00; border:1px solid #e6d28a; border-radius:10px; padding:1px 8px; }
.rev { color:var(--muted); font-size:11px; }

/* ---------- banda regole ---------- */
#rulesbar:empty { display:none; }
#rulesbar.neutral { background:#eef0ee; color:#666; padding:6px 12px; text-align:center; font-size:13px; border-bottom:1px solid #ddd; }
#rulesbar.ok { background:#e7f6ea; color:#1b5e20; padding:8px 12px; border-bottom:1px solid #c7e6cd; font-weight:600; text-align:center; }
#rulesbar.bad { background:#fdeaea; border-bottom:1px solid #f0c9c9; padding:8px 12px; }
#rulesbar .rtitle { text-align:center; font-weight:800; letter-spacing:1px; color:#7a1111; margin-bottom:6px; font-size:16px; }
#rulesbar .rcols { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
#rulesbar .rcol { background:#fff6f6; border:1px solid #f0d3d3; border-radius:8px; padding:6px 10px; }
#rulesbar .rh { font-weight:800; color:#8a1f1f; font-size:9px; letter-spacing:1px; }
#rulesbar .ri { color:#8a1f1f; font-size:10px; }
#rulesbar .rn { color:#946666; font-size:10px; }

/* ---------- planner ---------- */
#planner { padding:10px; overflow-x:auto; flex:1;
  background-image:url("/assets/sfondo_piatti.png"); background-size:cover; background-position:center; }
table.grid { border-collapse:collapse; width:auto; margin:0 auto; background:rgba(255,255,255,0.42); }   /* width:auto = larga quanto il contenuto → colonne strette quanto i piatti (niente spazio extra) */
table.grid th, table.grid td { border:none; }
table.grid thead th { padding:5px 4px; }
.dh { font-size:16px; font-weight:700; color:#333; }
.ds { font-size:12px; color:#666; }
.corner { width:40px; background:transparent; }
th.meal { width:38px; text-align:center; vertical-align:middle; background:transparent; padding:0; }
th.meal .meal-v { display:inline-block; writing-mode:vertical-rl; transform:rotate(180deg);
  font-weight:800; letter-spacing:2px; color:#555; }
th.meal.meal-merenda .meal-v, th.meal.meal-spuntino .meal-v { font-size:0.35em; letter-spacing:1px; }
th.meal.meal-colazione .meal-v { font-size:0.9em; }
td.cell { text-align:center; vertical-align:middle; padding:1px 0; }
td.editable { cursor:pointer; }
td.editable:hover { background:rgba(255,255,255,0.45); }
.model-grid { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; }
.model-card { border:2px solid transparent; border-radius:10px; padding:4px; cursor:pointer; text-align:center; }
.model-card:hover { background:#f3f1ec; border-color:#cfc8be; }
.model-card.sel { border-color:#0a6b2b; background:#eef7ee; }
.model-card .mk { font-weight:700; color:#555; }
.md-title { font-size:20px; margin:0 0 14px; color:#2b241f; }
.md-search { position:relative; margin-bottom:16px; max-width:460px; }
.md-search label { display:block; margin-bottom:4px; color:#2b241f; }
#md-q { width:100%; padding:8px 10px; border:1px solid #b9b1a5; border-radius:6px; font-size:14px; }
.md-sugg { position:absolute; left:0; right:0; top:100%; z-index:5; background:#fff; border:1px solid #cfc8be;
  border-radius:0 0 8px 8px; box-shadow:0 8px 20px rgba(0,0,0,.18); max-height:260px; overflow:auto; }
.md-s { display:flex; justify-content:space-between; align-items:center; padding:7px 12px; cursor:pointer; }
.md-s:hover { background:#f3f1ec; }
.md-s .ms-n { font-size:14px; color:#2b241f; }
.md-s .ms-meta { font-size:11px; color:#777; }
.md-none { padding:8px 12px; color:#999; }
.md-scegli { display:block; margin:6px auto 0; cursor:pointer; border:1px solid #b9b1a5; background:#fff;
  border-radius:7px; padding:3px 13px; font-size:9px; letter-spacing:.5px; color:#2b241f; }
.md-scegli:hover { background:#eef7ee; border-color:#0a6b2b; color:#0a6b2b; }
.md-scegli:disabled { cursor:not-allowed; opacity:.5; }
.model-card.faded { opacity:.35; filter:grayscale(.5); }
.dlg-actions { margin-top:14px; text-align:center; }
.dlg-actions button { cursor:pointer; border:1px solid #c99; background:#fdeaea; color:#8a1f1f; border-radius:8px; padding:8px 14px; font-weight:700; }
.plate-svg { width:182px; height:182px; display:block; margin:0 auto; }   /* +40% (centro invariato: resta centrato nella cella) */
/* testo ed elementi sopra non catturano il click: passa allo spicchio sotto */
.plate-svg text, .plate-svg circle { pointer-events:none; }
.plate-svg .wedge { pointer-events:auto; cursor:pointer; }
.plate-svg .wedge:hover { opacity:.82; }
/* lampadina 💡 (idee piatto): cattura il click anche se è un circle */
.plate-svg g.bulb circle, .plate-svg g.bulb text { pointer-events:auto; cursor:pointer; }
.plate-svg g.bulb:hover circle { fill:#fff3bf; }
.plate-svg g.bimby:hover circle { fill:#c8f0d8; }
.t-bulb { font:13px Helvetica,Arial,sans-serif; stroke:#5a4a00; stroke-width:0.4px; paint-order:stroke; }
/* finestra Idee piatto */
ul.idee { margin:10px 0 0; padding-left:22px; }
ul.idee li { margin:8px 0; font-size:15px; }
ul.idee a { color:#1a5fb4; }
.idee-demo { color:#8a6d1a; font-size:12px; }
.idee-sect { margin:12px 0 0; color:#2a6a2a; font-size:13px; letter-spacing:.3px; }
ul.idee li { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.idee-name { flex:1 1 auto; }
.idee-meta { font-size:11px; color:#777; margin-top:2px; }
.idee-use { flex:0 0 auto; cursor:pointer; border:1px solid #2a6a2a; background:#eaf5ea; color:#1f5a1f;
  border-radius:6px; padding:3px 12px; font-size:12px; white-space:nowrap; }
.idee-use:hover { background:#dceedc; }
/* menù Liste: scelta settimana + duplica */
.wk-list { max-height:260px; overflow-y:auto; margin:10px 0; border:1px solid #d7d2c8; border-radius:6px; text-align:left; }
.wk-row { padding:7px 12px; cursor:pointer; font-size:14px; border-bottom:1px solid #eee; }
.wk-row:last-child { border-bottom:0; }
.wk-row:hover { background:#eaf3ff; }
.wk-row.sel { background:#dceaff; font-weight:600; }
.dup-row { display:flex; align-items:center; gap:10px; margin:10px 0; text-align:left; }
.dup-row label { min-width:120px; font-size:14px; color:#444; }
.dup-row select { flex:1; padding:6px 8px; border:1px solid #b9b1a5; border-radius:6px; font-size:14px; }
.planview { overflow-x:auto; }
/* menù a discesa dello spicchio: tabella Gruppo | Alimento */
.sp-search { margin-bottom:10px; }
#modal-body .sp-remove { display:inline-block; margin:0 0 12px; border:1px solid #e0a3a3; background:#fbe9e9; color:#a33; border-radius:6px; padding:6px 12px; cursor:pointer; font-size:13px; }
#modal-body .sp-remove:hover { background:#f7dcdc; }
#sp-q { width:100%; padding:8px 10px; border:1px solid #b9b1a5; border-radius:6px; font-size:14px; }
/* separate (batte #modal-body table = collapse) → header sticky affidabile in WebKit; niente più "limbo" */
#modal-body .sp-table { border-collapse:separate; border-spacing:0; }
.sp-table { width:100%; font-size:14px; }
.sp-table.sp-fixed { table-layout:fixed; width:auto; }           /* entrambe le colonne a larghezza esplicita (ridimensionabili, ricordate per utente); scroll orizzontale se serve */
.sp-table.sp-fixed td { overflow:hidden; }                       /* NON sui th: overflow rompe lo sticky */
#modal-body .sp-table thead th { background:#f1eee8; text-align:left; padding:6px 12px; border-bottom:2px solid #cfc8be; color:#555; position:sticky; top:0; z-index:5; }
.sp-table td { padding:6px 12px; border-bottom:1px solid #eee; }
/* picker: ricerca fissa in alto + tabella in un contenitore che scrolla (unico scroller) */
#modal-body.mb-picker { display:flex; flex-direction:column; overflow:hidden; }
#modal-body.mb-picker .sp-scroll { overflow:auto; flex:1 1 auto; min-height:0; }
.sp-row:hover { background:#eaf3ff; }
.sp-grp { color:#555; cursor:pointer; width:42%; }
.sp-grp:hover { text-decoration:underline; color:#1a5fb4; }
.sp-food { cursor:pointer; color:#2b241f; }
.sp-q { color:#777; font-size:12px; }
/* alimenti che violano una regola: rossi, comunque selezionabili (forzatura) */
.sp-food.red, .sp-grp.red { color:#B00020; }
.md-s.red .ms-n { color:#B00020; }
.md-s.red .ms-meta { color:#c0506a; }
.t-top { font:600 11px Helvetica,Arial,sans-serif; fill:#111; }
.t-bot { font:400 10px Helvetica,Arial,sans-serif; fill:#333; }
.t-fam { font:400 10px Helvetica,Arial,sans-serif; fill:#555; }
.t-red { font:700 11px Helvetica,Arial,sans-serif; fill:#B00020; }
.t-g   { font:700 11px Helvetica,Arial,sans-serif; fill:#222; }
.t-gpick { font:600 8px Helvetica,Arial,sans-serif; fill:#5a4a1a; }
.gbadge { cursor:pointer; }
.t-pdot { font:800 13px Helvetica,Arial,sans-serif; fill:#222; }
.t-clicca { font:400 13px Helvetica,Arial,sans-serif; fill:#9a9a9a; }
td.merenda { padding:1px 0; }
td.snack-cell { cursor:pointer; }
.mbox { width:156px; margin:0 auto; box-sizing:border-box; border:1px solid #cfcfcf; border-radius:4px; min-height:39px; background:rgba(255,255,255,0.75); font-size:12px; padding:3px 6px; }
.sn-it { line-height:1.35; }
.sn-it .sn-q, .sn-chip .sn-q { color:#666; font-size:11px; }
.sn-empty { color:#999; font-style:italic; }
.sn-chosen { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 10px; }
.sn-chip { display:inline-flex; align-items:center; gap:6px; background:#eef2f7; border:1px solid #c7d2e0; border-radius:12px; padding:2px 6px 2px 10px; font-size:12px; }
.sn-chip .sn-rm { border:none; background:transparent; cursor:pointer; font-size:15px; line-height:1; color:#a33; padding:0 2px; }
.sn-chip .sn-rm:hover { color:#e00; }
.sn-man { display:flex; gap:8px; align-items:center; margin:0 0 12px; }
.sn-man input { padding:6px 8px; border:1px solid #c7c0b4; border-radius:6px; font-size:13px; }
.sn-man #sn-man-name { flex:1; }
.sn-man .sn-man-q { width:64px; }
.sn-man .cd-btn { white-space:nowrap; }
/* editor inline spuntino/merenda nella casella del planner */
.mbox.sn-editing { position:relative; overflow:visible; background:#fff; }
.sn-editing .sn-chips { display:flex; flex-wrap:wrap; gap:4px; }
.sn-row { display:flex; align-items:center; gap:4px; margin-top:4px; }
.sn-typ { flex:1; min-width:50px; padding:3px 5px; border:1px solid #c7c0b4; border-radius:5px; font-size:12px; }
.sn-sel { font-size:12px; font-weight:600; color:#2c6a38; white-space:nowrap; }
.sn-qty { width:46px; padding:3px 5px; border:1px solid #c7c0b4; border-radius:5px; font-size:12px; }
.sn-um { font-size:11px; color:#666; }
.sn-ok { border:1px solid #9cc79c; background:#eef7ee; color:#2c6a38; border-radius:5px; cursor:pointer; font-size:13px; padding:1px 6px; }
.sn-x { border:none; background:transparent; color:#a33; cursor:pointer; font-size:14px; line-height:1; }
.sn-dd { position:absolute; left:0; right:0; top:100%; z-index:60; background:#fff; border:1px solid #c7c0b4; border-radius:6px; max-height:170px; overflow:auto; box-shadow:0 6px 18px rgba(0,0,0,.18); }
.sn-opt { padding:5px 8px; font-size:12px; cursor:pointer; border-bottom:1px solid #f0ece3; }
.sn-opt:hover { background:#eef2f7; }
.sn-gtag { font-size:10px; color:#7a715f; background:#efeae0; border-radius:8px; padding:0 5px; }
.sn-none { padding:6px 8px; font-size:12px; color:#999; }

/* ---------- footer (scritte sotto, come 1.8) ---------- */
#foot { background:#dff0d8; color:#2b241f; padding:3px 12px; font-size:10px; border-top:1px solid #c7e0c7; }
#foot div { padding:1px 0; }
#foot .foot-piet { display:flex; align-items:center; flex-wrap:wrap; gap:3px; }
#foot .foot-dot { width:15px; height:15px; vertical-align:middle; flex:0 0 auto; }
#foot .foot-piet span { margin:0 2px; }
#foot .foot-sep { color:#9a9a9a; margin:0 4px; }
.tb-logo { height:40px; width:40px; object-fit:contain; border-radius:8px; margin:0 8px 0 0; background:#fff; filter:saturate(2.4) contrast(1.2); }
.iconbtn { cursor:pointer; border:none; background:transparent; padding:0; width:42px; height:38px; }
.iconbtn img { width:36px; height:36px; object-fit:contain; }
.tb-pdf img { width:22px; height:22px; object-fit:contain; vertical-align:middle; }
#btnPlanPrint { font-size:19px; line-height:1; }

/* ---------- login (stile 1.8) ---------- */
#login { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: #fbfaf7 url("/assets/victus.png") center/520px no-repeat; }
#login.hidden { display: none; }
.login-card { background: rgba(246,244,239,0.55); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  border: 1px solid rgba(154,147,132,0.6); border-radius: 8px; width: min(560px, 92vw);
  box-shadow: 0 16px 50px rgba(0,0,0,.28); overflow: hidden; }
.login-head { background: rgba(243,241,236,0.55); border-bottom: 1px solid rgba(207,200,190,0.7); padding: 12px 16px; font-size: 15px; color: #2b241f; }
.login-box { background: rgba(230,227,221,0.45); margin: 14px; border: 1px solid rgba(207,200,190,0.7); border-radius: 6px; padding: 14px 16px; }
.login-sec { font-size: 15px; color: #2b241f; margin-bottom: 12px; }
.login-radios { display: flex; gap: 26px; margin-bottom: 14px; }
.login-radios label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.login-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.login-row .ll { width: 110px; flex-shrink: 0; color: #2b241f; }
.login-row input { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid #b9b1a5; border-radius: 5px; background: #fff; }
.login-first { display: block; margin: 6px 0 0; font-size: 12px; color: #2a6a2a; }
.us-acc { white-space: nowrap; font-size: 12px; }
.us-inv { margin-left: 6px; font-size: 11px; padding: 1px 6px; }
.login-remember { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; cursor: pointer; }
.login-actions { display: flex; justify-content: flex-end; gap: 10px; }
.login-actions button { cursor: pointer; border: 1px solid #b9b1a5; background: #f4f1ec; border-radius: 6px; padding: 7px 18px; }
.login-actions #loginStart { border-color: #0a6b2b; background: #dff5df; color: #0a6b2b; }
.login-err { color: #b00020; margin-top: 10px; min-height: 18px; font-size: 13px; }

/* ---------- menu ☰ ---------- */
.hidden { display: none !important; }
#menu { position: absolute; top: 46px; left: 56px; z-index: 50; background: #f3f1ec;
  border: 1px solid #9a9384; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  min-width: 260px; padding: 4px 0; }
#menu .mi { padding: 11px 18px; font-size: 15px; cursor: pointer; color: #2b241f; }
#menu .mi:hover { background: #e2ddd3; }
#menu .mi.admin { color: #999; }
#menu .sep { height: 2px; background: #cfc8be; margin: 4px 0; border-top: 1px solid #fff; }

/* ---------- modal ---------- */
#modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; }
.modal-panel { background: #fff; position: absolute; width: min(860px, 92vw); height: 80vh; display: flex;
  flex-direction: column; border-radius: 10px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.4); }
/* maniglia di ridimensionamento (angolo in basso a DX) */
.modal-resize { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; z-index: 3;
  background: linear-gradient(135deg, transparent 0 50%, #b9b1a5 50% 60%, transparent 60% 72%, #b9b1a5 72% 82%, transparent 82%); }
/* cornice standard finestre ☰ */
.modal-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  background: #d6d0c8; padding: 8px 12px; cursor: move; }
.modal-head button, .modal-head .mh-badge { cursor: default; }
.modal-head button { cursor: pointer; }
.mh-logo { height: 55px; width: 55px; object-fit: contain; background: #fff; border: 1px solid #c7c0b4; border-radius: 8px; filter: saturate(2.4) contrast(1.2); }
.mh-title { text-align: center; font-weight: 800; font-size: 18px; color: #2b241f; }
.mh-right { display: flex; align-items: center; gap: 8px; }
.mh-btn { cursor: pointer; border: 1px solid #b9b1a5; background: #f4f1ec; border-radius: 8px;
  padding: 6px 10px; font-size: 12px; line-height: 1.05; text-align: center; color: #2b241f; }
.mh-btn:hover { background: #fff; }
.mh-btn:disabled { opacity: .45; cursor: not-allowed; }
.mh-badge { background: #dff5df; border: 1px solid #bfe6bf; border-radius: 8px; padding: 3px 12px;
  text-align: center; line-height: 1.1; min-width: 86px; }
.mh-badge .bn { font-weight: 800; color: #0a6b2b; }
.mh-badge .bm { font-size: 11px; color: #333; }
.mh-save { background: #2faa55; border-color: #2faa55; color: #fff; padding: 8px 16px; font-size: 13px; }
.mh-save:hover { background: #268a45; }
.mh-back { cursor: pointer; border: none; background: #2faa55; color: #fff; width: 38px; height: 38px;
  border-radius: 50%; font-size: 18px; }
.mh-back:hover { background: #268a45; }
#modal-body { padding: 14px; overflow: auto; flex: 1 1 auto; min-height: 0; }
#modal-body table { border-collapse: collapse; width: 100%; font-size: 13px; }
#modal-body th, #modal-body td { border: none; padding: 5px 8px; text-align: left; }
#modal-body thead th { background: #f1eee8; position: sticky; top: 0; border-bottom: 1.5px solid #222; }  /* riga nera sotto i titoli */
#modal-body tbody td { border-bottom: 1px solid #ececec; }                                /* separatori riga: grigio chiaro sottile */
#modal-body th:first-child, #modal-body td:first-child { border-left: 1px solid #e8e8e8; } /* solo bordo laterale sx */
#modal-body th:last-child,  #modal-body td:last-child  { border-right: 1px solid #e8e8e8; }/* solo bordo laterale dx */
#modal-body th.td-r, #modal-body td.td-r { text-align: right; }    /* quantità a destra */
#modal-body th.td-c, #modal-body td.td-c { text-align: center; }   /* UM centrata */
#modal-body tr.fam-end td { border-bottom: 1.5px solid #222; }                 /* riga nera a fine famiglia */
#modal-body tr.fam-gap td { border: none; height: 9px; background: #fff; }     /* stacco bianco senza righe */
/* Lista spesa: colonne strette + colonna "Tot. gruppo" con celle unite per gruppo */
#modal-body .sl-table { width: auto; table-layout: fixed; border-left: 1px solid #e8e8e8; border-right: 1px solid #e8e8e8; }
#modal-body .sl-table td:first-child, #modal-body .sl-table th:first-child { border-left: none; }
#modal-body .sl-table td:last-child, #modal-body .sl-table th:last-child { border-right: none; }
#modal-body .sl-table .sl-fam { vertical-align: top; border-bottom: 1.5px solid #222; }   /* famiglia (unita) chiusa in nero */
#modal-body .sl-table .sl-grp { vertical-align: top; }
#modal-body .sl-table .sl-sum { vertical-align: middle; color: #333; }                     /* somma gruppo, centrata */
#modal-body .sl-table td.gfend, #modal-body .sl-table td.fend { border-bottom: 1.5px solid #222; }
#modal-body h4 { margin: 10px 0 6px; color: #6b5e4f; }
.doctabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 2px solid #cfc8be;
  background: #f1eee8; position: sticky; top: 0; z-index: 2; }
.doctab { flex: 0 0 auto; cursor: pointer; border: 1px solid transparent; border-bottom: none;
  background: transparent; padding: 8px 14px; font-size: 13px; color: #6b5e4f; white-space: nowrap;
  border-radius: 8px 8px 0 0; }
.doctab:hover { background: #e6e1d8; }
.doctab.active { background: #fff; border-color: #cfc8be; color: #2b241f; margin-bottom: -2px; }
.docpane { padding-top: 10px; }
.doc { line-height: 1.5; color: #2b241f; font-size: 14px; }
.doc h1 { font-size: 20px; margin: 6px 0 10px; color: #6b5e4f; }
.doc h2 { font-size: 17px; margin: 16px 0 6px; color: #6b5e4f; border-bottom: 1px solid #e6e1d8; padding-bottom: 3px; }
.doc h3 { font-size: 15px; margin: 12px 0 4px; color: #7a6e5c; }
.doc h4, .doc h5, .doc h6 { font-size: 14px; margin: 10px 0 4px; color: #7a6e5c; }
.doc p { margin: 6px 0; }
.doc ul { margin: 6px 0 6px 20px; }
.doc li { margin: 2px 0; }
.doc blockquote { margin: 8px 0; padding: 6px 12px; background: #f6f3ec; border-left: 3px solid #cfc8be; color: #555; }
.doc code { background: #f1eee8; border: 1px solid #e2dccf; border-radius: 4px; padding: 0 4px; font-size: 12px; }
.doc hr { border: none; border-top: 1px solid #e6e1d8; margin: 12px 0; }
.doc table { border-collapse: collapse; width: 100%; font-size: 12px; margin: 8px 0; }
.doc th, .doc td { border: 1px solid #e0dccf; padding: 4px 8px; text-align: left; vertical-align: top; }
.doc thead th { background: #f1eee8; }
#modal-body ul { margin: 6px 0 6px 18px; }
#modal-body .ro-note { color: #8a6d00; background: #fff3cd; border: 1px solid #e6d28a;
  border-radius: 8px; padding: 8px 10px; }
#modal-body .pill-max { color: #8a1f1f; font-weight: 700; }
#modal-body .pill-min { color: #7a4d00; font-weight: 700; }
#modal-body .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px;
  border: 1px solid #999; vertical-align: middle; margin-right: 6px; }

/* ---------- toast ---------- */
#toast { position:fixed; bottom:48px; left:50%; transform:translateX(-50%) translateY(20px);
  background:#333; color:#fff; padding:8px 14px; border-radius:10px; font-size:13px; opacity:0;
  transition:opacity .2s, transform .2s; pointer-events:none; }
#toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* ---------- menù contestuale sopra il modale ---------- */
#platemenu { z-index: 80; }

/* ---------- dialog conferma salvataggio (3 pulsanti) ---------- */
#confirmdlg { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; }
#confirmdlg.hidden { display: none; }
#confirmdlg .cd-box { background: #fff; border-radius: 12px; padding: 20px 22px; max-width: 440px;
  box-shadow: 0 16px 50px rgba(0,0,0,.45); }
#confirmdlg .cd-msg { font-size: 15px; color: #2b241f; line-height: 1.45; margin-bottom: 18px; }
#confirmdlg .cd-actions { display: flex; gap: 10px; justify-content: flex-end; }
#confirmdlg .cd-btn { cursor: pointer; border: 1px solid #b9b1a5; background: #f4f1ec; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; color: #2b241f; }
#confirmdlg .cd-btn:hover { background: #fff; }
/* Duplica settimana — mini-planner selezionabile */
#confirmdlg .dup-box { max-width: 720px; width: 92vw; }
.dup-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; text-align:left; }
.dup-i { font-size:20px; color:#6a5; }
.dup-ttl { font-size:16px; color:#2b241f; }
.dup-pick { margin-left:auto; display:flex; align-items:center; gap:8px; font-size:13px; color:#6b6358; flex-wrap:wrap; }
.dup-pick select { padding:5px 7px; border:1px solid #c7c0b4; border-radius:6px; font-size:13px; }
.dup-arr { color:#999; }
.dup-sep { border-left:1px solid #d8d2c6; padding-left:8px; }
.dg-table { display:grid; grid-template-columns:78px repeat(7,1fr); gap:4px; }
.dg-corner { }
.dg-day, .dg-meal { cursor:pointer; border:1px solid #cfc8bc; background:#f4f1ec; border-radius:6px; font-size:11.5px; padding:4px 2px; color:#3a322a; }
.dg-meal { text-align:left; padding-left:6px; }
.dg-day:hover, .dg-meal:hover { background:#fff; }
.dg-cell { min-height:34px; border:1px solid #d8d2c6; border-radius:6px; padding:3px 4px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; cursor:pointer; background:#fff; overflow:hidden; }
.dg-cell.on { border-color:#3a8a4a; background:#eaf6ec; }
.dg-cell.empty { border-style:dashed; color:#bbb; cursor:default; justify-content:center; }
.dg-chk { font-size:13px; line-height:1; color:#3a8a4a; min-height:13px; }
.dg-pv { font-size:10px; color:#5a5249; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dg-cell.on .dg-pv { color:#2c6a38; }
.dup-foot { display:flex; align-items:center; gap:12px; margin-top:14px; }
.dup-count { margin-left:auto; font-size:13px; color:#6b6358; }
#confirmdlg .dup-foot .cd-save:disabled { opacity:.5; cursor:default; }
.dup-pf { text-align:left; display:flex; flex-direction:column; min-height:0; }
.dup-pf-scroll { overflow:auto; max-height:55vh; padding-right:4px; }
.dup-pf-intro { font-size:14px; color:#2b241f; margin-bottom:12px; }
.dq-tbl { width:100%; border-collapse:collapse; }
.dq-tbl th { font-size:11px; color:#6b6358; font-weight:600; text-align:right; padding:2px 6px 4px; border-bottom:1px solid #e3c98a; white-space:nowrap; }
.dq-tbl th:first-child { text-align:left; }
.dq-tbl td { font-size:12px; padding:3px 6px; border-bottom:1px solid #f0e7d6; }
.dq-c { color:#5a5249; }
.dq-n { text-align:right; white-space:nowrap; color:#3a322a; }
.dq-zero { color:#b06a2c; }
.dup-pf-blk { border:1px solid #e0d9cd; border-radius:8px; padding:8px 12px; margin-bottom:10px; }
.dup-pf-blk .dup-pf-h { font-size:13px; color:#3a322a; margin-bottom:4px; }
.dup-pf-blk ul { margin:0; padding-left:18px; }
.dup-pf-blk li { font-size:12.5px; color:#5a5249; line-height:1.5; }
.dup-pf-over { border-color:#e3c98a; background:#fbf4e3; }
.dup-pf-qty  { border-color:#e0b48a; background:#fbeede; }
.dup-pf-bad  { border-color:#e0a3a3; background:#fbe9e9; }
.dup-pf-act { display:flex; gap:10px; justify-content:flex-end; margin-top:6px; }
.dup-more { list-style:none; color:#998f80; }
.upi-ro, .ub-ro { font-size:10px; color:#8a6d3b; background:#f7e7cf; border:1px solid #e3c98a; border-radius:8px; padding:0 5px; vertical-align:middle; white-space:nowrap; }
#confirmdlg .piet-in { width: 100%; box-sizing: border-box; resize: none; font-size: 14px; line-height: 1.4;
  padding: 8px 10px; border: 1px solid #cfcabf; border-radius: 8px; margin-bottom: 16px;
  font-family: inherit; color: #2b241f; }
#confirmdlg .piet-in:focus { outline: none; border-color: #2a6a2a; }
#confirmdlg .cd-save { background: #2faa55; border-color: #2faa55; color: #fff; }
#confirmdlg .cd-save:hover { background: #268a45; }
#confirmdlg .cd-discard { background: #fdeaea; border-color: #e6b3b3; color: #8a1f1f; }

/* ---------- editor Regole piatti ---------- */
.modal-panel.wide { width: min(1180px, 96vw); }
#pr-editor { display: flex; flex-direction: column; gap: 10px; }
#pr-editor.ro { opacity: .98; }
.pr-top { display: flex; align-items: center; gap: 18px; padding: 4px 2px 8px; border-bottom: 1px solid #e3ded3; }
.pr-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: #2b241f; cursor: pointer; }
.pr-spacer { flex: 1; }
.pr-main { display: flex; gap: 14px; align-items: flex-start; }
#pr-left { flex: 1; min-width: 0; overflow: auto; }
#pr-side { width: 250px; flex: none; border: 1px solid #e3ded3; border-radius: 10px; padding: 12px; background: #faf9f6; }
.pr-svg { display: block; }
.pr-svg text { pointer-events: none; }
.pr-hdr { font: 600 13px Helvetica, Arial, sans-serif; fill: #2b241f; }
.pr-rowlbl { font: 600 13px Helvetica, Arial, sans-serif; fill: #6b5e4f; }
.pr-key { font: 600 12px Helvetica, Arial, sans-serif; fill: #222; }
.pr-key.empty { fill: #b3ada3; }
.pr-side-note { color: #7a6f60; font-size: 13px; line-height: 1.4; }
.pr-side-hint { margin-top: 10px; color: #6b5e4f; font-size: 12px; text-align: center; }
.pr-side-title { font-size: 16px; color: #2b241f; margin-bottom: 8px; text-align: center; }
.pr-prev { display: flex; justify-content: center; }
.pr-prev-svg { width: 180px; height: 180px; }
.pr-pcaption { margin: 12px 0 2px; color: #2b241f; font-size: 14px; }
.pr-pcts { margin: 6px 0 4px; }
.pr-schema-head { margin-bottom: 8px; }
.pr-schema-title { font-size: 16px; color: #2b241f; }
.pr-schema-sub { font-size: 12.5px; color: #6b5e4f; }
.pr-pctrow { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.pr-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid #999; flex: none; }
.pr-plab { flex: 1; font-size: 13px; color: #2b241f; }
.pr-pct { width: 64px; padding: 4px 6px; border: 1px solid #c7c0b4; border-radius: 6px; font-size: 13px; text-align: right; }
.pr-pct:disabled { background: #efece6; color: #777; }
.pr-pp { color: #777; font-size: 13px; }
.pr-grassi { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #2b241f; margin: 6px 0 10px; cursor: pointer; }
.pr-sum { text-align: center; border-radius: 8px; padding: 5px; font-size: 14px; margin-bottom: 10px; }
.pr-sum.neutral { background: #e9e9e9; color: #222; }
.pr-sum.ok { background: #cfeecd; color: #0b3d0b; }
.pr-sum.bad { background: #ff3b30; color: #fff; }
.pr-schema { padding: 4px; }
.pr-schema-ctrls { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pr-schema-ctrls button { padding: 6px 12px; border: 1px solid #b9b1a5; border-radius: 8px; background: #f4f1ec; cursor: pointer; font-size: 13px; }
.pr-schema-ctrls button:disabled { opacity: .45; cursor: not-allowed; }
.pr-schema-info { color: #6b5e4f; font-size: 13px; }
.pr-schema-grid { display: grid; gap: 8px; }
.pr-sc-cell { background: #1e1e1e; color: #e5e7eb; border-radius: 8px; padding: 22px 6px; text-align: center; font-size: 14px; }
.pr-band { background: #1f2933; color: #e5e7eb; border-radius: 10px; padding: 10px 14px; }
.pr-band-top { display: flex; gap: 26px; margin-bottom: 6px; font-size: 13px; align-items: center; }
.pr-fbadge { display: inline-block; padding: 2px 10px; border-radius: 7px; font-size: 13px; margin-left: 4px; }
.pr-fhint { color: #9aa5b1; font-size: 13px; margin-left: 4px; }
.pr-band-help { font-size: 12.5px; line-height: 1.5; color: #cdd5dd; }

/* ---------- editor Lista alimenti ---------- */
#fd-editor { display: flex; flex-direction: column; gap: 10px; }
.fd-top { display: flex; align-items: center; gap: 12px; }
#fd-new { padding: 6px 12px; border: 1px solid #b9b1a5; border-radius: 8px; background: #f4f1ec; cursor: pointer; font-size: 13px; }
#fd-new:hover { background: #fff; }
.fd-info { color: #6b5e4f; font-size: 12px; }
.fd-wrap { overflow: auto; max-height: 70vh; border: 1px solid #e3ded3; border-radius: 8px; }
.fd-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.fd-table th, .fd-table td { border: 1px solid #e6e1d6; padding: 3px 6px; text-align: left; }
.fd-table thead th { background: #efece5; position: sticky; top: 0; z-index: 2; font-size: 12px; color: #4a4036; }
.fd-table thead th.fd-q { text-align: center; }
.fd-table thead th.fd-q span { color: #8a7f70; font-size: 10px; }
.fd-table td.fd-q { text-align: center; }
.fd-table td.fd-x { text-align: center; padding: 0; }
.fd-in { width: 100%; box-sizing: border-box; border: 1px solid transparent; background: transparent; padding: 3px 4px; font-size: 13px; border-radius: 4px; }
/* Regole alimenti: colonne a larghezza fissa (resize), allineamenti, maniglia di ridimensionamento */
.fd-table.rd-fixed { table-layout: fixed; }
.fd-table.rd-fixed th, .fd-table.rd-fixed td { overflow: hidden; }
#modal-body .fd-table th.td-r, #modal-body .fd-table td.td-r { text-align: right; }
#modal-body .fd-table th.td-c, #modal-body .fd-table td.td-c { text-align: center; }
#modal-body .fd-table td.td-c select.fd-in { text-align: center; text-align-last: center; }
.fd-table thead th { padding-right: 12px; }
.rd-resize { position: absolute; top: 0; right: 0; width: 9px; height: 100%; cursor: col-resize; z-index: 3; }
.rd-resize::after { content: ""; position: absolute; top: 22%; bottom: 22%; right: 3px; width: 2px; border-radius: 1px; background: #c9bfad; } /* grip visibile */
.rd-resize:hover::after { background: #6f6456; }
.fd-in:focus { border-color: #b9b1a5; background: #fff; outline: none; }
select.fd-in { cursor: pointer; }
.fd-qin { width: 56px; border: 1px solid #d8d2c6; border-radius: 4px; padding: 3px 4px; font-size: 13px; text-align: right; }
.fd-qin:focus { border-color: #2faa55; outline: none; }
.fd-del { border: none; background: transparent; color: #b00020; cursor: pointer; font-size: 14px; padding: 4px 8px; border-radius: 6px; }
.fd-del:hover { background: #fdeaea; }
/* checkbox multi-utente nel dialog */
#confirmdlg .cd-checks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; max-height: 50vh; overflow: auto; }
#confirmdlg .cd-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #2b241f; cursor: pointer; }
#confirmdlg .cd-check span { color: #888; font-size: 12px; }

/* ---------- tabelle: ordinamento + filtro su ogni colonna ---------- */
th.th-enh { white-space: nowrap; }
th.th-enh .th-lab { display: inline-block; vertical-align: middle; }
.th-ctr { display: inline-flex; align-items: center; gap: 1px; margin-left: 6px; vertical-align: middle; }
.th-ctr button { border: none; background: transparent; cursor: pointer; padding: 0 2px; line-height: 1;
  color: #b3aa9a; font-size: 9px; border-radius: 3px; }
.th-ctr .th-funnel { color: #9a907f; display: inline-flex; align-items: center; padding: 1px 3px; }
.th-ctr button:hover { color: #2b241f; background: #e6e1d6; }
th.sort-asc .th-asc, th.sort-desc .th-desc { color: #0a6b2b; }
th.filtered .th-funnel { color: #1a5fb4; }
.tfilter { position: fixed; z-index: 95; background: #fff; border: 1px solid #9a9384; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); padding: 8px; width: 220px; }
.tfilter .tf-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; color: #555; }
.tfilter .tf-x { border: none; background: transparent; cursor: pointer; color: #888; font-size: 12px; }
.tfilter .tf-x:hover { color: #2b241f; }
.tfilter .tf-op { width: 100%; padding: 5px 6px; border: 1px solid #c7c0b4; border-radius: 6px; font-size: 13px; margin-bottom: 6px; cursor: pointer; }
.tfilter .tf-val { width: 100%; padding: 6px 8px; border: 1px solid #c7c0b4; border-radius: 6px; font-size: 13px; }
.tfilter .tf-val:focus, .tfilter .tf-op:focus { outline: none; border-color: #4a86ff; }
.fd-del svg { display: block; }

/* ---------- selettore lingua (bandiera a dx di AI) ---------- */
.ts-flag { cursor: pointer; border: 1px solid #d7d2c7; background: #fff; border-radius: 8px; height: 26px; min-width: 34px;
  padding: 0 6px; font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.ts-flag:hover { background: #f3f1ec; }
#langpicker { position: fixed; z-index: 85; background: #fff; border: 1px solid #9a9384; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); padding: 4px 0; min-width: 210px; max-height: 70vh; overflow: auto; }
#langpicker .lpi { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; color: #2b241f; }
#langpicker .lpi:hover { background: #eef3ff; }
#langpicker .lpi.sel { background: #e8f1ff; }
#langpicker .lp-flag { font-size: 17px; }
#langpicker .lp-name { flex: 1; font-size: 14px; }
#langpicker .lp-code { color: #9aa0a8; font-size: 12px; }

/* ---------- editor Dizionario (i18n) ---------- */
#dz-editor { display: flex; flex-direction: column; gap: 10px; }
.dz-search { padding: 7px 10px; border: 1px solid #c7c0b4; border-radius: 8px; font-size: 14px; min-width: 240px; }
.dz-langf { font-size: 13px; color: #4a4036; display: inline-flex; align-items: center; gap: 6px; }
.dz-langf select { padding: 5px 6px; border: 1px solid #c7c0b4; border-radius: 6px; font-size: 13px; cursor: pointer; }
#dz-new, #dz-imp, #dz-exp { padding: 6px 12px; border: 1px solid #b9b1a5; border-radius: 8px; background: #f4f1ec; cursor: pointer; font-size: 13px; }
#dz-new:hover, #dz-imp:hover, #dz-exp:hover { background: #fff; }
.dz-cov { display: flex; flex-wrap: wrap; gap: 6px; }
.dz-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #f1eee8; border: 1px solid #ddd6c9; color: #6b5e4f; }
.dz-badge.full { background: #cfeecd; border-color: #aedcab; color: #0b3d0b; }
.dz-key { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.dz-imp-area { width: 100%; min-height: 160px; border: 1px solid #c7c0b4; border-radius: 8px; padding: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; margin-bottom: 14px; }
/* RTL (arabo) */
html[dir="rtl"] .fd-table th, html[dir="rtl"] .fd-table td { text-align: right; }
html[dir="rtl"] #menu .mi { text-align: right; }

/* ---------- editor Regole alimenti ---------- */
#rd-editor { display: flex; flex-direction: column; gap: 10px; }
#rd-new { padding: 6px 12px; border: 1px solid #b9b1a5; border-radius: 8px; background: #f4f1ec; cursor: pointer; font-size: 13px; }
#rd-new:hover { background: #fff; }
.rd-num { width: 64px; text-align: right; }
.doctab.doctab-ed { background: #eef7ee; border-color: #aedcab; color: #0a6b2b; margin-left: 8px; }
.doctab.doctab-ed:hover { background: #dff0df; }

/* ---------- editor Ricette AI / Famiglie / Utenti / Duplica / Password ---------- */
#ai-editor, #fa-editor, #us-editor, #dup-editor, #pw-editor { display: flex; flex-direction: column; gap: 10px; }
.ai-list { display: flex; flex-direction: column; gap: 8px; }
.ai-row { display: flex; gap: 8px; align-items: flex-start; }
.ai-in { flex: 1; border: 1px solid #c7c0b4; border-radius: 6px; padding: 6px 8px; font-size: 13px; resize: vertical; font-family: inherit; }
.ai-ro { flex: 1; padding: 6px 8px; background: #faf9f6; border: 1px solid #eee; border-radius: 6px; font-size: 13px; }
.fa-in { width: 100%; border: 1px solid #c7c0b4; border-radius: 6px; padding: 4px 6px; font-size: 13px; }
.fa-col { width: 44px; height: 28px; border: 1px solid #c7c0b4; border-radius: 6px; cursor: pointer; padding: 0; }
.fa-ums { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fa-um { background: #f1eee8; border: 1px solid #ddd6c9; border-radius: 8px; padding: 4px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.fa-umdel { border: none; background: transparent; color: #b00020; cursor: pointer; font-size: 12px; }
#fa-umadd, #fa-new { padding: 5px 12px; border: 1px solid #b9b1a5; border-radius: 8px; background: #f4f1ec; cursor: pointer; font-size: 13px; }
.us-in { width: 100%; border: 1px solid transparent; background: transparent; padding: 4px 6px; font-size: 13px; border-radius: 4px; }
.us-in:focus { border-color: #b9b1a5; background: #fff; outline: none; }
#us-new { padding: 6px 12px; border: 1px solid #b9b1a5; border-radius: 8px; background: #f4f1ec; cursor: pointer; font-size: 13px; }
.dup-row { display: flex; align-items: center; gap: 12px; }
.dup-row label { min-width: 120px; color: #4a4036; font-size: 14px; }
.dup-row select, .dup-row input, .form-f { flex: 1; padding: 7px 9px; border: 1px solid #c7c0b4; border-radius: 6px; font-size: 14px; }
#confirmdlg .form-f { width: 100%; }
#confirmdlg .dup-row { margin-bottom: 10px; }
#fa-editor h4, #us-editor h4 { margin: 6px 0 2px; color: #6b5e4f; }
select.rd-tipo.pill-max { color: #8a1f1f; }
select.rd-tipo.pill-min { color: #7a4d00; }
/* popup Bimby: ingredienti da spuntare prima della ricerca */
.bp-list { display:flex; flex-direction:column; gap:6px; margin:8px 0 12px; }
.bp-row { display:flex; align-items:center; gap:8px; cursor:pointer; font-size:14px; }
.bp-fam { font-size:11px; color:#777; border:1px solid #ccc; border-radius:8px; padding:0 6px; }
.bp-actions { display:flex; justify-content:flex-end; }
.bp-actions button:disabled { opacity:.45; cursor:not-allowed; }
