* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: #f0f2f5;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

#app {
    max-width: 480px;
    width: 100%;
    min-height: 100vh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* HEADER */
header {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: white;
    padding: 20px;
    border-radius: 0 0 24px 24px;
    padding-bottom: 30px;
}

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

.greeting {
    font-weight: 600;
    font-size: 1.1rem;
}

.date {
    font-size: 0.85rem;
    opacity: 0.85;
}

.earnings {
    display: flex;
    gap: 30px;
}

.earning-item .label {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.earning-item .value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* FILTRI */
.status-filters {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    white-space: nowrap;
    background: #ffffff;
    border-bottom: 1px solid #e8eaed;
    position: sticky;
    top: 0;
    z-index: 10;
    scrollbar-width: none;
}

.status-filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background: #f1f3f4;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.filter-btn.active {
    background: #1a73e8;
    color: white;
}

.filter-btn:hover {
    background: #e8eaed;
}

.filter-btn.active:hover {
    background: #1557b0;
}

/* MAIN CONTENT */
main {
    flex: 1;
    padding: 12px 16px;
    padding-bottom: 80px;
    overflow-y: auto;
}

/* CARD INTERVENTO */
.intervention-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e8eaed;
    cursor: pointer;
    transition: all 0.2s;
}

.intervention-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

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

.card-client {
    font-weight: 600;
    font-size: 1rem;
    color: #202124;
}

.card-status {
    font-size: 0.7rem;
    padding: 2px 12px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-aperti { background: #e8f0fe; color: #1a73e8; }
.status-lavorazione { background: #fef7e0; color: #e37400; }
.status-ricambi { background: #fce8e6; color: #d93025; }
.status-completati { background: #e6f4ea; color: #1e8e3e; }
.status-consegnati { background: #e6f4ea; color: #1e8e3e; }
.status-preventivi { background: #f3e8fd; color: #7c3aed; }

.card-details {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: #5f6368;
    flex-wrap: wrap;
    align-items: center;
}

.card-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-total {
    font-weight: 700;
    color: #1a73e8;
    font-size: 0.95rem;
}

.card-type {
    font-size: 0.7rem;
    background: #f1f3f4;
    padding: 1px 10px;
    border-radius: 10px;
    color: #5f6368;
}

/* TIMER IN CORSO */
.timer-active {
    background: #e8f0fe;
    border: 2px solid #1a73e8;
    animation: pulse-border 1.5s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: #1a73e8; }
    50% { border-color: #4dabf7; }
}

.timer-display {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a73e8;
    margin-left: 8px;
}

/* MODALI */
.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: 16px;
}

.modal {
    background: white;
    border-radius: 20px;
    padding: 24px;
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-detail {
    max-width: 480px;
}

.modal h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: #202124;
}

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

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #5f6368;
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.2);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: flex-end;
}

.btn-primary {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #1557b0;
}

.btn-secondary {
    background: #f1f3f4;
    color: #5f6368;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #e8eaed;
}

.btn-success {
    background: #1e8e3e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-success:hover {
    background: #166b2f;
}

.btn-danger {
    background: #d93025;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #b3261e;
}

/* DETTAGLIO INTERVENTO */
.detail-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8eaed;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #5f6368;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.detail-section p {
    font-size: 1rem;
    color: #202124;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.detail-label {
    color: #5f6368;
}

.detail-value {
    font-weight: 500;
    color: #202124;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* BOTTOM NAV */
.bottom-nav {
    position: fixed;
    bottom: 0;
    max-width: 480px;
    width: 100%;
    background: #ffffff;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 env(safe-area-inset-bottom);
    border-top: 1px solid #e8eaed;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-item {
    background: none;
    border: none;
    font-size: 0.7rem;
    color: #5f6368;
    cursor: pointer;
    padding: 4px 12px;
    transition: color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.nav-item.active {
    color: #1a73e8;
    font-weight: 600;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #5f6368;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* TOAST NOTIFICATION */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #323232;
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 2000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* RESPONSIVE */
@media (max-width: 480px) {
    .earnings {
        gap: 20px;
    }
    .earning-item .value {
        font-size: 1.2rem;
    }
}