.wp-list-table .wpd-order-acquisition-channel.order-status,
.wp-list-table .wpd-new-vs-returning-customer.order-status {
    background: #78909c;
    color: #ffffffe0;
    opacity: .9;
    transition: all .1s ease-in-out;
}
.wp-list-table .wpd-order-acquisition-channel.order-status:hover,
.wp-list-table .wpd-new-vs-returning-customer.order-status {
    opacity: 1;
}
.wp-list-table .wpd-order-acquisition-channel.order-status.organic {
    background: #4dd72c;
}
.wp-list-table .wpd-order-acquisition-channel.order-status.google_ads {
    background: #4285f4;
}
.wp-list-table .wpd-order-acquisition-channel.order-status.microsoft_ads {
    background: #00a4ef;
}
.wp-list-table .wpd-order-acquisition-channel.order-status.email {
    background: #ed0355;
}
.wp-list-table .wpd-order-acquisition-channel.order-status.social {
    background: #e4405f;
}
.wp-list-table .wpd-order-acquisition-channel.order-status.direct {
    background: #ed4d03;
}
.wp-list-table .wpd-order-acquisition-channel.order-status.app {
    background: #edc203;
}
.wp-list-table .wpd-order-acquisition-channel.order-status.referral,
.wp-list-table .wpd-new-vs-returning-customer.order-status.customer-returning {
    background: rgb(132,103,214);
}
.wp-list-table .wpd-order-acquisition-channel.order-status.ai_chat {
    background: #00acc1;
}
.wp-list-table .wpd-order-acquisition-channel.order-status.admin {
    background: #607d8b;
}
.wp-list-table .wpd-order-acquisition-channel.order-status.unknown {
    background: #9e9e9e;
}
.wp-list-table .wpd-new-vs-returning-customer.order-status.customer-new {
    background: #03aaed;
}
td.wpd_ai_utm_campaign mark.order-status {
    background: white;
    border: solid 1px #eaeaea;
}
table.display_meta.wpd-line-item-summary th, 
table.display_meta.wpd-line-item-summary td {
    /* width: 50% !important; */
    font-size: 13px;
}
table.display_meta.wpd-line-item-summary {
    margin: 0px !important;
}
table.display_meta.wpd-line-item-summary th {
    font-weight: 500;
    color: #666;
    width: 160px !important;
}
table.display_meta.wpd-line-item-summary .wpd-meta {
    font-weight: 400;
    font-size: 80%;
    line-height: initial;
}
.wpd-attachment-media {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: flex-start;
    flex-direction: row;
}
.wpd-attachment-preview {
    width: 100px;
    height: 100px;
    display: flex;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 7px;
    box-shadow: 2px 2px 6px 0px #0000001f;
    transition: all .1s ease-in-out;
    position: relative;
    opacity: .8;
    align-items: flex-end;
    overflow: hidden;
}
.wpd-attachment-preview:hover {
    opacity: 1;
    /* transform: translateY(-5px); */
}
.wpd-media-file-name {
    line-height: initial;
    color: black;
    background: #ffffffb8;
    padding: 6px;
    max-height: 30px;
    text-overflow: ellipsis;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
}
.wpd-remove-media {
    position: absolute;
    top: 2px;
    right: 2px;
    color: red;
    transition: all .1s ease-in-out;
}
.wpd-remove-media:hover {
    background: red;
    border-radius: 7px;
    color: white;
}
.wpd-table th.wpd-sortable:hover {
    background: #f7f7f7;
}
.wpd-table th.wpd-sortable {
    cursor: pointer;
}
.wpd-table th.wpd-sortable::after {
    content: "\f347";
    font-family: 'Dashicons';
    color: #03abee;
    font-weight: 900;
    font-size: 14px;
    vertical-align: bottom;
    margin-left: 5px;
}
.wpd-table th.wpd-sortable.asc::after {
    content: "\f343";
}
.wpd-table th.wpd-sortable.active {
    border-bottom: solid 3px #03abee;
}
.wpd-table tbody tr:hover {
    background: #f7f7f7;
}
tr.wpd-table-row {
    background: white !important;
}
tr.wpd-table-row td, tr.wpd-table-row th {
    border-bottom: solid 1px #eaeaea;
}
.wpd-table {
    margin-bottom: 20px;
}
table.wpd-table th {
    font-weight: 500;
}

