/* Action buttons in the Whistleblower admin. */
#wpbody .wbls-admin-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 15px;
    border: 1px solid #0578a9;
    border-radius: 9px;
    background: #0578a9;
    color: #fff;
    font: inherit;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

#wpbody .wbls-admin-action:hover {
    background: #04658e;
    border-color: #04658e;
    color: #fff;
}

#wpbody .wbls-admin-action-import,
#wpbody .wbls-admin-action-apply,
#wpbody .wbls-admin-action-small {
    background: #eef6fb;
    border-color: #b5d1e1;
    color: #0a4562;
}

#wpbody :is(.wbls-admin-action-import, .wbls-admin-action-apply, .wbls-admin-action-small):hover {
    background: #deeff8;
    border-color: #8bb5cc;
    color: #0a4562;
}

#wpbody .wbls-admin-action-small {
    min-height: 34px;
    padding: 5px 11px;
}

#wpbody .wbls-admin-action:focus-visible {
    outline: 3px solid #9baedc;
    outline-offset: 2px;
}

#wpbody .wbls-admin-action:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.wbls-admin-action-add { --action-icon: "\f543"; }
.wbls-admin-action-import { --action-icon: "\f317"; }
.wbls-admin-action-export { --action-icon: "\f316"; }
.wbls-admin-action-apply { --action-icon: "\f344"; }

.wbls-admin-action:not(.wbls-button-loading)::before {
    content: var(--action-icon) / "";
    font: normal 19px/1 dashicons;
    flex: 0 0 19px;
}

.wbls-admin-header > .wbls-admin-action:last-child { margin-inline-end: 20px; }
.wbls-forms-header > .wbls-import-toggle { margin-inline-end: 12px; }

.wbls-form-author .wbls-submission-count-link {
    color: #3858e9;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.wbls-submission-count-link:focus-visible {
    outline: 2px solid #0578a9;
    outline-offset: 3px;
}

#wpbody .wbls-import-panel {
    box-sizing: border-box;
    max-inline-size: 720px;
    margin: 16px 10px 22px;
    padding: clamp(16px, 3vw, 28px);
    border: 1px solid #dbe5ee;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 16px #17264b0d;
    color: #17264b;
}

.wbls-import-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wbls-import-heading .dashicons {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    height: 40px;
    border-radius: 9px;
    background: #eef6fb;
    color: #0578a9;
}

.wbls-import-heading h3 { margin: 0; font-size: 18px; }
.wbls-import-panel > p { margin: 12px 0 18px; color: #4d5c75; line-height: 1.6; }

.wbls-import-file-area {
    padding: 15px;
    border: 1px dashed #afc8d9;
    border-radius: 9px;
    background: #f6fafd;
}

.wbls-import-file-area input[type=file] {
    box-sizing: border-box;
    width: 100%;
    padding: 3px;
    font: inherit;
}

.wbls-import-file-area ::file-selector-button {
    margin-inline-end: 10px;
    padding: 7px 11px;
    border: 1px solid #b5d1e1;
    border-radius: 6px;
    background: #fff;
    color: #0a4562;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.wbls-import-file-area input[type=file]:focus-visible { outline: 2px solid #0578a9; outline-offset: 2px; }
#wpbody .wbls-import-file-area .description { margin: 8px 0 0; font-style: normal; }
.wbls-import-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

#wpbody .wbls-import-actions .wbls-admin-action-import { background: #0578a9; border-color: #0578a9; color: #fff; }
#wpbody .wbls-import-actions .wbls-admin-action-import:hover { background: #04658e; border-color: #04658e; }
#wpbody .wbls-import-actions .wbls-import-cancel { background: #fff; border-color: #b5d1e1; color: #0a4562; }
#wpbody .wbls-import-actions .wbls-import-cancel:hover { background: #eef6fb; }

#wpbody .wbls-forms-page .wbls-import-panel {
    margin: 0 0 24px;
    border-color: #e1e6f0;
    border-radius: 16px;
    box-shadow: 0 4px 20px #17264b05;
}

.wbls-forms-page .wbls-transfer-notice { margin-inline: 0; border-radius: 8px; }

.wbls-admin-action-filter { --action-icon: "\f536"; }
.wbls-admin-action-reset { --action-icon: "\f463"; }
.wbls-admin-action-delete { --action-icon: "\f182"; }

#wpbody .wbls-admin-action-reset {
    background: #eef6fb;
    border-color: #b5d1e1;
    color: #0a4562;
}

