body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 20px;
}

header {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.8em;
}

.api-key-container {
    display: flex;
    align-items: center;
}

.api-key-container label {
    margin-right: 10px;
    font-weight: bold;
}

input[type="text"],
input[type="date"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

main {
    display: grid;
    gap: 20px;
}

section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

h2 {
    margin-top: 0;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    color: #34495e;
}

.controls {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

button.secondary {
    background-color: #27ae60;
}
button.secondary:hover {
    background-color: #229954;
}

button.tertiary {
    background-color: #95a5a6;
}
button.tertiary:hover {
    background-color: #7f8c8d;
}

/* Stile per i pulsanti nelle tabelle */
td button.btn-small {
    padding: 5px 10px;
    font-size: 0.9em;
    background-color: #7f8c8d;
}
td button.btn-small:hover {
    background-color: #616a6b;
}
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tbody tr:hover {
    background-color: #f5f5f5;
}

td.editable {
    cursor: pointer;
    color: #3498db;
    font-weight: bold;
}
td.editable:hover {
    text-decoration: underline;
}

/* Stile per timbrature modificate manualmente */
td.manual-edit {
    background-color: #fef9e7; /* Giallo paglierino chiaro */
    font-style: italic;
    color: #6c5b29;
}

/* Stili per la modale */
.modal { display: none; position: fixed; z-index: 1; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4); }
.modal-content { background-color: #fefefe; margin: 15% auto; padding: 20px; border: 1px solid #888; width: 80%; max-width: 500px; border-radius: 8px; }
.close-button { color: #aaa; float: right; font-size: 28px; font-weight: bold; }
.close-button:hover, .close-button:focus { color: black; text-decoration: none; cursor: pointer; }
#edit-form { display: flex; flex-direction: column; gap: 10px; }
.modal-buttons { margin-top: 15px; }

/* Stili per le notifiche */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.notification {
    padding: 15px;
    border-radius: 5px;
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.notification.error { background-color: #e74c3c; }
.notification.success { background-color: #2ecc71; }