/**
 * Legacy panel card headers (card-header2–6) — unified premium bar for all pages.
 */

body.g-sidenav-show #page_layout .card-header2,
body.g-sidenav-show #page_layout .card-header3,
body.g-sidenav-show #page_layout .card-header4,
body.g-sidenav-show #page_layout .card-header5,
body.g-sidenav-show #page_layout .card-header6,
#panel-ajax-content .card-header2,
#panel-ajax-content .card-header3,
#panel-ajax-content .card-header4,
#panel-ajax-content .card-header5,
#panel-ajax-content .card-header6 {
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    left: auto !important;
    right: auto !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    background: linear-gradient(135deg, #f4f7ff 0%, #eef2ff 42%, #f8fafc 100%) !important;
    border: 1px solid rgba(30, 64, 175, 0.1) !important;
    border-bottom: 1px solid rgba(37, 99, 235, 0.08) !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

body.g-sidenav-show #page_layout .card-header2::before,
body.g-sidenav-show #page_layout .card-header3::before,
body.g-sidenav-show #page_layout .card-header4::before,
body.g-sidenav-show #page_layout .card-header5::before,
body.g-sidenav-show #page_layout .card-header6::before,
#panel-ajax-content .card-header2::before,
#panel-ajax-content .card-header3::before,
#panel-ajax-content .card-header4::before,
#panel-ajax-content .card-header5::before,
#panel-ajax-content .card-header6::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
    pointer-events: none;
    z-index: 1;
}

body.g-sidenav-show #page_layout .card-header2 .card-head-title,
body.g-sidenav-show #page_layout .card-header3 .card-head-title,
body.g-sidenav-show #page_layout .card-header4 .card-head-title,
body.g-sidenav-show #page_layout .card-header5 .card-head-title,
body.g-sidenav-show #page_layout .card-header6 .card-head-title,
#panel-ajax-content .card-header2 .card-head-title,
#panel-ajax-content .card-header3 .card-head-title,
#panel-ajax-content .card-header4 .card-head-title,
#panel-ajax-content .card-header5 .card-head-title,
#panel-ajax-content .card-header6 .card-head-title {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 14px 16px 12px !important;
    box-sizing: border-box !important;
    border-bottom: none !important;
    position: relative;
    z-index: 2;
}

body.g-sidenav-show #page_layout .card-header2 .card-head-title > .d-flex:first-child,
body.g-sidenav-show #page_layout .card-header3 .card-head-title > .d-flex:first-child,
body.g-sidenav-show #page_layout .card-header4 .card-head-title > .d-flex:first-child,
body.g-sidenav-show #page_layout .card-header5 .card-head-title > .d-flex:first-child,
body.g-sidenav-show #page_layout .card-header6 .card-head-title > .d-flex:first-child,
body.g-sidenav-show #page_layout .card-header6 .card-head-title > .d-flex,
#panel-ajax-content .card-header2 .card-head-title > .d-flex:first-child,
#panel-ajax-content .card-header3 .card-head-title > .d-flex:first-child,
#panel-ajax-content .card-header4 .card-head-title > .d-flex:first-child,
#panel-ajax-content .card-header5 .card-head-title > .d-flex:first-child,
#panel-ajax-content .card-header6 .card-head-title > .d-flex:first-child,
#panel-ajax-content .card-header6 .card-head-title > .d-flex {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 0 1 auto !important;
    min-width: 0;
    width: fit-content !important;
    max-width: 100%;
    position: relative;
    overflow: visible !important;
    padding-bottom: 10px !important;
    margin-bottom: 0 !important;
    border-bottom: none !important;
}

body.g-sidenav-show #page_layout .card-header2 .card-head-title > .d-flex:first-child::after,
body.g-sidenav-show #page_layout .card-header3 .card-head-title > .d-flex:first-child::after,
body.g-sidenav-show #page_layout .card-header4 .card-head-title > .d-flex:first-child::after,
body.g-sidenav-show #page_layout .card-header5 .card-head-title > .d-flex:first-child::after,
body.g-sidenav-show #page_layout .card-header6 .card-head-title > .d-flex::after,
body.g-sidenav-show #page_layout .card-header6 .card-head-title > .d-flex:first-child::after,
#panel-ajax-content .card-header2 .card-head-title > .d-flex:first-child::after,
#panel-ajax-content .card-header3 .card-head-title > .d-flex:first-child::after,
#panel-ajax-content .card-header4 .card-head-title > .d-flex:first-child::after,
#panel-ajax-content .card-header5 .card-head-title > .d-flex:first-child::after,
#panel-ajax-content .card-header6 .card-head-title > .d-flex::after,
#panel-ajax-content .card-header6 .card-head-title > .d-flex:first-child::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 3px !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 55%, #60a5fa 100%) !important;
    box-shadow: 0 1px 6px rgba(37, 99, 235, 0.35);
}

