.wp-list-table .wpd-order-acquisition-channel.order-status,
.wp-list-table .wpd-new-vs-returning-customer.order-status {
    background: #03aaed;
    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.social,
.wp-list-table .wpd-new-vs-returning-customer.order-status.customer-new {
    background: #03aaed;
}
.wp-list-table .wpd-order-acquisition-channel.order-status.organic {
    background: #4dd72c;
}
.wp-list-table .wpd-order-acquisition-channel.order-status.direct {
    background: #ed4d03;
}
.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.app {
    background: #edc203;
}
.wp-list-table .wpd-order-acquisition-channel.order-status.email {
    background: #ed0355;
}
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;
    text-align: center;
    align-items: center;
    justify-content: center;
}
.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;
}