/* Estilos personalizados para SweetAlert2 */

/* Popup principal */
.swal2-custom-popup {
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    font-family: 'Inter', sans-serif !important;
    max-width: 500px !important;
    width: 90% !important;
}

/* Título */
.swal2-custom-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin-bottom: 1rem !important;
    line-height: 1.3 !important;
}

/* Conteúdo */
.swal2-custom-content {
    font-size: 1rem !important;
    color: #5a6c7d !important;
    line-height: 1.5 !important;
    margin-bottom: 1.5rem !important;
}

/* Botão de confirmação */
.swal2-custom-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
}

.swal2-custom-confirm:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%) !important;
}

/* Botão de cancelamento */
.swal2-custom-cancel {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3) !important;
}

.swal2-custom-cancel:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4) !important;
    background: linear-gradient(135deg, #ff5252 0%, #d32f2f 100%) !important;
}

/* Variantes de cores */
.swal2-success {
    border-left: 4px solid #28a745 !important;
}

.swal2-success .swal2-icon {
    border-color: #28a745 !important;
    color: #28a745 !important;
}

.swal2-error {
    border-left: 4px solid #dc3545 !important;
}

.swal2-error .swal2-icon {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

.swal2-warning {
    border-left: 4px solid #ffc107 !important;
}

.swal2-warning .swal2-icon {
    border-color: #ffc107 !important;
    color: #ffc107 !important;
}

.swal2-info {
    border-left: 4px solid #17a2b8 !important;
}

.swal2-info .swal2-icon {
    border-color: #17a2b8 !important;
    color: #17a2b8 !important;
}

/* Ícones personalizados */
.swal2-icon {
    border-width: 3px !important;
    margin: 1.5rem auto 1rem !important;
}

/* Barra de progresso */
.swal2-timer-progress-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
    height: 4px !important;
    border-radius: 2px !important;
}

/* Animações */
@keyframes swal2-show {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }
    45% {
        transform: scale(1.05);
        opacity: 1;
    }
    80% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.swal2-show {
    animation: swal2-show 0.3s ease-out !important;
}

/* Responsividade */
@media (max-width: 768px) {
    .swal2-custom-popup {
        width: 95% !important;
        margin: 1rem !important;
    }
    
    .swal2-custom-title {
        font-size: 1.3rem !important;
    }
    
    .swal2-custom-content {
        font-size: 0.95rem !important;
    }
    
    .swal2-custom-confirm,
    .swal2-custom-cancel {
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
    }
}

/* Tema escuro */
@media (prefers-color-scheme: dark) {
    .swal2-custom-popup {
        background-color: #2c3034 !important;
        color: #e9ecef !important;
    }
    
    .swal2-custom-title {
        color: #ffffff !important;
    }
    
    .swal2-custom-content {
        color: #adb5bd !important;
    }
    
    .swal2-custom-confirm {
        background: linear-gradient(135deg, #495057 0%, #343a40 100%) !important;
        box-shadow: 0 4px 15px rgba(73, 80, 87, 0.3) !important;
    }
    
    .swal2-custom-confirm:hover {
        background: linear-gradient(135deg, #343a40 0%, #212529 100%) !important;
        box-shadow: 0 6px 20px rgba(73, 80, 87, 0.4) !important;
    }
}

/* Efeitos de foco */
.swal2-custom-confirm:focus,
.swal2-custom-cancel:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25) !important;
}

.swal2-custom-cancel:focus {
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.25) !important;
}

/* Modal elegante — sugerir filiação (CIM já cadastrado) */
.swal2-popup.swal2-obreiro-filiacao-elegante {
    background: linear-gradient(165deg, #ffffff 0%, #fafafa 50%, #f5f5f5 100%) !important;
    border: 1px solid rgba(0, 0, 0, 0.07) !important;
    border-radius: 0 !important;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.04),
        0 24px 48px rgba(0, 0, 0, 0.1) !important;
    max-width: 28rem !important;
    padding: 1.75rem 1.5rem 1.5rem !important;
}

