/* Nova Poshta settings — Midnight chrome 1:1 with left-menu settings tabs */

#nx-delivery-settings.nx-item-edit-page {
    --nx-edit-card: #1a1a1a;
    --nx-edit-surface: #121212;
    --nx-edit-border: rgba(255, 255, 255, 0.12);
    --nx-edit-text: #ffffff;
    --nx-edit-text-muted: rgba(255, 255, 255, 0.7);
}

html:not(.midnight):not([data-bs-theme="midnight"]) #nx-delivery-settings.nx-item-edit-page {
    --nx-edit-card: #f7f8fa;
    --nx-edit-surface: #ffffff;
    --nx-edit-border: rgba(0, 0, 0, 0.1);
    --nx-edit-text: #1f2a38;
    --nx-edit-text-muted: rgba(69, 79, 91, 0.72);
}

#nx-delivery-settings .nx-item-editor-shell {
    --nx-item-modal-surface: transparent;
    --nx-item-modal-card: transparent;
    --nx-item-modal-border: var(--nx-edit-border, rgba(255, 255, 255, 0.12));
    --nx-item-modal-text: var(--nx-edit-text, #ffffff);
    --nx-item-modal-text-muted: var(--nx-edit-text-muted, rgba(255, 255, 255, 0.7));
    --nx-item-field-bg: rgba(255, 255, 255, 0.06);
    --nx-item-field-text: #ffffff;
    --nx-item-field-placeholder: rgba(255, 255, 255, 0.45);
    --nx-item-field-border: rgba(255, 255, 255, 0.12);
    --color-accent-2-rgb: var(--nx-primary-rgb, 197, 205, 216);
}

html:not(.midnight):not([data-bs-theme="midnight"]) #nx-delivery-settings .nx-item-editor-shell {
    --nx-item-modal-card: transparent;
    --nx-item-modal-surface: transparent;
    --nx-item-modal-border: rgba(0, 0, 0, 0.1);
    --nx-item-modal-text: #1f2a38;
    --nx-item-modal-text-muted: rgba(69, 79, 91, 0.72);
    --nx-item-field-bg: #ffffff;
    --nx-item-field-text: #1f2a38;
    --nx-item-field-placeholder: rgba(69, 79, 91, 0.45);
    --nx-item-field-border: rgba(0, 0, 0, 0.14);
}

#nx-delivery-settings .nx-item-editor-shell .nx-item-editor-frame,
#nx-delivery-settings.nx-item-edit-page .nx-item-editor-frame,
#nx-delivery-settings .nx-np-editor-frame.nx-item-editor-frame {
    --accent: var(--nx-edit-card, #1a1a1a) !important;
    --track-bg: var(--nx-edit-surface, #121212) !important;
    --border-color: var(--nx-edit-border, rgba(255, 255, 255, 0.12));
}

html:not(.midnight):not([data-bs-theme="midnight"]) #nx-delivery-settings .nx-item-editor-shell .nx-item-editor-frame,
html:not(.midnight):not([data-bs-theme="midnight"]) #nx-delivery-settings.nx-item-edit-page .nx-item-editor-frame,
html:not(.midnight):not([data-bs-theme="midnight"]) #nx-delivery-settings .nx-np-editor-frame.nx-item-editor-frame {
    --accent: var(--nx-edit-card, #f7f8fa) !important;
    --track-bg: var(--nx-edit-surface, #ffffff) !important;
}

#nx-delivery-settings .nx-np-editor-frame .nx-item-editor-frame__body {
    color: var(--nx-edit-text, #ffffff);
    background: var(--accent, #1a1a1a) !important;
}

html:not(.midnight):not([data-bs-theme="midnight"]) #nx-delivery-settings .nx-np-editor-frame .nx-item-editor-frame__body {
    background: var(--accent, #f7f8fa) !important;
}

/* Flat sections — same surface as tab body, never nested black cards */
body.settings #settings-wrapper #embed-content-container #nx-delivery-settings .nx-np-section,
body.settings #settings-wrapper #embed-content-container #nx-delivery-settings .card,
body.settings #settings-wrapper #embed-content-container #nx-delivery-settings .card.card-body,
#nx-delivery-settings .nx-np-section,
#nx-delivery-settings .card,
#nx-delivery-settings .card.card-body {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 1.25rem !important;
    color: inherit !important;
}

#nx-delivery-settings .nx-np-pane .nx-np-section + .nx-np-section {
    margin-top: 0.25rem !important;
}

#nx-delivery-settings .nx-np-pane h5,
#nx-delivery-settings .nx-np-pane h6,
#nx-delivery-settings .nx-np-pane .nx-np-section-title {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--nx-edit-text, var(--nx-item-modal-text)) !important;
}

