﻿/* Categorie, statistiche, utenti, dispositivi
   Estratto da assets/style.css per rendere il progetto piu manutenibile. */

/* V5.33 - Categorie prodotti multiple */
.category-picker{
  grid-column:1/-1;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:10px;
  border:1px solid #dbe4f0;
  background:#f8fafc;
  border-radius:16px;
}
.category-picker button{
  border:1px solid #cbd5e1;
  background:#fff;
  color:#0f172a;
  border-radius:999px;
  padding:8px 12px;
  font-weight:800;
  cursor:pointer;
}
.category-picker button.active{
  background:#0f172a;
  color:#fff;
  border-color:#0f172a;
}
.category-manual{
  grid-column:1/-1;
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto;
  gap:10px;
}
.selected-categories{
  grid-column:1/-1;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  min-height:38px;
  align-items:center;
}
.selected-categories span{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border-radius:999px;
  background:#dcfce7;
  color:#166534;
  padding:7px 10px;
  font-weight:900;
}
.selected-categories span button{
  border:0;
  background:transparent;
  color:#166534;
  font-size:18px;
  cursor:pointer;
  line-height:1;
}
@media(max-width:700px){
  .category-manual{
    grid-template-columns:1fr;
  }
}


/* V5.33 FIX - Menu categorie + select categoria prodotto */
.field-label{
  display:block;
  font-size:12px;
  font-weight:900;
  color:#475569;
  margin-bottom:6px;
}
select#p_category{
  width:100%;
  min-height:44px;
  border:2px solid #cbd5e1;
  border-radius:14px;
  padding:8px 12px;
  background:#fff;
  font-weight:800;
}
select#p_category:focus{
  outline:none;
  border-color:#0f172a;
  box-shadow:0 0 0 4px rgba(15,23,42,.12);
}


/* V5.33 FIX vero - select categoria nel nuovo prodotto */
.category-select-field{
  display:block;
}
.category-select-field select,
#np_category{
  width:100%;
  min-height:54px;
  border:2px solid #cbd5e1;
  border-radius:16px;
  padding:0 16px;
  background:#fff;
  color:#0f172a;
  font-size:16px;
  font-weight:800;
}
.category-select-field select:focus,
#np_category:focus{
  outline:none;
  border-color:#2563eb;
  box-shadow:0 0 0 4px rgba(37,99,235,.16);
}
.field-label{
  display:block;
  margin-bottom:6px;
  font-size:13px;
  font-weight:900;
  color:#475569;
}


/* V5.33 FIX - ricerca prodotti stabile */
.product-search-panel{
  display:grid;
  grid-template-columns:minmax(260px,1fr) 220px auto;
  gap:10px;
  margin-top:14px;
  align-items:center;
}
.product-search-panel input,
.product-search-panel select{
  min-height:48px;
  border:2px solid #cbd5e1;
  border-radius:14px;
  padding:0 14px;
  background:#fff;
  font-size:16px;
  font-weight:800;
}
.product-search-panel input:focus,
.product-search-panel select:focus{
  outline:none;
  border-color:#2563eb;
  box-shadow:0 0 0 4px rgba(37,99,235,.16);
}
.products-live-results{
  margin-top:16px;
  display:grid;
  gap:10px;
}
.product-live-card{
  display:grid;
  grid-template-columns:minmax(240px,1fr) 140px auto;
  gap:12px;
  align-items:center;
  border:1px solid #dbe4f0;
  background:#fff;
  border-radius:16px;
  padding:12px;
}
.product-live-price{
  text-align:right;
}
.product-live-price small{
  display:block;
  color:#64748b;
  font-weight:800;
}
.product-live-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
}
.empty-search-result{
  border:1px dashed #cbd5e1;
  border-radius:16px;
  padding:18px;
  color:#64748b;
  background:#f8fafc;
  font-weight:800;
}
@media(max-width:800px){
  .product-search-panel,
  .product-live-card{
    grid-template-columns:1fr;
  }
  .product-live-price{
    text-align:left;
  }
  .product-live-actions{
    justify-content:flex-start;
  }
}


/* V5.33 FIX - ricerche stabili */
.crud-search-bar input,
.service-search-bar input,
.product-search-panel input{
  caret-color:#2563eb;
}
.crud-search-bar input:focus,
.service-search-bar input:focus,
.product-search-panel input:focus{
  border-color:#2563eb!important;
  box-shadow:0 0 0 4px rgba(37,99,235,.16)!important;
}
.crud-table tbody tr{
  transition:background .12s ease;
}


