/* daCLOUD — cambi turno, magazzino, cassa: informazioni del prodotto
   I fogli di questa cartella si caricano in ordine (numero iniziale): l'ordine conta, i successivi
   rifiniscono i precedenti. */

/* ===================================================================== 2.54.0 — turni */
.plain-list { margin: 10px 0; padding-left: 18px; display: grid; gap: 4px; }
/* area personale: richieste di cambio turno */
.me-request-note { margin: 6px 0 0; font-size: var(--text-sm); color: #8a5a00; }
.me-request-late { margin: 6px 0 0; font-size: var(--text-sm); color: var(--muted); }
.me-requests { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.me-request { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface); }
.me-request > div { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.me-request > div strong { font-weight: 600; font-size: var(--text-base); }
.me-request > div small { color: var(--muted); }
.me-request-status { flex: 0 0 auto; font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.me-request.is-pending .me-request-status { background: #fff4d6; color: #8a5a00; }
.me-request.is-ok .me-request-status { background: var(--green-100); color: var(--green-700); }
.me-request.is-no .me-request-status { background: #fde7e5; color: var(--danger); }
/* pannello: richieste di cambio turno */
.req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.req-item { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface); }
.req-item.is-decided { opacity: .85; }
.req-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.req-item-head strong { flex: 1 1 auto; }
.req-item-reason { margin: 0; color: var(--ink-2); font-size: var(--text-base); }
.req-item-warn { margin: 6px 0 0; padding-left: 18px; color: #8a5a00; font-size: var(--text-sm); }
.req-item-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.req-item-actions input { flex: 1 1 200px; }
.badge-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--green-700); font-size: var(--text-xs); font-weight: 700; margin-left: 4px; }
.btn-secondary .badge-count { background: var(--green-600); color: #fff; }

/* ===================================================================== 2.55.0 — magazzino */
.inv-tabs { margin-bottom: 14px; }
.inv-filters { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); border-radius: 0; background: var(--surface-2); }
.inv-filters .search-box { flex: 1 1 220px; min-width: 180px; }
.inv-row.is-out td:first-child strong { color: var(--danger); }
.inv-kind { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: var(--text-xs); font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.inv-kind.is-sale { background: var(--green-100); color: var(--green-700); }
.inv-kind.is-load { background: #e3f0ff; color: #1d4e89; }
.inv-kind.is-transfer { background: #efe8ff; color: #5b3fa5; }
.inv-kind.is-count { background: #fff4d6; color: #8a5a00; }
.inv-kind.is-void, .inv-kind.is-edit { background: #fde7e5; color: var(--danger); }
.inv-lines { display: grid; gap: 8px; margin-bottom: 10px; }
.inv-line { display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px 36px; gap: 8px; align-items: center; }
.inv-line:has(> :nth-child(3):last-child) { grid-template-columns: minmax(0, 1fr) 110px 36px; } /* senza colonna costo */
.inv-line select, .inv-line input { min-width: 0; }
.inv-count input { width: 110px; margin-left: auto; text-align: right; }
.inv-reorder-foot { display: grid; gap: 12px; }
.inv-params summary { cursor: pointer; font-weight: 600; }
.inv-params .form-grid { margin-top: 10px; }
.inv-matrix td.inv-cell { border-left: 3px solid transparent; }
.inv-cell.is-out { background: #fde7e5; color: var(--danger); font-weight: 700; }
.inv-cell.is-low { background: #fff4d6; color: #8a5a00; font-weight: 700; }
.inv-cell.is-dormant { background: var(--surface-2); color: var(--muted); }
.inv-cell.is-overstock { background: #e3f0ff; color: #1d4e89; }
.inv-legend .inv-cell { display: inline-block; padding: 1px 8px; border-radius: 6px; margin-right: 4px; }
.card-head .inv-head-action { margin-left: auto; }
/* 2.56.3: griglia "Tutti i punti" modificabile — ogni cella è un pulsante che apre la rettifica */
.inv-matrix.is-editable td.inv-cell-td { padding: 0; }
.inv-cell-btn { width: 100%; min-height: 36px; border: 0; background: transparent; font: inherit; color: inherit; text-align: right; padding: 8px 12px; cursor: pointer; transition: filter .12s ease, box-shadow .12s ease; }
.inv-cell-btn.is-empty { color: var(--muted-2); }
.inv-cell-btn:hover { filter: brightness(0.95); box-shadow: inset 0 0 0 2px var(--green-300); }
.inv-cell-btn:active { filter: brightness(0.9); }
.inv-cell-btn:focus-visible { outline: 2px solid var(--green-600); outline-offset: -2px; }
@media (max-width: 720px) {
    .inv-line { grid-template-columns: 1fr 1fr; }
    .inv-line select { grid-column: 1 / -1; }
}

/* ===================================================================== 2.56.0 */
/* "i" del prodotto in cassa (pannello e tablet): in alto a sinistra, come la stella a destra */
.info-toggle { border: 0; padding: 0; font-family: Georgia, 'Times New Roman', serif; position: absolute; top: 6px; left: 6px; z-index: 2; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: 15px; font-weight: 700; font-style: italic; line-height: 1; color: #fff; background: var(--green-600); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); cursor: pointer; transition: transform .1s ease, background .15s ease; }
.info-toggle:hover { background: var(--green-700); transform: scale(1.12); }
/* 2.56.1: con la "i" la riga della categoria parte dopo il cerchio (prima ci finiva sotto) */
.product-tile-wrap:has(.info-toggle) .product-category, .product-tile-wrap:has(.info-toggle) .tablet-product-category { padding-left: 30px; }
/* 2.56.3: con la foto la "i" e la stella stanno SOPRA l'immagine, non sulla riga categoria (che è sotto):
   togliere i rientri laterali, altrimenti stringono il testo e spezzano le parole a metà (es. "ROMANTI CA"). */
.product-tile-wrap:has(.tile-thumb) .product-category, .product-tile-wrap:has(.tile-thumb) .tablet-product-category { padding-left: 2px; padding-right: 2px; }
/* 2.56.3: tessera SENZA foto ma con la "i": invece di stringere la categoria accanto ai due pulsanti
   (che la spezzava, es. "INFORMATIV O"), si spinge il contenuto sotto la fascia dei pulsanti così la
   categoria usa tutta la larghezza e va a capo solo fra le parole. */
.product-tile-wrap:not(:has(.tile-thumb)):has(.info-toggle) > .product-tile,
.product-tile-wrap:not(:has(.tile-thumb)):has(.info-toggle) > .tablet-product { padding-top: 36px; }
.product-tile-wrap:not(:has(.tile-thumb)):has(.info-toggle) .product-category,
.product-tile-wrap:not(:has(.tile-thumb)):has(.info-toggle) .tablet-product-category { padding-left: 2px; padding-right: 2px; }
.info-toggle:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; }
.product-info { display: grid; gap: 12px; }
.product-info-img { width: 100%; max-height: 220px; object-fit: contain; border-radius: var(--r-md); background: var(--surface-2); }
.product-info-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin: 0; color: var(--muted); font-size: var(--text-sm); }
.product-info-meta strong { margin-left: auto; font-size: var(--text-xl); color: var(--ink); }
.product-info-text { white-space: normal; line-height: 1.5; font-size: var(--text-md); }
/* sottocategorie: seconda riga di chip sotto il padre scelto (cassa del pannello) */
.category-chips:has(.category-subchips) { flex-wrap: wrap; }
.category-subchips { flex: 0 0 100%; display: flex; gap: 8px; overflow-x: auto; padding-top: 8px; border-top: 1px dashed var(--line-soft); }
.category-chip.is-sub { font-size: var(--text-sm); padding-top: 4px; padding-bottom: 4px; }
.cat-indent { color: var(--muted-2); margin-right: 6px; }
.cat-child td:first-child { padding-left: 24px; white-space: nowrap; } /* 4.3.1: simbolo e nome sulla stessa riga anche sul telefono */
.cat-child td:first-child strong { white-space: normal; display: inline; }
.kind-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; vertical-align: middle; margin-right: 2px; }
.kind-dot.is-products { background: #2f6fd6; }
.kind-dot.is-services { background: #d6453a; }
/* statistiche prodotti */
.ps-stores .inv-kind { margin: 1px 2px 1px 0; }
.ps-ranks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.ps-rank { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.ps-rank li { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ps-rank li > span { display: grid; min-width: 0; }
.ps-rank li small { color: var(--muted); font-size: var(--text-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 2.56.1: la categoria (una parola lunga + rientro della "i") non deve allargare la tessera sui telefoni */
.product-tile { min-width: 0; max-width: 100%; }
.product-category { display: block; min-width: 0; }
/* 4.3.0/4.3.1: una categoria di una sola parola lunga (MERCHANDISING) non si spezza a metà, né sul telefono né nelle
   schede strette del pannello: va a capo solo fra le parole, e se non ci sta si tronca con i puntini */
.product-category, .tablet-product-category { letter-spacing: .03em; overflow-wrap: normal; word-break: keep-all; hyphens: none; overflow: hidden; text-overflow: ellipsis; }
/* 2.56.2: sul telefono le tabelle larghe mostrano solo le colonne che contano (il resto nel CSV e sui computer) */
@media (max-width: 560px) {
    .inv-table th:nth-child(3), .inv-table td:nth-child(3), .inv-table th:nth-child(5), .inv-table td:nth-child(5), .inv-table th:nth-child(6), .inv-table td:nth-child(6) { display: none; }
    .ps-table th:nth-child(n+5):not(:last-child), .ps-table td:nth-child(n+5):not(:last-child), .ps-table th:last-child, .ps-table td:last-child { display: none; }
    .inv-table td:first-child, .ps-table td:first-child { min-width: 150px; }
    .inv-table .table-subline, .ps-table .table-subline { white-space: normal; }
}