body.g-sidenav-show #page_layout .card-head-icon,
#panel-ajax-content .card-head-icon {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 0 !important;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%) !important;
    background-image: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #fff !important;
    font-size: 18px !important;
    line-height: 1 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 2px 10px rgba(37, 99, 235, 0.28) !important;
}

body.g-sidenav-show #page_layout .card-head-title h3,
body.g-sidenav-show #page_layout .card-head-title h3.acc-item-title,
#panel-ajax-content .card-head-title h3,
#panel-ajax-content .card-head-title h3.acc-item-title {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 1.0625rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.025em !important;
    line-height: 1.25 !important;
    display: inline-block;
}

body.g-sidenav-show #page_layout .card-head-title h3.text-gradient-info,
body.g-sidenav-show #page_layout .card-head-title .text-gradient-info,
#panel-ajax-content .card-head-title h3.text-gradient-info,
#panel-ajax-content .card-head-title .text-gradient-info {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 48%, #3b82f6 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

body.g-sidenav-show #page_layout .card-head-actions,
#panel-ajax-content .card-head-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    width: auto !important;
    max-width: 100%;
    margin: 0 !important;
    flex: 0 0 auto;
}

body.g-sidenav-show #page_layout .card-head-actions .mass-bttns,
body.g-sidenav-show #page_layout .card-head-actions .mass-bttns2,
body.g-sidenav-show #page_layout .card-head-title > .mass-bttns,
body.g-sidenav-show #page_layout .card-head-title > .mass-bttns2,
#panel-ajax-content .card-head-actions .mass-bttns,
#panel-ajax-content .card-head-actions .mass-bttns2,
#panel-ajax-content .card-head-title > .mass-bttns,
#panel-ajax-content .card-head-title > .mass-bttns2 {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 100%;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 8px 14px !important;
    border-radius: 999px !important;
    border: none !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    letter-spacing: 0.01em;
    white-space: nowrap !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.2) inset,
        0 4px 12px rgba(15, 23, 42, 0.12) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

body.g-sidenav-show #page_layout .mass-bttns:hover,
body.g-sidenav-show #page_layout .mass-bttns2:hover,
#panel-ajax-content .mass-bttns:hover,
#panel-ajax-content .mass-bttns2:hover {
    transform: translateY(-1px) !important;
    filter: brightness(1.04);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.25) inset,
        0 8px 18px rgba(15, 23, 42, 0.16) !important;
}

body.g-sidenav-show #page_layout .btn-primary3.mass-bttns2,
#panel-ajax-content .btn-primary3.mass-bttns2 {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%) !important;
    background-image: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%) !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28) !important;
}

body.g-sidenav-show #page_layout .btn-secondary.mass-bttns,
#panel-ajax-content .btn-secondary.mass-bttns {
    background: linear-gradient(118deg, #047857 0%, #059669 45%, #10b981 100%) !important;
}

body.g-sidenav-show #page_layout .mass-bttns .mass-icon,
body.g-sidenav-show #page_layout .mass-bttns2 .mass-icon,
#panel-ajax-content .mass-bttns .mass-icon,
#panel-ajax-content .mass-bttns2 .mass-icon {
    width: 26px !important;
    height: 26px !important;
    line-height: 26px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.22) !important;
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

