/* V5.42 - Tema moderno pulito
   Ispirato a UI gestionali recenti: superfici chiare, blu primario,
   spaziatura leggibile e meno effetti pesanti. */

:root{
  --bg:#f4f7fb;
  --card:#ffffff;
  --text:#081126;
  --muted:#66728a;
  --border:#dce4f0;
  --border-strong:#c7d2e4;
  --primary:#155eef;
  --primary-dark:#0b45c9;
  --primary-soft:#eaf1ff;
  --good:#16a34a;
  --good-soft:#dcfce7;
  --danger:#dc2626;
  --danger-soft:#fee2e2;
  --warn:#d97706;
  --warn-soft:#fff7ed;
  --shadow:0 12px 32px rgba(8,17,38,.08);
  --shadow-sm:0 4px 14px rgba(8,17,38,.06);
  --radius:8px;
}

*{
  letter-spacing:0 !important;
}

body{
  background:
    radial-gradient(circle at 18% 0%, rgba(21,94,239,.08), transparent 30rem),
    radial-gradient(circle at 92% 4%, rgba(22,163,74,.07), transparent 28rem),
    var(--bg) !important;
  color:var(--text) !important;
  font-size:15px !important;
  line-height:1.45;
}

.app{
  max-width:1720px;
  padding:20px 24px 32px !important;
}

h1,h2,h3{
  color:var(--text) !important;
  line-height:1.12;
  font-weight:900;
}

h1{font-size:32px !important}
h2{font-size:24px !important}
h3{font-size:18px !important}

.muted,
small,
.text-muted{
  color:var(--muted) !important;
}

.topbar{
  background:rgba(255,255,255,.86);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px !important;
  box-shadow:var(--shadow-sm);
  backdrop-filter:blur(12px);
}

.brand{
  min-width:280px;
}

.logo,
.login-logo{
  width:54px;
  height:54px;
  display:grid;
  place-items:center;
  padding:0 !important;
  border-radius:var(--radius) !important;
  background:linear-gradient(135deg,var(--primary),#4f8cff) !important;
  color:#fff !important;
  box-shadow:0 10px 22px rgba(21,94,239,.22);
}

.topbar-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

.scan{
  height:54px;
  border:1px solid var(--border) !important;
  border-radius:var(--radius) !important;
  box-shadow:none !important;
  background:#fff !important;
  padding:6px !important;
}

.scan input,
#barcode{
  height:40px !important;
  min-height:40px !important;
  border:0 !important;
  box-shadow:none !important;
  background:transparent !important;
  font-size:15px !important;
  font-weight:700 !important;
}

.scan input:focus,
#barcode:focus{
  box-shadow:none !important;
  transform:none !important;
}

.nav{
  display:flex !important;
  flex-wrap:wrap;
  gap:8px !important;
  padding:8px !important;
  border:1px solid var(--border) !important;
  border-radius:var(--radius) !important;
  background:rgba(255,255,255,.9) !important;
  box-shadow:var(--shadow-sm) !important;
}

.nav button{
  flex:0 0 auto;
  min-height:42px;
  border:1px solid transparent;
  border-radius:var(--radius);
  padding:10px 13px;
  font-size:14px;
  font-weight:800;
  box-shadow:none;
}

.nav button:hover{
  transform:none;
}

.nav button.active{
  box-shadow:0 8px 18px rgba(21,94,239,.24);
}

.card,
.item,
.stat,
.payment-panel,
.cashier-left,
.cashier-right .card,
.tablewrap,
.pay-total-card{
  border-radius:var(--radius) !important;
  border:1px solid var(--border) !important;
  background:var(--card) !important;
  box-shadow:var(--shadow-sm) !important;
  transform:none !important;
  backdrop-filter:none !important;
}

.card{
  padding:20px !important;
}

.card:hover,
.item:hover,
.stat:hover,
.cart-line:hover,
.product-live-card:hover{
  transform:none !important;
  box-shadow:var(--shadow) !important;
  border-color:var(--border-strong) !important;
}

.item{
  margin:0 !important;
  padding:14px !important;
  background:#f8fafc !important;
}

.grid{
  gap:14px !important;
}

input,
select,
textarea{
  min-height:48px !important;
  height:48px;
  border:1px solid var(--border-strong) !important;
  border-radius:var(--radius) !important;
  background:#fff !important;
  color:var(--text) !important;
  padding:0 14px !important;
  font-size:15px !important;
  font-weight:650 !important;
  box-shadow:none !important;
  transform:none !important;
}

textarea{
  min-height:96px !important;
  padding-top:12px !important;
}

input::placeholder,
textarea::placeholder{
  color:#9aa6ba !important;
  opacity:1;
}

input:hover,
select:hover,
textarea:hover{
  border-color:#9fb0ca !important;
}

input:focus,
select:focus,
textarea:focus{
  outline:none !important;
  border-color:var(--primary) !important;
  box-shadow:0 0 0 4px rgba(21,94,239,.12) !important;
  transform:none !important;
}

button,
.buttonlike{
  min-height:44px;
  border-radius:var(--radius);
  padding:10px 16px;
  font-size:14px;
  font-weight:850;
  text-decoration:none;
}


button::before{
  display:none !important;
}

button:hover,
.buttonlike:hover{
  background:var(--primary-dark) !important;
  border-color:var(--primary-dark) !important;
  color:#fff !important;
  box-shadow:0 10px 20px rgba(21,94,239,.20) !important;
  transform:none !important;
}

