.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: white;
    border-radius: 12px;
    padding: 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.2s ease-out;
}

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

.modal-card h3 {
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 20px;
}

.modal-card p {
    margin-bottom: 12px;
    color: #666;
    font-size: 14px;
}

.modal-card label {
    display: block;
    font-weight: bold;
    margin: 12px 0 6px;
    font-size: 14px;
}

.modal-card input[type="text"],
.modal-card input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 4px;
}

.modal-card input:focus {
    outline: 2px solid rgba(74, 144, 226, 0.2);
    border-color: var(--primary-color);
}

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

.modal-actions button {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: white;
    background: #4CAF50;
    transition: background 0.2s;
    min-width: 100px;
}

.modal-actions button:hover {
    background: #388E3C;
}

.modal-actions button[style*="background:#999"]:hover {
    background: #777 !important;
}

/* Scrollable subject list in completion modal */
.assunto-lista {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
}

.assunto-lista:empty {
    display: none;
}

.assunto-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    transition: background 0.15s;
}

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

.assunto-item:hover {
    background: #f0f7ff;
}

.assunto-item.selected {
    background: #e3f0ff;
    font-weight: bold;
    color: var(--primary-color);
}

.assunto-item--outro {
    color: #888;
    font-style: italic;
}
