/* PC System - stili a scelta (Impostazioni > Aspetto) e grandezza di caratteri e bottoni. */

/* Grandezza: --zt per tutto il testo, --zb in più per i bottoni */
html[data-zt] body { zoom: var(--zt, 1); }
html[data-zb] .btn, html[data-zb] .filtro, html[data-zb] .chip-btn { zoom: var(--zb, 1); }

/* ---------- Compatto: tutto più fitto, meno spazio da scorrere ---------- */
html[data-tema="compatto"] {
  --r-lg: 12px;
  --r: 9px;
  --sh: 0 1px 2px rgba(16, 24, 40, .06);
  --sh-lg: 0 8px 24px -8px rgba(16, 24, 40, .2);
}
html[data-tema="compatto"] body { font-size: 14px; line-height: 1.4; }
html[data-tema="compatto"] h1 { font-size: 22px; }
html[data-tema="compatto"] h2 { font-size: 15.5px; }
html[data-tema="compatto"] .content { padding: 16px 20px 48px; }
html[data-tema="compatto"] .page-head { margin-bottom: 14px; }
html[data-tema="compatto"] .panel { padding: 14px; }
html[data-tema="compatto"] .cols { gap: 14px; }
html[data-tema="compatto"] .form { gap: 11px; }
html[data-tema="compatto"] .tiles { gap: 12px; }
html[data-tema="compatto"] .tile { min-height: 128px; padding: 16px; }
html[data-tema="compatto"] .tile-t { font-size: 17px; margin-top: 10px; }
html[data-tema="compatto"] .tbl td { padding: 7px 10px; }
html[data-tema="compatto"] .tbl th { padding: 7px 10px; }
html[data-tema="compatto"] .btn { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
html[data-tema="compatto"] .btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
html[data-tema="compatto"] .btn-lg { min-height: 42px; padding: 0 16px; font-size: 14.5px; border-radius: 10px; }
html[data-tema="compatto"] :is(input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=search], input[type=date], input:not([type]), select) { min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
html[data-tema="compatto"] textarea { padding-top: 8px; padding-bottom: 8px; font-size: 14px; }

/* ---------- Classico: piatto, angoli squadrati, bordi netti, niente ombre ---------- */
html[data-tema="classico"] {
  --bg: #eef0f3;
  --border: #d5dae2;
  --border-strong: #bfc6d1;
  --r-lg: 4px;
  --r: 4px;
  --sh-sm: none;
  --sh: none;
  --sh-lg: 0 4px 14px rgba(16, 24, 40, .16);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --nav: #1f2937;
  --nav-2: #374151;
}
html[data-tema="classico"] h1, html[data-tema="classico"] h2 { letter-spacing: 0; }
html[data-tema="classico"] h1 { font-weight: 700; }
html[data-tema="classico"] .btn { border-radius: 4px; box-shadow: none !important; }
html[data-tema="classico"] .btn-amber { background: #ea7a1e; }
html[data-tema="classico"] .btn-amber:hover { background: #d66c14; }
html[data-tema="classico"] .tile { border-radius: 6px; box-shadow: none; }
html[data-tema="classico"] .tile::after { display: none; }
html[data-tema="classico"] .tile:hover { transform: none; filter: brightness(1.06); }
html[data-tema="classico"] .panel { border-color: var(--border-strong); }
html[data-tema="classico"] .tbl th { background: #e9ecf1; border-radius: 0 !important; }
html[data-tema="classico"] .filtro, html[data-tema="classico"] .badge, html[data-tema="classico"] .chip span { border-radius: 4px; }
html[data-tema="compatto"] .spesa .scan > svg { top: 8px; }
html[data-tema="compatto"] .spesa .scan input { min-height: 38px; }
html[data-tema="compatto"] .scan-cam { top: 3px; width: 32px; height: 32px; }
html[data-tema="compatto"] .riga-nuova input, html[data-tema="compatto"] .btn-ok { min-height: 38px; }

/* Quantità di magazzino spente (Impostazioni > Magazzino) */
html[data-noqta] .qta { display: none !important; }


/* ---------- Logo ---------- */
.brand { gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: block; flex: none; }
.brand-txt { display: grid; line-height: 1.05; }
.brand-txt b { font-size: 16.5px; font-weight: 800; letter-spacing: .06em; color: #fff; }
.brand-txt small { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: #d9ac4a; margin-top: 3px; }
.brand.big { flex-direction: column; gap: 10px; text-align: center; }
.brand-tile { width: 76px; height: 76px; border-radius: 20px; background: linear-gradient(160deg, #1b2236, #0f1422); display: grid; place-items: center; box-shadow: 0 12px 28px -10px rgba(10, 14, 30, .6); }
.brand.big .brand-mark { width: 58px; height: 58px; }
.brand.big .brand-txt b { color: var(--text); font-size: 22px; }
.brand.big .brand-txt small { color: #a87b22; font-size: 13px; }

/* ---------- Colori (Impostazioni > Aspetto) ---------- */
/* le parti che prima erano fisse sul blu ora seguono il colore scelto */
.btn-primary { box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--primary) 70%, transparent); }
.chip input:checked + span, button.chip-btn:hover { border-color: color-mix(in srgb, var(--primary) 35%, #fff); }
.nav-item.on { box-shadow: inset 3px 0 0 var(--accent, #7b93ff); }
@media (max-width: 860px) { .rail { background: var(--nav); } } /* barra in basso piena: niente trasparenze (alcuni telefoni non disegnavano le icone) */

html[data-colore="oliva"] {
  --primary: #66752b; --primary-600: #515e1f; --primary-soft: #f0f3e1;
  --ring: 0 0 0 4px rgba(102, 117, 43, .18);
  --nav: #262b16; --nav-2: #363d20; --accent: #c3cf78; --bg: #f5f5ee;
}
html[data-colore="parigi"] {
  --primary: #4a6175; --primary-600: #3a4e60; --primary-soft: #e8eef3;
  --ring: 0 0 0 4px rgba(74, 97, 117, .18);
  --nav: #1e2832; --nav-2: #2b3846; --accent: #a7bccd; --bg: #f1f3f5;
}
html[data-colore="tortora"] {
  --primary: #7a6a57; --primary-600: #635544; --primary-soft: #f3eee8;
  --ring: 0 0 0 4px rgba(122, 106, 87, .18);
  --nav: #37302a; --nav-2: #483f37; --accent: #dccbb2; --bg: #f7f4f0;
}
html[data-colore="verdino"] {
  --primary: #3f8f6b; --primary-600: #317357; --primary-soft: #e6f4ed;
  --ring: 0 0 0 4px rgba(63, 143, 107, .18);
  --nav: #1a352b; --nav-2: #24493b; --accent: #9de0bf; --bg: #f2f8f5;
}
html[data-colore="oro"] {
  --primary: #9a7020; --primary-600: #7f5c18; --primary-soft: #faf3e2;
  --ring: 0 0 0 4px rgba(154, 112, 32, .18);
  --nav: #0f1524; --nav-2: #18213a; --accent: #e3c269; --bg: #f5f4f0;
}

/* Logo dal logo storico (pieno / contorno) */
.brand-logo { display: block; width: min(150px, 100%); height: auto; margin: 0 auto 0 4px; }
.brand-logo-big { display: block; width: 190px; height: auto; margin: 0 auto 6px; }

/* Ricevuta / invio: pulsanti piccoli a icona (scheda riparazione) */
.ric-group { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--sh-sm); }
.ric-group form { display: inline; margin: 0; }
.ric-lbl { font-weight: 700; font-size: 13.5px; margin-right: 4px; }
.ric-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: var(--surface-2); color: #344054; cursor: pointer; text-decoration: none; font: inherit; font-size: 16px; font-weight: 600; }
.ric-btn:hover { background: var(--primary-soft); color: var(--primary); }
.ric-btn.wa { background: #25d366; color: #fff; }
.ric-btn.mail { background: #0ea5e9; color: #fff; }
.ric-btn.wa:hover, .ric-btn.mail:hover { filter: brightness(.93); color: #fff; }
.ric-btn span { display: none; }
.ric-group.grande { padding: 4px; flex-wrap: wrap; }
.ric-group.grande .ric-btn { width: auto; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.ric-group.grande .ric-btn span { display: inline; }

/* Telefono (apre WhatsApp) ed email (apre la pagina di invio) nelle liste clienti */
.tel-link, .mail-link { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; white-space: nowrap; border-radius: 6px; }
.tel-link svg { flex: none; width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: #e7f8ee; color: #128c4a; }
.tel-link:hover span { color: #128c4a; text-decoration: underline; }
.mail-link svg { flex: none; color: #0ea5e9; }
.mail-link:hover { color: #0284c7; text-decoration: underline; }

/* Compila con AI (scheda articolo) */
.ai-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.btn.btn-ai { background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; border: 0; }
.btn.btn-ai:hover { filter: brightness(1.08); color: #fff; }
.btn-ai[disabled] { opacity: .6; }
.ai-fatto { animation: aiLuce 1.6s ease-out; }
@keyframes aiLuce { 0% { box-shadow: 0 0 0 3px #a78bfa; background: #f5f3ff; } 100% { box-shadow: none; } }

/* Fotocamera: i pulsanti restano sempre visibili, anche col telefono in verticale */
.scanner-card { max-height: calc(100dvh - 24px); overflow-y: auto; }
.scanner-modal.foto { padding: 12px; }
.scanner-modal.foto #scanner-view { width: min(100%, 60dvh); min-height: 0; margin: 0 auto; }
.scanner-azioni { position: sticky; bottom: -18px; display: flex; gap: 8px; margin: 10px -18px -18px; padding: 10px 18px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
.scanner-azioni .btn { flex: 1; justify-content: center; }
.scanner-azioni #scanner-shot { flex: 2; }

/* Foto articolo: senza sfondo / originale */
.scont-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.scont-bar .chip-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.scont-bar .chip-btn[disabled] { opacity: .45; cursor: not-allowed; }
.photo-box { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.photo-box img { min-height: 0; min-width: 0; }

/* foto ingrandita */
img[data-zoom] { cursor: zoom-in; }
.zoom-box { position: fixed; inset: 0; z-index: 9999; background: rgba(10, 12, 20, .88); display: flex; flex-direction: column; animation: zoomIn .15s ease-out; }
@keyframes zoomIn { from { opacity: 0; } }
.zoom-barra { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: #fff; }
.zoom-nome { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zoom-n { font-size: 13px; opacity: .7; }
.zoom-barra button { border: 0; border-radius: 10px; background: rgba(255, 255, 255, .14); color: #fff; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; cursor: pointer; }
.zoom-barra button:hover { background: rgba(255, 255, 255, .24); }
.zoom-foto { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 12px 20px; }
.zoom-foto img { max-width: min(92vw, 900px); max-height: 100%; object-fit: contain; background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); cursor: default; }
.zoom-foto button { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.zoom-foto button[hidden] { display: none; }

/* cataloghi fornitori */
.cat-barra { display: grid; grid-template-columns: minmax(240px, 2.2fr) minmax(160px, 1.3fr) minmax(160px, 1.3fr) minmax(130px, .8fr) auto auto; gap: 10px; align-items: center; padding: 14px; margin-bottom: 14px; }
.cat-barra .cm-cerca { display: flex; gap: 6px; min-width: 0; max-width: none; }
.cat-barra .cm-cerca input { flex: 1; min-width: 0; }
.cat-barra select { width: 100%; min-width: 0; }
.cat-barra .chip { white-space: nowrap; }
.cat-barra .btn-cerca { background: var(--text); color: #fff; border-color: var(--text); }
@media (max-width: 1100px) { .cat-barra { grid-template-columns: 1fr 1fr; } .cat-barra .cm-cerca { grid-column: 1 / -1; } }
@media (max-width: 560px) { .cat-barra { grid-template-columns: 1fr; } }
.cat-pagine { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 4px 2px 10px; }
.cat-pagine + .table-wrap + .cat-pagine { padding: 12px 2px 0; }
.cat-pg-wrap { display: inline-flex; gap: 4px; align-items: center; }
.cat-pg { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.cat-pg:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.cat-pg.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.cat-pg:disabled { opacity: .35; cursor: default; }
.cat-pg-pp { color: var(--muted); padding: 0 2px; }
.cat-ord { border: 0; background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; padding: 0; white-space: nowrap; }
.cat-ord span { opacity: .45; font-size: .9em; }
.cat-ord.on, .cat-ord:hover { color: var(--primary); } .cat-ord.on span { opacity: 1; }
th.r .cat-ord { margin-left: auto; }
#catRis.cat-carica { opacity: .55; transition: opacity .15s; }
/* reverse charge (IVA 0 nel listino del fornitore: il 22% lo versi tu, nel costo è già contato) */
.rc { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; padding: 1px 6px; border-radius: 5px; background: #fff4e5 !important; color: #b54708 !important; vertical-align: middle; cursor: help; }

/* piede pagina e scheda Sintesy */
@font-face { font-family: "Gesso"; src: url("gesso.woff2") format("woff2"); font-display: swap; }
.piede { margin: 34px 0 6px; padding-top: 14px; border-top: 1px solid var(--border); text-align: center; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.piede a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.piede a:hover, .piede-sintesy:hover { color: var(--primary); }
.piede-sintesy { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: #a67c2e; cursor: pointer; }
.sintesy-velo { position: fixed; inset: 0; z-index: 9998; background: rgba(10, 12, 20, .62); display: grid; place-items: center; padding: 16px; animation: zoomIn .15s ease-out; }
.sintesy-velo[hidden] { display: none; }
.sintesy-card { position: relative; width: min(100%, 440px); max-height: calc(100dvh - 32px); overflow: auto; background: #f3eee2; color: #1d1d1f; border-radius: 22px; padding: 30px 28px 24px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.sintesy-x { position: absolute; top: 14px; right: 16px; border: 0; background: none; font-size: 20px; font-weight: 700; color: #555; cursor: pointer; }
.sintesy-foto { width: 150px; height: 150px; margin: 0 auto 14px; border-radius: 50%; overflow: hidden; border: 4px solid #a67c2e; box-shadow: 0 10px 26px rgba(0, 0, 0, .22); }
.sintesy-foto img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); display: block; }
.sintesy-card h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; color: #1d1d1f; }
.sintesy-aka { margin: 2px 0 14px; color: #666; font-size: 16px; }
.sintesy-aka span { font-family: "Gesso", "Brush Script MT", cursive; font-size: 25px; font-weight: 700; color: #a67c2e; }
.sintesy-tag { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.sintesy-tag span { padding: 6px 14px; border-radius: 999px; background: #ebe2cc; border: 1px solid #e0d4b8; font-size: 13.5px; font-weight: 600; }
.sintesy-card p { margin: 0 0 10px; font-size: 15px; line-height: 1.5; }
.sintesy-motto { font-style: italic; color: #666; margin-top: 4px !important; }
