body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    margin: 0;
}

/* Barra di Navigazione superiore */
.nav-tabs {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 600px;
    margin-bottom: 25px;
}
.tab-btn {
    background-color: #e5e7e9;
    color: #7f8c8d;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    font-weight: bold;
}
.tab-btn.active {
    background-color: #2c3e50;
    color: white;
}

/* Gestione visibilità schede flex-column centrate */
.tab-content {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
}
.tab-content.active {
    display: flex;
}

/* Box principale centrato a schermo */
.container {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
    text-align: center;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.main-center-box {
    margin-left: auto;
    margin-right: auto;
}

h1 { color: #2c3e50; font-size: 24px; margin-bottom: 20px; }
textarea {
    width: 100%;
    height: 110px;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    resize: none;
    box-sizing: border-box;
}
textarea:focus { border-color: #3498db; outline: none; }

.pulsantiera {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
button {
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}
.btn-invia { background-color: #2ecc71; }
.btn-invia:hover { background-color: #27ae60; }
.btn-foto { background-color: #3498db; }
.btn-foto:hover { background-color: #2980b9; }

.output {
    margin-top: 20px;
    background: #e8f8f5;
    color: #27ae60;
    border: 1px solid #d4efdf;
    padding: 18px;
    border-radius: 12px;
    text-align: left;
    display: none;
}
.output h3 { 
    margin-top: 0; 
    color: #1e8449; 
    font-size: 18px; 
    display: flex;
    align-items: center;
    gap: 8px;
}
.output ul { margin: 10px 0 0 0; padding-left: 20px; }
.output li { 
    margin-bottom: 6px; 
    font-family: sans-serif; 
    color: #2c3e50;
    list-style-type: none;
    position: relative;
}
.output li::before {
    content: "•";
    color: #2ecc71;
    font-weight: bold;
    display: inline-block; 
    width: 1em;
    margin-left: -1em;
}

.dispensa-box {
    background-color: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
    text-align: left;
    box-sizing: border-box;
    margin-bottom: 20px;
}
.dispensa-box h2 { color: #2c3e50; margin-top: 0; border-bottom: 2px solid #f4f7f6; padding-bottom: 10px; }
.grid-dispensa { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.sezione-dispensa h3 { color: #e67e22; font-size: 16px; margin-bottom: 8px; border-bottom: 1px dashed #f4f7f6; padding-bottom: 4px; }
.prodotto-item {
    display: flex;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 5px;
    font-size: 14px;
}
.quantita { font-weight: bold; color: #2c3e50; }
#anteprimaFoto { max-width: 100%; max-height: 150px; margin-top: 10px; display: none; border-radius: 8px; }

.loading-text {
    color: #7f8c8d;
    font-style: italic;
}

.ricetta-salvata-item {
    background: #f8f9fa;
    border: 1px solid #e5e7e9;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ricetta-salvata-info h4 { margin: 0 0 5px 0; color: #2c3e50; font-size: 16px; }
.ricetta-salvata-info span { font-size: 12px; color: #7f8c8d; }
.ricetta-salvata-azioni { display: flex; gap: 5px; }
.btn-azione-ricetta { padding: 6px 12px; font-size: 12px; border-radius: 15px; width: auto; }

.check-dispensa-box {
    background-color: #fef9e7;
    border: 1px solid #f9e79f;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #7d6608;
    font-size: 14px;
}
.check-dispensa-box ul { margin: 5px 0 0 0; padding-left: 20px; }
.check-dispensa-box li { margin-bottom: 3px; }

.btn-cucina-rapida {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 8px 15px;
    font-size: 14px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    width: auto;
    transition: background 0.3s;
}
.btn-cucina-rapida:hover { background-color: #27ae60; }

.spesa-checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #e5e7e9;
    font-size: 16px;
    cursor: pointer;
}
.spesa-checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}
.spesa-checkbox-item.checked-line {
    text-decoration: line-through;
    color: #bcbbbb;
    background-color: #f2f4f4;
    border-color: #e5e7e9;
}

.alert-item-scorte {
    background-color: #fdf2e9;
    color: #d35400;
    border-left: 4px solid #e67e22;
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}