.sun-new-orders-layout {
    /* sizing */
    --sun-orders-radius-lg: 16px;
    --sun-orders-radius-md: 12px;
    --sun-orders-radius-pill: 999px;
    --sun-orders-actions-w: 300px;

    /* surfaces & text (neutral) */
    --sun-orders-card-bg: #ffffff;
    --sun-orders-row-border: #ececf1;
    --sun-orders-shadow: 0 10px 30px rgba(17, 17, 26, 0.06);
    --sun-orders-text: #2c2c3a;
    --sun-orders-muted: #6b7280;
    --sun-orders-header: #1f2937;

    /* accent + header icons (neutral defaults - override per client) */
    --sun-orders-accent: #374151;
    --sun-orders-number: var(--sun-orders-accent);
    --sun-orders-icon: #9ca3af;
    --sun-orders-icon-number: var(--sun-orders-icon);
    --sun-orders-icon-date: var(--sun-orders-icon);
    --sun-orders-icon-status: var(--sun-orders-icon);
    --sun-orders-icon-total: var(--sun-orders-icon);
    --sun-orders-icon-actions: var(--sun-orders-icon);

    /* neutral status/button base (override per client) */
    --sun-orders-neutral-fg: #6b7280;
    --sun-orders-neutral-bg: #f1f1f4;
    --sun-orders-neutral-border: #e5e7eb;

    /* status pills (neutral defaults - override per client) */
    --sun-orders-cancelled-fg: #6b7280;
    --sun-orders-cancelled-bg: #f1f1f4;
    --sun-orders-processing-fg: #6b7280;
    --sun-orders-processing-bg: #f1f1f4;
    --sun-orders-completed-fg: #6b7280;
    --sun-orders-completed-bg: #f1f1f4;

    /* action buttons (neutral defaults - override per client) */
    --sun-orders-pay-fg: #6b7280;
    --sun-orders-pay-bg: #f1f1f4;
    --sun-orders-pay-border: #e5e7eb;
    --sun-orders-view-fg: #6b7280;
    --sun-orders-view-bg: #f1f1f4;
    --sun-orders-view-border: #e5e7eb;
    --sun-orders-cancel-fg: #6b7280;
    --sun-orders-cancel-bg: #f1f1f4;
    --sun-orders-cancel-border: #e5e7eb;
}


/* outer panel */
.sun-new-orders-layout table.woocommerce-orders-table {
    width: 100%;
    margin: 0;
    border: 0;
    box-sizing: border-box;
    padding: 24px;
    background: var(--sun-orders-card-bg);
    border-radius: var(--sun-orders-radius-lg);
    box-shadow: var(--sun-orders-shadow);
}


/* flatten the table so rows can become flex/grid cards */
.sun-new-orders-layout table.woocommerce-orders-table thead,
.sun-new-orders-layout table.woocommerce-orders-table tbody,
.sun-new-orders-layout table.woocommerce-orders-table tr,
.sun-new-orders-layout table.woocommerce-orders-table th,
.sun-new-orders-layout table.woocommerce-orders-table td {
    display: block !important;
    padding: 0;
}

.sun-new-orders-layout table.woocommerce-orders-table thead tr,
.sun-new-orders-layout table.woocommerce-orders-table tbody tr {
    display: grid !important;
    grid-template-columns: 0.8fr 1fr 1fr 1.2fr var(--sun-orders-actions-w);
    align-items: center;
    column-gap: 16px;
}

/* centre all cell content (default) */
.sun-new-orders-layout table.woocommerce-orders-table th.woocommerce-orders-table__cell-order-number,
.sun-new-orders-layout table.woocommerce-orders-table td.woocommerce-orders-table__cell-order-date,
.sun-new-orders-layout table.woocommerce-orders-table td.woocommerce-orders-table__cell-order-total {
    text-align: center !important;
}

.sun-new-orders-layout table.woocommerce-orders-table td.woocommerce-orders-table__cell-order-status {
    justify-self: center;
}

