/* Important declarations in this layer take precedence over legacy theme/module overrides. */
@layer go4host-buttons {
    :root {
        --go4h-button-height: 40px;
        --go4h-button-radius: 6px;
        --go4h-action-primary: #20817d;
        --go4h-action-primary-hover: #186560;
        --go4h-action-danger: #dc3545;
        --go4h-action-danger-hover: #b92534;
    }

    :where(#main-body, #footer, .modal, .hostiko-domain-search, .pricing-carousel) :is(.btn, .dash-button, .sdaz-manage-btn, .preset-btn):not(.btn-link, .close),
    #footer .footer-actions .nav-link {
        display: inline-block;
        box-sizing: border-box !important;
        max-width: 100% !important;
        min-height: var(--go4h-button-height) !important;
        height: auto !important;
        padding: 9px 14px !important;
        border: 1px solid var(--go4h-btn-border, #94a3b8) !important;
        border-radius: var(--go4h-button-radius) !important;
        background: var(--go4h-btn-bg, #fff) !important;
        color: var(--go4h-btn-text, #475569) !important;
        font-family: inherit !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        line-height: 20px !important;
        text-align: center !important;
        text-transform: none !important;
        text-decoration: none !important;
        vertical-align: middle !important;
        white-space: normal !important;
        box-shadow: none !important;
        transform: none !important;
        filter: none !important;
        margin-bottom: 0 !important;
        transition: background-color .15s, border-color .15s, color .15s !important;
    }

    :where(#main-body, #footer, .modal, .hostiko-domain-search, .pricing-carousel) :is(.btn, .dash-button, .sdaz-manage-btn, .preset-btn):not(.btn-link, .close):hover,
    #footer .footer-actions .nav-link:hover {
        background: var(--go4h-btn-hover-bg, #f1f5f9) !important;
        border-color: var(--go4h-btn-hover-border, #64748b) !important;
        color: var(--go4h-btn-hover-text, #1e293b) !important;
    }

    :where(#main-body, .modal, .hostiko-domain-search, .pricing-carousel) :is(.btn-primary, .btn-success, .btn-info, .btn-gradient-blue-custom, .dash-button-primary, .dash-button-ticket, .dash-button-domain),
    #ticketReply,
    #main-body .sidebar .card-footer a.btn[href*="action=addcontact"] {
        --go4h-btn-bg: var(--go4h-action-primary);
        --go4h-btn-border: var(--go4h-action-primary);
        --go4h-btn-text: #fff;
        --go4h-btn-hover-bg: var(--go4h-action-primary-hover);
        --go4h-btn-hover-border: var(--go4h-action-primary-hover);
        --go4h-btn-hover-text: #fff;
    }

    :where(#main-body, .modal, .hostiko-domain-search, .pricing-carousel) :is(.btn-outline-primary, .dash-button-outline) {
        --go4h-btn-border: var(--go4h-action-primary);
        --go4h-btn-text: var(--go4h-action-primary);
        --go4h-btn-hover-bg: #e9f5f4;
        --go4h-btn-hover-border: var(--go4h-action-primary);
        --go4h-btn-hover-text: var(--go4h-action-primary-hover);
    }

    :where(#main-body, .modal) :is(.btn-secondary, .btn-custom-line-gray, .btn[type="reset"], .btn[data-dismiss="modal"]) {
        --go4h-btn-bg: #fff;
        --go4h-btn-border: #94a3b8;
        --go4h-btn-text: #475569;
        --go4h-btn-hover-bg: #f1f5f9;
        --go4h-btn-hover-border: #64748b;
        --go4h-btn-hover-text: #1e293b;
    }

    :where(#main-body, .modal) :is(.btn-danger, .btn-delete, .btn-remove, .btn-cancel-invite, .btn-red-custom, .ox-delete-alias, #btnRemoveUserConfirm, #btnCancelInviteConfirm),
    #modalPaymentMethodDeleteConfirmation button[type="submit"] {
        --go4h-btn-bg: var(--go4h-action-danger);
        --go4h-btn-border: var(--go4h-action-danger);
        --go4h-btn-text: #fff;
        --go4h-btn-hover-bg: var(--go4h-action-danger-hover);
        --go4h-btn-hover-border: var(--go4h-action-danger-hover);
        --go4h-btn-hover-text: #fff;
    }

    :where(#main-body, .modal) :is(.btn-warning, .dash-button-sdaz, .sdaz-manage-btn) {
        --go4h-btn-bg: #ead14a;
        --go4h-btn-border: #d4bc38;
        --go4h-btn-text: #3b350d;
        --go4h-btn-hover-bg: #d9bf33;
        --go4h-btn-hover-border: #b9a128;
        --go4h-btn-hover-text: #302a08;
    }

    :where(#main-body, #footer, .modal, .hostiko-domain-search, .pricing-carousel) :is(.btn, .dash-button, .sdaz-manage-btn, .preset-btn):focus-visible,
    #footer .footer-actions .nav-link:focus-visible {
        outline: 2px solid #0f5d76 !important;
        outline-offset: 3px !important;
    }
    :where(#main-body, #footer, .modal, .hostiko-domain-search, .pricing-carousel) :is(.btn, .dash-button, .sdaz-manage-btn, .preset-btn):is(:disabled, .disabled, [aria-disabled="true"]) {
        opacity: .55 !important;
        cursor: not-allowed !important;
        pointer-events: none !important;
    }

    #main-body .md-header .btn {
        min-height: 32px !important;
        padding: 5px 9px !important;
        font-size: 13px !important;
        border-radius: 4px !important;
    }
    :where(#main-body, .modal) .btn-group > .btn:not(:first-child),
    :where(#main-body, .hostiko-domain-search) .input-group-append > .btn {
        border-top-left-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
    }
    :where(#main-body, .modal) .btn-group > .btn:not(:last-child),
    :where(#main-body, .hostiko-domain-search) .input-group-prepend > .btn {
        border-top-right-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }
    :where(#main-body, .modal) .btn-group > .btn-group:not(:first-child) > .btn {
        border-top-left-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
    }
    :where(#main-body, .modal) .btn-group > .btn-group:last-child > .btn {
        border-top-right-radius: var(--go4h-button-radius) !important;
        border-bottom-right-radius: var(--go4h-button-radius) !important;
    }
    #main-body .btn + .btn { margin-left: 6px; }
    #main-body .btn-group > .btn + .btn { margin-left: -1px; }
    #main-body .btn-block + .btn-block { margin-left: 0; }
    #main-body .responsive-records td:has(> .btn-manage-permissions) > .btn { margin: 0 4px 8px 0 !important; }
    @media (max-width: 575px) {
        #main-body .attachment-group .input-group-append > .btn { border-radius: var(--go4h-button-radius) !important; }
    }
    #main-body .ticket-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
    #main-body .ticket-actions .btn { margin: 0; }

    :where(#main-body, .hostiko-domain-search) .input-group :is(input.form-control, select.form-control, .custom-file, .custom-file-input, .custom-file-label) {
        min-height: 40px !important;
        height: 40px !important;
    }
    #main-body .custom-file-label { padding: 9px 12px !important; line-height: 20px !important; }
    #main-body .custom-file-label::after { height: 38px !important; padding: 9px 12px !important; line-height: 20px !important; }
    #main-body .ticket-attachment-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; margin-bottom: 8px; }
    #main-body .ticket-attachment-row > .custom-file { min-width: 0; }
    #main-body .ticket-attachments :is(.custom-file, .custom-file-input, .custom-file-label) { height: 40px !important; }
    #main-body .ticket-attachments .custom-file-label { padding-right: 124px !important; border-radius: 6px !important; }
    #main-body .ticket-attachments .custom-file-label::after { content: attr(data-browse) !important; width: 112px; text-align: center; }
    #main-body .ticket-attachment-remove[hidden] { display: none !important; }
    #main-body .ticket-attachment-actions { margin-bottom: 8px; }
    @media (max-width: 575px) {
        #main-body .ticket-attachment-row { grid-template-columns: minmax(0, 1fr); }
        #main-body .ticket-attachment-remove { justify-self: start; }
    }

    #main-body .filter-grid .btn.squre-white {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-height: 64px !important;
        padding: 8px !important;
    }
    #main-body .filter-grid .btn {
        --go4h-btn-bg: #fff;
        --go4h-btn-border: #94a3b8;
        --go4h-btn-text: #475569;
        --go4h-btn-hover-bg: #e9f5f4;
        --go4h-btn-hover-border: var(--go4h-action-primary);
        --go4h-btn-hover-text: var(--go4h-action-primary-hover);
    }
    #main-body .btn:is(.active, .active-filter, [aria-pressed="true"]),
    #main-body .preset-btn.active {
        --go4h-btn-bg: var(--go4h-action-primary);
        --go4h-btn-border: var(--go4h-action-primary);
        --go4h-btn-text: #fff;
        --go4h-btn-hover-bg: var(--go4h-action-primary-hover);
        --go4h-btn-hover-border: var(--go4h-action-primary-hover);
        --go4h-btn-hover-text: #fff;
    }
    #main-body .sdaz-manage-btn::after { display: none !important; }
    #main-body .sdaz-manage-btn :is(.flips, .aarrow) { animation: none !important; transform: none !important; }
    #header.header .header-ticket-action { min-height: 40px !important; padding: 9px 17px !important; }

    /* Approved compact palette for the two dashboard panels. */
    #main-body :is(.dash-tickets, .dash-domains) .dash-button {
        min-height: 33px !important;
        padding: 7px 12px !important;
        font-size: 12px !important;
        line-height: 17px !important;
        border-radius: 5px !important;
    }
    #main-body .dash-tickets .dash-button-ticket {
        --go4h-btn-bg: #e9f5ff; --go4h-btn-border: transparent; --go4h-btn-text: #0785fa;
        --go4h-btn-hover-bg: #d8edff; --go4h-btn-hover-border: transparent; --go4h-btn-hover-text: #056dcc;
    }
    #main-body .dash-tickets .dash-button-outline {
        --go4h-btn-bg: #fff; --go4h-btn-border: #0785fa; --go4h-btn-text: #0785fa;
        --go4h-btn-hover-bg: #e9f5ff; --go4h-btn-hover-border: #0785fa; --go4h-btn-hover-text: #056dcc;
    }
    #main-body .dash-domains .dash-button-domain {
        --go4h-btn-bg: #eaf8f1; --go4h-btn-border: transparent; --go4h-btn-text: #168754;
        --go4h-btn-hover-bg: #dbf1e5; --go4h-btn-hover-border: transparent; --go4h-btn-hover-text: #116b43;
    }
    #main-body .dash-domains .dash-button-outline {
        --go4h-btn-bg: #fff; --go4h-btn-border: #2bb673; --go4h-btn-text: #168754;
        --go4h-btn-hover-bg: #eaf8f1; --go4h-btn-hover-border: #2bb673; --go4h-btn-hover-text: #116b43;
    }
}