table.wpd-table th, table.wpd-table td {
    border-bottom: solid 1px #eaeaea;
}
table.wpd-table th, table.wpd-table td {
    vertical-align: middle;
}
tr.wpd-table-row td {
    vertical-align: middle;
}
.wpd-table input::placeholder {
    opacity: .5;
}
.wpd-table label {
    float: unset !important;
    width: unset !important;
    display: block !important;
    margin: unset !important;
}
.wpd-meta {
    opacity: .5;
    font-size: 90%;
    font-weight: 400;
}
.wpd-table p.form-field.form-field-wide {
    padding: 0px !important;
}
div#wpd-ai-cost-of-goods.panel input, 
div#wpd-ai-cost-of-goods.panel select {
    width: 100%;
    max-width: 250px;
}
div#wpd-ai-cost-of-goods {
    padding: 25px;
    position: relative;
}
table.wpd-data-table td span {
    overflow: auto;
}
table.wpd-data-table td {
    overflow-wrap: break-word;
    vertical-align: top;
    padding: 10px 0px;
}
div#wpd-ai-dashboard-summary .postbox-header h2 {
    margin-left: 40px;
    font-weight: 500;
    font-size: 16px;
}
#wpd-ai-dashboard-summary .inside {
    padding: 0px;
    margin: 0px;
}
.wpd-data-table .wpd-input {
    width: 100%;
}
.wpd-order-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    align-items: stretch;
    justify-content: center;
}
.wpd-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 1fr;
    text-align: center;
    align-items: stretch;
    justify-items: stretch;
    gap: 4px 8px;
}
.wpd-order-dashboard .wpd-order-stats {
    height: 100%;
}
.wpd-order-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 8px 4px;
}
.wpd-order-dashboard > * {
    border: solid 1px #eaeaea;
    padding: 15px 30px;
}
.wpd-statistic {
    font-size: 22px;
    font-weight: 600;
    line-height: initial;
}
.wpd-grid-full-span {
    grid-column: 1/-1;
}
.wpd-order-title {
    font-size: 12px;
    font-weight: 600;
    color: black;
    text-align: center;
    padding: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
table.wpd-data-table {
    width: 100%;
    table-layout: fixed;
    border-spacing: 0px;
    border-collapse: collapse;
}
table.wpd-data-table tr {
    border-bottom: solid 1px #eaeaea;
}
table.wpd-data-table td {
    overflow-wrap: break-word;
    vertical-align: top;
    padding: 10px 0px;
}
table.wpd-data-table td:first-child {
    width: 120px;
}
.wpd-grid-2 {
    display: grid;
    grid-template-columns: 120px 1fr;
    row-gap: 3px;
}
.wpd-order-dashboard-heading {
    display: flex;
    align-content: center;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    font-size: 18px;
    gap: 5px;
    font-weight: 500;
    color: black;
}
.wpd-order-stat-label.wpd-meta {
    color: #777;
}
table.wpd-data-table tr:last-child {
    border-bottom: none;
}
.wpd-order-dashboard .wpd-order-cost-inputs input {
    font-weight: 500;
    color: #333;
    width: 100%;
}
.wpd-order-dashboard .wpd-order-cost-inputs input::placeholder {
    opacity: .7;
    font-weight: 400;
}
div#wpd-ai-dashboard-summary .wpd-order-dashboard.wpd-license-inactive,
#wpd-ai-cost-of-goods.panel .wpd-license-inactive tbody {
    -webkit-filter: blur(5px);
    pointer-events: none;
}
div#wpd-ai-dashboard-summary .wpd-license-inactive-button,
#wpd-ai-cost-of-goods.panel .wpd-license-inactive-button {
    position: absolute;
    z-index: 9999;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Alpha Insights order dashboard – mobile friendly */