@media (max-width: 991.98px) {
    body.g-sidenav-show #page_layout .card-header2 .card-head-title,
    body.g-sidenav-show #page_layout .card-header3 .card-head-title,
    body.g-sidenav-show #page_layout .card-header5 .card-head-title,
    #panel-ajax-content .card-header2 .card-head-title,
    #panel-ajax-content .card-header3 .card-head-title,
    #panel-ajax-content .card-header5 .card-head-title {
        flex-wrap: wrap !important;
        align-items: flex-end !important;
        padding: 12px 14px 10px !important;
    }

    body.g-sidenav-show #page_layout .card-head-actions,
    #panel-ajax-content .card-head-actions {
        width: 100%;
        justify-content: stretch !important;
    }

    body.g-sidenav-show #page_layout .card-head-actions .mass-bttns,
    body.g-sidenav-show #page_layout .card-head-actions .mass-bttns2,
    #panel-ajax-content .card-head-actions .mass-bttns,
    #panel-ajax-content .card-head-actions .mass-bttns2 {
        flex: 1 1 calc(50% - 4px) !important;
    }

    /* New Order: single Mass order chip stays on title row (not second row) */
    body.orders-create-page #page_layout .card-header3 .card-head-title,
    #panel-ajax-content[data-panel-page="orders.create"] .card-header3 .card-head-title {
        flex-wrap: nowrap !important;
        align-items: center !important;
    }

    body.orders-create-page #page_layout .card-header3 .card-head-actions,
    #panel-ajax-content[data-panel-page="orders.create"] .card-header3 .card-head-actions {
        width: auto !important;
        max-width: none !important;
        justify-content: flex-end !important;
        flex: 0 0 auto !important;
        margin-bottom: 0 !important;
    }

    body.orders-create-page #page_layout .card-header3 .card-head-actions .mass-bttns,
    #panel-ajax-content[data-panel-page="orders.create"] .card-header3 .card-head-actions .mass-bttns {
        flex: 0 0 auto !important;
        transform: none !important;
    }

    /* New Order: hide Our Services on phone only (Mass order stays) */
    body.orders-create-page #page_layout .card-header3 .card-head-actions .mass-bttns2,
    #panel-ajax-content[data-panel-page="orders.create"] .card-header3 .card-head-actions .mass-bttns2 {
        display: none !important;
    }
}

@media (min-width: 992px) {
    body.orders-create-page #page_layout .card-header3 .card-head-actions .mass-bttns2,
    #panel-ajax-content[data-panel-page="orders.create"] .card-header3 .card-head-actions .mass-bttns2 {
        display: inline-flex !important;
    }
}

html.dark-mode body.g-sidenav-show #page_layout .card-header2,
html.dark-mode body.g-sidenav-show #page_layout .card-header3,
html.dark-mode body.g-sidenav-show #page_layout .card-header4,
html.dark-mode body.g-sidenav-show #page_layout .card-header5,
html.dark-mode body.g-sidenav-show #page_layout .card-header6,
html.dark-mode #panel-ajax-content .card-header2,
html.dark-mode #panel-ajax-content .card-header3,
html.dark-mode #panel-ajax-content .card-header4,
html.dark-mode #panel-ajax-content .card-header5,
html.dark-mode #panel-ajax-content .card-header6 {
    background: linear-gradient(135deg, #1a1f2e 0%, #151922 55%, #13151c 100%) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    border-bottom-color: rgba(96, 165, 250, 0.12) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

html.dark-mode body.g-sidenav-show #page_layout .card-head-icon,
html.dark-mode #panel-ajax-content .card-head-icon {
    background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

html.dark-mode body.g-sidenav-show #page_layout .card-head-title h3.text-gradient-info,
html.dark-mode body.g-sidenav-show #page_layout .card-head-title .text-gradient-info,
html.dark-mode #panel-ajax-content .card-head-title h3.text-gradient-info,
html.dark-mode #panel-ajax-content .card-head-title .text-gradient-info {
    background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

html.dark-mode body.g-sidenav-show #page_layout .card-header2 .card-head-title > .d-flex:first-child::after,
html.dark-mode body.g-sidenav-show #page_layout .card-header3 .card-head-title > .d-flex:first-child::after,
html.dark-mode body.g-sidenav-show #page_layout .card-header5 .card-head-title > .d-flex:first-child::after,
html.dark-mode body.g-sidenav-show #page_layout .card-header6 .card-head-title > .d-flex::after,
html.dark-mode #panel-ajax-content .card-header2 .card-head-title > .d-flex:first-child::after,
html.dark-mode #panel-ajax-content .card-header3 .card-head-title > .d-flex:first-child::after,
html.dark-mode #panel-ajax-content .card-header5 .card-head-title > .d-flex:first-child::after,
html.dark-mode #panel-ajax-content .card-header6 .card-head-title > .d-flex::after {
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%) !important;
    box-shadow: 0 1px 8px rgba(59, 130, 246, 0.45);
}
