:root {
  --primary-green: #9df04d;
  --text-dark: #202124;
  --text-gray: #5f6368;
  --bg-color: #f8f9fa;
  --border-color: #dadce0;
}

* { box-sizing: border-box; font-family: 'Segoe UI', sans-serif; -webkit-tap-highlight-color: transparent; }

body { 
  margin: 0; padding: 0; background-color: var(--bg-color); color: var(--text-dark); 
  height: 100vh; overflow: hidden; 
}

.view { display: none; height: 100%; flex-direction: column; overflow-y: auto; padding: 20px; }
.view.active { display: flex; }

/* Dashboard */
.app-header { margin-bottom: 20px; }
.header-title { font-size: 24px; margin: 0 0 5px 0; }
.header-subtitle { font-size: 14px; color: var(--text-gray); margin: 0; }

.action-bar { margin-bottom: 20px; }
.btn-primary { background: var(--primary-green); color: #111; border: none; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 16px; cursor: pointer; width: 100%; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.btn-primary:active { transform: scale(0.98); }

.list-card { background: #fff; border-radius: 12px; padding: 15px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border: 1px solid var(--border-color); }
.list-card-content { flex-grow: 1; cursor: pointer; }
.list-card-title { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.list-card-meta { font-size: 12px; color: var(--text-gray); }
.list-card-actions { display: flex; gap: 10px; }
.icon-btn { background: none; border: none; padding: 8px; cursor: pointer; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: #f0f0f0; }

/* Vista Dettaglio */
.detail-header-card { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid var(--border-color); margin-bottom: 20px; }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.btn-back { background: #fee2e2; border: none; border-radius: 8px; width: 40px; height: 40px; color: #d93025; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.badge-id { font-family: monospace; background: #f1f3f4; padding: 4px 8px; border-radius: 6px; font-size: 13px; color: var(--text-gray); }
.header-info h2 { margin: 0 0 5px 0; font-size: 20px; }
.header-info p { margin: 0; color: var(--text-gray); font-size: 14px; }

/* Input Scanner & Button */
.scanner-area { margin-bottom: 20px; }
.scanner-area .input-wrapper { display: flex; gap: 10px; width: 100%; }
.scanner-area input { flex-grow: 1; width: 100%; padding: 15px; font-size: 18px; border: 2px solid var(--primary-green); border-radius: 12px; outline: none; text-align: center; box-shadow: 0 4px 10px rgba(157, 240, 77, 0.2); }
.btn-add-manual { background: var(--primary-green); border: none; border-radius: 12px; padding: 0 20px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #111; box-shadow: 0 4px 10px rgba(157, 240, 77, 0.2); transition: transform 0.1s; }
.btn-add-manual:active { transform: scale(0.92); }

/* Lista Items */
.scanned-items-container { background: #fff; border-radius: 16px; padding: 10px 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid var(--border-color); flex-grow: 1; overflow-y: auto; }
.item-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid #f1f3f4; transition: background 0.3s; }
.item-row:last-child { border-bottom: none; }
.item-row.highlight { animation: flashGreen 1s; }
.item-code { font-family: monospace; font-size: 16px; font-weight: 500; }
.item-controls { display: flex; align-items: center; gap: 15px; }
.qty-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-color); background: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation; user-select: none; }
.qty-btn:active { background: #f0f0f0; }
.item-qty { font-size: 18px; font-weight: bold; min-width: 30px; text-align: center; cursor: pointer; }

@keyframes flashGreen {
  0% { background-color: rgba(157, 240, 77, 0.4); }
  100% { background-color: transparent; }
}

/* Modal */
.modal-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 100; display: none; justify-content: center; align-items: center; }
.modal-backdrop.active { display: flex; }
.modal-content { background: #fff; padding: 25px; border-radius: 16px; width: 90%; max-width: 350px; }
.modal-content h3 { margin-top: 0; margin-bottom: 20px; }
.modal-content input { width: 100%; max-width: 100%; box-sizing: border-box; padding: 12px; margin-bottom: 15px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 16px; outline: none; }
.modal-content input:focus { border-color: var(--primary-green); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.btn-text { background: none; border: none; color: var(--text-gray); font-weight: 600; font-size: 16px; cursor: pointer; padding: 10px 15px; }