* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 25%, #d1fae5 50%, #a7f3d0 75%, #6ee7b7 100%);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    color: #1a1a1a;
    min-height: 100vh;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 200px;
    background: white;
    border-right: 1px solid #e5e7eb;
    padding: 20px 0;
    z-index: 100;
}

.main-content {
    margin-left: 200px;
    padding: 40px;
    min-height: 100vh;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 30px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: #10b981;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 700;
}

.logo-text {
    font-weight: 700;
    font-size: 16px;
    color: #1a1a1a;
}

.logo-subtitle {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin: 4px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}

.nav-item:hover {
    background: #f3f4f6;
    color: #1a1a1a;
}

.nav-item.active {
    background: #10b981;
    color: white;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.logout-btn {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #f3f4f6;
    color: #1a1a1a;
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: #6b7280;
}

.user-badge {
    position: fixed;
    top: 20px;
    right: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 99;
}

.user-badge-mobile {
    display: none;
}

.user-icon {
    width: 24px;
    height: 24px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 20px;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}

.calendar-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.calendar-title {
    font-size: 18px;
    font-weight: 700;
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.calendar-nav-btn:hover {
    background: #f3f4f6;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

@media (max-width: 1024px) {
    .calendar-days {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .calendar-days {
        grid-template-columns: repeat(2, 1fr);
    }
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    position: relative;
}

.calendar-day:hover {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.calendar-day.disabled {
    background: #f9fafb;
    cursor: not-allowed;
    opacity: 0.5;
}

.calendar-day.disabled:hover {
    border-color: #e5e7eb;
    box-shadow: none;
}

.calendar-day.has-order {
    background: #d1fae5;
    border-color: #10b981;
}

.calendar-day.today {
    border: 2px solid #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.calendar-day.today.has-order {
    border: 2px solid #3b82f6;
    background: #d1fae5;
}

.day-name {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 4px;
    font-weight: 600;
}

.day-number {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.day-meals {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #10b981;
}

.day-status {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.status-ordinato {
    background: #d1fae5;
    color: #047857;
}

.new-order-btn {
    width: 100%;
    padding: 16px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.new-order-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.orders-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.order-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.order-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.order-badge {
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.order-badge:hover {
    transform: scale(1.05);
}

.order-badge:active {
    transform: scale(0.98);
}

.badge-da-fatturare {
    background: #fef3c7;
    color: #b45309;
}

.badge-fatturato {
    background: #dbeafe;
    color: #1e40af;
}

.order-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f0fdf4;
    border-radius: 8px;
}

.order-meals {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 700;
    color: #10b981;
}

.order-total {
    text-align: right;
}

.order-total-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.order-total-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.delete-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #ef4444;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    margin-bottom: 24px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.counter-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 32px;
}

.counter-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    background: white;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #6b7280;
    flex-shrink: 0;
}

.counter-btn:hover:not(:disabled) {
    border-color: #10b981;
    background: #10b981;
    color: white;
    transform: scale(1.1);
}

.counter-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.counter-value {
    font-size: 64px;
    font-weight: 700;
    color: #10b981;
    min-width: 100px;
    text-align: center;
}

.counter-label {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.total-box {
    background: #f0fdf4;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 24px;
}

.total-label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.total-value {
    font-size: 36px;
    font-weight: 700;
    color: #10b981;
}

.notes-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    resize: vertical;
}

.notes-textarea:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-cancel {
    padding: 14px;
    background: white;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #f3f4f6;
}

.btn-confirm {
    padding: 14px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-confirm:hover {
    background: #059669;
}

.summary-filters {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.summary-card {
    border-radius: 12px;
    padding: 24px;
    color: white;
}

.summary-card.green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.summary-card.blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.summary-card.orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.summary-card-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 20px;
}

.summary-card-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 4px;
}

.summary-card-label {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
}

.mark-all-btn {
    width: 100%;
    padding: 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    margin-bottom: 24px;
}

.mark-all-btn:hover {
    background: #2563eb;
}

.mark-all-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10b981, #059669);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 48px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 64px;
    height: 64px;
    background: #10b981;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto 16px;
}

.login-logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.login-logo-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.login-form {
    margin-top: 32px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.login-btn:hover {
    background: #059669;
}

.demo-credentials {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.demo-title {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.demo-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
}

.demo-item-label {
    color: #6b7280;
}

.demo-item-value {
    font-family: 'Courier New', monospace;
    color: #1a1a1a;
    font-weight: 600;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #ef4444;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
}

.loading {
    text-align: center;
    padding: 48px;
    color: #6b7280;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .date-inputs {
        grid-template-columns: 1fr;
    }

    .user-badge {
        display: none;
    }

    .user-badge-mobile {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 500;
        margin-bottom: 16px;
        width: fit-content;
    }

    .logout-btn {
        position: static;
        margin: 20px;
    }

    .calendar-day {
        padding: 12px;
    }

    .day-number {
        font-size: 18px;
    }

    .day-meals {
        font-size: 12px;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: slideIn 0.3s ease;
}

.install-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
    z-index: 10001;
    animation: slideIn 0.5s ease;
    max-width: 500px;
    margin: 0 auto;
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.install-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.install-text {
    flex: 1;
}

.install-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.install-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

.install-actions {
    display: flex;
    gap: 8px;
}

.install-btn {
    flex: 1;
    padding: 10px;
    background: white;
    color: #10b981;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.install-dismiss {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.install-dismiss:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 640px) {
    .install-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
}
