﻿/* Menu, prodotti, QR pubblico e scorte basse
   Estratto da assets/style.css per rendere il progetto piu manutenibile. */

/* V5.7 - Miglioria form Aggiungi voce menu */
.menu-form-card{
  padding:22px !important;
}
.menu-form-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.menu-form-header h2{
  margin:0 0 6px;
  font-size:20px;
}
.menu-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
.menu-form-grid .field{
  display:flex;
  flex-direction:column;
  gap:7px;
}
.menu-form-grid .field.full{
  grid-column:1 / -1;
}
.menu-form-grid label{
  font-size:13px;
  font-weight:900;
  color:#334155;
  letter-spacing:.01em;
}
.menu-form-grid input,
.menu-form-grid textarea{
  background:#fff !important;
  border:2px solid #cbd5e1 !important;
  border-radius:16px !important;
}
.menu-form-grid textarea{
  min-height:96px;
  resize:vertical;
  padding:12px 14px;
}
.menu-form-help{
  margin-top:16px;
  padding:14px;
  border:1px dashed #cbd5e1;
  border-radius:18px;
  background:#f8fafc;
}
.chips{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.chips button{
  min-height:40px;
  padding:9px 12px;
  font-size:14px !important;
}
.menu-form-actions{
  margin-top:16px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.menu-form-actions button{
  min-height:54px !important;
  font-size:16px !important;
}
.menu-preview-card h3{
  margin:10px 0 6px;
}
.menu-preview-card p{
  min-height:42px;
}
.menu-preview-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
@media(max-width:900px){
  .menu-form-grid,
  .menu-form-actions{
    grid-template-columns:1fr;
  }
}


/* V5.8 - Gestione prodotti, ricerca e stecche */
.product-search-bar{
  margin:16px 0;
  display:grid;
  grid-template-columns:minmax(280px,1fr) auto auto;
  gap:10px;
  align-items:center;
}
.products-table code{
  display:inline-block;
  background:#f1f5f9;
  border:1px solid #dbe4f0;
  border-radius:10px;
  padding:4px 7px;
  font-size:12px;
  color:#0f172a;
}
.action-stack{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.action-stack button{
  min-height:38px;
  padding:7px 10px;
}
.editing-row{
  background:#fffbeb !important;
}
.editing-row input,
.editing-row select{
  min-width:120px;
  height:40px !important;
  font-size:14px !important;
}
@media(max-width:900px){
  .product-search-bar{
    grid-template-columns:1fr;
  }
}


/* V5.10 - riepilogo utile cassa */
.profit-warning-zero{
  margin:10px 0;
  border:1px solid #fbbf24;
  background:#fffbeb;
  color:#92400e;
  border-radius:14px;
  padding:10px 12px;
  font-size:13px;
  font-weight:800;
}


/* V5.11 - importo ricevuto senza perdita focus */
#cash-under-warning{
  border:1px solid #f59e0b;
  background:#fffbeb;
  color:#92400e;
  font-size:15px;
  line-height:1.35;
}


/* V5.13 - ricerca prodotti e test Gratta e Vinci live */
#product_search_live,
#scratch_test_code{
  border:2px solid #2563eb !important;
  background:#ffffff !important;
  font-weight:750 !important;
}
#scratch-test-result .item{
  min-height:70px;
}


