/* Modal Overlay */
.sipm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.sipm-modal-overlay.active {
    display: flex;
}

/* Modal Container */
.sipm-modal-container {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: sipmModalSlideIn 0.3s ease;
}

@keyframes sipmModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Header */
.sipm-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sipm-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.sipm-modal-close {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.3s ease;
}

.sipm-modal-close:hover {
    background: #f3f4f6;
    color: #1a1a1a;
}

.sipm-modal-close i {
    font-size: 18px;
}

/* Modal Body */
.sipm-modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

/* Alert */
.sipm-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.sipm-alert-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sipm-alert-success {
    background: #dcfce7;
    border-left: 4px solid #22c55e;
    color: #166534;
}

.sipm-alert-error {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.sipm-alert i {
    font-size: 18px;
}

/* Form Styles */
.sipm-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sipm-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sipm-form-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sipm-form-input {
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a1a;
    transition: all 0.3s ease;
}

.sipm-form-input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.sipm-form-input.error {
    border-color: #ef4444;
}

.sipm-form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.sipm-form-input:read-only {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

.sipm-required {
    color: #ef4444;
}

.sipm-error {
    display: none;
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

.sipm-hint {
    display: block;
    color: #9ca3af;
    font-size: 12px;
    margin-top: 4px;
}

.sipm-form-textarea {
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a1a;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: all 0.3s ease;
}

.sipm-form-textarea:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.sipm-form-textarea.error {
    border-color: #ef4444;
}

.sipm-form-textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Form Row */
.sipm-form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.sipm-col-4 {
    grid-column: span 1;
}

/* Modal Footer */
.sipm-modal-footer {
    padding: 20px 28px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.sipm-btn {
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sipm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sipm-btn-primary {
    background: #22c55e;
    color: #ffffff;
}

.sipm-btn-primary:hover:not(:disabled) {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.sipm-btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.sipm-btn-secondary:hover {
    background: #e5e7eb;
}

.sipm-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sipm-modal-container {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .sipm-modal-header,
    .sipm-modal-body,
    .sipm-modal-footer {
        padding: 20px;
    }

    .sipm-modal-title {
        font-size: 16px;
        line-height: 1.3;
    }

    .sipm-form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sipm-col-4 {
        grid-column: span 1;
    }
}

@media (max-width: 480px) {
    .sipm-modal-overlay {
        padding: 0;
    }

    .sipm-modal-header,
    .sipm-modal-body {
        padding: 16px;
    }

    .sipm-btn {
        width: 100%;
    }
}