/* drop theme container side padding */
.sun-new-orders-layout.woocommerce-account.woocommerce-page .woocommerce {
    padding-left: 0;
    padding-right: 0;
}


/* neutralise theme grey cell backgrounds (keep the status pill) */
.sun-new-orders-layout .woocommerce-orders-table thead,
.sun-new-orders-layout .woocommerce-orders-table tbody,
.sun-new-orders-layout .woocommerce-orders-table thead tr,
.sun-new-orders-layout .woocommerce-orders-table th,
.sun-new-orders-layout .woocommerce-orders-table td:not(.woocommerce-orders-table__cell-order-status) {
    background: transparent !important;
    box-shadow: none !important;
}


/* remove cell borders  */
.sun-new-orders-layout table.woocommerce-orders-table th,
.sun-new-orders-layout table.woocommerce-orders-table td {
    border: 0 !important;
}


/* header row */
.sun-new-orders-layout .woocommerce-orders-table thead tr {
    padding: 0 16px;
}

.sun-new-orders-layout table.woocommerce-orders-table th.woocommerce-orders-table__header {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--sun-orders-header);
    text-transform: none;
}

.sun-new-orders-layout .woocommerce-orders-table__header::before {
    font-family: "Font Awesome 7 Free";
    font-weight: 900;
    font-style: normal;
    font-size: 15px;
    display: inline-block;
    padding-right: 10px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sun-new-orders-layout .woocommerce-orders-table__header-order-number::before {
    content: "\f290"; /* shopping-bag */
    color: var(--sun-orders-icon-number);
}

.sun-new-orders-layout .woocommerce-orders-table__header-order-date::before {
    content: "\f133"; /* calendar */
    color: var(--sun-orders-icon-date);
}

.sun-new-orders-layout .woocommerce-orders-table__header-order-status::before {
    content: "\f042"; /* circle-half-stroke */
    color: var(--sun-orders-icon-status);
}

.sun-new-orders-layout .woocommerce-orders-table__header-order-total::before {
    content: "\f02b"; /* tag */
    color: var(--sun-orders-icon-total);
}

.sun-new-orders-layout .woocommerce-orders-table__header-order-actions::before {
    content: "\e0b7"; /* bolt-lightning */
    color: var(--sun-orders-icon-actions);
}


/* order rows */
.sun-new-orders-layout .woocommerce-orders-table tbody tr {
    margin-top: 14px;
    padding: 16px 18px;
    background: transparent;
    border: 1px solid var(--sun-orders-row-border);
    border-radius: var(--sun-orders-radius-md);
    transition: box-shadow 0.2s ease;
}

.sun-new-orders-layout .woocommerce-orders-table tbody tr:hover {
    box-shadow: var(--sun-orders-shadow);
}

.sun-new-orders-layout .woocommerce-orders-table__cell-order-number a {
    color: var(--sun-orders-number);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

.sun-new-orders-layout .woocommerce-orders-table__cell-order-date,
.sun-new-orders-layout .woocommerce-orders-table__cell-order-total {
    color: var(--sun-orders-muted);
    font-size: 15px;
}

.sun-new-orders-layout .woocommerce-orders-table__cell-order-total .woocommerce-Price-amount {
    color: var(--sun-orders-text);
    font-weight: 600;
}


/* status pill */
.sun-new-orders-layout .woocommerce-orders-table__cell-order-status {
    padding: 7px 14px;
    border-radius: var(--sun-orders-radius-pill);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    color: var(--sun-orders-neutral-fg);
    background: var(--sun-orders-neutral-bg);
}

.sun-new-orders-layout .woocommerce-orders-table__row--status-cancelled .woocommerce-orders-table__cell-order-status,
.sun-new-orders-layout .woocommerce-orders-table__row--status-failed .woocommerce-orders-table__cell-order-status {
    color: var(--sun-orders-cancelled-fg);
    background: var(--sun-orders-cancelled-bg);
}

.sun-new-orders-layout .woocommerce-orders-table__row--status-processing .woocommerce-orders-table__cell-order-status,
.sun-new-orders-layout .woocommerce-orders-table__row--status-on-hold .woocommerce-orders-table__cell-order-status,
.sun-new-orders-layout .woocommerce-orders-table__row--status-pending .woocommerce-orders-table__cell-order-status {
    color: var(--sun-orders-processing-fg);
    background: var(--sun-orders-processing-bg);
}

.sun-new-orders-layout .woocommerce-orders-table__row--status-completed .woocommerce-orders-table__cell-order-status,
.sun-new-orders-layout .woocommerce-orders-table__row--status-processed .woocommerce-orders-table__cell-order-status,
.sun-new-orders-layout .woocommerce-orders-table__row--status-sent .woocommerce-orders-table__cell-order-status {
    color: var(--sun-orders-completed-fg);
    background: var(--sun-orders-completed-bg);
}


/* action buttons */
.sun-new-orders-layout table.woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions {
    display: flex !important;
    gap: 10px;
    justify-content: center;
}

.sun-new-orders-layout .woocommerce-orders-table__cell-order-actions .button {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    margin: 0 !important;
    padding: 9px 16px !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: none !important;
    color: var(--sun-orders-neutral-fg) !important;
    background: var(--sun-orders-neutral-bg) !important;
    transition: filter 0.15s ease;
}

.sun-new-orders-layout .woocommerce-orders-table__cell-order-actions .button:hover {
    filter: brightness(0.97);
}

.sun-new-orders-layout .woocommerce-orders-table__cell-order-actions .button::before {
    font-family: "Font Awesome 7 Free";
    font-weight: 900;
    font-style: normal;
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sun-new-orders-layout .woocommerce-orders-table__cell-order-actions .button.pay {
    color: var(--sun-orders-pay-fg) !important;
    background: var(--sun-orders-pay-bg) !important;
    border-color: var(--sun-orders-pay-border) !important;
}

.sun-new-orders-layout .woocommerce-orders-table__cell-order-actions .button.pay::before {
    content: "\f0d6"; /* money-bill */
}

.sun-new-orders-layout .woocommerce-orders-table__cell-order-actions .button.view {
    color: var(--sun-orders-view-fg) !important;
    background: var(--sun-orders-view-bg) !important;
    border-color: var(--sun-orders-view-border) !important;
}

.sun-new-orders-layout .woocommerce-orders-table__cell-order-actions .button.view::before {
    content: "\f06e"; /* eye */
}

.sun-new-orders-layout .woocommerce-orders-table__cell-order-actions .button.cancel {
    color: var(--sun-orders-cancel-fg) !important;
    background: var(--sun-orders-cancel-bg) !important;
    border-color: var(--sun-orders-cancel-border) !important;
}

.sun-new-orders-layout .woocommerce-orders-table__cell-order-actions .button.cancel::before {
    content: "\f00d"; /* xmark */
}


/* responsive */
@media (max-width: 768px) {
    .sun-new-orders-layout table.woocommerce-orders-table {
        padding: 16px;
    }

    .sun-new-orders-layout table.woocommerce-orders-table thead {
        display: none !important;
    }

    .sun-new-orders-layout table.woocommerce-orders-table tbody tr {
        grid-template-columns: 1fr;
        row-gap: 12px;
    }

    .sun-new-orders-layout .woocommerce-orders-table__cell-order-actions .button {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        padding: 9px 8px !important;
    }

    /* hide WooCommerce's auto data-title label inside the status pill */
    .sun-new-orders-layout table.woocommerce-orders-table td.woocommerce-orders-table__cell-order-status::before {
        content: "" !important;
    }

    .sun-new-orders-layout table.woocommerce-orders-table td.woocommerce-orders-table__cell-order-status {
        display: flex !important;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }
}