/* 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: color-mix(in srgb, var(--nav) 96%, transparent); } }

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: 150px; 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; }