@media screen and (max-width: 1600px) {
    .wpd-order-dashboard {
        grid-template-columns: 1fr 1fr;
    }
    /* Row 1: heading+content (col1), heading+content (col2); Row 2: same */
    .wpd-order-dashboard > .wpd-order-title:nth-child(1) { grid-row: 1; grid-column: 1; }
    .wpd-order-dashboard > .wpd-order-stats { grid-row: 2; grid-column: 1; }
    .wpd-order-dashboard > .wpd-order-title:nth-child(2) { grid-row: 1; grid-column: 2; }
    .wpd-order-dashboard > .wpd-order-cost-inputs { grid-row: 2; grid-column: 2; }
    .wpd-order-dashboard > .wpd-order-title:nth-child(3) { grid-row: 3; grid-column: 1; }
    .wpd-order-dashboard > .wpd-order-attribution { grid-row: 4; grid-column: 1; }
    .wpd-order-dashboard > .wpd-order-title:nth-child(4) { grid-row: 3; grid-column: 2; }
    .wpd-order-dashboard > .wpd-order-customer-activity { grid-row: 4; grid-column: 2; }
    .wpd-order-dashboard > .wpd-grid-footer { grid-row: 5; grid-column: 1 / -1; }
}
@media screen and (max-width: 1024px) {
    .wpd-order-dashboard {
        grid-template-columns: 1fr;
    }
    /* Reset explicit placement from 1600px so order controls single-column flow */
    .wpd-order-dashboard > * {
        grid-row: auto !important;
        grid-column: auto !important;
    }
    /* Pair each heading with its content (title, content, title, content…) */
    .wpd-order-dashboard > .wpd-order-title:nth-child(1) { order: 1; }
    .wpd-order-dashboard > .wpd-order-title:nth-child(2) { order: 3; }
    .wpd-order-dashboard > .wpd-order-title:nth-child(3) { order: 5; }
    .wpd-order-dashboard > .wpd-order-title:nth-child(4) { order: 7; }
    .wpd-order-dashboard > .wpd-order-stats { order: 2; }
    .wpd-order-dashboard > .wpd-order-cost-inputs { order: 4; }
    .wpd-order-dashboard > .wpd-order-attribution { order: 6; }
    .wpd-order-dashboard > .wpd-order-customer-activity { order: 8; }
    .wpd-order-dashboard > .wpd-grid-footer { order: 9; }
    .wpd-order-dashboard .wpd-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .wpd-order-dashboard .wpd-order-stat {
        min-width: 0;
    }
    .wpd-order-dashboard .wpd-grid-2 {
        grid-template-columns: 1fr;
        row-gap: 6px;
    }
    .wpd-order-dashboard .wpd-grid-2 span:nth-child(odd) {
        font-weight: 600;
    }
    .wpd-order-dashboard .wpd-grid-footer {
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    .wpd-order-dashboard .wpd-grid-footer p {
        float: none;
        margin: 0;
        text-align: center;
    }
    .wpd-order-dashboard .wpd-grid-footer .button {
        width: 100%;
        justify-content: center;
    }
}

/* Third-level submenu styling for WordPress admin menu */
/* Works on all admin pages across entire WordPress backend */

/* Hide items that will be shown in third level */
#adminmenu #toplevel_page_wpd-profit-reports .wp-submenu li.wpd-hidden-in-second-level {
    display: none !important;
}

#adminmenu .wp-submenu li.wp-has-third-level {
    position: relative;
}

#adminmenu .wp-submenu li.wp-has-third-level > a::after {
    content: '\f345';
    font-family: 'Dashicons';
    float: right;
    margin-left: 8px;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

#adminmenu .wp-submenu li.wp-has-third-level:hover > a::after {
    opacity: 1;
}

#adminmenu .wp-submenu ul.wp-third-level-menu {
    position: absolute;
    left: 100%;
    top: -6px;
    min-width: 200px;
    background: #2c3338;
    border-left: 1px solid #3c434a;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    margin-left: 0;
    padding: 0;
    /* Hide by moving off-screen and making invisible */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s 0.2s;
}

#adminmenu .wp-submenu li.wp-has-third-level:hover > ul.wp-third-level-menu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.2s ease, visibility 0s 0s;
}

#adminmenu .wp-third-level-menu li {
    margin: 0;
    padding: 0;
}

#adminmenu .wp-third-level-menu li a {
    display: block;
    padding: 8px 12px;
    color: #c3c4c7 !important;
    background: transparent !important;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.4;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

#adminmenu .wp-third-level-menu li a:hover,
#adminmenu .wp-third-level-menu li a:focus {
    background: #2c3338 !important;
    color: #72aee6 !important;
}

#adminmenu .wp-third-level-menu li.current a,
#adminmenu .wp-third-level-menu li a.current {
    background: #0c7ac7 !important;
    color: #fff !important;
    font-weight: 600;
}

/* Ensure smooth transition */
#adminmenu .wp-submenu li.wp-has-third-level {
    transition: background 0.2s ease;
}
#adminmenu .wp-submenu ul.wp-third-level-menu li a, #adminmenu .wp-submenu ul.wp-third-level-menu li a:hover {
    font-weight: 400;
}