/* V5.14 - Clienti/Fornitori/Scadenze/Personale con ricerca e modifica */
.crud-search-bar{
  margin:16px 0;
  display:grid;
  grid-template-columns:minmax(260px,1fr) auto;
  gap:10px;
  align-items:center;
}
.crud-table td,
.crud-table th{
  vertical-align:middle;
}
.field label{
  display:block;
  margin-bottom:6px;
  font-size:13px;
  font-weight:900;
  color:#334155;
}
.crud-actions{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
@media(max-width:900px){
  .crud-search-bar{
    grid-template-columns:1fr;
  }
}


/* V5.16 - Grafici statistiche ed export chiusura */
.stat-chart-card{padding:18px}
.stat-bar-row{
  margin-top:12px;
  border:1px solid #dbe4f0;
  background:#f8fafc;
  border-radius:16px;
  padding:12px;
}
.stat-bar-row small{
  display:block;
  margin-top:6px;
  color:#64748b;
}
.stat-bar-bg{
  height:16px;
  margin-top:8px;
  overflow:hidden;
  border-radius:999px;
  background:#e2e8f0;
}
.stat-bar-fill{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#0f172a,#10b981);
  transition:width .35s ease;
}
.export-links{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:10px;
}
.buttonlike{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  border:2px solid #cbd5e1;
  background:white;
  color:#0f172a;
  min-height:42px;
  padding:8px 14px;
  font-weight:900;
  text-decoration:none;
}
.buttonlike:hover{
  border-color:#10b981;
  background:#ecfdf5;
}
.qr-table-grid{
  align-items:stretch;
}
.qr-table-card{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.qr-table-img{
  width:180px;
  height:180px;
  align-self:center;
  border:1px solid #dbe4f0;
  border-radius:8px;
  background:#fff;
  padding:8px;
}
.qr-table-card input{
  font-size:12px;
}
.qr-conto-card{
  border-color:#bfdbfe!important;
  box-shadow:0 12px 28px rgba(37,99,235,.08)!important;
}
.qr-order-card{
  border-left:5px solid #2563eb;
}
.qr-order-line-wrap{
  padding:8px 0;
  border-bottom:1px solid #e2e8f0;
}
.qr-category-list{
  margin-top:12px;
}
.qr-admin-category-block{
  margin-top:18px;
}
.qr-admin-category-block h3{
  margin:0 0 10px;
}
.menu-preview-icon{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#fff7ed;
  color:#9a3412;
  border:1px solid #fed7aa;
  font-weight:1000;
}

body.public-menu-body{
  margin:0;
  background:#f4f6f8;
  color:#151b23;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}
.qr-public-shell{
  width:min(1380px,100%);
  margin:0 auto;
  padding:18px;
  padding-bottom:88px;
}
.qr-public-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:18px 0 14px;
}
.qr-public-header h1{
  font-size:34px;
  line-height:1.05;
  margin:0;
}
.qr-public-kicker{
  margin:0 0 4px;
  color:#047857;
  font-weight:900;
  text-transform:uppercase;
  font-size:12px;
}
.qr-public-cart-shortcut{
  border-radius:8px;
  background:#151b23;
}
.qr-public-cart-shortcut span{
  display:inline-grid;
  place-items:center;
  min-width:24px;
  height:24px;
  margin-left:6px;
  border-radius:999px;
  background:#f97316;
  color:#fff;
}
.qr-public-main{
  display:grid;
  grid-template-columns:210px minmax(0,1fr) 360px;
  gap:14px;
  align-items:start;
}
.qr-public-categories,
.qr-public-cart{
  position:sticky;
  top:12px;
  background:#fff;
  border:1px solid #d8dee6;
  border-radius:8px;
  padding:12px;
}
.qr-public-panel-title{
  font-size:13px;
  font-weight:1000;
  color:#4b5563;
  text-transform:uppercase;
  margin-bottom:10px;
}
.qr-public-category-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.qr-public-category-list button{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  width:100%;
  min-height:46px;
  border-radius:8px;
  border:1px solid #d8dee6;
  background:#fff;
  color:#151b23;
}
.qr-public-category-list button.active{
  background:#0f766e;
  border-color:#0f766e;
  color:#fff;
}
.qr-public-category-list b{
  min-width:28px;
  height:24px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:#eef2f7;
  color:#334155;
}
.qr-public-category-list button.active b{
  background:#fff;
  color:#0f766e;
}
.qr-public-search{
  margin-bottom:12px;
}
.qr-public-search input{
  height:50px;
  border-radius:8px;
  border:1px solid #cbd5e1;
  background:#fff;
}
.qr-public-product-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.qr-product-tile{
  display:grid;
  grid-template-columns:82px minmax(0,1fr);
  gap:12px;
  min-height:166px;
  background:#fff;
  border:1px solid #d8dee6;
  border-radius:8px;
  padding:12px;
}
.qr-product-mark{
  width:82px;
  height:82px;
  border-radius:8px;
  display:grid;
  place-items:center;
  align-self:start;
  background:#fff7ed;
  color:#9a3412;
  border:1px solid #fed7aa;
  font-size:26px;
  font-weight:1000;
  overflow:hidden;
}
.qr-product-content{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.qr-product-content h2{
  margin:0;
  font-size:18px;
  line-height:1.2;
}
.qr-product-content p{
  margin:0;
  color:#64748b;
  font-size:13px;
  line-height:1.35;
  min-height:34px;
}
.qr-product-meta{
  color:#2563eb;
  font-size:12px;
  font-weight:900;
}
.qr-product-bottom{
  margin-top:auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.qr-product-bottom b{
  font-size:18px;
}
.qr-qty-control{
  display:inline-grid;
  grid-template-columns:38px 34px 38px;
  align-items:center;
  border:1px solid #cbd5e1;
  border-radius:8px;
  overflow:hidden;
  background:#fff;
}
.qr-qty-control button{
  height:38px;
  border-radius:0;
  background:#151b23;
}
.qr-qty-control span{
  text-align:center;
  font-weight:1000;
}
.qr-public-cart{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.qr-public-cart input,
.qr-public-cart textarea{
  border-radius:8px;
}
.qr-cart-line{
  border:1px solid #d8dee6;
  border-radius:8px;
  padding:10px;
  background:#f8fafc;
  margin:8px 0;
}
.qr-cart-line-head,
.qr-cart-line-body,
.qr-public-total-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.qr-cart-line-head b{
  display:block;
}
.qr-cart-line-head small{
  color:#64748b;
}
.qr-cart-line-head button{
  width:32px;
  height:32px;
  padding:0;
  border-radius:8px;
  background:#ef4444;
}
.qr-cart-line-body{
  margin-top:8px;
}
.qr-line-note{
  margin-top:8px;
  height:38px;
}
.qr-public-total-row{
  padding-top:10px;
  border-top:1px solid #d8dee6;
  font-size:18px;
}
.qr-public-send{
  min-height:52px;
  border-radius:8px;
  font-size:16px;
}
.qr-public-empty{
  background:#fff;
  border:1px dashed #cbd5e1;
  border-radius:8px;
  padding:26px;
  color:#64748b;
  text-align:center;
}
.qr-public-empty.small{
  padding:16px;
}
.qr-public-error,
.qr-public-success{
  background:#fff;
  border:1px solid #d8dee6;
  border-left:6px solid #ef4444;
  border-radius:8px;
  padding:16px;
  margin-bottom:14px;
}
.qr-public-success{
  border-left-color:#059669;
}
.qr-mobile-cart-bar{
  display:none;
}
@media(max-width:1180px){
  .qr-public-main{
    grid-template-columns:170px minmax(0,1fr);
  }
  .qr-public-cart{
    grid-column:1/-1;
    position:static;
  }
}
@media(max-width:760px){
  .qr-public-shell{
    padding:12px;
    padding-bottom:92px;
  }
  .qr-public-header{
    align-items:flex-start;
  }
  .qr-public-header h1{
    font-size:28px;
  }
  .qr-public-main{
    display:block;
  }
  .qr-public-categories{
    position:sticky;
    top:0;
    z-index:20;
    margin-bottom:10px;
    padding:10px;
  }
  .qr-public-category-list{
    flex-direction:row;
    overflow:auto;
    padding-bottom:4px;
  }
  .qr-public-category-list button{
    min-width:138px;
  }
  .qr-public-product-grid{
    grid-template-columns:1fr;
  }
  .qr-product-tile{
    grid-template-columns:70px minmax(0,1fr);
    min-height:150px;
  }
  .qr-product-mark{
    width:70px;
    height:70px;
    font-size:22px;
  }
  .qr-public-cart{
    position:static;
    margin-top:12px;
  }
  .qr-mobile-cart-bar{
    position:fixed;
    left:12px;
    right:12px;
    bottom:12px;
    z-index:50;
    display:flex;
    align-items:center;
    justify-content:space-between;
    min-height:56px;
    border-radius:8px;
    background:#151b23;
    box-shadow:0 14px 34px #0003;
  }
}
@media print{
  nav,.nav,.topbar,.multi-pc-status,button,.buttonlike{display:none!important}
  .card{box-shadow:none!important;break-inside:avoid}
}

@media print{
  body.stats-screen-print-mode main{
    display:block!important;
  }
  body.stats-screen-print-mode .stat-control-panel{
    box-shadow:none!important;
    border:0!important;
    padding:0 0 10px!important;
    margin-bottom:10px!important;
  }
  body.stats-screen-print-mode .stat-control-panel .stats-compact-grid,
  body.stats-screen-print-mode .stat-control-panel .stat-quick-actions,
  body.stats-screen-print-mode .stat-control-panel .badge{
    display:none!important;
  }
  body.stats-screen-print-mode .card{
    border:1px solid #dbe4f0!important;
    background:#fff!important;
  }
  body.stats-screen-print-mode .stat-line-wrap{
    overflow:visible!important;
  }
}

.stats-print-report{
  display:none;
}
@media print{
  body.stats-print-mode .topbar,
  body.stats-print-mode .nav,
  body.stats-print-mode .multi-pc-status,
  body.stats-print-mode main{
    display:none!important;
  }
  body.stats-print-mode #stats_print_report{
    display:block!important;
  }
  .stats-print-page{
    color:#111827;
    background:#fff;
    font-family:Arial,Helvetica,sans-serif;
    padding:0;
  }
  .stats-print-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    border-bottom:2px solid #111827;
    padding-bottom:14px;
    margin-bottom:14px;
  }
  .stats-print-header h1{
    font-size:22px;
    margin:0 0 6px;
  }
  .stats-print-header p{
    margin:0;
    color:#374151;
    font-size:12px;
  }
  .stats-print-summary{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:8px;
    margin:14px 0;
  }
  .stats-print-summary div{
    border:1px solid #d1d5db;
    padding:10px;
  }
  .stats-print-summary span{
    display:block;
    color:#4b5563;
    font-size:11px;
  }
  .stats-print-summary b{
    display:block;
    margin-top:4px;
    font-size:18px;
  }
  .stats-print-section{
    break-inside:avoid;
    margin-top:18px;
  }
  .stats-print-section h2{
    font-size:16px;
    margin:0 0 8px;
  }
  .stats-print-section table{
    width:100%;
    border-collapse:collapse;
    font-size:11px;
  }
  .stats-print-section th,
  .stats-print-section td{
    border:1px solid #d1d5db;
    padding:6px 7px;
    text-align:left;
  }
  .stats-print-section th{
    background:#f3f4f6;
    color:#111827;
  }
}


/* V5.17 - Prodotti: filtro Bar/Tabacchi e aggiunta diretta in cassa */
.product-search-bar-v517{
  grid-template-columns:minmax(260px,1fr) 180px auto auto;
}
.product-search-bar-v517 select{
  height:48px;
  border:2px solid #cbd5e1;
  border-radius:14px;
  background:#fff;
  padding:0 12px;
  font-weight:800;
  color:#0f172a;
}
.product-filter-hint{
  margin:10px 0 14px;
  border:1px solid #bfdbfe;
  background:#eff6ff;
  color:#1e3a8a;
  border-radius:14px;
  padding:10px 12px;
  font-size:14px;
}
.product-cart-actions button{
  min-height:36px;
  padding:7px 10px;
}
.products-table th:nth-child(10),
.products-table td:nth-child(10){
  min-width:220px;
}
@media(max-width:900px){
  .product-search-bar-v517{
    grid-template-columns:1fr;
  }
}


/* V5.18 - Switch lingua IT / 中文 */
.topbar-actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.lang-switch{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid #cbd5e1;
  background:#ffffff;
  border-radius:999px;
  padding:5px;
  box-shadow:0 6px 16px rgba(15,23,42,.06);
}
.lang-switch span{
  padding:0 6px;
  font-size:12px;
  font-weight:900;
  color:#475569;
}
.lang-switch button{
  min-height:34px!important;
  height:34px!important;
  padding:4px 10px!important;
  border-radius:999px!important;
  border:0!important;
  background:transparent!important;
  color:#0f172a!important;
  box-shadow:none!important;
  font-size:13px!important;
}
.lang-switch button.active{
  background:#0f172a!important;
  color:#ffffff!important;
}
.lang-switch button:hover{
  background:#ecfdf5!important;
  color:#064e3b!important;
  transform:none!important;
}
.lang-switch button.active:hover{
  background:#0f172a!important;
  color:#ffffff!important;
}
.login-card .lang-switch{
  margin-left:auto;
}
html[lang="zh-CN"] body,
.lang-cn{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
}
@media(max-width:900px){
  .topbar-actions{
    width:100%;
    justify-content:flex-start;
  }
}


/* V5.19 - Scorte basse molto più visibili */
.low-stock-list{
  margin-top:12px;
  display:grid;
  gap:12px;
}
.low-stock-row{
  border-radius:18px;
  padding:14px;
  border:2px solid #fed7aa;
  background:linear-gradient(180deg,#fff7ed,#fffbeb);
  box-shadow:0 10px 24px rgba(245,158,11,.10);
}
.low-stock-row.critical{
  border-color:#ef4444;
  background:linear-gradient(180deg,#fef2f2,#fff7ed);
  box-shadow:0 12px 30px rgba(239,68,68,.15);
  animation:stockPulse 2.2s ease-in-out infinite;
}
.low-stock-row.warning{
  border-color:#f59e0b;
}
.low-stock-main{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.low-stock-name{
  font-size:17px;
  font-weight:1000;
  color:#0f172a;
}
.low-stock-meta{
  margin-top:3px;
  font-size:13px;
  font-weight:700;
  color:#64748b;
}
.low-stock-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:1000;
  white-space:nowrap;
}
.low-stock-badge.critical{
  background:#dc2626;
  color:#fff;
}
.low-stock-badge.warning{
  background:#f59e0b;
  color:#111827;
}
.low-stock-numbers{
  margin-top:12px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}
.low-stock-numbers div{
  border-radius:14px;
  background:rgba(255,255,255,.82);
  border:1px solid rgba(203,213,225,.9);
  padding:9px;
  text-align:center;
}
.low-stock-numbers span{
  display:block;
  font-size:11px;
  font-weight:900;
  color:#64748b;
  text-transform:uppercase;
}
.low-stock-numbers b{
  display:block;
  margin-top:2px;
  font-size:21px;
  font-weight:1000;
  color:#0f172a;
}
.low-stock-row.critical .low-stock-numbers b{
  color:#b91c1c;
}
.low-stock-progress{
  margin-top:12px;
  height:13px;
  overflow:hidden;
  border-radius:999px;
  background:#fee2e2;
}
.low-stock-progress div{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#ef4444,#f59e0b);
}
.low-stock-row.warning .low-stock-progress{
  background:#fef3c7;
}
.low-stock-row.warning .low-stock-progress div{
  background:linear-gradient(90deg,#f59e0b,#fbbf24);
}
@keyframes stockPulse{
  0%,100%{box-shadow:0 12px 30px rgba(239,68,68,.12)}
  50%{box-shadow:0 16px 42px rgba(239,68,68,.28)}
}
@media(max-width:650px){
  .low-stock-numbers{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}



/* V5.98 - calcolo automatico prezzo/costo per monopolio e aggio */
.new-product-manual .auto-margin-box{
  grid-column:1 / -1;
  border:1px solid #cbd5e1;
  background:#f8fafc;
  border-radius:18px;
  padding:14px;
}
.new-product-manual .auto-margin-switch{
  display:flex;
  align-items:flex-start;
  gap:12px;
  cursor:pointer;
  color:#0f172a;
}
.new-product-manual .auto-margin-switch input{
  width:22px;
  height:22px;
  margin-top:3px;
  accent-color:#2563eb;
}
.new-product-manual .auto-margin-switch span{
  display:flex;
  flex-direction:column;
  gap:3px;
  line-height:1.25;
}
.new-product-manual .auto-margin-switch small,
.new-product-manual .auto-margin-example{
  color:#64748b;
  font-size:13px;
}
.new-product-manual .auto-margin-example{
  margin-top:10px;
  padding:9px 10px;
  border-radius:12px;
  background:white;
  border:1px dashed #cbd5e1;
}
.new-product-manual .auto-margin-hint{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  background:white;
  color:#334155;
  border:1px solid #e2e8f0;
  font-size:13px;
}
.new-product-manual .auto-margin-hint.ok{
  background:#eff6ff;
  border-color:#bfdbfe;
  color:#1e3a8a;
}
.new-product-manual .auto-margin-hint.warn{
  background:#fff7ed;
  border-color:#fed7aa;
  color:#9a3412;
}
.new-product-manual .auto-margin-hint.off{
  background:#f8fafc;
  color:#64748b;
}