/* V5.33 - pannello modifica prodotto */
.edit-product-panel{
  border:2px solid #2563eb;
  box-shadow:0 16px 40px rgba(37,99,235,.14);
  margin-bottom:16px;
}
.edit-product-panel .field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.edit-product-panel label{
  font-size:13px;
  font-weight:900;
  color:#475569;
}
.edit-product-panel input,
.edit-product-panel select{
  min-height:48px;
  border:2px solid #cbd5e1;
  border-radius:14px;
  padding:0 12px;
  background:#fff;
  font-size:15px;
  font-weight:800;
}
.edit-product-panel input:focus,
.edit-product-panel select:focus{
  outline:none;
  border-color:#2563eb;
  box-shadow:0 0 0 4px rgba(37,99,235,.16);
}
.edit-product-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:16px;
}
.product-live-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}
.stock-workspace-head{
  margin-bottom:14px;
}
.stock-workspace-tabs{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-top:14px;
}
.stock-workspace-tabs button{
  min-height:54px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid #cbd5e1;
}
.stock-workspace-tabs button.active{
  background:#0f172a;
  color:#fff;
  border-color:#0f172a;
}
.stock-workspace-tabs button span{
  min-width:24px;
  height:24px;
  display:inline-grid;
  place-items:center;
  border-radius:999px;
  background:rgba(15,23,42,.08);
  padding:0 8px;
  font-size:12px;
  font-weight:1000;
}
.stock-workspace-tabs button.active span{
  background:rgba(255,255,255,.18);
  color:#fff;
}
.product-workspace-tabs{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.stock-tool-card{
  margin-top:0;
}
.product-live-card-pending{
  border-color:#fbbf24;
  background:#fffbeb;
}
.product-low-stock-select{
  width:auto;
  min-width:170px;
  height:40px;
  min-height:40px;
  border-radius:10px;
  font-size:13px;
  font-weight:900;
}
.product-low-stock-select.pending{
  border-color:#f59e0b;
  background:#fff7ed;
  color:#92400e;
}
.product-bulk-panel{
  position:sticky;
  bottom:12px;
  z-index:12;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:2px solid #c7d2fe;
  background:#eef2ff;
  color:#1e293b;
  border-radius:16px;
  padding:12px;
  box-shadow:0 14px 30px rgba(30,41,59,.12);
}
.product-bulk-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}
.product-checkbox-field{
  min-height:54px;
  margin:0;
  padding:10px 12px;
  gap:10px;
}
.product-checkbox-field span{
  font-weight:900;
}
.product-checkbox-field input[type="checkbox"]{
  width:20px;
  height:20px;
  min-width:20px;
  flex:0 0 auto;
}
.catalog-import-table .table{
  min-width:1380px;
}
.catalog-pagination{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:10px;
  padding:10px 12px;
  border:1px solid #dbe4f0;
  border-radius:14px;
  background:#f8fafc;
  color:#334155;
  font-size:13px;
  font-weight:800;
}
.catalog-pagination-top{
  position:sticky;
  top:66px;
  z-index:17;
  box-shadow:0 12px 24px rgba(15,23,42,.10);
}
.catalog-page-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:8px;
}
.catalog-page-size{
  width:auto;
  min-width:120px;
  height:38px;
  min-height:38px;
  border-radius:10px;
  font-size:13px;
  font-weight:900;
}
.catalog-selection-toolbar{
  position:sticky;
  top:8px;
  z-index:19;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:10px;
  padding:10px 12px;
  border:1px solid #bfdbfe;
  border-radius:14px;
  background:#eff6ff;
  color:#1e3a8a;
  font-size:13px;
  font-weight:900;
  box-shadow:0 12px 24px rgba(15,23,42,.10);
}
.catalog-selection-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}
.catalog-import-table th,
.catalog-import-table td{
  vertical-align:top;
}
.catalog-import-cell{
  min-width:118px;
}
.catalog-import-cell small{
  display:block;
  margin-top:6px;
  color:#64748b;
  font-weight:800;
}
.catalog-row-controls{
  display:grid;
  grid-template-columns:repeat(2,minmax(150px,1fr));
  gap:8px;
  min-width:340px;
}
.catalog-mini-input{
  min-height:38px;
  height:38px;
  border-radius:10px;
  font-size:13px;
  font-weight:800;
}
.catalog-check{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  min-height:38px;
  border:1px solid #dbe4f0;
  border-radius:10px;
  background:#fff;
  padding:8px 10px;
  color:#0f172a;
  font-size:13px;
  font-weight:900;
}
.catalog-check input[type="checkbox"]{
  width:18px;
  height:18px;
  min-width:18px;
}
@media(max-width:800px){
  .stock-workspace-tabs{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .product-low-stock-select{
    width:100%;
  }
  .product-bulk-panel{
    position:static;
    align-items:stretch;
    flex-direction:column;
  }
  .product-bulk-actions{
    justify-content:flex-start;
  }
  .catalog-pagination{
    align-items:stretch;
    flex-direction:column;
  }
  .catalog-pagination-top{
    top:118px;
  }
  .catalog-selection-toolbar{
    align-items:stretch;
    flex-direction:column;
  }
  .catalog-page-actions{
    justify-content:flex-start;
  }
  .catalog-selection-actions{
    justify-content:flex-start;
  }
  .catalog-row-controls{
    grid-template-columns:1fr;
    min-width:260px;
  }
}
.product-live-actions .danger,
.edit-product-actions .danger{
  background:#fee2e2;
  border:2px solid #fecaca;
  color:#991b1b;
}


/* V5.33 - elementi disattivati */
.inactive-row{
  opacity:.58;
  background:#f8fafc;
}
.inactive-row td{
  color:#64748b;
}
button.danger.small,
button.secondary.small{
  min-height:36px;
  padding:6px 12px;
}


/* V5.33 - stato Multi PC */
.multi-pc-status{
  margin:10px 0 14px;
  padding:10px 14px;
  border:1px solid #bbf7d0;
  border-radius:16px;
  background:#f0fdf4;
  color:#166534;
  font-size:13px;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.multi-pc-status .small{
  min-height:34px!important;
  height:34px!important;
  padding:5px 10px!important;
  border-radius:10px!important;
  font-size:13px!important;
}


/* V5.33 modern categoria/servizi/statistiche */
.category-actions-inline{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.category-row-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.service-modern-search .service-search-bar{margin-top:14px}
.service-search-results-modern{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px}
.service-search-result-card{background:#fff;border:1px solid #dbe4f0;border-radius:22px;padding:14px;box-shadow:0 10px 28px rgba(15,23,42,.08)}
.service-result-header{display:flex;align-items:center;gap:8px;margin-bottom:8px;flex-wrap:wrap}
.service-search-result-card .service-row{margin:0;border-color:#e2e8f0;background:#f8fafc}
.stat-line-card{overflow:hidden}
.stat-line-wrap{width:100%;overflow-x:auto;margin-top:12px;background:#f8fafc;border-radius:18px;border:1px solid #e2e8f0;padding:8px}
.stat-line-wrap svg{min-width:620px;width:100%;height:auto;display:block}
.stat-axis{stroke:#94a3b8;stroke-width:1.2}
.stat-axis-label,.stat-x-labels text{fill:#64748b;font-size:13px;font-weight:700}
.stat-line{fill:none;stroke-width:4;stroke-linejoin:round;stroke-linecap:round}
.stat-line-revenue{stroke:#0f172a}
.stat-line-profit{stroke:#059669}
.stat-dot-revenue{fill:#0f172a;stroke:#fff;stroke-width:2}
.stat-dot-profit{fill:#059669;stroke:#fff;stroke-width:2}
.stat-line-legend{display:flex;gap:12px;align-items:center;flex-wrap:wrap;font-size:13px;font-weight:800;color:#475569}
.stat-line-legend span{display:inline-flex;gap:6px;align-items:center}
.stat-line-legend i{display:inline-block;width:18px;height:4px;border-radius:999px}
.legend-revenue{background:#0f172a}
.legend-profit{background:#059669}
@media(max-width:760px){.service-search-results-modern{grid-template-columns:1fr}.category-row-actions{min-width:220px}.stat-line-wrap svg{min-width:560px}}


/* V5.34 - Statistiche moderne + fix menu categorie */
.category-manager-card{border:2px solid #dbe4f0}
.category-edit-grid input,.category-edit-grid select{min-height:48px;font-weight:800}
.inactive-row{opacity:.6;background:#f8fafc}
.stat-control-panel{border:2px solid #dbe4f0;background:linear-gradient(180deg,#fff,#f8fafc)}
.stat-filter-grid{align-items:center}
.stat-quick-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.stat-modern-bar .stat-bar-row.modern{animation:statFadeUp .42s ease both;animation-delay:var(--delay,0ms)}
.stat-modern-bar .stat-bar-fill{animation:barGrow .75s cubic-bezier(.2,.8,.2,1) both;transform-origin:left center}
.stat-modern-line-card{overflow:hidden}
.stat-modern-line-card h2{margin-bottom:4px}
.stat-line-wrap{background:linear-gradient(180deg,#f8fafc,#ffffff);padding:14px!important}
.stat-line{fill:none;stroke-width:4.2;stroke-linejoin:round;stroke-linecap:round;filter:drop-shadow(0 4px 8px rgba(15,23,42,.13))}
.stat-line-third{stroke:#2563eb}
.stat-animated-path{stroke-dasharray:1;stroke-dashoffset:1;animation:statDraw 1.25s cubic-bezier(.19,1,.22,1) forwards}
.stat-dot{opacity:0;transform-origin:center;animation:statDot .28s ease forwards}
.stat-dot-third{fill:#2563eb;stroke:#fff;stroke-width:2}
.legend-third{background:#2563eb}
.stat-x-labels text{font-size:12px;font-weight:800;fill:#64748b}
.stat-axis-label{font-size:13px;font-weight:900;fill:#64748b}
@keyframes statDraw{to{stroke-dashoffset:0}}
@keyframes statDot{from{opacity:0;transform:scale(.2)}to{opacity:1;transform:scale(1)}}
@keyframes barGrow{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes statFadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:900px){.stat-filter-grid{grid-template-columns:1fr!important}.stat-quick-actions button{flex:1}.category-edit-grid{grid-template-columns:1fr!important}}


/* V5.34 fix - statistiche periodo compatto */
.stat-control-panel.stat-control-compact{
  position: sticky;
  top: 8px;
  z-index: 30;
  padding: 14px;
  border: 2px solid #dbe4f0;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 38px rgba(15,23,42,.10);
}
.stats-compact-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.stats-compact-header h2{
  margin:0 0 4px;
}
.stats-compact-grid{
  display:grid;
  grid-template-columns: 145px minmax(220px, 1.15fr) 160px minmax(240px, 1fr) 170px 130px;
  gap:8px;
  align-items:center;
}
.stats-period-inputs{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:8px;
}
.stats-period-inputs input:only-child{
  grid-column: 1 / -1;
}
.stat-quick-actions.compact{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.stat-quick-actions.compact button{
  min-height:38px;
  padding:7px 12px;
}
.stat-chart-card{
  padding:16px;
}
.stat-modern-line-card .stat-line-wrap{
  max-height:315px;
}
.stat-single-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:10px;
  margin:12px 0;
}
.stat-single-box{
  border:1px solid #dbe4f0;
  border-radius:18px;
  padding:14px;
  background:#f8fafc;
}
.stat-single-box span{
  display:block;
  color:#64748b;
  font-weight:900;
  font-size:13px;
}
.stat-single-box b{
  display:block;
  font-size:26px;
  color:#0f172a;
  margin-top:4px;
}
.stat-single-box.profit b{
  color:#059669;
}
.stat-single-box.third b{
  color:#2563eb;
}
.stat-single-box small{
  display:block;
  margin-top:4px;
  color:#64748b;
}
@media(max-width:1200px){
  .stats-compact-grid{
    grid-template-columns: 1fr 1fr 1fr;
  }
  .stats-period-inputs{
    grid-column: span 2;
  }
}
@media(max-width:760px){
  .stat-control-panel.stat-control-compact{
    position:static;
  }
  .stats-compact-header{
    flex-direction:column;
  }
  .stats-compact-grid{
    grid-template-columns:1fr!important;
  }
  .stats-period-inputs{
    grid-column:auto;
    grid-template-columns:1fr;
  }
}


/* V5.34 fix - grafici più grandi + obiettivo guadagno dashboard */
.stat-line-wrap{
  overflow: visible !important;
  padding: 14px !important;
}
.stat-line-wrap svg{
  min-width: 0 !important;
  width: 100% !important;
  height: auto !important;
  max-height: 430px;
}
.stat-modern-line-card .stat-line-wrap{
  max-height: none !important;
}
.stat-modern-line-card{
  min-height: 430px;
}
.stat-modern-line-card h2{
  margin-bottom: 4px;
}
.dashboard-goal-card{
  border: 2px solid #bbf7d0;
  background: linear-gradient(135deg,#ecfdf5,#ffffff);
}
.dashboard-goal-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
}
.dashboard-goal-head h2{
  margin:0 0 4px;
}
.dashboard-goal-percent{
  min-width:92px;
  text-align:center;
  border-radius:22px;
  background:#059669;
  color:white;
  font-weight:1000;
  font-size:28px;
  padding:12px 14px;
  box-shadow:0 14px 28px rgba(5,150,105,.20);
}
.dashboard-goal-values{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:14px;
}
.dashboard-goal-values div{
  border:1px solid #d1fae5;
  border-radius:18px;
  background:#fff;
  padding:14px;
}
.dashboard-goal-values span{
  display:block;
  color:#64748b;
  font-size:13px;
  font-weight:900;
}
.dashboard-goal-values b{
  display:block;
  margin-top:4px;
  color:#064e3b;
  font-size:24px;
}
.dashboard-goal-bar{
  height:18px;
  margin:14px 0 8px;
  overflow:hidden;
  border-radius:999px;
  background:#d1fae5;
  border:1px solid #a7f3d0;
}
.dashboard-goal-bar i{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#059669,#10b981);
  transition:width .7s ease;
}
.dashboard-product-row{
  align-items:flex-start;
}
.dashboard-product-row > div{
  min-width:0;
  max-width:68%;
}
.dashboard-product-row b,
.dashboard-product-row small{
  display:block;
}
.dashboard-product-row small{
  margin-top:3px;
  color:#64748b;
  font-weight:800;
  line-height:1.35;
  word-break:break-word;
}
.dashboard-product-row > span{
  text-align:right;
  font-weight:900;
  line-height:1.45;
  white-space:normal;
}
@media(max-width:760px){
  .stat-modern-line-card{
    min-height:auto;
  }
  .dashboard-goal-head{
    flex-direction:column;
  }
  .dashboard-goal-percent{
    width:100%;
  }
  .dashboard-goal-values{
    grid-template-columns:1fr;
  }
  .dashboard-product-row{
    align-items:stretch;
    flex-direction:column;
  }
  .dashboard-product-row > div{
    max-width:100%;
  }
  .dashboard-product-row > span{
    text-align:left;
  }
}


/* V5.34 - Gratta: solo riconoscimento prefissi non registrati */
#scratchTest{
  border-color:#94a3b8;
}


/* V5.34 - Gratta riconoscimento senza alert + pacco 7 cifre */
.scratch-recognition-result{
  margin-top:14px;
  border-radius:20px;
  padding:16px;
  border:2px solid #dbe4f0;
  background:#f8fafc;
}
.scratch-recognition-result.unknown{
  border-color:#f59e0b;
  background:#fffbeb;
}
.scratch-recognition-result.known{
  border-color:#10b981;
  background:#ecfdf5;
}
.scratch-recognition-result > b{
  display:block;
  margin-bottom:12px;
  font-size:18px;
}
.scratch-recognition-result span{
  display:block;
  color:#64748b;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
}
.scratch-recognition-result strong{
  display:block;
  margin-top:3px;
  font-size:18px;
  color:#0f172a;
}
.scratch-recognition-result small{
  display:block;
  margin-top:12px;
  color:#92400e;
  font-weight:800;
}


/* V5.34 - toast non bloccanti al posto degli alert */
#bt_toast_root{
  position:fixed;
  top:18px;
  right:18px;
  z-index:99999;
  display:grid;
  gap:10px;
  max-width:min(420px, calc(100vw - 32px));
  pointer-events:none;
}
.bt-toast{
  transform:translateX(20px);
  opacity:0;
  border-radius:18px;
  padding:14px 16px;
  background:#0f172a;
  color:white;
  box-shadow:0 18px 42px rgba(15,23,42,.25);
  font-weight:900;
  white-space:pre-line;
  transition:opacity .22s ease, transform .22s ease;
}
.bt-toast.show{
  transform:translateX(0);
  opacity:1;
}
.bt-toast.warn{
  background:#92400e;
}
.bt-toast.info{
  background:#1d4ed8;
}
.bt-toast.success{
  background:#047857;
}
.bt-toast.error{
  background:#b91c1c;
}


/* V5.34 - Gratta: pacco/serie 7 cifre + biglietto */
.scratch-recognition-result strong{
  word-break: break-word;
}


/* V5.35 - Utenti e ruoli dipendenti */
.forbidden-card{
  border:2px solid #fecaca;
  background:#fff7f7;
}
.user-role-card select{
  width:100%;
  min-height:48px;
  margin:8px 0;
}
.role-box{
  border:1px solid #dbe4f0;
  border-radius:18px;
  padding:14px;
  margin:10px 0;
  background:#f8fafc;
}
.role-box b{
  display:block;
  font-size:16px;
}
.role-box small{
  display:block;
  color:#64748b;
  margin-top:3px;
}
.role-box p{
  margin:8px 0 0;
  color:#334155;
  line-height:1.45;
}
.pill{
  display:inline-block;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:900;
}
.pill.good{
  background:#dcfce7;
  color:#166534;
}
.pill.bad{
  background:#fee2e2;
  color:#991b1b;
}
.muted-row{
  opacity:.62;
}

/* V5.95 - Movimenti piu leggibili */
.movements-card{
  overflow:hidden;
}
.movement-head{
  padding-bottom:14px;
  border-bottom:1px solid #e2e8f0;
}
.movement-head h2{
  margin-bottom:4px;
}
.movement-filter-panel{
  display:grid;
  grid-template-columns:minmax(150px,180px) minmax(150px,180px) 150px auto auto;
  gap:10px;
  align-items:end;
  margin-top:14px;
  padding:12px;
  border:1px solid #dbe4f0;
  border-radius:16px;
  background:#f8fafc;
}
.movement-filter-panel label{
  display:flex;
  flex-direction:column;
  gap:6px;
  color:#475569;
  font-size:12px;
  font-weight:900;
}
.movement-filter-panel input{
  height:44px;
  border:2px solid #cbd5e1;
  border-radius:12px;
  font-weight:800;
}
.movement-include-deleted{
  height:44px;
  min-height:44px;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:space-between;
  gap:10px;
  padding:0 12px;
  border:2px solid #cbd5e1;
  border-radius:12px;
  background:#fff;
}
.movement-include-deleted input{
  width:20px;
  min-width:20px;
  height:20px;
  padding:0;
}
.movement-quickbar{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}
.movement-summary{
  margin-top:12px;
}

.movement-modebar{
  display:grid;
  grid-template-columns:repeat(3,minmax(160px,1fr));
  gap:10px;
  margin-top:12px;
}
.movement-modebar button{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:3px;
  min-height:58px;
  border:2px solid #dbe4f0;
  background:#fff;
  color:#0f172a;
}
.movement-modebar button.active{
  border-color:#2563eb;
  background:#eff6ff;
  box-shadow:0 10px 24px rgba(37,99,235,.12);
}
.movement-modebar button b{
  font-size:14px;
  font-weight:1000;
}
.movement-modebar button span{
  color:#64748b;
  font-size:12px;
  font-weight:800;
}
.movement-group-row td{
  background:#fff;
}
.movements-group-table{
  min-width:1220px;
}
.movement-summary .item{
  min-height:78px;
  margin:0;
  border-color:#dbe4f0;
  background:#ffffff;
}
.movement-summary .item.good{
  border-color:#bbf7d0;
  background:#ecfdf5;
  color:#065f46;
}
.movement-summary .item.redbox{
  border-color:#fecaca;
  background:#fef2f2;
}
.movement-summary .item span{
  display:block;
  color:#64748b;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
}
.movement-summary .item b{
  display:block;
  margin-top:6px;
  color:#0f172a;
  font-size:20px;
  font-weight:1000;
}
.movement-summary .item small{
  display:block;
  margin-top:4px;
  color:#64748b;
  font-weight:800;
}
.movements-tablewrap{
  margin-top:14px;
  border-radius:14px;
}
.movements-table{
  min-width:1180px;
}
.movements-table th{
  position:sticky;
  top:0;
  z-index:1;
  background:#eef2f7;
  color:#334155;
  font-size:11px;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.movements-table td{
  vertical-align:middle;
}
.movements-table tr:hover td{
  background:#f8fafc;
}
.movement-date b{
  display:block;
  font-size:13px;
  font-weight:1000;
}
.movement-date span{
  display:block;
  margin-top:3px;
  color:#64748b;
  font-size:12px;
  font-weight:900;
}
.movement-product b{
  display:block;
}
.movement-product span,
.movement-note small{
  display:block;
  margin-top:4px;
  color:#64748b;
  font-size:12px;
  font-weight:800;
}
.movement-payment{
  display:inline-flex;
  min-width:70px;
  justify-content:center;
  border:1px solid #dbe4f0;
  border-radius:999px;
  padding:5px 9px;
  background:#fff;
  font-weight:900;
}
.movement-note{
  max-width:260px;
  line-height:1.35;
}
.movement-actions{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  justify-content:flex-end;
}
.movement-actions button{
  min-height:34px;
  padding:7px 10px;
  border-radius:10px;
}
.movement-edit-row td{
  border-top:2px solid #bfdbfe;
  border-bottom:2px solid #bfdbfe;
  background:#eff6ff!important;
}
.movement-edit-row input,
.movement-edit-row select{
  height:38px;
  border-radius:10px;
  font-weight:800;
}
@media(max-width:900px){
  .movement-modebar{
    grid-template-columns:1fr;
  }
  .movement-filter-panel{
    grid-template-columns:1fr 1fr;
  }
  .movement-filter-panel button{
    width:100%;
  }
  .movement-include-deleted{
    grid-column:1/-1;
  }
  .movement-summary{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:620px){
  .movement-filter-panel,
  .movement-summary{
    grid-template-columns:1fr;
  }
}

.closing-destination-pick{
  margin-top:16px;
  border-top:1px solid var(--border);
  padding-top:12px;
}
.closing-destination-list{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:10px;
}
.closing-destination-option{
  display:grid;
  grid-template-columns:22px minmax(0,1fr);
  gap:10px;
  align-items:flex-start;
}
.closing-destination-option input{
  width:18px;
  height:18px;
  margin-top:3px;
}
.closing-destination-option small{
  display:block;
  color:var(--muted);
  margin-top:4px;
  word-break:break-word;
}
.closing-warning{
  border-color:#fde68a;
  background:#fffbeb;
}
.closing-destination-admin textarea{
  min-height:96px;
  grid-column:1/-1;
}


/* V5.36 - Realtime veloce */
.realtime-fast-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border-radius:999px;
  padding:6px 10px;
  background:#ecfdf5;
  color:#047857;
  font-weight:900;
  font-size:12px;
}
.realtime-fast-badge::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:999px;
  background:#10b981;
  box-shadow:0 0 0 4px rgba(16,185,129,.16);
}


/* V5.38 - CRUD prefissi Gratta e Vinci */
.scratch-prefix-row{
  border:1px solid #dbe4f0;
  border-radius:18px;
  padding:14px;
  margin:10px 0;
  background:#ffffff;
}
.scratch-prefix-row.inactive{
  opacity:.72;
  background:#f8fafc;
}
.scratch-prefix-actions{
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.scratch-type-form{
  border:2px solid #bfdbfe;
  background:linear-gradient(135deg,#eff6ff,#ffffff);
}
@media(max-width:760px){
  .scratch-prefix-row .row{
    align-items:flex-start;
    flex-direction:column;
  }
  .scratch-prefix-actions{
    width:100%;
  }
  .scratch-prefix-actions button{
    width:100%;
  }
}


/* V5.39 - Sync leggera anti-lag */
.sync-light-note{
  border:1px solid #bfdbfe;
  background:#eff6ff;
  color:#1e40af;
  border-radius:16px;
  padding:10px 12px;
  font-weight:800;
}


/* V5.43 - errore API utenti/ruoli visibile e pulito */
.api-error-card{
  border:2px solid #f97316;
  background:#fff7ed;
  color:#7c2d12;
  margin-bottom:16px;
}
.api-error-card h2{
  margin-top:0;
}
.api-error-card p{
  font-weight:800;
}


/* V5.44 - Login commerciale moderno */
.login-shell{
  min-height:calc(100vh - 40px);
  display:grid;
  grid-template-columns:minmax(320px,1.1fr) minmax(340px,460px);
  gap:28px;
  align-items:center;
  max-width:1120px;
  margin:0 auto;
  padding:44px 22px;
}
.login-hero{
  border-radius:34px;
  padding:42px;
  background:
    radial-gradient(circle at top left, rgba(16,185,129,.22), transparent 35%),
    linear-gradient(135deg,#0f172a,#111827 55%,#064e3b);
  color:white;
  box-shadow:0 28px 70px rgba(15,23,42,.28);
  min-height:460px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.login-logo{
  width:70px;
  height:70px;
  border-radius:24px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.25);
  font-weight:1000;
  letter-spacing:.08em;
  margin-bottom:24px;
}
.login-hero h1{
  font-size:54px;
  line-height:1;
  margin:0 0 18px;
  letter-spacing:0;
  color:#f8fafc !important;
  text-shadow:0 2px 18px rgba(0,0,0,.35);
}
.login-hero p{
  max-width:620px;
  color:#dbeafe;
  font-size:18px;
  line-height:1.55;
  margin:0;
}
.login-feature-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:34px;
}
.login-feature-grid span{
  border:1px solid rgba(255,255,255,.20);
  background:rgba(255,255,255,.10);
  border-radius:18px;
  padding:13px 14px;
  font-weight:900;
}
.login-panel{
  border-radius:32px;
  padding:30px;
  box-shadow:0 28px 70px rgba(15,23,42,.16);
  border:1px solid #dbe4f0;
}
.login-panel-head{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:22px;
}
.login-panel h2{
  margin:0 0 6px;
  font-size:30px;
  letter-spacing:-.03em;
}
.login-label{
  display:block;
  margin:14px 0 7px;
  font-weight:1000;
  color:#334155;
}
.login-input{
  width:100%;
  min-height:54px;
  border-radius:18px;
  border:2px solid #dbe4f0;
  padding:0 16px;
  font-size:17px;
  font-weight:800;
  background:#f8fafc;
  outline:none;
}
.login-input:focus{
  border-color:#2563eb;
  background:#fff;
  box-shadow:0 0 0 5px rgba(37,99,235,.10);
}
.login-submit{
  width:100%;
  min-height:58px;
  border-radius:20px;
  margin-top:22px;
  font-size:17px;
}
.login-security{
  margin:16px 0 0;
  color:#64748b;
  line-height:1.45;
  font-weight:700;
}
.login-error{
  border:1px solid #fecaca;
  background:#fef2f2;
  color:#991b1b;
  border-radius:18px;
  padding:13px 14px;
  font-weight:900;
  margin-bottom:14px;
}
@media(max-width:900px){
  .login-shell{
    grid-template-columns:1fr;
    padding:22px 14px;
  }
  .login-hero{
    min-height:auto;
    padding:30px;
  }
  .login-hero h1{
    font-size:40px;
  }
}
@media(max-width:560px){
  .login-feature-grid{
    grid-template-columns:1fr;
  }
  .login-panel-head{
    flex-direction:column;
  }
}

.display-stock-card{
  border-top:1px solid #e2e8f0;
  padding-top:16px;
}
.display-quick-panel{
  margin-top:14px;
  padding:14px;
  border:1px solid #dbeafe;
  background:#f8fbff;
  border-radius:8px;
}
.display-quick-panel h3{
  margin:0 0 4px;
}
.display-stock-summary{
  margin-top:12px;
}
.display-stock-tools{
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto auto;
  gap:10px;
  align-items:center;
  margin-top:12px;
}
.display-stock-tools input{
  min-height:44px;
  font-weight:800;
}
.display-stock-tools button{
  min-height:44px;
  white-space:nowrap;
}
.display-stock-table .small-input{
  width:92px;
  min-height:36px;
  padding:6px 8px;
  border-radius:10px;
  font-weight:800;
}
.display-stock-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  min-width:260px;
}
.display-row-need{
  background:#fffbeb;
}
.badge.bad{
  background:#fee2e2;
  color:#991b1b;
}
.department-mode-buttons button{
  min-height:44px;
  border-radius:8px;
  padding:10px 14px;
  white-space:normal;
  text-align:center;
}
.order-export-box{
  margin-top:14px;
  padding:14px;
  border:1px solid #dbe3ef;
  border-radius:8px;
  background:#f8fafc;
}
.order-export-box h3,
.order-export-links h3{
  margin:0 0 4px;
}
.order-format-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(120px,1fr));
  gap:10px;
  margin-top:10px;
}
.order-format-grid .item{
  margin:0;
  border-radius:8px;
  font-weight:900;
}
.order-format-grid input{
  width:auto;
  height:auto;
  transform:scale(1.25);
}
.order-action-buttons button{
  min-height:46px;
  border-radius:8px;
}
.order-export-links{
  margin-top:12px;
  padding:12px;
  border:1px solid #bbf7d0;
  border-radius:8px;
  background:#f0fdf4;
}
.order-preview-panel{
  margin-top:14px;
  padding:16px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  background:#ffffff;
}
.order-preview-panel h2,
.order-preview-panel h3{
  margin:0 0 4px;
}
.order-preview-summary{
  margin-top:12px;
}
.order-preview-summary .item{
  border-radius:8px;
}
.order-preview-groups{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:12px;
}
.order-preview-group{
  border:1px solid #e2e8f0;
  border-radius:8px;
  padding:14px;
  background:#f8fafc;
}
.order-preview-lines{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:10px;
}
.order-preview-line{
  display:grid;
  grid-template-columns:minmax(220px,1fr) 90px 90px 150px;
  gap:10px;
  align-items:center;
  padding:10px;
  border:1px solid #e2e8f0;
  border-radius:8px;
  background:white;
}
.order-preview-line span,
.order-preview-line small{
  color:#64748b;
  font-size:12px;
  font-weight:800;
}
.order-preview-line small,
.order-preview-line em{
  display:block;
}
.order-preview-line em{
  margin-top:2px;
  color:#92400e;
  font-size:12px;
  font-style:normal;
  font-weight:900;
}
.order-preview-table{
  margin-top:14px;
}
@media(max-width:760px){
  .display-stock-tools{
    grid-template-columns:1fr;
  }
  .display-stock-actions{
    min-width:220px;
  }
  .display-stock-table .small-input{
    width:78px;
  }
  .order-format-grid{
    grid-template-columns:1fr 1fr;
  }
  .order-preview-groups,
  .order-preview-line{
    grid-template-columns:1fr;
  }
}

.today-todo-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.today-todo-item{
  min-height:118px;
  text-align:left;
  border-radius:8px;
  padding:14px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  background:#0f172a;
}
.today-todo-item span{
  font-size:13px;
  font-weight:900;
}
.today-todo-item b{
  font-size:28px;
  line-height:1;
}
.today-todo-item small{
  color:rgba(255,255,255,.82);
  font-weight:700;
}
.today-todo-item.good{background:#047857}
.today-todo-item.warn{background:#b45309}
.today-todo-item.dark{background:#334155}

.quick-load-panel,
.cashier-quick-box,
.price-history-box,
.closing-guide{
  margin-top:14px;
  padding:14px;
  border:1px solid #dbe3ef;
  border-radius:8px;
  background:#f8fafc;
}
.quick-load-panel h2,
.cashier-quick-box h3,
.price-history-box h3{
  margin:0 0 4px;
}
.quick-load-hint{
  margin-top:10px;
  border-radius:8px;
  padding:10px 12px;
  font-weight:900;
}
.quick-load-hint.good{
  background:#dcfce7;
  color:#166534;
}
.quick-load-hint.warn{
  background:#fff7ed;
  color:#9a3412;
}
.cashier-quick-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-top:10px;
}
.cashier-quick-grid.tablet{
  grid-template-columns:repeat(7,minmax(0,1fr));
}
.cashier-quick-tile{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.cashier-quick-btn{
  min-height:74px;
  width:100%;
  border-radius:8px;
  background:#fff;
  color:#0f172a;
  border:1px solid #cbd5e1;
  text-align:left;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.cashier-quick-btn b{
  font-size:13px;
  line-height:1.2;
}
.cashier-quick-btn span{
  color:#047857;
  font-weight:1000;
}
.cashier-fav-remove{
  width:100%;
}
.cashier-fav-add-btn,
.cashier-fav-row button:not(.secondary):not(.cashier-fav-remove-btn){
  background:#047857 !important;
  color:#ffffff !important;
  border:2px solid #047857 !important;
  box-shadow:0 8px 18px rgba(4,120,87,.18) !important;
}
.cashier-fav-add-btn *,
.cashier-fav-row button:not(.secondary):not(.cashier-fav-remove-btn) *{
  color:#ffffff !important;
}
.cashier-fav-remove-btn,
.cashier-fav-row button.secondary{
  background:#fff1f2 !important;
  color:#991b1b !important;
  border:2px solid #fecdd3 !important;
}
.cashier-fav-remove-btn *,
.cashier-fav-row button.secondary *{
  color:#991b1b !important;
}
.cashier-view-toggle{
  background:#eff6ff !important;
  color:#1e3a8a !important;
  border:2px solid #bfdbfe !important;
}
.cashier-view-toggle *{
  color:#1e3a8a !important;
}
.cashier-fav-picker{
  margin-top:12px;
  padding:12px;
  border:1px solid #bfdbfe;
  border-radius:8px;
  background:#eff6ff;
}
.cashier-fav-picker h3{
  margin:0 0 4px;
}
.cashier-fav-picker input{
  margin-top:10px;
  min-height:44px;
}
.cashier-fav-results{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-top:10px;
  max-height:360px;
  overflow:auto;
  padding-right:4px;
}
.cashier-fav-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:10px;
  border:1px solid #dbe3ef;
  border-radius:8px;
  background:white;
}
.cashier-fav-row span{
  color:#64748b;
  font-size:12px;
  font-weight:800;
}
.price-history-table{
  min-width:720px;
}
.closing-guide{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  background:#fff;
}
.closing-guide .item{
  margin:0;
  border-radius:8px;
}
button.small,
.buttonlike.small{
  min-height:34px;
  padding:7px 10px;
  border-radius:8px;
  font-size:12px;
}
@media(max-width:1180px){
  .today-todo-grid,
  .cashier-quick-grid.tablet,
  .closing-guide{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:760px){
  .today-todo-grid,
  .cashier-quick-grid,
  .cashier-quick-grid.tablet,
  .closing-guide{
    grid-template-columns:1fr;
  }
  .cashier-fav-results,
  .cashier-fav-row{
    grid-template-columns:1fr;
  }
}

/* V5.59 - contrasto pulsanti: niente testo nero su fondo scuro */
button.good,
button.warn,
button.danger,
.pay-confirm-button,
.order-action-buttons button.good{
  color:#ffffff !important;
}
button.good *,
button.warn *,
button.danger *,
.pay-confirm-button *,
.order-action-buttons button.good *{
  color:#ffffff !important;
}
.nav button.active,
.nav button.active *,
.lang-switch button.active,
.lang-switch button.active *{
  color:#ffffff !important;
}
.nav button:not(.active),
.lang-switch button:not(.active){
  background:#ffffff !important;
  color:#0f172a !important;
}
body .today-todo-grid button.today-todo-item,
.today-todo-item{
  background:#ffffff !important;
  color:#0f172a !important;
  border:1px solid #cbd5e1 !important;
  box-shadow:0 8px 18px rgba(15,23,42,.08) !important;
}
body .today-todo-grid button.today-todo-item.good,
.today-todo-item.good{
  background:#ecfdf5 !important;
  color:#065f46 !important;
  border-color:#86efac !important;
}
body .today-todo-grid button.today-todo-item.warn,
.today-todo-item.warn{
  background:#fffbeb !important;
  color:#92400e !important;
  border-color:#fcd34d !important;
}
body .today-todo-grid button.today-todo-item.dark,
.today-todo-item.dark{
  background:#eff6ff !important;
  color:#1e3a8a !important;
  border-color:#bfdbfe !important;
}
body .today-todo-grid button.today-todo-item span,
body .today-todo-grid button.today-todo-item b,
body .today-todo-grid button.today-todo-item small,
.today-todo-item span,
.today-todo-item b,
.today-todo-item small{
  color:inherit !important;
}
.today-todo-item small{
  opacity:.78;
}
.cashier-quick-btn{
  background:#ffffff !important;
  color:#0f172a !important;
  border:1px solid #cbd5e1 !important;
}
.cashier-quick-btn b{
  color:#0f172a !important;
}
.cashier-quick-btn span{
  color:#047857 !important;
}

/* V5.62 - profili dispositivo automatici: PC, tablet/iPad, smartphone */
body.bt-device-desktop .app{
  max-width:1680px;
  padding:20px;
}
body.bt-device-tablet .app{
  max-width:1180px;
  padding:14px;
}
body.bt-device-phone .app{
  width:100%;
  max-width:none;
  padding:10px;
}
body.bt-device-tablet .nav{
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:8px;
}
body.bt-device-phone .nav{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:6px;
  border-radius:12px;
  padding:6px;
  margin:10px 0;
}
body.bt-device-tablet .nav button,
body.bt-device-tablet button{
  min-height:46px;
}
body.bt-device-phone .nav button{
  min-height:44px;
  padding:8px 7px;
  border-radius:8px;
  font-size:12px;
}
body.bt-device-phone .topbar,
body.bt-device-tablet .topbar{
  align-items:stretch;
}
body.bt-device-phone .topbar,
body.bt-device-phone .topbar-actions,
body.bt-device-phone .scan{
  flex-direction:column;
}
body.bt-device-phone .brand{
  align-items:flex-start;
}
body.bt-device-phone h1{
  font-size:22px;
}
body.bt-device-phone input,
body.bt-device-phone select,
body.bt-device-phone textarea{
  min-height:48px;
  font-size:16px;
}
body.bt-device-phone .card{
  border-radius:12px;
  padding:12px;
}
body.bt-device-tablet .cashier-layout,
body.bt-device-phone .cashier-layout{
  grid-template-columns:1fr !important;
}
body.bt-device-tablet .cashier-right,
body.bt-device-phone .cashier-right{
  position:static;
  max-height:none;
  overflow:visible;
}
body.bt-device-tablet .cashier-quick-grid,
body.bt-device-tablet .cashier-quick-grid.tablet{
  grid-template-columns:repeat(3,minmax(0,1fr)) !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;
}
body.bt-device-phone .cashier-quick-btn{
  min-height:86px;
  padding:10px;
}
body.bt-device-phone .cashier-fav-results,
body.bt-device-phone .cashier-fav-row{
  grid-template-columns:1fr !important;
}
body.bt-device-tablet .today-todo-grid,
body.bt-device-tablet .order-preview-groups{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
}
body.bt-device-phone .today-todo-grid,
body.bt-device-phone .order-preview-groups,
body.bt-device-phone .order-preview-line,
body.bt-device-phone .order-format-grid,
body.bt-device-phone .closing-guide{
  grid-template-columns:1fr !important;
}
body.bt-device-phone .cart-line{
  grid-template-columns:1fr !important;
}
body.bt-device-phone .pay-total-amount{
  font-size:44px !important;
}
body.bt-device-phone .table{
  min-width:720px;
}
body.bt-device-phone .multi-pc-status{
  flex-direction:column;
  align-items:stretch;
  gap:8px;
}
body.bt-touch button,
body.bt-touch .buttonlike{
  min-height:46px;
}

/* V5.64 - Cassa preferiti: bottoni scuri coerenti con testo bianco */
body .cashier-quick-box button.cashier-quick-btn{
  background:#0f172a !important;
  color:#ffffff !important;
  border:2px solid #0f172a !important;
  box-shadow:0 10px 22px rgba(15,23,42,.20) !important;
}
body .cashier-quick-box button.cashier-quick-btn:hover{
  background:#064e3b !important;
  color:#ffffff !important;
  border-color:#10b981 !important;
}
body .cashier-quick-box button.cashier-quick-btn b{
  color:#ffffff !important;
}
body .cashier-quick-box button.cashier-quick-btn span{
  color:#ffffff !important;
  opacity:.9;
}
body .cashier-quick-box button.cashier-quick-btn *{
  color:#ffffff !important;
}
body .cashier-quick-box button.cashier-fav-add-btn,
body .cashier-fav-picker .cashier-fav-row button:not(.secondary){
  background:#047857 !important;
  color:#ffffff !important;
  border:2px solid #047857 !important;
  box-shadow:0 8px 18px rgba(4,120,87,.18) !important;
}
body .cashier-quick-box button.cashier-fav-add-btn *,
body .cashier-fav-picker .cashier-fav-row button:not(.secondary) *{
  color:#ffffff !important;
}
body .cashier-quick-box button.cashier-view-toggle{
  background:#eff6ff !important;
  color:#1e3a8a !important;
  border:2px solid #bfdbfe !important;
}
body .cashier-quick-box button.cashier-view-toggle *{
  color:#1e3a8a !important;
}
body .cashier-quick-box button.cashier-fav-remove-btn,
body .cashier-fav-picker .cashier-fav-row button.secondary{
  background:#fff1f2 !important;
  color:#991b1b !important;
  border:2px solid #fecdd3 !important;
}
body .cashier-quick-box button.cashier-fav-remove-btn *,
body .cashier-fav-picker .cashier-fav-row button.secondary *{
  color:#991b1b !important;
}

/* V5.68 - danger chiari e disabilitati sempre leggibili */
body .product-live-actions button.danger:not(:disabled),
body .edit-product-actions button.danger:not(:disabled){
  background:#fee2e2 !important;
  color:#991b1b !important;
  border-color:#fecaca !important;
}
body .product-live-actions button.danger:not(:disabled) *,
body .edit-product-actions button.danger:not(:disabled) *{
  color:#991b1b !important;
}
body button.danger:disabled,
body button.danger[disabled]{
  background:#e2e8f0 !important;
  color:#334155 !important;
  border-color:#cbd5e1 !important;
}
body button.danger:disabled *,
body button.danger[disabled] *{
  color:#334155 !important;
}

/* V5.67 - visuale automatica piu comoda sui portatili Full HD */
body.bt-device-desktop.bt-density-comfort{
  font-size:16px;
}
body.bt-device-desktop.bt-density-comfort .app{
  max-width:1900px;
  padding:26px 30px;
}
body.bt-device-desktop.bt-density-comfort .topbar{
  gap:18px;
}
body.bt-device-desktop.bt-density-comfort h1{
  font-size:32px;
}
body.bt-device-desktop.bt-density-comfort .muted{
  font-size:14.5px;
}
body.bt-device-desktop.bt-density-comfort input,
body.bt-device-desktop.bt-density-comfort select,
body.bt-device-desktop.bt-density-comfort textarea{
  min-height:48px;
  font-size:16px;
  border-radius:14px;
  padding-left:14px;
  padding-right:14px;
}
body.bt-device-desktop.bt-density-comfort textarea{
  min-height:96px;
  padding-top:12px;
}
body.bt-device-desktop.bt-density-comfort button{
  min-height:48px;
  font-size:15.5px;
  padding:12px 16px;
  border-radius:14px;
}
body.bt-device-desktop.bt-density-comfort button.small{
  min-height:42px;
  font-size:14px;
  padding:9px 12px;
}
body.bt-device-desktop.bt-density-comfort .nav{
  grid-template-columns:repeat(8,minmax(0,1fr));
  gap:10px;
  padding:10px;
  margin:20px 0;
  border-radius:22px;
}
body.bt-device-desktop.bt-density-comfort .nav button{
  min-height:52px;
  padding:11px 10px;
  font-size:14.5px;
}
body.bt-device-desktop.bt-density-comfort .card{
  padding:22px;
  border-radius:22px;
}
body.bt-device-desktop.bt-density-comfort .grid{
  gap:16px;
}
body.bt-device-desktop.bt-density-comfort .layout{
  gap:20px;
}
body.bt-device-desktop.bt-density-comfort .section-title{
  font-size:22px;
}
body.bt-device-desktop.bt-density-comfort .badge{
  font-size:13px;
  padding:6px 11px;
}
body.bt-device-desktop.bt-density-comfort .stat .val{
  font-size:36px;
}
body.bt-device-desktop.bt-density-comfort .cashier-layout{
  grid-template-columns:minmax(0,1fr) 500px;
  gap:20px;
}
body.bt-device-desktop.bt-density-comfort .cashier-right{
  top:16px;
  gap:14px;
  max-height:calc(100vh - 32px);
}
body.bt-device-desktop.bt-density-comfort .cart-line{
  grid-template-columns:minmax(260px,1fr) 108px 100px 136px 96px;
  gap:12px;
  padding:14px;
  border-radius:18px;
}
body.bt-device-desktop.bt-density-comfort .cart-line-main b{
  font-size:16px;
}
body.bt-device-desktop.bt-density-comfort .cart-line-main small,
body.bt-device-desktop.bt-density-comfort .cart-line-total small{
  font-size:13px;
}
body.bt-device-desktop.bt-density-comfort .pay-total-card{
  padding:22px;
  border-radius:24px;
}
body.bt-device-desktop.bt-density-comfort .pay-total-label{
  font-size:14px;
  letter-spacing:.12em;
}
body.bt-device-desktop.bt-density-comfort .pay-total-amount,
body.bt-device-desktop.bt-density-comfort .bigtotal .amount{
  font-size:78px !important;
  letter-spacing:0 !important;
}
body.bt-device-desktop.bt-density-comfort .pay-confirm-button{
  min-height:76px;
  font-size:21px;
}
body.bt-device-desktop.bt-density-comfort .quick-cash{
  gap:10px;
}
body.bt-device-desktop.bt-density-comfort .cashier-quick-grid{
  gap:12px;
}
body.bt-device-desktop.bt-density-comfort .cashier-quick-grid:not(.tablet){
  grid-template-columns:repeat(4,minmax(0,1fr));
}
body.bt-device-desktop.bt-density-comfort .cashier-quick-grid.tablet{
  grid-template-columns:repeat(6,minmax(0,1fr));
}
body.bt-device-desktop.bt-density-comfort .cashier-quick-btn{
  min-height:96px;
  padding:14px;
  border-radius:12px;
}
body.bt-device-desktop.bt-density-comfort .cashier-quick-btn b{
  font-size:15px;
  line-height:1.25;
}
body.bt-device-desktop.bt-density-comfort .cashier-quick-btn span{
  font-size:15px;
}
body.bt-device-desktop.bt-density-comfort .table th,
body.bt-device-desktop.bt-density-comfort .table td{
  font-size:14px;
  padding:13px;
}

/* FIX UI Movimenti raggruppati - evita che lo stile globale dei pulsanti scuri copra le nuove viste */
.movements-card .movement-modebar{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(190px,1fr)) !important;
  gap:12px !important;
  margin-top:14px !important;
}
.movements-card .movement-modebar button.movement-mode-btn,
.movements-card .movement-modebar button{
  min-height:78px !important;
  padding:16px 18px !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  justify-content:center !important;
  gap:6px !important;
  border:2px solid #cbd5e1 !important;
  border-radius:18px !important;
  background:#ffffff !important;
  color:#0f172a !important;
  box-shadow:0 8px 18px rgba(15,23,42,.06) !important;
  text-align:left !important;
}
.movements-card .movement-modebar button.movement-mode-btn b,
.movements-card .movement-modebar button b{
  display:block !important;
  color:#0f172a !important;
  font-size:18px !important;
  line-height:1.15 !important;
  font-weight:1000 !important;
}
.movements-card .movement-modebar button.movement-mode-btn span,
.movements-card .movement-modebar button span{
  display:block !important;
  color:#475569 !important;
  font-size:13px !important;
  line-height:1.25 !important;
  font-weight:800 !important;
}
.movements-card .movement-modebar button.movement-mode-btn.active,
.movements-card .movement-modebar button.active{
  background:#2563eb !important;
  border-color:#1d4ed8 !important;
  color:#ffffff !important;
  box-shadow:0 12px 26px rgba(37,99,235,.25) !important;
}
.movements-card .movement-modebar button.movement-mode-btn.active b,
.movements-card .movement-modebar button.active b{
  color:#ffffff !important;
}
.movements-card .movement-modebar button.movement-mode-btn.active span,
.movements-card .movement-modebar button.active span{
  color:#dbeafe !important;
}
.movements-card .movement-modebar button.movement-mode-btn:hover,
.movements-card .movement-modebar button:hover{
  transform:translateY(-1px) !important;
  border-color:#2563eb !important;
}
@media(max-width:900px){
  .movements-card .movement-modebar{
    grid-template-columns:1fr !important;
  }
}
