/* 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}