#nx-delivery-settings .nx-np-pane .control-label,
#nx-delivery-settings .nx-np-pane label.control-label,
#nx-delivery-settings .nx-np-pane .col-form-label {
    color: var(--nx-edit-text-muted, var(--nx-item-modal-text-muted)) !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
}

#nx-delivery-settings .nx-np-pane .text-muted,
#nx-delivery-settings .nx-np-pane small.text-muted {
    color: var(--nx-edit-text-muted, var(--nx-item-modal-text-muted)) !important;
}

/* Fields — mirror #commonModalBody .nx-item-tab-pane */
#nx-delivery-settings .nx-np-pane .form-control,
#nx-delivery-settings .nx-np-pane textarea.form-control,
#nx-delivery-settings .nx-np-pane .select2-container--default .select2-selection--single,
#nx-delivery-settings .nx-np-pane .select2-container--bootstrap .select2-selection--single {
    border-radius: 10px !important;
    border: 1px solid var(--nx-item-field-border) !important;
    background-color: var(--nx-item-field-bg) !important;
    background-image: none !important;
    color: var(--nx-item-field-text) !important;
    box-shadow: none !important;
}

#nx-delivery-settings .nx-np-pane input.form-control,
#nx-delivery-settings .nx-np-pane select.form-control {
    min-height: 40px !important;
    padding: 10px 14px !important;
    font-size: 15px !important;
}

#nx-delivery-settings .nx-np-pane .form-control:focus,
#nx-delivery-settings .nx-np-pane .select2-container--default.select2-container--focus .select2-selection--single,
#nx-delivery-settings .nx-np-pane .select2-container--default .select2-selection--single:focus,
#nx-delivery-settings .nx-np-pane .select2-container--bootstrap.select2-container--focus .select2-selection--single {
    border-color: rgba(var(--color-accent-2-rgb, 32, 174, 227), 0.45) !important;
    background-color: var(--nx-item-field-bg) !important;
    color: var(--nx-item-field-text) !important;
    box-shadow: 0 0 0 3px rgba(var(--color-accent-2-rgb, 32, 174, 227), 0.25) !important;
}

#nx-delivery-settings .nx-np-pane .form-control::placeholder {
    color: var(--nx-item-field-placeholder) !important;
}

#nx-delivery-settings .nx-np-pane .select2-container {
    width: 100% !important;
}

#nx-delivery-settings .nx-np-pane .select2-container--default .select2-selection--single,
#nx-delivery-settings .nx-np-pane .select2-container--bootstrap .select2-selection--single {
    min-height: 40px !important;
    height: 40px !important;
    padding: 8px 34px 8px 14px !important;
}

#nx-delivery-settings .nx-np-pane .select2-container--default .select2-selection--single .select2-selection__rendered,
#nx-delivery-settings .nx-np-pane .select2-container--bootstrap .select2-selection--single .select2-selection__rendered {
    padding: 0 !important;
    line-height: 22px !important;
    color: var(--nx-item-field-text) !important;
    font-size: 15px !important;
}

#nx-delivery-settings .nx-np-pane .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
    right: 8px !important;
}

#nx-delivery-settings .nx-np-pane .x-input-name-wrap .form-control {
    padding-left: 38px !important;
}

#nx-delivery-settings .nx-np-pane .x-input-name-wrap .x-input-name-icon {
    color: var(--nx-item-modal-text-muted) !important;
    opacity: 1 !important;
    z-index: 3 !important;
}

#nx-delivery-settings .nx-np-pane .x-input-name-wrap .select2-container {
    z-index: 1 !important;
}

#nx-delivery-settings .nx-np-pane .nx-secret-mask {
    width: 100%;
}

#nx-delivery-settings .nx-np-pane .nx-secret-mask__btn {
    z-index: 4;
}

#nx-delivery-settings .nx-np-tab-actions {
    margin-top: 1.5rem !important;
    padding-top: 1rem;
    border-top: 1px solid var(--nx-edit-border, rgba(255, 255, 255, 0.12));
}

#nx-delivery-settings .nx-np-tab-actions .btn-rounded-x.btn-danger {
    font-weight: 600;
}

/* Override settings-wrapper dark inputs that fight editor chrome */
body.settings #settings-wrapper #embed-content-container #nx-delivery-settings .nx-np-pane input.form-control.form-control-sm,
body.settings #settings-wrapper #embed-content-container #nx-delivery-settings .nx-np-pane select.form-control.form-control-sm {
    display: block !important;
    height: auto !important;
    min-height: 40px !important;
    line-height: 1.5 !important;
    background-color: var(--nx-item-field-bg) !important;
    color: var(--nx-item-field-text) !important;
    border-color: var(--nx-item-field-border) !important;
}
