/* File: assets/css/style.css - Versione Finale Definitiva */
:root {
    --primary-color: #007bff;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #333;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: var(--bg-color); color: var(--text-color); padding-bottom: 60px; }
header { background-color: var(--primary-color); color: white; padding: 0.75rem 1rem; text-align: center; position: sticky; top: 0; z-index: 10; }
.app-brand { display: block; font-size: 0.8rem; font-weight: 300; opacity: 0.9; margin-bottom: 0.25rem; }
header h1 { margin: 0; font-size: 1.5rem; }
main { padding: 1rem; }
img { max-width: 100%; height: auto; }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; background-color: var(--card-bg); box-shadow: 0 -2px 5px rgba(0,0,0,0.1); height: 60px; z-index: 10; }
.nav-item { flex-grow: 1; text-align: center; padding: 1rem 0; text-decoration: none; color: var(--text-color); border: none; background: none; cursor: pointer; font-size: 1rem; }
.nav-item.active { color: var(--primary-color); font-weight: bold; }
a { color: var(--primary-color); text-decoration: none; }

/* Controlli e Liste */
.filter-container { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; align-items: center; }
.filter-container input, .filter-container select, .filter-container button { padding: 0.75rem; border: 1px solid #ccc; border-radius: 5px; font-size: 0.9rem; height: 44px; }
.filter-container input[type="text"] { flex-grow: 1; }
.filter-container button { background-color: var(--primary-color); color: white; border: none; cursor: pointer; }
.period-buttons { display: flex; gap: 0.5rem; }
.period-buttons button { background-color: #6c757d; }
.pagination-controls { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.loading-message { text-align: center; padding: 2rem; color: #888; }
.error-message { text-align: center; color: red; }

/* Card e Layout */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.detail-card, .kpi-card { background: var(--card-bg); padding: 1.5rem; margin-bottom: 1.5rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.kpi-card { text-align: center; padding: 1rem; }
.kpi-value { font-size: 1.5rem; font-weight: bold; }
.kpi-label { font-size: 0.9rem; color: #666; }
.chart-wrapper { margin-top: 1.5rem; }

.product-card { background: var(--card-bg); border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); display: flex; align-items: center; margin-bottom: 1rem; }
.product-card-link { display: block; text-decoration: none; color: inherit; }
.product-card img { width: 100px; height: 100px; object-fit: cover; flex-shrink: 0; }
.product-info { padding: 1rem; width: 100%; }
.order-item { background: var(--card-bg); padding: 1rem; margin-bottom: 1rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); border-left: 5px solid #ccc; cursor: pointer; }
.order-item-header { display: flex; justify-content: space-between; align-items: center; }
.order-status { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 12px; color: white; font-size: 0.8rem; float: right; }

/* Dettagli */
.detail-card h2 { margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 0.5rem; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.back-button { display: inline-block; margin-bottom: 1rem; padding: 0.5rem 1rem; background: #6c757d; color: white; border-radius: 5px; cursor: pointer; border: none; font-size: 1rem; }
.main-image-container img { border-radius: 8px; }
.thumbnails { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.thumbnails img { width: 60px; height: 60px; object-fit: cover; border-radius: 5px; cursor: pointer; border: 2px solid transparent; }
.thumbnails img.active { border-color: var(--primary-color); }
.features-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.features-table td { padding: 0.75rem; border-bottom: 1px solid #eee; }
.features-table td:first-child { font-weight: bold; width: 40%; }
.product-previews { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #f0f0f0; display: flex; gap: 0.5rem; }
.product-preview-img { width: 80px; height: 80px; object-fit: cover; border-radius: 5px; border: 1px solid #eee; }

/* --- STILI PER PAGINE ACCOUNT, LOGIN E MENU --- */
.auth-card { max-width: 500px; margin: 2rem auto; }
.login-logo-container { text-align: center; margin-bottom: 1.5rem; }
.login-logo-container img { width: 80px; height: 80px; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.form-group input { width: 100%; padding: 0.75rem; border: 1px solid #ccc; border-radius: 5px; font-size: 1rem; }
.form-button { width: 100%; padding: 0.75rem; font-size: 1rem; background-color: var(--primary-color); color: white; border: none; border-radius: 5px; cursor: pointer; }
.form-link { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; }
#stores-list ul { list-style: none; padding: 0; margin: 0; }
#stores-list li { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem; border-bottom: 1px solid #eee; }
#stores-list li:last-child { border-bottom: none; }
#stores-list span { word-break: break-all; padding-right: 1rem; }
.delete-store-btn { background-color: #dc3545; color: white; border: none; border-radius: 5px; cursor: pointer; padding: 0.4rem 0.8rem; font-size: 0.8rem; flex-shrink: 0; }
.menu-link { display: block; padding: 1rem; background-color: var(--bg-color); margin-bottom: 0.75rem; border-radius: 8px; text-align: center; font-weight: 500; transition: background-color 0.2s; }
.menu-link:hover { background-color: #e2e6ea; }
#logout-button { background-color: #fff0c1; color: #664d03; }

/* --- FIX RESPONSIVE PER SMARTPHONE --- */
@media (max-width: 768px) {
    .detail-grid { grid-template-columns: 1fr; }
    main .kpi-grid { grid-template-columns: 1fr 1fr; }
    main .filter-container { flex-direction: column; align-items: stretch; }
    .date-range { display: flex; gap: 0.5rem; }
    .date-range input { flex-grow: 1; }
}