/* Turnio – «nuovo design» (mockup 2 approvato, 3/11). Caricato da ogni vista SUBITO DOPO quaderno-theme.css.
   Base comune (agente A): 0 variabili e colori di stato · 1 bottoni · 2 contrasto · 3 tipografia
   4 elenchi sulle righe · 5 stati vuoti a post-it · 6 fogli · 7 tema nella banda · TURNI (computer, telefono, Timeline).
   Gli altri agenti aggiungono le loro sezioni IN FONDO, marcate  / * === <AREA> === * /  (Edit, mai riscrivere il file). */
/* ==========================================================================
   3 + 0. VARIABILI E COLORI DI STATO (Pubblica col colore del locale, avvisi come post-it)
   ========================================================================== */
/* Proposta 3 – colori di stato in variabili; Pubblica = colore del brand
   (mattone nei ristoranti, verde nelle farmacie), il verde "ok" solo per conferme. */
:root {
  --ok-bg:#e8f4ec; --ok-ink:#1f6b43; --warn-bg:#fff4c9; --warn-ink:#7a4a05;
  --err-bg:#fdecea; --err-ink:#9c2b1f; --postit:#f6e08a; --postit-ink:#1c1214;
}
:root[data-theme="dark"] {
  --ok-bg:#1d3326; --ok-ink:#9fd8b3; --warn-bg:#3a321a; --warn-ink:#f3d58a;
  --err-bg:#341819; --err-ink:#f2a49b; --postit:#d9c46e; --postit-ink:#1c1214;
}
html body .toolbar #publish-btn.needs-publish, html body .toolbar #publish-btn.qb-pub-fixed.needs-publish {
  background: var(--brand-700) !important; border: 2px solid var(--zinc-900) !important;
  color: #fff !important; box-shadow: 3px 3px 0 var(--zinc-900) !important;
}
html body .toolbar #publish-btn.qb-pub-fixed.needs-publish::after { border-color: var(--brand-600) !important; }
html body .toolbar #publish-btn.qb-pub-fixed .pub-n { color: var(--brand-700) !important; }
:root[data-theme="dark"] body .toolbar #publish-btn.qb-pub-fixed.needs-publish { background: var(--brand-600) !important; color: var(--zinc-50) !important; border-color: #000 !important; box-shadow: 3px 3px 0 #000 !important; }
:root[data-theme="dark"] body .toolbar #publish-btn.qb-pub-fixed.needs-publish svg { color: var(--zinc-50) !important; }
/* avviso del Report: un post-it, non un banner verde con barretta arancione */
p.notice {
  background: var(--postit) !important; color: var(--postit-ink) !important;
  border: 2px solid var(--zinc-900) !important; border-radius: 4px 12px 4px 12px !important;
  transform: rotate(-.4deg); box-shadow: 3px 3px 0 rgba(28,18,20,.18);
}
p.notice a { color: var(--postit-ink) !important; font-weight: 700; }
:root[data-theme="dark"] p.notice { border-color: #000 !important; }

/* ==========================================================================
   1. BOTTONI: un solo secondario a inchiostro, raggio unico, pressione
   ========================================================================== */
/* Proposta 1 – un solo bottone secondario (bordo a inchiostro), raggio unico.
   Da mettere in quaderno-theme.css. Il bordo beige resta solo per :disabled. */
:root { --qb-radius: 4px 10px 4px 10px; }
html body .qb-home-link, html body .qb-help-btn, html body #qb-assist-btn,
html body .btn-link.wk-arrow, html body .toolbar > a.btn-link, html body button.pg-sort-btn {
  border: 2px solid var(--zinc-900) !important;
  border-radius: var(--qb-radius) !important;
  background: var(--panel) !important;
  color: var(--zinc-900) !important;
  font-weight: 700;
}
/* tocco: il bottone "si preme" sul foglio */
button.secondary:not(#publish-btn), .btn-link.wk-arrow, .toolbar > a.btn-link, .qb-help-btn, .qb-home-link {
  transition: transform .08s ease, box-shadow .08s ease;
  box-shadow: 2px 2px 0 var(--zinc-900) !important;
}
button.secondary:active, .btn-link.wk-arrow:active, .toolbar > a.btn-link:active,
.qb-help-btn:active, .qb-home-link:active { transform: translate(2px,2px); box-shadow: none !important; }
button:disabled { border-color: var(--zinc-300) !important; box-shadow: none !important; color: var(--zinc-500) !important; }

/* ==========================================================================
   2. CONTRASTO WCAG AA
   ========================================================================== */
/* Proposta 2 – contrasto WCAG AA (4,5:1) nei due temi.
   --zinc-400 resta solo per linee e decorazioni, mai per testo. */
html body tr.report-row-zero td { color: var(--zinc-500) !important; }            /* 2,57 -> 5,8 */
.all-clear p, .all-clear { color: var(--zinc-600) !important; }          /* scuro 3,1 -> 7+ */
input::placeholder, textarea::placeholder { color: var(--zinc-500) !important; opacity: 1; }
.shift-chip .draft-tag { color: var(--zinc-600) !important; }
/* giorni scelti nel calendario da telefono: bianco su mattone 3,66 -> 6,2 */
.day-quick-select button.active { background: var(--brand-700) !important; border-color: var(--brand-700) !important; color: #fff !important; }
:root[data-theme="dark"] .day-quick-select button.active { background: var(--brand-600) !important; border-color: var(--brand-600) !important; color: var(--zinc-50) !important; } /* 2,73 -> 6,2 */

/* ==========================================================================
   6. STATI VUOTI COME POST-IT
   ========================================================================== */
/* Proposta 6 – stato "tutto in ordine" come post-it (Attenzione).
   L'icona a raggiera sembrava un caricamento: al suo posto una spunta a mano. */
.all-clear {
  max-width: 21rem; margin: 2.2rem auto !important; padding: 1.3rem 1.2rem 1.1rem !important;
  background: var(--postit, #f6e08a) !important; color: var(--postit-ink, #1c1214) !important;
  border: 2px solid var(--zinc-900); border-radius: 4px 14px 4px 14px;
  transform: rotate(-1.2deg); box-shadow: 4px 4px 0 rgba(28,18,20,.18); text-align: center;
}
:root[data-theme="dark"] .all-clear { border-color: #000; background: #d9c46e !important; }
.all-clear .big { display: none !important; }
.all-clear::before {
  content: ''; display: block; width: 2.6rem; height: 2.6rem; margin: 0 auto .4rem;
  background: no-repeat center/contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c1214' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M4 13.5c2 1.2 3.4 3 4.4 5C11 12 15 7.5 20.5 4.5'/></svg>");
}
.all-clear p { font-family: 'Permanent Marker', cursive; font-size: 1.15rem; color: #1c1214 !important; margin: 0; line-height: 1.35; }
@media (prefers-reduced-motion: no-preference) {
  .all-clear { animation: qb-postit-in .45s cubic-bezier(.22,.85,.32,1) both; }
  @keyframes qb-postit-in { from { opacity: 0; transform: translateY(10px) rotate(-4deg) scale(.96); } to { opacity: 1; transform: rotate(-1.2deg); } }
}

.qb-empty-note { margin: 1.2rem auto; max-width: 20rem; padding: 1rem 1.1rem; text-align: center; background: var(--postit, #f6e08a); color: #1c1214;
  border: 2px solid var(--zinc-900); border-radius: 4px 14px 4px 14px; transform: rotate(-1deg); box-shadow: 4px 4px 0 rgba(28,18,20,.18); font-weight: 700; }
:root[data-theme="dark"] .qb-empty-note { border-color: #000; }

/* ==========================================================================
   7. ELENCHI ALLINEATI ALLE RIGHE DELLA CARTA (Personale)
   ========================================================================== */
/* Mockup 2 – Proposta 7: elenchi allineati alle righe della carta (Personale).
   Passo della carta = 35px (34 + 1 di riga, come il body). Ogni persona occupa 2 righe,
   ogni titolo di gruppo 1 riga; niente tratteggi propri: separa la riga della carta.
   A sinistra il margine rosso del quaderno, per far leggere l'elenco come una pagina scritta. */
:root { --qb-line: 35px; }
/* .qb-paper = elenco con almeno una persona, messa da renderList() in employees.php (prima div:has(> .emp-row)) */
html body div.qb-paper {
  position: relative;
  background-color: var(--zinc-50);
  background-image:
    linear-gradient(90deg, transparent 0 46px, color-mix(in srgb, var(--brand-600) 55%, transparent) 46px 48px, transparent 48px),
    repeating-linear-gradient(transparent 0 calc(var(--qb-line) - 1px), var(--zinc-200) calc(var(--qb-line) - 1px) var(--qb-line));
  padding: 0 !important; margin-top: var(--qb-line) !important;
}
html body div.qb-paper > .emp-group-head {
  height: var(--qb-line) !important; line-height: calc(var(--qb-line) - 4px) !important; margin: 0 !important; padding: 0 0 0 58px !important;
  border: 0 !important; font-family: 'Permanent Marker', cursive !important; font-size: 1.05rem !important;
  letter-spacing: 0 !important; text-transform: none !important; color: var(--brand-700) !important;
}
:root[data-theme="dark"] html body div.qb-paper > .emp-group-head,
:root[data-theme="dark"] body div.qb-paper > .emp-group-head { color: var(--brand-700) !important; }
html body div.qb-paper > .emp-row {
  height: calc(var(--qb-line) * 2) !important; min-height: 0 !important; margin: 0 !important; padding: 0 12px 0 4px !important;
  border: 0 !important; background: transparent !important; transform: none !important; box-shadow: none !important;
  display: flex !important; align-items: center !important; gap: 14px !important;
}
html body div.qb-paper > .emp-row::before { display: none !important; }
html body .emp-row .avatar { align-self: flex-end; margin-bottom: 4px; width: 40px !important; height: 40px !important; min-width: 40px !important; font-size: .95rem !important;
  background: var(--panel) !important; border-width: 2px !important; }
html body .emp-row .emp-info { display: flex !important; align-items: baseline !important; gap: .5rem; align-self: flex-end; padding: 0 0 5px !important; }
html body .emp-row .chevron { align-self: flex-end; padding-bottom: 6px; }
html body .emp-row .name { font-size: 1.1rem !important; font-weight: 700 !important; }
html body .emp-row .meta { font-family: 'Quicksand', sans-serif !important; font-size: .85rem !important; color: var(--zinc-500) !important; letter-spacing: 0 !important; }
html body .emp-row:hover, html body .emp-row:focus-visible { background: color-mix(in srgb, var(--brand-50) 70%, transparent) !important; }

/* ==========================================================================
   8. TIPOGRAFIA: scala unica, Space Mono per orari e numeri
   ========================================================================== */
/* Mockup 2 – Proposta 8: scala tipografica unica + Space Mono solo per orari e numeri.
   Tre voci, tre ruoli: Permanent Marker = titoli e numeri del giorno (scritto a mano),
   Quicksand = testo e etichette, Space Mono = orari, ore, conteggi (scritto a macchina),
   con cifre tabellari cosi' le colonne di ore restano incolonnate.
   Scala 1,25 (terza maggiore) su base 1rem. */
:root {
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.25rem; --fs-xl: 1.56rem; --fs-2xl: 1.95rem;
  --font-hand: 'Permanent Marker', cursive; --font-text: 'Quicksand', sans-serif; --font-num: 'Space Mono', ui-monospace, monospace;
}
/* (scala dei titoli h1/h2/h3 non forzata ovunque: la Home resta com'è) */
html body .page-sub, html body .vs-hint { font-size: var(--fs-sm) !important; }

/* orari e numeri: macchina da scrivere, cifre incolonnate */
html body .pg-tg-time, html body .pg-pill.pg-person .t, html body .pg-count, html body .rel-badge,
html body .period-tag, html body .day-row .time, html body tr.report-row-zero td:not(:first-child),
html body .qb-num, html body .pg-dayx {
  font-family: var(--font-num) !important; font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
html body .pg-tg-time { font-size: var(--fs-xs) !important; font-weight: 700 !important; color: var(--zinc-700) !important; }
html body .pg-pill.pg-person .t { font-size: .68rem !important; }
html body tr.report-row-zero td:not(:first-child) { font-size: var(--fs-sm) !important; color: var(--zinc-800) !important; }
html body table.report-table.has-zero th { font-family: var(--font-text) !important; font-size: var(--fs-xs) !important; letter-spacing: .04em; }

/* le parole tornano in Quicksand: mansioni, link «apri →» */
html body .emp-row .meta, html body .qb-msg-card .go, html body .home-card .go, html body .apri {
  font-family: var(--font-text) !important; font-weight: 700 !important; letter-spacing: 0 !important;
}
/* i nomi delle persone nella griglia un filo piu' marcati: si cercano prima dell'orario */
html body .pg-pill .pn { font-weight: 800 !important; font-size: var(--fs-xs) !important; }

/* ==========================================================================
   10. TEMA DENTRO LA BANDA IN ALTO (il JS sposta il bottone in .qb-right)
   ========================================================================== */
/* Proposta 10 – tema dentro la banda in alto (accanto ad Aiuto/Esci), niente cerchio
   che copre i contenuti. Va stampato il bottone dentro .qb-band (layout-start.php);
   nel mockup e' spostato con una riga di JS. */
.qb-band .theme-toggle-btn {
  position: static !important; width: 2.6rem !important; height: 2.6rem !important; min-height: 2.6rem !important;
  border: 2px solid var(--zinc-900) !important; border-radius: 4px 10px 4px 10px !important;
  background: var(--panel) !important; color: var(--zinc-900) !important; box-shadow: none !important; flex: none;
}
html body .qb-band .qb-help-btn, html body .qb-band #qb-assist-btn { border-color: var(--zinc-900) !important; }
/* Il bottone tondo in basso a destra (layout-start.php) resta solo nelle pagine senza banda (accesso, link del dipendente). */
/* .qb-has-band la mette _qb-band.php (prima body:has(.qb-band …): rifaceva il giro di tutta la pagina a ogni ricalcolo dello stile) */
body.qb-has-band > .theme-toggle-btn, body.qb-has-band #theme-toggle-btn:not(.qb-theme-band) { display: none !important; }
.qb-band .theme-toggle-btn:hover { transform: rotate(-8deg); }
.qb-band .theme-toggle-btn:active { transform: translate(2px,2px); }
@media (max-width: 640px) { body.qb-has-band { padding-bottom: env(safe-area-inset-bottom, 0px) !important; } }
/* la banda resta su una riga: il nome del locale si accorcia con «…» (come gia' in Turni) */
@media (max-width: 640px) {
  .qb-band, .qb-band .qb-right { flex-wrap: nowrap !important; gap: .4rem !important; align-items: center; }
  .qb-band .qb-brand { min-width: 0; flex: 1 1 auto; }
  .qb-band .qb-brand .venue { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .qb-band .theme-toggle-btn { width: 2.4rem !important; height: 2.4rem !important; min-height: 2.4rem !important; }
}

/* ==========================================================================
   5. TURNI DENSI DA COMPUTER (>= 1000px, solo griglia a persone; vista a mansioni invariata)
   ========================================================================== */
/* Mockup 2 – Proposta 5: Turni densi da computer (>= 1000px).
   Obiettivo: almeno il doppio delle persone a schermo, azioni solo al passaggio,
   barra comandi su una riga. Stile quaderno invariato (inchiostro, angoli 4/10, Marker).
   "html body" serve solo a vincere sulle regole della pagina: applicandolo davvero
   si cambiano i valori nelle regole esistenti di calendar.php, senza prefissi. */
@media (min-width: 1000px) {
  html body .page-title { font-size: 1.5rem !important; margin: 0 !important; }
  html body .page-sub { margin: 0 0 .25rem !important; font-size: .85rem !important; }
  html body .toolbar { flex-wrap: nowrap !important; gap: .3rem !important; overflow-x: auto; scrollbar-width: none; margin: .2rem 0 !important; }
  html body .toolbar > .secondary:not(.qb-pub-fixed), html body .toolbar > .btn-link, html body .toolbar > .pend-pill { flex: none !important; min-height: 0 !important; height: 30px !important; padding: 0 8px !important; font-size: 13px !important; gap: 4px !important; }
  html body .toolbar svg { width: .9rem !important; height: .9rem !important; }
  html body .rf-bar { margin: .3rem 0 .4rem !important; gap: .3rem !important; min-height: 0 !important; }
  html body .rf-bar .rf-chip, html body .rf-bar select, html body .rf-bar button { min-height: 0 !important; height: 30px !important; padding: 0 8px !important; font-size: 13px !important; }
  html body .rf-bar svg { width: .85rem !important; height: .85rem !important; }

  /* intestazione dei giorni: una riga sola */
  html.qb-dense body .pg-dayhead { display: flex !important; flex-direction: row !important; align-items: baseline !important; justify-content: center !important;
    gap: .3rem !important; min-height: 0 !important; height: 2.1rem !important; padding: .1rem .3rem !important; width: 100% !important; }
  html.qb-dense body .pg-dayhead .dow { font-size: .85rem !important; }
  html.qb-dense body .pg-dayhead .num { font-size: 1.25rem !important; line-height: 1 !important; }
  html.qb-dense body .pg-dayhead .rel-badge { display: none !important; }
  html.qb-dense body .pg-dayhead .pg-dayx { font-size: .66rem !important; color: var(--zinc-500); }
  html.qb-dense body .pg-day-clear { opacity: 0; transition: opacity .15s ease; }
  html.qb-dense body th:hover .pg-day-clear, html.qb-dense body tr.pg-row:hover .pg-day-clear, html.qb-dense body .pg-day-clear:focus-visible { opacity: 1; }
  html.qb-dense body .pg-corner .pg-sort-btn { min-height: 1.7rem !important; font-size: .75rem !important; padding: 0 .5rem !important; }
  html.qb-dense body table.pg th { padding-top: 4px !important; padding-bottom: 4px !important; }

  /* righe: due mezze righe da 17px (pranzo / cena) */
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-cell, html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-pcell { min-height: 17px !important; height: 17px !important; flex: 0 0 17px !important; }
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-slots { gap: 0 !important; }
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-cell { padding: 0 3px !important; }
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-plabel { display: none !important; }
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-plus { opacity: 0; font-size: .75rem; line-height: 17px; }
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-cell:hover .pg-plus { opacity: .6; }
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-add { opacity: 0; height: 15px !important; min-height: 0 !important; }
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-cell:hover .pg-add { opacity: 1; }
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-pill { min-height: 0 !important; height: 16px !important; padding: 0 .35rem !important; font-size: .7rem !important; line-height: 1 !important;
    border-width: 1.5px !important; border-radius: 3px 7px 3px 7px !important; transform: none !important; }
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-pill::before { display: none !important; }
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-pill svg { width: .7rem !important; height: .7rem !important; }
  html.qb-dense body table.pg td { padding-top: 1px !important; padding-bottom: 1px !important; }

  /* colonna nomi: nome e mansione sulla stessa riga, stelle e maniglia al passaggio */
  html.qb-dense body td.pg-who { padding: 1px 4px !important; }
  /* 3/11: nome sopra, mansione sotto in piccolo, ore a destra (colonna propria): niente si sovrappone */
  html.qb-dense body .pg-who .pg-chip { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: .35rem !important; row-gap: 0 !important;
    align-items: center !important; align-content: center; padding: 1px .45rem !important; min-height: 32px !important; height: auto !important; border-width: 1.5px !important; transform: none !important; }
  html.qb-dense body .pg-who .pg-chip::before, html.qb-dense body .pg-who .pg-chip::after { display: none !important; }
  html.qb-dense body .pg-who .pg-name { grid-column: 1; grid-row: 1; min-width: 0; font-size: .86rem !important; line-height: 1.15 !important; white-space: normal !important; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  html.qb-dense body .pg-who .pg-sub { grid-column: 1; grid-row: 2; min-width: 0; font-size: .68rem !important; line-height: 1.1 !important; color: var(--zinc-500) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 !important; }
  html.qb-dense body .pg-who .pg-chip .qb-over-tag { grid-column: 2; grid-row: 1 / span 2; position: static !important; align-self: center; margin: 0 !important; box-shadow: none !important; border: 0 !important; }
  html.qb-dense body .pg-who .reliability-picker { display: none !important; }
  /* 12/11 (titolare: «quando mi avvicino a un nome lungo va a capo per far posto alle stelline»): le stelle compaiono SOPRA il
     bordo destro della casella del nome, senza prendere una colonna: il nome non si stringe e non va a capo. */
  html.qb-dense body .pg-who .pg-chip { position: relative; }
  html.qb-dense body tr.pg-row:hover .pg-who .reliability-picker { display: inline-flex !important; position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); margin: 0 !important; padding: .1rem .2rem; background: var(--panel); border-radius: 999px; z-index: 2; }
  html.qb-dense body tr.pg-row:hover .pg-who .pg-chip .qb-over-tag { display: none; }
  html.qb-dense body .pg-grip { opacity: 0; width: 12px !important; min-width: 12px !important; height: 28px !important; min-height: 0 !important; padding: 0 !important; }
  html.qb-dense body tr.pg-row:hover .pg-grip { opacity: .6; }
  /* 12/11 (titolare: «restringi le caselle per fare più spazio, ma in modo intelligente»): la riga è alta quanto il nome, non quanto due
     righe di testo. Nome e ore sulla stessa riga (ore a destra, piccole); sotto il nome resta solo un avviso vero (pg-check), la mansione
     scritta sparisce (si vede già dal gruppo e dal colore dei turni). Con il nome lungo: puntini, il nome intero nel suggerimento. */
  html.qb-dense body .pg-who .pg-chip { min-height: 24px !important; }
  html.qb-dense body .pg-who .pg-name { display: block !important; -webkit-line-clamp: unset; white-space: nowrap !important; text-overflow: ellipsis; }
  html.qb-dense body td.pg-who .pg-chip .pg-hrs { grid-column: 2 !important; grid-row: 1 !important; justify-self: end; margin: 0 !important; font-size: .64rem !important; line-height: 1 !important; white-space: nowrap; overflow: visible; }
  html.qb-dense body .pg-who .pg-sub:not(.pg-check) { display: none !important; }
  html.qb-dense body .pg-grip { height: 22px !important; }
  /* schermi larghi: i giorni hanno spazio in avanzo, la colonna dei nomi prende un po' di più così i nomi lunghi non si tagliano */
  @media (min-width: 1500px) { html.qb-dense body table.pg .pg-whocol { width: 12.5rem !important; } }

  /* colonna Pranzo/Cena: icone piccole, senza scritta */
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-pcell span { display: none !important; }
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-pcell svg { width: .7rem !important; height: .7rem !important; }
  html.qb-dense body td.pg-pcol, html.qb-dense body th.pg-pcolhead, html.qb-dense body td.pg-rowclear, html.qb-dense body th.pg-rowclear-head { width: 1.4rem !important; min-width: 1.4rem !important; padding: 0 !important; }

  /* righe alternate leggere per seguire la persona con l'occhio */
  html.qb-dense body tr.pg-row:nth-of-type(even) td:not(.pg-who) { background: color-mix(in srgb, var(--zinc-100) 60%, transparent); }
  html.qb-dense body tr.pg-row:hover td:not(.pg-who) { background: color-mix(in srgb, var(--brand-50) 70%, transparent); }
}
@media (min-width: 1000px) and (max-width: 1499px) { html body .pg-dayhead .pg-dayx { display: none !important; } }
/* comandi rari (Stampa, Report, Compiti, Mese): con la parola accanto all'icona; solo icona (nome nel title) quando la barra non ci
   sta su una riga (5/11: html.qb-tb-tight, misurato in calendar.php), cosi' sta su una riga anche nelle farmacie */
@media (min-width: 1000px) {
  html.qb-tb-tight body .toolbar > a.btn-link:not(.wk-arrow), html.qb-tb-tight body .toolbar > #open-month-view-btn { font-size: 0 !important; gap: 0 !important; padding: 0 .45rem !important; }
  html.qb-tb-tight body .toolbar > a.btn-link:not(.wk-arrow) svg { width: 1rem !important; height: 1rem !important; }
}

/* ==========================================================================
   B. PUBBLICA SENZA TIMBRO: stato dopo il tocco (QB_KIT.pubblicata = bottone | postit | riga)
   ========================================================================== */
/* Stato dopo il tocco su «Pubblica», senza timbro (non copre i turni). Tre varianti, colore = brand del locale.
   1 «bottone»: il bottone stesso diventa «✓ Pubblicata · N avvisati», pieno nel colore del locale.
   2 «postit»: il bottone diventa «✓ Pubblicata» (carta) e un post-it piccolo in basso conferma; sparisce da solo dopo 4 s.
   3 «riga»: il bottone diventa «✓ Pubblicata» e una riga di stato sopra la settimana dice quando e a quanti. */
html body .toolbar #publish-btn.qb-pub-fixed.qb-done {
  background: var(--panel) !important; color: var(--brand-700) !important; border: 2px solid var(--brand-600) !important;
  box-shadow: none !important; animation: none !important;
}
html body .toolbar #publish-btn.qb-pub-fixed.qb-done::after { display: none !important; }
html body .toolbar #publish-btn.qb-done svg { color: currentColor !important; animation: none !important; }
html body .toolbar #publish-btn.qb-pub-fixed.qb-done-bottone { background: var(--brand-700) !important; color: #fff !important; border-color: var(--zinc-900) !important; box-shadow: 3px 3px 0 var(--zinc-900) !important; }
:root[data-theme="dark"] body .toolbar #publish-btn.qb-pub-fixed.qb-done-bottone { background: var(--brand-600) !important; color: var(--zinc-50) !important; border-color: #000 !important; box-shadow: 3px 3px 0 #000 !important; }
.qb-done-n { font-weight: 600; opacity: .9; }
html body .pg-pill.qb-inked { border-style: solid !important; }


/* Turni da telefono: la barra in fondo dopo la pubblicazione */
.tt-pub.is-done { background: var(--panel) !important; color: var(--brand-700) !important; border: 2px solid var(--brand-600) !important; box-shadow: none !important; }
.tt-pub.is-done .qb-num { background: transparent !important; color: inherit !important; padding: 0 !important; font-family: 'Quicksand', sans-serif !important; font-weight: 700; }
.tt-pub.is-done.v-bottone { background: var(--brand-700) !important; color: #fff !important; border: 2px solid var(--zinc-900) !important; box-shadow: 3px 3px 0 var(--zinc-900) !important; }
:root[data-theme="dark"] .tt-pub.is-done.v-bottone { background: var(--brand-600) !important; color: var(--zinc-50) !important; border-color: #000 !important; }

/* ==========================================================================
   TURNI DA TELEFONO, NUOVA GERARCHIA (< 700px)
   ========================================================================== */
/* Mockup 2 – Turni da telefono, nuova gerarchia (stile quaderno). Solo variabili del tema. */
.tt { padding-bottom: 6rem; }
.tt-week { display: flex; align-items: center; gap: .4rem; margin: -.4rem 0 .6rem; }
.tt-week b { flex: 1; text-align: center; font-weight: 800; font-size: 1rem; color: var(--zinc-900); }
.tt-week button { width: 2.6rem; height: 2.6rem; border: 2px solid var(--zinc-900); border-radius: 4px 10px 4px 10px; background: var(--panel); color: var(--zinc-900); font-size: 1.2rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.tt-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: .9rem; }
.tt-day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; padding: .25rem 0 .85rem; min-height: 3.9rem;
  border: 2px solid var(--zinc-900); border-radius: 4px 10px 4px 10px; background: var(--panel); color: var(--zinc-900); }
.tt-day .dw { font-size: .68rem; font-weight: 700; text-transform: capitalize; color: var(--zinc-500); }
.tt-day .dn { font-family: 'Permanent Marker', cursive; font-size: 1.35rem; line-height: 1.1; }
.tt-day .st { position: absolute; bottom: 5px; width: 7px; height: 7px; border-radius: 50%; }
.tt-day .st.ok { background: #2f8057; } .tt-day .st.bad { background: var(--brand-600); box-shadow: 0 0 0 2px var(--brand-100); } .tt-day .st.none { border: 1.5px solid var(--zinc-400); }
.tt-day.on { background: var(--zinc-900); color: var(--panel); transform: translateY(-3px); box-shadow: 0 3px 0 var(--brand-600); }
.tt-day.on .dw { color: var(--zinc-300); }
.tt-day.past { opacity: .55; }
.tt-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; flex-wrap: wrap; border-bottom: 3px solid var(--zinc-900); margin-bottom: .8rem; }
.tt-head h1 { font-size: 2rem !important; margin: 0; text-transform: capitalize; }
.tt-head p { margin: 0; font-weight: 700; color: var(--zinc-700); font-size: .9rem; }
.tt-head .bad { color: var(--brand-700); } .tt-head .ok { color: #2f8057; }
.tt-gap { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem .8rem; margin: 0 0 .9rem;
  background: #f8c9bf; color: #1c1214; border: 2px solid var(--zinc-900); border-radius: 4px 12px 4px 12px; transform: rotate(-.6deg); box-shadow: 3px 3px 0 rgba(28,18,20,.2); }
.tt-gap b { display: block; font-size: 1rem; } .tt-gap span { font-family: 'Space Mono', monospace; font-size: .8rem; }
.tt-gap button { flex: none; min-height: 2.6rem; padding: 0 .8rem; font-weight: 800; background: #1c1214; color: #fdfbfb; border: 0; border-radius: 4px 10px 4px 10px; }
.tt-slot { margin: 0 0 1rem; padding: .2rem .8rem .6rem; background: var(--panel); border: 2px solid var(--zinc-900); border-radius: 4px 12px 4px 12px;
  background-image: repeating-linear-gradient(transparent 0 34px, var(--zinc-200) 34px 35px); }
.tt-slot h2 { display: flex; align-items: baseline; justify-content: space-between; margin: 0; height: 35px; line-height: 35px; font-size: 1rem !important; font-family: 'Quicksand', sans-serif !important; }
.tt-slot h2 .qb-num { font-family: 'Space Mono', monospace; font-weight: 700; font-size: 1.05rem; color: var(--zinc-900); }
.tt-slot h2 small { font-weight: 700; font-size: .78rem; color: var(--zinc-500); }
.tt-role { display: grid; grid-template-columns: 6.6rem 1fr; gap: .5rem; align-items: baseline; padding: 7px 0 7px .55rem; border-left: 4px solid var(--rc); min-height: 35px; }
.tt-rn { font-size: .74rem; font-weight: 800; color: var(--zinc-600); line-height: 1.2; }
.tt-names { font-size: .95rem; font-weight: 700; color: var(--zinc-900); line-height: 1.35; }
.tt-add { margin-top: .4rem; width: 100%; min-height: 2.6rem; border: 2px dashed var(--zinc-500); border-radius: 4px 10px 4px 10px; background: transparent; color: var(--zinc-700); font-weight: 800; }
.tt-empty { text-align: center; padding: 1.4rem; color: var(--zinc-600); font-weight: 700; }
.tt-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: .6rem 4.2rem calc(.6rem + env(safe-area-inset-bottom, 0px)) .9rem;
  background: color-mix(in srgb, var(--zinc-50) 92%, transparent); border-top: 2px solid var(--zinc-900); }
.tt-pub { width: 100%; min-height: 3.1rem; display: flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 800; font-size: 1.1rem;
  background: var(--brand-700); color: #fff; border: 2px solid var(--zinc-900); border-radius: 4px 12px 4px 12px; box-shadow: 3px 3px 0 var(--zinc-900); }
.tt-pub .qb-num { font-family: 'Space Mono', monospace; background: #fff; color: var(--brand-700); border-radius: 999px; padding: 0 .45rem; font-size: .9rem; }
:root[data-theme="dark"] .tt-pub { background: var(--brand-600); color: var(--zinc-50); border-color: #000; box-shadow: 3px 3px 0 #000; }
:root[data-theme="dark"] .tt-pub .qb-num { background: var(--zinc-50); color: var(--brand-600); }
:root[data-theme="dark"] .tt-gap, :root[data-theme="dark"] .tt-slot, :root[data-theme="dark"] .tt-day { border-color: var(--zinc-700); }
:root[data-theme="dark"] .tt-day.on { background: var(--zinc-900); color: var(--zinc-50); }
:root[data-theme="dark"] .tt-day.on .dw { color: var(--zinc-300); }
:root[data-theme="dark"] .tt-day.on .dn { color: var(--zinc-50); }
/* kit: con il tema nella banda la barra Pubblica usa tutta la larghezza; niente da pubblicare = bottone spento */
.tt-bar { padding-right: .9rem; }
.tt-pub.is-empty { background: var(--panel) !important; color: var(--zinc-500) !important; border: 2px dashed var(--zinc-400) !important; box-shadow: none !important; }
.qb-empty-note .tt-add { color: #1c1214 !important; border-color: #584f40 !important; }

/* ==========================================================================
   RAGGRUPPAMENTO PER MANSIONE / ORARIO / PERSONA, TIMELINE, PUBBLICA FUORI DALLA BANDA
   ========================================================================== */
/* Raggruppamento dei turni del giorno (Turni da telefono e pagina di oggi).
   .kg-mansione (proposta): mansione -> organico -> copertura, buco come post-it nella sua mansione,
   persone in ordine di inizio con l'orario a macchina accanto al nome.
   .kg-orario (com'era) e .kg-persona (elenco semplice) usano gli stessi pezzi. */
.kg { display: grid; gap: .8rem; }
.kg-grp { background: var(--panel); border: 2px solid var(--zinc-900); border-radius: 4px 12px 4px 12px; padding: 0 .8rem .45rem;
  background-image: repeating-linear-gradient(transparent 0 34px, var(--zinc-200) 34px 35px); }
.kg-grp h3 { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; height: 35px; line-height: 35px; margin: 0;
  font-family: 'Quicksand', sans-serif !important; font-size: 1rem !important; font-weight: 800; color: var(--zinc-900); }
.kg-grp h3 small { font-weight: 700; font-size: .78rem; color: var(--zinc-500); }
.kg-grp h3 .qb-num { font-family: 'Space Mono', monospace; }
/* intestazione di mansione: pallino colore, nome a pennarello, copertura a macchina */
.kg-role h3 .kg-rname { display: inline-flex; align-items: center; gap: .45rem; font-family: 'Permanent Marker', cursive; font-weight: 400; font-size: 1.1rem; }
.kg-role h3 .kg-rname i { width: .7rem; height: .7rem; border-radius: 50%; background: var(--rc); flex: none; }
.kg-cov { font-family: 'Space Mono', monospace; font-weight: 700; font-size: .95rem; color: var(--zinc-600); }
.kg-cov.ok { color: #2f8057; } .kg-cov.bad { color: var(--brand-700); }
:root[data-theme="dark"] .kg-cov.ok { color: #8fd3a8; }
.kg-role { border-left: 6px solid var(--rc); }
/* buco dentro la sua mansione */
.kg-gap { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .1rem 0 .4rem; padding: .45rem .6rem;
  background: #f8c9bf; color: #1c1214; border: 2px solid var(--zinc-900); border-radius: 4px 10px 4px 10px; transform: rotate(-.6deg); box-shadow: 3px 3px 0 rgba(28,18,20,.18); }
.kg-gap b { font-size: .95rem; white-space: nowrap; }
.kg-gap button { flex: none; min-height: 2.3rem; padding: 0 .7rem; font-weight: 800; font-size: .85rem; background: #1c1214; color: #fdfbfb; border: 0; border-radius: 4px 10px 4px 10px; }
:root[data-theme="dark"] .kg-gap { border-color: #000; }
/* persone: una per riga di carta, nome e orario a macchina */
.kg-list { list-style: none; margin: 0; padding: 0; }
.kg-p { display: flex; align-items: baseline; gap: .6rem; min-height: 35px; padding: 6px 0 4px; }
.kg-p .kg-n { flex: 1; font-weight: 700; font-size: .98rem; color: var(--zinc-900); }
.kg-p .kg-r { font-size: .78rem; font-weight: 700; color: var(--zinc-600); padding-left: .45rem; border-left: 4px solid var(--rc); }
.kg-p .kg-t { font-family: 'Space Mono', monospace; font-size: .82rem; font-weight: 700; color: var(--zinc-700); white-space: nowrap; }
/* per orario (com'era) */
.kg-role-line { display: grid; grid-template-columns: 6.6rem 1fr; gap: .5rem; align-items: baseline; padding: 7px 0 7px .55rem; border-left: 4px solid var(--rc); min-height: 35px; }
.kg-rn { font-size: .74rem; font-weight: 800; color: var(--zinc-600); line-height: 1.2; }
.kg-names { font-size: .95rem; font-weight: 700; color: var(--zinc-900); line-height: 1.35; }
/* sul computer, nella pagina di oggi, le mansioni stanno in due colonne */
/* stato «organico non impostato» nella pagina di oggi e pallino «ci sono turni» nella striscia dei giorni */
.tt-day .st.some { background: var(--zinc-500); }
.tt-head p .ok { color: #2f8057; } :root[data-theme="dark"] .tt-head p .ok { color: #8fd3a8; }
.tt > .tt-add { margin: .2rem 0 1rem; }

/* Timeline da telefono: resta la Timeline, solo con lo stile del quaderno */
/* Timeline (foglio del giorno a tutto schermo, anche da telefono): blocchi a inchiostro, ore a macchina, nomi marcati */
html body .day-timeline-block { border: 2px solid var(--zinc-900) !important; border-radius: 3px 8px 3px 8px !important; box-shadow: 2px 2px 0 var(--zinc-900) !important; }
:root[data-theme="dark"] body .day-timeline-block { border-color: #000 !important; box-shadow: 2px 2px 0 #000 !important; }
html body .day-timeline-block .time { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
html body .day-timeline-row-label { font-weight: 800; }
html body .day-timeline-hour-label { font-family: var(--font-num) !important; font-size: .7rem !important; font-weight: 700; color: var(--zinc-700) !important; }
html body .day-timeline-row { border-bottom: 1px solid var(--zinc-200); }

/* Pubblica non deve salire nella banda (fra 700 e 999px la pagina lo agganciava in alto a destra) */
@media (max-width: 999px) {
  html body .toolbar #publish-btn.qb-pub-fixed:not(.qb-pub-dock) { position: static !important; order: -1; margin: 0 auto 0 0 !important; }
}
.kg-cov-n { font-family: 'Quicksand', sans-serif; font-size: .8rem; color: var(--zinc-500); }

/* ==========================================================================
   FOGLI (sheet della pagina Turni: scelta del turno, orario, ripeti, copia, scambi, a chiamata, nota, storico, «…», Pubblica)
   ========================================================================== */
/* Mockup 3 – i fogli diventano pagine strappate dal quaderno: stessa carta a righe, titolo a pennarello con
   la sottolineatura del colore del locale, data e orario scritti a macchina, UN solo primario (colore del locale)
   in fondo e sempre visibile, scelte accese a inchiostro pieno con la riga colorata sotto (come i giorni di Turni
   da telefono), persone come righe di un elenco. Solo variabili del tema: mattone nei ristoranti, verde nelle farmacie.
   Da computer il foglio e' posato al centro della scrivania (bordo intero, ombra netta) invece che attaccato al fondo. */
:root { --sh-ink: var(--zinc-900); --sh-shadow: var(--zinc-900); }
:root[data-theme="dark"] { --sh-ink: var(--zinc-700); --sh-shadow: #000; }

/* sfondo: inchiostro caldo, niente sfocatura (meno pesante, e la griglia si riconosce sotto) */
html body .sheet-overlay { background: rgba(28,18,20,.42) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
:root[data-theme="dark"] body .sheet-overlay { background: rgba(0,0,0,.55) !important; }

/* il foglio */
html body .sheet-overlay .sheet-panel { border-color: var(--sh-ink) !important; border-radius: 4px 18px 0 0 !important; padding-top: .7rem; }
html body .sheet-overlay .sheet-handle { width: 3rem; height: 5px; background: var(--zinc-500) !important; opacity: .55; margin-bottom: .6rem; }

/* titolo: pennarello, sottolineato col colore del locale (come un titolo scritto e poi evidenziato) */
html body .sheet-overlay .sheet-title, html body #swap-sheet-title {
  font-family: var(--font-hand, 'Permanent Marker', cursive) !important; font-weight: 400 !important;
  font-size: 1.35rem !important; line-height: 1.2 !important; color: var(--zinc-900) !important; text-align: center;
  margin: 0 auto .15rem !important; padding: 0 .3rem .1rem; width: fit-content; max-width: calc(100% - 5rem);
  background: linear-gradient(transparent 88%, color-mix(in srgb, var(--brand-500) 45%, transparent) 88% 100%);
}
/* sottotitolo (giorno, fascia, mansione): leggibile, a macchina */
html body .sheet-overlay .sheet-title + p, html body #coverage-sheet-sub, html body #role-sheet-period, html body #shifttype-picker-date,
html body #extra-time-sheet-date, html body #flex-sheet-date, html body .cc-sub {
  font-family: var(--font-num, 'Space Mono', monospace) !important; font-size: .8rem !important; font-weight: 700 !important;
  color: var(--zinc-700) !important; letter-spacing: -.01em; margin-top: .1rem !important; text-align: center;
}
/* etichette di sezione: piccole ma scure, con la riga tratteggiata che chiude la sezione */
html body .sheet-overlay .sheet-section-label {
  display: flex; align-items: baseline; gap: .4rem; color: var(--zinc-700) !important; font-weight: 800 !important; letter-spacing: .05em;
}
html body .sheet-overlay .sheet-section-label::after { content: ''; flex: 1; border-bottom: 1.5px dashed var(--zinc-300); transform: translateY(-.2em); }
html body .sheet-overlay .sheet-section-label span { text-transform: none; letter-spacing: 0; color: var(--zinc-500) !important; }

/* X per chiudere: stesso angolo unico dei bottoni */
html body .sheet-overlay .qb-x { border-radius: var(--qb-radius) !important; border-color: var(--sh-ink) !important; box-shadow: 2px 2px 0 var(--sh-shadow) !important; }
/* Foglio del giorno: il titolo centrato (margin auto qui sopra) spinge «›» al bordo, sotto la ×: le si lascia il posto della × */
html body #day-sheet-next { margin-right: calc(2.4rem + 8px); }

/* scelte: tessere mansione, turni tipo, giorni da ripetere. Accesa = inchiostro pieno + riga del colore del locale */
html body .sheet-overlay .role-tile, html body .sheet-overlay #shifttype-picker-list .st-tile, html body .sheet-overlay .repeat-day-btn {
  border-color: var(--sh-ink) !important;
}
html body .sheet-overlay .role-tile.on, html body .sheet-overlay #shifttype-picker-list .st-tile.selected, html body .sheet-overlay .repeat-day-btn.on {
  background: var(--zinc-900) !important; border-color: var(--zinc-900) !important; color: var(--panel) !important;
  box-shadow: 0 3px 0 var(--brand-600) !important; transform: translateY(-2px);
}
html body .sheet-overlay .role-tile.on *, html body .sheet-overlay .repeat-day-btn.on *, html body .sheet-overlay #shifttype-picker-list .st-tile.selected * { color: var(--panel) !important; }
/* orari dei turni tipo a macchina */
html body .sheet-overlay #shifttype-picker-list .st-tile .role-tag, html body .sheet-overlay .repeat-day-btn small {
  font-family: var(--font-num, 'Space Mono', monospace) !important; letter-spacing: -.02em;
}

/* persone in elenco (Chi può coprire?, Chi avviso?, sostituzioni): righe del quaderno, non schede rosa una sotto l'altra */
html body .sheet-overlay .role-sheet-btn {
  min-height: 3.1rem !important; margin: 0 !important; padding: .45rem .7rem !important;
  background: transparent !important; border: 0 !important; border-bottom: 1.5px solid var(--zinc-200) !important;
  border-radius: 0 !important; box-shadow: none !important;
}
html body .sheet-overlay .role-sheet-btn:hover { background: color-mix(in srgb, var(--brand-50) 70%, transparent) !important; }
html body .sheet-overlay .role-sheet-btn .role-title { display: inline !important; font-weight: 700 !important; color: var(--zinc-900) !important; }
html body .sheet-overlay .role-sheet-btn .dot { width: .55rem !important; height: .55rem !important; }
html body .sheet-overlay .role-sheet-btn .role-tag { display: inline-block; margin-left: .45rem; padding: 0 .4rem; border: 1.5px solid var(--brand-600); border-radius: 4px 8px 4px 8px;
  color: var(--brand-700) !important; font-size: .62rem !important; letter-spacing: .03em; vertical-align: .1em; }
html body .sheet-overlay .role-sheet-btn .role-tag.secondary { border-color: var(--zinc-300); color: var(--zinc-600) !important; }
html body #coverage-sheet-list, html body #call-chooser-list { gap: 0 !important; border-top: 2px solid var(--sh-ink); }
html body .sheet-overlay .cc-person { border: 0 !important; border-bottom: 1.5px solid var(--zinc-200) !important; border-radius: 0 !important; background: transparent !important; margin: 0 !important; }
html body .sheet-overlay .cc-person.on { background: color-mix(in srgb, var(--brand-50) 80%, transparent) !important; }
html body .sheet-overlay .cc-person.on .cc-num { background: var(--brand-700) !important; border-color: var(--brand-700) !important; color: #fff !important; }
html body .sheet-overlay .cc-person small, html body .sheet-overlay .cc-person .cc-h { font-family: var(--font-num, monospace) !important; color: var(--zinc-600) !important; }
html body .sheet-overlay .cc-how, html body .hs-help { color: var(--zinc-700) !important; }

/* azioni in fondo: un solo primario pieno col colore del locale e ombra netta; togli = rosso di stato; restano visibili scorrendo */
html body .sheet-overlay .picker-sticky-footer, html body .sheet-overlay .flex-sheet-actions {
  position: sticky !important; bottom: calc(-2.5rem - env(safe-area-inset-bottom, 20px)); z-index: 2;
  margin-top: .8rem !important; padding: .6rem 0 .2rem !important; background: var(--panel) !important;
  border-top: 2px solid var(--sh-ink) !important; box-shadow: none !important;
}
html body #role-sheet-save-btn, html body #shifttype-picker-save-btn, html body #shifttype-picker-apply-repeat-btn, html body #extra-time-confirm-btn,
html body #flex-confirm-btn, html body #copy-week-confirm-btn, html body #copy-emp-confirm-btn, html body #publish-sheet-confirm, html body .cc-send,
html body #swap-ok, html body #add-open-shift-confirm-btn, html body #apply-pattern-confirm-btn {
  background: var(--brand-700) !important; color: #fff !important; border: 2px solid var(--zinc-900) !important;
  border-radius: 4px 12px 4px 12px !important; box-shadow: 3px 3px 0 var(--zinc-900) !important; font-weight: 800 !important; min-height: 3rem;
}
html body #swap-ok * { color: #fff !important; } html body #swap-ok svg { stroke: #fff !important; }
:root[data-theme="dark"] body :is(#role-sheet-save-btn, #shifttype-picker-save-btn, #shifttype-picker-apply-repeat-btn, #extra-time-confirm-btn, #flex-confirm-btn, #copy-week-confirm-btn, #copy-emp-confirm-btn, #publish-sheet-confirm, .cc-send, #swap-ok, #add-open-shift-confirm-btn, #apply-pattern-confirm-btn) {
  background: var(--brand-600) !important; color: var(--zinc-50) !important; border-color: #000 !important; box-shadow: 3px 3px 0 #000 !important;
}
html body .sheet-overlay :is(.cc-send, #publish-sheet-confirm, #copy-week-confirm-btn):disabled {
  background: var(--panel) !important; color: var(--zinc-600) !important; border: 2px dashed var(--zinc-400) !important; box-shadow: none !important;
}
html body #role-sheet-remove, html body #shifttype-picker-remove-btn, html body #flex-remove-btn, html body #swap-no {
  background: var(--err-bg) !important; color: var(--err-ink) !important; border: 2px solid var(--err-ink) !important;
  border-radius: 4px 12px 4px 12px !important; box-shadow: none !important; font-weight: 800 !important;
}
html body #swap-no * { color: var(--err-ink) !important; }
/* secondari nel foglio: gli stessi del resto dell'app (inchiostro + ombra) */
html body .sheet-overlay button.secondary { border: 2px solid var(--sh-ink) !important; border-radius: var(--qb-radius) !important; box-shadow: 2px 2px 0 var(--sh-shadow) !important; background: var(--panel) !important; color: var(--zinc-900) !important; }
html body .sheet-overlay button.secondary:active { transform: translate(2px,2px); box-shadow: none !important; }
html body .sheet-overlay .qb-bi-btn small { color: var(--zinc-600) !important; }
html body #swap-ok small { color: rgba(255,255,255,.88) !important; }
/* avvisi dentro il foglio (non disponibile, giorno libero, controlli dello scambio): post-it */
html body #role-sheet-hint, html body .sheet-overlay .swd-warn {
  background: var(--postit) !important; color: var(--postit-ink) !important; border: 2px solid var(--zinc-900); border-radius: 4px 12px 4px 12px !important; transform: rotate(-.4deg);
}
/* riepilogo dello scambio: il turno su un cartellino a inchiostro */
html body .sheet-overlay .swd { border: 2px solid var(--sh-ink) !important; border-radius: 4px 12px 4px 12px !important; background: var(--panel) !important; }
html body .sheet-overlay .swd-shift { font-family: var(--font-num, monospace) !important; font-weight: 700; }
/* campi orario: cifre a macchina, grandi */
html body .sheet-overlay .time-field-select, html body .sheet-overlay .time-field-manual { font-family: var(--font-num, monospace) !important; font-size: 1.05rem !important; font-weight: 700 !important; min-height: 2.8rem; }
html body .sheet-overlay .time-field-label { font-weight: 800 !important; color: var(--zinc-700) !important; }
/* collaudo 3/11: con le cifre grandi a macchina «07:00» usciva tagliato («07:0(») nel riquadro largo 7,6rem */
html body .sheet-overlay .time-field-wrap { width: 9.6rem !important; max-width: 46vw; }
html body .sheet-overlay .time-field-select { padding-left: .55rem !important; padding-right: 1.6rem !important; min-width: 0; }
/* elenchi del foglio «…», storico, menu Ordina: righe allineate */
html body #actions-sheet-list { gap: 0 !important; border-top: 2px solid var(--sh-ink); }
html body #actions-sheet-list > * { border: 0 !important; border-bottom: 1.5px solid var(--zinc-200) !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important; min-height: 3rem; justify-content: flex-start; }
html body .hs-row { border-color: var(--sh-ink) !important; }
html body .hs-when { font-family: var(--font-num, monospace) !important; }
html body .pg-sort-menu { border-color: var(--sh-ink) !important; box-shadow: 3px 3px 0 var(--sh-shadow) !important; padding: .2rem !important; }
html body .pg-sort-item { border-bottom: 1.5px solid var(--zinc-200) !important; border-radius: 0 !important; }
html body .pg-sort-item:last-of-type { border-bottom: 0 !important; }
/* cerca: angolo unico a inchiostro; mentre filtra diventa un post-it (si vede che l'elenco e' filtrato) */
html body #emp-search { border-radius: var(--qb-radius) !important; border: 2px solid var(--sh-ink) !important; font-weight: 700; }
html body #emp-search:not(:placeholder-shown) { background: var(--postit) !important; color: var(--postit-ink) !important; }

/* computer: il foglio e' posato al centro della scrivania */
@media (min-width: 900px) {
  html body .sheet-overlay:not(.qb-tl-full) { align-items: center !important; padding: 2rem 1rem; }
  html body .sheet-overlay:not(.qb-tl-full) .sheet-panel {
    border: 2.5px solid var(--sh-ink) !important; border-radius: 4px 18px 4px 18px !important;
    box-shadow: 6px 6px 0 var(--sh-shadow) !important; max-height: calc(100dvh - 4rem) !important; padding-bottom: 1.2rem !important;
  }
  html body .sheet-overlay:not(.qb-tl-full) .sheet-handle { display: none; }
  html body .sheet-overlay:not(.qb-tl-full) .picker-sticky-footer, html body .sheet-overlay:not(.qb-tl-full) .flex-sheet-actions { bottom: -1.2rem; }
}

/* Colonna persone della griglia (3/11, segnalazione del titolare), resa larga e densa:
   nome intero (va a capo su due righe invece di «…»), mansione sotto, ore a destra senza bordi sopra;
   persona scelta = UN solo contorno col colore del locale; caselle della riga scelta tinte, senza tratteggi uno per casella. */
@media (min-width: 1000px) {
  html:not(.qb-dense) body .pg-who .pg-name { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; line-height: 1.15 !important; }
  html:not(.qb-dense) body .pg-who .pg-sub { overflow-wrap: anywhere; }
}
html body .pg-who .pg-chip .qb-over-tag { border: 0 !important; box-shadow: none !important; }
html body tr.pg-row.selected td.pg-who .pg-chip { box-shadow: none !important; border-color: var(--brand-600) !important; background: color-mix(in srgb, var(--brand-50) 70%, var(--panel)) !important; }
html body tr.pg-row.selected .pg-cell:not(.pg-nogo) { outline: none !important; background: color-mix(in srgb, var(--brand-50) 45%, transparent); }
html body tr.pg-row.selected .pg-cell:not(.pg-nogo):hover { background: color-mix(in srgb, var(--brand-50) 90%, transparent); }

/* ==========================================================================
   TURNI DA TELEFONO, PEZZI VERI (calendar.php #tt, ttRender): cosa si nasconde, settimana, strumenti, righe toccabili
   ========================================================================== */
#tt[hidden] { display: none !important; }
.tt-back-btn { display: none !important; }
@media (max-width: 699px) {
  html.qb-tt main .page-title, html.qb-tt main .page-sub, html.qb-tt main .toolbar, html.qb-tt main .rf-bar,
  html.qb-tt main .day-pager, html.qb-tt main .planner-shell { display: none !important; }
  html:not(.qb-tt):not(.qb-mode-timeline) .toolbar .tt-back-btn { display: inline-flex !important; flex: none; width: 2.4rem; min-height: 38px; padding: 0; align-items: center; justify-content: center; }
  .tt-back-btn svg { width: 1.15rem; height: 1.15rem; }
}
.tt { padding-bottom: calc(5.4rem + env(safe-area-inset-bottom, 0px)); }
.tt-week { margin: 0 0 .45rem; }
.tt-week .tt-arrow { flex: none; width: 2.6rem; height: 2.6rem; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--zinc-900);
  border-radius: var(--qb-radius); background: var(--panel); color: var(--zinc-900); font-size: 1.35rem; font-weight: 800; text-decoration: none; box-shadow: 2px 2px 0 var(--zinc-900); }
.tt-week .tt-arrow:active { transform: translate(2px,2px); box-shadow: none; }
.tt-week .tt-wk { flex: 1; min-width: 0; width: auto; height: 2.6rem; min-height: 0; margin: 0; padding: 0 .5rem; border: 0; background: transparent; box-shadow: none;
  font-family: var(--font-hand); font-weight: 400; font-size: 1.3rem; color: var(--zinc-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-tools { display: flex; gap: .35rem; margin: 0 0 .7rem; }
.tt-tools button { flex: 1 1 0; min-width: 0; width: auto; min-height: 2.5rem; margin: 0; padding: 0 .4rem; display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  border: 2px solid var(--zinc-900); border-radius: var(--qb-radius); background: var(--panel); color: var(--zinc-900); font-size: .82rem; font-weight: 800; box-shadow: 2px 2px 0 var(--zinc-900); }
.tt-tools button.tt-more { flex: 0 0 2.6rem; }
.tt-tools button svg { width: 1rem; height: 1rem; flex: none; }
.tt-tools button:active { transform: translate(2px,2px); box-shadow: none; }
.tt-day { width: auto; min-width: 0; margin: 0; cursor: pointer; transition: transform .15s ease, background-color .15s ease; }
.tt-day.on.past { opacity: 1; }
.tt-day.today:not(.on) { box-shadow: inset 0 -3px 0 var(--brand-600); }
.tt-day.closed .dn { text-decoration: line-through; text-decoration-thickness: 2px; opacity: .6; }
.tt-day .st.off { display: none; }
.tt-head h1 { line-height: 1.1; }
.tt-open-day { all: unset; cursor: pointer; font: inherit; color: inherit; text-transform: capitalize; }
.tt-open-day span { font-family: var(--font-text); font-size: 1.2rem; color: var(--zinc-500); }
.tt-head p .bad { color: var(--brand-700); }
.kg-hr { display: inline-flex; align-items: center; gap: .45rem; }
.kg-add { width: 2rem; height: 2rem; min-height: 0; margin: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 2px dashed var(--zinc-500); border-radius: var(--qb-radius);
  background: transparent; color: var(--zinc-700); font-size: 1.15rem; font-weight: 800; line-height: 1; box-shadow: none; }
.kg-p { align-items: center; padding: 3px 0; }
.kg-p .kg-n { all: unset; flex: 1; min-width: 0; cursor: pointer; font-weight: 700; font-size: .98rem; color: var(--zinc-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kg-p .kg-n .kg-r { border-left: 0; padding-left: .2rem; font-size: .74rem; }
.kg-ts { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem; }
.kg-p .kg-t { width: auto; min-height: 29px; margin: 0; padding: 0 .45rem; border: 1.5px solid var(--zinc-900); border-radius: 3px 8px 3px 8px; background: var(--panel); box-shadow: none; cursor: pointer; }
/* stato del turno, come le pillole della griglia: tratteggio = non ancora inviato, verde = inviato, giallo = da confermare, rosso = non disponibile */
.kg-t.st-draft { border-style: dashed; }
.kg-t.st-sent { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-ink); }
.kg-t.st-pend { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-ink); }
.kg-t.st-rej { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-ink); text-decoration: line-through; }
.kg-gap small { font-weight: 700; font-size: .75rem; }
.kg-gap b { white-space: normal; }
:root[data-theme="dark"] .kg-grp, :root[data-theme="dark"] .tt-tools button, :root[data-theme="dark"] .tt-week .tt-arrow { border-color: var(--zinc-700); }
.tt-bar { padding-right: .9rem; z-index: 40; }
.tt-pub { cursor: pointer; }
.tt-pub:active { transform: translate(3px,3px); box-shadow: none !important; }
html.qb-tt .theme-toggle-btn:not(.qb-theme-band) { display: none !important; }
/* con un foglio aperto la barra di Pubblica non copre i suoi pulsanti */
body.qb-sheet-open .tt-bar { display: none; }
/* animazioni: il giorno scelto si posa, i gruppi entrano uno dopo l'altro, il «Pubblicata» si accende */
@media (prefers-reduced-motion: no-preference) {
  .tt-day.on { transition: transform .22s cubic-bezier(.2,1.4,.4,1); }
  #tt-groups > .kg-grp { animation: tt-in .32s cubic-bezier(.2,.8,.2,1) both; }
  #tt-groups > .kg-grp:nth-child(2) { animation-delay: .04s; } #tt-groups > .kg-grp:nth-child(3) { animation-delay: .08s; }
  #tt-groups > .kg-grp:nth-child(4) { animation-delay: .12s; } #tt-groups > .kg-grp:nth-child(n+5) { animation-delay: .16s; }
  .kg-gap { animation: tt-postit .45s cubic-bezier(.2,1.3,.4,1) both; }
  .tt-pub.is-done.v-bottone, html body .toolbar #publish-btn.qb-done-bottone { animation: tt-done .5s cubic-bezier(.2,1.5,.4,1) both !important; }
  @keyframes tt-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes tt-postit { from { opacity: 0; transform: translateY(-6px) rotate(-4deg) scale(.95); } to { opacity: 1; transform: rotate(-.6deg); } }
  @keyframes tt-done { 0% { transform: scale(.94); } 60% { transform: scale(1.04); } 100% { transform: none; } }
}
/* Pubblicata nella barra da computer: niente anello che pulsa, cifre leggibili */
html body .toolbar #publish-btn.qb-done .qb-done-n { margin-left: .3rem; }

/* === PAGINE === (agente B, 3/11) link del dipendente, Attenzione, Report, Report del gruppo, Team, Locali, Abbonamento,
   Messaggi, Assenze, Presenze. Solo variabili del tema (--brand-*, --zinc-*, --panel): mattone e verde farmacia da soli. */

/* bottoni: un solo raggio (4/10) anche dove era una pillola */
html body .rp-mode, html body .cal-btn, html body .sv-pdf, html body .sv-edit-btn, html body .rg-btn, html body .rg-sel {
  border-radius: var(--qb-radius, 4px 10px 4px 10px) !important;
}
/* Abbonamento e Messaggi: i bottoni grandi (pillole del tema base) prendono lo stesso angolo */
html body .pl-btn button, html body .plan-page form button { border-radius: var(--qb-radius, 4px 10px 4px 10px) !important; }
html body a.rg-btn, html body a.rp-mode:not(.active):not([aria-current]), html body .cal-btn { box-shadow: 2px 2px 0 var(--zinc-900); transition: transform .08s ease, box-shadow .08s ease; }
html body a.rg-btn:active, html body a.rp-mode:active, html body .cal-btn:active { transform: translate(2px,2px); box-shadow: none; }

/* primario dei fogli del link (Invia richiesta, Invia ore libere, ...): pieno a inchiostro con ombra del colore del locale,
   «Annulla» resta secondario. Prima era una pillola vuota, meno evidente di «Annulla». */
html body .sheet-overlay form button[type=submit]:not(.secondary):not(:disabled) {
  background: var(--zinc-900) !important; color: var(--panel) !important; border: 2px solid var(--zinc-900) !important;
  border-radius: var(--qb-radius, 4px 10px 4px 10px) !important; min-height: 3rem; box-shadow: 3px 3px 0 var(--brand-600) !important;
  transition: transform .08s ease, box-shadow .08s ease;
}
html body .sheet-overlay form button[type=submit]:not(.secondary):active { transform: translate(3px,3px); box-shadow: none !important; }

/* titoli delle pagine del gestore: misura unica, mai su due righe per una parola sola */
/* tranne Turni (#turni-title): prima main:not(:has(#publish-btn)), che girava tutta la pagina; stessa specificita' */
html body main .page-title:not(#turni-title) { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 1.95rem); line-height: 1.15; overflow-wrap: normal; }
html body .rg-card h2 small, html body .rg-card h3 small { white-space: nowrap; }
/* link del dipendente: saluto e «Turni dello staff» su una riga (si accorciano con … invece di andare a capo) */
html body .po-hdr > div:first-child { min-width: 0; }
html body .po-hdr .page-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(1.35rem, 5.6vw, 1.8rem); }

/* Report: numeri a macchina e incolonnati, nomi su una riga; da telefono la colonna dei nomi resta ferma scorrendo di lato */
html body .report-table td:not(:first-child) { font-family: var(--font-num, 'Space Mono', monospace); font-variant-numeric: tabular-nums; letter-spacing: -.02em; font-size: var(--fs-sm, .875rem); }
html body .report-table td:first-child { white-space: nowrap; font-weight: 700; }
@media (max-width: 640px) {
  html body .report-table th:first-child, html body .report-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); box-shadow: 2px 0 0 var(--zinc-200); }
}

/* Report del gruppo: i numeri grandi a macchina (il pennarello confondeva 1 e 7) */
html body .rg-kpi b, html body .rg-kpi .v, html body .rg-kpi strong { font-family: var(--font-num, 'Space Mono', monospace) !important; letter-spacing: -.03em; }

/* Attenzione: decisione con un tocco e «Annulla» per 4 secondi (attenzione.php) */
.att-decision { position: relative; }
.att-decision.qb-pending > :not(.qb-undo) { opacity: .45; pointer-events: none; transition: opacity .2s ease; }
.qb-undo {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap;
  margin-top: .7rem; padding: .55rem .6rem .7rem .9rem; overflow: hidden;
  background: var(--postit, #f6e08a); color: var(--postit-ink, #1c1214); border: 2px solid var(--zinc-900); border-radius: 4px 12px 4px 12px;
  box-shadow: 3px 3px 0 rgba(28,18,20,.18); font-size: .95rem;
}
.qb-undo.is-no { background: var(--err-bg); color: var(--err-ink); }
.qb-undo .qb-num { font-weight: 700; }
html body .qb-undo .qb-undo-btn { width: auto; min-height: 2.6rem; padding: 0 1.1rem; background: var(--panel) !important; color: var(--zinc-900) !important; }
.qb-undo-bar { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--brand-600); transform-origin: left; animation: qb-undo-run 4s linear forwards; }
@keyframes qb-undo-run { from { transform: scaleX(1); } to { transform: scaleX(0); } }
:root[data-theme="dark"] .qb-undo { border-color: #000; }
@media (prefers-reduced-motion: no-preference) { .qb-undo { animation: qb-postit-in .3s cubic-bezier(.22,.85,.32,1) both; } }
@media (prefers-reduced-motion: reduce) { .qb-undo-bar { animation: none; } }

/* Link del dipendente: bozze ben riconoscibili (variante B). Post-it in testa, giorno tratteggiato su carta rigata in
   diagonale, post-it «Bozza · può cambiare» sull'angolo. Il post-it resta giallo e leggibile anche in scuro. */
.qb-draft-note {
  margin: .2rem 0 .9rem; padding: .7rem .9rem; background: var(--postit, #f6e08a); color: var(--postit-ink, #1c1214);
  border: 2px solid var(--zinc-900); border-radius: 4px 12px 4px 12px; transform: rotate(-.6deg);
  box-shadow: 3px 3px 0 rgba(28,18,20,.18); font-size: .92rem; line-height: 1.35;
}
.qb-draft-note b { display: block; font-family: var(--font-hand, 'Permanent Marker', cursive); font-weight: 400; font-size: 1.1rem; }
:root[data-theme="dark"] .qb-draft-note { border-color: #000; }
html body .day-card.is-draft {
  position: relative; border-style: dashed !important; border-color: var(--zinc-500) !important; box-shadow: none !important;
  background-color: var(--panel) !important;
  background-image: repeating-linear-gradient(-45deg, transparent 0 9px, color-mix(in srgb, var(--zinc-300) 55%, transparent) 9px 10px) !important;
}
html body .day-card.is-draft.today { border-color: var(--brand-600) !important; }
.qb-draft-corner {
  position: absolute; top: -.55rem; inset-inline-end: 1.9rem; z-index: 1; padding: .1rem .45rem; background: var(--postit, #f6e08a); color: var(--postit-ink, #1c1214);
  border: 1.5px solid var(--zinc-900); border-radius: 3px 8px 3px 8px; transform: rotate(2deg); font-size: .68rem; font-weight: 800; white-space: nowrap;
}
:root[data-theme="dark"] .qb-draft-corner { border-color: #000; }
.qb-draft-corner::first-letter { text-transform: uppercase; } /* «bozza» tradotta in minuscolo nelle 14 lingue */
html body .day-card.is-draft .shift-chip .draft-tag { display: none; } /* gia' detto dall'angolo */
html body .shift-chip .draft-tag { color: var(--zinc-700) !important; border: 1.5px dashed var(--zinc-500); border-radius: 4px 8px; padding: 0 .3rem; }

/* === ONBOARDING === (agente DO, 3/11) nuovo onboarding: onboarding-guidato.php (tappe 1-3) e onboarding-week.php (Pubblica e
   finale). 4 tappe: Il locale · La squadra · Chi lavora quando · Pubblica → «Guarda il telefono». Telefono: una colonna, bottone
   principale fisso in basso. Computer (>= 900px): foglio al centro e a destra il telefono con quello che vedranno i dipendenti. */
.onb { --rad: 4px 12px 4px 12px; max-width: 1180px; margin: 0 auto; padding: 0 0 8.5rem; color: var(--zinc-900); font-family: var(--font-text); }
.onb * { box-sizing: border-box; }
.onb .marker, .onb h1 { font-family: var(--font-hand); font-weight: 400; letter-spacing: .01em; }
.onb .num { font-family: var(--font-num); font-weight: 700; font-variant-numeric: tabular-nums; }
.onb button { font-family: inherit; cursor: pointer; }
.onb .onb-go, .onb .onb-exit { font-weight: 800 !important; }
/* il tema sta nella banda: il bottone tondo in basso a destra coprirebbe il bottone fisso */
body.qb-has-onb-band > #theme-toggle-btn { display: none !important; } /* classe messa dopo .onb-band nelle due viste dell'onboarding */
.onb-band { display: flex; align-items: center; gap: .7rem; min-height: 3.2rem; padding: .3rem 0; }
.onb-band .marker { font-size: 1.55rem; line-height: 1; color: var(--zinc-900); }
.onb-band .grow { flex: 1; min-width: 0; display: flex; }
.onb-band form { margin: 0; }
.onb-time { font-size: .82rem; font-weight: 700; color: var(--zinc-600); white-space: nowrap; }
.onb-exit { background: none !important; border: 0 !important; box-shadow: none !important; min-height: 2.6rem; padding: 0 .2rem !important; font-weight: 700; color: var(--zinc-800) !important; text-decoration: none; display: inline-flex; align-items: center; }
.onb-band .theme-toggle-btn { position: static !important; width: 2.6rem !important; height: 2.6rem !important; min-height: 2.6rem !important; flex: none;
  border: 2px solid var(--zinc-900) !important; border-radius: var(--qb-radius) !important; background: var(--panel) !important; color: var(--zinc-900) !important; box-shadow: none !important; }

/* tappe: 4 linguette di quaderno */
.onb-prog { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: .2rem 0 1rem; padding: 0; counter-reset: t; }
.onb-prog li { counter-increment: t; padding: .5rem .2rem .45rem; border-bottom: 4px solid var(--zinc-200); font-size: .74rem; font-weight: 800; color: var(--zinc-500); line-height: 1.15; }
.onb-prog li::before { content: counter(t); font-family: var(--font-num); margin-right: .3rem; }
.onb-prog li.done { color: var(--zinc-700); border-color: var(--zinc-900); }
.onb-prog li.done::before { content: '✓'; color: var(--brand-600); }
.onb-prog li.cur { color: var(--zinc-900); border-color: var(--brand-600); }

.onb-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.onb-sheet { position: relative; min-width: 0; background: var(--panel); border: 2.5px solid var(--zinc-900); border-radius: 4px 18px 4px 18px; padding: 1.15rem 1.1rem 1.2rem; box-shadow: 4px 4px 0 var(--zinc-900); }
:root[data-theme="dark"] .onb-sheet { border-color: #000; box-shadow: 4px 4px 0 #000; }
.onb-sheet h1 { font-size: 1.85rem; line-height: 1.08; margin: 0 0 .25rem; color: var(--zinc-900); }
.onb-ul { display: block; width: 9rem; height: 10px; margin: 0 0 .5rem; color: var(--brand-600); }
.onb-sub { margin: 0 0 1rem; color: var(--zinc-600); font-size: .98rem; line-height: 1.4; }
.onb-lab { display: block; margin: 1.05rem 0 .45rem; font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--zinc-600); }
.onb-lab small { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--zinc-500); }


/* «Ho preparato così» */

/* bottoni */
.onb-cta { display: flex; gap: .6rem; align-items: center; margin: 1.3rem 0 0; }
.onb-go { flex: 1; min-height: 3.4rem; padding: 0 1.2rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; background: var(--zinc-900) !important; color: var(--panel) !important;
  border: 2px solid var(--zinc-900) !important; border-radius: var(--rad) !important; font-weight: 800; font-size: 1.08rem; text-decoration: none; box-shadow: 3px 3px 0 var(--brand-600) !important; transition: transform .08s ease, box-shadow .08s ease; }
.onb-go:active { transform: translate(2px, 2px); box-shadow: none !important; }
.onb-go.pub { background: var(--brand-700) !important; color: #fff !important; box-shadow: 3px 3px 0 var(--zinc-900) !important; font-size: 1.12rem; }
.onb-go:disabled { opacity: .7; }
:root[data-theme="dark"] .onb-go.pub { background: var(--brand-600) !important; color: #1c1214 !important; box-shadow: 3px 3px 0 #000 !important; }
.onb-go .badge { background: #fff; color: var(--brand-700); border-radius: 999px; padding: 0 .5rem; font-size: .9rem; }
:root[data-theme="dark"] .onb-go .badge { background: #1c1214; color: var(--brand-600); }
.onb-skip { display: block; width: fit-content; margin: .8rem auto 0; padding: .5rem !important; background: none !important; border: 0 !important; box-shadow: none !important; min-height: 2.6rem; font-size: .95rem; font-weight: 700; color: var(--zinc-700); text-decoration: underline; text-underline-offset: 3px; }
.onb-msg { margin: .8rem 0 0; padding: .55rem .8rem; background: var(--err-bg); color: var(--err-ink); border-radius: var(--rad); font-weight: 700; font-size: .92rem; }
.onb-empty { padding: .9rem 1rem; background: var(--postit); color: var(--postit-ink); border: 2px solid var(--zinc-900); border-radius: 4px 12px 4px 12px; transform: rotate(-.4deg); font-size: .9rem; font-weight: 600; line-height: 1.4; }
.onb-empty.big { margin-top: .5rem; font-size: 1rem; }
:root[data-theme="dark"] .onb-empty { border-color: #000; }

/* 2: la squadra */

/* 3: persona per persona */

/* 4: la settimana */
.onb-mini-wrap { max-width: 100%; overflow-x: auto; }
.onb-mini { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; font-size: .78rem; }
.onb-mini th { font-weight: 800; color: var(--zinc-600); font-size: .68rem; padding: 0 0 2px; white-space: nowrap; }
.onb-mini th .num { font-size: .66rem; }
.onb-mini th.cl { opacity: .5; }
.onb-mini th:first-child { width: 4.6rem; }
.onb-mini td { height: 2.15rem; text-align: center; border-radius: 4px 7px 4px 7px; background: var(--zinc-100); font-family: var(--font-num); font-weight: 700; font-size: .62rem; color: var(--zinc-900); overflow: hidden; white-space: nowrap; padding: 0 1px; }
.onb-mini td.n { background: none; text-align: left; font-family: var(--font-text); font-size: .82rem; font-weight: 800; text-overflow: ellipsis; }
.onb-mini td.n small { font-weight: 600; color: var(--zinc-500); }
.onb-mini td.s { background: var(--panel); border: 1.5px solid var(--zinc-900); }
.onb-mini td.s i { display: block; width: 70%; height: 3px; margin: 2px auto 0; border-radius: 2px; background: var(--rc); }
.onb-mini td.x { background: repeating-linear-gradient(-45deg, transparent 0 4px, var(--zinc-200) 4px 5px); }
.onb-warn { display: flex; gap: .6rem; align-items: flex-start; margin-top: .9rem; padding: .7rem .85rem; background: var(--postit); color: var(--postit-ink); border: 2px solid var(--zinc-900); border-radius: 4px 12px 4px 12px; transform: rotate(-.4deg); font-size: .9rem; line-height: 1.35; }
.onb-warn svg { width: 1.4rem; height: 1.4rem; flex: none; }
:root[data-theme="dark"] .onb-warn { border-color: #000; }
.onb-warn b { display: block; }
.onb-warn a { color: inherit; font-weight: 800; }
.onb-cost { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; font-size: .84rem; font-weight: 700; color: var(--zinc-600); }
.onb-cost.warn { color: var(--warn-ink); }

/* finale: «Guarda il telefono» (niente timbro: il bottone pieno nel colore del locale, come Pubblica in Turni) */
.onb-done { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.6rem; padding: 0 1rem; margin: 0 0 .8rem; background: var(--brand-700); color: #fff; border: 2px solid var(--zinc-900); border-radius: var(--rad); font-weight: 800; box-shadow: 3px 3px 0 var(--zinc-900); }
:root[data-theme="dark"] .onb-done { background: var(--brand-600); color: #1c1214; border-color: #000; box-shadow: 3px 3px 0 #000; }
.onb-wow h1 { font-size: 2.15rem; }
.onb-count { display: flex; gap: 1.4rem; margin: .8rem 0 0; }
.onb-count div { text-align: center; }
.onb-count .num { display: block; font-size: 1.9rem; line-height: 1; color: var(--zinc-900); }
.onb-count small { font-size: .78rem; font-weight: 700; color: var(--zinc-600); }
.onb-wow-ph { margin-top: 1.2rem; }
.onb-next { margin-top: 1.2rem; }
.onb-next ol { padding: 0; margin: 0; }
.onb-next li { list-style: none; border-bottom: 1px dashed var(--zinc-300); font-weight: 700; font-size: .93rem; }
.onb-next li, .onb-next li a { display: flex; gap: .6rem; align-items: center; min-height: 2.9rem; color: var(--zinc-900); text-decoration: none; }
.onb-next li a { flex: 1; min-width: 0; }
.onb-next li a span { text-decoration: underline; text-decoration-color: var(--zinc-300); text-underline-offset: 3px; }
.onb-next li i { flex: none; width: 1.4rem; height: 1.4rem; border: 2px solid var(--zinc-900); border-radius: 4px 7px 4px 7px; display: grid; place-items: center; font-style: normal; font-size: .8rem; }
.onb-next li i.ok { background: var(--zinc-900); color: var(--panel); }
.onb-next li small { margin-left: auto; color: var(--zinc-500); font-size: .78rem; white-space: nowrap; }

/* il telefono a destra (computer) e nel finale */
.onb-phone { position: relative; width: 17.5rem; max-width: 100%; margin: 0 auto; padding: .7rem .55rem .9rem; background: #1c1214; border-radius: 2.2rem; box-shadow: 6px 6px 0 rgba(28,18,20,.25); }
:root[data-theme="dark"] .onb-phone { background: #0b0a08; box-shadow: 0 0 0 2px #4a4231, 6px 6px 0 #000; }
.onb-phone::before { content: ''; display: block; width: 4.5rem; height: .9rem; margin: 0 auto .45rem; border-radius: 999px; background: #000; }
.onb-scr { min-height: 22rem; border-radius: 1.6rem; overflow: hidden; background: #efe7da; color: #1c1214; font-size: .8rem; display: flex; flex-direction: column; text-align: left; }
.onb-scr-h { display: flex; align-items: center; gap: .5rem; padding: .55rem .75rem; background: #2b4a3b; color: #fff; font-weight: 800; font-size: .82rem; }
.onb-scr-h span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onb-scr-h i { width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #f6e08a; color: #1c1214; display: grid; place-items: center; font-style: normal; font-family: var(--font-hand); font-size: .7rem; flex: none; }
.onb-scr-h small { display: block; font-weight: 600; opacity: .85; font-size: .66rem; }
.onb-chat { flex: 1; padding: .7rem .6rem; display: flex; flex-direction: column; gap: .45rem; }
.onb-chat .onb-msg { max-width: 88%; margin: 0; padding: .5rem .6rem .35rem; background: #fff; color: #1c1214; border-radius: .2rem .8rem .8rem .8rem; line-height: 1.35; font-weight: 500; font-size: .8rem; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.onb-chat .onb-msg.me { align-self: flex-end; background: #d8f3c8; border-radius: .8rem .2rem .8rem .8rem; }
.onb-msg b.who { display: block; font-size: .7rem; color: #2b4a3b; }
.onb-msg time { display: block; text-align: right; font-size: .6rem; color: #6d6250; margin-top: .1rem; font-family: var(--font-num); }
.onb-msg .lnk { color: #1d5fa0; text-decoration: underline; word-break: break-all; }
.onb-msg .btn { display: block; margin: .4rem -.6rem -.35rem; padding: .45rem; text-align: center; border-top: 1px solid #e3ddd0; color: #1d7a5a; font-weight: 800; }
@media (prefers-reduced-motion: no-preference) { .onb-msg.arrive { animation: onb-msg .7s cubic-bezier(.22,.85,.32,1) both .5s; } }
@keyframes onb-msg { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.onb-sys { align-self: center; padding: .15rem .55rem; background: #f6f1e4; border-radius: .5rem; font-size: .66rem; color: #6d6250; }
.onb-side-note { margin: 1rem auto 0; max-width: 17.5rem; padding: .75rem .9rem; background: var(--postit); color: var(--postit-ink); border: 2px solid var(--zinc-900); border-radius: 4px 12px 4px 12px; transform: rotate(.8deg); font-size: .88rem; line-height: 1.4; }
.onb-side-note b { display: block; font-family: var(--font-hand); font-weight: 400; font-size: 1.05rem; margin-bottom: .15rem; }
:root[data-theme="dark"] .onb-side-note { border-color: #000; }
.onb-side { display: none; }

/* «Preparo la tua prima settimana…» mentre il server crea il locale */
@media (prefers-reduced-motion: no-preference) {
  .onb-anim > * { animation: onb-arrive .45s cubic-bezier(.2,.9,.3,1) both; }
  .onb-anim > :nth-child(2) { animation-delay: .04s; } .onb-anim > :nth-child(3) { animation-delay: .08s; } .onb-anim > :nth-child(n+4) { animation-delay: .12s; }
  .onb-ul path { stroke-dasharray: 160; stroke-dashoffset: 160; animation: onb-draw .7s .2s ease forwards; }
  .onb-done { animation: onb-pop .5s cubic-bezier(.3,1.6,.5,1) both .15s; }
}
@keyframes onb-arrive { from { opacity: 0; transform: translateY(10px); } }
@keyframes onb-draw { to { stroke-dashoffset: 0; } }
@keyframes onb-pop { 0% { opacity: 0; transform: scale(.6); } 70% { opacity: 1; transform: scale(1.08); } }

/* telefono: bottone principale fisso in basso */
@media (max-width: 899px) {
  .onb-sheet { border-radius: 4px 16px 4px 16px; padding: 1rem .9rem 1.1rem; box-shadow: 3px 3px 0 var(--zinc-900); }
  .onb-cta.fix { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0; padding: .65rem 16px calc(.65rem + env(safe-area-inset-bottom, 0px)); background: var(--zinc-50); border-top: 2px solid var(--zinc-900); }
  .onb-band .onb-time { display: none; }
  .onb-wow { text-align: center; }
  .onb-wow .onb-count { justify-content: center; }
  .onb-wow .onb-ul { margin-left: auto; margin-right: auto; }
  .onb-wow .onb-phone { width: 15.5rem; }
  .onb-wow .onb-scr { min-height: 12rem; }
  .onb-next { text-align: left; }
}
@media (max-width: 420px) {
  .onb-sheet h1 { font-size: 1.6rem; }
  .onb-mini th:first-child { width: 3.6rem; }
  .onb-mini td.n { font-size: .74rem; }
}
@media (min-width: 900px) {
  .onb { padding: 0 1.5rem 3rem; zoom: .82; } /* la radice cresce coi PC (html 20-25 px): il foglio resta alla misura di lettura */
  .onb-grid { grid-template-columns: minmax(0, 1fr) 17rem; gap: 2rem; }
  .onb-grid.solo { grid-template-columns: minmax(0, 1fr); max-width: 60rem; margin: 0 auto; }
  .onb-side { display: block; position: sticky; top: 1rem; }
  .onb-band { min-height: 2.8rem; }
  .onb-prog { margin: 0 0 .8rem; }
  .onb-sheet { padding: 1.3rem 1.6rem 1.3rem; }
  .onb-sheet h1 { font-size: 2.1rem; }
  .onb-wow-grid { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 2rem; align-items: center; }
  .onb-wow-ph { margin-top: 0; }
  .onb-mini { font-size: .85rem; }
  .onb-mini td { height: 2.4rem; font-size: .7rem; }
  .onb-mini th { font-size: .74rem; }
  .onb-cta { max-width: 34rem; }
  /* compatto: il bottone principale resta sopra la piega anche a 1280x800 */
  .onb-band { min-height: 2.4rem; padding: 0; }
  .onb-prog li { padding: .3rem .2rem; }
  .onb-sub { margin-bottom: .6rem; }
  .onb-lab { margin: .7rem 0 .35rem; }
  .onb-cta { margin-top: .8rem; }
  .onb-go { min-height: 2.9rem; }
  .onb-phone { width: 15.5rem; border-radius: 1.9rem; padding: .55rem .45rem .7rem; }
  .onb-scr { min-height: 19rem; border-radius: 1.4rem; font-size: .74rem; }
  .onb-side-note { max-width: 15.5rem; font-size: .82rem; }
}
/* schermi grandi (titolare, 3/11: «troppo piccolo, sfruttiamo lo spazio»): largo fino a ~92vw (max 1700 px veri; lo zoom .82
   dimezza la crescita della radice, quindi le misure si dividono per .82), colonna del telefono piu' larga, il foglio centrato
   in verticale nello spazio che resta. Niente rem in piu': html cresce gia' da solo. */
@media (min-width: 1500px) {
  .onb { max-width: min(calc(92vw / .82), calc(1700px / .82)); min-height: calc((100vh - 4.5rem) / .82); display: flex; flex-direction: column; }
  .onb-grid { grid-template-columns: minmax(0, 1fr) 20rem; gap: 2.4rem; margin-block: auto; width: 100%; }
  .onb-grid.solo { max-width: none; grid-template-columns: minmax(0, 1fr); }
  .onb-sheet { padding: 1.6rem 2rem 1.6rem; }
  .onb-phone { width: 18.5rem; }
  .onb-scr { min-height: 22rem; font-size: .8rem; }
  .onb-side-note { max-width: 18.5rem; font-size: .88rem; }
  .onb-cta { max-width: 40rem; }
  .onb-wow-grid { grid-template-columns: minmax(0, 1fr) 20rem; }
}
@media (prefers-reduced-motion: reduce) { .onb *, .onb *::after { animation: none !important; transition: none !important; } }

/* === PERSONALE === (agente DP, 3/11) Personale (employees.php) e pagina «Impostazioni del locale» (/impostazioni, stessa vista).
   Regole: tre comandi in alto, scheda della persona Dati / Mansioni e ore / Disponibilità / Giorni liberi, salvataggio automatico
   con «Salvato ✓» e «Annulla». Solo variabili del tema (anche verde delle farmacie). Prefisso .dp- */
.dp-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: 1rem; }
.dp-sub { font-size: .9rem; color: var(--zinc-600); margin: 0 0 .3rem; }
html body .emp-tools { align-items: center; }
html body .emp-tools .toolbar-action { min-height: 44px; font-size: .92rem; font-weight: 700; padding: .4rem .95rem; box-shadow: 2px 2px 0 var(--zinc-900); }
html body .emp-tools .toolbar-action.emp-add-primary { background: var(--zinc-900); color: var(--panel); border-color: var(--zinc-900); }
html body .emp-tools .toolbar-action .tb-count { font-family: 'Space Mono', monospace; }
.dp-settings-link { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .3rem; font-weight: 700; font-size: .9rem;
  color: var(--zinc-700); text-decoration: underline wavy var(--zinc-300); text-underline-offset: 5px; white-space: nowrap; }
.dp-settings-link:hover { color: var(--zinc-900); }
@media (max-width: 560px) {
  html body .emp-tools { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: .45rem; }
  html body .emp-tools > .emp-add-primary { grid-column: 1 / -1; justify-content: center; }
  html body .emp-tools > .toolbar-action { justify-content: center; padding: .35rem .5rem; font-size: .86rem; }
  html body .emp-tools > .dp-settings-link { grid-column: 1 / -1; justify-self: start; min-height: 36px; }
}

/* --- Impostazioni del locale: indice + sezione --- */
.dp-set-head { margin-bottom: .8rem; }
html body #venue-settings-overlay.dp-set { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }
.dp-idx { display: flex; flex-direction: column; border: 2px solid var(--zinc-900); border-radius: 4px 10px 4px 10px; background: var(--panel); overflow: hidden; }
.dp-idx-h { padding: .55rem .85rem .2rem; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--zinc-500); border-top: 2px solid var(--zinc-200); }
.dp-idx-h:first-child { border-top: 0; }
html body .dp-idx .dp-idx-i { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: .05rem .65rem; align-items: center; width: 100%; min-height: 58px;
  margin: 0; padding: .5rem .85rem; border: 0; border-top: 1px dashed var(--zinc-300); border-radius: 0; background: transparent; box-shadow: none;
  color: var(--zinc-900); text-align: left; text-decoration: none; font: inherit; cursor: pointer; transform: none; }
.dp-idx-h + .dp-idx-i { border-top: 0; }
.dp-idx-i svg { width: 22px; height: 22px; grid-row: 1 / span 2; color: var(--zinc-700); }
.dp-idx-i b { font-size: .98rem; font-weight: 700; line-height: 1.2; }
.dp-idx-i small { grid-column: 2; font-size: .8rem; color: var(--zinc-500); line-height: 1.3; overflow-wrap: anywhere; }
.dp-idx-i .dp-ch { grid-row: 1 / span 2; grid-column: 3; color: var(--zinc-500); font-size: 1.3rem; line-height: 1; }
html body .dp-idx .dp-idx-i:hover { background: var(--zinc-100); }
html body .dp-idx .dp-idx-i.active { background: var(--zinc-900); color: var(--panel); }
.dp-idx-i.active svg, .dp-idx-i.active small, .dp-idx-i.active .dp-ch { color: var(--zinc-300); }
.dp-pane-wrap { min-width: 0; }
html body .dp-back { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; margin: 0 0 .2rem; padding: 0 .2rem; border: 0; background: none; box-shadow: none;
  color: var(--zinc-700); font-weight: 700; font-size: .92rem; cursor: pointer; }
.dp-pane-title { font-family: 'Permanent Marker', cursive; font-weight: 400; font-size: 1.5rem; margin: 0 0 .15rem; color: var(--zinc-900); }
.dp-status { display: inline-flex; align-items: center; gap: .35rem; margin: 0 0 .8rem; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--zinc-600); background: var(--zinc-100); }
.dp-status.ok { color: var(--ok-ink); background: var(--ok-bg); }
.dp-status.bad { color: var(--err-ink); background: var(--err-bg); }
.dp-unsaved { outline: 2px solid var(--err-ink) !important; outline-offset: 2px; }
#venue-settings-overlay .vs-form { display: block; margin: 0; }
#venue-settings-overlay .vs-body { padding: 0; overflow: visible; }
#venue-settings-overlay .vs-set-card { border: 2px solid var(--zinc-200); border-radius: 4px 10px 4px 10px; background: var(--panel); }
#venue-settings-overlay .vs-pane[data-pane="hours"]:first-of-type > .vs-hint:first-child { margin-top: 0; }
/* telefono: o l'indice o la sezione */
@media (max-width: 899px) {
  .dp-set.is-open .dp-idx, .dp-set.is-open ~ * .dp-idx { display: none; }
  .dp-set:not(.is-open) .dp-pane-wrap { display: none; }
  .dp-set-head.dp-open { display: none; } /* .dp-open la mette showTab() in employees.php (prima body:has(.dp-set.is-open)) */
  html body .dp-set:not(.is-open) .dp-idx .dp-idx-i.active { background: transparent; color: var(--zinc-900); }
  .dp-set:not(.is-open) .dp-idx-i.active svg { color: var(--zinc-700); } .dp-set:not(.is-open) .dp-idx-i.active small { color: var(--zinc-500); }
}
@media (min-width: 900px) {
  html body #venue-settings-overlay.dp-set { grid-template-columns: minmax(270px, 320px) minmax(0, 1fr); gap: 1.4rem; }
  .dp-idx { position: relative; }
  html body .dp-idx .dp-idx-i { min-height: 50px; padding: .4rem .8rem; }
  html body .dp-back { display: none; }
  .dp-pane-wrap { border: 2px solid var(--zinc-900); border-radius: 4px 12px 4px 12px; background: var(--panel); padding: 1rem 1.2rem 1.2rem; }
  #venue-settings-overlay .vs-pane[data-pane="turni"]:not([hidden]),
  #venue-settings-overlay .vs-pane[data-pane="indirizzo"]:not([hidden]) { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; align-items: start; }
  #venue-settings-overlay .vs-pane[data-pane="turni"] > #vs-staffing-wrap { grid-column: 1 / -1; }
}
@media (min-width: 1500px) { html body #venue-settings-overlay.dp-set { grid-template-columns: 340px minmax(0, 1fr); } }

/* avviso «… salvato · Annulla» (5 secondi) */
.dp-toast { position: fixed; left: 50%; bottom: calc(5.4rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 9500; display: flex; align-items: center; gap: .9rem;
  max-width: calc(100vw - 32px); padding: .5rem .6rem .5rem 1rem; border-radius: 4px 10px 4px 10px; background: var(--zinc-900); color: var(--panel);
  font-weight: 700; font-size: .92rem; box-shadow: 3px 3px 0 rgba(0,0,0,.25); }
.dp-toast span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body .dp-toast button { flex: none; min-height: 38px; margin: 0; padding: 0 .8rem; border: 2px solid var(--panel); border-radius: 4px 10px 4px 10px; background: transparent; color: var(--panel); font-weight: 800; box-shadow: none; }
@media (min-width: 900px) { .dp-toast { bottom: 1.4rem; } }
@media (prefers-reduced-motion: no-preference) {
  .dp-toast { animation: dp-toast-in .25s cubic-bezier(.22,.85,.32,1) both; }
  @keyframes dp-toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
  .dp-set.is-open .dp-pane-wrap { animation: dp-pane-in .22s ease-out both; }
  @keyframes dp-pane-in { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
}

/* --- Scheda della persona (3/11): Dati / Mansioni e ore / Disponibilità / Giorni liberi; al computer «Dati e mansioni» --- */
.dp-sec { border: 2px solid var(--zinc-200); border-radius: 4px 10px 4px 10px; background: var(--panel); padding: .6rem .8rem .7rem; margin: 0 0 .7rem; }
.dp-sec[hidden] { display: none; }
.dp-sec-h { display: flex; align-items: center; gap: .5rem; margin: 0 0 .45rem; font-size: .98rem; font-weight: 800; color: var(--zinc-900); }
.dp-f { display: block; margin: .45rem 0 .2rem; }
.dp-f > span { display: flex; align-items: baseline; gap: .5rem; font-size: .82rem; font-weight: 700; color: var(--zinc-600); }
.dp-f i, .dp-opt { font-style: normal; font-weight: 600; font-size: .78rem; color: var(--zinc-500); margin-left: auto; }
.dp-saved { font-style: normal; font-size: .74rem; font-weight: 800; color: var(--ok-ink); background: var(--ok-bg); border-radius: 999px; padding: 0 .5rem; }
.dp-saved[hidden] { display: none; }
.dp-help { font-size: .8rem; color: var(--zinc-500); margin: .25rem 0 0; line-height: 1.35; }
.dp-mono { font-family: "Space Mono", monospace !important; letter-spacing: .02em; }
#sheet-matricola.dp-mono { text-transform: none; }
html body #emp-sheet-panel .dp-sec input[type="text"], html body #emp-sheet-panel .dp-sec input[type="tel"], html body #emp-sheet-panel .dp-sec input[type="email"], html body #emp-sheet-panel .dp-sec select { width: 100%; margin: 0; min-height: 42px; }
html body #emp-sheet-panel .dp-name-row { display: flex; gap: .4rem; margin: 0 !important; }
html body #emp-sheet-panel .dp-name-row input { flex: 1; min-width: 0; }
.dp-t-pc { display: none; }
/* mansioni: un solo elenco, la stella e' la principale */
.dp-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.dp-chip { display: inline-flex; align-items: stretch; border: 2px solid var(--zinc-300); border-radius: 4px 10px 4px 10px; background: var(--panel); overflow: hidden; }
html body .dp-chip button { margin: 0; min-height: 40px; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--zinc-700); font: 700 .88rem 'Quicksand', sans-serif; cursor: pointer; transform: none; }
html body .dp-chip .dp-star { width: 34px; padding: 0; font-size: 1.05rem; color: var(--zinc-500); border-right: 1px dashed var(--zinc-300); }
html body .dp-chip .dp-chip-name { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .75rem .2rem .55rem; }
.dp-chip .qb-role-pick-icon svg { width: 1.05rem; height: 1.05rem; }
.dp-chip.on { border-color: var(--zinc-900); background: var(--zinc-900); }
html body .dp-chip.on button, html body .dp-chip.on .dp-star { color: var(--panel); border-color: color-mix(in srgb, var(--panel) 35%, transparent); }
.dp-chip.main { border-color: var(--brand-700); background: var(--brand-700); }
html body .dp-chip.main button, html body .dp-chip.main .dp-star { color: #fff; border-color: rgba(255,255,255,.35); }
/* fondo della scheda */
html body #emp-sheet-footer.dp-foot { display: flex !important; flex-direction: row !important; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .8rem !important;
  border-top: 2px solid var(--zinc-200); background: var(--panel); }
.dp-foot-danger { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; min-width: 0; }
.dp-foot-q { font-size: .82rem; color: var(--zinc-500); }
html body .dp-ghost { width: auto; min-height: 40px !important; margin: 0; padding: .2rem .45rem !important; border: 0 !important; background: transparent !important; box-shadow: none !important;
  color: var(--zinc-700) !important; font-size: .86rem !important; font-weight: 700; text-decoration: underline wavy var(--zinc-300); text-underline-offset: 4px; }
html body .dp-ghost.dp-red { color: var(--err-ink) !important; text-decoration-color: color-mix(in srgb, var(--err-ink) 40%, transparent); }
html body .dp-ghost svg { width: 1em; height: 1em; vertical-align: -2px; }
html body #emp-sheet-footer .dp-close { min-height: 44px !important; min-width: 9rem; margin: 0; padding: .3rem 1.4rem; background: var(--zinc-900) !important; color: var(--panel) !important;
  border: 2px solid var(--zinc-900) !important; border-radius: 4px 10px 4px 10px; font-weight: 800; box-shadow: 2px 2px 0 var(--zinc-500) !important; }
@media (max-width: 560px) { html body #emp-sheet-footer .dp-close { flex: 1 1 100%; order: -1; } }
@media (min-width: 900px) {
  html body #emp-sheet-overlay { align-items: center; }
  html body #emp-sheet-panel { width: min(1180px, 95vw); max-width: min(1180px, 95vw); max-height: 92dvh; }
  .dp-t-ph { display: none; } .dp-t-pc { display: inline; }
  html body #emp-sheet-panel .emp-tab.dp-tab-roles { display: none; }
  html body #emp-sheet-panel > .emp-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 1rem; align-content: start; }
  html body #emp-sheet-panel .emp-tab-panel { grid-column: 1 / -1; }
  html body #emp-sheet-panel .emp-tab-panel[data-tab-panel="anagrafica"] { grid-column: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 1rem; align-items: start; }
  html body #emp-sheet-panel .emp-tab-panel[data-tab-panel="ruoli"] { grid-column: 2; }
  html body #emp-sheet-panel .emp-tab-panel[hidden] { display: none; }
  #emp-sheet-panel .dp-sec { padding: .5rem .75rem .6rem; margin-bottom: .6rem; }
}

/* --- Aggiungi persona (3/11): mansione a pillole, un solo pulsante --- */
.dp-pills { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .6rem; }
.dp-pill { position: relative; margin: 0; cursor: pointer; }
.dp-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.dp-pill span { display: inline-flex; align-items: center; min-height: 40px; padding: .2rem .85rem; border: 2px solid var(--zinc-300); border-radius: 4px 10px 4px 10px;
  background: var(--panel); color: var(--zinc-700); font: 700 .88rem 'Quicksand', sans-serif; }
.dp-pill input:checked + span { background: var(--zinc-900); border-color: var(--zinc-900); color: var(--panel); }
.dp-pill input:focus-visible + span { outline: 3px solid var(--brand-500, #f5c84c); outline-offset: 2px; }
#add-employee-overlay .sheet-panel { position: relative; }
#add-employee-overlay .qb-x { position: absolute; top: .7rem; right: .7rem; }
#add-employee-overlay .dp-add-submit { width: 100%; min-height: 48px; margin-top: .8rem; font-weight: 800; }
#add-email-row[hidden], #add-new-fields[hidden], .dp-existing[hidden], .dp-suggest[hidden] { display: none !important; }
.dp-suggest { display: flex; flex-direction: column; gap: .3rem; margin: -.2rem 0 .6rem; }
html body .dp-suggest-i { display: flex; flex-direction: column; align-items: flex-start; width: 100%; margin: 0; padding: .45rem .7rem; border: 2px dashed var(--zinc-900); border-radius: 4px 10px 4px 10px;
  background: var(--postit); color: var(--postit-ink); box-shadow: none; text-align: left; }
.dp-suggest-i small { font-size: .78rem; font-weight: 600; }
.dp-existing { margin: 0 0 .5rem; padding: .5rem .7rem; border: 2px solid var(--zinc-900); border-radius: 4px 10px 4px 10px; background: var(--panel); }
.dp-existing p { margin: 0 0 .2rem; font-size: .88rem; font-weight: 600; }

/* --- Impostazioni del locale: interruttori al posto delle caselle di sistema, colonne al computer --- */
#venue-settings-overlay .vs-switch input[type="checkbox"], form[action="/employees/share"] input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; width: 46px !important; height: 26px; margin: 0 !important; border: 2px solid var(--zinc-900); border-radius: 999px;
  background: var(--zinc-200); position: relative; cursor: pointer; transition: background .15s; }
#venue-settings-overlay .vs-switch input[type="checkbox"]::after, form[action="/employees/share"] input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--zinc-900); transition: left .15s; }
#venue-settings-overlay .vs-switch input[type="checkbox"]:checked, form[action="/employees/share"] input[type="checkbox"]:checked { background: var(--brand-600); }
#venue-settings-overlay .vs-switch input[type="checkbox"]:checked::after, form[action="/employees/share"] input[type="checkbox"]:checked::after { left: 22px; background: #fff; }
#venue-settings-overlay .vs-switch input[type="checkbox"]:disabled { opacity: .55; cursor: default; }
/* 19/11: acceso/spento si capisce a colpo d'occhio: spento = vuoto, grigio, pallino a sinistra; acceso = pieno verde, pallino scuro a destra con la spunta */
#venue-settings-overlay .vs-switch input[type="checkbox"], form[action="/employees/share"] input[type="checkbox"] { width: 44px !important; height: 24px; border: 2px solid var(--zinc-400); background: transparent; }
#venue-settings-overlay .vs-switch input[type="checkbox"]::after, form[action="/employees/share"] input[type="checkbox"]::after { top: 2px; left: 2px; width: 16px; height: 16px; background: var(--zinc-400); }
#venue-settings-overlay .vs-switch input[type="checkbox"]:checked, form[action="/employees/share"] input[type="checkbox"]:checked { background: #2f9e6b !important; border-color: #2f9e6b !important; }
#venue-settings-overlay .vs-switch input[type="checkbox"]:checked::after, form[action="/employees/share"] input[type="checkbox"]:checked::after { left: 22px; background: #fff !important; }
#venue-settings-overlay .vs-switch input[type="checkbox"]:checked::before, form[action="/employees/share"] input[type="checkbox"]:checked::before { content: "✓"; position: absolute; left: 7px; top: -1px; font-size: 13px; font-weight: 900; line-height: 20px; color: #fff; }
#venue-settings-overlay .vs-switch { align-items: center; }
#venue-settings-overlay input[type="checkbox"] { accent-color: var(--brand-600); }
.dp-mine { font-size: .74rem; font-weight: 700; color: var(--zinc-500); margin-left: auto; }
html body .dp-idx .dp-idx-i { white-space: normal; overflow: visible; }
.dp-idx-i b { overflow-wrap: anywhere; }
form[action="/employees/share"].card { margin: 0 !important; }
@media (min-width: 900px) {
  #venue-settings-overlay .vs-pane[data-pane="turni"]:not([hidden]), #venue-settings-overlay .vs-pane[data-pane="indirizzo"]:not([hidden]) { display: contents; }
  #venue-settings-overlay .vs-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; align-items: start; }
  #venue-settings-overlay .vs-body > .vs-pane:not([hidden]) { grid-column: 1 / -1; }
  #venue-settings-overlay .vs-pane > #vs-staffing-wrap, #venue-settings-overlay .vs-pane > .vs-hint, #venue-settings-overlay .vs-pane > script, #venue-settings-overlay .vs-pane > style { grid-column: 1 / -1; }
  /* 5/11 (titolare): un giorno per riga, da lunedi' a domenica. In due colonne la domenica finiva sotto a sinistra e gli orari
     si leggevano a meta' («11:3»). Righe non piu' larghe del necessario, cosi' orari e «+ Pausa» restano vicini. */
  #venue-settings-overlay .vs-pane[data-pane="hours"]:not([hidden]) { display: grid; grid-template-columns: minmax(0, 52rem); gap: 0; align-items: start; }
  #venue-settings-overlay .vs-pane[data-pane="hours"] > :not(.vs-day) { grid-column: 1 / -1; }
}
:root[data-theme="dark"] .dp-chip.main button, :root[data-theme="dark"] .dp-chip.main .dp-star { color: #1c1214 !important; }
@media (min-width: 900px) { #emp-sheet-panel .dp-help { font-size: .76rem; } #emp-sheet-panel .dp-f { margin-top: .3rem; } }
html body #emp-sheet-panel #sheet-regen-link .rg-txt { display: inline; } html body #emp-sheet-panel #sheet-regen-link { color: var(--zinc-700) !important; }
@media (min-width: 900px) and (max-height: 900px) {
  html body #emp-sheet-panel .dp-chip button { min-height: 34px; font-size: .84rem; }
  html body #emp-sheet-panel .dp-sec-h { margin-bottom: .25rem; font-size: .92rem; }
  html body #emp-sheet-panel .emp-rate-row { padding: .3rem .7rem; }
  html body #emp-sheet-panel .dp-sec input[type="text"], html body #emp-sheet-panel .dp-sec input[type="tel"], html body #emp-sheet-panel .dp-sec input[type="email"], html body #emp-sheet-panel .dp-sec select { min-height: 38px; }
  html body #emp-sheet-panel .toggle-row { min-height: 38px; }
}
@media (min-width: 900px) and (max-height: 900px) { html body #emp-sheet-panel .dp-sec { margin-bottom: .45rem; } html body #emp-sheet-panel .emp-link-row { margin-top: .4rem; } }
@media (min-width: 900px) and (max-height: 900px) { html body #emp-sheet-panel > .emp-body { padding-bottom: .2rem; } html body #emp-sheet-panel .emp-rate-row { margin-bottom: 0; } }
@media (min-width: 900px) and (max-height: 900px) { html body #emp-sheet-panel .emp-tab-panel { padding-top: .25rem; } }
.dp-ghost .dp-opt { margin-left: .35rem; }
/* Mansioni e zone: prima le mansioni (il comando), poi gli aiuti e le zone */
#venue-settings-overlay .vs-pane[data-pane="roles"]:not([hidden]) { display: flex; flex-direction: column; }
#venue-settings-overlay .vs-pane[data-pane="roles"] > .vs-hint { order: 4; margin: .5rem 0 0; }
#venue-settings-overlay .vs-pane[data-pane="roles"] > #vs-zones { order: 5; margin-top: .8rem; }

/* --- Elenco di Personale (3/11, mockup «Dopo: due colonne, stato a destra»): righe da 48 px sulle righe della carta
   (passo 24 px dentro l'elenco), nome e sotto la mansione, bollino di stato a destra; 1 colonna al telefono, 2 al computer,
   3 sopra i 1600 px. I gruppi per mansione restano a tutta larghezza. Vince sulla proposta 7 (sezione di base). */
html body #employee-list.dp-list { --dp-l: 24px; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 2rem; align-items: stretch;
  margin-top: .6rem !important; padding: 0 !important; background-color: var(--zinc-50) !important; /* 4/11: pieno, se no sotto passano anche le righe del foglio (passo 35 px) e le righe si doppiano sui nomi */
  background-image: repeating-linear-gradient(transparent 0 calc(var(--dp-l) - 1px), var(--zinc-200) calc(var(--dp-l) - 1px) var(--dp-l)) !important;
  border-bottom: 0; }
html body #employee-list.dp-list > .emp-group-head { grid-column: 1 / -1; height: calc(var(--dp-l) * 2) !important; line-height: 1 !important; margin: 0 !important;
  padding: 0 0 4px 4px !important; display: flex; align-items: flex-end; gap: .45rem; border: 0 !important;
  font-family: 'Permanent Marker', cursive !important; font-size: 1.05rem !important; letter-spacing: .02em !important; text-transform: uppercase !important; color: var(--brand-700) !important; }
html body #employee-list.dp-list > .emp-group-head small { font-family: 'Space Mono', monospace; font-size: .78rem; color: var(--zinc-500); letter-spacing: 0; opacity: 1; }
html body #employee-list.dp-list > .emp-row { height: calc(var(--dp-l) * 2) !important; min-height: 0 !important; margin: 0 !important; padding: 0 .35rem 0 .2rem !important;
  display: grid !important; grid-template-columns: 34px minmax(0, 1fr) auto 14px; align-items: center !important; gap: .7rem !important;
  border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; transform: none !important; text-align: left; }
html body #employee-list.dp-list > .emp-row::before { display: none !important; }
html body #employee-list.dp-list .emp-row .avatar { align-self: center !important; margin: 0 !important; width: 34px !important; height: 34px !important; min-width: 34px !important;
  font-size: .8rem !important; border-width: 2px !important; background: var(--panel) !important; }
html body #employee-list.dp-list .emp-row .emp-info { display: flex !important; flex-direction: column; align-items: flex-start !important; justify-content: center; gap: 0; min-width: 0;
  align-self: center !important; padding: 0 !important; line-height: 1.2; }
html body #employee-list.dp-list .emp-row .name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem !important; font-weight: 700 !important; color: var(--zinc-900); }
html body #employee-list.dp-list .emp-row .meta { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'Quicksand', sans-serif !important;
  font-size: .8rem !important; color: var(--zinc-500) !important; }
html body #employee-list.dp-list .emp-row .chevron { align-self: center !important; padding: 0 !important; color: var(--zinc-500); font-size: 1.1rem; }
html body #employee-list.dp-list .emp-row.inactive .name, html body #employee-list.dp-list .emp-row.inactive .avatar { opacity: .55; }
html body #employee-list.dp-list .emp-row:hover, html body #employee-list.dp-list .emp-row:focus-visible { background: color-mix(in srgb, var(--brand-50) 70%, transparent) !important; }
html body #employee-list.dp-list > .emp-add-row { grid-column: 1 / -1; height: calc(var(--dp-l) * 2); margin: var(--dp-l) 0 0 !important; padding: 0 !important; }
.dp-tag { justify-self: end; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .05rem .5rem; border: 1.5px solid var(--zinc-300); border-radius: 999px;
  font-size: .72rem; font-weight: 700; color: var(--zinc-600); background: var(--panel); }
.dp-tag.none { border: 0; padding: 0; background: none; }
.dp-tag.warn { border-color: var(--warn-ink); color: var(--warn-ink); background: var(--warn-bg); }
.dp-tag.off { border-style: dashed; color: var(--zinc-500); }
.dp-tag.mono { font-family: 'Space Mono', monospace; font-weight: 400; }
@media (max-width: 420px) { .dp-tag { max-width: 7.5rem; font-size: .68rem; } }
@media (min-width: 900px) { html body #employee-list.dp-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1600px) { html body #employee-list.dp-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* 5/11 (titolare: «le righe non combaciano»): l'elenco aveva un suo foglio a righe ogni 24 px dentro la pagina a righe ogni 35 px.
   Ora un foglio solo: niente sfondo proprio, passo 35 px come la pagina, titolo su una riga, persona su due (nome sulla prima,
   mansione sulla seconda, appoggiati alle righe). Che l'elenco cominci proprio su una riga lo fa qbSnapToPaper() in employees.php. */
html body #employee-list.dp-list { --dp-l: 35px; background: transparent !important; }
html body #employee-list.dp-list > .emp-group-head { height: var(--dp-l) !important; padding: 0 0 5px 4px !important; }
html body #employee-list.dp-list .emp-row .emp-info { display: grid !important; grid-template-rows: var(--dp-l) var(--dp-l); grid-template-columns: minmax(0, 1fr); align-items: end !important; justify-items: start; justify-content: start !important; align-content: start !important; text-align: left; height: calc(var(--dp-l) * 2); }
html body #employee-list.dp-list .emp-row .emp-info > * { padding-bottom: 5px; line-height: 1.15; }
html body #employee-list.dp-list .emp-row .avatar { align-self: end !important; margin-bottom: calc(var(--dp-l) - 34px + 2px) !important; }
html body #employee-list.dp-list .emp-row .chevron, html body #employee-list.dp-list .emp-row .dp-tag { align-self: end !important; margin-bottom: 7px; }
@media (min-width: 561px) { html body .dp-head > .emp-tools { flex: 1 1 100%; } html body .dp-head .dp-settings-link { margin-left: auto; } }

/* === DASHBOARD === (agente DD, 3/11) Dashboard del gruppo (dashboard.php): una scheda per locale con stato, tre numeri,
   copertura PER MANSIONE (nomi con un tocco, <details>) e azioni; stessi bottoni e numeri a macchina nel resto della pagina. */
.dd-grid, .dd-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin: .4rem 0 1.6rem; align-items: start; }
@media (min-width: 900px) { .dd-grid, .dd-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dd-card { --vc: var(--brand-600); display: flex; flex-direction: column; gap: .85rem; min-width: 0; padding: .95rem 1rem 1rem;
  background: var(--panel); border: 2px solid var(--zinc-900); border-top: 7px solid var(--vc); border-radius: 4px 12px 4px 12px;
  box-shadow: 3px 3px 0 rgba(28,18,20,.16); }
.dd-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.dd-name { display: flex; align-items: center; gap: .5rem; margin: 0; min-width: 0; font-family: var(--font-hand) !important; font-weight: 400;
  font-size: var(--fs-lg) !important; line-height: 1.2; color: var(--zinc-900); }
.dd-name i { width: .8rem; height: .8rem; border-radius: 50%; background: var(--vc); flex: none; }
.dd-state { flex: none; font-size: var(--fs-xs); font-weight: 800; padding: .2rem .6rem; border: 2px solid var(--zinc-900); border-radius: 4px 10px 4px 10px; white-space: nowrap; }
.dd-state.published { background: var(--ok-bg); color: var(--ok-ink); }
.dd-state.draft { background: var(--postit); color: var(--postit-ink); border-style: dashed; }
.dd-state.incomplete { background: var(--err-bg); color: var(--err-ink); }
.dd-state.empty { color: var(--zinc-500); border-color: var(--zinc-300); }
/* tre numeri grandi */
.dd-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.dd-num { display: flex; flex-direction: column; gap: .1rem; padding: .5rem .6rem; border: 2px solid var(--zinc-300); border-radius: 4px 10px 4px 10px; min-width: 0; }
.dd-num b { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: var(--fs-2xl); font-weight: 700; line-height: 1.05; color: var(--zinc-900); }
.dd-num span { font-size: var(--fs-xs); font-weight: 700; color: var(--zinc-600); line-height: 1.2; }
.dd-num.bad { background: var(--err-bg); border-color: var(--err-ink); } .dd-num.bad b, .dd-num.bad span { color: var(--err-ink); }
.dd-num.ok b { color: var(--ok-ink); }
.dd-num.warn { background: var(--warn-bg); border-color: var(--warn-ink); } .dd-num.warn b, .dd-num.warn span { color: var(--warn-ink); }
/* copertura per mansione: una riga di carta per mansione */
.dd-roles { display: flex; flex-direction: column; border-top: 1px solid var(--zinc-200); }
.dd-role { border-bottom: 1px solid var(--zinc-200); }
.dd-role > summary { display: grid; grid-template-columns: .75rem minmax(0, 1fr) minmax(3.5rem, 7rem) 3.3rem auto; align-items: center; gap: .55rem;
  min-height: 2.5rem; padding: 0 .35rem; cursor: pointer; list-style: none; border-radius: 4px; }
.dd-role > summary::-webkit-details-marker { display: none; }
.dd-role > summary::after { content: ''; width: .45rem; height: .45rem; border-right: 2px solid var(--zinc-500); border-bottom: 2px solid var(--zinc-500);
  transform: rotate(-45deg); transition: transform .15s ease; margin-right: .2rem; }
.dd-role[open] > summary::after { transform: rotate(45deg); }
.dd-role > summary:hover { background: var(--zinc-100); }
.dd-role > summary:focus-visible { outline: 2px solid var(--zinc-900); outline-offset: 1px; }
.dd-role .dot { width: .75rem; height: .75rem; border-radius: 50%; background: var(--rc, var(--zinc-400)); }
.dd-role .nm { font-weight: 800; font-size: var(--fs-sm); color: var(--zinc-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-bar { height: .55rem; border-radius: 999px; background: var(--zinc-200); overflow: hidden; }
.dd-bar i { display: block; height: 100%; border-radius: 999px; background: var(--rc, var(--zinc-500)); }
.dd-role .cov { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; font-size: var(--fs-sm); text-align: right; color: var(--zinc-700); }
.dd-role .miss { display: none; }
.dd-role > summary { grid-template-columns: .75rem minmax(0, 1fr) minmax(3.5rem, 7rem) 3.3rem .65rem; }
/* buco in evidenza: riga rossa a post-it, «manca N» */
.dd-role.gap > summary { grid-template-columns: .75rem minmax(0, 1fr) minmax(3rem, 6rem) 3.3rem auto .65rem; background: var(--err-bg); }
.dd-role.gap .nm, .dd-role.gap .cov { color: var(--err-ink); }
.dd-role.gap .dd-bar { background: repeating-linear-gradient(-45deg, transparent 0 3px, color-mix(in srgb, var(--err-ink) 35%, transparent) 3px 5px); }
.dd-role.gap .miss { display: inline-block; font-size: var(--fs-xs); font-weight: 800; padding: .1rem .45rem; border-radius: 4px 8px 4px 8px; background: var(--err-ink); color: var(--panel); white-space: nowrap; }
.dd-ppl { list-style: none; margin: 0; padding: .2rem .4rem .55rem 1.65rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .1rem .9rem; }
.dd-ppl li { display: flex; gap: .5rem; align-items: baseline; font-size: var(--fs-sm); line-height: 1.7; min-width: 0; }
.dd-ppl .t { font-family: var(--font-num); font-size: var(--fs-xs); color: var(--zinc-600); white-space: nowrap; }
.dd-ppl .p { font-weight: 700; color: var(--zinc-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-ppl-none { margin: 0; padding: .2rem 0 .5rem 1.65rem; font-size: var(--fs-sm); color: var(--zinc-500); }
.dd-empty { margin: 0; padding: .6rem .7rem; font-size: var(--fs-sm); font-weight: 700; color: var(--zinc-600); border: 2px dashed var(--zinc-300); border-radius: 4px 10px 4px 10px; }
.dd-issues > summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 800; color: var(--warn-ink); padding: .2rem 0; }
.dd-issues .td-issues { margin-top: .3rem; }
/* azioni in fondo, piu' visibili */
.dd-acts { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: auto; padding-top: .2rem; }
.dd-acts form { margin: 0; flex: 1 1 9rem; display: flex; }
html body button.dd-go, .dd-att, html body .dd-pub { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px; padding: .3rem 1rem;
  border: 2px solid var(--zinc-900) !important; border-radius: 4px 10px 4px 10px !important; font-weight: 800; font-size: var(--fs-sm); text-decoration: none; cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease; }
html body button.dd-go, html body button.dd-go:hover, html body .dd-pub, html body .dd-pub:hover { flex: 1; background: var(--brand-700) !important; color: #fff !important; box-shadow: 3px 3px 0 var(--zinc-900) !important; }
.dd-att { flex: 1 1 9rem; background: var(--panel); color: var(--zinc-900); box-shadow: 2px 2px 0 var(--zinc-900); }
.dd-att .qb-num { font-family: var(--font-num); }
html body button.dd-go:active, .dd-att:active, html body .dd-pub:active { transform: translate(2px,2px); box-shadow: none !important; }
html body .dd-pub { flex: 0 1 auto; }
/* resto della pagina: stessi bottoni, numeri a macchina, schede a due colonne */
html body .db-btn { border-radius: var(--qb-radius) !important; box-shadow: 2px 2px 0 var(--zinc-900); transition: transform .08s ease, box-shadow .08s ease; }
html body .db-btn:active { transform: translate(2px,2px); box-shadow: none; }
html body .db-btn.on { box-shadow: none; }
html body .db-kpi { border-top: 7px solid var(--zinc-900); box-shadow: 3px 3px 0 rgba(28,18,20,.16); }
html body .db-kpi .v { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; font-size: var(--fs-xl); }
html body .db-row { margin-bottom: 0; box-shadow: 3px 3px 0 rgba(28,18,20,.16); }
html body .db-name { font-family: var(--font-hand); font-weight: 400; font-size: var(--fs-lg); }
html body .db-cols .v { font-family: var(--font-num); font-size: var(--fs-sm); }
html body .db-actions form:first-child button[type="submit"], html body .db-actions form:first-child button[type="submit"]:hover { background: var(--zinc-900) !important; color: var(--panel) !important; }
html body .dd-publish { background: var(--postit); color: var(--postit-ink); transform: rotate(-.3deg); box-shadow: 3px 3px 0 rgba(28,18,20,.18); }
html body .dd-publish .t, html body .dd-publish .m { color: var(--postit-ink); }
:root[data-theme="dark"] .dd-card, :root[data-theme="dark"] .dd-state, html[data-theme="dark"] body button.dd-go, :root[data-theme="dark"] .dd-att,
html[data-theme="dark"] body .dd-pub, :root[data-theme="dark"] .db-row, :root[data-theme="dark"] .db-kpi, :root[data-theme="dark"] .td-dec { border-color: #000 !important; }
:root[data-theme="dark"] .dd-card { border-top-color: var(--vc) !important; box-shadow: 3px 3px 0 #000; }
:root[data-theme="dark"] .dd-state.empty { border-color: var(--zinc-300) !important; }
html[data-theme="dark"] body button.dd-go, html[data-theme="dark"] body button.dd-go:hover, html[data-theme="dark"] body .dd-pub, html[data-theme="dark"] body .dd-pub:hover { background: var(--brand-600) !important; color: var(--zinc-50) !important; box-shadow: 3px 3px 0 #000 !important; }
:root[data-theme="dark"] .dd-att, html[data-theme="dark"] body .db-btn { box-shadow: 2px 2px 0 #000; }
html[data-theme="dark"] body .db-kpi { border-top-color: var(--zinc-600) !important; box-shadow: 3px 3px 0 #000; }
html[data-theme="dark"] body .db-actions form:first-child button[type="submit"], html[data-theme="dark"] body .db-actions form:first-child button[type="submit"]:hover { background: var(--zinc-900) !important; color: var(--zinc-50) !important; }
@media (max-width: 480px) {
  .dd-num b { font-size: var(--fs-xl); }
  .dd-role > summary { grid-template-columns: .7rem minmax(0, 1fr) 3rem 3rem .6rem; gap: .4rem; }
  .dd-role.gap > summary { grid-template-columns: .7rem minmax(0, 1fr) 2.2rem 3rem auto .6rem; }
  .dd-ppl { padding-left: .6rem; grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .dd-role[open] .dd-ppl { animation: dd-open .18s ease-out; }
  @keyframes dd-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}
/* schermi molto grandi (2560): la radice smette di crescere, quindi niente zoom ridotto e piu' largo */
@media (min-width: 2200px) {
  .onb { zoom: 1; max-width: min(90vw, 2300px); min-height: calc(100vh - 4.5rem); }
  .onb-grid { grid-template-columns: minmax(0, 1fr) 22rem; }
  .onb-phone { width: 20rem; } .onb-side-note { max-width: 20rem; }
}

/* === PERSONALE: numero da controllare (5/11) === */
/* Avviso in alto se l'ultimo WhatsApp di qualcuno non e' arrivato per un problema del numero; il tocco mostra solo quelle persone. */
.emp-num-note { margin: 0 0 .7rem; }
.emp-num-note[hidden] { display: none; }
html body .emp-num-note button { display: flex; align-items: center; justify-content: space-between; gap: .8rem; width: 100%; min-height: 2.75rem; margin: 0; padding: .5rem .8rem;
  border: 1.5px solid var(--warn-ink) !important; border-radius: 4px 12px 4px 12px; background: var(--warn-bg) !important; color: var(--warn-ink) !important; box-shadow: none !important;
  font: inherit; font-size: .85rem; line-height: 1.4; text-align: left; cursor: pointer; }
html body .emp-num-note button span { flex: none; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
html body .emp-num-note button[aria-pressed="true"] { border-style: dashed !important; }
.dp-num-warn { color: var(--warn-ink) !important; font-weight: 600; }

/* QA 9/11: calendario a ~768 px — il nome della mansione si leggeva a meta' ("Lavap…"): senza l'icona (c'e' gia' il nome) ci sta intero;
   «Pubblica» e' fisso in basso e copriva l'ultima cella dei totali: la pagina lascia lo spazio sotto. */
@media (min-width: 640px) and (max-width: 1100px) {
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-pill > svg.qb-role-icon { display: none !important; }
  html.qb-dense body tr.pg-row:not(.pg-rolerow) .pg-pill { padding: 0 .1rem !important; }
}
html body:has(#publish-btn.qb-pub-fixed) main.app-main { padding-bottom: 5.5rem; }

/* 9/11 sera (titolare: «mi sembrano un po' piccoli i dipendenti in Personale»): nome, mansione, bollino di stato e iniziali piu'
   grandi. Le righe restano sulla carta (35 px a riga, 70 a persona): il nome sta in una riga da 35, la mansione nell'altra. */
html body #employee-list.dp-list { --dp-av: 48px; }
html body #employee-list.dp-list > .emp-row { grid-template-columns: var(--dp-av) minmax(0, 1fr) auto 14px; gap: .85rem !important; }
html body #employee-list.dp-list .emp-row .avatar { width: var(--dp-av) !important; height: var(--dp-av) !important; min-width: var(--dp-av) !important; font-size: 1.05rem !important; align-self: center !important; margin: 0 !important; }
html body #employee-list.dp-list .emp-row .name { font-size: 1.28rem !important; }
html body #employee-list.dp-list .emp-row .meta { font-size: 1rem !important; }
html body #employee-list.dp-list .emp-row .chevron { font-size: 1.4rem; margin-bottom: 4px; }
html body #employee-list.dp-list .dp-tag { font-size: .85rem; padding: .1rem .65rem; max-width: 14rem; }
html body #employee-list.dp-list > .emp-group-head { font-size: 1.25rem !important; }
html body #employee-list.dp-list > .emp-group-head small { font-size: .9rem; }
@media (max-width: 420px) { html body #employee-list.dp-list { --dp-av: 42px; } html body #employee-list.dp-list .emp-row .name { font-size: 1.15rem !important; } html body #employee-list.dp-list .emp-row .meta { font-size: .9rem !important; } html body #employee-list.dp-list .dp-tag { font-size: .75rem; } }

/* 19/11: interruttori delle Impostazioni chiari anche fuori dal vecchio pannello: spento = vuoto con pallino grigio a sinistra; acceso = verde con pallino bianco a destra */
.vs-switch input[type="checkbox"] { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 44px !important; min-width: 44px; height: 24px; margin: .1rem 0 0; border: 2px solid var(--zinc-400); border-radius: 999px; background: transparent; cursor: pointer; transition: background .15s, border-color .15s; }
.vs-switch input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--zinc-400); transition: left .15s, background .15s; }
.vs-switch input[type="checkbox"]:checked { background: #2f9e6b !important; border-color: #2f9e6b !important; }
.vs-switch input[type="checkbox"]:checked::after { left: 22px; background: #fff !important; }
.vs-switch input[type="checkbox"]:disabled { opacity: .55; cursor: default; }
