.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.open .modal-content {
    transform: translateY(0);
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 5px;
}

.close-modal:hover,
.close-modal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.detail-row.total {
    font-weight: bold;
    border-top: 2px solid #ddd;
    border-bottom: none;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 1.1em;
}

.detail-row .label {
    color: #555;
}

.detail-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.detail-header h3 {
    margin: 0;
    color: #2c3e50;
}

.detail-header span {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Clickable cells */
#monthlyTable td {
    cursor: pointer;
    transition: background-color 0.2s;
}

#monthlyTable td:hover {
    background-color: #f0f8ff;
}
