:root {
    --bg: #f5f2ee;
    --card: #fffdf9;
    --card-2: #f0ebe5;
    --text: #302e2b;
    --muted: #827d77;
    --line: #e2dbd2;
    --primary: #6f7f92;
    --primary-soft: #e4e9ee;
    --danger: #b4504b;
    --danger-soft: #f2d9d7;
    --done: #6f8c70;
    --shadow: 0 4px 14px rgba(49, 42, 33, .055);
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; width:100%; min-height:100%; }
body { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; background:var(--bg); color:var(--text); padding-bottom:72px; overflow-x:hidden; }
button,input { font:inherit; }
button { cursor:pointer; }
button:disabled { opacity:.5; cursor:default; }
.hidden { display:none !important; }

main, .section { width:100%; max-width:760px; margin-inline:auto; }
.eyebrow,.section-kicker { font-size:.57rem; letter-spacing:.09em; text-transform:uppercase; font-weight:900; color:var(--muted); }
.section { display:none; padding:8px 12px 16px; }
.section.active { display:block; }
.section-head { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:9px; }
.section-head h2 { margin:1px 0 0; font-size:1.7rem; line-height:1.05; }
.section-title-row { display:flex; justify-content:space-between; align-items:end; gap:10px; margin:13px 0 7px; }
.section-title-row h3 { margin:0; font-size:.93rem; }
.section-title-row p { margin:2px 0 0; color:var(--muted); font-size:.64rem; }
.user-badge { max-width:45%; padding:5px 8px; border-radius:999px; background:#e9e3dc; color:#5c5954; font-weight:800; font-size:.62rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.btn { border:1px solid var(--line); background:#eee9e3; color:var(--text); border-radius:11px; padding:9px 11px; font-weight:800; font-size:.73rem; }
.btn-primary { background:var(--primary); border-color:var(--primary); color:#fff; }
.btn-danger { background:var(--danger); border-color:var(--danger); color:#fff; }
.btn-lg { padding:11px 12px; font-size:.75rem; }
.icon-btn { width:34px; height:34px; border:1px solid var(--line); background:var(--card); border-radius:11px; color:var(--text); display:grid; place-items:center; font-weight:900; }
.icon-btn.small { width:30px; height:30px; }

/* Bidoni: 2 + 3, sempre dentro il viewport */
.bins-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:5px; }
.bin-card { min-width:0; width:100%; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:6px 3px; box-shadow:var(--shadow); text-align:center; color:var(--text); }
.bin-emoji { display:block; font-size:1.18rem; line-height:1.05; }
.bin-name { display:block; margin-top:3px; min-height:23px; font-size:.53rem; font-weight:900; line-height:1.02; }
.status { display:inline-flex; align-items:center; justify-content:center; max-width:100%; margin-top:4px; border-radius:999px; padding:2px 4px; font-size:.43rem; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.status-empty { background:#e9e5df; color:#706a63; }
.status-mid { background:#eee4d4; color:#916d32; }
.status-full { background:var(--danger-soft); color:#9b403c; }
.level-bar { height:3px; background:#ebe6e0; border-radius:99px; overflow:hidden; margin-top:7px; }
.level-fill { height:100%; border-radius:99px; }
.bin-hint { display:none; }
.pulse { animation:pulse-red 1.55s infinite; }
@keyframes pulse-red { 0%,100% { box-shadow:0 0 0 0 rgba(180,80,75,.08); } 50% { box-shadow:0 0 0 5px rgba(180,80,75,.18); } }

/* calendario: 5 colonne senza scroll orizzontale */
.calendar-title { align-items:flex-end; }
.segmented { display:flex; background:#e8e2dc; padding:2px; border-radius:10px; }
.segment { border:0; background:transparent; color:var(--muted); padding:6px 8px; border-radius:8px; font-size:.62rem; font-weight:900; }
.segment.active { background:var(--card); color:var(--text); box-shadow:0 2px 7px rgba(49,42,33,.08); }
.month-controls { display:flex; justify-content:center; align-items:center; gap:14px; margin:4px 0 9px; }
.month-controls strong { min-width:115px; text-align:center; font-size:.73rem; }
.calendar-legend { display:flex; gap:7px; flex-wrap:wrap; margin-bottom:5px; color:var(--muted); font-size:.52rem; }
.dot { width:7px; height:7px; border-radius:50%; display:inline-block; margin-right:3px; }
.dot-cucina { background:#8b7a67; }.dot-bagno { background:#788a9f; }.dot-trash { background:#a28672; }
.calendar-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; }
.cal-day { position:relative; min-width:0; min-height:94px; background:var(--card); border:1px solid var(--line); border-radius:11px; padding:5px; box-shadow:var(--shadow); cursor:pointer; overflow:hidden; }
.cal-day.today { outline:2px solid #c8d1d8; outline-offset:-1px; }
.cal-day.selectable { border-color:#7d8b9a; box-shadow:0 0 0 2px rgba(77,97,121,.10); }
.cal-head { display:flex; justify-content:space-between; align-items:baseline; gap:3px; margin-bottom:3px; }
.cal-dayname { font-size:.49rem; text-transform:uppercase; color:var(--muted); font-weight:900; }
.cal-date { font-size:.71rem; font-weight:900; }
.shift-pill { position:relative; min-width:0; display:flex; align-items:center; gap:3px; border-radius:6px; padding:4px 4px; margin-top:3px; color:#fff; font-size:.49rem; font-weight:800; line-height:1.05; overflow:hidden; }

.shift-pill > div { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.shift-pill .done-meta { display:block; opacity:.9; font-size:.42rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.shift-pill .done-corner { position:absolute; right:0; top:0; width:14px; height:14px; background:var(--done); clip-path:polygon(100% 0,100% 100%,0 0); }
.absent-banner { margin-top:3px; padding:3px 4px; border-radius:6px; background:#f2e3df; color:#96504a; font-size:.45rem; font-weight:900; line-height:1.1; }
.bin-plan { margin-top:4px; padding-top:4px; border-top:1px dashed var(--line); color:var(--muted); font-size:.43rem; line-height:1.05; }

.quick-actions { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:9px; }
.task-btn { min-width:0; border:1px solid var(--line); background:var(--card); border-radius:12px; padding:8px 7px; text-align:left; display:flex; gap:6px; align-items:center; box-shadow:var(--shadow); }
.task-btn span { font-size:1rem; flex:0 0 auto; }.task-btn b { display:block; font-size:.61rem; line-height:1.05; }.task-btn small { display:block; margin-top:2px; color:var(--muted); font-size:.48rem; line-height:1.05; }
.muted-action { background:#f1ede8; }

/* prodotti */
.products-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.product-card { min-width:0; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:9px; box-shadow:var(--shadow); }
.product-top { display:flex; align-items:flex-start; justify-content:space-between; gap:6px; }
.product-emoji { font-size:1.28rem; }.product-name { margin-top:3px; font-weight:900; font-size:.65rem; line-height:1.05; }
.product-top .status { margin-top:0; flex-shrink:0; }
.product-percent { margin-top:3px; color:var(--muted); font-size:.5rem; }
.product-actions { display:grid; grid-template-columns:1fr 1fr; gap:5px; margin-top:7px; }
.product-actions .btn { padding:7px 5px; font-size:.54rem; }

/* spese */
.expense-summary { display:grid; gap:7px; }
.summary-card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:9px; box-shadow:var(--shadow); }
.summary-total { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.stat { background:#f1ece6; border-radius:10px; padding:8px; }.stat span { display:block; color:var(--muted); font-size:.5rem; }.stat strong { display:block; margin-top:3px; font-size:.9rem; }
.people-summary { margin-top:7px; display:grid; gap:4px; }.person-row { display:flex; justify-content:space-between; gap:8px; align-items:center; padding:7px 8px; border-radius:9px; background:#fbf8f4; font-size:.58rem; }.person-row small { color:var(--muted); }.person-balance { font-weight:900; font-size:.62rem; }.balance-positive { color:var(--primary); }.balance-negative { color:var(--danger); }
.history-list { display:grid; gap:5px; }.history-item { min-width:0; background:var(--card); border:1px solid var(--line); border-radius:10px; padding:7px 8px; display:flex; justify-content:space-between; gap:8px; box-shadow:0 3px 10px rgba(49,42,33,.03); }.history-main { min-width:0; }.history-main b { font-size:.58rem; }.history-main div { font-size:.57rem; margin-top:2px; overflow-wrap:anywhere; }.history-date { color:var(--muted); font-size:.49rem; white-space:nowrap; }.empty-state { background:var(--card); border:1px dashed var(--line); border-radius:10px; padding:12px; text-align:center; color:var(--muted); font-size:.63rem; }

/* bottom nav */
.bottom-nav { position:fixed; left:0; right:0; bottom:0; padding:5px 8px calc(5px + env(safe-area-inset-bottom)); background:rgba(255,253,249,.96); border-top:1px solid var(--line); display:grid; grid-template-columns:1fr 1fr; z-index:40; }
.nav-item { border:0; background:transparent; color:var(--muted); padding:6px; display:grid; gap:1px; justify-items:center; border-radius:10px; }.nav-item span { font-size:.95rem; }.nav-item b { font-size:.54rem; }.nav-item.active { background:var(--primary-soft); color:var(--primary); }

/* modali compatti */
.modal-overlay { position:fixed; inset:0; background:rgba(38,37,35,.35); z-index:80; }.modal-sheet { position:fixed; z-index:90; left:50%; top:50%; transform:translate(-50%,-50%); width:min(calc(100% - 14px),540px); max-height:calc(100dvh - 16px); overflow:auto; background:var(--card); border:1px solid var(--line); border-radius:18px; box-shadow:0 22px 55px rgba(38,37,35,.24); }.sheet-handle { width:34px; height:3px; border-radius:99px; background:#d7d0c8; margin:7px auto 2px; }.modal-inner { padding:6px 12px 13px; }.modal-head { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }.modal-head h3 { margin:3px 0 0; font-size:1rem; }.detail-card { background:#f6f1eb; border-radius:11px; padding:9px; margin-top:7px; }.detail-row { display:flex; justify-content:space-between; gap:8px; padding:6px 0; border-bottom:1px solid #e1d9d0; font-size:.64rem; }.detail-row:last-child { border-bottom:0; }.detail-label { color:var(--muted); }.modal-actions { display:grid; gap:6px; margin-top:8px; }.choice-grid { display:grid; gap:5px; margin-top:7px; }.choice-btn { width:100%; padding:9px; border:1px solid var(--line); border-radius:10px; background:#fbf8f4; text-align:left; font-weight:800; font-size:.65rem; }.field-label { display:block; margin-top:10px; font-size:.66rem; font-weight:800; }.money-input { display:flex; align-items:center; gap:6px; margin-top:5px; padding:0 9px; border:1px solid var(--line); background:#fbf8f4; border-radius:10px; }.money-input span { color:var(--muted); font-weight:900; }.money-input input { min-width:0; flex:1; border:0; outline:0; background:transparent; padding:10px 0; }.form-error { color:#a4443f; font-size:.6rem; min-height:1em; margin-top:4px; }
.toast { position:fixed; left:50%; top:10px; transform:translate(-50%,-8px); z-index:120; width:calc(100% - 24px); max-width:480px; text-align:center; background:#2f302f; color:#fff; border-radius:11px; padding:8px 10px; font-size:.63rem; font-weight:700; opacity:0; pointer-events:none; transition:.18s; }.toast.show { opacity:1; transform:translate(-50%,0); }
.global-busy { position:fixed; inset:0; display:none; place-items:center; z-index:110; background:rgba(245,242,238,.36); backdrop-filter:blur(2px); }.global-busy.show { display:grid; }.global-busy span { width:25px; height:25px; border:3px solid #d4dbe2; border-top-color:var(--primary); border-radius:50%; animation:spin .7s linear infinite; } @keyframes spin {to{transform:rotate(360deg)}}

/* login */
.login-shell { min-height:100vh; display:grid; place-items:center; padding:16px; }.login-card { width:min(100%,380px); background:var(--card); border:1px solid var(--line); border-radius:22px; padding:22px; box-shadow:0 18px 45px rgba(38,37,35,.10); }.brand-mark { width:48px; height:48px; border-radius:15px; background:#e7ecef; display:grid; place-items:center; font-size:1.35rem; margin-bottom:13px; }.login-card h1 { font-size:1.55rem; line-height:1.05; margin:5px 0 0; }.login-card .muted { color:var(--muted); margin:8px 0 15px; line-height:1.4; font-size:.72rem; }.stack { display:grid; gap:9px; }.stack label { font-size:.64rem; font-weight:800; }.stack input { display:block; width:100%; margin-top:4px; padding:10px 11px; border:1px solid var(--line); border-radius:10px; background:#fbf8f4; outline:0; }

@media (max-width:380px) {
  .app-header h1 { font-size:1rem; }
  .section-head h2 { font-size:1.45rem; }
  .bin-card { padding:7px 5px; }.bin-name{font-size:.58rem}.bin-emoji{font-size:1.2rem}
  .cal-day { min-height:89px; padding:4px; }.shift-pill{font-size:.45rem;padding:3px}.cal-dayname{font-size:.44rem}.cal-date{font-size:.66rem}
  .task-btn{padding:7px 5px}.task-btn span{font-size:.9rem}.task-btn b{font-size:.55rem}.task-btn small{font-size:.45rem}
}

.bin-modal-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.modal-actions-two { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.absent-banner.large { margin-top:7px; padding:7px 8px; font-size:.58rem; }
.product-level { margin-top:9px !important; }
@media (max-width:340px) {
  .section { padding-inline:8px; }
  .bins-grid { gap:4px; }
  .bin-card { border-radius:10px; padding:5px 2px; }
  .bin-emoji { font-size:1.02rem; }
  .bin-name { font-size:.48rem; min-height:20px; }
  .status { font-size:.39rem; padding:2px 3px; }
  .calendar-grid { gap:3px; }
  .cal-day { min-height:86px; }
  .shift-pill { font-size:.43rem; padding:3px; }
}


/* --- V4: leggibilità mobile + modalità operative persistenti --- */
body { -webkit-text-size-adjust: 100%; }
.section-head { margin-bottom:10px; }
.section-head h2 { font-size:1.48rem; }
.section-title-row h3 { font-size:1.02rem; }
.section-title-row p { font-size:.72rem; }
.user-badge { padding:7px 10px; font-size:.70rem; background:#e5e1dc; color:#56524d; border:1px solid #d9d2ca; }
.btn { font-size:.78rem; padding:10px 12px; }
.btn-lg { font-size:.82rem; padding:12px 13px; }
.segment { font-size:.68rem; padding:7px 9px; }
.icon-btn { width:36px; height:36px; }

/* 5 bidoni sempre sulla stessa riga, senza compromettere il resto */
.bins-scroll { width:100%; overflow:visible; }
.bins-grid { grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; }
.bin-card { padding:8px 3px; min-height:92px; border-radius:13px; }
.bin-emoji { font-size:1.32rem; }
.bin-name { font-size:.60rem; min-height:26px; }
.status { font-size:.47rem; padding:3px 4px; }
.level-bar { margin-top:8px; height:4px; }

.calendar-grid { gap:5px; }
.cal-day { min-height:98px; padding:6px; }
.cal-dayname { font-size:.56rem; }
.cal-date { font-size:.76rem; }
.shift-pill { font-size:.55rem; padding:5px 5px; }
.shift-pill .done-meta { font-size:.46rem; }
.absent-banner { font-size:.51rem; }
.bin-plan { font-size:.49rem; }
.task-btn b { font-size:.70rem; }
.task-btn small { font-size:.56rem; }

.products-grid { gap:8px; }
.product-card { padding:10px; }
.product-name { font-size:.73rem; }
.product-percent { font-size:.57rem; }
.product-actions .btn { font-size:.63rem; padding:8px 5px; }
.stat span { font-size:.57rem; }
.stat strong { font-size:.98rem; }
.person-row { font-size:.64rem; }
.person-balance { font-size:.68rem; }
.history-main b { font-size:.66rem; }
.history-main div { font-size:.65rem; }
.history-date { font-size:.54rem; }

.mode-banner { display:grid; grid-template-columns:1fr auto; gap:2px 8px; align-items:center; margin:7px 0; padding:10px 11px; border-radius:12px; border:1px solid #cdd5dc; background:#e9eef2; color:#40515e; box-shadow:0 3px 10px rgba(49,42,33,.05); }
.mode-banner strong { font-size:.76rem; }
.mode-banner span { grid-column:1; font-size:.64rem; line-height:1.25; color:#64717b; }
.mode-banner .mode-cancel { grid-column:2; grid-row:1 / span 2; border:1px solid #b9c3cc; background:#f7f8f9; color:#4e5e69; border-radius:9px; padding:8px 9px; font-weight:900; font-size:.62rem; }
.mode-banner.absence { border-color:#d9c6b9; background:#f5ece7; color:#745a4d; }
.mode-banner.absence span { color:#806d62; }
.mode-banner.absence .mode-cancel { border-color:#d1bdb0; color:#765c4e; }

.toast { font-size:.70rem; padding:10px 12px; }

/* popup acquisto: resta ancorato alla viewport ridotta dalla tastiera */
.modal-sheet { max-height:calc(100dvh - 10px); }
#buy-modal { top:auto; bottom:max(8px, env(safe-area-inset-bottom)); transform:translateX(-50%); }
.money-input input { font-size:1rem; min-height:42px; }

/* login: con tastiera aperta il pannello resta visibile in alto */
.login-shell { min-height:100svh; min-height:100dvh; height:auto; display:flex; align-items:flex-start; justify-content:center; overflow-y:auto; padding:18px 14px max(18px, env(safe-area-inset-bottom)); }
.login-card { margin-top:clamp(4px, 7vh, 52px); }
.stack input { font-size:1rem; min-height:46px; padding:11px 12px; }
.stack label { font-size:.72rem; }
.login-card h1 { font-size:1.62rem; }
.login-card .muted { font-size:.76rem; }

@media (max-height:560px) {
  .login-card { margin-top:6px; padding:17px; }
  .brand-mark { width:42px; height:42px; margin-bottom:8px; }
  .login-card h1 { font-size:1.36rem; }
  .login-card .muted { margin:6px 0 10px; }
  .stack { gap:7px; }
}

@media (max-width:360px) {
  .section { padding-inline:9px; }
  .section-head h2 { font-size:1.38rem; }
  .bin-card { min-height:88px; padding:7px 2px; }
  .bin-emoji { font-size:1.20rem; }
  .bin-name { font-size:.56rem; }
  .status { font-size:.43rem; }
  .cal-day { min-height:94px; padding:5px 4px; }
  .cal-dayname { font-size:.51rem; }
  .cal-date { font-size:.72rem; }
  .shift-pill { font-size:.49rem; padding:4px; }
  .bin-plan { font-size:.44rem; }
}

/* V5: calendario più compatto e indicatori task leggibili */
.cal-day{min-height:78px;padding:4px;display:flex;flex-direction:column;align-items:stretch;}
.cal-head{order:0;min-height:16px;margin-bottom:2px;}
.cal-dayname{font-size:.54rem;line-height:1;font-weight:900;}
.cal-date{font-size:.76rem;line-height:1;font-weight:950;}
.shift-pill{font-size:.46rem;padding:3px 4px;margin-top:2px;min-height:18px;}
.shift-pill .shift-emoji{font-size:.62rem;flex:0 0 auto;}
.shift-pill > div{font-size:.46rem;line-height:1;}
.shift-pill .done-meta{font-size:.40rem;}
.shift-pill .done-corner{width:17px;height:17px;background:#7a9b76;}
.done-task-only{display:flex;align-items:center;justify-content:center;gap:3px;height:18px;margin-top:2px;border:1px solid #b7c9b0;background:#eef4ec;color:#5f765a;border-radius:6px;font-size:.58rem;font-weight:950;}
.done-task-only span{font-size:.56rem;}
.absence-dot{width:8px;height:8px;border-radius:50%;background:#d5a33c;box-shadow:0 0 0 2px #f6e8bf;position:absolute;top:4px;left:4px;}
.absence-detail{margin-top:6px;padding:7px 8px;border-radius:9px;background:#f5e8c9;color:#7e6533;font-size:.72rem;font-weight:800;}
.bin-plan{font-size:.41rem;padding-top:2px;margin-top:2px;line-height:1;}
.modal-actions-two .btn,.modal-close-action{font-size:.73rem;padding:9px 10px;}
.modal-close-action{width:100%;margin-top:5px;background:#f1ede8;}

@media (max-width:380px){
  .cal-day{min-height:75px;padding:3px;}
  .cal-dayname{font-size:.51rem}.cal-date{font-size:.72rem}
  .shift-pill{font-size:.43rem;padding:2.5px 3px}.shift-pill > div{font-size:.43rem}.shift-pill .shift-emoji{font-size:.57rem}
  .done-task-only{height:17px;font-size:.53rem}
}


/* --- V6: rifiniture richieste --- */
.section-divider{display:flex;align-items:center;gap:8px;margin:12px 2px 4px;opacity:.9;}
.section-divider::before,.section-divider::after{content:"";height:1px;flex:1;background:linear-gradient(90deg,transparent,var(--line));}
.section-divider::after{background:linear-gradient(90deg,var(--line),transparent);}
.section-divider span{width:5px;height:5px;border-radius:50%;background:#cfc6bc;}

.bin-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;text-overflow:ellipsis;max-height:2.08em;}
.bin-card.bin-level-0{border-color:var(--line);}
.bin-card.bin-level-1{border:1.5px solid #d6b274;box-shadow:0 3px 12px rgba(177,132,63,.10);}
.bin-card.bin-level-2{border:2px solid #ca6b65;}
.bin-card .level-bar{height:6px;margin-top:7px;}

.shift-pill{gap:2px;padding-inline:3px;}
.shift-pill.shift-other{filter:saturate(.48) brightness(1.18);opacity:.82;}
.shift-pill.shift-mine{filter:none;opacity:1;}
.shift-pill .shift-emoji{font-size:.58rem;}
.shift-pill .shift-name{font-size:.51rem;line-height:1.02;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;text-align:left;}
.shift-pill .done-meta{font-size:.39rem;line-height:1;white-space:normal;}
.absence-corner{position:absolute;top:2px;left:2px;width:13px;height:13px;border-top:2px solid #d0a147;border-left:2px solid #d0a147;border-top-left-radius:7px;pointer-events:none;}

.products-grid{gap:6px;}
.product-card{padding:7px 8px;border-radius:12px;}
.product-top{gap:4px;align-items:center;}
.product-emoji{font-size:1.08rem;line-height:1;}
.product-name{margin-top:2px;font-size:.67rem;line-height:1.02;}
.product-top .status{font-size:.44rem;padding:2px 4px;}
.product-card .product-level{height:6px;margin-top:6px;}
.product-percent{margin-top:2px;font-size:.52rem;}
.product-actions{gap:4px;margin-top:5px;}
.product-actions .btn{padding:6px 4px;font-size:.57rem;border-radius:9px;}

.extra-expense-card{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,.9fr) auto;gap:6px;align-items:end;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:8px;box-shadow:var(--shadow);}
.extra-expense-card label{min-width:0;color:var(--muted);font-size:.54rem;font-weight:850;}
.extra-expense-card input{width:100%;min-width:0;margin-top:3px;border:1px solid var(--line);border-radius:9px;background:#fbf8f4;color:var(--text);outline:0;padding:7px 8px;font-size:.68rem;}
.extra-money{display:flex;align-items:center;gap:3px;margin-top:3px;border:1px solid var(--line);border-radius:9px;background:#fbf8f4;padding-left:7px;}
.extra-money span{font-size:.67rem;color:var(--muted);font-weight:900;}
.extra-money input{margin:0;border:0;background:transparent;padding-left:2px;}
.extra-expense-card>.btn{padding:8px 9px;font-size:.62rem;}
.extra-expense-error{grid-column:1/-1;margin:0;min-height:0;}
.extra-expense-error:empty{display:none;}

@media (max-width:380px){
  .shift-pill .shift-name{font-size:.47rem;}
  .product-card{padding:6px;}
  .product-name{font-size:.62rem;}
  .product-actions .btn{font-size:.53rem;padding:5px 3px;}
  .extra-expense-card{grid-template-columns:1fr .8fr;}
  .extra-expense-card>.btn{grid-column:1/-1;}
}


/* --- V7: sezioni casa, calendario e prodotti --- */
.home-zone{position:relative;margin:10px 0 12px;padding:8px 8px 9px;border-radius:15px;background:#faf7f3;border:1px solid #eee8e1;box-shadow:0 5px 16px rgba(49,42,33,.025);}
.home-zone::before{content:"";position:absolute;left:0;top:14px;bottom:14px;width:3px;border-radius:0 4px 4px 0;background:#d7d0c7;}
.home-zone-bins{background:#fbf8f4;}
.home-zone-turns{background:#f7f8f8;border-color:#e4e8e9;}
.home-zone-turns::before{background:#9caeba;}
.home-zone-history{background:#fbf9f6;}
.home-zone-history::before{background:#c8b9a7;}
.home-zone .section-title-row{margin:0 0 7px;padding-left:2px;}
.home-zone-title{min-height:28px;}
.home-zone .quick-actions{margin-bottom:0;}

/* label turni: più grandi senza aumentare inutilmente il banner */
.shift-pill{padding:2.5px 3px;gap:2px;min-height:18px;}
.shift-pill .shift-emoji{font-size:.56rem;}
.shift-pill .shift-name,.shift-pill>div{font-size:.56rem;line-height:1;}
.shift-pill .done-meta{display:block;font-size:.42rem;line-height:1.05;margin-top:1px;}
.done-task-only{justify-content:flex-start;padding:2px 4px;gap:3px;height:auto;min-height:18px;overflow:hidden;}
.done-only-emoji{font-size:.56rem;flex:0 0 auto;}
.done-only-name{font-size:.48rem;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* assenza: bordo dell'angolo alto destro, dietro il numero */
.cal-head{position:relative;z-index:2;}
.absence-corner{top:1px;right:1px;left:auto;width:18px;height:18px;border:0;border-top:2px solid #d0a147;border-right:2px solid #d0a147;border-top-right-radius:8px;z-index:1;opacity:.9;}

/* dettaglio giornata: assegnazione e completamento nello stesso rigo */
.detail-value-stack{display:flex;flex-direction:column;align-items:flex-end;gap:2px;text-align:right;}
.detail-done{font-size:.53rem;color:#627c61;font-weight:850;white-space:nowrap;}
.detail-card-bins{background:#f8f5f1;}

/* Prodotti: tile compatte, leggibili e meno alte */
.products-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.product-card{padding:9px 9px 8px;border-radius:14px;background:linear-gradient(180deg,#fffdf9 0%,#faf7f2 100%);border:1px solid #e3ddd5;box-shadow:0 4px 13px rgba(49,42,33,.035);}
.product-head{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0;}
.product-ident{display:flex;align-items:center;gap:5px;min-width:0;}
.product-emoji{font-size:1.08rem;line-height:1;flex:0 0 auto;}
.product-name{margin:0;font-size:.70rem;line-height:1.05;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.product-status{margin:0!important;flex:0 0 auto;font-size:.52rem!important;padding:3px 6px!important;}
.product-meter{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:center;margin-top:7px;}
.product-card .product-level{height:7px;margin:0!important;background:#eae4dd;}
.product-percent{margin:0;font-size:.57rem;font-weight:900;color:#77716a;min-width:28px;text-align:right;}
.product-actions{display:grid;grid-template-columns:.72fr 1.28fr;gap:5px;margin-top:7px;}
.product-action{border:1px solid #ddd5cc;border-radius:9px;padding:6px 5px;font-size:.57rem;font-weight:900;line-height:1;background:#f6f1eb;color:#655f58;cursor:pointer;}
.product-action.primary{background:#e7edf0;border-color:#d3dde2;color:#506574;}
.product-action:active{transform:translateY(1px);}

@media (max-width:380px){
  .home-zone{padding:7px 6px 8px;margin:8px 0 10px;}
  .shift-pill .shift-name,.shift-pill>div{font-size:.52rem;}
  .shift-pill .done-meta{font-size:.39rem;}
  .product-card{padding:8px 7px 7px;}
  .product-name{font-size:.65rem;}
  .product-status{font-size:.49rem!important;padding:3px 5px!important;}
  .product-action{font-size:.54rem;padding:6px 3px;}
}

/* --- V8: rifiniture casa, profilo, calendario e prodotti --- */
.home-zone{margin:10px 0 12px;padding:8px 8px 9px;border:0;border-radius:15px;background:rgba(255,253,249,.58);box-shadow:none;}
.home-zone::before{display:none!important;content:none!important;}
.home-zone-bins,.home-zone-turns{background:rgba(255,253,249,.58);border:0;}
.home-zone-history{margin:13px 0 0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;}
.home-zone-history .section-title-row{margin:13px 0 7px;padding-left:0;}
.user-badge{appearance:none;border:1px solid #d9d2ca;display:flex;align-items:center;gap:6px;max-width:52%;padding:7px 9px;font-size:.70rem;line-height:1;background:#e8e3dd;color:#55514c;text-align:left;}
.user-badge-dot{width:8px;height:8px;border-radius:50%;flex:0 0 auto;box-shadow:0 0 0 2px rgba(255,255,255,.55);}
.user-badge-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.user-badge-chevron{font-size:.72rem;color:#817b74;flex:0 0 auto;transform:translateY(-1px);}
.user-menu{position:fixed;z-index:72;width:min(268px,calc(100vw - 16px));max-height:calc(100dvh - 18px);overflow:auto;padding:10px;border:1px solid #ddd6ce;border-radius:15px;background:#fffdfa;box-shadow:0 15px 38px rgba(44,39,34,.16);}
.user-menu-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:1px 1px 8px;}.user-menu-head>div{display:grid;gap:2px;}
.user-menu-kicker,.user-menu-label{font-size:.55rem;letter-spacing:.04em;text-transform:uppercase;font-weight:900;color:var(--muted);}.user-menu-head strong{font-size:.84rem;}
.user-menu-close{width:28px;height:28px;border:0;border-radius:9px;background:#f1ece6;color:#655f59;font-size:1rem;line-height:1;display:grid;place-items:center;}
.user-menu-section{padding:9px 1px;border-top:1px solid #eee8e1;}.color-choices{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:8px;}
.color-swatch{width:24px;height:24px;border:2px solid #fff;border-radius:50%;background:var(--swatch);box-shadow:0 0 0 1px #d9d2cb;}.color-swatch.selected{box-shadow:0 0 0 2px #56514c,0 0 0 4px #fff;}
.color-custom{position:relative;width:24px;height:24px;border:1px dashed #bbb2a8;border-radius:50%;display:grid;place-items:center;color:#736c65;font-weight:900;background:#f7f3ee;overflow:hidden;cursor:pointer;}.color-custom span{pointer-events:none;font-size:.72rem;}.color-custom input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;}
.user-menu-row{width:100%;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:8px;border:0;border-top:1px solid #eee8e1;background:transparent;padding:10px 2px 5px;text-align:left;color:var(--text);font-size:.68rem;font-weight:850;}.user-menu-row-icon{font-size:.74rem;}.user-menu-chevron{font-size:1rem;color:#9a938c;}
.password-panel{display:grid;gap:7px;margin-top:8px;padding:9px;border-radius:11px;background:#f6f1eb;}.password-panel label{display:grid;gap:3px;font-size:.56rem;font-weight:850;color:#6e6862;}.password-panel input{width:100%;min-width:0;border:1px solid #dcd4cc;border-radius:9px;background:#fffdfa;padding:8px 9px;outline:0;font-size:.72rem;}.password-panel .btn{margin-top:2px;padding:8px 9px;font-size:.64rem;}
.cal-day{padding:3px 2px;border-radius:11px;}.shift-pill{gap:1px;padding:2.5px 2px;min-height:18px;border-radius:6px;}.shift-pill.shift-other,.shift-pill.shift-mine{filter:none!important;opacity:1!important;}.shift-pill .shift-emoji{font-size:.50rem;line-height:1;flex:0 0 auto;}
.shift-pill .shift-name,.shift-pill>div{min-width:0;width:100%;font-size:.59rem!important;line-height:1.02;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;overflow-wrap:normal!important;text-align:left;}.shift-pill .done-meta{font-size:.41rem!important;line-height:1.02;margin-top:1px;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}.shift-pill .done-corner{width:16px;height:16px;background:#6f8c70!important;opacity:1!important;filter:none!important;z-index:4;}.done-only-pill{min-height:18px;}
.absence-corner{top:0;right:0;left:auto;width:22px;height:22px;border:0;border-top:2px solid #d0a147;border-right:2px solid #d0a147;border-top-right-radius:10px;z-index:1;opacity:.92;pointer-events:none;}.cal-head{position:relative;z-index:2;}
.month-controls{gap:11px;margin:5px 0 9px;}.month-arrow{width:35px;height:28px;border:0;border-radius:999px;background:#eae5df;color:#5d5954;display:grid;place-items:center;box-shadow:inset 0 0 0 1px #ded7cf;}.month-arrow span{font-family:Georgia,"Times New Roman",serif;font-size:1.32rem;line-height:.8;transform:translateY(-1px);}.month-arrow:active{transform:translateY(1px);background:#e1dbd4;}
.task-btn{transition:transform .12s ease,background .12s ease;}.task-btn:active{transform:translateY(1px);}.task-btn-kitchen{background:#eef2ea;border-color:#d9e2d3;color:#4f6250;}.task-btn-kitchen small{color:#748274;}.task-btn-bath{background:#edf2f5;border-color:#d8e2e8;color:#4d6472;}.task-btn-bath small{color:#73858f;}
.modal-actions-dynamic{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;}.modal-actions-dynamic.single{grid-template-columns:1fr;}.absence-remove-btn{background:#f2e7df;border-color:#e3cec2;color:#775b4c;}
.products-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}.product-card{min-width:0;min-height:64px;display:grid;grid-template-columns:34px minmax(0,1fr) 34px;align-items:center;gap:7px;padding:7px;border-radius:13px;background:#fffdfa;border:1px solid #e1dad2;box-shadow:0 3px 10px rgba(49,42,33,.035);}.product-icon-box{width:34px;height:34px;border-radius:10px;background:#f1ece6;display:grid;place-items:center;font-size:1.08rem;line-height:1;}.product-info{min-width:0;display:grid;gap:5px;}.product-name-row{min-width:0;display:grid;gap:3px;justify-items:start;}.product-name{min-width:0;max-width:100%;margin:0;font-size:.69rem;line-height:1.02;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.product-status{margin:0!important;font-size:.56rem!important;line-height:1!important;padding:3px 6px!important;}.product-meter-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;align-items:center;min-width:0;}.product-card .product-level{height:7px;margin:0!important;background:#eae4dd;}.product-percent{margin:0;font-size:.55rem;font-weight:900;color:#7b756e;min-width:27px;text-align:right;}.product-side-actions{display:grid;gap:4px;align-self:stretch;}.product-mini-action{min-width:0;border:1px solid #ddd5cc;border-radius:8px;background:#f4efe9;color:#655f58;font-size:.54rem;font-weight:950;line-height:1;padding:0;}.product-mini-action.decrease{background:#f3ede5;color:#786554;}.product-mini-action.bought{background:#e8eef1;border-color:#d5e0e5;color:#506a77;font-size:.78rem;}.product-mini-action:active{transform:translateY(1px);}
body{padding-bottom:82px;}.bottom-nav{padding:7px 8px calc(7px + env(safe-area-inset-bottom));}.nav-item{min-height:48px;padding:7px 6px;border-radius:12px;}.nav-item span{display:grid;justify-items:center;gap:2px;font-size:1.04rem;line-height:1;}.nav-item b{font-size:.60rem;line-height:1.05;}
@media (max-width:380px){.home-zone{padding:7px 6px 8px;}.cal-day{padding:3px 2px;}.shift-pill .shift-name,.shift-pill>div{font-size:.59rem!important;}.shift-pill .shift-emoji{font-size:.48rem;}.product-card{grid-template-columns:31px minmax(0,1fr) 32px;gap:6px;padding:6px;min-height:61px;}.product-icon-box{width:31px;height:31px;font-size:1rem;}.product-name{font-size:.66rem;}.product-status{font-size:.54rem!important;padding:3px 5px!important;}.product-mini-action{font-size:.51rem;}}

/* --- V9: rifiniture richieste --- */
/* separazione neutra ma più leggibile, senza bordi laterali */
.home-zone-bins,.home-zone-turns{background:#f0ece7!important;box-shadow:none!important;border:0!important;}
.home-zone-history{background:transparent!important;}

/* label calendario: altri coinquilini più chiari, emoji un po' più grandi */
.shift-pill.shift-other{opacity:1!important;filter:none!important;}
.shift-pill .shift-emoji{font-size:.68rem!important;line-height:1;}
.shift-pill.shift-mine .shift-emoji{font-size:.70rem!important;}

/* angolo assenza: piccolo e realmente raccordato con lo spigolo */
.absence-corner{top:2px!important;right:2px!important;width:13px!important;height:13px!important;border-top:2px solid #d8a62e!important;border-right:2px solid #d8a62e!important;border-top-right-radius:8px!important;opacity:1!important;}

/* completamento: triangolo verde acceso con spunta, mai attenuato */
.shift-pill .done-corner{position:absolute!important;right:0!important;top:0!important;width:18px!important;height:18px!important;background:#27b34a!important;clip-path:polygon(100% 0,100% 100%,0 0)!important;z-index:6!important;opacity:1!important;filter:none!important;color:#fff!important;display:block!important;}
.shift-pill .done-corner b{position:absolute;top:1px;right:2px;font-size:.48rem;line-height:1;font-weight:1000;color:#fff;transform:rotate(1deg);}

/* quick action neutre */
.task-btn-kitchen,.task-btn-bath{background:#f7f4f0!important;border-color:#ddd6ce!important;color:#5d5954!important;}
.task-btn-kitchen small,.task-btn-bath small{color:var(--muted)!important;}

/* prodotti: card a lista, niente percentuali */
.products-grid{display:grid!important;grid-template-columns:1fr!important;gap:7px!important;}
.product-card{display:grid!important;grid-template-columns:minmax(0,1fr) 72px 72px!important;align-items:center!important;gap:9px!important;min-height:58px!important;padding:8px 9px!important;border-radius:14px!important;background:#fffdfa!important;border:1px solid #e2dbd3!important;box-shadow:0 3px 11px rgba(49,42,33,.035)!important;}
.product-main{min-width:0;display:flex;align-items:center;gap:9px;}
.product-icon-box{width:36px!important;height:36px!important;flex:0 0 36px;border-radius:11px!important;background:#f1ece6!important;font-size:1.16rem!important;}
.product-copy{min-width:0;display:grid;gap:4px;justify-items:start;}
.product-name{font-size:.72rem!important;line-height:1.05!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:100%;}
.product-status{font-size:.59rem!important;padding:3px 7px!important;margin:0!important;}
.product-stock{display:flex;align-items:center;gap:4px;justify-content:center;}
.stock-segment{width:18px;height:6px;border-radius:999px;background:#e7e1da;box-shadow:inset 0 0 0 1px rgba(90,80,70,.04);}
.stock-segment.filled{background:var(--stock);}
.product-actions-v9{display:grid;grid-template-columns:1fr 1fr;gap:6px;}
.product-icon-action{height:38px;border:1px solid #ddd5cc;border-radius:11px;background:#f5f1ec;color:#655f58;font-size:1rem;display:grid;place-items:center;cursor:pointer;padding:0;}
.product-icon-action.buy{background:#f1f4f5;border-color:#dce3e6;}
.product-icon-action:active{transform:translateY(1px);}
.product-empty{border-color:#e2c7c3!important;}

/* profilo: più spazio ai colori */
.color-choices{gap:8px!important;}
.color-swatch,.color-custom{width:25px!important;height:25px!important;}

/* evita che il suggeritore password resti agganciato ad altri popup */
#passwordPanel input{font-size:16px;}
#buyAmount{font-size:16px!important;}

@media (max-width:380px){
  .product-card{grid-template-columns:minmax(0,1fr) 62px 66px!important;gap:7px!important;padding:7px!important;}
  .product-icon-box{width:33px!important;height:33px!important;flex-basis:33px;font-size:1.08rem!important;}
  .product-name{font-size:.68rem!important;}
  .stock-segment{width:15px;height:6px;}
  .product-icon-action{height:36px;font-size:.96rem;}
  .shift-pill .shift-emoji{font-size:.64rem!important;}
}

/* --- V10: prodotti a due colonne, rotazione turni e note --- */
/* Indicatore assenza: appoggiato esattamente al bordo arrotondato della giornata. */
.cal-day{overflow:visible;}
.absence-corner{
  position:absolute!important;
  top:-1px!important; right:-1px!important; left:auto!important;
  width:14px!important; height:14px!important;
  border:0!important;
  border-top:2px solid #d8a62e!important;
  border-right:2px solid #d8a62e!important;
  border-top-right-radius:11px!important;
  opacity:1!important;
  pointer-events:none!important;
  box-sizing:border-box!important;
  z-index:5!important;
}
.day-note-marker{position:absolute;left:3px;bottom:2px;font-size:.49rem;line-height:1;z-index:5;filter:saturate(.72);}

/* Rotazione: quattro teste per attività, nome solo sul prossimo turno. */
.turn-overview-block{margin-top:9px;padding:8px;border-radius:12px;background:#e8e3dd;}
.turn-overview-title{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:5px;}
.turn-overview-title>span{font-size:.62rem;font-weight:950;color:#5e5954;}
.turn-overview-title small{font-size:.45rem;color:#8a837b;}
.turn-overview{display:grid;gap:5px;}
.turn-overview-row{display:grid;grid-template-columns:62px minmax(0,1fr);align-items:center;gap:5px;min-height:36px;}
.turn-overview-label{display:flex;align-items:center;gap:4px;color:#625d58;min-width:0;}
.turn-overview-label span{font-size:.76rem;}.turn-overview-label b{font-size:.53rem;white-space:nowrap;}
.turn-heads{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:start;gap:2px;}
.turn-head-wrap{min-width:0;display:grid;justify-items:center;gap:1px;position:relative;}
.turn-head{width:25px;height:25px;border-radius:50%;background:var(--head);display:grid;place-items:center;font-size:.75rem;line-height:1;box-shadow:0 0 0 2px rgba(255,255,255,.76);position:relative;filter:saturate(.82);}
.turn-head-wrap.active .turn-head{width:28px;height:28px;filter:none;box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(91,86,81,.18);}
.turn-head-name{max-width:100%;font-size:.48rem;font-weight:950;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#57524d;line-height:1;}
.turn-last-done{position:absolute;right:-3px;bottom:-2px;width:13px;height:13px;border-radius:50%;display:grid;place-items:center;background:#22b94c;color:#fff;border:2px solid #f3efe9;font-size:.43rem;line-height:1;font-weight:1000;}

/* Azioni rapide più esplicite e neutre. */
.task-btn-kitchen,.task-btn-bath{background:#f7f4f0!important;border-color:#ddd6ce!important;color:#5d5954!important;}
.task-btn b{font-size:.66rem;}.task-btn small{font-size:.48rem;}

/* Prodotti: SEMPRE due colonne, anche sui telefoni stretti. */
.products-title-row{align-items:center;}
.section-icon-action{width:31px;height:31px;border:1px solid #ddd6ce;border-radius:10px;background:#f5f1ec;display:grid;place-items:center;font-size:.82rem;cursor:pointer;}
.products-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;}
.product-card.product-card-v10{min-width:0!important;min-height:0!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:6px!important;padding:7px!important;border-radius:13px!important;background:#fffdfa!important;border:1px solid #e2dbd3!important;box-shadow:0 3px 10px rgba(49,42,33,.035)!important;}
.product-card-head{display:grid;grid-template-columns:30px minmax(0,1fr) 24px;gap:6px;align-items:center;min-width:0;}
.product-card-v10 .product-icon-box{width:30px!important;height:30px!important;min-width:30px!important;flex-basis:30px!important;border-radius:9px!important;font-size:1rem!important;}
.product-card-copy{min-width:0;display:grid;gap:3px;justify-items:start;}
.product-card-v10 .product-name{font-size:.63rem!important;line-height:1.05!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;width:100%;}
.product-card-v10 .product-status{font-size:.51rem!important;padding:3px 5px!important;line-height:1!important;}
.product-note-btn{width:24px;height:24px;border:0;border-radius:8px;background:transparent;font-size:.70rem;display:grid;place-items:center;padding:0;cursor:pointer;opacity:.52;}
.product-note-btn.has-note{opacity:1;background:#f0ebe5;}
.product-card-v10 .product-stock{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;width:100%;}
.product-card-v10 .stock-segment{width:auto;height:7px;border-radius:999px;background:#e6e0d9;}
.product-card-v10 .stock-segment.filled{background:var(--stock);}
.product-actions-v10{display:grid;grid-template-columns:1fr 1fr;gap:5px;}
.product-card-v10 .product-icon-action{height:31px;border-radius:9px;font-size:.88rem;background:#f4f0eb;border-color:#ddd6ce;}
.product-card-v10 .product-icon-action.buy{background:#eef2f3;border-color:#dce3e5;}
.product-note-preview{width:100%;border:0;background:#f6f2ed;color:#726b64;border-radius:7px;padding:4px 5px;font-size:.47rem;line-height:1.15;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;}

/* Note calendario e prodotto. */
.day-notes-card{margin-top:8px;padding:8px;border-radius:11px;background:#f5f1ec;border:1px solid #e7e0d8;}
.day-notes-head{font-size:.66rem;margin-bottom:5px;}
.notes-list{display:grid;gap:5px;}
.note-empty{font-size:.56rem;color:var(--muted);padding:2px 0;}
.note-item{display:grid;grid-template-columns:minmax(0,1fr) 24px;gap:5px;align-items:start;padding:6px 7px;border-radius:8px;background:#fffdfa;border:1px solid #ebe4dc;}
.note-item>div{min-width:0;display:grid;gap:2px;}.note-item b{font-size:.53rem;}.note-item span{font-size:.58rem;line-height:1.25;overflow-wrap:anywhere;}
.note-remove{width:23px;height:23px;border:0;border-radius:7px;background:#f2ece6;color:#776f68;font-size:.82rem;line-height:1;}
.note-compose{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;margin-top:6px;align-items:stretch;}
.note-compose textarea{min-width:0;min-height:52px;resize:vertical;border:1px solid #ddd6ce;border-radius:9px;background:#fff;padding:7px 8px;font:inherit;font-size:16px;line-height:1.2;outline:0;}
.note-add-btn{align-self:stretch;padding-inline:10px;font-size:.58rem;}
.product-modal-notes{max-height:35vh;overflow:auto;margin-bottom:8px;}
.note-compose-modal{grid-template-columns:1fr;}.note-compose-modal .note-add-btn{min-height:38px;}

/* Configurazione consumo automatico. */
.config-help{margin:-2px 0 9px;color:var(--muted);font-size:.61rem;line-height:1.35;}
.product-config-list{display:grid;gap:5px;max-height:48vh;overflow:auto;padding-right:2px;}
.product-config-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:7px 8px;border-radius:9px;background:#f6f2ed;font-size:.60rem;font-weight:850;}
.duration-input{display:flex;align-items:center;gap:4px;}.duration-input input{width:55px;border:1px solid #d9d1c8;border-radius:8px;background:#fff;padding:6px;text-align:center;font-size:16px;}.duration-input b{font-size:.50rem;color:var(--muted);}

@media (max-width:380px){
  .products-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;}
  .product-card.product-card-v10{padding:6px!important;gap:5px!important;}
  .product-card-head{grid-template-columns:27px minmax(0,1fr) 22px;gap:4px;}
  .product-card-v10 .product-icon-box{width:27px!important;height:27px!important;min-width:27px!important;flex-basis:27px!important;font-size:.92rem!important;}
  .product-card-v10 .product-name{font-size:.59rem!important;}
  .product-card-v10 .product-status{font-size:.48rem!important;padding:2px 4px!important;}
  .product-note-btn{width:22px;height:22px;font-size:.64rem;}
  .product-card-v10 .stock-segment{height:6px;}
  .product-card-v10 .product-icon-action{height:29px;font-size:.82rem;}
  .turn-overview-row{grid-template-columns:55px minmax(0,1fr);}.turn-overview-label b{font-size:.49rem;}.turn-head{width:23px;height:23px;font-size:.68rem;}.turn-head-wrap.active .turn-head{width:26px;height:26px;}.turn-head-name{font-size:.44rem;}
}
.turn-last-done.previous-only{background:#88847f;font-size:.46rem;}

/* V6 — note calendario compatte: il contenuto compare solo su richiesta */
.day-note-toggle{margin-top:7px;min-height:30px;padding:6px 9px;border:1px solid #ddd6ce;border-radius:9px;background:#f7f4f0;color:#655f59;font:inherit;font-size:.57rem;font-weight:900;cursor:pointer;}
.day-notes-panel{margin-top:5px;padding:7px;border-radius:10px;background:#f5f1ec;border:1px solid #e7e0d8;}
.compact-note-compose{grid-template-columns:minmax(0,1fr) auto!important;}
.compact-note-compose textarea{min-height:38px!important;max-height:90px!important;}
.compact-note-compose .note-add-btn{min-height:38px;padding-inline:9px;}


/* V7 — prodotti senza turnazione acquisti: più leggibili e stati più evidenti */
.product-card.product-card-v10{
  position:relative;
  gap:7px!important;
  padding:8px!important;
}
.product-card-head{
  grid-template-columns:36px minmax(0,1fr) 26px!important;
  gap:7px!important;
}
.product-card-v10 .product-icon-box{
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  flex-basis:36px!important;
  border-radius:10px!important;
  font-size:1.18rem!important;
}
.product-card-v10 .product-name{
  font-size:.70rem!important;
  line-height:1.08!important;
}
.product-card-v10 .product-status{
  font-size:.56rem!important;
  padding:3px 6px!important;
}
.product-note-btn{
  width:26px!important;
  height:26px!important;
  font-size:.76rem!important;
}
.product-card-v10 .stock-segment{height:8px!important;}
.product-card-v10 .product-icon-action{
  height:33px!important;
  font-size:.96rem!important;
}
.product-note-preview{font-size:.51rem!important;padding:5px 6px!important;}

/* A metà: bordo caldo ma discreto. */
.product-card.product-half{
  border:1.5px solid #d6b274!important;
  box-shadow:0 3px 11px rgba(177,132,63,.08)!important;
}

/* Finito: bordo rosso e alone pulsante senza alterare il layout. */
.product-card.product-empty{
  border:2px solid #cf6a64!important;
  overflow:visible;
}
.product-card.product-empty::after{
  content:"";
  position:absolute;
  inset:-3px;
  border-radius:15px;
  pointer-events:none;
  border:2px solid rgba(207,106,100,.32);
  animation:product-finished-pulse 1.45s ease-in-out infinite;
}
@keyframes product-finished-pulse{
  0%,100%{opacity:.20;transform:scale(.995);box-shadow:0 0 0 0 rgba(207,106,100,.08);}
  50%{opacity:.90;transform:scale(1.012);box-shadow:0 0 0 4px rgba(207,106,100,.12);}
}

@media (max-width:380px){
  .product-card.product-card-v10{padding:7px!important;gap:6px!important;}
  .product-card-head{grid-template-columns:32px minmax(0,1fr) 24px!important;gap:5px!important;}
  .product-card-v10 .product-icon-box{width:32px!important;height:32px!important;min-width:32px!important;flex-basis:32px!important;font-size:1.08rem!important;}
  .product-card-v10 .product-name{font-size:.66rem!important;}
  .product-card-v10 .product-status{font-size:.53rem!important;padding:3px 5px!important;}
  .product-note-btn{width:24px!important;height:24px!important;font-size:.70rem!important;}
  .product-card-v10 .stock-segment{height:7px!important;}
  .product-card-v10 .product-icon-action{height:31px!important;font-size:.91rem!important;}
}


/* --- V8: stato casa, calendario e controlli --- */
.btn-bin-up{background:#e9992f!important;border-color:#e18d20!important;color:#fff!important;}
.home-alerts{display:grid;gap:6px;margin:2px 0 10px;}
.home-alert{display:flex;align-items:center;gap:8px;min-width:0;padding:8px 10px;border-radius:12px;border:1px solid #ead7bf;background:#fff5e8;color:#6d5140;box-shadow:0 3px 10px rgba(62,46,31,.035);}
.home-alert.alert-product{border-color:#ead0cc;background:#fff0ee;color:#784a46;}
.home-alert-icon{font-size:1rem;line-height:1;flex:0 0 auto;}
.home-alert>div{min-width:0;display:grid;gap:1px;}.home-alert b{font-size:.64rem;}.home-alert span:not(.home-alert-icon){font-size:.55rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.rollover-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 8px;padding:7px 9px;border:0;border-radius:11px;background:#e9e5df;color:#635d57;text-align:left;}
.rollover-copy{min-width:0;display:grid;gap:1px;}.rollover-copy b{font-size:.58rem;line-height:1.1;}.rollover-copy small{font-size:.46rem;color:#8a837c;line-height:1.1;}
.switch-knob{position:relative;width:34px;height:19px;flex:0 0 auto;border-radius:999px;background:#c8c1ba;transition:background .18s ease;box-shadow:inset 0 0 0 1px rgba(65,58,52,.06);}
.switch-knob::after{content:"";position:absolute;left:2px;top:2px;width:15px;height:15px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(44,39,34,.18);transition:transform .18s ease;}
.rollover-toggle.active{background:#e7f0eb;color:#405f4d;}.rollover-toggle.active .switch-knob{background:#39a96b;}.rollover-toggle.active .switch-knob::after{transform:translateX(15px);}
.month-controls{display:grid!important;grid-template-columns:36px minmax(0,1fr) 36px!important;align-items:center!important;gap:6px!important;margin:5px 0 9px!important;padding:5px!important;border-radius:14px!important;background:#e9e5df!important;}
.month-controls strong{min-width:0!important;padding:5px 7px!important;border-radius:10px!important;background:#fffdfa!important;text-align:center!important;font-size:.86rem!important;line-height:1.05!important;letter-spacing:-.01em!important;color:#4f4a45!important;box-shadow:0 2px 7px rgba(49,42,33,.045)!important;}
.month-arrow{width:36px!important;height:31px!important;border-radius:10px!important;background:transparent!important;box-shadow:none!important;border:0!important;color:#5c5650!important;}
.month-arrow:hover{background:rgba(255,255,255,.55)!important;}.month-arrow span{font-size:1.45rem!important;font-family:inherit!important;font-weight:700!important;}
.cal-day{padding:6px 3px 4px!important;}
.cal-head{padding:1px 2px 2px!important;margin-bottom:4px!important;}
.cal-day.today{outline:2px solid #3b82f6!important;outline-offset:-1px!important;border-color:#82b4f5!important;box-shadow:0 0 0 2px rgba(59,130,246,.08),var(--shadow)!important;}
.absence-corner{top:-1px!important;right:-1px!important;width:12px!important;height:12px!important;border-top:1.5px solid #e8c66c!important;border-right:1.5px solid #e8c66c!important;border-top-right-radius:10px!important;opacity:.92!important;}
.shift-pill.shift-mine{box-shadow:inset 0 0 0 1px rgba(255,255,255,.16);}
.shift-pill.shift-other{box-shadow:inset 0 0 0 1px rgba(255,255,255,.42);}
.product-card-v10 .product-stock{width:68%!important;max-width:82px!important;align-self:flex-start!important;gap:3px!important;}
.product-card-v10 .stock-segment{height:4px!important;border-radius:99px!important;background:#ebe6e0!important;opacity:.72!important;}
.product-card-v10 .stock-segment.filled{opacity:.78!important;}
.password-modal-form{display:grid;gap:8px;padding:2px 0 4px;}.password-modal-form label{display:grid;gap:4px;font-size:.60rem;font-weight:850;color:#69635d;}.password-modal-form input{width:100%;border:1px solid #d9d2ca;border-radius:10px;background:#fff;padding:10px 11px;font-size:16px;outline:0;}.password-modal-form input:focus{border-color:#8eabc9;box-shadow:0 0 0 3px rgba(59,130,246,.08);}
@media (max-width:380px){.home-alert{padding:7px 8px;}.home-alert b{font-size:.60rem;}.home-alert span:not(.home-alert-icon){font-size:.51rem;}.month-controls strong{font-size:.80rem!important;}.cal-day{padding-top:5px!important;}.product-card-v10 .product-stock{max-width:70px!important;}}

/* --- V9: palette soft, turni altrui più leggeri, alert minimo --- */
/* L'header del mese non deve mai comparire nella vista 7 giorni. */
.month-controls.hidden{display:none!important;}

/* I colori restano distinguibili ma con resa pastello. */
.shift-pill.shift-mine{
  box-shadow:inset 0 0 0 1px rgba(93,83,74,.08)!important;
  filter:none!important;
}
.shift-pill.shift-other{
  box-shadow:inset 0 0 0 1px rgba(102,94,87,.06)!important;
  color:#68615b!important;
}
.shift-pill.shift-other .shift-emoji,
.shift-pill.shift-other .shift-name{opacity:.76;}
/* Il triangolo verde di completamento resta sempre pieno e leggibile. */
.shift-pill.shift-other .done-corner,
.shift-pill.shift-other .done-corner b{opacity:1!important;filter:none!important;}

/* Richiamo minimale: serve solo a far capire che la pagina Spese richiede attenzione. */
.home-alerts{display:flex!important;margin:1px 0 7px!important;gap:0!important;}
.home-alerts.hidden{display:none!important;}
.home-product-attention{
  width:auto;
  max-width:100%;
  min-height:27px;
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:4px 7px;
  border:1px solid #ead7d2;
  border-radius:999px;
  background:#fff8f6;
  color:#755d58;
  box-shadow:none;
  text-align:left;
}
.home-product-attention>span{font-size:.72rem;line-height:1;}
.home-product-attention>b{font-size:.55rem;line-height:1;}
.home-product-attention>small{font-size:.49rem;color:#9a7770;line-height:1;white-space:nowrap;}
.home-product-attention>i{font-style:normal;font-size:.75rem;color:#b28e87;line-height:1;margin-left:1px;}

@media (max-width:380px){
  .home-product-attention{min-height:25px;padding:3px 6px;gap:4px;}
  .home-product-attention>small{font-size:.46rem;}
}

/* --- V10: conferma pulizie, impostazione rollover nel profilo, emoji leggibili --- */
/* Il recupero dei turni non occupa più spazio nella home: vive nelle impostazioni del profilo. */
.user-settings-section{padding-bottom:8px!important;}
.rollover-menu-toggle{
  margin:7px 0 0!important;
  padding:8px 9px!important;
  background:#f3efea!important;
  border:1px solid #e6dfd8!important;
  border-radius:12px!important;
}
.rollover-menu-toggle.active{background:#eef5f0!important;border-color:#d8e8dd!important;}
.rollover-menu-toggle .rollover-copy b{font-size:.60rem!important;}
.rollover-menu-toggle .rollover-copy small{font-size:.48rem!important;}

/* Badge bianco dietro alle emoji dei turni: il colore della label resta leggibile. */
.shift-pill .shift-emoji{
  width:17px!important;
  height:17px!important;
  flex:0 0 17px!important;
  display:inline-grid!important;
  place-items:center!important;
  border-radius:6px!important;
  background:rgba(255,255,255,.93)!important;
  box-shadow:0 1px 3px rgba(55,48,42,.10),inset 0 0 0 1px rgba(91,82,74,.07)!important;
  font-size:.66rem!important;
  line-height:1!important;
  opacity:1!important;
}
.shift-pill.shift-other .shift-emoji{opacity:.92!important;}
.shift-pill.shift-mine .shift-emoji{font-size:.68rem!important;}

/* Conferma pulizia dedicata: più chiara e piacevole del confirm del browser. */
.confirm-task-modal{
  width:min(calc(100% - 28px),360px)!important;
  overflow:visible!important;
  border:1px solid #e6ded6!important;
  border-radius:21px!important;
  background:#fffdfa!important;
  box-shadow:0 24px 70px rgba(42,37,32,.22)!important;
}
.confirm-task-inner{
  position:relative;
  padding:22px 18px 17px!important;
  text-align:center;
}
.confirm-close{
  position:absolute;right:10px;top:10px;
  width:28px;height:28px;border:0;border-radius:9px;
  display:grid;place-items:center;background:#f2ede7;color:#766e67;
  font-size:1rem;line-height:1;cursor:pointer;
}
.confirm-task-visual{
  position:relative;
  width:58px;height:58px;margin:0 auto 10px;
  border-radius:19px;background:#f5f0ea;
  display:grid;place-items:center;
  box-shadow:inset 0 0 0 1px #eae2da;
  font-size:1.65rem;
}
.confirm-check{
  position:absolute;right:-4px;bottom:-3px;
  width:23px;height:23px;border-radius:50%;
  display:grid;place-items:center;
  background:#49a66f;color:white;border:3px solid #fffdfa;
  font-size:.68rem;font-weight:1000;
}
.confirm-kicker{display:block;margin-bottom:4px;}
.confirm-task-inner h3{margin:0;font-size:1.02rem;color:#4d4843;}
.confirm-task-inner p{margin:7px auto 0;max-width:275px;color:#817970;font-size:.62rem;line-height:1.35;}
.confirm-task-actions{display:grid;grid-template-columns:.78fr 1.22fr;gap:7px;margin-top:15px;}
.confirm-task-actions .btn{min-height:39px;border-radius:11px;font-size:.64rem;font-weight:900;}
.confirm-cancel{background:#f3efea!important;border-color:#e5ddd5!important;color:#716a63!important;}
.confirm-submit{background:#5c9f77!important;border-color:#5c9f77!important;color:#fff!important;}

@media (max-width:380px){
  .shift-pill .shift-emoji{width:15px!important;height:15px!important;flex-basis:15px!important;border-radius:5px!important;font-size:.59rem!important;}
  .shift-pill.shift-mine .shift-emoji{font-size:.61rem!important;}
  .confirm-task-modal{width:min(calc(100% - 20px),350px)!important;}
}


/* V11 — tacche prodotti: il colore pieno deve prevalere sulle regole precedenti. */
.product-card-v10 .stock-segment.filled{
  background:var(--stock)!important;
  opacity:1!important;
  box-shadow:none!important;
}

/* --- V12: nomi senza puntini, assenza aderente al bordo, tacche nette --- */
/* Nei turni il nome viene tagliato di netto: niente ellissi che mangiano lettere. */
.shift-pill .shift-name,
.shift-pill > div,
.shift-pill .done-meta,
.turn-head-name,
.user-badge-name{
  text-overflow:clip!important;
}
.shift-pill{gap:2px!important;padding-left:2px!important;padding-right:2px!important;}
.shift-pill .shift-emoji{
  width:16px!important;
  height:16px!important;
  flex-basis:16px!important;
}

/* L'assenza usa direttamente lo stesso angolo della cella del calendario. */
.absence-corner{display:none!important;}
.cal-day.has-absence::after{
  content:"";
  position:absolute;
  top:-1px;
  right:-1px;
  width:16px;
  height:16px;
  box-sizing:border-box;
  border-top:2px solid #edd47d;
  border-right:2px solid #edd47d;
  border-top-right-radius:11px;
  pointer-events:none;
  z-index:7;
}

/* Le tre tacche sono l'unico indicatore di scorta e il colore è sempre visibile. */
.product-card-v10 .product-stock{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
.product-card-v10 .stock-segment{
  opacity:1!important;
  background:#e9e3dc!important;
  box-shadow:none!important;
}

@media (max-width:380px){
  .shift-pill .shift-emoji{width:15px!important;height:15px!important;flex-basis:15px!important;}
  .cal-day.has-absence::after{width:15px;height:15px;border-top-right-radius:11px;}
}
/* Usa la geometria della cella stessa: il tratto giallo coincide con la stondatura del riquadro. */
.cal-day.has-absence::after{
  inset:-1px!important;
  width:auto!important;
  height:auto!important;
  border:2px solid #edd47d!important;
  border-radius:11px!important;
  clip-path:polygon(calc(100% - 18px) 0,100% 0,100% 18px,calc(100% - 3px) 18px,calc(100% - 3px) 3px,calc(100% - 18px) 3px)!important;
}


/* --- V13: tre stati reali prodotti + assenza continua --- */
.product-card-v10 .product-stock{--stock-color:#84a9c8;}
.product-card-v10 .stock-segment{
  background-color:#e8e3dc!important;
  opacity:.72!important;
}
.product-card-v10 .stock-segment.filled{
  background-color:var(--stock-color)!important;
  opacity:1!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.18)!important;
}
/* Un solo tratto continuo, raccordato allo stesso angolo della cella; le estremità sfumano. */
.cal-day.has-absence::after{
  content:""!important;
  position:absolute!important;
  inset:auto!important;
  top:-1px!important;
  right:-1px!important;
  width:18px!important;
  height:18px!important;
  box-sizing:border-box!important;
  border:0!important;
  border-top:2px solid #efd77f!important;
  border-right:2px solid #efd77f!important;
  border-top-right-radius:11px!important;
  clip-path:none!important;
  opacity:.96!important;
  pointer-events:none!important;
  z-index:7!important;
  -webkit-mask-image:radial-gradient(circle at 100% 0%,#000 0 43%,rgba(0,0,0,.92) 60%,rgba(0,0,0,.35) 79%,transparent 100%)!important;
  mask-image:radial-gradient(circle at 100% 0%,#000 0 43%,rgba(0,0,0,.92) 60%,rgba(0,0,0,.35) 79%,transparent 100%)!important;
}
@media (max-width:380px){.cal-day.has-absence::after{width:17px!important;height:17px!important;}}

/* --- V14: tre stati visivi, assenza puntuale, tema scuro e calendario a elenco --- */
/* Scorte: 3=Pieno, 2=Quasi finito, 1=Finito. La tacca residua di Finito è rossa. */
.product-card-v10 .product-stock{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:3px!important;
}
.product-card-v10 .stock-segment{
  height:4px!important;
  background:#e9e3dc!important;
  opacity:.58!important;
  box-shadow:none!important;
}
.product-card-v10 .stock-segment.filled{
  background:var(--stock-color)!important;
  opacity:1!important;
  box-shadow:none!important;
}
.product-card.product-half{border:1.5px solid #d6b274!important;}
.product-card.product-empty{border:2px solid #cf6a64!important;}

/* Assenza: un semplice punto nell'angolo, senza interferire con la stondatura della cella. */
.cal-day.has-absence::after{
  content:""!important;
  position:absolute!important;
  inset:auto!important;
  top:4px!important;
  right:4px!important;
  width:7px!important;
  height:7px!important;
  border:0!important;
  border-radius:50%!important;
  background:#efd36f!important;
  box-shadow:0 0 0 1.5px rgba(255,255,255,.82)!important;
  opacity:1!important;
  -webkit-mask-image:none!important;
  mask-image:none!important;
  clip-path:none!important;
  pointer-events:none!important;
  z-index:8!important;
}

/* Nel dettaglio giornata l'assegnatario usa una label coerente con il calendario. */
.detail-user-pill{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  max-width:150px;
  padding:5px 9px;
  border-radius:8px;
  font-size:.66rem;
  font-weight:900;
  line-height:1;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:clip;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.18);
}
.detail-user-pill.other{box-shadow:inset 0 0 0 1px rgba(90,80,70,.06);}
.detail-absence-label{color:#9a7561;font-size:.62rem;font-weight:850;}
.detail-value-stack{align-items:flex-end!important;}
.detail-done{margin-top:4px!important;}

/* L'utente loggato usa testo bianco nelle label del calendario. */
.shift-pill.shift-mine,.shift-pill.shift-mine .shift-name,.shift-pill.shift-mine .done-meta{color:#fff!important;}

/* Alert quasi-finito: più tenue e transitorio (rimosso via JS dopo 2s). */
.home-product-attention.low-stock{
  border-color:#eadfbe;
  background:#fffbef;
  color:#75663f;
}
.home-product-attention.low-stock>small{color:#9b8852;}

/* Vista calendario a elenco, attivabile nelle impostazioni. */
.calendar-grid.calendar-list{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:6px!important;
}
.calendar-grid.calendar-list .cal-day{
  min-height:68px!important;
  display:grid!important;
  grid-template-columns:48px minmax(0,1fr)!important;
  grid-auto-rows:min-content!important;
  column-gap:8px!important;
  row-gap:3px!important;
  padding:7px 8px!important;
  text-align:left!important;
  overflow:hidden!important;
}
.calendar-grid.calendar-list .cal-head{
  grid-column:1!important;
  grid-row:1 / span 8!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:flex-start!important;
  gap:2px!important;
  margin:0!important;
  padding-top:1px!important;
}
.calendar-grid.calendar-list .cal-dayname{font-size:.56rem!important;}
.calendar-grid.calendar-list .cal-date{font-size:1.04rem!important;line-height:1!important;}
.calendar-grid.calendar-list .cal-day > :not(.cal-head){grid-column:2!important;}
.calendar-grid.calendar-list .shift-pill{margin-top:0!important;max-width:100%!important;}
.calendar-grid.calendar-list .bin-plan{margin-top:1px!important;}
.calendar-grid.calendar-list .day-note-marker{position:absolute!important;left:30px!important;bottom:6px!important;}

/* Tema scuro personale. */
body.dark-mode{
  --bg:#17191c;
  --card:#22252a;
  --card-2:#292d32;
  --text:#f1eee9;
  --muted:#aaa49c;
  --line:#3a3e45;
  --primary:#91a8c0;
  --primary-soft:#2a333d;
  --danger:#d2736d;
  --danger-soft:#452d2d;
  --shadow:0 4px 14px rgba(0,0,0,.22);
  background:var(--bg);
  color:var(--text);
}
body.dark-mode .home-zone-bins,
body.dark-mode .home-zone-turns{background:#202328!important;}
body.dark-mode .home-zone-history{background:transparent!important;}
body.dark-mode .bin-card,
body.dark-mode .cal-day,
body.dark-mode .summary-card,
body.dark-mode .history-item,
body.dark-mode .empty-state,
body.dark-mode .modal-sheet,
body.dark-mode .confirm-task-modal,
body.dark-mode .user-menu,
body.dark-mode .extra-expense-card{background:#22252a!important;border-color:#393d43!important;color:var(--text)!important;}
body.dark-mode .product-card.product-card-v10{background:#22252a!important;border-color:#393d43!important;color:var(--text)!important;}
body.dark-mode .product-card.product-half{border-color:#8d7449!important;}
body.dark-mode .product-card.product-empty{border-color:#a85753!important;}
body.dark-mode .product-icon-box,
body.dark-mode .product-note-preview,
body.dark-mode .product-note-btn.has-note,
body.dark-mode .stat,
body.dark-mode .person-row,
body.dark-mode .detail-card,
body.dark-mode .day-notes-card,
body.dark-mode .note-item,
body.dark-mode .rollover-menu-toggle,
body.dark-mode .task-btn-kitchen,
body.dark-mode .task-btn-bath,
body.dark-mode .confirm-task-visual,
body.dark-mode .confirm-cancel,
body.dark-mode .user-menu-close,
body.dark-mode .section-icon-action,
body.dark-mode .product-icon-action,
body.dark-mode .choice-btn{background:#2b2e34!important;border-color:#3d4148!important;color:#e9e5df!important;}
body.dark-mode .rollover-menu-toggle.active{background:#25332b!important;border-color:#355040!important;color:#cfe5d5!important;}
body.dark-mode .segmented{background:#292c31!important;}
body.dark-mode .segment.active{background:#393d43!important;color:#fff!important;box-shadow:none!important;}
body.dark-mode .month-arrow{background:#2b2f34!important;color:#ddd8d1!important;box-shadow:inset 0 0 0 1px #3c4148!important;}
body.dark-mode .bottom-nav{background:rgba(28,31,35,.97)!important;border-color:#393d43!important;}
body.dark-mode .user-badge{background:#292d32!important;border-color:#3c4148!important;color:#e9e5df!important;}
body.dark-mode .user-menu-section,
body.dark-mode .user-menu-row{border-color:#383c42!important;}
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode .money-input,
body.dark-mode .extra-money{background:#1d2024!important;border-color:#40454c!important;color:#f3efe9!important;}
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder{color:#777c82!important;}
body.dark-mode .level-bar,
body.dark-mode .product-card-v10 .stock-segment{background:#3a3d42!important;}
body.dark-mode .status-empty{background:#34383d!important;color:#c3c7ca!important;}
body.dark-mode .status-mid{background:#493f2d!important;color:#e6c98b!important;}
body.dark-mode .status-full{background:#4a3030!important;color:#efaaa5!important;}
body.dark-mode .bin-plan{border-color:#40444a!important;}
body.dark-mode .home-product-attention{background:#322829!important;border-color:#543a3a!important;color:#e2c4c0!important;}
body.dark-mode .home-product-attention.low-stock{background:#332f24!important;border-color:#514831!important;color:#e4d19b!important;}
body.dark-mode .home-product-attention.low-stock>small{color:#bda86e!important;}
body.dark-mode .modal-overlay{background:rgba(0,0,0,.55)!important;}
body.dark-mode .confirm-check{border-color:#22252a!important;}
body.dark-mode .sheet-handle{background:#4c5057!important;}
body.dark-mode .detail-absence-label{color:#d5a989!important;}

@media (max-width:380px){
  .cal-day.has-absence::after{top:3px!important;right:3px!important;width:6px!important;height:6px!important;}
  .calendar-grid.calendar-list .cal-day{grid-template-columns:44px minmax(0,1fr)!important;padding:6px 7px!important;}
}


/* --- V15: assenza accanto alla data, scorte visibili in dark, lista compatta --- */
/* Il pallino d'assenza non è più sovrapposto alla cella: vive accanto al numero. */
.cal-day.has-absence::after{display:none!important;content:none!important;}
.cal-date-wrap{
  display:inline-flex;
  align-items:center;
  justify-content:flex-end;
  gap:4px;
  min-width:0;
  flex:0 0 auto;
}
.absence-date-dot{
  width:6px;
  height:6px;
  flex:0 0 6px;
  border-radius:50%;
  background:#efd36f;
  box-shadow:0 0 0 1px rgba(255,255,255,.72);
}

/* In modalità scura le tacche attive devono prevalere sul fondo delle tacche vuote. */
body.dark-mode .product-card-v10 .stock-segment.filled{
  background:var(--stock-color)!important;
  opacity:1!important;
}
body.dark-mode .product-card.product-empty .stock-segment.filled{
  background:#dc6b64!important;
}

/* Lista calendario più stretta e con label solo larghe quanto il contenuto. */
.calendar-grid.calendar-list{
  width:min(92%,360px)!important;
  max-width:360px!important;
  margin-left:auto!important;
  margin-right:auto!important;
  gap:6px!important;
}
.calendar-grid.calendar-list .cal-day{
  width:100%!important;
  grid-template-columns:50px minmax(0,1fr)!important;
  padding:8px 9px!important;
  min-height:64px!important;
}
.calendar-grid.calendar-list .cal-day > :not(.cal-head){
  justify-self:start!important;
  width:auto!important;
  max-width:100%!important;
}
.calendar-grid.calendar-list .shift-pill{
  display:inline-flex!important;
  width:max-content!important;
  max-width:100%!important;
  justify-self:start!important;
  padding:5px 7px!important;
  gap:4px!important;
  font-size:.62rem!important;
}
.calendar-grid.calendar-list .shift-pill .shift-name,
.calendar-grid.calendar-list .shift-pill > div{
  width:auto!important;
  max-width:180px!important;
  font-size:.64rem!important;
}
.calendar-grid.calendar-list .shift-pill .done-meta{font-size:.46rem!important;}
.calendar-grid.calendar-list .shift-pill .shift-emoji{
  width:18px!important;
  height:18px!important;
  flex-basis:18px!important;
  font-size:.66rem!important;
}
.calendar-grid.calendar-list .bin-plan{
  display:inline-block!important;
  width:max-content!important;
  max-width:100%!important;
}
.calendar-grid.calendar-list .cal-date-wrap{
  justify-content:flex-start!important;
  gap:4px!important;
}
@media (max-width:380px){
  .calendar-grid.calendar-list{width:min(94%,330px)!important;max-width:330px!important;}
  .calendar-grid.calendar-list .cal-day{grid-template-columns:46px minmax(0,1fr)!important;padding:7px 8px!important;}
  .calendar-grid.calendar-list .shift-pill .shift-name,
  .calendar-grid.calendar-list .shift-pill > div{max-width:155px!important;font-size:.61rem!important;}
}

/* --- V16: lista orizzontale, utente corrente più pieno, alert centrale persistente --- */
.section-head-home{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr) auto!important;
  align-items:center!important;
  column-gap:8px!important;
}
.section-head-home .home-alerts{
  justify-self:center!important;
  align-self:center!important;
  margin:0!important;
  min-width:0!important;
  max-width:100%!important;
}
.section-head-home .home-product-attention{
  max-width:100%!important;
  min-height:25px!important;
  padding:3px 7px!important;
  gap:4px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
}
.section-head-home .home-product-attention small{
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  max-width:120px!important;
}
.section-head-home .user-badge{justify-self:end!important;}

/* Nel calendario normale il wrapper non cambia il layout già esistente. */
.cal-day-items{display:contents;}

/* In elenco i turni stanno affiancati, non uno sotto l'altro. */
.calendar-grid.calendar-list .cal-day{
  grid-template-columns:48px minmax(0,1fr)!important;
  align-items:center!important;
}
.calendar-grid.calendar-list .cal-day-items{
  grid-column:2!important;
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:5px!important;
  width:auto!important;
  min-width:0!important;
  overflow-x:auto!important;
  scrollbar-width:none!important;
}
.calendar-grid.calendar-list .cal-day-items::-webkit-scrollbar{display:none!important;}
.calendar-grid.calendar-list .cal-day-items .shift-pill,
.calendar-grid.calendar-list .cal-day-items .bin-plan{
  flex:0 0 auto!important;
  margin:0!important;
  width:max-content!important;
  max-width:none!important;
}
.calendar-grid.calendar-list .shift-pill .shift-name,
.calendar-grid.calendar-list .shift-pill > div{
  max-width:none!important;
}

/* Il turno dell'utente loggato deve restare nettamente più pieno degli altri. */
.shift-pill.shift-mine{
  filter:none!important;
  opacity:1!important;
  color:#fff!important;
  box-shadow:inset 0 0 0 1px rgba(65,55,48,.12)!important,0 2px 5px rgba(54,46,39,.05)!important;
}
.shift-pill.shift-mine .shift-name,
.shift-pill.shift-mine .done-meta{color:#fff!important;opacity:1!important;}

@media (max-width:380px){
  .section-head-home{column-gap:5px!important;}
  .section-head-home .home-product-attention{padding:3px 5px!important;}
  .section-head-home .home-product-attention small{max-width:78px!important;font-size:.45rem!important;}
  .section-head-home .home-product-attention>span{font-size:.66rem!important;}
  .calendar-grid.calendar-list .cal-day{grid-template-columns:44px minmax(0,1fr)!important;}
}

/* --- V17: header utente stabile, alert più leggibile, elenco compatto --- */
.section-head-home{
  grid-template-columns:max-content minmax(0,1fr) max-content!important;
  column-gap:7px!important;
}
.section-head-home .home-alerts{
  width:100%!important;
  max-width:min(38vw,150px)!important;
  justify-self:center!important;
  overflow:hidden!important;
}
.section-head-home .home-product-attention{
  width:max-content!important;
  max-width:100%!important;
  min-height:30px!important;
  padding:5px 9px!important;
  gap:5px!important;
  border-radius:999px!important;
}
.section-head-home .home-product-attention>span{
  font-size:.82rem!important;
}
.section-head-home .home-product-attention small{
  max-width:105px!important;
  font-size:.57rem!important;
  font-weight:900!important;
  line-height:1!important;
}
.section-head-home .home-product-attention>i{
  font-size:.82rem!important;
}
.section-head-home .user-badge{
  justify-self:end!important;
  width:max-content!important;
  min-width:86px!important;
  max-width:132px!important;
  flex-shrink:0!important;
}
.section-head-home .user-badge-name{
  display:block!important;
  min-width:0!important;
  max-width:94px!important;
  overflow:hidden!important;
  text-overflow:clip!important;
  white-space:nowrap!important;
}

/* Vista elenco: righe più sottili, turni compatti a destra, spazzatura sotto. */
.calendar-grid.calendar-list{
  width:min(92%,320px)!important;
  max-width:320px!important;
  gap:3px!important;
}
.calendar-grid.calendar-list .cal-day{
  min-height:0!important;
  grid-template-columns:40px minmax(0,1fr)!important;
  grid-template-rows:auto auto!important;
  align-items:center!important;
  column-gap:5px!important;
  row-gap:1px!important;
  padding:3px 5px!important;
  border-radius:9px!important;
}
.calendar-grid.calendar-list .cal-head{
  grid-column:1!important;
  grid-row:1 / span 2!important;
  align-self:center!important;
  margin:0!important;
  min-width:0!important;
}
.calendar-grid.calendar-list .cal-dayname{font-size:.48rem!important;}
.calendar-grid.calendar-list .cal-date{font-size:.92rem!important;}
.calendar-grid.calendar-list .cal-day-items{
  grid-column:2!important;
  grid-row:1 / span 2!important;
  display:flex!important;
  flex-flow:row wrap!important;
  align-items:center!important;
  justify-content:flex-end!important;
  align-content:center!important;
  gap:3px!important;
  width:100%!important;
  min-width:0!important;
  overflow:visible!important;
}
.calendar-grid.calendar-list .cal-day-items .shift-pill{
  flex:0 0 auto!important;
  width:max-content!important;
  max-width:120px!important;
  min-height:16px!important;
  margin:0!important;
  padding:2px 3px!important;
  gap:2px!important;
  border-radius:5px!important;
}
.calendar-grid.calendar-list .shift-pill .shift-name,
.calendar-grid.calendar-list .shift-pill>div{
  width:auto!important;
  max-width:88px!important;
  font-size:.54rem!important;
  line-height:1!important;
}
.calendar-grid.calendar-list .shift-pill .shift-emoji{
  font-size:.43rem!important;
  width:13px!important;
  height:13px!important;
  border-radius:4px!important;
}
.calendar-grid.calendar-list .shift-pill .done-meta{
  font-size:.40rem!important;
  margin-top:0!important;
}
.calendar-grid.calendar-list .cal-day-items .bin-plan{
  order:50!important;
  flex:0 0 100%!important;
  width:100%!important;
  max-width:100%!important;
  margin:1px 0 0!important;
  padding:2px 0 0!important;
  border-top:1px dashed var(--line)!important;
  text-align:right!important;
  font-size:.42rem!important;
  line-height:1!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:clip!important;
}
.calendar-grid.calendar-list .day-note-marker{
  left:4px!important;
  bottom:2px!important;
  font-size:.52rem!important;
}

@media (max-width:380px){
  .section-head-home{column-gap:5px!important;}
  .section-head-home .home-alerts{max-width:118px!important;}
  .section-head-home .home-product-attention{min-height:28px!important;padding:4px 7px!important;}
  .section-head-home .home-product-attention small{max-width:82px!important;font-size:.53rem!important;}
  .section-head-home .home-product-attention>span{font-size:.76rem!important;}
  .section-head-home .user-badge{min-width:82px!important;max-width:116px!important;padding-inline:7px!important;}
  .section-head-home .user-badge-name{max-width:79px!important;}
  .calendar-grid.calendar-list{width:min(94%,306px)!important;max-width:306px!important;}
  .calendar-grid.calendar-list .cal-day{grid-template-columns:38px minmax(0,1fr)!important;padding:3px 4px!important;}
  .calendar-grid.calendar-list .shift-pill .shift-name,
  .calendar-grid.calendar-list .shift-pill>div{max-width:76px!important;font-size:.52rem!important;}
}

/* --- V18: alert soft ma più leggibili; lista ordinata e bidoni puliti --- */
/* Wrapper trasparente nel calendario a box. */
.cal-turn-row{display:contents;}

/* Finito: rosso soft più riconoscibile. Quasi finito: giallo soft. */
.section-head-home .home-product-attention:not(.low-stock){
  background:#fff0ef!important;
  border-color:#efc5c2!important;
  color:#8a4b47!important;
}
.section-head-home .home-product-attention:not(.low-stock) small{color:#9a5651!important;}
.section-head-home .home-product-attention:not(.low-stock)>i{color:#b56a65!important;}
.section-head-home .home-product-attention.low-stock{
  background:#fff8df!important;
  border-color:#ead58c!important;
  color:#74602b!important;
}
.section-head-home .home-product-attention.low-stock small{color:#8d752f!important;}
.section-head-home .home-product-attention.low-stock>i{color:#a28737!important;}
body.dark-mode .section-head-home .home-product-attention:not(.low-stock){
  background:#3c2929!important;border-color:#704545!important;color:#f0c1bd!important;
}
body.dark-mode .section-head-home .home-product-attention.low-stock{
  background:#3b3524!important;border-color:#6a5d35!important;color:#ead999!important;
}

/* Vista elenco V18: più aria verticale, label leggibili e tutte a destra. */
.calendar-grid.calendar-list{
  width:min(94%,350px)!important;
  max-width:350px!important;
  gap:5px!important;
}
.calendar-grid.calendar-list .cal-day{
  grid-template-columns:45px minmax(0,1fr)!important;
  grid-template-rows:auto!important;
  min-height:52px!important;
  padding:6px 8px!important;
  column-gap:7px!important;
  row-gap:0!important;
  border-radius:10px!important;
}
.calendar-grid.calendar-list .cal-head{
  grid-column:1!important;
  grid-row:1!important;
  align-self:center!important;
}
.calendar-grid.calendar-list .cal-dayname{font-size:.52rem!important;}
.calendar-grid.calendar-list .cal-date{font-size:1rem!important;}
.calendar-grid.calendar-list .cal-day-items{
  grid-column:2!important;
  grid-row:1!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:auto auto!important;
  justify-items:end!important;
  align-content:center!important;
  gap:3px!important;
  width:100%!important;
  min-width:0!important;
  overflow:visible!important;
}
.calendar-grid.calendar-list .cal-turn-row{
  display:flex!important;
  flex-flow:row nowrap!important;
  justify-content:flex-end!important;
  align-items:center!important;
  gap:4px!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow-x:auto!important;
  scrollbar-width:none!important;
}
.calendar-grid.calendar-list .cal-turn-row::-webkit-scrollbar{display:none!important;}
.calendar-grid.calendar-list .cal-turn-row .shift-pill{
  flex:0 0 auto!important;
  width:max-content!important;
  max-width:128px!important;
  min-height:19px!important;
  margin:0!important;
  padding:3px 5px!important;
  gap:3px!important;
  border-radius:6px!important;
}
.calendar-grid.calendar-list .shift-pill .shift-name,
.calendar-grid.calendar-list .shift-pill>div{
  width:auto!important;
  max-width:94px!important;
  font-size:.59rem!important;
  line-height:1.05!important;
}
.calendar-grid.calendar-list .shift-pill .shift-emoji{
  width:15px!important;
  height:15px!important;
  flex-basis:15px!important;
  font-size:.50rem!important;
  border-radius:4px!important;
}
.calendar-grid.calendar-list .shift-pill .done-meta{font-size:.43rem!important;}

/* Bidoni previsti: niente linea tratteggiata; piccolo chip secondario a destra. */
.calendar-grid.calendar-list .bin-plan{
  order:initial!important;
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:none!important;
  text-align:right!important;
  font-size:inherit!important;
  line-height:1!important;
  overflow:visible!important;
}
.calendar-grid.calendar-list .bin-plan-chip{
  display:inline-flex!important;
  align-items:center!important;
  gap:4px!important;
  width:max-content!important;
  max-width:100%!important;
  padding:2px 6px!important;
  border-radius:999px!important;
  background:rgba(154,126,96,.09)!important;
  color:#766657!important;
  font-size:.48rem!important;
  font-weight:800!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:clip!important;
}
.calendar-grid.calendar-list .bin-plan-icon{font-size:.52rem!important;line-height:1!important;}
body.dark-mode .calendar-grid.calendar-list .bin-plan-chip{
  background:rgba(255,255,255,.07)!important;
  color:#cfc6bc!important;
}

@media (max-width:380px){
  .calendar-grid.calendar-list{width:min(95%,338px)!important;max-width:338px!important;}
  .calendar-grid.calendar-list .cal-day{grid-template-columns:43px minmax(0,1fr)!important;min-height:50px!important;padding:5px 7px!important;}
  .calendar-grid.calendar-list .cal-turn-row .shift-pill{max-width:116px!important;padding:3px 4px!important;}
  .calendar-grid.calendar-list .shift-pill .shift-name,
  .calendar-grid.calendar-list .shift-pill>div{max-width:84px!important;font-size:.57rem!important;}
  .calendar-grid.calendar-list .bin-plan-chip{font-size:.46rem!important;padding:2px 5px!important;}
}

/* --- V19: elenco realmente allineato a destra + dark mode rifinita --- */
/* In elenco il blocco turni ha la larghezza del proprio contenuto ed è ancorato al bordo destro. */
.calendar-grid.calendar-list{
  width:min(94%,360px)!important;
  max-width:360px!important;
  gap:5px!important;
}
.calendar-grid.calendar-list .cal-day{
  grid-template-columns:46px minmax(0,1fr)!important;
  min-height:55px!important;
  padding:6px 8px!important;
  column-gap:8px!important;
}
.calendar-grid.calendar-list .cal-day-items{
  grid-column:2!important;
  grid-row:1!important;
  justify-self:stretch!important;
  align-self:center!important;
  width:100%!important;
  max-width:100%!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-end!important;
  justify-content:center!important;
  gap:3px!important;
  overflow:visible!important;
}
.calendar-grid.calendar-list .cal-turn-row{
  display:flex!important;
  flex-flow:row nowrap!important;
  align-items:center!important;
  justify-content:flex-end!important;
  align-self:flex-end!important;
  width:max-content!important;
  max-width:100%!important;
  min-width:0!important;
  margin-left:auto!important;
  gap:4px!important;
  overflow-x:auto!important;
  scrollbar-width:none!important;
}
.calendar-grid.calendar-list .cal-turn-row::-webkit-scrollbar{display:none!important;}
.calendar-grid.calendar-list .cal-turn-row .shift-pill{
  flex:0 0 auto!important;
  width:max-content!important;
  max-width:132px!important;
  min-height:20px!important;
  margin:0!important;
  padding:3px 6px!important;
  gap:3px!important;
  border-radius:6px!important;
}
.calendar-grid.calendar-list .shift-pill .shift-name,
.calendar-grid.calendar-list .shift-pill>div{
  width:auto!important;
  max-width:98px!important;
  font-size:.62rem!important;
  line-height:1.05!important;
}
.calendar-grid.calendar-list .shift-pill .shift-emoji{
  width:16px!important;
  height:16px!important;
  flex:0 0 16px!important;
  font-size:.54rem!important;
  border-radius:4px!important;
}
.calendar-grid.calendar-list .shift-pill .done-meta{font-size:.45rem!important;}

/* Bidoni in elenco: semplice riga informativa, senza pill/box. */
.calendar-grid.calendar-list .bin-plan{
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  align-self:flex-end!important;
  width:max-content!important;
  max-width:100%!important;
  margin:1px 0 0 auto!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  color:#92755f!important;
  overflow:hidden!important;
  line-height:1!important;
}
.calendar-grid.calendar-list .bin-plan-chip{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:4px!important;
  width:max-content!important;
  max-width:100%!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:inherit!important;
  font-size:.47rem!important;
  font-weight:800!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:clip!important;
}
.calendar-grid.calendar-list .bin-plan-icon{
  width:15px!important;
  height:15px!important;
  display:inline-grid!important;
  place-items:center!important;
  flex:0 0 15px!important;
  border-radius:50%!important;
  background:#f1e5d8!important;
  font-size:.50rem!important;
  line-height:1!important;
}

/* Dark mode: neutro antracite con meno marroni e contrasti più coerenti. */
body.dark-mode{
  --bg:#17191d!important;
  --card:#23262b!important;
  --card-2:#2b2f35!important;
  --text:#f1eee9!important;
  --muted:#aaa59e!important;
  --line:#3b4047!important;
  --primary:#93abc2!important;
  --primary-soft:#293744!important;
  --danger:#d77a74!important;
  --danger-soft:#4a3030!important;
  --shadow:0 4px 14px rgba(0,0,0,.24)!important;
  background:#17191d!important;
}
body.dark-mode .home-zone-bins,
body.dark-mode .home-zone-turns{
  background:#1f2227!important;
}
body.dark-mode .bin-card,
body.dark-mode .cal-day,
body.dark-mode .summary-card,
body.dark-mode .history-item,
body.dark-mode .empty-state,
body.dark-mode .product-card.product-card-v10{
  background:#24272c!important;
  border-color:#3a3f46!important;
}
body.dark-mode .cal-day.today{
  outline-color:#72a2df!important;
  border-color:#557ba9!important;
  box-shadow:0 0 0 2px rgba(87,137,200,.13),var(--shadow)!important;
}
body.dark-mode .segmented{
  background:#282c32!important;
}
body.dark-mode .segment{
  color:#aaa69f!important;
}
body.dark-mode .segment.active{
  background:#373c43!important;
  color:#fff!important;
  box-shadow:0 2px 7px rgba(0,0,0,.16)!important;
}
body.dark-mode .month-controls{
  background:#23272c!important;
  box-shadow:inset 0 0 0 1px #353a41!important;
}
body.dark-mode .month-controls strong{
  background:#30343a!important;
  color:#f0ece6!important;
  box-shadow:none!important;
}
body.dark-mode .month-arrow{
  background:transparent!important;
  color:#d6d1ca!important;
  box-shadow:none!important;
}
body.dark-mode .month-arrow:hover{background:#30343a!important;}
body.dark-mode .task-btn-kitchen,
body.dark-mode .task-btn-bath{
  background:#282c31!important;
  border-color:#3a3f46!important;
  color:#e7e3dc!important;
}
body.dark-mode .task-btn-kitchen small,
body.dark-mode .task-btn-bath small{color:#99958e!important;}
body.dark-mode .product-icon-box,
body.dark-mode .product-note-preview,
body.dark-mode .product-note-btn.has-note,
body.dark-mode .product-icon-action,
body.dark-mode .section-icon-action{
  background:#2c3036!important;
  border-color:#41464e!important;
  color:#e5e1da!important;
}
body.dark-mode .product-icon-action.buy{
  background:#29343a!important;
  border-color:#3d4b52!important;
}
body.dark-mode .day-note-toggle,
body.dark-mode .day-notes-panel,
body.dark-mode .note-item,
body.dark-mode .product-config-row,
body.dark-mode .detail-card,
body.dark-mode .choice-btn,
body.dark-mode .stat,
body.dark-mode .person-row{
  background:#2a2e34!important;
  border-color:#3c4148!important;
  color:#e9e5df!important;
}
body.dark-mode .detail-row{border-color:#3b4047!important;}
body.dark-mode .note-remove{
  background:#34383f!important;
  color:#c8c3bc!important;
}
body.dark-mode .user-menu,
body.dark-mode .modal-sheet,
body.dark-mode .confirm-task-modal,
body.dark-mode .extra-expense-card{
  background:#22252a!important;
  border-color:#3a3f46!important;
}
body.dark-mode .rollover-menu-toggle{
  background:#2a2e34!important;
  border-color:#3d4249!important;
  color:#e7e3dc!important;
}
body.dark-mode .rollover-menu-toggle.active{
  background:#27352d!important;
  border-color:#3a5543!important;
  color:#d5ead9!important;
}
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode .money-input,
body.dark-mode .extra-money{
  background:#1b1e22!important;
  border-color:#41464e!important;
  color:#f2eee8!important;
}
body.dark-mode .bottom-nav{
  background:rgba(27,30,34,.97)!important;
  border-color:#393e45!important;
}
body.dark-mode .nav-item.active{
  background:#293744!important;
  color:#a8bfd4!important;
}
body.dark-mode .user-badge{
  background:#2a2e34!important;
  border-color:#40454d!important;
  color:#ece8e2!important;
}
body.dark-mode .absence-date-dot{
  background:#f0cb62!important;
  box-shadow:0 0 0 1px rgba(22,24,28,.8)!important;
}
body.dark-mode .calendar-grid.calendar-list .bin-plan{
  color:#ba9b80!important;
}
body.dark-mode .calendar-grid.calendar-list .bin-plan-chip{
  background:transparent!important;
  color:inherit!important;
}
body.dark-mode .calendar-grid.calendar-list .bin-plan-icon{
  background:#3b332c!important;
}
body.dark-mode .home-product-attention:not(.low-stock){
  background:#402a2b!important;
  border-color:#724547!important;
  color:#f0c0bd!important;
}
body.dark-mode .home-product-attention.low-stock{
  background:#3b3525!important;
  border-color:#675b35!important;
  color:#ead89c!important;
}

@media (max-width:380px){
  .calendar-grid.calendar-list{width:min(95%,344px)!important;max-width:344px!important;}
  .calendar-grid.calendar-list .cal-day{grid-template-columns:43px minmax(0,1fr)!important;min-height:53px!important;padding:5px 7px!important;}
  .calendar-grid.calendar-list .cal-turn-row .shift-pill{max-width:122px!important;padding:3px 5px!important;}
  .calendar-grid.calendar-list .shift-pill .shift-name,
  .calendar-grid.calendar-list .shift-pill>div{max-width:90px!important;font-size:.60rem!important;}
  .calendar-grid.calendar-list .bin-plan-chip{font-size:.45rem!important;}
}

/* --- V20: lista con turni realmente a destra, bidoni separati, colori più distinti --- */
/* Il marcatore compatto dei bidoni è usato solo nella vista elenco. */
.bin-plan-listmark{display:none;}

.calendar-grid.calendar-list{
  width:min(96%,380px)!important;
  max-width:380px!important;
}
.calendar-grid.calendar-list .cal-day{
  grid-template-columns:46px auto minmax(0,1fr)!important;
  min-height:56px!important;
  padding:6px 8px!important;
  column-gap:7px!important;
}
.calendar-grid.calendar-list .cal-head{
  grid-column:1!important;
  grid-row:1!important;
  align-self:center!important;
}
.calendar-grid.calendar-list .cal-day-items{
  grid-column:3!important;
  grid-row:1!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  justify-self:stretch!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  overflow:hidden!important;
}
.calendar-grid.calendar-list .cal-turn-row{
  display:flex!important;
  flex-flow:row nowrap!important;
  align-items:center!important;
  justify-content:flex-end!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  gap:4px!important;
  overflow:hidden!important;
  text-align:right!important;
}
.calendar-grid.calendar-list .cal-turn-row .shift-pill{
  flex:0 1 auto!important;
  width:auto!important;
  max-width:126px!important;
  min-width:0!important;
  margin:0!important;
  padding:3px 5px!important;
}
.calendar-grid.calendar-list .shift-pill .shift-name,
.calendar-grid.calendar-list .shift-pill>div{
  width:auto!important;
  max-width:94px!important;
  font-size:.62rem!important;
}

/* In elenco il promemoria bidoni vive in una colonna propria, tra data e turni. */
.calendar-grid.calendar-list .bin-plan{
  grid-column:2!important;
  grid-row:1!important;
  align-self:center!important;
  justify-self:start!important;
  display:inline-flex!important;
  width:auto!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  overflow:visible!important;
}
.calendar-grid.calendar-list .bin-plan-chip{display:none!important;}
.calendar-grid.calendar-list .bin-plan-listmark{
  display:inline-flex!important;
  align-items:center!important;
  gap:2px!important;
  height:22px!important;
  padding:0 4px!important;
  border-radius:7px!important;
  background:#fff2df!important;
  border:1px solid #efd7b7!important;
  color:#b9722e!important;
  box-shadow:0 1px 3px rgba(91,62,31,.06)!important;
  white-space:nowrap!important;
}
.calendar-grid.calendar-list .bin-plan-list-icon{
  font-size:.62rem!important;
  line-height:1!important;
}
.calendar-grid.calendar-list .bin-plan-listmark b{
  font-size:.48rem!important;
  line-height:1!important;
  font-weight:950!important;
}

/* Dark: il marcatore bidoni resta distinto ma non acceso. */
body.dark-mode .calendar-grid.calendar-list .bin-plan-listmark{
  background:#3a3025!important;
  border-color:#594631!important;
  color:#e0b17d!important;
  box-shadow:none!important;
}

/* Gli altri coinquilini restano chiari, ma senza perdere l'identità del colore. */
.shift-pill.shift-other{opacity:1!important;filter:none!important;}

@media (max-width:380px){
  .calendar-grid.calendar-list{width:min(96%,360px)!important;max-width:360px!important;}
  .calendar-grid.calendar-list .cal-day{grid-template-columns:43px auto minmax(0,1fr)!important;column-gap:5px!important;padding:5px 6px!important;}
  .calendar-grid.calendar-list .cal-turn-row{gap:3px!important;}
  .calendar-grid.calendar-list .cal-turn-row .shift-pill{max-width:116px!important;padding:3px 4px!important;}
  .calendar-grid.calendar-list .shift-pill .shift-name,
  .calendar-grid.calendar-list .shift-pill>div{max-width:84px!important;font-size:.60rem!important;}
  .calendar-grid.calendar-list .bin-plan-listmark{height:20px!important;padding:0 3px!important;}
}


/* --- V21: vista elenco - turni realmente a destra, secchi di nuovo sotto --- */
/*
 * Le regole precedenti usavano un selettore più specifico con !important
 * (`.cal-day > :not(.cal-head)`), che riportava il contenuto nella seconda
 * colonna. Qui usiamo un selettore ancora più specifico e una struttura a
 * due colonne semplice: data | contenuto.
 */
.calendar-grid.calendar-list{
  width:min(96%,380px)!important;
  max-width:380px!important;
}
.calendar-grid.calendar-list .cal-day{
  grid-template-columns:48px minmax(0,1fr)!important;
  grid-template-rows:auto!important;
  min-height:62px!important;
  padding:7px 9px!important;
  column-gap:8px!important;
  row-gap:0!important;
}
.calendar-grid.calendar-list .cal-day > .cal-head{
  grid-column:1!important;
  grid-row:1!important;
  align-self:center!important;
}
.calendar-grid.calendar-list .cal-day > .cal-day-items{
  grid-column:2!important;
  grid-row:1!important;
  justify-self:stretch!important;
  align-self:center!important;
  width:100%!important;
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-end!important;
  justify-content:center!important;
  gap:4px!important;
  margin:0!important;
  padding:0!important;
  overflow:visible!important;
}
.calendar-grid.calendar-list .cal-day > .cal-day-items > .cal-turn-row{
  display:flex!important;
  flex-flow:row nowrap!important;
  align-items:center!important;
  justify-content:flex-end!important;
  align-self:flex-end!important;
  width:max-content!important;
  max-width:100%!important;
  min-width:0!important;
  margin:0 0 0 auto!important;
  gap:4px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none!important;
  text-align:right!important;
}
.calendar-grid.calendar-list .cal-day > .cal-day-items > .cal-turn-row::-webkit-scrollbar{display:none!important;}
.calendar-grid.calendar-list .cal-day > .cal-day-items > .cal-turn-row > .shift-pill{
  flex:0 0 auto!important;
  width:max-content!important;
  max-width:132px!important;
  min-width:0!important;
  min-height:21px!important;
  margin:0!important;
  padding:3px 6px!important;
  gap:3px!important;
  border-radius:6px!important;
}
.calendar-grid.calendar-list .shift-pill .shift-name,
.calendar-grid.calendar-list .shift-pill>div{
  width:auto!important;
  max-width:98px!important;
  font-size:.63rem!important;
  line-height:1.05!important;
}
.calendar-grid.calendar-list .shift-pill .shift-emoji{
  width:16px!important;
  height:16px!important;
  flex:0 0 16px!important;
  font-size:.54rem!important;
  border-radius:4px!important;
}

/* Ripristino del promemoria secchi sotto alle label, come nella vista originale. */
.calendar-grid.calendar-list .cal-day > .cal-day-items > .bin-plan{
  display:flex!important;
  align-self:flex-end!important;
  justify-content:flex-end!important;
  width:max-content!important;
  max-width:100%!important;
  margin:0 0 0 auto!important;
  padding:3px 0 0!important;
  border:0!important;
  border-top:2px dashed rgba(155,132,108,.28)!important;
  background:transparent!important;
  color:#88786a!important;
  overflow:hidden!important;
}
.calendar-grid.calendar-list .cal-day > .cal-day-items > .bin-plan .bin-plan-listmark{display:none!important;}
.calendar-grid.calendar-list .cal-day > .cal-day-items > .bin-plan .bin-plan-chip{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:4px!important;
  width:max-content!important;
  max-width:100%!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:inherit!important;
  font-size:.49rem!important;
  font-weight:760!important;
  line-height:1.05!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:clip!important;
}
.calendar-grid.calendar-list .cal-day > .cal-day-items > .bin-plan .bin-plan-icon{
  font-size:.55rem!important;
  line-height:1!important;
}
body.dark-mode .calendar-grid.calendar-list .cal-day > .cal-day-items > .bin-plan{
  color:#c8bbae!important;
  border-top-color:rgba(214,198,183,.20)!important;
}

@media (max-width:380px){
  .calendar-grid.calendar-list{width:min(96%,360px)!important;max-width:360px!important;}
  .calendar-grid.calendar-list .cal-day{grid-template-columns:44px minmax(0,1fr)!important;min-height:59px!important;padding:6px 7px!important;column-gap:6px!important;}
  .calendar-grid.calendar-list .cal-day > .cal-day-items > .cal-turn-row{gap:3px!important;}
  .calendar-grid.calendar-list .cal-day > .cal-day-items > .cal-turn-row > .shift-pill{max-width:120px!important;padding:3px 5px!important;}
  .calendar-grid.calendar-list .shift-pill .shift-name,
  .calendar-grid.calendar-list .shift-pill>div{max-width:88px!important;font-size:.61rem!important;}
}

/* --- V22: elenco realmente ancorato a destra + nome utente centrato --- */
/*
 * In V21 il gruppo turni era width:max-content: dentro la cella grid questo
 * poteva rimanere in una posizione intermedia. Qui il wrapper occupa tutta
 * la seconda colonna e il contenuto viene spinto esplicitamente a destra.
 */
.calendar-grid.calendar-list .cal-day > .cal-day-items{
  width:100%!important;
  max-width:100%!important;
  justify-self:stretch!important;
  align-self:center!important;
  align-items:stretch!important;
}
.calendar-grid.calendar-list .cal-day > .cal-day-items > .cal-turn-row{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  display:flex!important;
  flex-flow:row nowrap!important;
  justify-content:flex-end!important;
  align-items:center!important;
  align-self:stretch!important;
  margin:0!important;
  padding:0!important;
  text-align:right!important;
}
.calendar-grid.calendar-list .cal-day > .cal-day-items > .cal-turn-row > .shift-pill:first-child{
  margin-left:auto!important;
}
.calendar-grid.calendar-list .cal-day > .cal-day-items > .bin-plan{
  width:100%!important;
  max-width:100%!important;
  align-self:stretch!important;
  justify-content:flex-end!important;
  margin-left:0!important;
  text-align:right!important;
}
.calendar-grid.calendar-list .cal-day > .cal-day-items > .bin-plan .bin-plan-chip{
  margin-left:auto!important;
}

/* Il nome nel badge deve essere centrato rispetto al bottone, non solo
   verticalmente rispetto a pallino e freccia. */
.user-badge,
.section-head-home .user-badge{
  display:grid!important;
  grid-template-columns:12px minmax(0,1fr) 12px!important;
  align-items:center!important;
  justify-items:center!important;
  column-gap:4px!important;
  min-height:32px!important;
  line-height:1!important;
}
.user-badge-dot{
  justify-self:center!important;
  align-self:center!important;
}
.user-badge-name,
.section-head-home .user-badge-name{
  width:100%!important;
  max-width:none!important;
  justify-self:stretch!important;
  align-self:center!important;
  text-align:center!important;
  line-height:1!important;
}
.user-badge-chevron{
  justify-self:center!important;
  align-self:center!important;
  transform:none!important;
  line-height:1!important;
}

/* V22 hard-fix: in vista elenco il blocco contenuti è fisicamente ancorato
   al margine destro della card. Questo evita qualsiasi interferenza delle
   vecchie regole grid rimaste nel foglio stile. */
.calendar-grid.calendar-list .cal-day{
  position:relative!important;
}
.calendar-grid.calendar-list .cal-day > .cal-day-items{
  position:absolute!important;
  left:62px!important;
  right:10px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  width:auto!important;
  max-width:none!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-end!important;
  justify-content:center!important;
  gap:4px!important;
  overflow:visible!important;
}
.calendar-grid.calendar-list .cal-day > .cal-day-items > .cal-turn-row{
  width:100%!important;
  justify-content:flex-end!important;
}
@media (max-width:380px){
  .calendar-grid.calendar-list .cal-day > .cal-day-items{
    left:55px!important;
    right:8px!important;
  }
}
