/* APPLE HIG - Modals: glassmorphism suave, radio generoso */

.modal-content {
    background: var(--apple-bg-2) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid var(--apple-separator) !important;
    border-radius: var(--apple-radius-xl) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden;
}

.modal-header {
    background: var(--apple-fill-1) !important;
    background-image: none !important;
    border-bottom: 1px solid var(--apple-separator) !important;
    border-radius: 0 !important;
    padding: 1rem 1.25rem;
}
.modal-header .modal-title {
    color: var(--apple-label) !important;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.modal-header.bg-primary,
.modal-header.bg-warning,
.modal-header.bg-success,
.modal-header.bg-danger,
.modal-header.bg-info,
.modal-header[style*="background"] {
    background: var(--apple-fill-1) !important;
    background-image: none !important;
}
.modal-header.bg-primary .modal-title,
.modal-header.bg-warning .modal-title,
.modal-header.bg-success .modal-title,
.modal-header.bg-danger .modal-title,
.modal-header.bg-info .modal-title,
.modal-header[style*="background"] .modal-title {
    color: var(--apple-label) !important;
}

.modal-body {
    background: transparent !important;
    padding: 1.25rem;
}

.modal-footer {
    background: rgba(242, 242, 247, 0.8) !important;
    border-top: 1px solid rgba(229, 229, 234, 0.7) !important;
    border-radius: 0 !important;
    padding: 0.875rem 1.25rem;
    gap: 0.5rem;
}

/* Backdrop: frosted glass */
.modal-backdrop {
    opacity: 1 !important;
    background-color: rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(0.8px) saturate(180%) brightness(1.01) !important;
    -webkit-backdrop-filter: blur(0.8px) saturate(180%) brightness(1.01) !important;
}

/* Quitar blur heredado en main/sidebar — no usar filter en contenedores */
body:has(.modal-backdrop) main,
body:has(.modal-backdrop) .sidebar {
    filter: none !important;
}

/* Close button */
.btn-close {
    filter: none;
    opacity: 0.45;
    border-radius: 50% !important;
    background-color: rgba(120, 120, 128, 0.16);
    padding: 0.375rem;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}
.btn-close:hover { opacity: 1; background-color: rgba(120, 120, 128, 0.28); }
.btn-close-white { filter: none; }

/* ── Botones de acción — estilo Apple glass ── */

/* Base glass para todos los action buttons */
.btn-action-view,
.btn-action-edit,
.btn-action-add,
.btn-action-delete,
.btn-action-special {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: var(--apple-radius-sm) !important;
    font-weight: 500;
    font-size: 0.8125rem;
    padding: 0.375rem 0.875rem;
    border: 1px solid transparent !important;
    backdrop-filter: saturate(160%) blur(8px);
    -webkit-backdrop-filter: saturate(160%) blur(8px);
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    letter-spacing: -0.01em;
}
.btn-action-view:active,
.btn-action-edit:active,
.btn-action-add:active,
.btn-action-delete:active,
.btn-action-special:active { transform: scale(0.97); }

/* Agregar — color del tema principal (teal salvia) */
.btn-action-add {
    background-color: var(--apple-blue) !important;
    border-color: rgba(0, 137, 123, 0.4) !important;
    color: #fff !important;
    box-shadow: 0 2px 10px rgba(0, 137, 123, 0.32) !important;
}
.btn-action-add:hover:not(:disabled) {
    background-color: var(--apple-blue-hover) !important;
    box-shadow: 0 4px 16px rgba(0, 137, 123, 0.42) !important;
    transform: translateY(-1px);
}

/* Ver — glass neutro */
.btn-action-view {
    background-color: rgba(120, 120, 128, 0.14) !important;
    border-color: rgba(120, 120, 128, 0.22) !important;
    color: var(--apple-label-2) !important;
    box-shadow: none !important;
}
.btn-action-view:hover:not(:disabled) {
    background-color: rgba(120, 120, 128, 0.22) !important;
    transform: translateY(-1px);
}

/* Editar — amarillo cálido */
.btn-action-edit {
    background-color: rgba(253, 216, 53, 0.85) !important;
    border-color: rgba(230, 184, 0, 0.4) !important;
    color: #1D1D1F !important;
    box-shadow: 0 2px 8px rgba(253, 216, 53, 0.35) !important;
}
.btn-action-edit:hover:not(:disabled) {
    background-color: rgba(249, 202, 0, 0.95) !important;
    box-shadow: 0 4px 14px rgba(253, 216, 53, 0.45) !important;
    transform: translateY(-1px);
}

/* Eliminar — rojo */
.btn-action-delete {
    background-color: rgba(229, 57, 53, 0.88) !important;
    border-color: rgba(183, 28, 28, 0.35) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3) !important;
}
.btn-action-delete:hover:not(:disabled) {
    background-color: rgba(198, 40, 40, 0.95) !important;
    box-shadow: 0 4px 14px rgba(229, 57, 53, 0.4) !important;
    transform: translateY(-1px);
}

/* Especial / Reasignar — naranja */
.btn-action-special {
    background-color: rgba(251, 140, 0, 0.88) !important;
    border-color: rgba(230, 81, 0, 0.35) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(251, 140, 0, 0.3) !important;
}
.btn-action-special:hover:not(:disabled) {
    background-color: rgba(239, 108, 0, 0.95) !important;
    box-shadow: 0 4px 14px rgba(251, 140, 0, 0.4) !important;
    transform: translateY(-1px);
}
