/* ========================================
   MODALES Y CONTEXT MENU
   ======================================== */

/* Modal base */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-modal);
    max-width: 480px;
    width: 90%;
    border-radius: var(--border-radius-modal);
    padding: 1rem;
    border: 1px solid var(--accent);
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3, .modal-content h4 {
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.modal-content input, .modal-content textarea {
    width: 100%;
    margin: 0.3rem 0;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: var(--bg-input);
    border: 1px solid #3a3e64;
    color: white;
    font-family: inherit;
    font-size: 0.8rem;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.modal-buttons button {
    padding: 0.35rem 0.7rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 0.6rem;
    padding: 0.3rem;
    z-index: var(--z-context-menu);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    min-width: 160px;
}

.context-menu button {
    display: block;
    width: 100%;
    padding: 0.35rem 0.7rem;
    margin: 0.15rem 0;
    background: #2a2f4e;
    border: none;
    color: white;
    border-radius: 0.4rem;
    cursor: pointer;
    text-align: left;
    font-size: 0.75rem;
}

.context-menu button:hover {
    background: var(--accent);
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2c2f4e;
    padding: 0.35rem 0.7rem;
    border-radius: 1.2rem;
    font-size: 0.7rem;
    z-index: var(--z-toast);
    animation: fadeOut 2s ease;
}

@keyframes fadeOut {
    0% { opacity: 0; transform: translateY(20px); }
    15% { opacity: 1; transform: translateY(0); }
    85% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(20px); }
}

/* Elementos de eliminación */
.delete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.3rem 0;
    padding: 0.3rem;
    background: var(--bg-input);
    border-radius: 0.4rem;
}

.delete-item span {
    font-size: 0.75rem;
}

.delete-item button {
    background: var(--error-dark);
    border: none;
    padding: 0.15rem 0.5rem;
    border-radius: 0.4rem;
    cursor: pointer;
    color: white;
    font-size: 0.7rem;
}

.delete-item button:hover {
    background: #c43a52;
}

hr {
    margin: 0.6rem 0;
    border-color: #2a2f4e;
}

.login-error {
    color: #ff6b6b;
    font-size: 0.7rem;
    margin-top: 0.4rem;
    text-align: center;
}

.logout-btn {
    background: var(--error-dark);
    margin-top: 0.5rem;
}

.logout-btn:hover {
    background: #c43a52;
}