.custom-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.custom-modal-backdrop.is-active {
    opacity: 1;
    visibility: visible;
}

.custom-modal-container {
    background: var(--color-bg-white, #ffffff);
    border-radius: 14px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--color-border, #e2e8f0);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.custom-modal-backdrop.is-active .custom-modal-container {
    transform: scale(1) translateY(0);
}

.custom-modal-header {
    padding: 20px 24px 12px 24px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
}

.custom-modal-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.custom-modal-icon-badge.type-warning {
    background-color: #fef3c7;
    color: #d97706;
}

.custom-modal-icon-badge.type-primary,
.custom-modal-icon-badge.type-question {
    background-color: #fce7f3;
    color: var(--color-primary, #936179);
}

.custom-modal-icon-badge.type-info {
    background-color: #dbeafe;
    color: var(--color-secondary, #3b82f6);
}

.custom-modal-icon-badge.type-danger {
    background-color: #fee2e2;
    color: var(--color-error, #ef4444);
}

.custom-modal-icon-badge.type-success {
    background-color: #dcfce7;
    color: #16a34a;
}

.custom-modal-title-wrap {
    flex-grow: 1;
    padding-top: 2px;
}

.custom-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text, #1e293b);
    line-height: 1.35;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}

.custom-modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--color-text-muted, #64748b);
    padding: 0;
    line-height: 1;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}

.custom-modal-close-btn:hover {
    background: var(--color-bg-hover, #f1f5f9);
    color: var(--color-text, #1e293b);
}

.custom-modal-body {
    padding: 0 24px 20px 24px;
    color: var(--color-text-muted, #64748b);
    font-size: 14px;
    line-height: 1.5;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}

.custom-modal-body p {
    margin: 0 0 10px 0;
}

.custom-modal-body p:last-child {
    margin-bottom: 0;
}

.custom-modal-footer {
    padding: 16px 24px;
    background: var(--color-bg-light, #f8fafc);
    border-top: 1px solid var(--color-border, #cbd5e1);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Stacked Layout for 3+ Actions */
.custom-modal-footer.layout-vertical {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.custom-modal-footer.layout-vertical .custom-modal-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 13.5px;
    text-align: center;
    box-sizing: border-box;
}

.custom-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
    line-height: 1.25;
    text-decoration: none;
    user-select: none;
}

.custom-modal-btn:focus-visible {
    outline: 2px solid var(--color-secondary, #3b82f6);
    outline-offset: 2px;
}

/* Primary Button (Brand Rose Gold) */
.custom-modal-btn-primary {
    background: var(--color-primary, #936179) !important;
    color: var(--color-on-primary, #ffffff) !important;
    border-color: var(--color-primary, #936179) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.custom-modal-btn-primary:hover {
    background: #7d4f64 !important;
    border-color: #7d4f64 !important;
    color: #ffffff !important;
}

/* Secondary Button (Blue / Active) */
.custom-modal-btn-secondary {
    background: var(--color-secondary, #3b82f6) !important;
    color: var(--color-on-secondary, #ffffff) !important;
    border-color: var(--color-secondary, #3b82f6) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.custom-modal-btn-secondary:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

/* Soft Secondary Button (Subtle Outline / Tint) */
.custom-modal-btn-subtle {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #bfdbfe !important;
}

.custom-modal-btn-subtle:hover {
    background: #dbeafe !important;
    border-color: #93c5fd !important;
    color: #1e40af !important;
}

/* Cancel / Neutral Button */
.custom-modal-btn-cancel,
.custom-modal-btn-outline {
    background: var(--color-bg-white, #ffffff) !important;
    border: 1px solid var(--color-border, #cbd5e1) !important;
    color: var(--color-text, #1e293b) !important;
}

.custom-modal-btn-cancel:hover,
.custom-modal-btn-outline:hover {
    background: var(--color-bg-hover, #f1f5f9) !important;
    border-color: var(--color-border-hover, #94a3b8) !important;
    color: var(--color-text, #1e293b) !important;
}

/* Danger Button */
.custom-modal-btn-danger {
    background: var(--color-error, #ef4444) !important;
    color: #ffffff !important;
    border-color: var(--color-error, #ef4444) !important;
}

.custom-modal-btn-danger:hover {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

/* Warning Button (Orange / Pause) */
.custom-modal-btn-warning {
    background: #f59e0b !important;
    color: #ffffff !important;
    border-color: #f59e0b !important;
}

.custom-modal-btn-warning:hover {
    background: #d97706 !important;
    border-color: #d97706 !important;
    color: #ffffff !important;
}
