/* Shared database creation wizard. Scoped to avoid changing other panel forms. */
#modal-create-db-backdrop.db-create-backdrop {
    position: fixed; inset: 0; z-index: 10020; display: grid; place-items: center;
    padding: 20px; overflow: auto; overscroll-behavior: contain;
    background: rgba(26, 24, 45, .4); backdrop-filter: blur(4px);
}
#modal-create-db-backdrop .db-create-dialog {
    width: min(780px, 100%); min-width: 0; max-height: calc(100dvh - 40px);
    display: flex; flex-direction: column; overflow: hidden !important;
    border: 1px solid var(--wp-border, #E5E3ED); border-radius: 16px; background: #FFF;
    box-shadow: 0 24px 70px rgba(26, 16, 51, .2); color: var(--wp-text, #172C49);
    font-family: var(--bc-font-body, Inter, sans-serif);
}
.db-create-dialog *, .db-create-dialog *::before, .db-create-dialog *::after { box-sizing: border-box; }
.db-create-header {
    display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between;
    gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--wp-border, #E5E3ED);
}
.db-create-header h2 { margin: 0; font-family: var(--bc-font-heading, Outfit, sans-serif); font-size: 22px; font-weight: 600; line-height: 1.4; }
.db-create-header h2 > i { margin-right: 8px; color: var(--bc-primary, #8352F1); font-size: 18px; }
.db-create-header p { margin: 5px 0 0; color: var(--wp-text-muted, #66748C); font-size: 13px; line-height: 1.6; }
.db-create-header .db-password-close { flex: 0 0 36px; min-width: 36px; }
.db-create-form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; margin: 0; }
.db-create-body { padding: 24px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.db-create-section { min-width: 0; margin: 20px 0 0; padding: 18px; border: 1px solid var(--wp-border, #E5E3ED); border-radius: 12px; }
.db-create-section:first-child { margin-top: 0; }
.db-create-section legend { float: none; width: auto; max-width: 100%; margin: 0; padding: 0 7px; font-family: var(--bc-font-heading, Outfit, sans-serif); font-size: 16px; font-weight: 600; }
.db-create-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; }
.db-create-field { min-width: 0; margin: 0 0 14px; }
.db-create-field:last-child { margin-bottom: 0; }
.db-create-grid .db-create-field { margin-bottom: 0; }
.db-create-dialog .db-create-field > label { display: block; margin: 0 0 7px; font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--wp-text-secondary, #33445D); }
.db-create-dialog .db-create-field > label > span { color: var(--bc-primary, #8352F1); }
.db-create-dialog .form-control { display: block; width: 100%; min-width: 0; min-height: var(--bc-control-h, 40px); padding: 10px 12px; border: 1px solid var(--wp-border, #DDDDE9); border-radius: 8px; background-color: #FFF; color: var(--wp-text, #172C49); font-family: inherit; font-size: 13px; line-height: 1.45; }
.db-create-dialog select.form-control { padding-right: 34px; }
.db-create-dialog .form-control::placeholder { color: #8A93A3; opacity: 1; }
.db-create-dialog .form-control:focus { outline: none; border-color: var(--bc-primary, #8352F1); box-shadow: 0 0 0 3px rgba(131, 82, 241, .1); }
.db-create-dialog .form-control[aria-invalid="true"] { border-color: #D33535; }
.db-create-prefixed { display: flex; min-width: 0; align-items: stretch; border: 1px solid var(--wp-border, #DDDDE9); border-radius: 8px; background: #FFF; overflow: hidden; }
.db-create-prefixed:focus-within { border-color: var(--bc-primary, #8352F1); box-shadow: 0 0 0 3px rgba(131, 82, 241, .1); }
.db-create-prefixed > span { display: flex; align-items: center; min-width: 0; max-width: 48%; padding: 9px 10px; overflow-wrap: anywhere; background: #F7F5FC; border-right: 1px solid var(--wp-border, #DDDDE9); color: #65718A; font-size: 12px; line-height: 1.45; }
.db-create-prefixed > span[hidden] { display: none; }
#modal-create-db-backdrop .db-create-prefixed > input.form-control { flex: 1 1 0; border: none; border-radius: 0; box-shadow: none; }
.db-create-help, .db-create-preview, .db-create-section-help, .db-create-scope { margin: 6px 0 0; font-size: 12px; line-height: 1.6; color: var(--wp-text-muted, #66748C); }
.db-create-preview { color: var(--wp-text-secondary, #485570); overflow-wrap: anywhere; }
.db-create-section-help { margin: 0 0 15px; }
.db-create-section > .db-create-help { margin-top: 10px; }
.db-create-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.db-create-tools .bgc-btn { min-height: 36px; font-size: 12px; padding: 8px 11px; }
.db-create-custom { margin-top: 14px; padding: 14px; background: #FAF9FD; border: 1px solid var(--wp-border, #E5E3ED); border-radius: 8px; }
.db-create-custom[hidden] { display: none; }
.db-create-custom > p { margin: 0 0 12px; }
.db-create-grants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.db-create-grants > label { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 12px; line-height: 1.5; cursor: pointer; overflow-wrap: anywhere; }
.db-create-grants input { flex: 0 0 16px; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--bc-primary, #8352F1); }
.db-create-scope { margin-top: 14px; }
.db-create-scope > i { margin-right: 5px; color: var(--bc-primary, #8352F1); }
.db-create-error { margin: 18px 0 0; padding: 12px 14px; border: 1px solid #F5C2C2; border-radius: 8px; background: #FFF6F6; color: #A62929; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.db-create-error[hidden] { display: none; }
.db-create-error > p { margin: 6px 0 12px; }
.db-create-error:first-child { margin-top: 0; }
.db-create-footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin: 0; padding: 16px 24px; border-top: 1px solid var(--wp-border, #E5E3ED); background: #FCFBFF; }
.db-create-footer > p { flex: 1 1 200px; margin: 0; color: var(--wp-text-muted, #66748C); font-size: 12px; line-height: 1.6; }
.db-create-footer > p:empty { display: none; }
.db-create-footer .bgc-btn { min-height: var(--bc-control-h, 40px); }
.db-create-dialog button:disabled { opacity: .6; cursor: not-allowed; }
.db-create-dialog :is(button, input, select):focus-visible { outline: 2px solid var(--bc-primary, #8352F1); outline-offset: 3px; }
.db-create-dialog :is(input, select):disabled { background: #F5F4F8; color: #768095; }
.db-create-loading, .db-create-empty p { margin: 0; color: var(--wp-text-muted, #66748C); line-height: 1.7; font-size: 13px; }
.db-create-empty h3 { margin: 0 0 8px; font-size: 18px; }
.db-create-success { margin: 0 0 22px; }
.db-create-success-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 12px; border-radius: 50%; background: #E9FBF3; color: #059C73; font-size: 18px; }
.db-create-success h3 { margin: 0 0 6px; font-size: 20px; }
.db-create-success p { margin: 0; color: var(--wp-text-muted, #66748C); font-size: 13px; line-height: 1.6; }
.db-create-details { display: grid; gap: 0; margin: 0 0 20px; border: 1px solid var(--wp-border, #E5E3ED); border-radius: 10px; overflow: hidden; }
.db-create-details > div { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(0, 2fr); gap: 16px; padding: 13px 16px; border-bottom: 1px solid var(--wp-border-light, #F0EDF7); font-size: 13px; }
.db-create-details > div:last-child { border-bottom: none; }
.db-create-details :is(dt,dd) { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.db-create-details dt { color: var(--wp-text-muted, #66748C); }
.db-create-details dd { color: var(--wp-text, #172C49); font-weight: 500; }
.db-create-secret { display: flex; gap: 8px; min-width: 0; }
.db-create-secret > input { flex: 1 1 0; }
.db-create-secret > button { flex: 0 0 auto; min-width: 64px; }
@media (max-width: 600px) {
    #modal-create-db-backdrop.db-create-backdrop { padding: 10px; }
    #modal-create-db-backdrop .db-create-dialog { max-height: calc(100dvh - 20px); border-radius: 12px; }
    .db-create-header { padding: 17px 16px; gap: 8px; }
    .db-create-header h2 { font-size: 20px; }
    .db-create-header p { font-size: 12px; }
    .db-create-body { padding: 16px; }
    .db-create-section { padding: 14px; margin-top: 16px; }
    .db-create-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; }
    .db-create-grants { grid-template-columns: minmax(0, 1fr); gap: 13px; }
    .db-create-footer { padding: 14px 16px; gap: 8px; }
    .db-create-footer > p { flex-basis: 100%; }
    .db-create-footer > button { flex: 1 1 auto; }
    .db-create-tools > button { flex: 1 1 auto; }
    .db-create-details > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