button.good{
  background:linear-gradient(180deg,#1c6bff,#0d49ce) !important;
  border-color:#0d49ce !important;
  color:#fff !important;
}

button.danger{
  background:var(--danger) !important;
  border-color:var(--danger) !important;
  color:#fff !important;
}

button.warn{
  background:var(--warn) !important;
  border-color:var(--warn) !important;
  color:#fff !important;
}

button.small,
.small{
  min-height:36px !important;
  padding:8px 12px !important;
  font-size:13px !important;
}

.badge,
.pill{
  border-radius:999px !important;
  border:1px solid transparent;
  box-shadow:none !important;
}

.badge.dark,
.pill.dark{
  background:var(--primary-soft) !important;
  color:var(--primary-dark) !important;
  border-color:#cfe0ff;
}

.badge.good,
.pill.good,
.closing-status.ok{
  background:var(--good-soft) !important;
  color:#14743a !important;
}

.badge.warn,
.pill.warn,
.closing-status.warn{
  background:var(--warn-soft) !important;
  color:#9a5a00 !important;
}

.badge.danger,
.pill.bad,
.badge.bad{
  background:var(--danger-soft) !important;
  color:#a11919 !important;
}

.tablewrap{
  overflow:auto;
}

.table{
  border-collapse:separate !important;
  border-spacing:0;
  min-width:880px;
}

.table th,
.table td{
  border-bottom:1px solid var(--border) !important;
  padding:13px 14px !important;
}

.table th{
  background:#f4f7fb !important;
  color:#27324a !important;
  font-size:12px !important;
  text-transform:uppercase;
}

.table tr:hover td{
  background:#f8fbff !important;
}

.pay-total-card,
.total-card,
.bigtotal{
  border:1px solid #b7dfc2 !important;
  background:linear-gradient(180deg,#f0fff4,#e2f9ea) !important;
  box-shadow:var(--shadow-sm) !important;
  animation:none !important;
}

.pay-total-amount,
.huge,
.bigtotal .amount{
  color:#118a43 !important;
  font-size:56px !important;
  text-shadow:none !important;
  letter-spacing:0 !important;
}

.pay-confirm-button{
  min-height:62px !important;
  font-size:17px !important;
}

.cart-line{
  border-radius:var(--radius) !important;
  border:1px solid var(--border) !important;
  background:#fff !important;
  box-shadow:none !important;
}

.cart-line-profit{
  border-radius:var(--radius) !important;
  background:#f0fff4 !important;
}

.stock-workspace-head,
.config-workspace-head,
.product-workspace-head{
  border-left:4px solid var(--primary) !important;
}

.stock-workspace-tabs button{
  border-radius:var(--radius) !important;
}

.stock-workspace-tabs button.active{
  background:var(--primary) !important;
  border-color:var(--primary) !important;
  color:#fff !important;
}

.closing-modern-card{
  padding:28px !important;
}

.closing-modern-head{
  display:flex;
  align-items:center;
  gap:18px;
  margin-bottom:22px;
}

.closing-modern-head h2{
  margin:0 0 6px;
  font-size:32px !important;
}

.closing-modern-icon{
  flex:0 0 62px;
  width:62px;
  height:62px;
  display:grid;
  place-items:center;
  border-radius:var(--radius);
  background:var(--primary-soft);
  color:var(--primary);
  font-size:25px;
  font-weight:950;
}

.closing-guide{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin:18px 0 22px;
}

.closing-step-card{
  display:grid;
  grid-template-columns:54px minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  min-height:92px;
  background:#fff !important;
  border-color:var(--border) !important;
}

.closing-step-icon{
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:linear-gradient(180deg,#1c6bff,#155eef);
  color:#fff;
  font-weight:950;
}

.closing-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:42px;
  min-height:28px;
  border-radius:999px;
  padding:4px 10px;
  font-style:normal;
  font-size:12px;
  font-weight:900;
}

.closing-modern-form{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  padding:18px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:#fbfdff;
}

.closing-field{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.closing-field span{
  font-size:13px;
  font-weight:850;
  color:#27324a;
}

.closing-format-option{
  min-height:78px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:#fff;
  padding:14px;
  cursor:pointer;
}

.closing-format-option:hover{
  border-color:#bcd0ff;
  background:#f8fbff;
}

.closing-format-option span{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.closing-format-option small{
  font-size:12px;
}

.closing-format-option input[type="checkbox"],
.closing-destination-option input[type="checkbox"]{
  width:24px !important;
  min-width:24px !important;
  height:24px !important;
  min-height:24px !important;
  accent-color:var(--primary);
}

.closing-destination-pick{
  margin-top:24px;
  padding-top:22px;
  border-top:1px solid var(--border);
}

.closing-destination-list{
  display:grid;
  gap:10px;
  margin-top:12px;
}

.closing-destination-option{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:12px;
}

.closing-warning{
  border-style:dashed !important;
  background:#fbfdff !important;
  padding:22px !important;
}

.closing-submit-button{
  width:100%;
  min-height:64px !important;
  margin-top:24px;
  font-size:18px !important;
}

.login-shell{
  min-height:calc(100vh - 40px);
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(360px,.8fr);
  gap:22px;
  align-items:stretch;
}

.login-hero,
.login-panel{
  border-radius:var(--radius) !important;
}

@media(max-width:1180px){
  .closing-guide,
  .closing-modern-form{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .cashier-layout{
    grid-template-columns:1fr !important;
  }
}

@media(max-width:760px){
  .app{
    padding:12px !important;
  }
  .topbar,
  .topbar-actions{
    align-items:stretch !important;
  }
  .scan{
    width:100%;
  }
  .nav{
    flex-wrap:nowrap;
    overflow:auto;
  }
  .closing-guide,
  .closing-modern-form,
  .g2,.g3,.g4,.g5,.g6{
    grid-template-columns:1fr !important;
  }
  .closing-step-card{
    grid-template-columns:48px minmax(0,1fr);
  }
  .closing-status{
    grid-column:2;
    justify-self:start;
  }
  .closing-modern-head{
    align-items:flex-start;
  }
  .closing-modern-head h2{
    font-size:26px !important;
  }
  .pay-total-amount,
  .huge,
  .bigtotal .amount{
    font-size:42px !important;
  }
  .login-shell{
    grid-template-columns:1fr;
  }
}

@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    animation:none !important;
    transition:none !important;
    scroll-behavior:auto !important;
  }
}

/* V5.43 - Fluid premium pass
   Più morbido e vivo, ma senza effetti pesanti da landing page. */

html{
  scroll-behavior:smooth;
}

body{
  background:
    radial-gradient(circle at 12% -8%, rgba(21,94,239,.13), transparent 34rem),
    radial-gradient(circle at 90% 2%, rgba(34,197,94,.10), transparent 30rem),
    linear-gradient(180deg,#f8fbff 0%,#eef4fb 100%) !important;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(15,23,42,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,.025) 1px, transparent 1px);
  background-size:42px 42px;
  mask-image:linear-gradient(180deg, rgba(0,0,0,.42), transparent 68%);
}

.topbar{
  position:sticky;
  top:12px;
  z-index:60;
  background:rgba(255,255,255,.92) !important;
  box-shadow:0 14px 34px rgba(8,17,38,.08) !important;
}

main{
  animation:btPageIn .22s ease-out both;
}

@keyframes btPageIn{
  from{opacity:.72; transform:translateY(4px)}
  to{opacity:1; transform:translateY(0)}
}

.card,
.item,
.stat,
.cart-line,
.product-live-card,
.closing-format-option,
.closing-step-card,
.payment-panel{
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease,
    background-color .18s ease !important;
}

.card:hover,
.item:hover,
.stat:hover,
.cart-line:hover,
.product-live-card:hover,
.closing-format-option:hover,
.closing-step-card:hover{
  transform:translateY(-1px) !important;
  box-shadow:0 14px 34px rgba(8,17,38,.09) !important;
}

button,
.buttonlike{
  transition:
    transform .16s ease,
    box-shadow .18s ease,
    background-color .18s ease,
    border-color .18s ease,
    color .18s ease !important;
}

button:hover,
.buttonlike:hover{
  transform:translateY(-1px) !important;
}

button:active,
.buttonlike:active{
  transform:translateY(0) scale(.985) !important;
}

button.good,
.closing-submit-button,
.pay-confirm-button{
  background:
    linear-gradient(180deg, rgba(255,255,255,.13), transparent 42%),
    linear-gradient(135deg,#1f6fff 0%,#0647c8 100%) !important;
  box-shadow:0 12px 28px rgba(21,94,239,.20) !important;
}

button.good:hover,
.closing-submit-button:hover,
.pay-confirm-button:hover{
  box-shadow:0 16px 34px rgba(21,94,239,.28) !important;
}

input,
select,
textarea{
  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    background-color .18s ease !important;
}

input:focus,
select:focus,
textarea:focus{
  background:#fbfdff !important;
}

.nav{
  backdrop-filter:blur(16px);
}

.nav button{
  transition:
    background-color .16s ease,
    border-color .16s ease,
    color .16s ease,
    transform .16s ease,
    box-shadow .16s ease !important;
}

.nav button:hover{
  transform:translateY(-1px) !important;
}

.nav button.active{
  box-shadow:0 10px 22px rgba(21,94,239,.26) !important;
}

.badge,
.pill,
.closing-status{
  font-weight:900 !important;
}

.pay-total-card,
.bigtotal{
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), transparent 42%),
    linear-gradient(135deg,#effff5 0%,#dff7e8 100%) !important;
}

.pay-total-card:hover,
.bigtotal:hover{
  border-color:#8fd6a5 !important;
}

.pay-total-amount,
.bigtotal .amount{
  color:#087a3a !important;
}

.tablewrap{
  box-shadow:0 8px 24px rgba(8,17,38,.05) !important;
}

.table th{
  position:sticky;
  top:0;
  z-index:1;
}

.closing-modern-card{
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.90)),
    radial-gradient(circle at 12% 0%, rgba(21,94,239,.08), transparent 28rem) !important;
}

.closing-modern-icon{
  background:
    linear-gradient(180deg, rgba(255,255,255,.55), transparent),
    var(--primary-soft) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}

.closing-step-card,
.closing-format-option{
  box-shadow:0 6px 18px rgba(8,17,38,.05) !important;
}

.closing-format-option:has(input:checked){
  border-color:#bcd0ff !important;
  background:#f8fbff !important;
}

.closing-format-option:has(input:checked)::after{
  content:none;
  display:none;
}

.closing-format-option input[type="checkbox"]{
  display:block;
  width:24px !important;
  min-width:24px !important;
  height:24px !important;
  min-height:24px !important;
  accent-color:var(--primary);
}

.closing-destination-pick h3{
  margin:0;
}

.login-shell{
  animation:btPageIn .24s ease-out both;
}

.login-panel{
  box-shadow:0 18px 48px rgba(8,17,38,.11) !important;
}

@media(max-width:760px){
  .topbar{
    position:static;
  }
  main{
    animation:none;
  }
}

@media (prefers-reduced-motion: reduce){
  html{
    scroll-behavior:auto;
  }
  main,
  .login-shell{
    animation:none !important;
  }
  .card:hover,
  .item:hover,
  .stat:hover,
  .cart-line:hover,
  .product-live-card:hover,
  .closing-format-option:hover,
  .closing-step-card:hover,
  button:hover,
  .buttonlike:hover,
  .nav button:hover{
    transform:none !important;
  }
}

/* V5.45 - Stock visuale solo nel Magazzino */
.stock-inventory-wrap{
  border-radius:12px;
  background:#fff;
}

.stock-inventory-table{
  min-width:980px;
}

.stock-inventory-table th:nth-child(5),
.stock-inventory-table td:nth-child(5){
  min-width:230px;
}

.stock-inventory-row.warning td{
  background:#fffaf0;
}

.stock-inventory-row.critical td{
  background:#fff5f5;
}

.stock-inventory-level{
  min-width:210px;
  display:grid;
  gap:7px;
}

.stock-inventory-level-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.stock-inventory-level-head b{
  color:#071632;
  font-size:18px;
  font-weight:950;
}

.stock-inventory-level small{
  color:#667085;
  font-size:11px;
  font-weight:800;
}

.stock-inventory-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:24px;
  padding:4px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:950;
  white-space:nowrap;
}

.stock-inventory-badge.ok{
  background:#dcfce7;
  color:#14743a;
}

.stock-inventory-badge.warning{
  background:#ffedd5;
  color:#9a3412;
}

.stock-inventory-badge.critical{
  background:#fee2e2;
  color:#b91c1c;
}

.stock-inventory-meter{
  height:8px;
  overflow:hidden;
  border-radius:999px;
  background:#edf2f7;
}

.stock-inventory-meter i{
  display:block;
  height:100%;
  min-width:4px;
  border-radius:999px;
  background:linear-gradient(90deg,#16a34a,#6ee7a8);
  box-shadow:0 0 0 1px rgba(22,163,74,.08) inset;
}

.stock-inventory-level.warning .stock-inventory-meter i{
  background:linear-gradient(90deg,#f59e0b,#fb923c);
}

.stock-inventory-level.critical .stock-inventory-meter i{
  background:linear-gradient(90deg,#ef4444,#fb7185);
}

@media(max-width:640px){
  .stock-inventory-level{
    min-width:180px;
  }
}

/* V5.46 - Campi leggibili, toggle switch e firma Aedifex */
.brand-credit,
.brand-credit-inline{
  display:inline-flex;
  align-items:center;
  gap:4px;
  color:#64748b;
  font-size:12px;
  font-weight:800;
  letter-spacing:.01em;
}

.brand-credit b,
.brand-credit-inline b{
  color:#155eef;
  font-weight:950;
}

.brand-credit{
  margin-top:3px;
}

.form-field{
  display:flex;
  flex-direction:column;
  gap:7px;
  width:100%;
  min-width:0;
  color:#0f172a;
  font-weight:850;
}

.form-field > span{
  font-size:13px;
  line-height:1.2;
}

.form-field small{
  color:#64748b;
  font-size:12px;
  font-weight:650;
  line-height:1.35;
}

.form-field input,
.form-field select,
.form-field textarea{
  margin:0 !important;
}

.config-modern-card{
  display:grid;
  gap:16px;
}

.config-field-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.config-toggle-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.toggle-row{
  min-height:74px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
  padding:14px;
  border:1px solid #dbe4f0;
  border-radius:14px;
  background:linear-gradient(180deg,#fff,#f8fbff);
  cursor:pointer;
}

.toggle-row > span{
  display:grid;
  gap:4px;
  min-width:0;
}

.toggle-row b{
  color:#0f172a;
  font-size:14px;
  font-weight:950;
}

.toggle-row small{
  color:#64748b;
  font-size:12px;
  font-weight:650;
  line-height:1.35;
}

.toggle-input,
.mini-toggle input{
  position:absolute;
  inline-size:1px;
  block-size:1px;
  opacity:0;
  pointer-events:none;
}

.toggle-control{
  width:54px;
  height:30px;
  position:relative;
  border-radius:999px;
  background:#cbd5e1;
  box-shadow:inset 0 2px 6px rgba(15,23,42,.18);
  transition:background .2s ease, box-shadow .2s ease;
}

.toggle-control::after{
  content:"";
  position:absolute;
  top:4px;
  left:4px;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 3px 8px rgba(15,23,42,.24);
  transition:transform .2s ease;
}

.toggle-input:checked + .toggle-control{
  background:#155eef;
  box-shadow:0 8px 18px rgba(21,94,239,.22);
}

.toggle-input:checked + .toggle-control::after{
  transform:translateX(24px);
}

.config-save-btn{
  justify-self:start;
  min-width:210px;
}

.users-roles-layout{
  align-items:start;
}

.user-role-card{
  display:grid;
  gap:12px;
}

.user-role-card > .muted{
  margin-top:-4px;
}

.user-role-card .role-quick-buttons{
  gap:8px;
}

.roles-panel{
  display:grid;
  gap:10px;
}

.role-box{
  border-radius:14px !important;
  padding:14px !important;
  background:linear-gradient(180deg,#fff,#f8fbff) !important;
}

.role-box-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.role-box-head > span{
  flex:0 0 auto;
  border-radius:999px;
  padding:5px 9px;
  background:#eef4ff;
  color:#155eef;
  font-size:11px;
  font-weight:950;
}

.role-box em{
  display:block;
  margin-top:12px;
  color:#475569;
  font-size:12px;
  font-style:normal;
  font-weight:900;
}

.role-permission-list{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}

.role-permission-list span{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:4px 8px;
  border-radius:999px;
  background:#f1f5f9;
  color:#334155;
  font-size:12px;
  font-weight:850;
}

.user-search-field{
  max-width:360px;
}

.mini-toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
}

.mini-toggle span{
  width:44px;
  height:24px;
  position:relative;
  border-radius:999px;
  background:#cbd5e1;
  transition:background .2s ease, box-shadow .2s ease;
}

.mini-toggle span::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:18px;
  height:18px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 7px rgba(15,23,42,.24);
  transition:transform .2s ease;
}

.mini-toggle input:checked + span{
  background:#155eef;
  box-shadow:0 7px 16px rgba(21,94,239,.18);
}

.mini-toggle input:checked + span::after{
  transform:translateX(20px);
}

.mini-toggle em{
  min-width:64px;
  color:#334155;
  font-size:12px;
  font-style:normal;
  font-weight:900;
}

@media(max-width:900px){
  .config-field-grid,
  .config-toggle-grid{
    grid-template-columns:1fr;
  }

  .user-search-field{
    max-width:none;
  }
}

/* V5.47 - Login piu pulito e coerente con il gestionale */
.login-shell{
  width:100%;
  max-width:1180px;
  min-height:calc(100vh - 40px);
  margin:0 auto;
  padding:34px 18px !important;
  display:grid !important;
  grid-template-columns:minmax(0,1.05fr) minmax(360px,440px) !important;
  gap:24px !important;
  align-items:center !important;
  animation:btPageIn .24s ease-out both;
}

.login-hero{
  min-height:560px !important;
  position:relative;
  overflow:hidden;
  display:flex !important;
  flex-direction:column;
  justify-content:space-between !important;
  gap:28px;
  padding:38px !important;
  border:1px solid rgba(203,213,225,.88);
  border-radius:24px !important;
  background:
    radial-gradient(circle at top left, rgba(21,94,239,.13), transparent 26rem),
    radial-gradient(circle at bottom right, rgba(16,185,129,.13), transparent 22rem),
    linear-gradient(180deg,rgba(255,255,255,.96),rgba(248,251,255,.94)) !important;
  color:#0f172a !important;
  box-shadow:0 22px 60px rgba(15,23,42,.10) !important;
}

.login-hero::before{
  content:"";
  position:absolute;
  inset:auto -80px -120px auto;
  width:360px;
  height:360px;
  border-radius:50%;
  background:linear-gradient(135deg,rgba(21,94,239,.16),rgba(16,185,129,.10));
  filter:blur(2px);
  pointer-events:none;
}

.login-hero-top{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.login-logo{
  width:64px !important;
  height:64px !important;
  border-radius:18px !important;
  background:linear-gradient(135deg,#155eef,#0b45c9) !important;
  color:#fff !important;
  box-shadow:0 16px 34px rgba(21,94,239,.26) !important;
  letter-spacing:.04em;
}

.login-maker{
  display:inline-flex;
  align-items:center;
  min-height:34px;
  padding:7px 11px;
  border:1px solid #dbe4f0;
  border-radius:999px;
  background:rgba(255,255,255,.78);
  color:#64748b;
  font-size:12px;
  font-weight:850;
}

.login-maker b{
  margin-left:4px;
  color:#155eef;
  font-weight:950;
}

.login-hero h1{
  position:relative;
  z-index:1;
  max-width:700px;
  margin:0 !important;
  color:#071632 !important;
  font-size:56px !important;
  line-height:1.02 !important;
  letter-spacing:0 !important;
  text-shadow:none !important;
}

.login-hero p{
  position:relative;
  z-index:1;
  max-width:620px;
  margin:16px 0 0 !important;
  color:#475569 !important;
  font-size:18px !important;
  line-height:1.55 !important;
  font-weight:700;
}

.login-feature-grid{
  position:relative;
  z-index:1;
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:12px !important;
  margin-top:8px !important;
}

.login-feature-grid span{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:58px;
  border:1px solid #dbe4f0 !important;
  border-radius:16px !important;
  background:rgba(255,255,255,.78) !important;
  color:#0f172a !important;
  padding:12px 14px !important;
  box-shadow:0 10px 24px rgba(15,23,42,.06);
  font-weight:900;
}

.login-feature-grid span b{
  display:inline-grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:10px;
  background:#eef4ff;
  color:#155eef;
  font-size:12px;
}

.login-panel{
  width:100%;
  padding:30px !important;
  border-radius:24px !important;
  border:1px solid rgba(203,213,225,.95) !important;
  background:rgba(255,255,255,.96) !important;
  box-shadow:0 22px 60px rgba(15,23,42,.12) !important;
  backdrop-filter:blur(16px);
}

.login-panel:hover{
  transform:none !important;
}

.login-panel-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:22px !important;
}

.login-kicker{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  margin-bottom:8px;
  padding:4px 9px;
  border-radius:999px;
  background:#eef4ff;
  color:#155eef;
  font-size:11px;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.login-panel h2{
  margin:0 0 6px !important;
  color:#071632 !important;
  font-size:30px !important;
  line-height:1.08 !important;
  letter-spacing:0 !important;
}

.login-field{
  display:grid;
  gap:8px;
  margin-top:14px;
  color:#0f172a;
  font-size:13px;
  font-weight:950;
}

.login-field span{
  line-height:1.2;
}

.login-label{
  display:none !important;
}

.login-input{
  min-height:54px !important;
  border:1px solid #dbe4f0 !important;
  border-radius:14px !important;
  background:#f8fafc !important;
  color:#0f172a !important;
  padding:0 15px !important;
  font-size:16px !important;
  font-weight:800 !important;
  box-shadow:none !important;
}

.login-input:focus{
  border-color:#155eef !important;
  background:#fff !important;
  box-shadow:0 0 0 4px rgba(21,94,239,.13) !important;
  transform:none !important;
}

.login-submit{
  width:100%;
  min-height:56px !important;
  margin-top:20px !important;
  border-radius:14px !important;
  background:linear-gradient(135deg,#155eef,#0b45c9) !important;
  box-shadow:0 16px 32px rgba(21,94,239,.22) !important;
  font-size:16px !important;
  font-weight:950 !important;
}

.login-security{
  margin:16px 0 0 !important;
  padding-top:14px;
  border-top:1px solid #e5edf7;
  color:#64748b !important;
  line-height:1.45 !important;
  font-size:13px;
  font-weight:750 !important;
}

.login-error{
  border-radius:14px !important;
}

.login-panel .lang-switch{
  flex:0 0 auto;
}

@media(max-width:980px){
  .login-shell{
    grid-template-columns:1fr !important;
    max-width:720px;
  }

  .login-hero{
    min-height:auto !important;
  }

  .login-hero h1{
    font-size:42px !important;
  }
}

@media(max-width:620px){
  .login-shell{
    padding:18px 10px !important;
    gap:14px !important;
  }

  .login-hero,
  .login-panel{
    padding:22px !important;
    border-radius:18px !important;
  }

  .login-hero-top,
  .login-panel-head{
    flex-direction:column;
    align-items:flex-start;
  }

  .login-hero h1{
    font-size:34px !important;
  }

  .login-feature-grid{
    grid-template-columns:1fr !important;
  }
}

/* V5.48 - Pulsanti piu comodi e leggibili */
button,
.buttonlike{
  min-height:48px !important;
  padding:12px 18px !important;
  border-radius:14px !important;
  font-size:15.5px !important;
  line-height:1.15 !important;
}

button.small,
.buttonlike.small,
.table button.small,
.category-row-actions button,
.movement-actions button{
  min-height:40px !important;
  padding:9px 13px !important;
  border-radius:11px !important;
  font-size:13.5px !important;
}

.nav button{
  min-height:50px !important;
  padding:11px 10px !important;
  font-size:14.5px !important;
}

.stock-workspace-tabs button,
.movement-modebar button,
.movement-quickbar button,
.stat-quick-actions button,
.role-quick-buttons button{
  min-height:44px !important;
  padding:10px 14px !important;
  font-size:14px !important;
}

.lang-switch button{
  min-height:34px !important;
  padding:7px 10px !important;
  border-radius:10px !important;
  font-size:12px !important;
}

.pay-confirm-button,
.closing-submit-button,
.login-submit{
  min-height:62px !important;
  font-size:17px !important;
}

.cashier-quick-btn{
  min-height:90px !important;
}

.qr-qty-control button{
  min-width:42px !important;
  min-height:42px !important;
  padding:0 !important;
}

body.bt-device-desktop.bt-density-comfort button,
body.bt-device-desktop.bt-density-comfort .buttonlike{
  min-height:52px !important;
  font-size:16px !important;
}

body.bt-device-desktop.bt-density-comfort button.small,
body.bt-device-desktop.bt-density-comfort .buttonlike.small{
  min-height:44px !important;
  font-size:14px !important;
}

body.bt-device-phone button,
body.bt-device-tablet button{
  min-height:50px !important;
}

/* V5.49 - Barra scansione allineata */
.topbar .scan{
  height:58px !important;
  min-height:58px !important;
  display:grid !important;
  grid-template-columns:minmax(260px,1fr) auto;
  align-items:center !important;
  gap:8px !important;
  padding:6px !important;
  border-radius:18px !important;
}

.topbar .scan #barcode{
  height:46px !important;
  min-height:46px !important;
  line-height:46px !important;
  display:block !important;
  padding:0 16px !important;
  border-radius:14px !important;
  font-size:15.5px !important;
  font-weight:850 !important;
  overflow:hidden;
  text-overflow:ellipsis;
}

.topbar .scan button{
  height:46px !important;
  min-height:46px !important;
  min-width:136px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:0 22px !important;
  border-radius:14px !important;
  font-size:15.5px !important;
  font-weight:950 !important;
  line-height:1 !important;
  white-space:nowrap !important;
}

.topbar .scan button:hover{
  transform:none !important;
}

body.bt-device-desktop.bt-density-comfort .topbar .scan{
  height:60px !important;
  min-height:60px !important;
}

body.bt-device-desktop.bt-density-comfort .topbar .scan #barcode,
body.bt-device-desktop.bt-density-comfort .topbar .scan button{
  height:48px !important;
  min-height:48px !important;
}

@media(max-width:760px){
  .topbar .scan{
    height:auto !important;
    grid-template-columns:1fr;
  }

  .topbar .scan button{
    width:100%;
  }
}

/* V5.50 - Niente testo duplicato dentro campi gia etichettati */
.form-field input::placeholder,
.form-field textarea::placeholder,
.field input::placeholder,
.field textarea::placeholder,
.closing-field input::placeholder,
.closing-field textarea::placeholder,
.menu-form-grid input::placeholder,
.menu-form-grid textarea::placeholder{
  color:transparent !important;
  opacity:0 !important;
}

.form-field input,
.field input,
.closing-field input{
  color:#0f172a !important;
}

/* V5.51 - Campi input e select allineati nei form */
.form-field,
.field,
.closing-field{
  align-self:stretch;
}

.form-field > span,
.field > label,
.closing-field > span{
  min-height:32px;
  display:flex !important;
  align-items:flex-end;
  margin:0 !important;
  line-height:1.18 !important;
}

.form-field input,
.form-field select,
.field input,
.field select,
.closing-field input,
.closing-field select,
.category-edit-grid input,
.category-edit-grid select,
.service-search-bar input,
.service-search-bar select{
  height:50px !important;
  min-height:50px !important;
  display:block !important;
  line-height:normal !important;
  padding-top:0 !important;
  padding-bottom:0 !important;
  vertical-align:middle !important;
}

.form-field select,
.field select,
.closing-field select,
.category-edit-grid select{
  appearance:auto;
  -webkit-appearance:menulist;
}

.form-field textarea,
.field textarea,
.closing-field textarea{
  height:auto !important;
  min-height:96px !important;
  padding-top:12px !important;
  line-height:1.35 !important;
}

.form-field input:focus,
.form-field select:focus,
.field input:focus,
.field select:focus,
.closing-field input:focus,
.closing-field select:focus{
  transform:none !important;
}

/* V5.52 - Switch tema chiaro/scuro stile editor */
.login-panel-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}

.theme-switch{
  min-height:38px !important;
  display:inline-flex !important;
  align-items:center !important;
  gap:8px !important;
  padding:7px 10px !important;
  border:1px solid var(--border-strong) !important;
  border-radius:999px !important;
  background:#fff !important;
  color:var(--text) !important;
  box-shadow:none !important;
  font-size:12px !important;
}

.theme-switch:hover{
  transform:none !important;
}

.theme-switch-track{
  width:38px;
  height:22px;
  display:inline-flex;
  align-items:center;
  padding:3px;
  border-radius:999px;
  background:#dbe4f0;
  transition:background .2s ease;
}

.theme-switch-track i{
  width:16px;
  height:16px;
  display:block;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 6px rgba(15,23,42,.24);
  transition:transform .2s ease;
}

.theme-switch b{
  color:inherit !important;
  font-size:12px;
  font-weight:950;
}

.theme-switch.dark{
  background:#252526 !important;
  color:#f4f4f5 !important;
  border-color:#3c3c3c !important;
}

.theme-switch.dark .theme-switch-track{
  background:#007acc;
}

.theme-switch.dark .theme-switch-track i{
  transform:translateX(16px);
}

body.bt-theme-dark{
  --bg:#1e1e1e;
  --card:#252526;
  --text:#f4f4f5;
  --muted:#a5adba;
  --border:#3c3c3c;
  --border-strong:#4b5563;
  --primary:#3794ff;
  --primary-dark:#007acc;
  --primary-soft:#16324f;
  --good:#4ade80;
  --good-soft:#132f20;
  --danger:#f87171;
  --danger-soft:#3b1d23;
  --warn:#fbbf24;
  --warn-soft:#3a2a12;
  --shadow:0 18px 42px rgba(0,0,0,.32);
  --shadow-sm:0 8px 22px rgba(0,0,0,.24);
  background:
    radial-gradient(circle at 20% 0%, rgba(0,122,204,.18), transparent 30rem),
    radial-gradient(circle at 92% 5%, rgba(75,85,99,.20), transparent 28rem),
    #1e1e1e !important;
  color:#f4f4f5 !important;
}

body.bt-theme-dark .app,
body.bt-theme-dark main{
  color:#f4f4f5 !important;
}

body.bt-theme-dark .card,
body.bt-theme-dark .stat,
body.bt-theme-dark .item,
body.bt-theme-dark .tablewrap,
body.bt-theme-dark .topbar,
body.bt-theme-dark .nav,
body.bt-theme-dark .scan,
body.bt-theme-dark .login-panel,
body.bt-theme-dark .login-hero,
body.bt-theme-dark .role-box,
body.bt-theme-dark .toggle-row,
body.bt-theme-dark .stock-tool-card,
body.bt-theme-dark .closing-step-card,
body.bt-theme-dark .closing-format-option,
body.bt-theme-dark .closing-destination-option,
body.bt-theme-dark .service-search-result-card,
body.bt-theme-dark .cart-line,
body.bt-theme-dark .product-live-card{
  background:#252526 !important;
  border-color:#3c3c3c !important;
  color:#f4f4f5 !important;
  box-shadow:0 14px 36px rgba(0,0,0,.28) !important;
}

body.bt-theme-dark h1,
body.bt-theme-dark h2,
body.bt-theme-dark h3,
body.bt-theme-dark b,
body.bt-theme-dark strong,
body.bt-theme-dark label,
body.bt-theme-dark .form-field,
body.bt-theme-dark .field label,
body.bt-theme-dark .login-field,
body.bt-theme-dark .section-title{
  color:#f4f4f5 !important;
}

body.bt-theme-dark .muted,
body.bt-theme-dark small,
body.bt-theme-dark .text-muted,
body.bt-theme-dark .login-hero p,
body.bt-theme-dark .login-security,
body.bt-theme-dark .brand-credit,
body.bt-theme-dark .form-field small,
body.bt-theme-dark .role-box small{
  color:#a5adba !important;
}

body.bt-theme-dark input,
body.bt-theme-dark select,
body.bt-theme-dark textarea{
  background:#1f1f1f !important;
  color:#f4f4f5 !important;
  border-color:#3c3c3c !important;
}

body.bt-theme-dark input:hover,
body.bt-theme-dark select:hover,
body.bt-theme-dark textarea:hover{
  border-color:#5f6b7a !important;
}

body.bt-theme-dark input:focus,
body.bt-theme-dark select:focus,
body.bt-theme-dark textarea:focus{
  border-color:#3794ff !important;
  box-shadow:0 0 0 4px rgba(55,148,255,.18) !important;
}

body.bt-theme-dark input::placeholder,
body.bt-theme-dark textarea::placeholder{
  color:#7f8794 !important;
}

body.bt-theme-dark .nav button,
body.bt-theme-dark button.secondary,
body.bt-theme-dark button.out,
body.bt-theme-dark .buttonlike.secondary,
body.bt-theme-dark .theme-switch{
  background:#2d2d30 !important;
  color:#f4f4f5 !important;
  border-color:#3c3c3c !important;
}

body.bt-theme-dark .nav button.active,
body.bt-theme-dark button:not(.secondary):not(.out):not(.danger):not(.theme-switch),
body.bt-theme-dark .buttonlike:not(.secondary){
  background:linear-gradient(135deg,#007acc,#005a9e) !important;
  color:#fff !important;
  border-color:#007acc !important;
}

body.bt-theme-dark button.danger{
  background:#b91c1c !important;
  color:#fff !important;
}

body.bt-theme-dark .table th{
  background:#2d2d30 !important;
  color:#e5e7eb !important;
}

body.bt-theme-dark .table td{
  background:#252526 !important;
  color:#f4f4f5 !important;
  border-color:#3c3c3c !important;
}

body.bt-theme-dark .badge,
body.bt-theme-dark .pill,
body.bt-theme-dark .role-permission-list span,
body.bt-theme-dark .login-kicker,
body.bt-theme-dark .role-box-head > span{
  background:#16324f !important;
  color:#9cdcfe !important;
}

body.bt-theme-dark .badge.good,
body.bt-theme-dark .pill.good,
body.bt-theme-dark .greenbox{
  background:#132f20 !important;
  color:#86efac !important;
}

body.bt-theme-dark .badge.warn,
body.bt-theme-dark .amberbox{
  background:#3a2a12 !important;
  color:#fbbf24 !important;
}

body.bt-theme-dark .badge.danger,
body.bt-theme-dark .pill.bad,
body.bt-theme-dark .redbox{
  background:#3b1d23 !important;
  color:#fca5a5 !important;
}

body.bt-theme-dark .bluebox,
body.bt-theme-dark .login-maker,
body.bt-theme-dark .login-feature-grid span{
  background:#16324f !important;
  color:#dbeafe !important;
  border-color:#21486e !important;
}

body.bt-theme-dark .pay-total-card,
body.bt-theme-dark .total-card,
body.bt-theme-dark .bigtotal{
  background:#132f20 !important;
  border-color:#15803d !important;
  color:#dcfce7 !important;
}

body.bt-theme-dark .pay-total-amount,
body.bt-theme-dark .huge,
body.bt-theme-dark .bigtotal .amount{
  color:#86efac !important;
}

body.bt-theme-dark .toggle-control,
body.bt-theme-dark .mini-toggle span{
  background:#4b5563;
}

body.bt-theme-dark .toggle-input:checked + .toggle-control,
body.bt-theme-dark .mini-toggle input:checked + span{
  background:#007acc;
}

body.bt-theme-dark .stock-inventory-row.warning td{
  background:#3a2a12 !important;
}

body.bt-theme-dark .stock-inventory-row.critical td{
  background:#3b1d23 !important;
}

/* V5.53 - Tema scuro leggibile in Movimenti */
body.bt-theme-dark .movement-hero-meta,
body.bt-theme-dark .movement-filter-panel,
body.bt-theme-dark .movement-include-deleted,
body.bt-theme-dark .movement-control-card .movement-filter-panel{
  background:#2d2d30 !important;
  border-color:#3c3c3c !important;
  color:#f4f4f5 !important;
}

body.bt-theme-dark .movement-hero-meta span,
body.bt-theme-dark .movement-hero-meta small,
body.bt-theme-dark .movement-filter-panel label,
body.bt-theme-dark .movement-filter-panel label span,
body.bt-theme-dark .movement-title-kicker,
body.bt-theme-dark .movement-modebar button span,
body.bt-theme-dark .movements-hero .movement-modebar button span,
body.bt-theme-dark .movement-summary .item span,
body.bt-theme-dark .movement-summary .item small,
body.bt-theme-dark .movement-date span,
body.bt-theme-dark .movement-product span,
body.bt-theme-dark .movement-note,
body.bt-theme-dark .movement-note small{
  color:#a5adba !important;
}

body.bt-theme-dark .movement-hero-meta b,
body.bt-theme-dark .movement-summary .item b,
body.bt-theme-dark .movement-date b,
body.bt-theme-dark .movement-product b,
body.bt-theme-dark .movements-list-card h2{
  color:#f4f4f5 !important;
}

body.bt-theme-dark .movement-modebar button,
body.bt-theme-dark .movements-hero .movement-modebar button,
body.bt-theme-dark .movements-card .movement-modebar button{
  background:#007acc !important;
  border-color:#1688d6 !important;
  color:#fff !important;
  box-shadow:none !important;
}

body.bt-theme-dark .movement-modebar button span,
body.bt-theme-dark .movements-hero .movement-modebar button span,
body.bt-theme-dark .movements-card .movement-modebar button span{
  color:#dbeafe !important;
}

body.bt-theme-dark .movement-modebar button.active,
body.bt-theme-dark .movements-hero .movement-modebar button.active,
body.bt-theme-dark .movements-card .movement-modebar button.active{
  background:#005a9e !important;
  border-color:#3794ff !important;
  box-shadow:0 0 0 3px rgba(55,148,255,.18) !important;
}

body.bt-theme-dark .movement-summary .item{
  background:#252526 !important;
  border-color:#3c3c3c !important;
}

body.bt-theme-dark .movement-summary .item.good{
  background:#132f20 !important;
  border-color:#166534 !important;
}

body.bt-theme-dark .movement-summary .item.redbox{
  background:#3b1d23 !important;
  border-color:#7f1d1d !important;
}

body.bt-theme-dark .movement-payment{
  background:#16324f !important;
  color:#9cdcfe !important;
  border-color:#3794ff !important;
}

body.bt-theme-dark .movement-type,
body.bt-theme-dark .badge.dark,
body.bt-theme-dark .badge.vendita,
body.bt-theme-dark .badge.sale,
body.bt-theme-dark .badge.Vendita{
  background:#132f20 !important;
  color:#86efac !important;
  border-color:#166534 !important;
}

body.bt-theme-dark .badge.carico,
body.bt-theme-dark .badge.acquisto,
body.bt-theme-dark .badge.reso,
body.bt-theme-dark .badge.deleted,
body.bt-theme-dark .badge.eliminato{
  background:#3a2a12 !important;
  color:#fbbf24 !important;
  border-color:#92400e !important;
}

body.bt-theme-dark .movement-quickbar .badge.dark{
  background:#16324f !important;
  color:#9cdcfe !important;
  border-color:#3794ff !important;
}

body.bt-theme-dark .multi-pc-status{
  background:#132f20 !important;
  color:#86efac !important;
  border-color:#166534 !important;
}

body.bt-theme-dark .multi-pc-status .muted,
body.bt-theme-dark .multi-pc-status span{
  color:#86efac !important;
}

body.bt-theme-dark .movement-filter-panel input[type="checkbox"],
body.bt-theme-dark .movement-include-deleted input{
  accent-color:#3794ff;
}

/* V5.54 - campi cassa piu stabili e bottoni allineati */
button,
.buttonlike{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
  vertical-align:middle !important;
  line-height:1.12 !important;
}

.toolbar,
.stat-quick-actions,
.stock-workspace-tabs,
.movement-quickbar,
.movement-modebar,
.quick-cash{
  align-items:center !important;
}

.grid > button,
.grid > .buttonlike,
.toolbar > button,
.toolbar > .buttonlike{
  align-self:center !important;
}

.cashier-quick-btn{
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  text-align:left !important;
}

.cashier-fav-picker input,
.payment-panel input{
  transform:none !important;
}

.payment-panel input:focus,
.cashier-fav-picker input:focus{
  transform:none !important;
}

#mixed-missing-warning:empty{
  display:none !important;
}

/* V5.55 - riallineamento form larghi: statistiche, chiusura, servizi e FIFO */
html,
body{
  overflow-x:hidden;
}

main,
.card,
.grid,
.grid > *,
.tablewrap{
  min-width:0;
}

input[type="checkbox"]:not(.toggle-input){
  width:20px !important;
  min-width:20px !important;
  max-width:20px !important;
  height:20px !important;
  min-height:20px !important;
  padding:0 !important;
  margin:0 !important;
  flex:0 0 auto !important;
  accent-color:#155eef;
}

.mini-toggle input{
  position:absolute !important;
  inline-size:1px !important;
  block-size:1px !important;
  width:1px !important;
  height:1px !important;
  opacity:0 !important;
  pointer-events:none !important;
}

.stats-compact-grid{
  grid-template-columns:minmax(140px,.75fr) minmax(320px,1.45fr) minmax(160px,.85fr) minmax(280px,1.35fr) minmax(170px,.85fr) minmax(130px,.7fr) !important;
  align-items:end !important;
  gap:12px !important;
}

.stats-compact-grid .form-field > span,
.stats-period-inputs .form-field > span,
.lot-form-grid .form-field > span,
.service-config-card .form-field > span{
  min-height:24px !important;
  align-items:flex-end !important;
}

.stats-compact-grid .form-field input,
.stats-compact-grid .form-field select,
.stats-period-inputs .form-field input,
.stats-period-inputs .form-field select{
  height:50px !important;
  min-height:50px !important;
}

.stats-compact-grid > button{
  height:50px !important;
  min-height:50px !important;
  align-self:end !important;
  width:100%;
}

.stats-period-inputs{
  align-items:end !important;
}

.closing-destination-form-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px 16px;
  align-items:end;
}

.closing-destination-form-grid .form-field,
.closing-destination-form-grid .toggle-row{
  margin:0 !important;
}

.closing-destination-form-grid .toggle-row{
  min-height:74px !important;
  align-self:end;
}

.closing-destination-form-grid .closing-full{
  grid-column:1/-1;
}

.closing-destination-form-grid textarea{
  width:100%;
  min-height:110px !important;
  resize:vertical;
}

.service-config-grid{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:18px !important;
}

.service-config-card{
  min-width:0;
  overflow:hidden;
}

.service-config-card .grid.g3{
  align-items:end !important;
  gap:14px 16px !important;
}

.service-config-card .service-mode-field select{
  width:100%;
}

.service-config-card > button{
  width:auto;
  max-width:100%;
}

.lot-form-grid{
  display:grid;
  grid-template-columns:minmax(280px,1.25fr) minmax(230px,1fr) repeat(3,minmax(160px,.85fr));
  gap:14px 16px;
  align-items:end;
}

.lot-form-grid .form-field input,
.lot-form-grid .form-field select{
  height:50px !important;
  min-height:50px !important;
}

.department-mode-buttons{
  align-items:center !important;
  gap:10px !important;
}

@media(max-width:1400px){
  .stats-compact-grid{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  }
  .stats-compact-grid > button{
    width:auto;
    min-width:160px;
  }
  .lot-form-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:980px){
  .stats-compact-grid,
  .closing-destination-form-grid,
  .service-config-grid,
  .lot-form-grid{
    grid-template-columns:1fr !important;
  }
  .stats-period-inputs{
    grid-template-columns:1fr !important;
  }
  .stats-compact-grid > button,
  .service-config-card > button{
    width:100%;
  }
}

/* V5.56 - switch per formati esportazione chiusura */
.closing-format-option{
  grid-template-columns:minmax(0,1fr) auto;
}

.closing-format-option .toggle-input{
  position:absolute !important;
  inline-size:1px !important;
  block-size:1px !important;
  width:1px !important;
  height:1px !important;
  opacity:0 !important;
  pointer-events:none !important;
}

.closing-format-option .toggle-control{
  flex:0 0 54px;
  width:54px !important;
  height:30px !important;
  min-width:54px !important;
  min-height:30px !important;
}

.closing-format-option .toggle-input:focus-visible + .toggle-control{
  box-shadow:0 0 0 4px rgba(21,94,239,.18), inset 0 2px 6px rgba(15,23,42,.18);
}

/* V5.57 - bottoni pagamento leggibili anche su pannello stretto */
.payment-panel button,
.payment-panel .buttonlike{
  min-width:0 !important;
  max-width:100% !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  line-height:1.18 !important;
  word-break:normal !important;
  overflow-wrap:break-word !important;
}

.payment-panel .grid.g2,
.payment-panel .grid.g3{
  align-items:stretch !important;
}

.payment-panel .grid.g2 > button,
.payment-panel .grid.g3 > button{
  width:100% !important;
  min-height:58px !important;
  padding-left:14px !important;
  padding-right:14px !important;
}

.payment-panel .grid.g2 > button{
  min-height:64px !important;
}

@media(max-width:720px){
  .payment-panel{
    padding:20px !important;
  }

  .payment-panel .grid.g2,
  .payment-panel .grid.g3{
    grid-template-columns:1fr !important;
  }

  .payment-panel h2{
    font-size:28px !important;
  }

  .payment-panel .profit-summary{
    grid-template-columns:1fr !important;
  }
}

/* V5.58 - ricerca avanzata nei movimenti */
.movement-local-filter-panel{
  display:grid;
  grid-template-columns:minmax(260px,1.45fr) repeat(5,minmax(130px,.8fr)) auto;
  gap:12px;
  align-items:end;
  margin-top:14px;
  padding:14px;
  border:1px solid #dbe4f0;
  border-radius:16px;
  background:linear-gradient(180deg,#ffffff,#f8fbff);
}

.movement-local-filter-panel .form-field{
  margin:0 !important;
}

.movement-local-filter-panel .form-field > span{
  min-height:22px !important;
  align-items:flex-end !important;
}

.movement-local-filter-panel input,
.movement-local-filter-panel select{
  height:50px !important;
  min-height:50px !important;
}

.movement-local-filter-panel button{
  height:50px !important;
  min-height:50px !important;
  white-space:normal !important;
}

.movement-search-field input{
  font-weight:800 !important;
}

.movement-quickbar .badge.warn{
  background:#fff7ed !important;
  color:#9a3412 !important;
  border:1px solid #fed7aa !important;
}

body.bt-theme-dark .movement-local-filter-panel{
  background:#252526 !important;
  border-color:#3c3c3c !important;
  color:#f4f4f5 !important;
}

body.bt-theme-dark .movement-local-filter-panel .form-field,
body.bt-theme-dark .movement-local-filter-panel .form-field > span{
  color:#f4f4f5 !important;
}

body.bt-theme-dark .movement-local-filter-panel button.secondary{
  background:#2d2d30 !important;
  color:#f4f4f5 !important;
  border-color:#3c3c3c !important;
}

@media(max-width:1400px){
  .movement-local-filter-panel{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:820px){
  .movement-local-filter-panel{
    grid-template-columns:1fr;
  }
}

/* V5.59 - allineamento nuovo prodotto e obiettivo leggibile in tema scuro */
.new-product-manual > .grid.g4{
  align-items:end !important;
}

.new-product-manual .form-field{
  margin:0 !important;
  min-height:82px;
}

.new-product-manual .form-field > span{
  min-height:24px !important;
  align-items:flex-end !important;
}

.new-product-manual .form-field input,
.new-product-manual .form-field select{
  height:50px !important;
  min-height:50px !important;
}

.new-product-manual .product-checkbox-field{
  min-height:74px !important;
  align-self:end !important;
}

body.bt-theme-dark .dashboard-goal-card{
  background:linear-gradient(135deg,#1f2a24,#252526) !important;
  border-color:#166534 !important;
}

body.bt-theme-dark .dashboard-goal-card .muted{
  color:#cbd5e1 !important;
}

body.bt-theme-dark .dashboard-goal-percent{
  background:#0f9f6e !important;
  color:#ffffff !important;
}

body.bt-theme-dark .dashboard-goal-values div{
  background:#1f2933 !important;
  border-color:#375846 !important;
  color:#f4f4f5 !important;
}

body.bt-theme-dark .dashboard-goal-values span{
  color:#cbd5e1 !important;
}

body.bt-theme-dark .dashboard-goal-values b{
  color:#86efac !important;
}

body.bt-theme-dark .dashboard-goal-bar{
  background:#132f20 !important;
  border-color:#166534 !important;
}

/* V5.60 - sfondo scuro piu naturale, senza tagli laterali */
html.bt-theme-dark,
body.bt-theme-dark{
  min-height:100%;
  background-color:#1e1e1e !important;
}

body.bt-theme-dark{
  min-height:100vh;
  background:
    radial-gradient(ellipse 1100px 720px at 11% 112%, rgba(0,122,204,.13) 0%, rgba(0,122,204,.075) 36%, rgba(0,122,204,0) 76%),
    radial-gradient(ellipse 980px 680px at 94% 112%, rgba(55,148,255,.075) 0%, rgba(55,148,255,.04) 38%, rgba(55,148,255,0) 78%),
    radial-gradient(ellipse 900px 560px at 50% -14%, rgba(75,85,99,.16) 0%, rgba(75,85,99,.07) 44%, rgba(75,85,99,0) 78%),
    linear-gradient(180deg,#202020 0%,#1f1f1f 44%,#1d1d1d 100%) !important;
  background-attachment:fixed !important;
  background-repeat:no-repeat !important;
  background-size:cover !important;
}

body.bt-theme-dark::before{
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,.006) 46%, rgba(255,255,255,.012)) !important;
  background-size:100% 100% !important;
  mask-image:none !important;
  opacity:1;
}

/* V5.69 - cassa leggibile anche in tema scuro */
body.bt-theme-dark .cashier-quick-box,
body.bt-theme-dark .cashier-fav-picker,
body.bt-theme-dark .cashier-fav-row{
  background:#252526 !important;
  border-color:#3c3c3c !important;
  color:#f4f4f5 !important;
}

body.bt-theme-dark .cashier-quick-box h3,
body.bt-theme-dark .cashier-fav-picker h3,
body.bt-theme-dark .cashier-fav-row b{
  color:#f4f4f5 !important;
}

body.bt-theme-dark .cashier-quick-box .muted,
body.bt-theme-dark .cashier-fav-row span{
  color:#a5adba !important;
}

body.bt-theme-dark .cashier-quick-box button.cashier-quick-btn:not(.secondary):not(.out):not(.danger):not(.theme-switch){
  background:#0f172a !important;
  color:#ffffff !important;
  border-color:#1e293b !important;
  box-shadow:0 10px 22px rgba(0,0,0,.28) !important;
}

body.bt-theme-dark .cashier-quick-box button.cashier-quick-btn:not(.secondary):not(.out):not(.danger):not(.theme-switch):hover{
  background:#064e3b !important;
  border-color:#10b981 !important;
}

body.bt-theme-dark .cashier-quick-box button.cashier-quick-btn *,
body.bt-theme-dark .cashier-quick-box button.cashier-fav-add-btn *,
body.bt-theme-dark .cashier-fav-picker .cashier-fav-row button:not(.secondary) *{
  color:#ffffff !important;
}

body.bt-theme-dark .cashier-quick-box button.cashier-fav-add-btn:not(.secondary):not(.out):not(.danger):not(.theme-switch),
body.bt-theme-dark .cashier-fav-picker .cashier-fav-row button:not(.secondary):not(.out):not(.danger):not(.theme-switch){
  background:#047857 !important;
  color:#ffffff !important;
  border-color:#047857 !important;
}

body.bt-theme-dark .cashier-quick-box button.cashier-view-toggle{
  background:#1e293b !important;
  color:#bfdbfe !important;
  border-color:#334155 !important;
}

body.bt-theme-dark .cashier-quick-box button.cashier-view-toggle *{
  color:#bfdbfe !important;
}

/* V5.70 - rifinitura responsive finale: PC, tablet e smartphone */
html,
body,
.app{
  max-width:100%;
}

.topbar,
.brand,
.topbar-actions,
.scan,
.nav,
.card,
.item,
.stat,
.tablewrap,
.cashier-left,
.cashier-right,
.payment-panel,
.pay-total-card,
.product-live-card,
.service-search-result-card,
.movement-control-card,
.movements-card,
.movements-list-card,
.config-modern-card,
.stock-tool-card{
  min-width:0 !important;
}

.topbar{
  display:grid !important;
  grid-template-columns:minmax(280px,1fr) minmax(420px,auto);
  align-items:center !important;
  gap:14px !important;
}

.brand{
  overflow:hidden;
}

.brand > div:last-child{
  min-width:0;
}

.brand h1,
.brand .muted,
.brand-credit{
  overflow:hidden;
  text-overflow:ellipsis;
}

.topbar-actions{
  width:100%;
}

.topbar .scan{
  flex:1 1 420px;
}

.nav{
  overflow-x:auto !important;
  overflow-y:hidden !important;
  scrollbar-width:thin;
  -webkit-overflow-scrolling:touch;
}

.nav button{
  white-space:normal !important;
  line-height:1.12 !important;
  overflow-wrap:anywhere;
}

.tablewrap,
.stat-line-card,
.stat-modern-line-card{
  max-width:100%;
  overflow:auto;
}

.table{
  width:100%;
}

.row{
  min-width:0;
}

.row > *,
.toolbar > *,
.grid > *{
  min-width:0;
}

body.bt-device-desktop.bt-density-standard .app{
  padding:18px 22px 30px !important;
}

body.bt-device-desktop.bt-density-standard .cashier-layout{
  grid-template-columns:minmax(0,1fr) minmax(360px,430px);
  gap:16px;
}

body.bt-device-desktop.bt-density-roomy .app{
  max-width:1960px;
  padding:30px 38px 42px !important;
}

body.bt-device-desktop.bt-density-roomy .cashier-layout{
  grid-template-columns:minmax(0,1fr) minmax(420px,520px);
  gap:22px;
}

body.bt-device-desktop.bt-density-roomy .nav{
  gap:10px !important;
}

body.bt-device-tablet .app{
  padding:14px 16px 26px !important;
}

body.bt-device-tablet .topbar{
  grid-template-columns:1fr !important;
  padding:14px !important;
}

body.bt-device-tablet .topbar-actions{
  display:grid !important;
  grid-template-columns:auto auto auto minmax(360px,1fr);
  justify-content:stretch !important;
  align-items:center;
}

body.bt-device-tablet .topbar .scan{
  width:100%;
  flex-basis:auto;
}

body.bt-device-tablet .nav{
  display:flex !important;
  flex-wrap:nowrap !important;
  gap:8px !important;
  padding:8px !important;
  margin:14px 0 !important;
}

body.bt-device-tablet .nav button{
  flex:0 0 clamp(132px, 18vw, 190px);
}

body.bt-device-tablet .grid.g3,
body.bt-device-tablet .grid.g4,
body.bt-device-tablet .grid.g5,
body.bt-device-tablet .grid.g6,
body.bt-device-tablet .layout,
body.bt-device-tablet .users-roles-layout{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
}

body.bt-device-tablet .grid.g2{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
}

body.bt-device-tablet .cashier-layout{
  gap:14px !important;
}

body.bt-device-tablet .cashier-left,
body.bt-device-tablet .payment-panel,
body.bt-device-tablet .pay-total-card{
  padding:18px !important;
}

body.bt-device-tablet .cashier-quick-grid,
body.bt-device-tablet .cashier-quick-grid.tablet{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
}

@media(min-width:981px){
  body.bt-device-tablet .cart-table-clean .cart-line,
  body.bt-device-tablet .cart-table-clean .cart-line-head{
    grid-template-columns:minmax(220px,1fr) 88px 138px 112px 112px 98px !important;
    column-gap:10px !important;
  }
}

@media(max-width:980px){
  body.bt-device-tablet .cart-table-clean .cart-line-head{
    display:none !important;
  }

  body.bt-device-tablet .cart-table-clean .cart-line{
    grid-template-columns:1fr 1fr !important;
  }
}

body.bt-device-tablet .payment-panel .grid.g3{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
}

body.bt-device-tablet .payment-panel .grid.g2{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
}

@media(max-width:820px) and (min-width:641px){
  body.bt-device-tablet .topbar-actions{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  body.bt-device-tablet .topbar .scan{
    grid-column:1 / -1;
  }
}

body.bt-device-phone{
  font-size:15px !important;
}

body.bt-device-phone .app{
  padding:8px 8px 18px !important;
}

body.bt-device-phone .topbar{
  grid-template-columns:1fr !important;
  gap:10px !important;
  padding:12px !important;
  border-radius:12px !important;
}

body.bt-device-phone .brand{
  display:grid !important;
  grid-template-columns:44px minmax(0,1fr);
  gap:10px !important;
  align-items:center !important;
}

body.bt-device-phone .logo{
  width:44px;
  height:44px;
  border-radius:10px !important;
}

body.bt-device-phone .brand h1{
  font-size:21px !important;
  white-space:normal;
}

body.bt-device-phone .brand .muted,
body.bt-device-phone .brand-credit{
  white-space:normal;
  font-size:12px !important;
  line-height:1.25;
}

body.bt-device-phone .topbar-actions{
  display:grid !important;
  grid-template-columns:1fr 1fr;
  gap:8px !important;
}

body.bt-device-phone .theme-switch,
body.bt-device-phone .lang-switch,
body.bt-device-phone .logout-btn{
  width:100%;
}

body.bt-device-phone .scan{
  grid-column:1 / -1;
  width:100%;
  min-height:0 !important;
  border-radius:12px !important;
}

body.bt-device-phone .topbar .scan{
  grid-template-columns:1fr !important;
  padding:8px !important;
}

body.bt-device-phone .topbar .scan #barcode,
body.bt-device-phone .topbar .scan button{
  width:100%;
  min-width:0 !important;
}

body.bt-device-phone .nav{
  display:flex !important;
  flex-wrap:nowrap !important;
  gap:7px !important;
  padding:7px !important;
  margin:10px 0 !important;
  border-radius:12px !important;
}

body.bt-device-phone .nav button{
  flex:0 0 116px;
  min-height:44px !important;
  padding:8px 9px !important;
  font-size:12px !important;
}

body.bt-device-phone h2{
  font-size:21px !important;
}

body.bt-device-phone h3{
  font-size:17px !important;
}

body.bt-device-phone .card,
body.bt-device-phone .cashier-left,
body.bt-device-phone .payment-panel,
body.bt-device-phone .pay-total-card,
body.bt-device-phone .stock-tool-card,
body.bt-device-phone .config-modern-card{
  padding:14px !important;
  border-radius:12px !important;
}

body.bt-device-phone .grid,
body.bt-device-phone .grid.g2,
body.bt-device-phone .grid.g3,
body.bt-device-phone .grid.g4,
body.bt-device-phone .grid.g5,
body.bt-device-phone .grid.g6,
body.bt-device-phone .layout,
body.bt-device-phone .users-roles-layout,
body.bt-device-phone .config-grid,
body.bt-device-phone .stock-tool-grid{
  grid-template-columns:1fr !important;
  gap:10px !important;
}

body.bt-device-phone .row{
  flex-wrap:wrap;
  align-items:flex-start;
  gap:8px !important;
}

body.bt-device-phone .row > .toolbar,
body.bt-device-phone .toolbar{
  width:100%;
}

body.bt-device-phone .toolbar > button,
body.bt-device-phone .toolbar > .buttonlike{
  flex:1 1 130px;
}

body.bt-device-phone .cashier-layout{
  gap:12px !important;
}

body.bt-device-phone .cashier-left > .grid.g3{
  grid-template-columns:1fr !important;
}

body.bt-device-phone .cashier-quick-box{
  padding:12px !important;
  border-radius:12px !important;
}

body.bt-device-phone .cashier-quick-grid,
body.bt-device-phone .cashier-quick-grid.tablet{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:8px !important;
}

body.bt-device-phone .cashier-quick-btn{
  min-height:88px !important;
  padding:11px !important;
  border-radius:12px !important;
}

body.bt-device-phone .cashier-quick-btn b{
  font-size:13px !important;
  line-height:1.2;
}

body.bt-device-phone .cashier-quick-btn span{
  font-size:14px !important;
}

body.bt-device-phone .empty-cart{
  padding:26px 14px !important;
  border-radius:12px !important;
  font-size:15px !important;
}

body.bt-device-phone .cart-table-clean .cart-line{
  grid-template-columns:1fr !important;
  padding:14px !important;
  border-radius:14px !important;
}

body.bt-device-phone .cart-table-clean .cart-line-total,
body.bt-device-phone .cart-table-clean .cart-line-profit,
body.bt-device-phone .cart-table-clean .cart-remove-btn{
  width:100% !important;
  min-width:0 !important;
  justify-self:stretch !important;
}

body.bt-device-phone .pay-total-card{
  text-align:center;
}

body.bt-device-phone .pay-total-amount,
body.bt-device-phone .bigtotal .amount{
  font-size:clamp(38px, 13vw, 54px) !important;
  overflow-wrap:anywhere;
}

body.bt-device-phone .payment-panel .grid.g2,
body.bt-device-phone .payment-panel .grid.g3,
body.bt-device-phone .quick-cash{
  grid-template-columns:1fr !important;
}

body.bt-device-phone .payment-panel button,
body.bt-device-phone .pay-confirm-button,
body.bt-device-phone .pay-secondary-button{
  width:100%;
}

body.bt-device-phone .tablewrap{
  border-radius:12px !important;
}

body.bt-device-phone .table{
  min-width:680px !important;
}

body.bt-device-phone .login-shell{
  min-height:auto !important;
  padding:10px 0 !important;
}

body.bt-device-phone .login-hero,
body.bt-device-phone .login-panel{
  padding:18px !important;
  border-radius:14px !important;
}

body.bt-device-phone .login-feature-grid{
  grid-template-columns:1fr !important;
}

body.bt-device-phone .login-panel-head{
  gap:12px;
}

body.bt-device-phone .login-panel-actions{
  width:100%;
  justify-content:stretch;
}

body.bt-device-phone .login-panel-actions > *{
  flex:1 1 auto;
}

/* V5.71 - rifinitura UI finale per PC, tablet e smartphone */
.app,
.card,
.item,
.row,
.toolbar,
.tablewrap,
.stock-workspace-head,
.stock-workspace-tabs,
.config-workspace-tabs,
.stat-control-panel,
.stats-compact-grid,
.stats-period-inputs,
.product-search-panel,
.products-live-results,
.product-live-card,
.menu-form-card,
.menu-preview-card,
.qr-order-card,
.display-stock-card,
.order-preview-panel,
.closing-modern-card{
  min-width:0;
}

.card > .row:first-child,
.stock-workspace-head > .row,
.stats-compact-header,
.menu-form-header,
.closing-modern-head,
.role-box-head{
  align-items:flex-start;
  gap:14px;
}

.card > .row:first-child h2,
.stock-workspace-head h2,
.stat-control-panel h2,
.menu-form-header h2,
.closing-modern-head h2,
.config-modern-card h2{
  margin-top:0;
  line-height:1.12;
}

.toolbar,
.row{
  flex-wrap:wrap;
}

.toolbar button,
.toolbar .buttonlike,
.row button,
.row .buttonlike,
.stock-workspace-tabs button,
.config-workspace-tabs button,
.stat-quick-actions button,
.menu-form-actions button,
.product-live-actions button,
.display-stock-actions button,
.closing-submit-button{
  min-width:0;
  overflow-wrap:anywhere;
  white-space:normal;
  line-height:1.14;
}

input,
select,
textarea,
button,
.buttonlike{
  max-width:100%;
}

.tablewrap{
  width:100%;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

.table th,
.table td{
  overflow-wrap:anywhere;
}

.stock-workspace-head,
.config-workspace-head,
.stat-control-panel,
.closing-modern-card{
  overflow:hidden;
}

.stock-workspace-tabs,
.config-workspace-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  max-width:100%;
}

.stock-workspace-tabs button,
.config-workspace-tabs button{
  flex:1 1 150px;
  min-height:46px;
  padding:10px 14px !important;
}

.stat-control-compact{
  padding:20px !important;
}

.stats-compact-header{
  display:flex;
  justify-content:space-between;
  margin-bottom:14px;
}

.stats-compact-header > div{
  min-width:0;
}

.stats-compact-header .badge{
  flex:0 0 auto;
}

.stats-compact-grid{
  display:grid;
  grid-template-columns:170px minmax(240px,1fr) 180px minmax(220px,1fr) 160px auto;
  gap:10px;
  align-items:end;
}

.stats-period-inputs{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.stats-period-inputs .form-field{
  min-width:0;
}

.stat-quick-actions.compact{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}

.stat-quick-actions.compact button{
  flex:1 1 140px;
}

.stat-chart-card,
.stat-modern-line-card,
.stat-line-card{
  overflow:hidden;
}

.stat-bar-row,
.stat-chart-card .tablewrap{
  min-width:0;
}

.today-todo-grid,
.dashboard-goal-values{
  align-items:stretch;
}

.today-todo-item{
  min-width:0;
  overflow:hidden;
}

.today-todo-item b,
.today-todo-item small,
.dashboard-goal-values b,
.dashboard-goal-values span{
  overflow-wrap:anywhere;
}

.product-search-panel{
  grid-template-columns:minmax(220px,1fr) minmax(170px,220px) auto;
}

.product-live-card{
  grid-template-columns:minmax(220px,1fr) minmax(110px,150px) minmax(180px,auto);
}

.product-live-card > div:first-child,
.product-live-price{
  min-width:0;
}

.product-live-card b,
.product-live-card small,
.product-live-price{
  overflow-wrap:anywhere;
}

.product-live-actions{
  align-items:center;
}

.product-live-actions button{
  flex:1 1 auto;
}

.menu-form-grid,
.config-field-grid,
.config-toggle-grid,
.closing-modern-form,
.closing-destination-form-grid{
  align-items:stretch;
}

.menu-form-grid .field,
.form-field,
.closing-field,
.toggle-row,
.closing-format-option,
.closing-destination-option{
  min-width:0;
}

.menu-form-actions{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.menu-preview-card,
.qr-order-card{
  overflow:hidden;
}

.menu-preview-card h3,
.menu-preview-card p,
.qr-order-card b,
.qr-order-card small{
  overflow-wrap:anywhere;
}

.display-stock-tools{
  grid-template-columns:minmax(220px,1fr) minmax(160px,220px) minmax(140px,180px) auto;
  align-items:end;
}

.display-stock-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}

.display-stock-actions .small-input{
  flex:1 1 84px;
  min-width:74px;
}

.order-preview-panel,
.order-preview-group,
.order-preview-line{
  max-width:100%;
}

.order-preview-line{
  grid-template-columns:minmax(0,1fr) minmax(86px,auto) minmax(86px,auto) minmax(100px,auto);
  gap:10px;
}

.order-preview-line b,
.order-preview-line span,
.order-preview-line em{
  overflow-wrap:anywhere;
}

.closing-modern-form{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.closing-field input,
.closing-field select,
.closing-field textarea,
.menu-form-grid input,
.menu-form-grid select,
.menu-form-grid textarea,
.config-field-grid input,
.config-field-grid select,
.config-field-grid textarea{
  width:100%;
}

.closing-format-option,
.toggle-row{
  gap:12px;
}

.closing-format-option > span,
.toggle-row > span,
.closing-step-card > div{
  min-width:0;
}

.closing-submit-button{
  width:100%;
  min-height:58px !important;
}

.role-box,
.user-role-card,
.roles-panel,
.users-table-card{
  min-width:0;
  overflow:hidden;
}

.role-permission-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.role-permission-list span{
  max-width:100%;
  overflow-wrap:anywhere;
}

body.bt-theme-dark .stat-control-panel,
body.bt-theme-dark .stat-chart-card,
body.bt-theme-dark .stat-modern-line-card,
body.bt-theme-dark .stat-line-card,
body.bt-theme-dark .stock-workspace-head,
body.bt-theme-dark .stock-tool-card,
body.bt-theme-dark .display-stock-card,
body.bt-theme-dark .order-preview-panel,
body.bt-theme-dark .order-preview-group,
body.bt-theme-dark .menu-form-card,
body.bt-theme-dark .menu-preview-card,
body.bt-theme-dark .qr-order-card,
body.bt-theme-dark .config-modern-card,
body.bt-theme-dark .roles-panel,
body.bt-theme-dark .user-role-card,
body.bt-theme-dark .users-table-card,
body.bt-theme-dark .closing-modern-card{
  background:#0f172a !important;
  border-color:#1e293b !important;
  color:#f8fafc !important;
}

body.bt-theme-dark .stat-control-panel h2,
body.bt-theme-dark .stat-chart-card h2,
body.bt-theme-dark .stock-workspace-head h2,
body.bt-theme-dark .stock-tool-card h2,
body.bt-theme-dark .menu-form-card h2,
body.bt-theme-dark .config-modern-card h2,
body.bt-theme-dark .closing-modern-card h2,
body.bt-theme-dark .roles-panel h2,
body.bt-theme-dark .user-role-card h2,
body.bt-theme-dark .users-table-card h2{
  color:#f8fafc !important;
}

body.bt-theme-dark .stat-control-panel .muted,
body.bt-theme-dark .stat-chart-card .muted,
body.bt-theme-dark .stock-workspace-head .muted,
body.bt-theme-dark .stock-tool-card .muted,
body.bt-theme-dark .menu-form-card .muted,
body.bt-theme-dark .config-modern-card .muted,
body.bt-theme-dark .closing-modern-card .muted,
body.bt-theme-dark .role-box small,
body.bt-theme-dark .qr-order-card small{
  color:#cbd5e1 !important;
}

body.bt-theme-dark .stat-bar-row,
body.bt-theme-dark .empty-search-result,
body.bt-theme-dark .menu-form-help,
body.bt-theme-dark .order-preview-line,
body.bt-theme-dark .display-stock-table td,
body.bt-theme-dark .category-picker,
body.bt-theme-dark .role-permission-list span{
  background:#111827 !important;
  border-color:#334155 !important;
  color:#e5e7eb !important;
}

body.bt-theme-dark .stock-workspace-tabs button.secondary,
body.bt-theme-dark .config-workspace-tabs button.secondary,
body.bt-theme-dark .stat-quick-actions button.secondary,
body.bt-theme-dark .buttonlike{
  background:#111827 !important;
  color:#dbeafe !important;
  border-color:#334155 !important;
}

body.bt-theme-dark .stock-workspace-tabs button.active,
body.bt-theme-dark .config-workspace-tabs button.active{
  background:#2563eb !important;
  color:#ffffff !important;
  border-color:#38bdf8 !important;
}

body.bt-theme-dark .menu-form-grid label,
body.bt-theme-dark .field label,
body.bt-theme-dark .field-label,
body.bt-theme-dark .form-field span,
body.bt-theme-dark .closing-field span{
  color:#e5e7eb !important;
}

body.bt-theme-dark .menu-form-grid input,
body.bt-theme-dark .menu-form-grid select,
body.bt-theme-dark .menu-form-grid textarea,
body.bt-theme-dark .product-search-panel input,
body.bt-theme-dark .product-search-panel select,
body.bt-theme-dark .config-field-grid input,
body.bt-theme-dark .config-field-grid select,
body.bt-theme-dark .config-field-grid textarea,
body.bt-theme-dark .closing-field input,
body.bt-theme-dark .closing-field select,
body.bt-theme-dark .closing-field textarea{
  background:#020617 !important;
  color:#f8fafc !important;
  border-color:#334155 !important;
}

body.bt-theme-dark .table th,
body.bt-theme-dark .table td{
  border-color:#334155 !important;
}

body.bt-device-desktop.bt-density-roomy .stats-compact-grid{
  grid-template-columns:180px minmax(260px,1fr) 190px minmax(260px,1.15fr) 170px auto;
}

body.bt-device-tablet .stock-workspace-tabs button,
body.bt-device-tablet .config-workspace-tabs button{
  flex:1 1 160px;
}

body.bt-device-tablet .stats-compact-header,
body.bt-device-tablet .closing-modern-head,
body.bt-device-tablet .menu-form-header{
  flex-wrap:wrap;
}

body.bt-device-tablet .stats-compact-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

body.bt-device-tablet .stats-period-inputs{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

body.bt-device-tablet .stat-quick-actions.compact button{
  flex:1 1 160px;
}

body.bt-device-tablet .product-search-panel,
body.bt-device-tablet .display-stock-tools{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

body.bt-device-tablet .product-search-panel > button,
body.bt-device-tablet .display-stock-tools > button{
  grid-column:auto;
}

body.bt-device-tablet .product-live-card{
  grid-template-columns:minmax(0,1fr) minmax(120px,160px);
}

body.bt-device-tablet .product-live-actions{
  grid-column:1 / -1;
  justify-content:flex-start;
}

body.bt-device-tablet .menu-form-actions,
body.bt-device-tablet .closing-modern-form,
body.bt-device-tablet .config-field-grid,
body.bt-device-tablet .config-toggle-grid{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
}

body.bt-device-tablet .order-preview-line{
  grid-template-columns:minmax(0,1fr) repeat(3,minmax(82px,auto));
}

body.bt-device-phone .stock-workspace-head > .row,
body.bt-device-phone .stats-compact-header,
body.bt-device-phone .menu-form-header,
body.bt-device-phone .closing-modern-head,
body.bt-device-phone .role-box-head{
  display:grid !important;
  grid-template-columns:1fr !important;
}

body.bt-device-phone .stock-workspace-tabs,
body.bt-device-phone .config-workspace-tabs,
body.bt-device-phone .stat-quick-actions.compact{
  display:grid !important;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

body.bt-device-phone .stock-workspace-tabs button,
body.bt-device-phone .config-workspace-tabs button,
body.bt-device-phone .stat-quick-actions.compact button{
  width:100%;
  min-height:44px;
  padding:9px 10px !important;
  font-size:13px !important;
}

body.bt-device-phone .stats-compact-grid,
body.bt-device-phone .stats-period-inputs,
body.bt-device-phone .product-search-panel,
body.bt-device-phone .product-live-card,
body.bt-device-phone .display-stock-tools,
body.bt-device-phone .menu-form-grid,
body.bt-device-phone .menu-form-actions,
body.bt-device-phone .closing-modern-form,
body.bt-device-phone .closing-destination-form-grid,
body.bt-device-phone .config-field-grid,
body.bt-device-phone .config-toggle-grid{
  grid-template-columns:1fr !important;
}

body.bt-device-phone .stats-compact-header .badge,
body.bt-device-phone .product-live-actions,
body.bt-device-phone .display-stock-actions,
body.bt-device-phone .export-links{
  width:100%;
}

body.bt-device-phone .product-live-price{
  text-align:left;
}

body.bt-device-phone .product-live-actions,
body.bt-device-phone .display-stock-actions,
body.bt-device-phone .export-links{
  justify-content:stretch;
}

body.bt-device-phone .product-live-actions button,
body.bt-device-phone .display-stock-actions button,
body.bt-device-phone .export-links .buttonlike{
  flex:1 1 140px;
}

body.bt-device-phone .closing-step-card,
body.bt-device-phone .closing-format-option,
body.bt-device-phone .toggle-row,
body.bt-device-phone .closing-destination-option{
  align-items:flex-start;
}

body.bt-device-phone .closing-format-option,
body.bt-device-phone .toggle-row{
  grid-template-columns:minmax(0,1fr) auto;
}

body.bt-device-phone .order-preview-line{
  display:grid;
  grid-template-columns:1fr;
}

body.bt-device-phone .role-permission-list span{
  flex:1 1 130px;
}

body.bt-device-phone .table{
  min-width:640px !important;
}

@media(max-width:700px){
  .stats-compact-grid,
  .stats-period-inputs,
  .product-search-panel,
  .product-live-card,
  .display-stock-tools,
  .menu-form-grid,
  .menu-form-actions,
  .closing-modern-form,
  .closing-destination-form-grid,
  .config-field-grid,
  .config-toggle-grid{
    grid-template-columns:1fr !important;
  }

  .stock-workspace-tabs,
  .config-workspace-tabs,
  .stat-quick-actions.compact{
    display:grid !important;
    grid-template-columns:1fr 1fr;
  }

  .product-live-price{
    text-align:left;
  }

  .product-live-actions,
  .display-stock-actions{
    justify-content:stretch;
  }
}

/* V5.72 - login leggibile in tema scuro */
body.bt-theme-dark .login-input,
body.bt-theme-dark input.login-input,
body.bt-theme-dark .login-panel input.login-input{
  background:#020617 !important;
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
  caret-color:#38bdf8 !important;
  border-color:#475569 !important;
  color-scheme:dark;
}

body.bt-theme-dark .login-input:focus,
body.bt-theme-dark input.login-input:focus,
body.bt-theme-dark .login-panel input.login-input:focus{
  background:#020617 !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  border-color:#38bdf8 !important;
  box-shadow:0 0 0 4px rgba(56,189,248,.22) !important;
}

body.bt-theme-dark .login-input::placeholder{
  color:#94a3b8 !important;
  -webkit-text-fill-color:#94a3b8 !important;
}

body.bt-theme-dark input.login-input:-webkit-autofill,
body.bt-theme-dark input.login-input:-webkit-autofill:hover,
body.bt-theme-dark input.login-input:-webkit-autofill:focus{
  -webkit-text-fill-color:#ffffff !important;
  caret-color:#38bdf8 !important;
  box-shadow:0 0 0 1000px #020617 inset !important;
  transition:background-color 9999s ease-in-out 0s;
}


/* ============================================================
   V7.00 - Fix contrasto tema scuro (audit completo)
   Copre tutti i componenti con sfondo chiaro hardcoded che in
   dark mode ricevevano testo chiaro ereditato (bianco su bianco).
   ============================================================ */

/* --- Cassa: resto, riepilogo utile, etichetta totale --- */
body.bt-theme-dark .change-box>div,
body.bt-theme-dark .change-highlight{
  background:var(--primary-soft) !important;
  border-color:#2d4f6f !important;
  color:#dbeafe !important;
}
body.bt-theme-dark .change-box>div b,
body.bt-theme-dark .change-highlight b{
  color:#9cdcfe !important;
  -webkit-text-fill-color:#9cdcfe !important;
}
body.bt-theme-dark .change-highlight{
  background:var(--good-soft) !important;
  border-color:#14532d !important;
}
body.bt-theme-dark .change-highlight b{
  color:#86efac !important;
  -webkit-text-fill-color:#86efac !important;
}
body.bt-theme-dark .profit-summary>div{
  background:#1f1f1f !important;
  border-color:var(--border) !important;
}
body.bt-theme-dark .profit-summary>div b{
  color:#f4f4f5 !important;
  -webkit-text-fill-color:#f4f4f5 !important;
}
body.bt-theme-dark .pay-total-label{
  color:#86efac !important;
  -webkit-text-fill-color:#86efac !important;
}

/* --- Input ricerca prodotti (regola con ID batteva il dark) --- */
body.bt-theme-dark #product_search_live{
  background:#1f1f1f !important;
  color:#f4f4f5 !important;
  border-color:var(--border-strong) !important;
}
body.bt-theme-dark #product_search_live::placeholder{color:#7c8590 !important}

/* --- Gratta e Vinci: risultato test riconoscimento --- */
body.bt-theme-dark .scratch-recognition-result{
  background:#1f1f1f !important;
  border-color:var(--border-strong) !important;
  color:#f4f4f5 !important;
}
body.bt-theme-dark .scratch-recognition-result.known{
  background:var(--good-soft) !important;
  border-color:#14532d !important;
}
body.bt-theme-dark .scratch-recognition-result.unknown{
  background:var(--warn-soft) !important;
  border-color:#92400e !important;
}
body.bt-theme-dark .scratch-recognition-result b,
body.bt-theme-dark .scratch-recognition-result strong,
body.bt-theme-dark .scratch-recognition-result span,
body.bt-theme-dark .scratch-recognition-result small{
  color:#f4f4f5 !important;
  -webkit-text-fill-color:#f4f4f5 !important;
}
body.bt-theme-dark .scratch-recognition-result>div>div span,
body.bt-theme-dark .scratch-recognition-result small{color:#a5adba !important}

/* --- Dashboard: scorte basse e box statistiche --- */
body.bt-theme-dark .low-stock-row{
  background:#252526 !important;
  border-color:var(--border) !important;
}
body.bt-theme-dark .low-stock-row b,
body.bt-theme-dark .low-stock-row strong{color:#f4f4f5 !important}
body.bt-theme-dark .low-stock-numbers div{
  background:rgba(255,255,255,.06) !important;
  color:#cbd5e1 !important;
}
body.bt-theme-dark .low-stock-numbers div b{color:#f4f4f5 !important;-webkit-text-fill-color:#f4f4f5 !important}
body.bt-theme-dark .stat-single-box{
  background:#1f1f1f !important;
  border-color:var(--border) !important;
}
body.bt-theme-dark .stat-single-box b{color:#f4f4f5 !important;-webkit-text-fill-color:#f4f4f5 !important}
body.bt-theme-dark .stat-single-box small{color:#a5adba !important}

/* --- Salute sistema, self-test, backup, notice, resi --- */
body.bt-theme-dark .health-summary,
body.bt-theme-dark .health-row,
body.bt-theme-dark .self-test-score,
body.bt-theme-dark .backup-auto-card,
body.bt-theme-dark .notice,
body.bt-theme-dark .success-box,
body.bt-theme-dark .return-preview{
  background:#252526 !important;
  border-color:var(--border) !important;
  color:#f4f4f5 !important;
}
body.bt-theme-dark .health-summary b,
body.bt-theme-dark .health-row b,
body.bt-theme-dark .self-test-score b,
body.bt-theme-dark .backup-auto-card b,
body.bt-theme-dark .notice b,
body.bt-theme-dark .success-box b,
body.bt-theme-dark .return-preview b{
  color:#f4f4f5 !important;
  -webkit-text-fill-color:#f4f4f5 !important;
}
body.bt-theme-dark .health-summary span,
body.bt-theme-dark .health-row span,
body.bt-theme-dark .notice span{color:#cbd5e1 !important}
body.bt-theme-dark .health-summary.ok,
body.bt-theme-dark .health-row.ok,
body.bt-theme-dark .notice.good,
body.bt-theme-dark .success-box{
  background:var(--good-soft) !important;
  border-color:#14532d !important;
}
body.bt-theme-dark .health-row.warn,
body.bt-theme-dark .notice.warn{
  background:var(--warn-soft) !important;
  border-color:#92400e !important;
}
body.bt-theme-dark .health-row.error,
body.bt-theme-dark .health-summary.error{
  background:var(--danger-soft) !important;
  border-color:#7f1d1d !important;
}
body.bt-theme-dark .self-test-group{
  background:#252526 !important;
  border-color:var(--border) !important;
}
body.bt-theme-dark .self-test-group h3{color:#f4f4f5 !important;-webkit-text-fill-color:#f4f4f5 !important}

/* --- Magazzino, ordini, catalogo, import --- */
body.bt-theme-dark .quick-load-panel,
body.bt-theme-dark .price-history-box,
body.bt-theme-dark .display-quick-panel,
body.bt-theme-dark .order-export-box,
body.bt-theme-dark .order-export-links,
body.bt-theme-dark .closing-guide,
body.bt-theme-dark .catalog-pagination,
body.bt-theme-dark .catalog-selection-toolbar,
body.bt-theme-dark .product-bulk-panel{
  background:#252526 !important;
  border-color:var(--border) !important;
  color:#f4f4f5 !important;
}
body.bt-theme-dark .quick-load-panel h2,
body.bt-theme-dark .price-history-box h3,
body.bt-theme-dark .display-quick-panel h3,
body.bt-theme-dark .order-export-box h3,
body.bt-theme-dark .order-export-links h3,
body.bt-theme-dark .product-bulk-panel b,
body.bt-theme-dark .catalog-pagination b,
body.bt-theme-dark .catalog-selection-toolbar b{
  color:#f4f4f5 !important;
  -webkit-text-fill-color:#f4f4f5 !important;
}
body.bt-theme-dark .quick-load-hint{background:#1f1f1f !important;color:#cbd5e1 !important}
body.bt-theme-dark .quick-load-hint.good{background:var(--good-soft) !important;color:#86efac !important}
body.bt-theme-dark .quick-load-hint.warn{background:var(--warn-soft) !important;color:#fbbf24 !important}

/* --- Testo scuro su scuro (nero su nero) --- */
body.bt-theme-dark .role-box p{color:var(--muted) !important}
body.bt-theme-dark .mini-toggle em{color:var(--muted) !important}
body.bt-theme-dark .order-preview-line em{color:#fbbf24 !important}

/* --- Dashboard "Cosa fare oggi": colori semantici in dark --- */
body.bt-theme-dark .today-todo-item.good{
  background:var(--good-soft) !important;
  border-color:#14532d !important;
  color:#86efac !important;
}
body.bt-theme-dark .today-todo-item.warn{
  background:var(--warn-soft) !important;
  border-color:#92400e !important;
  color:#fbbf24 !important;
}
body.bt-theme-dark .today-todo-item.dark{
  background:#252526 !important;
  border-color:var(--border-strong) !important;
  color:#f4f4f5 !important;
}
body.bt-theme-dark .today-todo-item b,
body.bt-theme-dark .today-todo-item span{color:inherit !important;-webkit-text-fill-color:inherit !important}
body.bt-theme-dark .today-todo-item small{color:#a5adba !important}

/* --- Badge senza variante dark --- */
body.bt-theme-dark .badge.muted{background:#3c3c3c !important;color:#cbd5e1 !important}
body.bt-theme-dark .badge.bad{background:var(--danger-soft) !important;color:#f87171 !important}

/* --- Evidenze di modifica/pending perse in dark --- */
body.bt-theme-dark .editing-row td,
body.bt-theme-dark .movement-edit-row td{
  background:var(--primary-soft) !important;
}
body.bt-theme-dark .product-live-card-pending,
body.bt-theme-dark .product-low-stock-select.pending{
  background:var(--warn-soft) !important;
  border-color:#92400e !important;
}
body.bt-theme-dark .display-row-need{
  background:var(--warn-soft) !important;
}
body.bt-theme-dark .closing-warning{
  background:var(--warn-soft) !important;
  border-color:#92400e !important;
  color:#fbbf24 !important;
}
body.bt-theme-dark .category-picker button.active{
  background:var(--primary-dark) !important;
  color:#ffffff !important;
}
body.bt-theme-dark .stock-workspace-tabs button span{
  background:#3c3c3c !important;
  color:#f4f4f5 !important;
}

/* --- Minori: isole chiare residue --- */
body.bt-theme-dark #barcode{
  background:#1f1f1f !important;
  color:#f4f4f5 !important;
  border-color:var(--border-strong) !important;
}
body.bt-theme-dark #barcode::placeholder{color:#7c8590 !important}
body.bt-theme-dark .empty-cart{
  background:#252526 !important;
  border-color:var(--border) !important;
  color:var(--muted) !important;
}
body.bt-theme-dark .stat-line-wrap{
  background:#1f1f1f !important;
  border-color:var(--border) !important;
}
body.bt-theme-dark .lang-switch{
  background:#252526 !important;
  border-color:var(--border) !important;
}
body.bt-theme-dark .stock-inventory-wrap{background:#252526 !important}
body.bt-theme-dark .products-table code{
  background:#1f1f1f !important;
  color:#9cdcfe !important;
  border-color:var(--border) !important;
}
body.bt-theme-dark .global-barcode-hint,
body.bt-theme-dark .movement-deleted-note,
body.bt-theme-dark .sync-light-note,
body.bt-theme-dark .auto-refresh-note,
body.bt-theme-dark .last-sale-message,
body.bt-theme-dark .profit-warning-zero,
body.bt-theme-dark .restore-table-list span{
  background:#252526 !important;
  border-color:var(--border) !important;
  color:#cbd5e1 !important;
}

/* --- Card guadagni per reparto (dashboard) --- */
.dept-table td,
.dept-table th{white-space:nowrap}
.dept-total-row td{
  background:#f1f5f9;
  font-weight:800;
  border-top:2px solid var(--border);
}
body.bt-theme-dark .dept-total-row td{background:#1f1f1f !important}


/* ============================================================
   V7.30 - Chiusura: ultime parti bianche in tema scuro
   ============================================================ */

/* Pannello form chiusura (era #fbfdff) */
body.bt-theme-dark .closing-modern-form{
  background:#111827 !important;
  border-color:#334155 !important;
}

/* Opzioni formato JSON/XML/PDF/Excel: hover e selezionato */
body.bt-theme-dark .closing-format-option:hover{
  background:#1f2937 !important;
  border-color:#4b5563 !important;
}
body.bt-theme-dark .closing-format-option:has(input:checked){
  background:var(--primary-soft) !important;
  border-color:var(--primary) !important;
}
body.bt-theme-dark .closing-format-option:has(input:checked) span{
  color:#dbeafe !important;
}
body.bt-theme-dark .closing-format-option small{
  color:#a5adba !important;
}

/* Badge di stato (ok/warn): testo scuro su pill scura, illeggibile */
body.bt-theme-dark .closing-status.ok{color:#86efac !important}
body.bt-theme-dark .closing-status.warn{color:#fbbf24 !important}


/* ============================================================
   V7.50 - Design system professionale "Blu business"
   Layer finale: ridefinisce superfici, tipografia, bottoni,
   tabelle e form. Nessun cambio di layout/JS.
   ============================================================ */

:root{
  --bg:#eef2f8;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#5b6b82;
  --border:#dde5f0;
  --border-strong:#c3d0e2;
  --dark:#16233d;
  --primary:#1d4ed8;
  --primary-dark:#1e40af;
  --primary-soft:#e8effd;
  --good:#047857;
  --good-soft:#e7f8f1;
  --danger:#b91c1c;
  --danger-soft:#fdecec;
  --warn:#b45309;
  --warn-soft:#fdf3e3;
  --radius:14px;
  --radius-sm:10px;
  --shadow:0 1px 2px rgba(15,23,42,.05),0 8px 24px rgba(15,23,42,.06);
  --shadow-sm:0 1px 2px rgba(15,23,42,.06);
}

body{
  background:var(--bg);
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  font-size:14.5px;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
}

/* --- Tipografia --- */
h1{font-size:26px;font-weight:850;letter-spacing:-.02em}
h2{font-size:19px;font-weight:800;letter-spacing:-.01em}
h3{font-size:16px;font-weight:750}
.muted{color:var(--muted);font-size:13px}
.stat .val,
.val{font-variant-numeric:tabular-nums;font-weight:850;letter-spacing:-.02em}
.table td,.table th{font-variant-numeric:tabular-nums}

/* --- Topbar / brand --- */
.topbar{padding:6px 2px}
.logo{
  background:linear-gradient(135deg,#1d4ed8,#1e40af) !important;
  color:#fff !important;
  border-radius:var(--radius) !important;
  box-shadow:0 6px 16px rgba(29,78,216,.28);
}

/* --- Navigazione principale: tab professionali --- */
.nav{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:6px;
  box-shadow:var(--shadow-sm);
  gap:4px;
}
.nav button{
  background:transparent;
  color:var(--muted);
  font-weight:700;
  font-size:13px;
  border-radius:var(--radius-sm);
  padding:9px 6px;
  transition:background .15s ease,color .15s ease;
}
.nav button:hover{background:var(--primary-soft);color:var(--primary)}
.nav button.active{
  background:var(--primary);
  color:#fff;
  box-shadow:0 4px 12px rgba(29,78,216,.30);
}

/* --- Card e superfici --- */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:20px;
}
.item{
  background:#f6f8fc;
  border:1px solid #e8eef7;
  border-radius:var(--radius-sm);
  padding:12px 14px;
}
.tablewrap{
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  overflow:auto;
}

/* --- Tabelle professionali --- */
.table{border-collapse:collapse;width:100%}
.table th{
  background:#f6f8fc;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  z-index:2;
}
.table td{
  padding:11px 12px;
  border-bottom:1px solid #eef2f8;
  font-size:13.5px;
}
.table tr:hover td{background:#f8fbff}
.table tr:last-child td{border-bottom:0}

/* --- Bottoni --- */
button{
  border-radius:var(--radius-sm);
  font-weight:750;
  font-size:14px;
  padding:10px 16px;
  min-height:42px;
  letter-spacing:.01em;
  transition:background .15s ease,box-shadow .15s ease,transform .05s ease,border-color .15s ease;
}
button:active{transform:translateY(1px)}
button:where(:not(.secondary):not(.good):not(.warn):not(.danger):not(.out)){
  background:var(--primary);
  color:#fff;
}
button:where(:not(.secondary):not(.good):not(.warn):not(.danger):not(.out)):hover{
  background:var(--primary-dark);
  box-shadow:0 6px 14px rgba(29,78,216,.25);
}
button.secondary{
  background:var(--card);
  color:var(--text);
  border:1px solid var(--border-strong);
}
button.secondary:hover{border-color:var(--primary);color:var(--primary);background:var(--primary-soft)}
button.good{background:var(--good)}
button.good:hover{background:#065f46}
button.warn{background:var(--warn)}
button.danger{background:var(--danger)}
button.danger:hover{background:#991b1b}
button.small,.buttonlike.small{min-height:34px;padding:6px 12px;font-size:12.5px}
.buttonlike{
  border-radius:var(--radius-sm);
  font-weight:750;
  border:1px solid var(--border-strong);
  padding:9px 14px;
  display:inline-block;
}

/* --- Form --- */
input,select,textarea{
  height:42px;
  border:1px solid var(--border-strong);
  border-radius:var(--radius-sm);
  background:var(--card);
  padding:0 12px;
  font-size:14px;
  color:var(--text);
  transition:border-color .15s ease,box-shadow .15s ease;
}
input:focus,select:focus,textarea:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 3px rgba(29,78,216,.14);
}
textarea{height:80px;padding-top:10px}
label,.form-field span,.field>label{
  font-size:13px;
  font-weight:700;
  color:#33405a;
}

/* --- Badge e pill --- */
.badge{
  border-radius:999px;
  padding:4px 10px;
  font-size:11.5px;
  font-weight:800;
  letter-spacing:.02em;
}
.badge.dark{background:var(--dark);color:#fff}
.badge.good{background:var(--good-soft);color:var(--good)}
.badge.warn{background:var(--warn-soft);color:var(--warn)}
.badge.danger,.badge.bad{background:var(--danger-soft);color:var(--danger)}

/* --- Box colorati semantici --- */
.greenbox{background:var(--good-soft);color:var(--good)}
.amberbox{background:var(--warn-soft);color:var(--warn)}
.bluebox{background:var(--primary-soft);color:var(--primary)}
.redbox{background:var(--danger-soft);color:var(--danger)}

/* --- Scanner barcode --- */
.scan{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-sm);
}

/* --- Scrollbar --- */
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:#c3cede;border-radius:99px;border:2px solid var(--bg)}
::-webkit-scrollbar-thumb:hover{background:#9fb0c9}

/* ============================================================
   V7.50 - Variante tema scuro "Blu business"
   ============================================================ */
body.bt-theme-dark{
  --bg:#0b1220;
  --card:#111a2e;
  --text:#e6edf7;
  --muted:#93a4bd;
  --border:#22304d;
  --border-strong:#2e4066;
  --dark:#0b1220;
  --primary:#4f8cff;
  --primary-dark:#3b76e1;
  --primary-soft:#152a4d;
  --good:#34d399;
  --good-soft:#0d2b21;
  --danger:#f87171;
  --danger-soft:#3b1d23;
  --warn:#fbbf24;
  --warn-soft:#3a2a12;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 10px 28px rgba(0,0,0,.35);
  --shadow-sm:0 1px 2px rgba(0,0,0,.3);
}

body.bt-theme-dark .nav button{color:var(--muted)}
body.bt-theme-dark .nav button:hover{background:var(--primary-soft);color:var(--primary)}
body.bt-theme-dark .nav button.active{background:var(--primary);color:#0b1220;font-weight:800}

body.bt-theme-dark .item{background:#0d1526;border-color:#1c2947}
body.bt-theme-dark .table th{background:#0d1526;color:var(--muted);border-bottom-color:var(--border)}
body.bt-theme-dark .table td{border-bottom-color:#1a2742}
body.bt-theme-dark .table tr:hover td{background:#16203a}

body.bt-theme-dark label,
body.bt-theme-dark .form-field span,
body.bt-theme-dark .field>label{color:#b9c6dc}

body.bt-theme-dark button.secondary{background:#0d1526;border-color:var(--border-strong);color:var(--text)}
body.bt-theme-dark button.secondary:hover{border-color:var(--primary);color:var(--primary);background:var(--primary-soft)}

body.bt-theme-dark .logo{box-shadow:0 6px 16px rgba(79,140,255,.25)}
body.bt-theme-dark ::-webkit-scrollbar-thumb{background:#2e4066;border-color:var(--bg)}
body.bt-theme-dark ::-webkit-scrollbar-thumb:hover{background:#4f8cff}


/* ============================================================
   V7.60 - Audit log leggibile
   ============================================================ */
.audit-filter-bar{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:flex-end;
  margin-top:14px;
}
.audit-filter-bar .form-field{
  flex:1 1 150px;
  min-width:140px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.audit-load-btn{
  flex:0 0 auto;
  height:42px;
  padding:0 22px;
  align-self:flex-end;
}
.audit-table .audit-when{white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--muted)}
.audit-table .audit-detail{font-size:13px;line-height:1.5}
.audit-table td{vertical-align:middle}
body.bt-theme-dark .audit-filter-bar .form-field span{color:#b9c6dc}


/* ============================================================
   V7.61 - Audit: riga espandibile con dettaglio tecnico
   ============================================================ */
.audit-row-main{cursor:pointer}
.audit-row-main:hover td{background:var(--primary-soft)}
.audit-chev{
  width:28px;
  color:var(--muted);
  font-size:14px;
  text-align:center;
  user-select:none;
}
.audit-detail-row>td{
  background:#f6f8fc;
  border-bottom:1px solid var(--border);
  padding:12px 16px !important;
}
.audit-raw{
  margin:0;
  max-height:280px;
  overflow:auto;
  white-space:pre-wrap;
  word-break:break-word;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:12px;
  line-height:1.5;
  color:#33405a;
}
body.bt-theme-dark .audit-detail-row>td{background:#0d1526;border-bottom-color:#1a2742}
body.bt-theme-dark .audit-raw{color:#9cdcfe}


/* ============================================================
   V7.70 - Import Logista
   ============================================================ */
.logista-card{margin-top:16px}
.logista-summary{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:12px 0;
}
.logista-table-wrap{
  max-height:480px;
  overflow:auto;
  margin-top:8px;
}
.logista-table .logista-num{
  width:86px;
  height:34px;
  min-height:34px;
  padding:0 8px;
  font-size:13px;
}
.logista-table td{vertical-align:middle}
.logista-row-new td{background:#fffdf4}
.logista-card input[type="file"]{
  max-width:340px;
  height:auto;
  min-height:42px;
  padding:8px 12px;
}
body.bt-theme-dark .logista-row-new td{background:#241d10}


/* ============================================================
   V7.80 - Gratta e Vinci: registrazione rapida, bulk, vendi blocco
   ============================================================ */
.scratch-step{
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:14px;
  margin-top:12px;
  background:#f8fafd;
}
.scratch-step-head{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}
.scratch-step-num{
  width:26px;
  height:26px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:var(--primary);
  color:#fff;
  font-weight:850;
  font-size:13px;
}
.scratch-book-summary{
  border:1px dashed var(--border-strong);
  border-radius:var(--radius-sm);
  padding:12px 14px;
  color:var(--muted);
  font-size:13.5px;
  line-height:1.5;
}
.scratch-book-summary.ready{
  border-style:solid;
  border-color:var(--primary);
  background:var(--primary-soft);
  color:var(--text);
  font-weight:650;
}
.scratch-book-advanced{margin-top:10px}
.scratch-book-advanced summary{
  cursor:pointer;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}
.scratch-book-row.selected{
  border-color:var(--primary);
  background:var(--primary-soft);
}
.scratch-book-check input{
  width:20px;
  height:20px;
  min-height:20px;
  accent-color:var(--primary);
}
.scratch-book-actions{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.scratch-bulk-bar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  margin-bottom:10px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  background:#f6f8fc;
}
.scratch-bulk-all{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:700;
  font-size:13px;
}
.scratch-bulk-all input{
  width:20px;
  height:20px;
  min-height:20px;
  accent-color:var(--primary);
}
.scratch-sell-panel{
  border:2px solid var(--good);
  margin-bottom:12px;
}
.chips{display:flex;flex-wrap:wrap;gap:6px}
body.bt-theme-dark .scratch-step{background:#0d1526;border-color:#1c2947}
body.bt-theme-dark .scratch-bulk-bar{background:#0d1526;border-color:#1c2947}
body.bt-theme-dark .scratch-book-row.selected{background:var(--primary-soft)}


/* ============================================================
   V7.90 - Fix login dark, vendi blocco, serie Gratta
   ============================================================ */

/* Login: le 4 card (Cassa veloce ecc.) illeggibili in dark */
body.bt-theme-dark .login-feature-grid span{
  background:#152036 !important;
  border-color:#2b3a5e !important;
  color:#e6edf7 !important;
  box-shadow:0 10px 24px rgba(0,0,0,.35) !important;
}
body.bt-theme-dark .login-feature-grid span b{
  background:var(--primary-soft) !important;
  color:var(--primary) !important;
  -webkit-text-fill-color:var(--primary) !important;
}

/* Vendi blocco: pagamento allineato ai bottoni */
.scratch-sell-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:flex-end;
  margin-top:10px;
}
.scratch-sell-actions .form-field{
  flex:1 1 180px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.scratch-sell-actions button{
  flex:0 0 auto;
  height:42px;
}

/* Dettaglio serie vendute / da vendere */
.scratch-series-detail{
  margin-top:10px;
  border-top:1px dashed var(--border);
  padding-top:10px;
}
.scratch-series-legend{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:var(--muted);
  margin-bottom:8px;
}
.scratch-series-grid{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  max-height:200px;
  overflow:auto;
}
.scratch-serie{
  min-width:34px;
  height:26px;
  padding:0 6px;
  display:inline-grid;
  place-items:center;
  border-radius:7px;
  font-size:11.5px;
  font-weight:800;
  font-variant-numeric:tabular-nums;
}
.scratch-serie.sold{
  background:var(--good-soft);
  color:var(--good);
  text-decoration:line-through;
}
.scratch-serie.open{
  background:var(--primary-soft);
  color:var(--primary);
}
.scratch-serie.legend-chip{text-decoration:none}
.scratch-book-row{cursor:pointer}


/* ============================================================
   V7.91 - Gratta: regolarizzazione serie dimenticate
   ============================================================ */
.scratch-serie.clickable{cursor:pointer}
.scratch-serie.open.clickable:hover{
  outline:2px solid var(--primary);
  outline-offset:1px;
}
.scratch-serie.picked{
  background:var(--primary);
  color:#fff;
}
.scratch-series-detail .scratch-sell-actions select{
  width:auto;
  min-width:130px;
}
body.bt-theme-dark .scratch-serie.picked{background:var(--primary);color:#0b1220}


/* ============================================================
   V7.92 - Guadagni per reparto: card visuale
   ============================================================ */
.dept-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-top:14px;
}
.dept-card{
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  background:#f8fafd;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.dept-card-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:15px;
}
.dept-card-share{
  font-size:11.5px;
  font-weight:800;
  color:var(--muted);
}
.dept-card-today{
  font-size:30px;
  font-weight:850;
  letter-spacing:-.02em;
  font-variant-numeric:tabular-nums;
  margin-top:4px;
}
.dept-card-sub{
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
}
.dept-card-bar{
  height:8px;
  border-radius:99px;
  background:#e2e8f2;
  overflow:hidden;
  margin-bottom:10px;
}
.dept-card-bar i{
  display:block;
  height:100%;
  border-radius:99px;
}
.dept-bar .dept-card-bar i{background:#2563eb}
.dept-tab .dept-card-bar i{background:#d97706}
.dept-altro .dept-card-bar i{background:#7c3aed}
.dept-bar .dept-card-today{color:#1d4ed8}
.dept-tab .dept-card-today{color:#b45309}
.dept-altro .dept-card-today{color:#6d28d9}
.dept-card-lines{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:13px;
}
.dept-card-lines>div{
  display:flex;
  justify-content:space-between;
  gap:10px;
  border-bottom:1px dashed var(--border);
  padding-bottom:5px;
}
.dept-card-lines span{color:var(--muted)}
.dept-card-hint{
  margin-top:8px;
  font-size:12px;
  color:var(--muted);
}
.dept-total-strip{
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:12px;
  margin-top:14px;
  padding:12px 16px;
  border-radius:var(--radius-sm);
  background:var(--primary-soft);
  font-size:13.5px;
}
.dept-total-strip span{
  display:block;
  font-size:11.5px;
  color:var(--muted);
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}
body.bt-theme-dark .dept-card{background:#0d1526;border-color:#1c2947}
body.bt-theme-dark .dept-card-bar{background:#1a2742}
@media(max-width:1050px){
  .dept-grid{grid-template-columns:1fr}
}


/* ============================================================
   V7.93 - Prodotti: barra livello scorte nelle schede
   ============================================================ */
.product-stock-meter{
  min-width:150px;
  margin-top:4px;
}
.product-stock-meter-top{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  font-size:12px;
}
.product-stock-meter-top b{
  font-variant-numeric:tabular-nums;
  font-size:13px;
}
.product-stock-meter-top span{
  color:var(--muted);
  font-weight:800;
  font-size:11.5px;
}
.product-stock-meter-bar{
  height:7px;
  border-radius:99px;
  background:#e2e8f2;
  overflow:hidden;
  margin-top:3px;
}
.product-stock-meter-bar i{
  display:block;
  height:100%;
  border-radius:99px;
  transition:width .3s ease;
}
.product-stock-meter.ok .product-stock-meter-bar i{background:#2563eb}
.product-stock-meter.warning .product-stock-meter-bar i{background:#d97706}
.product-stock-meter.critical .product-stock-meter-bar i{background:#dc2626}
.product-stock-meter.critical .product-stock-meter-top b{color:#dc2626}
.product-stock-meter.warning .product-stock-meter-top b{color:#b45309}
.product-stock-meter-warn{
  display:block;
  font-size:11px;
  font-weight:800;
  margin-top:2px;
  color:#b45309;
}
.product-stock-meter.critical .product-stock-meter-warn{color:#dc2626}
body.bt-theme-dark .product-stock-meter-bar{background:#1a2742}


/* ============================================================
   V7.94 - Cosa fare oggi: striscia obiettivo integrata
   ============================================================ */
.todo-goal-strip{
  display:flex;
  align-items:center;
  gap:16px;
  margin:14px 0;
  padding:14px 16px;
  border:2px solid #bbf7d0;
  border-radius:var(--radius);
  background:linear-gradient(135deg,#ecfdf5,#ffffff);
}
.todo-goal-strip.reached{
  border-color:#059669;
  background:linear-gradient(135deg,#d1fae5,#ecfdf5);
}
.todo-goal-strip.todo-goal-empty{
  border-style:dashed;
  border-color:var(--border-strong);
  background:#f8fafd;
}
.todo-goal-pct{
  min-width:76px;
  text-align:center;
  border-radius:var(--radius-sm);
  background:#059669;
  color:#fff;
  font-weight:900;
  font-size:26px;
  padding:10px 12px;
  font-variant-numeric:tabular-nums;
}
.todo-goal-empty .todo-goal-pct{background:var(--muted)}
.todo-goal-info{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.todo-goal-info>span{
  font-size:13px;
  color:var(--muted);
}
.todo-goal-bar{
  height:12px;
  border-radius:99px;
  background:#d1fae5;
  border:1px solid #a7f3d0;
  overflow:hidden;
}
.todo-goal-bar i{
  display:block;
  height:100%;
  border-radius:99px;
  background:linear-gradient(90deg,#059669,#10b981);
  transition:width .7s ease;
}
.todo-goal-strip .secondary{flex:0 0 auto}
body.bt-theme-dark .todo-goal-strip{
  background:linear-gradient(135deg,#132f20,#111a2e);
  border-color:#166534;
}
body.bt-theme-dark .todo-goal-strip.todo-goal-empty{
  background:#0d1526;
  border-color:#2e4066;
}
body.bt-theme-dark .todo-goal-bar{
  background:#0b1220;
  border-color:#166534;
}


/* ============================================================
   V7.95 - Movimenti: aspetto professionale
   ============================================================ */

/* Badge tipo aggiuntivi */
.badge.info{background:var(--primary-soft);color:var(--primary)}
.badge.violet{background:#ede9fe;color:#6d28d9}
body.bt-theme-dark .badge.violet{background:#2e1d4d;color:#c4b5fd}

/* Importi con segno colore */
.mv-amount-pos{color:var(--good)}
.mv-amount-neg{color:var(--danger)}
.mv-amount{font-variant-numeric:tabular-nums}

/* Tabella movimenti: zebra + hover + eliminati leggibili */
.movements-table tbody tr:nth-child(even) td,
.movements-table tr.mv-zebra td{background:#fafcff}
.movements-table tr:hover td{background:var(--primary-soft)}
.movements-table tr.mv-deleted td{
  background:#fdf6f6;
  color:var(--muted);
}
.movements-table tr.mv-deleted .movement-product b{
  text-decoration:line-through;
}
body.bt-theme-dark .movements-table tbody tr:nth-child(even) td,
body.bt-theme-dark .movements-table tr.mv-zebra td{background:#101a30}
body.bt-theme-dark .movements-table tr.mv-deleted td{background:#241417}

/* Data compatta */
.movement-date b{display:block;font-variant-numeric:tabular-nums}
.movement-date span{font-size:11.5px;color:var(--muted)}

/* Summary card con accento */
.movement-summary .item{
  border-top:3px solid var(--border-strong);
  border-radius:var(--radius-sm);
}
.movement-summary .item.good{border-top-color:var(--good)}
.movement-summary .item.redbox{border-top-color:var(--danger)}

/* Hero movimenti */
.movements-hero .movement-title-kicker{
  display:inline-block;
  font-size:11.5px;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--primary);
  background:var(--primary-soft);
  border-radius:99px;
  padding:3px 10px;
  margin-bottom:6px;
}

/* Barra modalità: pill moderne */
.movement-modebar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.movement-mode-btn{
  flex:1 1 180px;
  text-align:left;
  border:1px solid var(--border);
  background:var(--card);
  color:var(--text);
  border-radius:var(--radius-sm);
  padding:10px 14px;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.movement-mode-btn span{
  font-size:11.5px;
  color:var(--muted);
  font-weight:500;
}
.movement-mode-btn.active{
  border-color:var(--primary);
  background:var(--primary-soft);
  box-shadow:0 0 0 1px var(--primary) inset;
}
.movement-mode-btn.active b{color:var(--primary)}
body.bt-theme-dark .movement-mode-btn{background:#0d1526 !important;border-color:#1c2947 !important;color:var(--text) !important}
body.bt-theme-dark .movement-mode-btn.active{background:var(--primary-soft) !important;border-color:var(--primary) !important}

/* Filtri: bottone pulisci allineato */
.movement-local-filter-panel{
  align-items:flex-end;
}


/* ============================================================
   V7.96 - Movimenti load-more, Inventario %, Cassa polish
   ============================================================ */

/* Movimenti: carica altri */
.movement-load-more{
  display:flex;
  justify-content:center;
  padding:14px 0 4px;
}

/* Inventario: percentuale visibile */
.stock-inventory-pct{
  font-size:15px;
  font-weight:900;
  font-variant-numeric:tabular-nums;
}
.stock-inventory-level.ok .stock-inventory-pct{color:#1d4ed8}
.stock-inventory-level.warning .stock-inventory-pct{color:#b45309}
.stock-inventory-level.critical .stock-inventory-pct{color:#dc2626}
.stock-inventory-level-head{
  display:flex;
  align-items:baseline;
  gap:8px;
}
.stock-inventory-level-head>b{
  font-size:17px;
  font-variant-numeric:tabular-nums;
}
.stock-inventory-meter{
  height:9px;
  margin-top:4px;
}

/* Cassa: righe carrello e pannello pagamento piu leggibili */
.cart-table-clean .cart-line{
  border-radius:var(--radius-sm);
  padding:8px 10px;
  transition:background .12s ease;
}
.cart-table-clean .cart-line:hover{background:var(--primary-soft)}
.cart-line-main b{font-size:14.5px}
.cart-line-qty .qty-btn{
  min-width:34px;
  min-height:34px;
  font-size:16px;
  font-weight:900;
}
.cart-line-qty .qty-input{
  width:56px;
  text-align:center;
  font-weight:800;
}
.cart-line-total b,
.cart-line-profit b{
  font-variant-numeric:tabular-nums;
}
.cashier-right .card{box-shadow:var(--shadow)}
.pay-total-card .pay-total-label{
  font-weight:850;
  letter-spacing:.04em;
  text-transform:uppercase;
  font-size:12px;
}
body.bt-theme-dark .cart-table-clean .cart-line:hover{background:var(--primary-soft)}


/* ============================================================
   V7.96b - Cassa: selettore metodo pagamento a card
   ============================================================ */
.pay-method-row{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.pay-method{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  padding:12px 8px;
  border:1.5px solid var(--primary);
  border-radius:var(--radius-sm);
  background:var(--primary-soft);
  color:var(--primary);
  min-height:86px;
}
.pay-method:hover{
  background:#d8e5fb;
  border-color:var(--primary-dark);
}
.pay-method.active{
  background:var(--primary);
  border-color:var(--primary);
  color:#fff;
  box-shadow:0 6px 16px rgba(29,78,216,.30);
}
.pay-method.active b{color:#fff}
.pay-method.active small{color:#fff;opacity:.85}
.pay-method.active .pay-method-ico{background:rgba(255,255,255,.22);color:#fff}
.pay-method-ico{
  display:inline-grid;
  place-items:center;
  min-width:34px;
  height:30px;
  padding:0 8px;
  border-radius:8px;
  background:#ffffff;
  color:var(--primary);
  font-weight:900;
  font-size:12.5px;
  letter-spacing:.03em;
}
.pay-method b{font-size:14px;color:inherit}
.pay-method small{
  color:inherit;
  opacity:.75;
  font-size:11px;
  font-weight:600;
}
body.bt-theme-dark .pay-method{background:#0d1526 !important;border-color:var(--primary) !important;color:var(--primary) !important}
body.bt-theme-dark .pay-method:hover{background:var(--primary-soft) !important}
body.bt-theme-dark .pay-method.active{background:var(--primary) !important;color:#0b1220 !important}
body.bt-theme-dark .pay-method.active b,
body.bt-theme-dark .pay-method.active small{color:#0b1220 !important}
body.bt-theme-dark .pay-method-ico{background:#1a2742;color:var(--primary)}
@media(max-width:520px){
  .pay-method-row{grid-template-columns:1fr}
}


/* ============================================================
   V8.01 - Sistema bottoni colorato globale (chiaro + scuro)
   Bottoni sempre "pieni": niente bottoni bianchi anonimi.
   ============================================================ */

/* Secondari: azzurro chiaro con testo blu (non più bianchi) */
button.secondary,
.buttonlike.secondary{
  background:#dbe7fa;
  color:#1d4ed8;
  border:1px solid #b7cdf0;
}
button.secondary:hover,
.buttonlike.secondary:hover{
  background:#c9dcfa;
  border-color:var(--primary);
  color:var(--primary-dark);
}
button.secondary:disabled{
  background:#eef2f8;
  color:#94a3b8;
  border-color:var(--border);
}

/* Bottoni "out" (discreti): grigio chiaro pieno, non bianco */
button.out{
  background:#e6edf7;
  color:#334155;
  border:1px solid var(--border-strong);
}
button.out:hover{
  background:#dbe4f0;
  border-color:#94a3b8;
}

/* Navigazione: stili definiti nel tema Apple (V9.00) */
.nav button.active{
  background:var(--primary);
  color:#fff;
  box-shadow:0 4px 12px rgba(29,78,216,.30);
}

/* Badge dentro bottoni resta leggibile */
.nav button .nav-alert-dot{background:#dc2626;color:#fff}

/* Link stile bottone */
.buttonlike{
  background:#dbe7fa;
  color:#1d4ed8;
  border:1px solid #b7cdf0;
}
.buttonlike:hover{
  background:#d9e5fa;
  border-color:var(--primary);
  color:var(--primary-dark);
  text-decoration:none;
}

/* ---- Tema scuro ---- */
body.bt-theme-dark button.secondary,
body.bt-theme-dark .buttonlike.secondary{
  background:#1a2742 !important;
  color:#9cc2ff !important;
  border-color:#2e4066 !important;
}
body.bt-theme-dark button.secondary:hover,
body.bt-theme-dark .buttonlike.secondary:hover{
  background:#22335a !important;
  border-color:var(--primary) !important;
  color:#c7dbff !important;
}
body.bt-theme-dark button.secondary:disabled{
  background:#16203a !important;
  color:#5b6b82 !important;
}
body.bt-theme-dark button.out{
  background:#16203a !important;
  color:#b9c6dc !important;
  border-color:#2e4066 !important;
}
/* Nav dark: stili definiti nel tema Apple (V9.00) */
body.bt-theme-dark .nav button.active{
  background:var(--primary);
  color:#0b1220;
}
body.bt-theme-dark .buttonlike{
  background:#1a2742 !important;
  color:#9cc2ff !important;
  border-color:#2e4066 !important;
}


/* ============================================================
   V9.00 - TEMA APPLE (stile iOS/macOS completo)
   Sfondo #f5f5f7, card senza bordi, bottoni pillola,
   segmented control, blu Apple #0071e3. Chiaro e scuro.
   ============================================================ */

:root{
  --bg:#f5f5f7;
  --card:#ffffff;
  --text:#1d1d1f;
  --muted:#86868b;
  --border:#d2d2d7;
  --border-strong:#c7c7cc;
  --primary:#0071e3;
  --primary-dark:#0077ed;
  --primary-soft:#e8f0fd;
  --good:#34c759;
  --good-soft:#e5f8eb;
  --danger:#ff3b30;
  --danger-soft:#ffeceb;
  --warn:#ff9f0a;
  --warn-soft:#fff4e0;
  --radius:18px;
  --radius-sm:12px;
  --shadow:0 4px 16px rgba(0,0,0,.04);
  --shadow-sm:0 2px 8px rgba(0,0,0,.04);
}

body{
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Arial,sans-serif;
  letter-spacing:-.01em;
}
h1,h2,h3{letter-spacing:-.02em;font-weight:700}
.muted{color:var(--muted)}

/* ---------- Bottoni pillola Apple ---------- */
button{
  border-radius:980px;
  font-weight:600;
  letter-spacing:-.01em;
  min-height:44px;
  transition:background .18s ease,box-shadow .18s ease,transform .1s ease;
}
button:active{transform:scale(.97)}
button:where(:not(.secondary):not(.good):not(.warn):not(.danger):not(.out)){
  background:var(--primary);
  color:#fff;
}
button:where(:not(.secondary):not(.good):not(.warn):not(.danger):not(.out)):hover{
  background:var(--primary-dark);
}
button.secondary{
  background:#ffffff;
  color:#1d1d1f;
  border:1px solid var(--border);
  box-shadow:0 1px 3px rgba(0,0,0,.06);
}
button.secondary:hover{background:#f5f5f7;border-color:var(--border-strong);color:var(--primary)}
button.good{background:var(--good);color:#fff}
button.good:hover{background:#2db44e}
button.danger{background:var(--danger);color:#fff}
button.danger:hover{background:#e0342b}
button.warn{background:var(--warn);color:#fff}
button.out{background:#ffffff;color:#1d1d1f;border:1px solid var(--border)}
button.out:hover{background:#f5f5f7;border-color:var(--border-strong)}
button.small,.buttonlike.small{min-height:34px;padding:6px 14px;font-size:13px}
.buttonlike{
  border-radius:980px;
  background:#ffffff;
  color:#1d1d1f;
  border:1px solid var(--border);
  font-weight:600;
}
.buttonlike:hover{background:#f5f5f7;border-color:var(--border-strong);text-decoration:none}

/* ---------- Nav: segmented control iOS ---------- */
.nav{
  background:#e8e8ed;
  border:0;
  border-radius:980px;
  padding:5px;
  box-shadow:none;
  gap:4px;
}
.nav button{
  background:transparent;
  color:#6e6e73;
  border:0;
  border-radius:980px;
  box-shadow:none;
  font-weight:600;
}
.nav button:hover{background:rgba(255,255,255,.55);color:#1d1d1f}
.nav button.active{
  background:var(--primary);
  color:#ffffff;
  box-shadow:0 4px 12px rgba(0,113,227,.30);
}

/* ---------- Card e superfici ---------- */
.card{
  background:var(--card);
  border:0;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.item{
  background:#f5f5f7;
  border:0;
  border-radius:var(--radius-sm);
}
.topbar{padding:8px 4px}
.logo{
  background:#1d1d1f !important;
  color:#fff !important;
  border-radius:14px !important;
  box-shadow:none;
}
.scan{
  background:#fff;
  border:0;
  border-radius:980px;
  box-shadow:var(--shadow-sm);
}

/* ---------- Input ---------- */
input,select,textarea{
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:var(--text);
  font-size:15px;
  transition:border-color .15s ease,box-shadow .15s ease;
}
input:focus,select:focus,textarea:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(0,113,227,.18);
}

/* ---------- Tabelle minimal ---------- */
.table th{
  background:transparent;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
  text-transform:none;
  letter-spacing:0;
  border-bottom:1px solid var(--border);
}
.table td{border-bottom:1px solid #f0f0f2}
.table tr:hover td{background:#f5f5f7}
.tablewrap{border:1px solid var(--border);border-radius:var(--radius-sm)}

/* ---------- Badge e box ---------- */
.badge{
  background:#e8e8ed;
  color:#6e6e73;
  font-weight:600;
}
.badge.dark{background:#1d1d1f;color:#fff}
.badge.good{background:var(--good-soft);color:#248a3d}
.badge.warn{background:var(--warn-soft);color:#c77700}
.badge.danger,.badge.bad{background:var(--danger-soft);color:#d70015}
.badge.info{background:var(--primary-soft);color:var(--primary)}
.greenbox{background:var(--good-soft);color:#248a3d}
.amberbox{background:var(--warn-soft);color:#c77700}
.bluebox{background:var(--primary-soft);color:var(--primary)}
.redbox{background:var(--danger-soft);color:#d70015}

/* ---------- Cassa: totale stile Apple ---------- */
.total-card,.bigtotal,.pay-total-card{
  border:0 !important;
  background:#fff !important;
  box-shadow:var(--shadow) !important;
  border-radius:var(--radius) !important;
}
.pay-total-amount,.huge{
  color:#1d1d1f !important;
  letter-spacing:-.04em !important;
}
.pay-total-label{color:#248a3d !important;font-weight:600}
.pay-confirm-button{
  background:#000 !important;
  color:#fff !important;
  border-radius:980px !important;
}
.pay-confirm-button:hover{background:#333 !important}

/* ---------- Cassa: metodi pagamento segmented ---------- */
.pay-method-row{
  background:#e8e8ed;
  border-radius:14px;
  padding:5px;
  gap:5px;
}
.pay-method{
  background:transparent;
  border:0;
  color:#6e6e73;
  border-radius:10px;
  min-height:76px;
}
.pay-method:hover{background:rgba(255,255,255,.5)}
.pay-method.active{
  background:#fff;
  color:#1d1d1f;
  box-shadow:0 2px 8px rgba(0,0,0,.12);
}
.pay-method.active b{color:#1d1d1f}
.pay-method.active small{color:#6e6e73}
.pay-method-ico{
  background:rgba(0,113,227,.12);
  color:var(--primary);
}
.pay-method.active .pay-method-ico{background:var(--primary-soft);color:var(--primary)}

/* ---------- Scrollbar Apple-like ---------- */
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-thumb{background:#c7c7cc;border-radius:99px;border:0}
::-webkit-scrollbar-thumb:hover{background:#aeaeb2}

/* ============================================================
   V9.00 - Tema scuro stile Apple (iOS dark)
   ============================================================ */
body.bt-theme-dark{
  --bg:#000000;
  --card:#1c1c1e;
  --text:#f5f5f7;
  --muted:#98989d;
  --border:#38383a;
  --border-strong:#48484a;
  --primary:#0a84ff;
  --primary-dark:#409cff;
  --primary-soft:#0d1f3c;
  --good:#30d158;
  --good-soft:#0d2b16;
  --danger:#ff453a;
  --danger-soft:#3b1715;
  --warn:#ff9f0a;
  --warn-soft:#3a2a08;
  --shadow:0 4px 16px rgba(0,0,0,.5);
  --shadow-sm:0 2px 8px rgba(0,0,0,.4);
}
body.bt-theme-dark button.secondary,
body.bt-theme-dark button.out{background:#2c2c2e;color:#f5f5f7}
body.bt-theme-dark button.secondary:hover,
body.bt-theme-dark button.out:hover{background:#3a3a3c}
body.bt-theme-dark .buttonlike{background:#2c2c2e;color:#f5f5f7}
body.bt-theme-dark .buttonlike:hover{background:#3a3a3c}
body.bt-theme-dark .nav{background:#1c1c1e}
body.bt-theme-dark .nav button{color:#98989d}
body.bt-theme-dark .nav button:hover{background:rgba(255,255,255,.08);color:#f5f5f7}
body.bt-theme-dark .nav button.active{background:var(--primary);color:#fff}
body.bt-theme-dark .item{background:#2c2c2e}
body.bt-theme-dark input,
body.bt-theme-dark select,
body.bt-theme-dark textarea{
  background:#1c1c1e;
  border-color:#38383a;
  color:#f5f5f7;
}
body.bt-theme-dark .table tr:hover td{background:#2c2c2e}
body.bt-theme-dark .table td{border-bottom-color:#2c2c2e}
body.bt-theme-dark .badge{background:#2c2c2e;color:#98989d}
body.bt-theme-dark .badge.dark{background:#3a3a3c;color:#f5f5f7}
body.bt-theme-dark .pay-method-row{background:#1c1c1e}
body.bt-theme-dark .pay-method{color:#98989d}
body.bt-theme-dark .pay-method.active{background:#3a3a3c;color:#f5f5f7}
body.bt-theme-dark .pay-method.active b{color:#f5f5f7}
body.bt-theme-dark .total-card,
body.bt-theme-dark .bigtotal,
body.bt-theme-dark .pay-total-card{background:#1c1c1e !important}
body.bt-theme-dark .pay-total-amount,
body.bt-theme-dark .huge{color:#f5f5f7 !important}
body.bt-theme-dark .pay-confirm-button{background:#f5f5f7 !important;color:#000 !important}
body.bt-theme-dark .logo{background:#f5f5f7 !important;color:#000 !important}
body.bt-theme-dark ::-webkit-scrollbar-thumb{background:#48484a}

/* V9.06 - Cassa: tasti rapidi e importo libero.
   I selettori usano :not(#_) per vincere sulle vecchie regole globali dei bottoni con !important. */
.qk-panel{
  --qk-surface:var(--card);
  --qk-soft:#f3f6fb;
  --qk-bar:var(--primary);
  --qk-tab:#b45309;
  --qk-tab-soft:#fff4e5;
  --qk-ok:#15803d;
  --qk-ok-soft:#dcfce7;
  --qk-est:#a16207;
  --qk-est-soft:#fef3c7;
  --qk-bad:var(--danger);
  --qk-bad-soft:var(--danger-soft);
  margin-top:14px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--qk-surface);
  box-shadow:var(--shadow-sm);
}
body.bt-theme-dark .qk-panel{
  --qk-soft:#1d1d1f;
  --qk-tab:#fbbf24;
  --qk-tab-soft:#3a2a12;
  --qk-ok:#4ade80;
  --qk-ok-soft:#132f20;
  --qk-est:#fbbf24;
  --qk-est-soft:#3a2a12;
}
.qk-head{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-start;justify-content:space-between}
.qk-head > div:first-child{flex:1 1 240px;min-width:0}
.qk-head h3{margin:0 0 2px;display:flex;align-items:center;gap:8px}
.qk-head .muted{margin:0;font-size:13px}
.qk-total{font-size:12px;font-weight:800;padding:2px 8px;border-radius:999px;background:var(--primary-soft);color:var(--primary)}
.qk-tools{display:flex;flex-wrap:wrap;gap:6px}

body .qk-panel button.qk-tool:not(#_){
  min-height:36px;padding:6px 12px;font-size:13px;font-weight:800;border-radius:999px;
  background:var(--qk-soft) !important;color:var(--text) !important;border:1px solid var(--border) !important;box-shadow:none !important;
}
body .qk-panel button.qk-tool:not(#_):hover{border-color:var(--primary) !important;color:var(--primary) !important;background:var(--primary-soft) !important}
body .qk-panel button.qk-tool.on:not(#_){background:var(--primary) !important;border-color:var(--primary) !important;color:#fff !important}
body .qk-panel button.qk-tool.qk-free:not(#_):not(.on){border-color:var(--qk-ok) !important;color:var(--qk-ok) !important;background:var(--qk-ok-soft) !important}

.qk-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
body .qk-panel .qk-chips button:not(#_){
  min-height:32px;padding:4px 12px;font-size:13px;font-weight:800;border-radius:999px;
  background:transparent !important;color:var(--muted) !important;border:1px solid var(--border) !important;box-shadow:none !important;
}
body .qk-panel .qk-chips button:not(#_):hover{color:var(--text) !important;border-color:var(--border-strong) !important;background:var(--qk-soft) !important}
body .qk-panel .qk-chips button.on:not(#_){background:var(--text) !important;color:var(--card) !important;border-color:var(--text) !important}
.qk-chips small{opacity:.7;font-weight:700;margin-left:2px;color:inherit !important}

.qk-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:8px;margin-top:12px}
.qk-panel.big .qk-grid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px}
.qk-tile{position:relative;display:flex;flex-direction:column;gap:4px;min-width:0}
body .qk-panel button.qk-btn:not(#_){
  position:relative;width:100%;min-height:72px;padding:10px 12px 10px 14px;
  display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;gap:6px;text-align:left;
  background:var(--qk-surface) !important;color:var(--text) !important;
  border:1px solid var(--border) !important;border-radius:10px;box-shadow:0 1px 2px rgba(8,17,38,.06) !important;
  transition:border-color .12s, box-shadow .12s, transform .06s;
}
.qk-panel.big button.qk-btn:not(#_){min-height:96px;padding:14px 14px 12px 16px}
body .qk-panel button.qk-btn:not(#_)::after{
  content:"";position:absolute;left:0;top:10px;bottom:10px;width:4px;border-radius:0 4px 4px 0;background:var(--qk-bar);display:block !important;
}
body .qk-panel .qk-tile.tab button.qk-btn:not(#_)::after{background:var(--qk-tab)}
body .qk-panel button.qk-btn:not(#_):hover{border-color:var(--primary) !important;box-shadow:0 6px 16px rgba(21,94,239,.14) !important;background:var(--qk-surface) !important;color:var(--text) !important}
body .qk-panel button.qk-btn:not(#_):active{transform:scale(.98)}
body .qk-panel .qk-tile.in-cart button.qk-btn:not(#_){border-color:var(--qk-ok) !important;background:var(--qk-ok-soft) !important}
body .qk-panel button.qk-btn:not(#_):disabled{opacity:.75;cursor:default}
.qk-name{
  font-size:13px;font-weight:800;line-height:1.25;color:var(--text) !important;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word;
}
.qk-panel.big .qk-name{font-size:15px}
.qk-price{font-size:14px;font-weight:900;color:var(--qk-ok) !important}
.qk-panel.big .qk-price{font-size:17px}
.qk-count{position:absolute;top:6px;right:6px;min-width:24px;padding:1px 7px;border-radius:999px;font-size:12px;font-weight:900;text-align:center;background:var(--qk-ok);color:#fff !important}
body.bt-theme-dark .qk-count{color:#0b1a10 !important}

.qk-edit{display:grid;grid-template-columns:34px 1fr 34px;gap:4px}
body .qk-panel .qk-edit button:not(#_){
  min-height:30px;padding:2px 4px;font-size:12px;font-weight:800;border-radius:8px;
  background:var(--qk-soft) !important;color:var(--text) !important;border:1px solid var(--border) !important;box-shadow:none !important;
}
body .qk-panel .qk-edit button:not(#_):hover{border-color:var(--primary) !important;color:var(--primary) !important}
body .qk-panel .qk-edit button.qk-del:not(#_){background:var(--qk-bad-soft) !important;color:var(--qk-bad) !important;border-color:transparent !important}
body .qk-panel .qk-edit button:not(#_):disabled{opacity:.35}

/* Importo libero */
.fa-panel{margin-top:14px;padding:14px;border-radius:12px;background:var(--qk-soft);border:1px solid var(--border)}
.fa-head{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-start;justify-content:space-between}
.fa-head > div:first-child{flex:1 1 240px;min-width:0}
.fa-head h3{margin:0 0 2px;font-size:16px !important}
.fa-head .muted{margin:0;font-size:13px}
.fa-seg{display:inline-flex;padding:3px;border-radius:999px;background:var(--qk-surface);border:1px solid var(--border)}
body .qk-panel .fa-seg button:not(#_){
  min-height:32px;padding:4px 16px;font-size:13px;font-weight:800;border-radius:999px;
  background:transparent !important;color:var(--muted) !important;border:0 !important;box-shadow:none !important;
}
body .qk-panel .fa-seg button:not(#_):hover{color:var(--text) !important;background:transparent !important}
body .qk-panel .fa-seg button.on:not(#_){background:var(--primary) !important;color:#fff !important}
.fa-fields{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr);gap:10px;margin-top:12px}
.fa-field{display:flex;flex-direction:column;gap:4px;margin:0;min-width:0}
.fa-field > span{font-size:12px;font-weight:800;color:var(--muted) !important;text-transform:uppercase}
.fa-field em{font-style:normal;font-weight:700;text-transform:none;opacity:.8}
.fa-panel input{width:100%;min-width:0;margin:0}
.fa-input{position:relative}
.fa-input i{position:absolute;left:12px;top:50%;transform:translateY(-50%);font-style:normal;font-weight:900;color:var(--muted);pointer-events:none}
.fa-panel .fa-input input{padding-left:30px;font-weight:800;font-size:16px;text-align:right}
.fa-foot{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;margin-top:12px}
.fa-preview{display:flex;flex-wrap:wrap;gap:8px;align-items:center;min-width:0;flex:1 1 260px}
.fa-chip{padding:6px 12px;border-radius:999px;font-size:13px;font-weight:700;background:var(--qk-surface);border:1px solid var(--border);color:var(--muted)}
.fa-chip b{font-size:15px;font-weight:900;color:inherit}
.fa-chip.ok{background:var(--qk-ok-soft);border-color:transparent;color:var(--qk-ok)}
.fa-chip.est{background:var(--qk-est-soft);border-color:transparent;color:var(--qk-est)}
.fa-chip.bad{background:var(--qk-bad-soft);border-color:transparent;color:var(--qk-bad)}
.fa-note{font-size:12px;color:var(--muted)}
.fa-actions{display:flex;gap:8px;flex-wrap:wrap}
body .qk-panel .fa-actions button.fa-cancel:not(#_){
  min-height:42px;background:transparent !important;color:var(--muted) !important;border:1px solid var(--border) !important;box-shadow:none !important;
}
body .qk-panel .fa-actions button.fa-cancel:not(#_):hover{color:var(--text) !important;border-color:var(--border-strong) !important}
body .qk-panel .fa-actions button.fa-add:not(#_){
  min-height:42px;padding:8px 18px;background:var(--qk-ok) !important;color:#fff !important;border:1px solid var(--qk-ok) !important;box-shadow:0 6px 16px rgba(21,128,61,.22) !important;
}
body.bt-theme-dark .qk-panel .fa-actions button.fa-add:not(#_){color:#0b1a10 !important}
body .qk-panel .fa-actions button.fa-add:not(#_):hover{filter:brightness(1.06)}

@media (max-width:720px){
  .qk-panel{padding:12px}
  .fa-fields{grid-template-columns:1fr 1fr}
  .fa-fields .fa-desc{grid-column:1 / -1}
  .fa-actions{width:100%}
  .fa-actions button{flex:1}
  .qk-grid{grid-template-columns:repeat(auto-fill,minmax(112px,1fr))}
}
/* forza layout sui vecchi stili globali dei bottoni */
body .qk-panel button.qk-tool:not(#_),
body .qk-panel .qk-chips button:not(#_){min-height:34px !important;padding:6px 14px !important;font-size:13px !important;border-radius:999px !important;width:auto !important}
body .qk-panel button.qk-btn:not(#_){text-align:left !important;align-items:flex-start !important;justify-content:space-between !important;padding:10px 12px 10px 16px !important;border-radius:10px !important;min-height:72px !important}
.qk-panel.big .qk-tile button.qk-btn:not(#_){min-height:96px !important;padding:14px 14px 12px 18px !important}
body .qk-panel button.qk-btn:not(#_) .qk-name,
body .qk-panel button.qk-btn:not(#_) .qk-price{text-align:left !important;width:100%}
body .qk-panel .qk-edit button:not(#_){min-height:30px !important;padding:2px 4px !important;font-size:12px !important;border-radius:8px !important}
body .qk-panel .fa-seg button:not(#_){min-height:32px !important;padding:4px 16px !important;font-size:13px !important;border-radius:999px !important}
body .qk-panel .fa-actions button:not(#_){min-height:42px !important;padding:8px 18px !important;font-size:14px !important;border-radius:10px !important}
body .qk-panel button.qk-btn:not(#_) .qk-name{white-space:normal !important;overflow:hidden !important;text-overflow:clip !important;display:-webkit-box !important;-webkit-line-clamp:2;-webkit-box-orient:vertical}

/* V9.10 - rifinitura tasti rapidi / importo libero */
body .qk-panel button:not(#_),
body .qk-panel input:not(#_){font-family:inherit !important;letter-spacing:0 !important}
body .qk-panel button.qk-btn:not(#_) .qk-name{font-weight:700 !important;font-size:14px !important;line-height:1.25 !important}
.qk-panel.big .qk-tile button.qk-btn:not(#_) .qk-name{font-size:16px !important}
body .qk-panel button.qk-btn:not(#_) .qk-price{font-weight:800 !important;font-size:15px !important}
body .qk-panel button.qk-tool:not(#_),
body .qk-panel .qk-chips button:not(#_),
body .qk-panel .fa-seg button:not(#_){font-weight:700 !important}
body .qk-panel .fa-actions button:not(#_){font-weight:700 !important;white-space:normal !important;line-height:1.2 !important}
body .qk-panel .fa-input input:not(#_){text-align:left !important;padding-left:32px !important;font-weight:700 !important;font-size:16px !important}
body .qk-panel .fa-field input:not(#_){min-height:44px;border-radius:10px !important}
.fa-field > span{letter-spacing:.02em !important;font-size:11px}
@media (max-width:720px){
  .qk-tools{width:100%}
  body .qk-panel button.qk-tool:not(#_){flex:1 1 auto}
  .fa-foot{flex-direction:column;align-items:stretch}
}
@media (max-width:720px){
  .fa-foot .fa-preview{flex:0 0 auto}
  .fa-foot .fa-actions{flex:0 0 auto}
}

/* V9.12 - Tasti rapidi: ritorno allo stile classico (bottoni scuri), funzioni nuove invariate */
.qk-panel{background:#f8fafc;border-color:#dbe3ef;box-shadow:none}
body.bt-theme-dark .qk-panel{background:#252526;border-color:#3c3c3c}
body .qk-panel button.qk-btn:not(#_){
  background:#0f172a !important;color:#ffffff !important;
  border:2px solid #0f172a !important;border-radius:8px !important;
  box-shadow:0 10px 22px rgba(15,23,42,.20) !important;
}
body.bt-theme-dark .qk-panel button.qk-btn:not(#_){border-color:#1e293b !important;box-shadow:0 10px 22px rgba(0,0,0,.28) !important}
body .qk-panel button.qk-btn:not(#_):hover{background:#064e3b !important;border-color:#10b981 !important;color:#ffffff !important;box-shadow:0 10px 22px rgba(15,23,42,.20) !important}
body .qk-panel button.qk-btn:not(#_)::after{display:none !important}
body .qk-panel button.qk-btn:not(#_) .qk-name{color:#ffffff !important;font-weight:800 !important}
body .qk-panel button.qk-btn:not(#_) .qk-price{color:#ffffff !important;font-weight:900 !important}
body .qk-panel .qk-tile.in-cart button.qk-btn:not(#_){background:#064e3b !important;border-color:#10b981 !important}
body .qk-panel .qk-count{background:#10b981;color:#ffffff !important}
body .qk-panel button.qk-btn:not(#_):disabled{opacity:.85}
body .qk-panel button.qk-tool.qk-add:not(#_):not(.on){background:#047857 !important;border-color:#047857 !important;color:#ffffff !important}
body .qk-panel button.qk-tool.qk-add:not(#_):not(.on):hover{background:#065f46 !important;border-color:#065f46 !important;color:#ffffff !important}

/* ============================================================
   V9.18 - Statistiche per reparto + Report annuale
   ============================================================ */
.stats-v2{--stat-track:#eef2f7;--stat-grid:#e5eaf2;--stat-up:#15803d;--stat-down:#dc2626}
body.bt-theme-dark .stats-v2{--stat-track:#2f3136;--stat-grid:#34373d;--stat-up:#4ade80;--stat-down:#f87171}
.stat-row{margin-top:16px}
.stats-v2 .grid.g2.stat-row{gap:16px}
.stat-card-v2{padding:18px;border-radius:12px}
.stat-card-head{margin-bottom:12px}
.stat-card-head h2{margin:0 0 2px;font-size:18px !important}
.stat-card-head .muted{margin:0;font-size:13px}

/* KPI */
.stat-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin-top:16px}
.stat-kpi{display:flex;flex-direction:column;gap:4px;padding:16px;border-radius:12px;margin:0}
.stat-kpi > .stat-kpi-label{font-size:12px;font-weight:800;text-transform:uppercase;color:var(--muted)}
.stat-kpi > b{font-size:26px;font-weight:900;font-variant-numeric:tabular-nums;line-height:1.1}
.stat-kpi > small{font-size:12.5px;color:var(--muted)}
.stat-delta{display:inline-block;margin-top:4px;font-size:12px;font-weight:800;padding:2px 8px;border-radius:999px;width:fit-content}
.stat-delta.up{color:var(--stat-up);background:rgba(21,128,61,.10)}
.stat-delta.down{color:var(--stat-down);background:rgba(220,38,38,.10)}
.stat-delta.flat{color:var(--muted);background:var(--stat-track)}

/* Selettori */
.stat-view-switch{display:inline-flex;padding:3px;border-radius:999px;background:var(--stat-track);border:1px solid var(--border)}
body .stats-v2 .stat-view-switch button:not(#_){min-height:34px !important;padding:5px 16px !important;border-radius:999px !important;font-size:13px !important;font-weight:800;background:transparent !important;color:var(--muted) !important;border:0 !important;box-shadow:none !important}
body .stats-v2 .stat-view-switch button.on:not(#_){background:var(--card) !important;color:var(--text) !important;box-shadow:0 1px 4px rgba(8,17,38,.12) !important}
.stat-seg-chips{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 4px}
body .stats-v2 .stat-seg-chips button:not(#_){min-height:36px !important;padding:6px 14px !important;border-radius:999px !important;font-size:13px !important;font-weight:800;display:inline-flex;align-items:center;gap:7px;background:var(--card) !important;color:var(--text) !important;border:1px solid var(--border) !important;box-shadow:none !important}
body .stats-v2 .stat-seg-chips button:not(#_):hover{border-color:var(--primary) !important}
body .stats-v2 .stat-seg-chips button.on:not(#_){background:var(--text) !important;color:var(--card) !important;border-color:var(--text) !important}
.stat-seg-chips i,.stat-legend-row i,.stat-inline-legend i,.stats-v2 i.dot{display:inline-block;width:10px;height:10px;border-radius:3px;flex:0 0 auto}
.stats-v2 i.dot{margin-right:7px;vertical-align:-1px}

/* Ciambella */
.stat-donut-wrap{display:grid;grid-template-columns:minmax(150px,200px) 1fr;gap:18px;align-items:center}
.stat-donut{width:100%;max-width:200px;height:auto;display:block;margin:auto}
.stat-donut circle{transition:stroke-width .15s}
.stat-donut circle:hover{stroke-width:30}
.stat-donut-total{font-size:15px;font-weight:900;fill:var(--text)}
.stat-donut-sub{font-size:10px;fill:var(--muted);text-transform:uppercase;letter-spacing:.08em}
.stat-legend{display:flex;flex-direction:column;gap:6px;min-width:0}
body .stats-v2 button.stat-legend-row:not(#_){display:grid !important;grid-template-columns:12px 1fr auto 52px;align-items:center;gap:8px;min-height:38px !important;padding:6px 10px !important;border-radius:8px !important;text-align:left;background:transparent !important;color:var(--text) !important;border:1px solid transparent !important;box-shadow:none !important;font-weight:700;font-size:14px !important;width:100%}
body .stats-v2 button.stat-legend-row:not(#_):hover:not(:disabled){background:var(--stat-track) !important}
body .stats-v2 button.stat-legend-row.on:not(#_){border-color:var(--border-strong) !important;background:var(--stat-track) !important}
body .stats-v2 button.stat-legend-row:not(#_):disabled{opacity:1;cursor:default}
.stat-legend-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stat-legend-row b{font-variant-numeric:tabular-nums}
.stat-legend-row small{color:var(--muted);text-align:right;font-variant-numeric:tabular-nums}

/* Colonne */
.stat-svg-wrap svg{width:100%;height:auto;display:block}
.stats-v2 .stat-grid{stroke:var(--stat-grid);stroke-width:1}
.stats-v2 .stat-axis-label{font-size:11px;fill:var(--muted)}
.stats-v2 svg rect:hover{opacity:.82}
.stat-inline-legend{display:flex;flex-wrap:wrap;gap:12px;font-size:12.5px;font-weight:700;color:var(--muted)}
.stat-inline-legend span{display:inline-flex;align-items:center;gap:6px}

/* Barre orizzontali */
.stat-hbars{display:flex;flex-direction:column;gap:11px}
.stat-hbar-top{display:flex;justify-content:space-between;gap:10px;font-size:14px}
.stat-hbar-top span{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stat-hbar-top b{font-variant-numeric:tabular-nums;white-space:nowrap}
.stat-hbar-track{height:8px;border-radius:99px;background:var(--stat-track);overflow:hidden;margin-top:5px}
.stat-hbar-track i{display:block;height:100%;border-radius:99px}
.stat-hbar small{display:block;margin-top:3px;font-size:12px;color:var(--muted)}

/* Tabelle stile bilancio */
.stat-fin-table{width:100%;border-collapse:collapse;font-size:14px}
.stat-fin-table th{font-size:12px;text-transform:uppercase;color:var(--muted);font-weight:800;text-align:left;padding:8px 10px;border-bottom:2px solid var(--border)}
.stat-fin-table td{padding:8px 10px;border-bottom:1px solid var(--border)}
.stat-fin-table .num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.stat-fin-table .pos{color:var(--stat-up);font-weight:800}
.stat-fin-table .neg{color:var(--stat-down);font-weight:800}
.stat-fin-table tr.sec td{font-size:12px;text-transform:uppercase;font-weight:800;color:var(--muted);background:var(--stat-track);padding-top:6px;padding-bottom:6px}
.stat-fin-table tr.tot td{font-weight:800;border-top:2px solid var(--border)}
.stat-fin-table tr.tot.strong td{font-size:15px;border-bottom:3px double var(--border-strong)}
.stat-fin-table tr.muted td{color:var(--muted)}
.stat-fin-table tfoot td{position:sticky;bottom:0;background:var(--card)}

/* Report annuale */
.stat-annual{margin-top:16px;padding:22px;border-radius:14px}
.stat-annual-head h1{margin:4px 0 4px;font-size:28px !important}
.stat-annual-kicker{font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:var(--primary)}
.stat-annual-notes{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.stat-annual-notes div{padding:10px 12px;border-radius:10px;background:var(--stat-track);display:flex;flex-direction:column;gap:2px}
.stat-annual-notes span{font-size:12px;color:var(--muted);font-weight:700}
.stat-annual-notes b{font-size:14px}

/* Reparti in dashboard: fino a 5 reparti */
.dept-grid{grid-template-columns:repeat(auto-fit,minmax(220px,1fr)) !important}
.dept-gv .dept-card-bar i{background:#059669}
.dept-gv .dept-card-today{color:#047857}
.dept-serv .dept-card-bar i{background:#7c3aed}
.dept-serv .dept-card-today{color:#6d28d9}
.dept-altro .dept-card-bar i{background:#64748b}
.dept-altro .dept-card-today{color:#475569}

@media (max-width:760px){
  .stat-donut-wrap{grid-template-columns:1fr}
  .stat-annual-notes{grid-template-columns:1fr}
  .stat-kpi > b{font-size:22px}
}
@media print{
  body.stats-screen-print-mode .stat-seg-chips,
  body.stats-screen-print-mode .stat-view-switch,
  body.stats-screen-print-mode #stats_all_search{display:none !important}
  body.stats-screen-print-mode .stat-card-v2,
  body.stats-screen-print-mode .stat-kpi{break-inside:avoid;box-shadow:none !important}
}
body .stats-v2 button.stat-legend-row:not(#_) span{text-align:left !important;justify-self:start}
body .stats-v2 button.stat-legend-row:not(#_) b{justify-self:end}
.stats-v2 div.stat-legend-row{display:grid;grid-template-columns:12px 1fr auto 52px;align-items:center;gap:8px;min-height:38px;padding:6px 10px;font-weight:700;font-size:14px}

/* ============================================================
   V9.19 - Dashboard "oggi"
   ============================================================ */
.dash-head{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end;justify-content:space-between}
.dash-head h1{margin:2px 0 4px;font-size:28px !important}
.dash-head .muted{margin:0;font-size:13.5px}
.dash-head-actions{display:flex;flex-wrap:wrap;gap:8px}
.dash-row-main{grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) !important}
.dash-kpi-unit{font-size:13px;font-weight:700;color:var(--muted)}
.dash-goal,.dash-paybar{display:flex;height:7px;border-radius:99px;background:var(--stat-track);overflow:hidden;margin:6px 0 5px}
.dash-goal i{display:block;height:100%;background:var(--stat-up);border-radius:99px}
.dash-paybar i{display:block;height:100%}
.dash-paybar i.cash{background:#059669}
.dash-paybar i.pos{background:#2563eb}
.dash-paybar i.mixed{background:#d97706}

/* Grafico orario */
.dash-v2 .dash-bar{fill:var(--primary);opacity:.8}
.dash-v2 .dash-bar-now{fill:var(--primary)}
.dash-v2 .dash-bar-future{fill:var(--muted);opacity:.35}
.dash-v2 .dash-avg-line{fill:none;stroke:#d97706;stroke-width:2.5;stroke-dasharray:6 5;stroke-linecap:round}
.dash-legend-line{display:inline-block;width:16px;height:0 !important;border-top:3px dashed #d97706;border-radius:0 !important;background:none !important}

/* Avvisi */
.dash-alerts .stat-card-head{margin-bottom:8px}
body .dash-v2 button.dash-alert:not(#_){display:grid !important;grid-template-columns:28px 1fr;gap:10px;align-items:start;width:100%;min-height:0 !important;padding:10px 12px !important;margin-top:8px;border-radius:10px !important;text-align:left;font-size:14px !important;font-weight:400;background:var(--stat-track) !important;color:var(--text) !important;border:1px solid transparent !important;box-shadow:none !important}
body .dash-v2 button.dash-alert:not(#_):hover{border-color:var(--border-strong) !important}
.dash-alert > i{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;font-style:normal;font-weight:900;color:#fff}
.dash-alert.bad > i{background:var(--stat-down)}
.dash-alert.warn > i{background:#d97706}
.dash-alert.info > i{background:#64748b}
.dash-alert span{display:flex;flex-direction:column;gap:2px;min-width:0}
.dash-alert b{font-size:14px}
.dash-alert small{color:var(--muted);font-size:12.5px;line-height:1.35}
.dash-all-ok{padding:14px;border-radius:10px;background:rgba(21,128,61,.10);color:var(--stat-up);font-weight:700}

/* Ultime vendite */
.dash-sales{display:flex;flex-direction:column}
.dash-sale{display:grid;grid-template-columns:52px 1fr auto 92px;gap:10px;align-items:center;padding:9px 2px;border-bottom:1px solid var(--border);font-size:14px}
.dash-sale:last-child{border-bottom:0}
.dash-sale-time{color:var(--muted);font-variant-numeric:tabular-nums;font-weight:700}
.dash-sale-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-sale-name em{font-style:normal;color:var(--muted);font-size:12px}
.dash-sale b{text-align:right;font-variant-numeric:tabular-nums}
.dash-sale-pay{font-size:11.5px;font-weight:800;padding:2px 8px;border-radius:999px;background:rgba(5,150,105,.12);color:#047857}
.dash-sale-pay.pos{background:rgba(37,99,235,.12);color:#1d4ed8}
.dash-sale-pay.misto{background:rgba(217,119,6,.14);color:#b45309}
body.bt-theme-dark .dash-sale-pay{color:#6ee7b7}
body.bt-theme-dark .dash-sale-pay.pos{color:#93c5fd}
body.bt-theme-dark .dash-sale-pay.misto{color:#fcd34d}

/* Totali da sempre */
.dash-total-strip{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}
.dash-total-strip div{padding:12px 14px;border-radius:10px;background:var(--card);border:1px solid var(--border);display:flex;flex-direction:column;gap:2px}
.dash-total-strip span{font-size:12px;color:var(--muted);font-weight:700}
.dash-total-strip b{font-size:17px;font-variant-numeric:tabular-nums}

@media (max-width:900px){
  .dash-row-main{grid-template-columns:1fr !important}
}
@media (max-width:520px){
  .dash-sale{grid-template-columns:44px 1fr 80px}
  .dash-sale-pay{display:none}
}
body .dash-v2 button.dash-alert:not(#_) span,body .dash-v2 button.dash-alert:not(#_) b,body .dash-v2 button.dash-alert:not(#_) small{text-align:left !important;justify-self:start}
body .dash-v2 button.dash-alert:not(#_) b{color:var(--text) !important}
body .dash-v2 button.dash-alert:not(#_) small{color:var(--muted) !important;font-weight:500}
body .dash-v2 button.dash-alert:not(#_) > i{color:#fff !important}
.dash-v2 .stat-axis-label{font-size:13px}
@media (max-width:520px){.stat-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.stat-kpi{padding:12px}.stat-kpi > b{font-size:19px}.dash-head h1{font-size:22px !important}}

/* V9.20 - Registro veloce Servizi/Giochi */
.svcreg-card .row{flex-wrap:wrap;gap:12px;align-items:flex-start}
.svcreg-card .row > div:first-child{flex:1 1 320px}
.svcreg-pay{min-width:160px;margin:0}
.svcreg-table{width:100%;border-collapse:collapse;margin-top:10px;font-size:14px}
.svcreg-table th{font-size:12px;text-transform:uppercase;color:var(--muted);font-weight:800;text-align:left;padding:8px 10px;border-bottom:2px solid var(--border)}
.svcreg-table td{padding:7px 10px;border-bottom:1px solid var(--border);vertical-align:middle}
.svcreg-table .num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.svcreg-table td small{display:block;color:var(--muted);font-size:12px;font-weight:500}
.svcreg-table tr.svcreg-group td{background:var(--primary-soft);color:var(--primary);font-size:12px;font-weight:800;text-transform:uppercase;padding:6px 10px}
.svcreg-table input.svcreg-input{width:120px;min-height:40px;margin:0;text-align:right;font-weight:700;font-size:15px}
.svcreg-table input.svcreg-count{width:80px}
.svcreg-profit{font-weight:800;color:#15803d}
body.bt-theme-dark .svcreg-profit{color:#4ade80}
.svcreg-foot{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;margin-top:14px}
.svcreg-foot #svcreg_summary{font-size:15px}
@media (max-width:760px){
  .svcreg-table thead th:nth-child(2),.svcreg-table td:nth-child(2),
  .svcreg-table thead th:nth-child(6),.svcreg-table td:nth-child(6){display:none}
  .svcreg-table input.svcreg-input{width:96px}
}

/* ============================================================
   V9.21 - Icone (Tabler Icons, MIT)
   ============================================================ */
.bt-ico{width:1.15em;height:1.15em;flex:0 0 auto;vertical-align:-0.2em;stroke-width:2}
button .bt-ico{margin-right:.4em}
body button:not(#_) > .bt-ico + span{display:inline}
/* pulsanti con icona + testo: allineati in riga */
body .topbar-actions button:not(#_),
body .dash-head-actions button:not(#_),
body .stat-quick-actions button:not(#_),
body .stat-view-switch button:not(#_),
body .multi-pc-status button:not(#_){display:inline-flex !important;align-items:center;justify-content:center;gap:.4em}
body .topbar-actions button:not(#_) .bt-ico,
body .dash-head-actions button:not(#_) .bt-ico,
body .stat-quick-actions button:not(#_) .bt-ico,
body .stat-view-switch button:not(#_) .bt-ico,
body .multi-pc-status button:not(#_) .bt-ico{margin-right:0}

/* Menu sezioni */
body .nav button:not(#_){display:inline-flex !important;align-items:center;gap:.45em}
body .nav button:not(#_) .nav-ico{width:1.2em;height:1.2em;margin:0;opacity:.85}
body .nav button.active:not(#_) .nav-ico{opacity:1}
body .nav button:not(#_) > span{display:inline-flex;align-items:center}

/* Cassa: metodi di pagamento */
.pay-method-ico .bt-ico{width:22px;height:22px;margin:0;vertical-align:middle}

/* Indicatori (KPI) */
.stat-kpi > .stat-kpi-label{display:flex;align-items:center;gap:6px}
.stat-kpi > .stat-kpi-label .bt-ico{width:16px;height:16px;color:var(--primary);opacity:.9}

/* Reparti */
.seg-chip-ico{display:inline-flex}
body .stats-v2 .stat-seg-chips button:not(#_) .bt-ico{width:16px;height:16px;margin:0}
body .stats-v2 .stat-seg-chips button.on:not(#_) .seg-chip-ico{color:inherit !important}
.dept-card-head b{display:inline-flex;align-items:center;gap:7px}
.dept-card-head .seg-ico{width:20px;height:20px}
.dept-bar .seg-ico{color:#2563eb}
.dept-tab .seg-ico{color:#d97706}
.dept-gv .seg-ico{color:#059669}
.dept-serv .seg-ico{color:#7c3aed}
.dept-altro .seg-ico{color:#64748b}

/* Avvisi dashboard */
.dash-alert > i .bt-ico{width:16px;height:16px;margin:0;stroke-width:2.4}
.dash-all-ok{display:flex;align-items:center;gap:8px}
.dash-all-ok .bt-ico{width:20px;height:20px}

/* V9.23 - Vendite distributore automatico */
.dist-panel h2{display:flex;align-items:center;gap:8px}
.dist-info{display:flex;flex-wrap:wrap;gap:8px 18px;align-items:center;margin:14px 0 10px;padding:10px 12px;border-radius:10px;background:var(--primary-soft);font-size:14px}
.dist-info span{display:inline-flex;align-items:center;gap:6px}
.dist-table td small{display:block;color:var(--muted);font-size:12px;margin-top:2px}
.dist-table input.dist-product{width:100%;min-width:220px;min-height:38px;margin:0;font-size:13.5px}
.dist-table input.dist-margin{width:80px;min-height:38px;margin:0;text-align:right;font-weight:700}
.dist-table tr.muted td{opacity:.55}
.dept-dist .dept-card-bar i{background:#0891b2}
.dept-dist .dept-card-today{color:#0e7490}
.dept-dist .seg-ico{color:#0891b2}
.dash-paybar i.dist{background:#0891b2}

/* V9.25 - Ordine intelligente */
.so-panel h2{display:flex;align-items:center;gap:8px}
.so-schedule{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:12px}
.so-schedule>div{padding:10px 12px;border-radius:10px;background:var(--primary-soft)}
.so-schedule small{display:block;color:var(--muted);font-size:12px}
.so-schedule b{display:block;font-size:16px}
.so-schedule b::first-letter{text-transform:uppercase}
.so-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:14px}
.so-seg{display:flex;flex-wrap:wrap;gap:6px}
.so-seg button{min-height:38px;padding:6px 12px}
.so-seg button span{display:inline-block;min-width:20px;padding:0 6px;border-radius:10px;background:#dc2626;color:#fff;font-size:12px}
.so-search{flex:1;min-width:200px;min-height:38px;margin:0}
.so-totals{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
.so-kpi{flex:1;min-width:110px;padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.so-kpi b{display:block;font-size:20px}
.so-kpi span{color:var(--muted);font-size:12.5px}
.so-actions{margin-top:12px}
.so-actions button{display:inline-flex;align-items:center;gap:6px}
.so-table td.num,.so-table th.num{text-align:right;white-space:nowrap}
.so-table td small{display:block;color:var(--muted);font-size:12px;margin-top:2px}
.so-table tr.so-zero td{opacity:.6}
.so-table tr.so-edited td{background:rgba(234,179,8,.08)}
.so-table td.so-qty div{display:flex;align-items:center;gap:6px;white-space:nowrap}
.so-table td.so-qty input{width:74px;min-height:36px;margin:0;text-align:right;font-weight:700}
.so-table .so-was{color:#b45309}
.so-flags{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
.so-flag{font-size:11.5px;padding:1px 7px;border-radius:9px;background:#e2e8f0;color:#334155}
.so-flag.bad{background:#fee2e2;color:#b91c1c}
.so-flag.warn{background:#fef3c7;color:#92400e}
.so-flag.good{background:#dcfce7;color:#166534}
.so-flag.info{background:#dbeafe;color:#1e40af}
.so-help,.so-config{margin-top:12px;padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.so-help summary,.so-config summary{cursor:pointer;font-weight:700;display:flex;align-items:center;gap:6px}
.so-help ol{margin:10px 0 6px 18px;line-height:1.55}
.so-stopped{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.so-stopped span{font-size:13px;padding:3px 8px;border-radius:8px;background:var(--primary-soft)}
.so-config-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:12px 0}
.so-check{display:flex;gap:8px;align-items:center;margin:6px 0}
.so-check input{width:auto;min-height:0;margin:0}
.so-text{width:100%;margin-top:10px;font-family:monospace}
@media (max-width:720px){.so-schedule{grid-template-columns:repeat(2,minmax(0,1fr))}}
.dash-total-strip small{font-size:11.5px;color:var(--muted)}

/* V9.27 - File pronti da scaricare: pulsanti grandi e ben visibili */
.bt-files{margin-top:14px;padding:12px;border:2px solid #16a34a;border-radius:12px;background:rgba(22,163,74,.07)}
.bt-files-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px;color:var(--text)}
.bt-files-head .bt-ico{color:#16a34a}
.bt-files-list{display:grid;gap:8px}
.bt-file{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:10px 12px;border-radius:10px;background:var(--card,#fff);border:1px solid var(--border,#dbe4f0)}
.bt-file-badge{flex:0 0 auto;min-width:58px;padding:8px 6px;border-radius:8px;color:#fff;font-weight:800;font-size:13px;text-align:center;background:#475569}
.bt-file.pdf .bt-file-badge{background:#dc2626}
.bt-file.xls .bt-file-badge{background:#15803d}
.bt-file.csv .bt-file-badge{background:#0d9488}
.bt-file.json .bt-file-badge{background:#7c3aed}
.bt-file.xml .bt-file-badge{background:#ea580c}
.bt-file.sql .bt-file-badge,.bt-file.zip .bt-file-badge{background:#1d4ed8}
.bt-file-name{flex:1 1 200px;min-width:0;color:var(--text)}
.bt-file-name b{display:block;font-size:14.5px}
.bt-file-name small{display:block;color:var(--muted);font-size:12px;word-break:break-all}
.bt-file-actions{display:flex;gap:8px;flex-wrap:wrap}
.bt-file-actions button,.bt-dl-btn{display:inline-flex;align-items:center;gap:6px;min-height:42px;padding:8px 14px;font-weight:700}
@media (max-width:600px){.bt-file-actions{width:100%}.bt-file-actions button{flex:1;justify-content:center}}

/* V9.28 - Controllo giacenze */
.sc-panel h2{display:flex;align-items:center;gap:8px}
.sc-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.sc-tabs button{min-height:40px}
.sc-tabs button span{display:inline-block;min-width:22px;margin-left:4px;padding:0 7px;border-radius:10px;background:rgba(0,0,0,.12);font-size:12.5px}
.sc-hint{margin:10px 0;padding:9px 12px;border-radius:10px;background:var(--primary-soft);font-size:14px}
.sc-table td.num,.sc-table th.num{text-align:right;white-space:nowrap}
.sc-table td small{display:block;color:var(--muted);font-size:12px}
.sc-table input.sc-count{width:110px;min-height:40px;margin:0;text-align:right;font-weight:700}
.sc-dup{display:grid;gap:4px;margin:8px 0;padding:10px 12px;border:1px solid var(--border);border-left:4px solid #d97706;border-radius:10px}
.sc-dup div{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline}
.sc-dup .muted{font-size:13px}

/* ============================================================
   V9.39 - Grafica uniforme nelle schermate vecchie
   Stesso stile di Dashboard, Statistiche e Ordine intelligente:
   titoli con icona, filtri compatti a pillola, tabelle leggibili.
   Solo aspetto: nessun cambio di funzionamento.
   ============================================================ */

/* --- Intestazioni card: titolo con icona + sottotitolo grigio --- */
.card h2:has(> .bt-ico){display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.card h2 > .bt-ico{width:24px;height:24px;margin:0;color:var(--primary);flex:0 0 auto}
.card > .row:first-child h2 + p.muted,
.card > .row:first-child > div > h2 + p.muted,
.card > h2 + p.muted{margin:4px 0 0;font-size:13.5px;line-height:1.45;color:var(--muted)}
.card > .row:first-child{margin-bottom:4px}

/* Etichetta in alto a destra (es. "Bar + Tabacchi", "Manuale"): pillola grigia leggibile */
.card .row > .pill:not(.good):not(.warn):not(.bad):not(.danger):not(.dark):not(.info),
.card .row > .toolbar > .pill:not(.good):not(.warn):not(.bad):not(.danger):not(.dark):not(.info){
  background:var(--stat-track,#eef2f7);color:var(--text);border:1px solid var(--border);
  padding:5px 12px;font-size:12.5px;font-weight:800;white-space:nowrap
}
body.bt-theme-dark .card .row > .pill:not(.good):not(.warn):not(.bad):not(.danger):not(.dark):not(.info),
body.bt-theme-dark .card .row > .toolbar > .pill:not(.good):not(.warn):not(.bad):not(.danger):not(.dark):not(.info){background:#2c2c2e;color:#f5f5f7}

/* --- Filtri e schede compatte (reparti, schede Magazzino/Config/Gratta, Ordine intelligente) --- */
.bt-chips,
.so-seg,
.sc-tabs,
.stock-workspace-tabs,
.config-workspace-tabs{display:flex !important;flex-wrap:wrap;gap:6px !important;align-items:center}
.bt-chips,
.stock-workspace-tabs{margin-top:12px}
.bt-chips + .stock-workspace-tabs{margin-top:8px}
body .bt-chips button:not(#_),
body .so-seg button:not(#_),
body .sc-tabs button:not(#_),
body .stock-workspace-tabs button:not(#_),
body .config-workspace-tabs button:not(#_){
  flex:0 0 auto !important;width:auto !important;min-width:0 !important;
  min-height:38px !important;padding:6px 14px !important;
  border-radius:999px !important;font-size:13.5px !important;font-weight:700 !important;
  line-height:1.2 !important;white-space:nowrap !important;
  display:inline-flex !important;align-items:center !important;justify-content:center !important;gap:7px;
  box-shadow:none !important;transform:none
}
body .bt-chips button.secondary:not(#_),
body .so-seg button.secondary:not(#_),
body .sc-tabs button.secondary:not(#_),
body .stock-workspace-tabs button.secondary:not(#_),
body .config-workspace-tabs button.secondary:not(#_){
  background:var(--card) !important;color:var(--text) !important;border:1px solid var(--border) !important
}
body .bt-chips button.secondary:not(#_):hover,
body .so-seg button.secondary:not(#_):hover,
body .sc-tabs button.secondary:not(#_):hover,
body .stock-workspace-tabs button.secondary:not(#_):hover,
body .config-workspace-tabs button.secondary:not(#_):hover{border-color:var(--primary) !important;color:var(--primary) !important}
body .bt-chips button:not(.secondary):not(#_),
body .so-seg button:not(.secondary):not(#_),
body .sc-tabs button:not(.secondary):not(#_),
body .stock-workspace-tabs button:not(.secondary):not(#_),
body .config-workspace-tabs button:not(.secondary):not(#_){
  background:var(--primary) !important;color:#fff !important;border:1px solid var(--primary) !important
}
body .bt-chips button:not(#_) .bt-ico,
body .so-seg button:not(#_) .bt-ico{width:16px;height:16px;margin:0}
.bt-chips .seg-chip-ico,.so-seg .seg-chip-ico{display:inline-flex}
body .bt-chips button:not(.secondary):not(#_) .seg-chip-ico,
body .so-seg button:not(.secondary):not(#_) .seg-chip-ico{color:inherit !important}
/* le icone reparto non sono contatori: niente pallino rosso */
.so-seg button span.seg-chip-ico{min-width:0;padding:0;border-radius:0;background:none;font-size:inherit}
/* contatori nelle schede */
body .stock-workspace-tabs button:not(#_) span,
body .config-workspace-tabs button:not(#_) span,
body .sc-tabs button:not(#_) span{
  min-width:22px;height:20px;padding:0 7px;margin:0;border-radius:999px;display:inline-grid;place-items:center;
  font-size:11.5px;font-weight:800;background:var(--stat-track,#eef2f7);color:var(--text)
}
body .stock-workspace-tabs button:not(.secondary):not(#_) span,
body .config-workspace-tabs button:not(.secondary):not(#_) span,
body .sc-tabs button:not(.secondary):not(#_) span{background:rgba(255,255,255,.25);color:#fff}
body.bt-theme-dark .stock-workspace-tabs button.secondary:not(#_) span,
body.bt-theme-dark .config-workspace-tabs button.secondary:not(#_) span,
body.bt-theme-dark .sc-tabs button.secondary:not(#_) span{background:#2c2c2e;color:#f5f5f7}
@media (max-width:520px){
  body .bt-chips button:not(#_),
  body .stock-workspace-tabs button:not(#_),
  body .config-workspace-tabs button:not(#_){white-space:normal !important;flex:1 1 auto !important}
}

/* --- Tabelle: intestazioni piccole, numeri a destra, righe leggibili --- */
body .table th:not(#_){font-size:12px;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.02em;white-space:nowrap}
body .table td:not(#_){vertical-align:middle}
body .table th.num:not(#_),
body .table td.num:not(#_){text-align:right !important;font-variant-numeric:tabular-nums;white-space:nowrap}
body .crud-table td:not(#_){font-size:14px}

/* Pulsanti dentro le righe (Modifica / Elimina / Aggiungi): compatti come nelle schermate nuove */
body .action-stack button:not(#_),
body .category-actions-inline button:not(#_),
body .product-live-actions button:not(#_){
  min-height:36px !important;padding:6px 14px !important;font-size:13px !important;
  border-radius:999px !important;white-space:nowrap !important;width:auto !important
}
body .action-stack:not(#_),
body .category-actions-inline:not(#_){display:flex;flex-wrap:wrap;gap:6px}

/* --- Tema scuro --- */
body.bt-theme-dark .card h2 > .bt-ico{color:#4f9dff}
/* Tablet: Modifica/Elimina restano sulla stessa riga, righe tabella piu basse */
body .crud-table .action-stack:not(#_){flex-wrap:nowrap}

/* V9.29 - Tema scuro: testi poco leggibili trovati dopo il controllo di contrasto */
body.bt-theme-dark .stat-fin-table td:not(#_),
body.bt-theme-dark .stats-v2 table td:not(#_){color:var(--text) !important}
body.bt-theme-dark .role-box em:not(#_){color:var(--muted) !important}
body.bt-theme-dark .auto-margin-box:not(#_){background:rgba(255,255,255,.05) !important;border-color:var(--border) !important;color:var(--text) !important}
body.bt-theme-dark .auto-margin-box:not(#_) small{color:var(--muted) !important}
body .qk-panel .qk-chips button.on:not(#_) small{color:inherit !important;opacity:.75}
body .so-flag.muted:not(#_){color:#475569 !important;opacity:1}
body.bt-theme-dark .so-flag.muted:not(#_){color:#cbd5e1 !important;background:rgba(255,255,255,.08) !important}

/* V9.30 - Registro attività */
.log-panel h2{display:flex;align-items:center;gap:8px}
.log-panel .row .toolbar button{display:inline-flex;align-items:center;gap:6px}
.log-periods,.log-cats{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.log-periods button,.log-cats button{min-height:38px;padding:6px 12px;display:inline-flex;align-items:center;gap:6px}
.log-cats button span{display:inline-block;min-width:22px;padding:0 7px;border-radius:10px;background:rgba(0,0,0,.1);font-size:12px;font-variant-numeric:tabular-nums}
.log-custom{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin-top:10px}
.log-custom .form-field{margin:0}
.log-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin-top:14px}
.log-kpi{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:10px}
.log-kpi .bt-ico{width:22px;height:22px;color:var(--muted)}
.log-kpi b{display:block;font-size:20px;font-variant-numeric:tabular-nums}
.log-kpi span{color:var(--muted);font-size:12.5px}
.log-kpi.bad{border-color:#fca5a5;background:rgba(220,38,38,.06)}.log-kpi.bad .bt-ico,.log-kpi.bad b{color:#dc2626}
.log-kpi.warn{border-color:#fcd34d;background:rgba(217,119,6,.06)}.log-kpi.warn .bt-ico,.log-kpi.warn b{color:#b45309}
.log-filters{display:grid;grid-template-columns:200px 260px 1fr;gap:10px;margin-top:12px}
.log-filters .form-field{margin:0}
.log-filters select,.log-filters input{min-height:40px;margin:0;width:100%}
@media (max-width:760px){.log-filters{grid-template-columns:1fr}}
.log-table td{vertical-align:top}
.log-table .log-day td{background:var(--primary-soft);font-weight:800;text-transform:capitalize;font-size:13px;padding:6px 10px}
.log-table .log-dev{display:block;font-size:11.5px}
.log-table .badge{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.log-table .badge .bt-ico{width:14px;height:14px}
.log-table tr.log-danger td:first-child{box-shadow:inset 3px 0 0 #dc2626}
.log-table tr.log-warn td:first-child{box-shadow:inset 3px 0 0 #d97706}
.log-table .log-items{color:var(--muted);font-size:12.5px}
.log-table .log-bad{color:#dc2626;font-weight:700}
.backup-keep{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:6px}
.backup-keep button{display:inline-flex;align-items:center;gap:5px}

/* V9.32 - Gratta e Vinci rinnovato */
.gv-head h2{display:flex;align-items:center;gap:8px}
.gv-head .row>button{display:inline-flex;align-items:center;gap:6px}
.gv-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.gv-tabs button{display:inline-flex;align-items:center;gap:6px;min-height:42px;padding:6px 14px}
.gv-tabs button span{min-width:22px;padding:0 7px;border-radius:10px;background:rgba(0,0,0,.12);font-size:12px}
.gv-body{margin-top:16px}
.gv-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px}
.gv-kpi{display:flex;gap:12px;align-items:center;padding:14px;border-radius:12px;background:var(--card);border:1px solid var(--border)}
.gv-kpi .bt-ico{width:26px;height:26px;color:#059669}
.gv-kpi b{display:block;font-size:22px;font-variant-numeric:tabular-nums}
.gv-kpi span{color:var(--muted);font-size:13px}
.gv-kpi.warn{border-color:#fcd34d;background:rgba(217,119,6,.07)}.gv-kpi.warn .bt-ico{color:#d97706}
.gv-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0}
.gv-toolbar select{min-height:40px;margin:0;max-width:320px}
.gv-search{flex:1;min-width:180px;min-height:40px;margin:0}
.gv-games{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:12px}
.gv-game{display:flex;flex-direction:column;gap:8px;padding:14px;border-radius:12px;background:var(--card);border:1px solid var(--border);border-top:4px solid #059669}
.gv-game.warn{border-top-color:#d97706}.gv-game.bad{border-top-color:#dc2626}.gv-game.idle{border-top-color:#94a3b8}.gv-game.off{border-top-color:#cbd5e1;opacity:.75}
.gv-game-head{display:flex;justify-content:space-between;gap:8px}
.gv-game-head small{display:block;color:var(--muted);font-size:12px}
.gv-price{white-space:nowrap;align-self:flex-start;padding:3px 9px;border-radius:9px;background:#059669;color:#fff;font-weight:800;font-size:13px}
.gv-game-stock b{font-size:22px;font-variant-numeric:tabular-nums}
.gv-bar{height:7px;border-radius:5px;background:var(--stat-track,#e5e7eb);overflow:hidden}
.gv-bar i{display:block;height:100%;background:#059669;border-radius:5px}
.gv-game.warn .gv-bar i{background:#d97706}.gv-game.bad .gv-bar i{background:#dc2626}
.gv-game-nums{display:grid;grid-template-columns:1fr 1fr;gap:2px 10px;font-size:12.5px;color:var(--muted)}
.gv-game-nums b{color:var(--text)}
.gv-game-foot{display:flex;justify-content:space-between;align-items:center;gap:6px;flex-wrap:wrap;margin-top:auto}
.gv-game-foot button{display:inline-flex;align-items:center;gap:4px}
.gv-state{font-size:12px;font-weight:800;padding:2px 8px;border-radius:9px;background:#dcfce7;color:#166534}
.gv-state.warn{background:#fef3c7;color:#92400e}.gv-state.bad{background:#fee2e2;color:#b91c1c}.gv-state.idle,.gv-state.off{background:#e2e8f0;color:#475569}
.gv-load{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:16px;align-items:start}
.gv-load .gv-advanced{grid-column:1/-1}
.gv-load .gv-advanced summary{cursor:pointer;font-weight:700;display:flex;align-items:center;gap:6px}
@media (max-width:980px){.gv-load{grid-template-columns:1fr}}
.gv-mode{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}
.gv-mode button{display:inline-flex;align-items:center;gap:6px;min-height:42px}
.gv-scan{width:100%;min-height:56px;font-size:20px;font-weight:700;margin:8px 0;letter-spacing:.5px}
.gv-scan-msg{padding:10px 12px;border-radius:10px;background:var(--primary-soft);font-weight:700}
.gv-scan-msg.good{background:#dcfce7;color:#166534}.gv-scan-msg.bad{background:#fee2e2;color:#b91c1c}
.gv-seq{display:grid;grid-template-columns:2fr 1.2fr 1fr;gap:10px}
.gv-seq .form-field{margin:0}.gv-seq input,.gv-seq select{min-height:44px;margin:0;width:100%}
@media (max-width:640px){.gv-seq{grid-template-columns:1fr}}
.gv-quick{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}
.gv-seq-prev{margin:8px 0 12px;padding:10px 12px;border-radius:10px;background:var(--primary-soft)}
.gv-queue h2{display:flex;align-items:center;gap:8px}
.gv-queue-list{display:grid;gap:6px;margin-top:10px;max-height:460px;overflow:auto}
.gv-qrow{display:grid;grid-template-columns:110px minmax(0,1fr) auto auto 34px;gap:10px;align-items:center;padding:8px 10px;border:1px solid var(--border);border-radius:10px}
.gv-qrow .gv-qstate{font-size:12px;font-weight:800;padding:2px 8px;border-radius:9px;background:#dcfce7;color:#166534;text-align:center}
.gv-qrow.exists .gv-qstate{background:#e2e8f0;color:#475569}.gv-qrow.unknown .gv-qstate{background:#fee2e2;color:#b91c1c}
.gv-qrow.exists,.gv-qrow.unknown{opacity:.75}
@media (max-width:640px){.gv-qrow{grid-template-columns:1fr auto}}
.gv-last{margin-top:10px;padding:10px 12px;border-radius:10px;background:rgba(5,150,105,.08);font-size:13.5px}
.gv-views{display:flex;flex-wrap:wrap;gap:6px}
.gv-views button{min-height:40px}
.gv-views button span{min-width:22px;padding:0 7px;border-radius:10px;background:rgba(0,0,0,.12);font-size:12px}
.gv-books{display:grid;gap:8px;margin-top:10px}
.gv-book{display:grid;grid-template-columns:24px minmax(0,1fr) 110px auto;gap:12px;align-items:center;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--card)}
.gv-book.selected{border-color:#059669;box-shadow:0 0 0 2px rgba(5,150,105,.15)}
.gv-book input[type=checkbox]{width:18px;height:18px;margin:0}
.gv-book-main{cursor:pointer;min-width:0}
.gv-book-main small{display:block;color:var(--muted);font-size:12.5px;margin:2px 0 6px}
.gv-book-num{text-align:right}
.gv-book-num b{font-size:20px;font-variant-numeric:tabular-nums}
.gv-book-num small{display:block;color:var(--muted);font-size:12px}
.gv-book-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.gv-book-series{grid-column:1/-1}
@media (max-width:760px){.gv-book{grid-template-columns:24px minmax(0,1fr) 90px}.gv-book-actions{grid-column:1/-1;justify-content:flex-start}}
.gv-chip{font-size:11.5px;font-weight:800;padding:2px 8px;border-radius:9px;background:#dcfce7;color:#166534;vertical-align:middle}
.gv-chip.open{background:#dbeafe;color:#1e40af}.gv-chip.off{background:#e2e8f0;color:#475569}
.gv-games-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:16px;align-items:start}
@media (max-width:980px){.gv-games-layout{grid-template-columns:1fr}}
.gv-type-list{display:grid;gap:8px;margin-top:10px}
.gv-type{display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap;padding:10px 12px;border:1px solid var(--border);border-radius:10px}
.gv-type.off{opacity:.65}
.gv-type small{display:block;color:var(--muted);font-size:12.5px;margin-top:2px}
.gv-type-actions{display:flex;gap:6px;flex-wrap:wrap}
.scan-issue{display:flex;gap:12px;align-items:flex-start;flex-wrap:wrap;margin-bottom:12px;padding:12px 14px;border-radius:12px;border:2px solid #f59e0b;background:rgba(245,158,11,.08)}
.scan-issue>.bt-ico{width:26px;height:26px;color:#d97706;flex:0 0 auto}
.scan-issue>div:first-of-type{flex:1;min-width:200px}
.scan-issue b{display:block;font-size:15px}
.scan-issue span{color:var(--muted);font-size:13.5px}
.scan-issue-actions{display:flex;gap:6px;flex-wrap:wrap}
.scan-issue-actions button{display:inline-flex;align-items:center;gap:5px}
body.bt-theme-dark .gv-state:not(#_),body.bt-theme-dark .gv-chip:not(#_),body.bt-theme-dark .gv-qstate:not(#_){filter:brightness(.9)}

/* V9.33 - Struttura del codice Gratta e Vinci */
.gv-code-help{margin-top:12px;padding:12px;border-radius:12px;background:var(--primary-soft)}
.gv-code-help .form-field{margin:10px 0 6px}
.gv-code-layout{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;font-family:ui-monospace,Consolas,monospace;font-size:18px;font-weight:800}
.gv-seg{display:inline-flex;flex-direction:column;align-items:center;padding:6px 10px;border-radius:8px;color:#fff;letter-spacing:1px}
.gv-seg small{font-family:system-ui,sans-serif;font-size:10.5px;font-weight:700;letter-spacing:0;opacity:.9}
.gv-seg.pre{background:#7c3aed}.gv-seg.pack{background:#059669}.gv-seg.tic{background:#2563eb}.gv-seg.ext{background:#94a3b8}
.gv-code-warn{flex-basis:100%;margin-top:6px;padding:8px 10px;border-radius:8px;background:#fee2e2;color:#b91c1c;font-family:system-ui,sans-serif;font-size:13px;font-weight:700}
.gv-qrow.badlen .gv-qstate{background:#fef3c7;color:#92400e}.gv-qrow.badlen{opacity:.8}

/* V9.34 - Prodotti, Categorie, Nuovo prodotto, Movimenti, Utenti */
.ui-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap}
.ui-head h2{display:flex;align-items:center;gap:8px;margin:0 0 2px}
.ui-head>button{display:inline-flex;align-items:center;gap:6px}
.ui-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-top:14px}
.ui-kpi{padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--card)}
.ui-kpi b{display:block;font-size:20px;font-variant-numeric:tabular-nums}
.ui-kpi span{color:var(--muted);font-size:12.5px}
.ui-kpi.warn{border-color:#fcd34d;background:rgba(217,119,6,.07)}.ui-kpi.warn b{color:#b45309}
.ui-filters{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:14px 0 10px}
.ui-filters select{min-height:42px;margin:0;max-width:260px}
.ui-search{flex:1;min-width:220px;min-height:44px;margin:0;font-size:15px}
.ui-seg{display:inline-flex;gap:4px;padding:3px;border-radius:12px;background:var(--stat-track,#eef2f7)}
.ui-seg button{min-height:36px;padding:4px 14px;border-radius:9px !important;box-shadow:none !important}
.ui-seg button.secondary{background:transparent !important;border-color:transparent !important}
.ui-two{display:grid;grid-template-columns:minmax(300px,.85fr) minmax(0,1.6fr);gap:16px;align-items:start}
@media (max-width:980px){.ui-two{grid-template-columns:1fr}}
.ui-form-card h2{display:flex;align-items:center;gap:8px}
.ui-form-card .form-field{display:block;margin:10px 0}
.ui-form-card .form-field input,.ui-form-card .form-field select{width:100%;min-height:44px}
.ui-form-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.ui-form-actions button{display:inline-flex;align-items:center;gap:6px}
.ui-list{display:grid;gap:8px}
.ui-item{display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--card)}
.ui-item.off{opacity:.6}
.ui-item-main{flex:1;min-width:0}
.ui-item-main b{font-size:15px}
/* righe prodotto */
.pl-row{display:grid;grid-template-columns:minmax(0,1fr) 110px 150px auto;gap:14px;align-items:center;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--card);margin-bottom:8px}
.pl-row.pending{border-color:#f59e0b;box-shadow:0 0 0 2px rgba(245,158,11,.15)}
.pl-main b{font-size:15px}
.pl-meta{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:center;margin-top:4px;font-size:12.5px;color:var(--muted)}
.pl-dep{display:inline-flex;align-items:center;gap:5px;font-weight:800;color:var(--dep)}
.pl-dep::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--dep)}
.pl-code{display:inline-flex;align-items:center;gap:4px;padding:1px 7px;border-radius:7px;background:var(--stat-track,#eef2f7);color:var(--text);font-size:11.5px}
.pl-code .bt-ico{width:12px;height:12px}
.pl-pending{color:#b45309;font-weight:700}
.pl-price{text-align:right}
.pl-price b{display:block;font-size:17px;font-variant-numeric:tabular-nums}
.pl-price small{color:var(--muted);font-size:12px}
.pl-actions{display:flex;gap:6px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.pl-ico{width:40px;height:40px;min-height:40px;padding:0 !important;display:inline-flex;align-items:center;justify-content:center}
.pl-ico .bt-ico{width:18px;height:18px}
.pl-alert{display:inline-flex;align-items:center;gap:7px;min-height:36px;padding:4px 10px !important;border-radius:20px !important;font-size:12.5px;background:#dcfce7 !important;color:#166534 !important;border:1px solid #86efac !important;box-shadow:none !important}
.pl-alert i{width:26px;height:15px;border-radius:9px;background:#16a34a;position:relative}
.pl-alert i::after{content:"";position:absolute;top:2px;right:2px;width:11px;height:11px;border-radius:50%;background:#fff}
.pl-alert.off{background:#f1f5f9 !important;color:#475569 !important;border-color:#cbd5e1 !important}
.pl-alert.off i{background:#94a3b8}.pl-alert.off i::after{right:auto;left:2px}
.pl-alert.pending{outline:2px dashed #f59e0b;outline-offset:2px}
@media (max-width:900px){.pl-row{grid-template-columns:minmax(0,1fr) 100px}.pl-stock{grid-column:1/2}.pl-actions{grid-column:1/-1;justify-content:flex-start}}
/* nuovo prodotto */
.np-form .np-sec{margin-top:14px;padding:14px;border:1px solid var(--border);border-radius:12px}
.np-form .np-sec h3{display:flex;align-items:center;gap:8px;margin:0 0 10px;font-size:15px}
.np-form .np-sec h3>span{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:var(--primary,#2563eb);color:#fff;font-size:13px}
.np-form .np-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:10px}
.np-form .np-wide{grid-column:1/-1}
.np-form .np-save{position:sticky;bottom:0;display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:14px;padding:12px;border-radius:12px;background:var(--card);border:1px solid var(--border);box-shadow:0 -6px 18px rgba(15,23,42,.06)}
.np-form .np-save button{display:inline-flex;align-items:center;gap:6px;min-height:46px;padding:8px 22px}
/* movimenti */
.movement-more-filters{margin-top:10px;border:1px solid var(--border);border-radius:12px;padding:8px 12px}
.movement-more-filters summary{cursor:pointer;font-weight:700;display:flex;align-items:center;gap:6px;padding:4px 0}
.movement-more-filters[open] summary{margin-bottom:8px}
/* utenti */
.ui-role-pick{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;margin-top:6px}
.ui-role-pick button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;min-height:64px;padding:8px 10px !important;background:var(--card) !important;color:var(--text) !important;border:1px solid var(--border) !important;border-left:4px solid var(--role) !important;box-shadow:none !important}
.ui-role-pick button small{color:var(--muted);font-size:11.5px;font-weight:400;line-height:1.3}
.ui-role-pick button.on{background:color-mix(in srgb,var(--role) 10%,var(--card)) !important;border-color:var(--role) !important;box-shadow:0 0 0 2px color-mix(in srgb,var(--role) 25%,transparent) !important}
.ui-hidden-select{display:none !important}
.ui-role-pages{margin:10px 0;padding:10px;border-radius:10px;background:var(--primary-soft)}
.ui-role-pages>div{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
.ui-avatar{flex:0 0 auto;width:42px;height:42px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:var(--role);color:#fff;font-weight:800}
.ui-roles-matrix{margin-top:16px}
.ui-roles-matrix summary{cursor:pointer;font-weight:700;display:flex;align-items:center;gap:6px}
.ui-roles-matrix .ui-check{text-align:center;color:#059669;font-weight:800}
body.bt-theme-dark .pl-alert:not(#_){background:rgba(22,163,74,.15) !important;color:#86efac !important;border-color:rgba(134,239,172,.4) !important}
body.bt-theme-dark .pl-alert.off:not(#_){background:rgba(148,163,184,.12) !important;color:#cbd5e1 !important;border-color:rgba(203,213,225,.3) !important}
body.bt-theme-dark .pl-code:not(#_){background:rgba(255,255,255,.09) !important;color:var(--text) !important}
body.bt-theme-dark .ui-seg:not(#_){background:rgba(255,255,255,.07)}

/* V9.35 - Scelta del ruolo: elenco pulito con icona, descrizione completa e spunta */
.ui-role-pick:not(#_){display:flex;flex-direction:column;gap:8px;margin-top:8px}
.ui-role-opt{display:grid;grid-template-columns:40px minmax(0,1fr) auto 26px;align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--card);cursor:pointer;transition:border-color .15s,background .15s,box-shadow .15s}
.ui-role-opt:hover{border-color:var(--role)}
.ui-role-opt:focus-visible{outline:2px solid var(--role);outline-offset:2px}
.ui-role-dot{width:40px;height:40px;border-radius:11px;display:inline-flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--role) 14%,transparent);color:var(--role)}
.ui-role-dot .bt-ico{width:20px;height:20px}
.ui-role-text{min-width:0}
.ui-role-text b{display:block;font-size:14.5px;color:var(--text)}
.ui-role-text small{display:block;margin-top:2px;color:var(--muted);font-size:12.5px;line-height:1.35;white-space:normal}
.ui-role-count{font-size:11.5px;font-weight:700;color:var(--muted);white-space:nowrap}
.ui-role-check{width:26px;height:26px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;border:2px solid var(--border);color:transparent}
.ui-role-check .bt-ico{width:15px;height:15px}
.ui-role-opt.on{border-color:var(--role);background:color-mix(in srgb,var(--role) 7%,var(--card));box-shadow:0 0 0 3px color-mix(in srgb,var(--role) 18%,transparent)}
.ui-role-opt.on .ui-role-dot{background:var(--role);color:#fff}
.ui-role-opt.on .ui-role-check{background:var(--role);border-color:var(--role);color:#fff}
.ui-role-pages:not(#_){margin:12px 0;padding:12px;border-radius:12px;background:var(--primary-soft);border:1px dashed var(--border)}
.ui-role-pages-head{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--text)}
.ui-role-pages-head .bt-ico{width:15px;height:15px;color:var(--muted)}
.ui-role-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.ui-role-tabs span{display:inline-flex;align-items:center;gap:5px;padding:4px 9px;border-radius:8px;background:var(--card);border:1px solid var(--border);font-size:12.5px;font-weight:600;color:var(--text)}
.ui-role-tabs .bt-ico{width:14px;height:14px;color:var(--muted)}
@media (max-width:520px){.ui-role-opt{grid-template-columns:36px minmax(0,1fr) 24px}.ui-role-count{display:none}}

/* V9.37 - Icona dell'app nel logo */
.app-logo:not(#_){background:transparent !important;box-shadow:none !important;padding:0 !important;overflow:hidden;color:transparent}
.app-logo:not(#_) img{display:block;width:100%;height:100%;object-fit:contain}

/* V9.39 - Doppioni da unire */
.sc-dup:not(#_){display:grid;gap:6px}
.sc-dup-row{display:grid;grid-template-columns:22px minmax(0,1fr) auto 64px;gap:10px;align-items:center;padding:8px 10px;border:1px solid var(--border);border-radius:10px;cursor:pointer;background:var(--card)}
.sc-dup-row input{width:18px;height:18px;margin:0}
.sc-dup-row.keep{border-color:#059669;background:rgba(5,150,105,.06)}
.sc-dup-main b{display:block}
.sc-dup-main small,.sc-dup-num small{display:block;color:var(--muted);font-size:12px}
.sc-dup-num{text-align:right;font-weight:700}
.sc-dup-tag{font-size:12px;font-weight:800;text-align:center;padding:2px 6px;border-radius:8px;background:#fee2e2;color:#b91c1c}
.sc-dup-row.keep .sc-dup-tag{background:#dcfce7;color:#166534}
.sc-dup-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:2px}
.sc-dup-actions button{display:inline-flex;align-items:center;gap:5px}

/* V9.40 - Controllo completo */
.fullcheck{margin:14px 0;padding:14px;border:1px solid var(--border);border-radius:12px;background:var(--card)}
.fullcheck h3{display:flex;align-items:center;gap:6px;margin:0 0 4px}
.fullcheck .ui-head>button{display:inline-flex;align-items:center;gap:6px}
.fullcheck-sum{display:flex;align-items:center;gap:8px;margin-top:12px;padding:10px 12px;border-radius:10px;font-weight:800}
.fullcheck-sum.good{background:#dcfce7;color:#166534}.fullcheck-sum.bad{background:#fee2e2;color:#b91c1c}
.fullcheck-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:6px;margin-top:10px}
.fullcheck-row{display:grid;grid-template-columns:12px minmax(0,1fr) auto;gap:8px;align-items:center;padding:7px 10px;border:1px solid var(--border);border-radius:9px;font-size:13px}
.fullcheck-row small{display:block;color:var(--muted);font-size:11.5px}
.fullcheck-dot{width:10px;height:10px;border-radius:50%;background:#16a34a}
.fullcheck-row.ko{border-color:#fca5a5;background:rgba(220,38,38,.05)}.fullcheck-row.ko .fullcheck-dot{background:#dc2626}

/* V9.41 - Conti aperti e Resi */
.conti-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px;margin-top:16px}
.conto-card{display:flex;flex-direction:column;gap:10px}
.conto-card.locked{opacity:.75}
.conto-head{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}
.conto-head h3{margin:0}
.conto-total{display:flex;justify-content:space-between;align-items:baseline;padding:12px 14px;border-radius:12px;background:var(--primary-soft)}
.conto-total span{color:var(--muted);font-weight:700}
.conto-total b{font-size:30px;font-variant-numeric:tabular-nums}
.conto-items{display:grid;gap:4px;font-size:14px}
.conto-items>div{display:flex;justify-content:space-between;gap:10px;padding:4px 0;border-bottom:1px dashed var(--border)}
.conto-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:auto}
.conto-actions button{display:inline-flex;align-items:center;gap:6px}
.ui-empty{display:flex;flex-direction:column;align-items:center;gap:6px;padding:30px;text-align:center}
.ui-empty .bt-ico{width:34px;height:34px;color:var(--muted)}
.ret-mode{margin:6px 0 4px}
.ret-code{display:flex;gap:8px}
.ret-code input{flex:1}
.ret-code button{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.ret-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* V9.42 - Azioni sui singoli doppioni */
.sc-dup-row:not(#_){grid-template-columns:22px minmax(0,1fr) auto 64px auto}
.sc-dup-main{cursor:pointer}
.sc-dup-tools{display:flex;gap:6px;align-items:center}
.sc-dup-tools .pl-ico{width:36px;height:36px;min-height:36px}
.sc-dup-tools button[disabled]{opacity:.35;cursor:not-allowed}
.sc-dup-actions small{flex-basis:100%}
@media (max-width:760px){.sc-dup-row:not(#_){grid-template-columns:22px minmax(0,1fr) 64px}.sc-dup-num{grid-column:2}.sc-dup-tools{grid-column:1/-1;justify-content:flex-end}}

/* V9.43 - Controllo prima della conferma degli import */
.bt-review-overlay{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(15,23,42,.55);backdrop-filter:blur(2px)}
.bt-review{width:min(860px,100%);max-height:calc(100vh - 32px);overflow:auto;padding:18px;border-radius:16px;background:var(--card,#fff);color:var(--text);box-shadow:0 24px 60px rgba(0,0,0,.3)}
.bt-review-head{display:flex;gap:12px;align-items:flex-start}
.bt-review-head>.bt-ico{width:30px;height:30px;color:var(--primary,#2563eb);flex:0 0 auto}
.bt-review-head h2{margin:0}
.bt-review-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px;margin:14px 0}
.bt-review-kpis>div{padding:10px 12px;border:1px solid var(--border);border-radius:10px}
.bt-review-kpis b{display:block;font-size:20px;font-variant-numeric:tabular-nums}
.bt-review-kpis span{color:var(--muted);font-size:12.5px}
.bt-review-block{margin:10px 0;padding:10px 12px;border-radius:10px}
.bt-review-block>b{display:flex;align-items:center;gap:6px}
.bt-review-block ul{margin:6px 0 0 18px;padding:0;font-size:13.5px;line-height:1.5}
.bt-review-block.bad{background:#fee2e2;color:#7f1d1d}.bt-review-block.warn{background:#fef3c7;color:#78350f}.bt-review-block.good{background:#dcfce7;color:#14532d}
.bt-review-ack{display:flex;align-items:center;gap:8px;margin-top:10px;font-weight:700}
.bt-review-ack input{width:18px;height:18px;margin:0}
.bt-review-rows{margin-top:10px}
.bt-review-rows summary{cursor:pointer;font-weight:700}
.bt-review-rows .tablewrap{max-height:300px;overflow:auto;margin-top:8px}
.bt-review-rows tr.bad td{background:rgba(220,38,38,.08)}.bt-review-rows tr.warn td{background:rgba(217,119,6,.08)}
.bt-review-note{margin-top:8px}
.bt-review-actions{position:sticky;bottom:-18px;display:flex;justify-content:flex-end;gap:8px;margin:14px -18px -18px;padding:12px 18px;background:var(--card,#fff);border-top:1px solid var(--border)}
.bt-review-actions button{display:inline-flex;align-items:center;gap:6px;min-height:44px}
body.bt-theme-dark .bt-review-block.bad{background:rgba(220,38,38,.18);color:#fecaca}
body.bt-theme-dark .bt-review-block.warn{background:rgba(217,119,6,.18);color:#fde68a}
body.bt-theme-dark .bt-review-block.good{background:rgba(22,163,74,.18);color:#bbf7d0}

/* V9.44 - Avvisi e conferme del gestionale */
.bt-dialog-overlay{position:fixed;inset:0;z-index:11000;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(15,23,42,.5);backdrop-filter:blur(2px);animation:btFade .12s ease-out}
.bt-dialog-overlay.closing{opacity:0;transition:opacity .12s}
@keyframes btFade{from{opacity:0}to{opacity:1}}
@keyframes btPop{from{transform:translateY(8px) scale(.98);opacity:0}to{transform:none;opacity:1}}
.bt-dialog{width:min(480px,100%);display:grid;grid-template-columns:48px minmax(0,1fr);gap:4px 14px;padding:20px;border-radius:16px;background:var(--card,#fff);color:var(--text);box-shadow:0 24px 60px rgba(0,0,0,.28);border-top:5px solid var(--dlg,#2563eb);animation:btPop .14s ease-out}
.bt-dialog.success{--dlg:#16a34a}.bt-dialog.warn{--dlg:#d97706}.bt-dialog.danger{--dlg:#dc2626}.bt-dialog.info{--dlg:#2563eb}
.bt-dialog-ico{width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--dlg) 14%,transparent);color:var(--dlg)}
.bt-dialog-ico .bt-ico{width:24px;height:24px}
.bt-dialog-body h3{margin:2px 0 6px;font-size:17px;line-height:1.3}
.bt-dialog-msg{font-size:14.5px;line-height:1.5;color:var(--text);max-height:50vh;overflow:auto;word-break:break-word}
.bt-dialog-body h3+.bt-dialog-msg{color:var(--muted)}
.bt-dialog-input{width:100%;min-height:44px;margin:12px 0 0}
.bt-dialog-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
.bt-dialog-actions button{min-width:110px;min-height:44px}
@media (max-width:480px){.bt-dialog{grid-template-columns:1fr}.bt-dialog-ico{display:none}.bt-dialog-actions button{flex:1}}
/* V9.45b - rinforzo contro le regole vecchie del conto */
.conto-card .conto-item:not(#_){display:grid !important;grid-template-columns:34px minmax(0,1fr) auto !important;text-align:left !important}
.conto-card .conto-item .conto-name:not(#_){display:block !important;text-align:left !important;min-width:0}
.conto-card .conto-item .conto-name b:not(#_){display:block !important;white-space:nowrap !important;overflow:hidden !important;text-overflow:ellipsis !important;text-align:left !important}
.conto-card .conto-item .conto-name small:not(#_){display:block !important;white-space:nowrap !important;overflow:hidden !important;text-overflow:ellipsis !important;text-align:left !important;margin-top:1px}
.conto-card .conto-actions .conto-del:not(#_){background:transparent !important;color:#dc2626 !important;border:1px solid #fca5a5 !important;box-shadow:none !important;flex:0 0 44px !important}
.conto-card .conto-actions .conto-del:not(#_):hover{background:#fee2e2 !important}
.conto-card .conto-actions .conto-del:not(#_)[disabled]{opacity:.4}
body.bt-theme-dark .conto-card .conto-actions .conto-del:not(#_){border-color:rgba(248,113,113,.5) !important;color:#f87171 !important}

/* V9.46 - Conti aperti: elenco + dettaglio */
.cn-top .ui-head>button{display:inline-flex;align-items:center;gap:6px}
.cn-layout{display:grid;grid-template-columns:minmax(300px,380px) minmax(0,1fr);gap:16px;margin-top:16px;align-items:start}
@media (max-width:900px){.cn-layout{grid-template-columns:1fr}}
.cn-list{padding:12px !important;position:sticky;top:12px}
.cn-tools{display:grid;gap:8px;margin-bottom:10px}
.cn-tools .ui-seg{justify-self:start}
.cn-rows{display:grid;gap:6px;max-height:62vh;overflow:auto;padding-right:2px}
.cn-row:not(#_){display:grid;grid-template-columns:10px minmax(0,1fr) auto;gap:10px;align-items:center;width:100%;min-height:58px;padding:10px 12px !important;border-radius:12px !important;background:var(--card) !important;color:var(--text) !important;border:1px solid var(--border) !important;box-shadow:none !important;text-align:left;font-weight:400}
.cn-row:not(#_):hover{border-color:#94a3b8 !important}
.cn-row.on:not(#_){border-color:var(--primary,#2563eb) !important;background:color-mix(in srgb,var(--primary,#2563eb) 7%,var(--card)) !important;box-shadow:0 0 0 2px color-mix(in srgb,var(--primary,#2563eb) 20%,transparent) !important}
.cn-dot{width:10px;height:10px;border-radius:50%;background:#16a34a}
.cn-row.qr .cn-dot{background:#2563eb}.cn-row.lock .cn-dot{background:#d97706}
.cn-row-main{min-width:0}
.cn-row-main b{display:block;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cn-row-main small{display:block;color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cn-row-main em{font-style:normal;color:#b45309;font-weight:700}
.cn-row-total{font-size:16px;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap}
.cn-detail{padding:18px !important;display:flex;flex-direction:column;gap:14px}
.cn-d-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.cn-d-head h2{margin:0;font-size:22px}
.cn-badge{font-size:12px;font-weight:800;padding:4px 10px;border-radius:20px;background:#dcfce7;color:#166534;white-space:nowrap}
.cn-badge.qr{background:#dbeafe;color:#1e40af}.cn-badge.lock{background:#fef3c7;color:#92400e}
.cn-d-items{border:1px solid var(--border);border-radius:12px;overflow:hidden}
.cn-d-row{display:grid;grid-template-columns:52px minmax(0,1fr) 90px 100px;gap:10px;align-items:center;padding:10px 14px;border-bottom:1px solid var(--border)}
.cn-d-row:last-child{border-bottom:0}
.cn-d-th{background:var(--stat-track,#f1f5f9);font-size:11.5px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);padding:8px 14px}
.cn-d-th span:nth-child(3),.cn-d-th span:nth-child(4),.cn-p,.cn-t{text-align:right}
.cn-q{font-weight:800;font-variant-numeric:tabular-nums}
.cn-n{min-width:0}
.cn-n b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14.5px}
.cn-n small{display:block;color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cn-p{color:var(--muted);font-variant-numeric:tabular-nums}
.cn-t{font-weight:800;font-variant-numeric:tabular-nums}
@media (max-width:560px){.cn-d-row{grid-template-columns:40px minmax(0,1fr) 84px}.cn-p,.cn-d-th span:nth-child(3){display:none}}
.cn-d-sum{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-radius:12px;background:var(--primary-soft)}
.cn-d-sum>span{color:var(--muted);font-weight:700}
.cn-d-sum small{display:block;text-align:right;color:var(--muted);font-size:12px;font-weight:700}
.cn-d-sum b{display:block;font-size:32px;font-variant-numeric:tabular-nums;line-height:1.1}
.cn-d-actions{display:flex;flex-wrap:wrap;gap:8px}
.cn-d-actions button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:48px}
.cn-d-actions .cn-main{flex:1 1 240px;font-size:16px}
.cn-d-actions .cn-del:not(#_){background:transparent !important;color:#dc2626 !important;border:1px solid #fca5a5 !important;box-shadow:none !important}
.cn-d-actions .cn-del:not(#_):hover{background:#fee2e2 !important}
.cn-lock-note{display:flex;align-items:center;gap:6px;margin:0}
.cn-empty button{display:inline-flex;align-items:center;gap:6px;margin-top:8px}
body.bt-theme-dark .cn-badge:not(#_){filter:brightness(.92)}
body.bt-theme-dark .cn-d-actions .cn-del:not(#_){border-color:rgba(248,113,113,.5) !important;color:#f87171 !important}
.cn-row:not(#_) .cn-row-main,.cn-row:not(#_) .cn-row-main b,.cn-row:not(#_) .cn-row-main small{text-align:left !important;justify-self:stretch}
.cn-row:not(#_) .cn-row-total{justify-self:end}
.cn-rows .cn-row:not(#_){display:grid !important;grid-template-columns:10px minmax(0,1fr) auto !important;justify-content:stretch !important;justify-items:stretch !important;text-align:left !important}
body.bt-theme-dark .cn-d-th:not(#_){background:rgba(255,255,255,.06);color:var(--muted)}
body.bt-theme-dark .cn-d-row:not(#_){border-bottom-color:rgba(255,255,255,.08)}

/* V9.47 - Movimenti */
.mv-top .ui-head>button{display:inline-flex;align-items:center;gap:6px}
.mv-period{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:12px}
.mv-date{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;color:var(--muted)}
.mv-date input{min-height:40px;margin:0;width:auto}
.mv-del{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;color:var(--muted);cursor:pointer}
.mv-del input{width:18px;height:18px;margin:0}
.mv-list-card{margin-top:16px}
.mv-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.mv-types{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 4px}
.mv-types button:not(#_){min-height:34px;padding:4px 12px !important;border-radius:20px !important;background:var(--card) !important;color:var(--text) !important;border:1px solid var(--border) !important;box-shadow:none !important;font-size:13px}
.mv-types button.on:not(#_){background:var(--primary,#2563eb) !important;color:#fff !important;border-color:var(--primary,#2563eb) !important}
.mv-types button span{margin-left:4px;font-size:11.5px;opacity:.75}
.mv-days{display:grid;gap:14px;margin-top:12px}
.mv-day{border:1px solid var(--border);border-radius:12px;overflow:hidden}
.mv-day-head{display:flex;justify-content:space-between;flex-wrap:wrap;gap:6px 12px;align-items:baseline;padding:9px 14px;background:var(--primary-soft);font-size:13px}
.mv-day-head>b{text-transform:capitalize;font-size:14px}
.mv-day-head span{color:var(--muted)}
.mv-day-head span b{color:var(--text)}
.mv-row{display:grid;grid-template-columns:48px 118px minmax(0,1fr) 60px 120px 112px 88px;gap:10px;align-items:center;padding:9px 14px;border-top:1px solid var(--border)}
.mv-row:hover{background:color-mix(in srgb,var(--primary,#2563eb) 4%,transparent)}
.mv-row.deleted{opacity:.55}
.mv-row.deleted .mv-prod b{text-decoration:line-through}
.mv-time{font-weight:800;font-variant-numeric:tabular-nums;color:var(--muted)}
.mv-type{justify-self:start;white-space:nowrap;font-size:11.5px}
.mv-prod{min-width:0}
.mv-prod b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}
.mv-prod small{display:block;color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mv-qty{text-align:right;font-weight:800;font-variant-numeric:tabular-nums}
.mv-qty small,.mv-tot small{display:block;font-size:11.5px;font-weight:600;color:var(--muted)}
.mv-tot{text-align:right;font-weight:800;font-variant-numeric:tabular-nums}
.mv-tot small.pos{color:#16a34a}.mv-tot small.neg{color:#dc2626}
.mv-pay{display:inline-flex;align-items:center;gap:5px;justify-self:start;font-size:12.5px;font-weight:700;padding:3px 9px;border-radius:20px;background:var(--stat-track,#f1f5f9);color:var(--text)}
.mv-pay .bt-ico{width:14px;height:14px}
.mv-pay.contanti{background:#dcfce7;color:#166534}.mv-pay.pos{background:#dbeafe;color:#1e40af}.mv-pay.misto{background:#ede9fe;color:#5b21b6}.mv-pay.distributore{background:#cffafe;color:#155e75}
.mv-act{display:flex;gap:6px;justify-content:flex-end}
.mv-act .pl-ico{width:36px;height:36px;min-height:36px}
@media (max-width:980px){.mv-row{grid-template-columns:44px minmax(0,1fr) 100px;grid-template-areas:"time prod tot" "type pay act"}.mv-time{grid-area:time}.mv-prod{grid-area:prod}.mv-tot{grid-area:tot}.mv-type{grid-area:type}.mv-pay{grid-area:pay}.mv-act{grid-area:act}.mv-qty{display:none}}
.mv-edit{padding:14px;border-top:1px solid var(--border);background:color-mix(in srgb,#f59e0b 7%,var(--card))}
.mv-edit-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px}
.mv-edit-head b{display:inline-flex;align-items:center;gap:6px}
.mv-edit-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.mv-edit-grid .form-field{margin:0}
.mv-edit-grid input,.mv-edit-grid select{width:100%;min-height:40px;margin:0}
.mv-edit-grid .mv-wide{grid-column:span 2}
body.bt-theme-dark .mv-pay:not(#_){filter:brightness(.9)}
.mv-edit-hint{display:flex;gap:6px;align-items:flex-start;padding:8px 10px;border-radius:8px;background:var(--primary-soft);font-size:13px;grid-column:1/-1}
.mv-edit-hint .bt-ico{width:16px;height:16px;flex:0 0 auto;margin-top:1px}

/* V9.49 - Avvisi dashboard che portano al punto giusto */
.dash-alert .dash-alert-go{margin-left:auto;align-self:center;white-space:nowrap;font-style:normal;font-size:12px;font-weight:800;color:var(--primary,#2563eb)}
.gv-only{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0;padding:10px 12px;border-radius:10px;background:#fef3c7;color:#78350f;font-size:13.5px}
.gv-only .bt-ico{width:16px;height:16px}
.gv-only button{margin-left:auto}
body.bt-theme-dark .gv-only{background:rgba(217,119,6,.18);color:#fde68a}
.dash-alerts .dash-alert:not(#_){display:flex !important;flex-wrap:nowrap !important;align-items:center;gap:10px}
.dash-alerts .dash-alert:not(#_)>span{flex:1 1 auto;min-width:0}
.dash-alerts .dash-alert:not(#_)>span small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-alerts .dash-alert:not(#_) .dash-alert-go{flex:0 0 auto}
body .dash-alerts button.dash-alert:not(#_):not(#__){grid-template-columns:28px minmax(0,1fr) auto !important;align-items:center}
body .dash-alerts button.dash-alert:not(#_):not(#__) .dash-alert-go{grid-column:3;grid-row:1}
