/* General Styles */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    background-color: #f0f2f5; 
    color: #34495e;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background-color: #2E4E6F;
    color: #ffffff;
    padding: 15px 30px;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
}
.header-left { justify-self: start; }
.header-center { justify-self: center; }
.header-right {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 15px;
}
.logo { font-size: 30px; font-weight: 700; color: #ffffff; letter-spacing: 0.5px; margin: 0; }
.home-button { background: none; border: none; color: #ffffff; font-size: 26px; cursor: pointer; transition: color 0.3s ease; padding: 0; }
.home-button:hover { color: #a9cce3; }

/* Account Menu */
.account-menu { position: relative; display: inline-block; }
.account-button {
    background-color: rgba(255,255,255,0.1); color: #ffffff;
    border: 1px solid rgba(255,255,255,0.2); padding: 10px 20px;
    border-radius: 25px; cursor: pointer; font-size: 16px;
    display: flex; align-items: center; transition: background-color 0.3s ease;
}
.account-button:hover { background-color: rgba(255,255,255,0.2); }
.account-button .arrow-down { margin-left: 8px; font-size: 12px; }
.dropdown-content {
    display: none; position: absolute; background-color: #ffffff;
    min-width: 180px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 100; border-radius: 8px; right: 0; top: 100%;
    margin-top: 10px; overflow: hidden; border: 1px solid #e0e0e0;
}
.dropdown-content a { color: #3d3d3d; padding: 12px 16px; text-decoration: none; display: block; transition: all 0.2s ease; }
.dropdown-content a:hover { background-color: #f0f2f5; color: #2E4E6F; }
.account-menu .dropdown-content.show { display: block; }


/* Page Layout */
.main-container { flex: 1; padding: 30px; display: flex; justify-content: center; }
.page-section {
    width: 100%;
    max-width: 1100px;
    text-align: center;
    box-sizing: border-box;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.page-section.active { display: block; opacity: 1; transform: translateY(0); }
#input-detail-page { text-align: left; }
#input-pages-container { position: relative; }

.input-page {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    padding: 40px;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.4s ease-out;
}
.input-page.active { display: flex; opacity: 1; z-index: 10; }

/* Page Headers */
.page-header-with-back {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 15px;
    flex-shrink: 0;
    width: 100%;
}
.page-header-with-back h3 {
    margin: 0;
    color: #2E4E6F;
    font-size: 28px;
    font-weight: 700;
    text-align: left;
}
.back-button {
    background-color: #7b8a9b; color: #ffffff; border: none;
    padding: 10px 18px; border-radius: 25px; cursor: pointer;
    font-size: 16px; display: flex; align-items: center; gap: 8px;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.back-button:hover { background-color: #5c6a79; }

/* Big Step Buttons */
.step-buttons-grid, .goods-in-buttons-grid {
    display: inline-grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    width: 100%;
}
.big-step-button {
    background-color: #ffffff; border: 1px solid #e0e0e0;
    color: #34495e; padding: 30px 20px; border-radius: 8px;
    font-size: 18px; font-weight: 700; text-align: center;
    cursor: pointer; transition: all 0.3s ease; display: flex;
    flex-direction: column; align-items: center; justify-content: center;
    min-height: 150px; box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.big-step-button i { font-size: 45px; margin-bottom: 15px; color: #2E4E6F; transition: color 0.3s ease; }
.big-step-button:hover {
    transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: #e67e22;
}
.big-step-button:hover i { color: #e67e22; }

/* Manual Form Styles */
.manual-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.form-group { display: flex; flex-direction: column; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { margin-bottom: 8px; font-weight: 600; color: #2E4E6F; font-size: 14px; text-align: left; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 8px;
    background-color: #f8f9fa; font-size: 16px; box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: 'Roboto', sans-serif;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #2E4E6F;
    box-shadow: 0 0 0 3px rgba(46, 78, 111, 0.2);
}
.submit-btn {
    width: 100%; padding: 15px; border: none; border-radius: 8px; background-color: #27ae60;
    color: white; font-size: 18px; font-weight: 600; cursor: pointer; transition: all 0.3s;
    display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px;
}
.submit-btn:hover { background-color: #219150; transform: translateY(-2px); }

/* --- STILI PAGINE SPECIFICHE --- */
.inventory-controls { display: flex; gap: 15px; margin-bottom: 20px; align-items: center; }
.inventory-controls input[type="search"], .inventory-controls select { padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 14px; }
.inventory-controls input[type="search"] { flex-grow: 1; }
.icon-btn {
    background: #f0f2f5; border: 1px solid #ccc; color: #555;
    padding: 0; width: 40px; height: 40px; border-radius: 8px;
    cursor: pointer; font-size: 16px; transition: all 0.2s ease;
    flex-shrink: 0;
}
.icon-btn:hover { background-color: #e0e0e0; border-color: #aaa; }

.inventory-controls-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-grow: 1;
}
.inventory-controls-row select {
    flex-grow: 1;
}

.inventory-table-container {
    max-height: 400px; 
    overflow-y: auto; 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: max-height 0.5s ease-in-out;
}
.inventory-table-container.collapsed-view {
    max-height: 270px;
    overflow-y: auto;
}
.inventory-table-container table { width: 100%; border-collapse: collapse; }
.inventory-table-container th, .inventory-table-container td { 
    padding: 12px 15px; 
    text-align: left; 
    border-bottom: 1px solid #ecf0f1; 
}
.inventory-table-container td:first-child,
.inventory-table-container th:first-child {
    min-width: 150px;
}

.inventory-table-container thead th { background-color: #ecf0f1; color: #34495e; font-weight: 600; font-size: 14px; position: sticky; top: 0; z-index: 2; }
.inventory-summary {
    margin-top: 20px;
    padding: 15px 20px;
    background-color: #e9ecef;
    border-radius: 8px;
    text-align: right;
}
.inventory-summary h4 { margin: 0; font-size: 18px; color: #2c3e50; font-weight: 500; }
.inventory-summary span { font-weight: 700; margin-left: 15px; }

#camera-simulation-page, #voice-input-page-content { align-items: center; text-align: center; }
.camera-preview-container {
    width: 100%; max-width: 400px; margin-bottom: 20px;
    aspect-ratio: 1 / 1; display: flex; justify-content: center;
    align-items: center; background-color: #34495e; border-radius: 10px;
    color: #ffffff;
}
.camera-viewfinder { width: 90%; height: 90%; border: 2px dashed #ffffff; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.camera-viewfinder i { font-size: 80px; margin-bottom: 15px; }
.camera-controls { display: flex; justify-content: center; gap: 20px; width: 100%; }
.input-btn {
    background-color: #e67e22; color: white; border: none;
    padding: 12px 25px; border-radius: 8px; cursor: pointer;
    font-size: 16px; font-weight: 600; transition: all 0.3s;
    display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.input-btn:hover { background-color: #d35400; transform: translateY(-2px); }

.voice-input-container { display: flex; flex-direction: column; align-items: center; gap: 30px; margin-top: 50px; flex-grow: 1; justify-content: center; text-align: center; }
.voice-mic-container { display: flex; flex-direction: column; align-items: center; gap: 15px; }
#microphone-btn { background-color: #3498db; color: #ffffff; border-radius: 50%; width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; box-shadow: 0 5px 15px rgba(0,0,0,0.2); border: none; cursor: pointer; }
#microphone-btn i { font-size: 50px; color: #ffffff; }
#microphone-btn:hover { background-color: #2980b9; transform: scale(1.05); }
#microphone-btn.recording { background-color: #c0392b; animation: pulse-red 1.5s infinite; }
#mic-label { font-size: 16px; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: 0.5px; }
.output-section { background-color: #eaf6ec; border-left: 5px solid #27ae60; padding: 25px; border-radius: 8px; margin-top: 30px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); text-align: left; flex-shrink: 0; }
.output-section h4 { color: #27ae60; font-size: 20px; margin-top: 0; margin-bottom: 15px; font-weight: 600;}
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.7); } 70% { box-shadow: 0 0 0 20px rgba(192, 57, 43, 0); } 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); } }

/* --- STILI DASHBOARD --- */
#kitchen-dashboard-content,
#management-dashboard-content { background-color: transparent; padding: 0; box-shadow: none; }
#kitchen-dashboard-content .page-header-with-back,
#management-dashboard-content .page-header-with-back { padding: 0 0 15px 0; margin: 0 0 20px 0; border-color: #dce1e6; }
.new-dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.new-dashboard-grid.kitchen-dash { grid-template-columns: 1fr 1fr; }
.new-dash-card { background-color: #ffffff; border-radius: 8px; padding: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); border: 1px solid #e0e0e0; text-align: left; display: flex; flex-direction: column; }
.new-dash-card.full-width { grid-column: 1 / -1; }
.new-dash-card.tall { grid-row: span 2; }
.new-card-title { margin: 0 0 20px 0; font-size: 16px; font-weight: 700; color: #2E4E6F; flex-shrink: 0; }
.kpi-card { text-align: center; justify-content: center; }
.kpi-title { font-size: 14px; color: #7f8c8d; margin: 0 0 5px 0; font-weight: 700; text-transform: uppercase; }
.kpi-amount { font-size: 36px; color: #2c3e50; margin: 0; font-weight: 700; }
.kpi-change { font-size: 14px; }
.kpi-change.up { color: #27ae60; }
.kpi-change.down { color: #c0392b; }
.bar-chart-v { display: flex; justify-content: space-around; align-items: flex-end; width: 100%; flex-grow: 1; }
.bar-wrapper { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar-chart-v .bar { width: 25px; background-color: #3498db; border-radius: 4px 4px 0 0; }
.bar-label-month { font-size: 12px; color: #7f8c8d; margin-top: 6px; }
.bar-chart-h { display: flex; flex-direction: column; gap: 15px; flex-grow: 1; justify-content: center; }
.bar-item { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.bar-label { width: 70px; color: #555; }
.bar-bg { flex-grow: 1; background-color: #ecf0f1; border-radius: 4px; height: 20px; }
.bar-fg { height: 100%; border-radius: 4px; }
.bar-perc { font-weight: 700; width: 35px; text-align: right; }
.bar-fg.food { background-color: #f39c12; }
.bar-fg.beverage { background-color: #16a085; }
.bar-fg.dessert { background-color: #27ae60; }
.bar-fg.other { background-color: #7f8c8d; }
.prep-list-table, .hot-items-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prep-list-table th, .prep-list-table td, .hot-items-table th, .hot-items-table td { text-align: left; padding: 10px 5px; border-bottom: 1px solid #ecf0f1; }
.priority.high { color: #c0392b; font-weight: 600; }
.priority.medium { color: #f39c12; font-weight: 600; }
.status.done { color: #27ae60; }
.status.pending { color: #7f8c8d; }
.inventory-column { width: 50%; }
.inventory-column h5 { margin: 0 0 10px 0; font-size: 14px; color: #2c3e50; }
.dash-list { margin: 0; padding-left: 0; font-size: 14px; color: #555; list-style-type: none;}
.dash-list li { margin-bottom: 5px; }
.inventory-column h5:first-of-type { color: #c0392b; }
.menu-engineering-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.quadrant { border: 1px solid #ecf0f1; border-radius: 6px; padding: 15px; text-align: center; }
.quadrant h6 { margin: 0 0 8px 0; font-size: 14px; font-weight: 700; }
.quadrant p { font-size: 13px; margin: 5px 0 0 0; }
.quadrant small { font-size: 12px; font-style: italic; color: #7f8c8d; display: block; margin-bottom: 10px; }
.quadrant.star { background-color: #fef9e7; border-color: #f39c12; }
.quadrant.star h6 { color: #f39c12; }
.quadrant.plow-horse { background-color: #eaf6ec; border-color: #27ae60; }
.quadrant.plow-horse h6 { color: #27ae60; }
.quadrant.puzzle { background-color: #ddebf8; border-color: #3498db; }
.quadrant.puzzle h6 { color: #3498db; }
.quadrant.dog { background-color: #f9eaea; border-color: #c0392b; }
.quadrant.dog h6 { color: #c0392b; }
.hot-items-table .margin.good { color: #27ae60; font-weight: 600; }
.hot-items-table .margin.ok { color: #f39c12; font-weight: 600; }
.chart-with-legend { display: flex; flex-direction: column; align-items: center; gap: 20px; flex-grow: 1; justify-content: center; }
.pie-chart { width: 150px; height: 150px; border-radius: 50%; background-image: conic-gradient( #3498db 0% 70%, #f39c12 70% 85%, #16a085 85% 100% ); flex-shrink: 0; }
.channel-list { display: flex; flex-direction: column; gap: 15px; width: 100%;}
.channel-item { display: flex; align-items: center; gap: 10px; }
.channel-icon { font-size: 10px; }
.channel-icon.dine-in { color: #3498db; }
.channel-icon.takeaway { color: #f39c12; }
.channel-icon.delivery { color: #16a085; }
.channel-label { flex-grow: 1; font-weight: 600; color: #34495e; font-size: 16px; }
.channel-perc { font-size: 16px; font-weight: 700; color: #2c3e50; }

.add-ingredient-section {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr auto;
    gap: 15px;
    align-items: flex-end;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.ingredients-list-container {
    background-color: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    min-height: 100px;
    margin-bottom: 20px;
}
#recipe-ingredients-list { list-style: none; padding: 0; margin: 0; }
#recipe-ingredients-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ecf0f1;
}
#recipe-ingredients-list li:last-child { border-bottom: none; }
.remove-ingredient-btn {
    background: none; border: none;
    color: #c0392b; cursor: pointer;
    font-size: 20px; padding: 0 5px;
}

.add-production-task-section {
    display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 15px;
    align-items: flex-end; background-color: #f8f9fa; padding: 20px;
    border-radius: 8px; margin-bottom: 30px; border: 1px solid #e0e0e0;
}
.submit-btn.small-btn { padding: 10px 20px; font-size: 16px; height: 46px; }
.production-board { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.production-column h4 { margin-top: 0; padding-bottom: 10px; border-bottom: 2px solid #e0e0e0; color: #2E4E6F; }
.task-list { background-color: #f8f9fa; border-radius: 8px; padding: 15px; min-height: 200px; display: flex; flex-direction: column; gap: 15px; }
.task-card { background-color: #ffffff; border-radius: 6px; padding: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); border-left: 5px solid #3498db; }
.task-card.inprogress { border-left-color: #f39c12; }
.task-card h5 { margin: 0 0 5px 0; font-size: 16px; }
.task-card p { margin: 0 0 15px 0; font-size: 14px; color: #7f8c8d; }
.task-card-footer { display: flex; justify-content: flex-end; }
.task-action-btn { background-color: #3498db; color: white; border: none; border-radius: 6px; padding: 8px 12px; cursor: pointer; font-size: 12px; font-weight: 600; transition: background-color 0.2s; }
.task-card.inprogress .task-action-btn { background-color: #27ae60; }
.task-action-btn:hover { opacity: 0.9; }
.completed-tasks-section { background-color: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; }
.completed-tasks-section h4 { margin-top: 0; padding-bottom: 10px; border-bottom: 2px solid #e0e0e0; color: #27ae60; }
#completed-tasks-list { list-style: none; padding: 0; margin: 0; font-size: 14px; }
#completed-tasks-list li { padding: 8px 0; border-bottom: 1px dashed #dce1e6; color: #7f8c8d; }
#completed-tasks-list li:last-child { border-bottom: none; }
#completed-tasks-list li strong { color: #34495e; }


/* MEDIA QUERIES */
@media (max-width: 768px) {
    .header-center { display: none; }
    .page-header-with-back {
        grid-template-columns: auto 1fr;
    }
    .page-header-with-back h3 {
        text-align: left;
    }
    .new-dashboard-grid, .new-dashboard-grid.kitchen-dash, .manual-form, .step-buttons-grid, .goods-in-buttons-grid, .add-production-task-section, .production-board, .add-ingredient-section { grid-template-columns: 1fr; }
    .main-container { padding: 10px; }

    .inventory-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .inventory-controls-row {
        width: 100%;
    }
    
    .inventory-column { width: 100%; }

    .camera-controls {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .camera-controls .input-btn {
        width: 100%;
        max-width: 350px;
        justify-content: center;
    }

    /* Stili per rendere il grafico a barre verticale responsive (PATCH 6.0) */
    .bar-chart-v .bar {
        width: 15px; /* Riduci la larghezza delle barre */
    }
    .bar-label-month {
        font-size: 10px; /* Riduci la dimensione del font delle etichette */
    }
}