.swal2-obreiro-filiacao-title {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    letter-spacing: -0.02em !important;
    margin-bottom: 0.35rem !important;
    padding-bottom: 0 !important;
    line-height: 1.35 !important;
}

.swal2-obreiro-filiacao-html {
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

.swal-obreiro-filiacao-body {
    color: #3d3d3d;
    font-size: 0.9375rem;
    line-height: 1.65;
}

.swal-obreiro-filiacao-lead {
    margin: 0 0 1rem;
    color: #4a4a4a;
    font-weight: 400;
}

.swal-obreiro-filiacao-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.8125rem;
    color: #5c5c5c;
}

.swal-obreiro-filiacao-meta span strong {
    color: #1a1a1a;
    font-weight: 600;
}

.swal-obreiro-lojas-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.65rem 0.85rem 0.75rem;
    margin-bottom: 1rem;
}

.swal-obreiro-lojas-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.swal-obreiro-lojas-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.swal-obreiro-lojas-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.875rem;
    color: #1a1a1a;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.swal-obreiro-lojas-list li:last-child {
    border-bottom: none;
}

.swal-obreiro-loja-dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    margin-top: 0.45rem;
    border-radius: 50%;
    background: #1a1a1a;
    opacity: 0.85;
}

.swal-obreiro-lojas-empty {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.55;
}

.swal-obreiro-filiacao-foot {
    margin: 0 0 0.75rem;
    margin-top: 0.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    color: #4a4a4a;
    font-size: 0.875rem;
}

.swal-obreiro-filiacao-cta {
    margin: 0 !important;
    padding: 0.65rem 0.85rem;
    background: rgba(26, 26, 26, 0.04);
    border-left: 3px solid #1a1a1a;
    font-size: 0.875rem;
    color: #2d2d2d;
}

.swal2-obreiro-filiacao-btn-confirm {
    background: #1a1a1a !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0.55rem 1.25rem !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
}

.swal2-obreiro-filiacao-btn-confirm:hover {
    background: #0d0d0d !important;
    color: #fff !important;
}

.swal2-obreiro-filiacao-btn-cancel {
    background: #fff !important;
    color: #4b5563 !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    border-radius: 0 !important;
    padding: 0.55rem 1.25rem !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
}

.swal2-obreiro-filiacao-btn-cancel:hover {
    background: #f9fafb !important;
    color: #1a1a1a !important;
}

.swal2-popup.swal2-obreiro-filiacao-elegante .swal2-close {
    color: #9ca3af !important;
    font-size: 1.35rem !important;
    transition: color 0.15s ease !important;
}

.swal2-popup.swal2-obreiro-filiacao-elegante .swal2-close:hover {
    color: #1a1a1a !important;
}

/* Cadastro inativo — aviso + histórico de lojas (novo obreiro) */
.swal-obreiro-inativo-banner {
    background: linear-gradient(180deg, #fffdf8 0%, #fff9e6 100%);
    border: 1px solid rgba(180, 140, 60, 0.35);
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #4a3f28;
    line-height: 1.55;
}

.swal-obreiro-inativo-banner strong {
    color: #1a1a1a;
}

.swal-obreiro-hist-wrap {
    overflow-x: auto;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
}

.swal-obreiro-hist-table {
    width: 100%;
    font-size: 0.8125rem;
    border-collapse: collapse;
    margin: 0;
}

.swal-obreiro-hist-table th {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.65rem;
    color: #6b7280;
    padding: 0.5rem 0.45rem;
    background: #fafafa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}

.swal-obreiro-hist-table td {
    padding: 0.45rem 0.45rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
    vertical-align: top;
}

.swal-obreiro-hist-table tr:last-child td {
    border-bottom: none;
}

.swal-obreiro-hist-badge-ativa {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.swal-obreiro-hist-badge-inativa {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}