/* Order dashboard browsing history */
.wpd-order-customer-activity {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.wpd-order-customer-activity .wpd-stats-grid {
    flex: 1 1 auto;
    min-height: 0;
}
.wpd-order-customer-activity .wpd-browsing-history-btn {
    display: block;
    width: 100%;
    margin-top: auto;
    flex: 0 0 auto;
    background: #fff;
    border: 1px solid #d0d5dd;
    color: #1d2327;
    box-shadow: none;
    border-radius: 7px;
    font-weight: 600;
    padding: 10px 16px;
    text-align: center;
    height: auto !important;
    line-height: 1.3;
}
.wpd-order-customer-activity .wpd-browsing-history-btn:hover,
.wpd-order-customer-activity .wpd-browsing-history-btn:focus {
    background: #fff;
    border-color: #138fdd;
    color: #138fdd;
    box-shadow: none;
}

body.wpd-bh-modal-open {
    overflow: hidden;
}
.wpd-bh-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
}
.wpd-bh-modal.is-open {
    display: block;
}
.wpd-bh-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}
.wpd-bh-dialog {
    position: relative;
    z-index: 1;
    width: min(860px, calc(100vw - 40px));
    max-height: calc(100vh - 48px);
    margin: 24px auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.wpd-bh-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid #eee;
}
.wpd-bh-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111;
}
.wpd-bh-subtitle {
    margin: 4px 0 0;
    color: #667085;
    font-size: 13px;
}
.wpd-bh-close {
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #667085;
    padding: 0 4px;
}
.wpd-bh-body {
    padding: 12px 12px 20px;
    overflow: auto;
}
.wpd-bh-loading,
.wpd-bh-empty,
.wpd-bh-empty-session {
    padding: 28px 16px;
    text-align: center;
    color: #667085;
}
.wpd-bh-session {
    border: 1px solid #ececec;
    border-radius: 10px;
    margin: 0 8px 10px;
    background: #fff;
}
.wpd-bh-session-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fafafa;
    border: 0;
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    text-align: left;
}
.wpd-bh-session.is-open .wpd-bh-session-toggle {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: 1px solid #ececec;
    background: #fff;
}
.wpd-bh-session-main,
.wpd-bh-session-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}
.wpd-bh-session-date {
    font-weight: 600;
    color: #111;
}
.wpd-bh-session-meta {
    color: #667085;
    font-size: 12px;
}
.wpd-bh-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.wpd-bh-pill {
    display: inline-block;
    background: #eef6fc;
    color: #138fdd;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.wpd-bh-pill-order {
    background: #edfaf3;
    color: #14804a;
}
.wpd-bh-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid #98a2b3;
    border-bottom: 2px solid #98a2b3;
    transform: rotate(45deg);
    margin-left: 4px;
}
.wpd-bh-session.is-open .wpd-bh-chevron {
    transform: rotate(225deg);
    margin-top: 4px;
}
.wpd-bh-session-body {
    display: none;
    padding: 14px 16px 16px;
}
.wpd-bh-session.is-open .wpd-bh-session-body {
    display: block;
}
.wpd-bh-session-summary {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: #344054;
    font-size: 13px;
}
.wpd-bh-session-summary div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px;
}
.wpd-bh-session-summary span {
    color: #667085;
    font-weight: 600;
}
.wpd-bh-session-summary a,
.wpd-bh-step-content a {
    color: #138fdd;
    text-decoration: none;
    word-break: break-all;
}
.wpd-bh-session-summary a:hover,
.wpd-bh-step-content a:hover {
    text-decoration: underline;
}
.wpd-bh-timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 12px;
    border-left: 2px solid #eaeaea;
}
.wpd-bh-step {
    position: relative;
    padding: 0 0 16px 18px;
}
.wpd-bh-step:last-child {
    padding-bottom: 0;
}
.wpd-bh-step-dot {
    position: absolute;
    left: -7px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #138fdd;
    box-shadow: 0 0 0 3px #fff;
}
.wpd-bh-step-add_to_cart .wpd-bh-step-dot,
.wpd-bh-step-init_checkout .wpd-bh-step-dot,
.wpd-bh-step-viewed_checkout_page .wpd-bh-step-dot {
    background: #7a5af8;
}
.wpd-bh-step-transaction .wpd-bh-step-dot,
.wpd-bh-step-product_purchase .wpd-bh-step-dot {
    background: #12b76a;
}
.wpd-bh-step-checkout_error .wpd-bh-step-dot {
    background: #f04438;
}
.wpd-bh-step-session-start .wpd-bh-step-dot {
    background: #12b76a;
}
.wpd-bh-step-session-end .wpd-bh-step-dot {
    background: #667085;
}
.wpd-bh-boundary-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.wpd-bh-step-session-start .wpd-bh-boundary-badge {
    background: #edfaf3;
    color: #14804a;
}
.wpd-bh-step-session-end .wpd-bh-boundary-badge {
    background: #f2f4f7;
    color: #344054;
}
.wpd-bh-step-empty .wpd-bh-empty-session {
    padding: 0;
    text-align: left;
}
.wpd-bh-step-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}
.wpd-bh-step-top strong {
    font-size: 13px;
    color: #111;
}
.wpd-bh-step-top time,
.wpd-bh-step-path {
    color: #667085;
    font-size: 12px;
}
@media screen and (max-width: 782px) {
    .wpd-bh-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        margin: 8px auto;
    }
    .wpd-bh-session-toggle,
    .wpd-bh-session-summary div {
        display: block;
    }
    .wpd-bh-session-meta {
        margin-top: 8px;
    }
}