:root {
    --primary-color: #e74c3c;
    --primary-dark: #c0392b;
    --secondary-color: #3498db;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --gray-color: #95a5a6;
    --light-gray: #f5f5f5;
    --white: #fff;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-gray);
    color: var(--dark-color);
    line-height: 1.6;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    overflow: hidden;
}

.app-header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: var(--white);
}

.step-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    margin-right: 10px;
    font-size: 0.9rem;
}

/* Tavoli */
.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.table-btn {
    aspect-ratio: 1;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    background-color: var(--white);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
}

.table-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.table-btn.selected {
    background-color: var(--primary-color);
    color: var(--white);
}

.custom-table-input {
    margin-top: 10px;
}

.custom-table-input label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.custom-table-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-color);
    border-radius: 5px;
    font-size: 1rem;
}

/* Coperti */
.covers-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.cover-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#coversCount {
    font-size: 2rem;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

/* Categorie */
.category-tabs {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    padding: 8px 15px;
    white-space: nowrap;
    background-color: var(--light-gray);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
}

.category-tab.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Piatti */
.dishes-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.dish-card {
    background-color: var(--white);
    border-radius: 10px;
    padding: 15px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dish-info {
    flex: 1;
}

.dish-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.dish-price {
    color: var(--primary-color);
    font-weight: bold;
}

.add-dish-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

/* Riepilogo */
.order-summary {
    background-color: var(--light-gray);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.order-summary h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.order-items {
    margin: 15px 0;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--gray-color);
}

.order-item:last-child {
    border-bottom: none;
}

.item-name {
    flex: 1;
}

.item-qty {
    margin: 0 10px;
    font-weight: bold;
}

.item-price {
    font-weight: bold;
    color: var(--primary-color);
    min-width: 60px;
    text-align: right;
}

.item-edit {
    margin-left: 10px;
    color: var(--secondary-color);
    background: none;
    border: none;
    cursor: pointer;
}

.empty-message {
    color: var(--gray-color);
    text-align: center;
    padding: 20px 0;
    font-style: italic;
}

.order-total {
    text-align: right;
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 10px;
}

.notes-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.notes-section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-color);
    border-radius: 5px;
    min-height: 100px;
    resize: vertical;
}

/* Footer */
.app-footer {
    background-color: var(--white);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    bottom: 0;
}

.btn {
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--white);
}

.step-indicator {
    display: flex;
    gap: 8px;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--gray-color);
}

.step-dot.active {
    background-color: var(--primary-color);
}

/* Modali */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

.modal-content.small {
    max-width: 300px;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-color);
}

.orders-list {
    margin-top: 15px;
}

.order-modal-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--light-gray);
}

.order-modal-item:last-child {
    border-bottom: none;
}

.order-modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.order-modal-table {
    font-weight: bold;
    color: var(--primary-color);
}

.order-modal-date {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.order-modal-dishes {
    font-size: 0.9rem;
    color: var(--dark-color);
}

/* Modale quantità */
.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#currentQuantity {
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* Responsive */
@media (min-width: 768px) {
    .dishes-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (min-width: 992px) {
    .dishes-container {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* Stili aggiuntivi per la modale ordini */
.order-modal-item {
    padding: 15px;
    margin-bottom: 10px;
    background-color: var(--light-gray);
    border-radius: 8px;
    position: relative;
}

.order-modal-notes {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--gray-color);
    font-size: 0.9rem;
    color: var(--dark-color);
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
    margin-top: 10px;
}

.mark-completed {
    background-color: var(--success-color);
    width: 100%;
}

.mark-completed:hover {
    background-color: #27ae60;
}
.order-modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: bold;
}

.order-modal-dishes {
    margin: 8px 0;
    line-height: 1.4;
}

.order-modal-total {
    font-weight: bold;
    color: var(--primary-color);
    margin: 8px 0;
}

.order-modal-notes {
    padding: 8px;
    background-color: #fff8e1;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 0.9rem;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    margin-top: 10px;
}

.mark-completed {
    background-color: var(--success-color);
    width: 100%;
}

.mark-completed:hover {
    background-color: #27ae60;
}
.order-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.order-actions .btn {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-edit {
    background-color: #ffc107;
    color: #000;
}

.btn-edit:hover {
    background-color: #e0a800;
}

.btn-delete {
    background-color: #dc3545;
}

.btn-delete:hover {
    background-color: #c82333;
}

.btn-complete {
    background-color: #28a745;
}

.btn-complete:hover {
    background-color: #218838;
}
/* Aggiungi questi stili */
.item-info {
    flex: 1;
    margin-right: 10px;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-qty-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.qty-btn {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.item-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.1rem;
}

.item-notes {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-color);
    margin-top: 3px;
}

/* Aggiungi questi stili */
.table-btn.selected {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary-color);
}

.step-dot.hidden {
    display: none;
}

.edit-mode .table-section,
.edit-mode .covers-section {
    opacity: 0.5;
    pointer-events: none;
}

.edit-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--secondary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}