#wpbody .wbls-admin-action-reset:hover {
    background: #deeff8;
    border-color: #8bb5cc;
    color: #0a4562;
}

#wpbody .wbls-admin-action-delete {
    background: #fff5f5;
    border-color: #f0cdd1;
    color: #b42332;
}

#wpbody .wbls-admin-action-delete:hover:not(:disabled) {
    background: #ffe8eb;
    border-color: #dc929b;
    color: #91202b;
}

.wbls-admin-header:is(.wbls-theme-editor-header, .wbls-submissions-editor-header) {
    height: auto;
    min-height: 80px;
    gap: 12px;
}

.wbls-theme-editor-header .wbls-theme-title-row { min-width: 0; }
.wbls-theme-editor-header .wbls-theme-title { max-width: 100%; }

.wbls-header-actions {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 18px;
    margin-inline-start: auto;
}

.wbls-header-actions .wbls-theme-save-button { margin: 0; }

#wpbody .wbls-admin-action-back {
    --action-icon: "\f341";
    background: #eef6fb;
    border-color: #b5d1e1;
    color: #0a4562;
}

#wpbody .wbls-admin-action-back:hover {
    background: #deeff8;
    border-color: #8bb5cc;
    color: #0a4562;
}

@media (max-width: 680px) {
    :is(.wbls-theme-editor-header, .wbls-submissions-editor-header) { flex-wrap: wrap; }
    .wbls-theme-editor-header .wbls-theme-title-row,
    .wbls-submissions-editor-header .wbls-page-title { flex-basis: calc(100% - 90px); }
}

.wbls-editable-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

#wpbody .wbls-editable-title :is(.wbls-editable-title-input, .wbls-editable-title-display) {
    box-sizing: border-box;
    flex: 0 1 210px;
    inline-size: 210px;
    min-inline-size: 0;
    max-inline-size: 100%;
    block-size: 40px;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid #cbd7eb;
    border-radius: 8px;
    color: #17264b;
    font: inherit;
    line-height: 26px;
}

#wpbody .wbls-editable-title .wbls-editable-title-input {
    background: #f7faff;
    transition: background-color .15s, border-color .15s;
}

#wpbody .wbls-editable-title .wbls-editable-title-input:not([readonly]):focus {
    border-color: #3858e9;
    background: #fff;
    box-shadow: 0 0 0 2px #3858e926;
    outline: none;
}

#wpbody .wbls-editable-title .wbls-editable-title-input[readonly],
.wbls-editable-title-input:not([readonly]) + .wbls-editable-title-display {
    display: none;
}

#wpbody .wbls-editable-title .wbls-editable-title-display {
    overflow: hidden;
    border-color: #dce1ea;
    background: #f2f4f7;
    color: #505b70;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#wpbody :is(.wbls-editable-title-edit, .wbls-editable-title-cancel) {
    box-sizing: border-box;
    flex: 0 0 34px;
    inline-size: 34px;
    min-width: 34px;
    padding-inline: 6px;
}

#wpbody .wbls-editable-title-edit[hidden] { display: none; }

/* Keep the cancel button's space when switching between display and edit modes. */
#wpbody .wbls-editable-title-cancel[hidden] {
    display: inline-flex;
    visibility: hidden;
}

:is(.wbls-editable-title-edit, .wbls-editable-title-cancel) .dashicons { width: 17px; height: 17px; font-size: 17px; }
