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

body {
    overflow: hidden;
    background-color: #ffffff;
    height: 100vh;
    height: 100dvh; /* dynamic viewport height - tiene conto della barra browser su mobile */
}

#excel-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100vw;
}

/* Modal dialogs */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 24px;
    border-radius: 2px;
    min-width: 400px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-bottom: 16px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.modal-content input {
    width: 100%;
    padding: 8px;
    margin-bottom: 16px;
    border: 1px solid #d6d6d6;
    border-radius: 2px;
    font-size: 13px;
    color: #333;
}

.modal-content input:focus {
    outline: none;
    border-color: #217346;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-buttons button {
    padding: 6px 16px;
    border: 1px solid #d6d6d6;
    background-color: #ffffff;
    border-radius: 2px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: all 0.15s ease;
}

.modal-buttons button:hover {
    background-color: #f3f3f3;
}

.modal-buttons button.primary {
    background-color: #217346;
    color: white;
    border-color: #217346;
}

.modal-buttons button.primary:hover {
    background-color: #1a5c38;
}

#file-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
    border: 1px solid #d6d6d6;
    border-radius: 2px;
    background-color: white;
}

.file-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f3f3f3;
    font-size: 13px;
    color: #333;
    transition: background-color 0.15s ease;
}

.file-item:hover {
    background-color: #f3f3f3;
}

.file-item.selected {
    background-color: #d4e8d4;
    border-color: #217346;
    color: #217346;
}

.file-item:last-child {
    border-bottom: none;
}

/* File list scrollbar */
#file-list::-webkit-scrollbar {
    width: 12px;
}

#file-list::-webkit-scrollbar-track {
    background: #f3f3f3;
}

#file-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 6px;
    border: 3px solid #f3f3f3;
}

#file-list::-webkit-scrollbar-thumb:hover {
    background: #a6a6a6;
}

/* ==================== RESPONSIVE MOBILE ==================== */
@media (max-width: 768px) {
    .modal-content {
        min-width: auto;
        width: 90vw;
        max-width: 400px;
        padding: 16px;
    }
    .modal-content h3 { font-size: 14px; }
}
