:root {
    --page-background: #f7f9fc;
    --panel-background: #ffffff;
    --header-background: #061a43;
    --header-border: #0a2456;
    --primary: #0b63f6;
    --primary-hover: #0752d6;
    --border: #dde4ee;
    --border-dark: #c8d2e1;
    --text-primary: #101b38;
    --text-secondary: #63718a;
    --table-header: #f4f6f9;
    --table-row-hover: #f5f8fe;
    --table-row-alternate: #fbfcfe;
    --error-background: #fff1f1;
    --error-text: #d92d20;
    --success-background: #e2f7e9;
    --success-text: #138a43;
    --warning-background: #fff1bd;
    --warning-text: #8a5a00;
    --shadow: 0 2px 10px rgba(15, 30, 65, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--page-background);
    color: var(--text-primary);
}

/*
 * Author CSS rules such as `.results-state { display: grid; }` can override the
 * browser's default handling of the hidden attribute. This guarantees that
 * loading, empty, table, and pagination states are mutually exclusive.
 */
[hidden] {
    display: none !important;
}

button,
input,
select {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
}

.app-header {
    display: flex;
    align-items: center;
    min-height: 82px;
    padding: 18px 30px;
    background: var(--header-background);
    border-bottom: 1px solid var(--header-border);
    color: #ffffff;
}

.app-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.app-header p {
    margin: 5px 0 0;
    font-size: 13px;
    color: #c9d8e5;
}

/* Tabs share one shell so future workflows can replace only the content area. */
.tab-navigation {
    display: flex;
    gap: 2px;
    padding: 0 15px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.tab-button {
    min-width: 150px;
    padding: 15px 22px 13px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.tab-button.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.tab-button:disabled {
    color: #a5afb8;
    cursor: not-allowed;
}

.tab-content {
    padding: 24px 15px 30px;
}

.tab-heading {
    margin-bottom: 18px;
}

.tab-heading h2 {
    margin: 0;
    font-size: 22px;
}

.tab-heading p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.report-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.filter-panel,
.results-panel {
    background: var(--panel-background);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.filter-panel {
    padding: 20px;
}

.panel-heading {
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.panel-heading h3,
.results-header h3 {
    margin: 0;
    font-size: 17px;
}

.panel-heading p,
.results-header p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.form-field {
    margin-bottom: 16px;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}

.form-field input {
    width: 100%;
    height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    color: var(--text-primary);
    background: #ffffff;
}

.form-field select {
    width: 100%;
    height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    color: var(--text-primary);
    background: #ffffff;
}

.form-field select:focus {
    outline: 2px solid rgba(31, 111, 169, 0.2);
    border-color: var(--primary);
}

.form-field input:focus {
    outline: 2px solid rgba(31, 111, 169, 0.2);
    border-color: var(--primary);
}

.filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
}

.filter-actions .button {
    width: 100%;
}

.button {
    min-height: 38px;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-weight: 600;
    cursor: pointer;
}

.button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.button-primary {
    background: var(--primary);
    color: #ffffff;
}

.button-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.button-secondary {
    background: #ffffff;
    border-color: var(--border-dark);
    color: var(--text-primary);
}

.results-panel {
    min-width: 0;
    overflow: hidden;
}

.results-header {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 7px;
    border-bottom: 1px solid var(--border);
}

.results-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.button-export {
    min-height: 34px;
    padding: 6px 14px;
    font-size: 13px;
}

.results-state {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    color: var(--text-secondary);
}

.results-state.error {
    min-height: 54px;
    margin: 14px 20px;
    border: 1px solid #efb9b9;
    border-radius: 3px;
    background: var(--error-background);
    color: var(--error-text);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    background: #ffffff;
}

th,
td {
    padding: 7px 7px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

th:first-child,
td:first-child {
    border-left: 1px solid var(--border);
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--table-header);
    color: #34495e;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    user-select: none;
}

td {
    font-size: 12px;
    background: #ffffff;
}

tbody tr:nth-child(odd) td {
    background: var(--table-row-alternate);
}

tbody tr:nth-child(even) td {
    background: #ffffff;
}

tbody tr:hover td {
    background: var(--table-row-hover);
}

.sortable-column {
    cursor: pointer;
}

.sortable-column::after {
    content: " \21C5"; /* ? */
    color: #8795a3;
    font-size: 11px;
    font-weight: 400;
}

.sortable-column.sort-asc::after {
    content: " \2191"; /* ? */
    color: var(--primary);
    font-weight: 700;
}

.sortable-column.sort-desc::after {
    content: " \2193"; /* ? */
    color: var(--primary);
    font-weight: 700;
}

.column-resizer {
    position: absolute;
    top: 0;
    right: -3px;
    bottom: 0;
    width: 7px;
    cursor: col-resize;
    z-index: 2;
}

.column-resizer:hover {
    background: rgba(43, 108, 176, 0.18);
}

.column-resizing {
    cursor: col-resize;
    user-select: none;
}

.numeric-column {
    text-align: left;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 850px) {
    .app-header,
    .tab-navigation,
    .tab-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .report-layout {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .tab-navigation {
        overflow-x: auto;
    }

    .tab-button {
        min-width: 130px;
    }

    .filter-actions {
        flex-direction: column;
    }

    .button {
        width: 100%;
    }
}

/*Date and Pagination CSS */
.field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}

.date-range-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.date-range-item label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
}

.date-range-item input {
    width: 100%;
    height: 38px;
    padding: 6px 7px;
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    background: #ffffff;
}

.table-container {
    width: 100%;
    max-height: calc(100vh - 330px);
    min-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    min-height: 58px;
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    background: #ffffff;
}

.pagination-button {
    min-width: 82px;
    height: 36px;
    padding: 7px 14px;
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    background: #ffffff;
    color: var(--text-primary);
    cursor: pointer;
}

.pagination-button:hover:not(:disabled) {
    background: var(--table-header);
}

.pagination-button:disabled {
    color: #9aa5af;
    background: #f4f6f8;
    cursor: not-allowed;
}

.pagination-info {
    min-width: 105px;
    text-align: center;
    font-size: 13px;
}
/*
 * The upper pagination separates itself from the table with a bottom border.
 * The lower pagination uses a top border to close the results grid.
 */
.pagination-bottom {
    border-top: 1px solid var(--border);
    border-bottom: 0;
}
/* end of date and pagination setup */

/* Invoice Processing styles */
.workflow-tab {
    width: 100%;
}

.invoice-processing-layout {
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 12px;
    min-height: calc(100vh - 210px);
}

.invoice-sidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
}

.invoice-queue-panel,
.invoice-list-panel,
.invoice-detail-panel {
    background: var(--panel-background);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.invoice-queue-panel {
    padding: 8px;
}

.invoice-queue-button {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.invoice-queue-button:hover {
    background: #f3f7fb;
}

.invoice-queue-button.active {
    background: #dceafb;
    color: #163d61;
}

.queue-count {
    min-width: 30px;
    padding: 3px 9px;
    border-radius: 14px;
    background: #edf2f7;
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
}

.invoice-queue-button.active .queue-count {
    background: #ffffff;
    color: var(--primary);
}

.invoice-list-panel {
    min-height: 420px;
    overflow: hidden;
}

.invoice-list-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.invoice-list-header h3 {
    margin: 0;
    font-size: 16px;
}

.invoice-refresh-button {
    min-height: 36px;
    padding: 7px 14px;
}

.invoice-list-status {
    padding: 18px;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
}

.invoice-list-status.error {
    color: var(--error-text);
    background: var(--error-background);
}

.invoice-item-list {
    max-height: calc(100vh - 380px);
    min-height: 340px;
    padding: 8px;
    overflow-y: auto;
}

.invoice-item {
    width: 100%;
    display: block;
    margin-bottom: 6px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #ffffff;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.invoice-item:hover {
    background: #f5f8fc;
    border-color: #aebfd1;
}

.invoice-item.selected {
    background: #e7f0fb;
    border-color: var(--primary);
}

.invoice-item-title {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 700;
}

.invoice-item-description {
    display: block;
    overflow: hidden;
    color: #314559;
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    margin-top: 7px;
    color: var(--text-secondary);
    font-size: 11px;
}

.invoice-error-message {
    margin-top: 7px;
    color: #a12626;
    font-size: 12px;
    line-height: 1.35;
}

.invoice-detail-panel {
    min-width: 0;
    min-height: 600px;
    overflow: hidden;
}

/*
 * The invoice review form needs more horizontal space than the normal tables,
 * so the sidebar/detail layout stacks earlier when the browser is narrowed.
 */
@media (max-width: 1250px) {
    .invoice-processing-layout {
        grid-template-columns: 1fr;
    }

    .invoice-sidebar {
        grid-template-rows: auto auto;
    }

    .invoice-item-list {
        max-height: 360px;
    }

    .invoice-detail-panel {
        min-height: 450px;
    }
}

.invoice-detail-placeholder {
    min-height: 600px;
    display: grid;
    place-items: center;
    padding: 30px;
    color: var(--text-secondary);
    text-align: center;
}

.invoice-error-frame {
    display: block;
    width: 100%;
    min-height: 100vh;
    border: 0;
    background: #ffffff;
}

/* Payment Processing uses the same report-style layout as Sent to Acumatica. */
.payment-processing-layout {
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 12px;
    min-height: calc(100vh - 210px);
}

.payment-sidebar {
    display: grid;
    grid-template-rows: auto auto;
    align-content: start;
    gap: 12px;
    min-width: 0;
}

.payment-queue-button {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.payment-queue-button:hover {
    background: #f3f7fb;
}

.payment-queue-button.active {
    background: #dceafb;
    color: #163d61;
}

.payment-queue-button.active .queue-count {
    background: #ffffff;
    color: var(--primary);
}

@media (max-width: 1050px) {
    .payment-processing-layout {
        grid-template-columns: 360px minmax(0, 1fr);
    }
}

@media (max-width: 850px) {
    .payment-processing-layout {
        grid-template-columns: 1fr;
    }
}

/* Customer queues sit above the full-width results panel. */
.customer-sync-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px 12px;
    min-height: 0;
}

.customer-sync-layout > .processing-subtabs {
    grid-column: 1 / -1;
}

#customerErrorResultsPanel {
    grid-column: 1 / -1;
}

.customer-queue-button {
    display: flex;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
}

.customer-error-col-customer {
    width: 12%;
}

.customer-error-col-name {
    width: 24%;
}

.customer-error-col-missing {
    width: 36%;
}

.customer-error-col-type {
    width: 16%;
}

.customer-error-col-date {
    width: 12%;
}

.customer-mobile-summary {
    display: none;
}

.customer-desktop-value {
    display: inline;
}

/*
 * Customer Sync switches to its stacked layout and expandable card table
 * earlier because nine columns become difficult to read well before phone size.
 */
@media (max-width: 1160px) {
    .customer-sync-layout {
        grid-template-columns: 1fr;
    }

    #customerSyncTableContainer {
        min-height: 0;
        max-height: calc(100vh - 260px);
        padding: 12px;
        background: #f8fafc;
    }

    #customerSyncTableContainer table,
    #customerSyncTableContainer tbody {
        display: block;
        width: 100%;
    }

    #customerSyncTableContainer colgroup,
    #customerSyncTableContainer thead {
        display: none;
    }

    #customerSyncTableContainer tbody tr {
        display: block;
        width: 100%;
        margin-bottom: 10px;
        overflow: hidden;
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: 0 1px 4px rgba(25, 45, 65, 0.06);
    }

    #customerSyncTableContainer tbody tr:nth-child(odd) {
        background: var(--table-row-alternate);
    }

    #customerSyncTableContainer tbody tr:nth-child(even) {
        background: #ffffff;
    }

    #customerSyncTableContainer tbody tr:last-child {
        margin-bottom: 0;
    }

    #customerSyncTableContainer tbody tr:hover {
        background: var(--table-row-hover);
    }

    /*
     * Detail cells remain hidden until the + button expands the customer.
     * Every field then renders as a label/value row.
     */
    #customerSyncTableContainer td {
        display: none;
        width: 100%;
        padding: 10px 16px;
        border-left: 0;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        background: inherit;
    }

    #customerSyncTableContainer td:first-child {
        display: block;
        padding: 0;
        border: 0;
    }

    #customerSyncTableContainer .customer-result-row.expanded td:not(:first-child) {
        display: grid;
        grid-template-columns: minmax(150px, 42%) minmax(0, 1fr);
        align-items: start;
        gap: 18px;
    }

    #customerSyncTableContainer .customer-result-row.expanded td:last-child {
        border-bottom: 0;
    }

    #customerSyncTableContainer td:not(:first-child)::before {
        content: attr(data-label);
        color: #5d6d7d;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.03em;
        text-align: left;
        text-transform: uppercase;
    }

    #customerSyncTableContainer .customer-mobile-value {
        min-width: 0;
        text-align: right;
        overflow-wrap: anywhere;
    }

    .customer-desktop-value {
        display: none;
    }

    .customer-mobile-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        min-height: 64px;
        padding: 12px 16px;
    }

    .customer-mobile-summary-text {
        min-width: 0;
        flex: 1;
    }

    .customer-mobile-summary-title {
        color: #102d47;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .customer-mobile-summary-subtitle {
        margin-top: 5px;
        color: #314559;
        font-size: 13px;
        line-height: 1.35;
    }

    .customer-mobile-toggle {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        padding: 0;
        border: 1px solid var(--border-dark);
        border-radius: 8px;
        background: #ffffff;
        color: #163d61;
        font-size: 21px;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
    }

    .customer-mobile-toggle:hover {
        background: var(--table-header);
        border-color: var(--primary);
    }

    #customerSyncTableContainer .column-resizer {
        display: none;
    }
}

/* Keep any remaining Payment sidebar content at its natural height. */
.payment-sidebar {
    align-content: start;
}

.payment-sidebar .invoice-queue-panel {
    align-self: start;
}

.invoice-review-host {
    min-height: 600px;
    padding: 20px;
    overflow: auto;
    background: #f4f4f4;
}

.invoice-review-input-error {
    border-color: #d9534f !important;
    background: #fff5f5 !important;
    outline: 2px solid rgba(217, 83, 79, 0.2);
}

.invoice-review-form {
    width: 100%;
    max-width: none;
    background: #ffffff;
    border: 1px solid #999;
    color: #000000;
}

.invoice-review-header,
.invoice-review-gl-header {
    background: #1f3a50;
    color: #ffffff;
    font-weight: 700;
}

.invoice-review-header {
    padding: 12px 14px;
}

.invoice-review-top-section {
    padding: 14px 18px 18px;
    background: #ffffff;
}

.invoice-review-field-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px 18px;
    align-items: end;
}

/*
 * Subtotal is calculated from the invoice detail lines. It remains part of the
 * submitted form but cannot receive mouse or keyboard focus.
 */
.invoice-review-total-row .invoice-review-total-input[readonly] {
    pointer-events: none;
    cursor: not-allowed;
    border-color: #c5ced7;
    background: #e9eef3;
    color: var(--text-secondary);
    box-shadow: inset 0 0 0 1px rgba(74, 91, 107, 0.04);
}

.invoice-review-field {
    min-width: 0;
}

.invoice-review-field label {
    display: block;
    margin: 0 0 3px;
    font-size: 12px;
    font-weight: 700;
}

.invoice-review-field input,
.invoice-review-field select {
    width: 100%;
    height: 25px;
    padding: 2px 6px;
    border: 1px solid #999;
    border-radius: 0;
    background: #ffffff;
    color: #000000;
}

.invoice-review-error-box {
    width: 100%;
    margin-top: 16px;
    border: 1px solid #d9534f;
    background: #ffffff;
}

.invoice-review-error-title {
    padding: 10px;
    background: #c04b4b;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.invoice-review-error-box textarea {
    width: 100%;
    min-height: 100px;
    padding: 8px;
    border: 0;
    resize: vertical;
    font: inherit;
}

.invoice-review-gl-section {
    padding-bottom: 24px;
    background: #878d91;
}

.invoice-review-gl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
}

.invoice-review-table {
    width: calc(100% - 34px);
    margin: 0 17px;
    table-layout: fixed;
    border-collapse: collapse;
    background: #ffffff;
}

.customer-results-col-id {
    width: 9%;
}

.customer-results-col-name {
    width: 18%;
}

.customer-results-col-balance {
    width: 10%;
}

.customer-results-col-credit-limit {
    width: 10%;
}

.customer-results-col-credit {
    width: 11%;
}

.customer-results-col-credit-code {
    width: 10%;
}

.customer-results-col-status {
    width: 9%;
}

.customer-results-col-date-created {
    width: 9%;
}

.customer-results-col-date-updated {
    width: 14%;
}

.error-results-col-customer {
    width: 10%;
}

.error-results-col-name {
    width: 16%;
}

.error-results-col-error {
    width: 16%;
}

.error-results-col-missing {
    width: 32%;
}

.error-results-col-review {
    width: 11%;
}

.error-results-col-amount {
    width: 7%;
}

.error-results-col-date {
    width: 8%;
}

.invoice-sent-col-id {
    width: 11%;
}

.invoice-sent-col-invoice-date {
    width: 10%;
}

.invoice-sent-col-customer-id {
    width: 10%;
}

.invoice-sent-col-customer {
    width: 15%;
}

.invoice-sent-col-type {
    width: 11%;
}

.invoice-sent-col-total {
    width: 10%;
}

.invoice-sent-col-sync-method {
    width: 12%;
}

.invoice-sent-col-date {
    width: 21%;
}

.payment-main-col-payment-date {
    width: 10%;
}

.payment-main-col-ref {
    width: 8%;
}

.payment-main-col-customer-id {
    width: 8%;
}

.payment-main-col-customer {
    width: 12%;
}

.payment-main-col-total {
    width: 10%;
}

.payment-main-col-invoice {
    width: 9%;
}

.payment-main-col-invoice-amount {
    width: 10%;
}

.payment-main-col-applied {
    width: 11%;
}

.payment-main-col-sync-method {
    width: 9%;
}

.payment-main-col-sent-date {
    width: 13%;
}

/*
 * Single-invoice and multi-invoice payment rows use the same standard
 * table appearance. The expand button is the only visual difference.
 */
#paymentMainTableBody .payment-main-single-payment-row td,
#paymentMainTableBody .payment-main-group-header td {
    border-top: 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-weight: 400;
}

#paymentMainTableBody .payment-main-single-payment-row td:first-child,
#paymentMainTableBody .payment-main-group-header td:first-child {
    border-left: 1px solid var(--border);
}

#paymentMainTableBody .payment-main-row-alternate td {
    background: var(--table-row-alternate) !important;
}

#paymentMainTableBody .payment-main-row-default td {
    background: #ffffff !important;
}

#paymentMainTableBody .payment-main-single-payment-row:hover td,
#paymentMainTableBody .payment-main-group-header:hover td {
    background: var(--table-row-hover) !important;
}

.payment-main-invoice-count-content {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.payment-main-expand-button {
    display: inline-flex;
    flex: 0 0 24px;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #88a5bc;
    border-radius: 5px;
    background: #ffffff;
    color: var(--primary);
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.payment-main-expand-button:hover {
    border-color: var(--primary);
    background: #e8f2fa;
}

.payment-main-expand-button:focus-visible {
    outline: 2px solid rgba(31, 111, 169, 0.3);
    outline-offset: 2px;
}

#paymentMainTableBody .payment-main-invoice-row td {
    border-bottom: 1px solid #e0e7ed;
    background: #ffffff !important;
    color: var(--text-primary);
}

#paymentMainTableBody .payment-main-invoice-row td:first-child {
    border-left: 4px solid #d5e2ec;
}

#paymentMainTableBody .payment-main-invoice-row:hover td {
    background: #f8fbfd !important;
}

#paymentMainTableBody .payment-main-last-invoice-row td {
    border-bottom: 2px solid #aebfcd;
}

#paymentMainTableBody .payment-main-invoice-label {
    padding-left: 38px;
    color: #587084;
    font-weight: 600;
}

#paymentMainTableBody .payment-main-invoice-label::before {
    content: "↳";
    display: inline-block;
    margin-right: 8px;
    color: var(--primary);
    font-size: 15px;
    font-weight: 700;
}

#paymentMainTableBody .payment-main-group-total,
#paymentMainTableBody .payment-main-invoice-count {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 400;
}

#paymentMainTableBody .payment-main-applied-amount,
#paymentMainTableBody .payment-main-child-invoice-id {
    font-weight: 600;
}

/* Payment Error review uses the Invoice Error card and form visual language. */
.payment-review-form {
    width: 100%;
}

.payment-review-table {
    width: calc(100% - 36px);
    margin: 16px 18px 20px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}

.payment-review-table th,
.payment-review-table td {
    padding: 8px;
    border-left: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}

.payment-review-table th {
    position: static;
    padding-top: 10px;
    padding-bottom: 10px;
    background: var(--table-header);
    color: #34495e;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
}

.payment-review-table tbody tr:last-child td {
    border-bottom: 0;
}

.payment-review-table tbody tr:nth-child(odd) td {
    background: var(--table-row-alternate);
}

.payment-review-table tbody tr:nth-child(even) td {
    background: #ffffff;
}

.payment-review-table input {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 6px 8px;
    border: 1px solid var(--border-dark);
    border-radius: 5px;
    background: #ffffff;
    color: var(--text-primary);
    font-size: 13px;
}

.payment-review-table input:focus {
    outline: 2px solid rgba(31, 111, 169, 0.18);
    border-color: var(--primary);
}

.payment-review-table input[readonly] {
    background: #f4f6f8;
    color: var(--text-secondary);
}

.payment-review-action-cell {
    text-align: center;
}

.payment-review-col-line {
    width: 10%;
}

.payment-review-col-reference {
    width: 45%;
}

.payment-review-col-amount {
    width: 30%;
}

.payment-review-col-action {
    width: 15%;
}

.payment-review-form button[value="retry_btn"]:disabled {
    cursor: not-allowed;
}

/*
 * Payment detail needs the same earlier stacking behavior as Invoice Errors
 * because the left queue and right review form both need usable width.
 */
@media (max-width: 1250px) {
    .payment-processing-layout {
        grid-template-columns: 1fr;
    }

    .payment-sidebar {
        grid-template-rows: auto auto;
    }

    .paymentProcessingList,
    #paymentProcessingList {
        max-height: 360px;
    }

    #paymentProcessingDetail {
        min-height: 450px;
    }
}

@media (max-width: 900px) {
    .payment-review-table colgroup,
    .payment-review-table thead {
        display: none;
    }

    .payment-review-table,
    .payment-review-table tbody {
        display: block;
    }

    .payment-review-table tr {
        display: grid;
        grid-template-columns: 90px minmax(120px, 1fr) minmax(120px, 1fr);
        gap: 8px;
        margin-bottom: 10px;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: #ffffff;
    }

    .payment-review-table td {
        display: block;
        width: 100%;
        padding: 0;
        border: 0;
        background: transparent !important;
    }

    .payment-review-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        color: #34495e;
        font-size: 11px;
        font-weight: 700;
    }

    .payment-review-cell-reference {
        grid-column: span 2;
    }

    .payment-review-action-cell {
        text-align: left;
    }
}

@media (max-width: 600px) {
    .payment-review-table {
        width: calc(100% - 20px);
        margin-left: 10px;
        margin-right: 10px;
    }

    .payment-review-table tr {
        grid-template-columns: 1fr 1fr;
    }

    .payment-review-cell-reference {
        grid-column: 1 / -1;
    }

    .payment-review-action-cell {
        grid-column: span 1;
    }
}

/*
 * Keep the desktop GL Line Coding table compact before switching to the
 * tablet/mobile card layout. The action column is wide enough for "Remove"
 * while smaller numeric/code columns give space back first.
 */
.invoice-review-col-cost-center {
    width: 13%;
}

.invoice-review-col-gl-account {
    width: 12%;
}

.invoice-review-col-description {
    width: 18%;
}

.invoice-review-col-message {
    width: 20%;
}

.invoice-review-col-qty {
    width: 7%;
}

.invoice-review-col-uom {
    width: 7%;
}

.invoice-review-col-amount {
    width: 11%;
}

.invoice-review-col-action {
    width: 12%;
}

.invoice-review-table th,
.invoice-review-table td {
    padding: 6px 4px;
    border: 0;
    background: #ffffff;
    color: #000000;
}

.invoice-review-table th {
    position: static;
    text-align: center;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
}

.invoice-review-table input,
.invoice-review-table select {
    width: 100%;
    min-width: 0;
    height: 25px;
    padding: 2px 6px;
    border: 1px solid #999;
    border-radius: 0;
}

.invoice-review-table input,
.invoice-review-table select {
    font-size: 13px;
}

.invoice-review-action-cell {
    text-align: center;
}

.invoice-review-total-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    width: calc(100% - 34px);
    margin: 10px 17px 0;
}

.invoice-review-total-row label {
    color: #ffffff;
    font-weight: 700;
}

.invoice-review-total-row input {
    width: 90px;
    height: 25px;
    border: 1px solid #999;
}

.invoice-review-actions {
    display: flex;
    gap: 8px;
    padding: 12px 17px 0;
}

.invoice-review-add-button,
.invoice-review-remove-button,
.invoice-review-actions button {
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid #777;
    border-radius: 0;
    background: #d9dedf;
    color: #000000;
    font-weight: 700;
    cursor: pointer;
}

/*
 * The action column should not split "Remove" into multiple lines. Other GL
 * fields are allowed to shrink before the layout switches to tablet/mobile.
 */
.invoice-review-remove-button {
    white-space: nowrap;
    padding-left: 7px;
    padding-right: 7px;
}

@media (max-width: 1350px) {
    .invoice-review-field-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }
}

@media (max-width: 1050px) {
    .invoice-review-field-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

    .invoice-review-table colgroup,
    .invoice-review-table thead {
        display: none;
    }

    .invoice-review-table,
    .invoice-review-table tbody {
        display: block;
    }

    .invoice-review-table tr {
        display: grid;
        grid-template-columns:
            110px
            110px
            minmax(180px, 1fr)
            minmax(180px, 1fr)
            65px
            70px
            100px
            80px;
        gap: 6px;
        margin-bottom: 10px;
        padding: 8px;
        border: 1px solid #b8b8b8;
        background: #ffffff;
    }

    .invoice-review-table td {
        display: block;
        width: 100%;
        padding: 0;
    }

    .invoice-review-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 3px;
        font-size: 11px;
        font-weight: 700;
        color: #333333;
    }

    .invoice-review-action-cell {
        text-align: left;
    }
}

@media (max-width: 760px) {
    .invoice-review-host {
        padding: 12px;
    }

    .invoice-review-field-grid {
        grid-template-columns: 1fr;
    }

    .invoice-review-table,
    .invoice-review-total-row {
        width: calc(100% - 20px);
        margin-left: 10px;
        margin-right: 10px;
    }

    .invoice-review-table tr {
        grid-template-columns: 1fr 1fr 72px;
    }

    .invoice-review-cell-description,
    .invoice-review-cell-message {
        grid-column: 1 / -1;
    }

    .invoice-review-cell-cost-center,
    .invoice-review-cell-gl-account {
        grid-column: span 1;
    }

    .invoice-review-cell-qty {
        grid-column: span 1;
    }

    .invoice-review-cell-uom {
        grid-column: span 1;
    }

    .invoice-review-cell-amount {
        grid-column: span 1;
    }

    .invoice-review-action-cell {
        grid-column: span 1;
    }

    .invoice-review-actions {
        flex-direction: column;
        padding-left: 10px;
        padding-right: 10px;
    }

    .invoice-review-actions button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .invoice-review-table tr {
        grid-template-columns: 1fr 1fr;
    }

    .invoice-review-cell-description,
    .invoice-review-cell-message {
        grid-column: 1 / -1;
    }

    .invoice-review-cell-qty,
    .invoice-review-cell-uom,
    .invoice-review-cell-amount,
    .invoice-review-action-cell {
        grid-column: span 1;
    }
}

/*
 * Modern invoice review styling.
 *
 * This keeps the review form visually aligned with the portal: white cards,
 * rounded panels, blue section headers, soft borders, and consistent buttons.
 */
.invoice-review-host {
    padding: 20px;
    background: #eef1f5;
}

.invoice-review-form {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow);
    color: var(--text-primary);
}

.invoice-review-header {
    padding: 14px 18px;
    background: var(--header-background);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.invoice-review-top-section {
    padding: 18px;
    background: #ffffff;
}

.invoice-review-field-grid {
    gap: 14px 18px;
}

.invoice-review-field label {
    margin-bottom: 5px;
    color: #34495e;
    font-size: 12px;
    font-weight: 700;
}

.invoice-review-field input,
.invoice-review-field select {
    height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--border-dark);
    border-radius: 5px;
    background: #ffffff;
    color: var(--text-primary);
}

.invoice-review-field input:focus,
.invoice-review-field select:focus,
.invoice-review-table input:focus {
    outline: 2px solid rgba(31, 111, 169, 0.18);
    border-color: var(--primary);
}

.invoice-review-field input[readonly] {
    background: #f4f6f8;
    color: var(--text-secondary);
}

.invoice-review-error-box {
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid #efb9b9;
    border-radius: 8px;
    background: #ffffff;
}

.invoice-review-error-title {
    padding: 10px 12px;
    background: var(--error-background);
    color: var(--error-text);
    font-size: 13px;
    font-weight: 700;
}

.invoice-review-error-box textarea {
    min-height: 90px;
    padding: 10px 12px;
    color: var(--text-primary);
    background: #ffffff;
}

.invoice-review-gl-section {
    padding-bottom: 20px;
    background: #f7fafc;
    border-top: 1px solid var(--border);
}

.invoice-review-gl-header {
    padding: 12px 18px;
    background: var(--table-header);
    border-bottom: 1px solid var(--border);
    color: #34495e;
}

.invoice-review-table {
    width: calc(100% - 36px);
    margin: 16px 18px 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}

.invoice-review-table th {
    padding: 10px 8px;
    background: var(--table-header);
    color: #34495e;
    font-size: 12px;
    font-weight: 700;
}

.invoice-review-table td {
    padding: 8px;
    border-top: 1px solid var(--border);
    background: #ffffff;
}

.invoice-review-table input,
.invoice-review-table select {
    height: 34px;
    padding: 6px 8px;
    border: 1px solid var(--border-dark);
    border-radius: 5px;
    color: var(--text-primary);
}

.invoice-review-total-row {
    width: calc(100% - 36px);
    margin: 14px 18px 0;
}

.invoice-review-total-row label {
    color: #34495e;
}

.invoice-review-total-row input {
    width: 120px;
    height: 34px;
    padding: 6px 8px;
    border: 1px solid var(--border-dark);
    border-radius: 5px;
    color: var(--text-primary);
    background: #ffffff;
}

.invoice-review-actions {
    padding: 16px 18px 0;
}

.invoice-review-add-button,
.invoice-review-remove-button,
.invoice-review-actions button {
    min-height: 34px;
    padding: 7px 13px;
    border: 1px solid var(--border-dark);
    border-radius: 5px;
    background: #ffffff;
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
}

.invoice-review-add-button:hover,
.invoice-review-remove-button:hover,
.invoice-review-actions button:hover:not(:disabled) {
    background: var(--table-header);
}

.invoice-review-actions button[value="retry_btn"] {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.invoice-review-actions button[value="retry_btn"]:hover:not(:disabled) {
    background: var(--primary-hover);
}

.invoice-review-actions button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.invoice-review-input-error {
    border-color: #d9534f !important;
    background: #fff5f5 !important;
    outline: 2px solid rgba(217, 83, 79, 0.18);
}
.invoice-review-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: calc(100% - 36px);
    margin: 14px 18px 0;
}

.invoice-review-bottom-row .invoice-review-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
}

.invoice-review-bottom-row .invoice-review-total-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: auto;
    margin: 0;
}

.invoice-review-bottom-row .invoice-review-totals {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-left: auto;
}

@media (max-width: 700px) {
    .invoice-review-bottom-row {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        width: calc(100% - 36px);
        margin: 14px 18px 0;
    }

    .invoice-review-bottom-row .invoice-review-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0;
    }

    .invoice-review-totals {
        display: flex;
        flex-direction: column;
        gap: 8px;
        min-width: 200px;
    }

    .invoice-review-bottom-row .invoice-review-total-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: auto;
        margin: 0;
    }

    .invoice-review-total-row input[readonly] {
        background: #f4f6f8;
        color: var(--text-secondary);
    }

    @media (max-width: 700px) {
        .invoice-review-bottom-row {
            align-items: stretch;
            flex-direction: column-reverse;
        }

        .invoice-review-bottom-row .invoice-review-actions {
            flex-wrap: wrap;
        }

        .invoice-review-totals {
            width: 100%;
            max-width: 240px;
        }

        .invoice-review-bottom-row .invoice-review-total-row {
            justify-content: space-between;
        }
    }
}

.invoice-review-error-row {
    display: block;
    margin-top: 18px;
}

.invoice-review-error-row .invoice-review-error-box {
    width: 100%;
    margin-top: 0;
}

.invoice-review-form.has-review-message .invoice-review-error-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: stretch;
}
.invoice-review-response-message {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #efb9b9;
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-primary);
    visibility: visible;
}

.invoice-review-response-title {
    padding: 10px 12px;
    background: var(--error-background);
    color: var(--error-text);
    font-size: 13px;
    font-weight: 700;
}

.invoice-review-response-list {
    min-height: 90px;
    margin: 0;
    padding: 10px 12px 10px 32px;
    background: #ffffff;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.45;
}

.invoice-review-response-list li {
    margin-bottom: 6px;
}

.invoice-review-response-list li:last-child {
    margin-bottom: 0;
}
/*
 * A successful Retry replaces the original error box and uses the full row.
 */
.invoice-review-form.has-review-success .invoice-review-error-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.invoice-review-form.has-review-success .invoice-review-error-box {
    display: none;
}

.invoice-review-form.has-review-success .invoice-review-response-message {
    width: 100%;
    border-color: #5ca85c;
}

.invoice-review-form.has-review-success .invoice-review-response-title {
    background: #edf8ed;
    color: #226622;
}

.invoice-review-response-message:not(.validation) .invoice-review-response-list {
    padding-left: 12px;
    list-style: none;
}

.invoice-review-response-message.processing {
    border-color: #8bb9db;
}

.invoice-review-response-message.processing .invoice-review-response-title {
    background: #eaf4fb;
    color: #185c8f;
}

.invoice-review-response-message.processing .invoice-review-response-list {
    background: #f7fbfe;
}

/* Invoice and Payment UI rework */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.processing-page {
    display: grid;
    gap: 16px;
}

.processing-subtabs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.processing-subtab {
    width: auto;
    min-width: 130px;
    min-height: 44px;
    justify-content: center;
    gap: 10px;
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #ffffff;
    box-shadow: none;
    text-align: center;
}

.processing-subtab::before {
    content: "";
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.processing-subtab-error {
    color: var(--error-text);
}

.processing-subtab-error::before {
    content: "!";
    display: inline-grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.processing-subtab-completed {
    color: var(--success-text);
}

.processing-subtab-completed::before {
    content: "✓";
    display: inline-grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.processing-subtab:hover {
    background: #f8faff;
}

.processing-subtab.active {
    position: relative;
    background: #ffffff;
    box-shadow: inset 0 -3px 0 var(--primary);
}

.processing-subtab .queue-count,
.processing-subtab.active .queue-count {
    min-width: 28px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.processing-subtab .queue-count-error,
.processing-subtab.active .queue-count-error {
    background: #ffe2e0;
    color: var(--error-text);
}

.processing-subtab .queue-count-success,
.processing-subtab.active .queue-count-success {
    background: var(--success-background);
    color: var(--success-text);
}

.invoice-processing-layout,
.payment-processing-layout {
    display: block;
    min-height: calc(100vh - 230px);
}

.invoice-processing-layout.processing-error-mode,
.payment-processing-layout.processing-error-mode {
    display: grid;
    grid-template-columns: minmax(300px, 30%) minmax(0, 70%);
    align-items: stretch;
    gap: 18px;
}

.processing-results-panel {
    width: 100%;
    border-radius: 8px;
    box-shadow: none;
}

.processing-results-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    min-height: 82px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}

.results-title-block {
    min-width: 205px;
    margin-right: auto;
}

.results-title-line {
    display: flex;
    align-items: center;
    gap: 9px;
}

.results-title-line h3 {
    margin: 0;
    font-size: 20px;
}

.results-title-block p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

.results-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--success-background);
    color: var(--success-text);
    font-size: 12px;
    font-weight: 700;
}

.primary-filter-bar {
    display: grid;
    grid-template-columns:
        minmax(270px, 1.25fr)
        minmax(170px, 0.85fr)
        minmax(210px, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 760px;
}

.primary-filter-bar > select,
.primary-date-filter,
.quick-search-control {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    background: #ffffff;
}

.primary-filter-bar > select {
    min-width: 0;
    padding: 8px 34px 8px 12px;
    color: var(--text-primary);
}

.primary-date-filter {
    display: grid;
    grid-template-columns:
        minmax(115px, 1fr)
        auto
        minmax(115px, 1fr);
    align-items: center;
    gap: 4px;
    padding: 0 7px;
}

.primary-date-filter input {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 5px 3px;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
}

.primary-date-filter input:focus {
    outline: 0;
}

.quick-search-control {
    position: relative;
    display: block;
}

.quick-search-control input {
    width: 100%;
    height: 40px;
    padding: 8px 38px 8px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary);
}

.quick-search-control input:focus {
    outline: 2px solid rgba(11, 99, 246, 0.15);
}

.quick-search-icon {
    position: absolute;
    top: 12px;
    right: 13px;
    width: 14px;
    height: 14px;
    border: 2px solid #52627a;
    border-radius: 50%;
    pointer-events: none;
}

.quick-search-icon::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: -4px;
    width: 6px;
    height: 2px;
    background: #52627a;
    transform: rotate(45deg);
    transform-origin: left center;
}

.processing-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
}

.processing-toolbar-actions .button {
    min-height: 42px;
    border-radius: 6px;
}

.filter-toggle-button {
    min-width: 96px;
    text-transform: uppercase;
}

.filter-toggle-button.active {
    box-shadow: 0 0 0 3px rgba(11, 99, 246, 0.14);
}

.processing-results-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    background: #ffffff;
}

.processing-results-workspace.advanced-filter-open {
    grid-template-columns:
        minmax(0, 7fr)
        minmax(280px, 3fr);
}

.processing-table-area {
    min-width: 0;
    overflow: hidden;
}

.advanced-filter-panel {
    min-width: 0;
    min-height: 610px;
    border-left: 1px solid var(--border);
    background: #ffffff;
}

.advanced-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
}

.advanced-filter-header h3 {
    margin: 0;
    font-size: 18px;
}

.advanced-filter-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
}

.advanced-filter-form {
    display: flex;
    flex-direction: column;
    min-height: 550px;
    padding: 20px 18px 16px;
}

.advanced-filter-form .form-field input,
.advanced-filter-form .form-field select {
    height: 42px;
    border-radius: 6px;
}

.amount-range-fields {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.amount-range-fields input {
    min-width: 0;
}

.advanced-filter-actions {
    margin-top: auto;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.advanced-filter-actions .button {
    min-height: 44px;
    border-radius: 6px;
}

#customerSyncTableContainer,
#customerErrorTableContainer,
#invoiceSentTableContainer,
#paymentMainTableContainer {
    max-height: calc(100vh - 340px);
    min-height: 440px;
}

#customerSyncTableContainer th,
#customerErrorTableContainer th,
#invoiceSentTableContainer th,
#paymentMainTableContainer th {
    padding-top: 11px;
    padding-bottom: 11px;
    background: #f5f7fa;
    color: #17213c;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
}

#customerSyncTableContainer td,
#customerErrorTableContainer td,
#invoiceSentTableContainer td,
#paymentMainTableContainer td {
    padding-top: 8px;
    padding-bottom: 8px;
    vertical-align: middle;
}

.processing-results-workspace.advanced-filter-open th,
.processing-results-workspace.advanced-filter-open td {
    padding-left: 5px;
    padding-right: 5px;
    font-size: 11px;
}

.invoice-sent-col-id {
    width: 12%;
}

.invoice-sent-col-invoice-date {
    width: 12%;
}

.invoice-sent-col-customer {
    width: 24%;
}

.invoice-sent-col-type {
    width: 11%;
}

.invoice-sent-col-total {
    width: 10%;
}

.invoice-sent-col-sync-method {
    width: 13%;
}

.invoice-sent-col-date {
    width: 18%;
}

.payment-main-col-payment-date {
    width: 11%;
}

.payment-main-col-ref {
    width: 10%;
}

.payment-main-col-customer {
    width: 22%;
}

.payment-main-col-total {
    width: 12%;
}

.payment-main-col-invoice {
    width: 12%;
}

.payment-main-col-invoice-amount {
    width: 11%;
}

.payment-main-col-sync-method {
    width: 10%;
}

.payment-main-col-sent-date {
    width: 12%;
}

.sync-method-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.sync-method-auto {
    background: var(--success-background);
    color: var(--success-text);
}

.sync-method-retry {
    background: var(--warning-background);
    color: var(--warning-text);
}

.sync-method-manual {
    background: #e9edf3;
    color: #26344d;
}

.sync-method-other {
    background: #edf1f6;
    color: var(--text-secondary);
}

.payment-main-invoice-info,
.payment-main-invoice-count-text {
    color: var(--primary);
    font-weight: 600;
}

.payment-main-invoice-count-content {
    gap: 4px;
}

.payment-main-expand-button {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    border: 0;
    border-radius: 3px;
    background: transparent;
}

.payment-main-expand-button:hover {
    border: 0;
    background: #eaf1ff;
}

.payment-main-expand-icon {
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    transform: translateY(-2px) rotate(45deg);
    transition: transform 120ms ease;
}

.payment-main-expand-button.expanded .payment-main-expand-icon {
    transform: translateY(2px) rotate(225deg);
}

#paymentMainTableBody .payment-main-invoice-row td:first-child {
    border-left: 1px solid var(--border);
}

#paymentMainTableBody .payment-main-invoice-row td {
    background: #ffffff !important;
}

.payment-main-applied-content {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    white-space: nowrap;
}

.payment-main-child-connector {
    color: #4d8dff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}

.results-pagination {
    display: grid;
    grid-template-columns:
        minmax(160px, 1fr)
        auto
        minmax(160px, 1fr);
    gap: 16px;
    min-height: 64px;
    padding: 10px 16px;
}

.pagination-range {
    justify-self: start;
    color: var(--text-secondary);
    font-size: 12px;
}

.pagination-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-arrow,
.pagination-page-button {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border-dark);
    border-radius: 5px;
    background: #ffffff;
    color: var(--text-primary);
    cursor: pointer;
}

.pagination-arrow {
    font-size: 22px;
    line-height: 1;
}

.pagination-arrow:disabled {
    background: #f4f6f9;
    color: #a9b2c0;
    cursor: not-allowed;
}

.pagination-page-button.active {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.pagination-ellipsis {
    min-width: 24px;
    text-align: center;
    color: var(--text-secondary);
}

.page-size-control {
    justify-self: end;
}

.page-size-control select {
    height: 38px;
    padding: 6px 32px 6px 10px;
    border: 1px solid var(--border-dark);
    border-radius: 5px;
    background: #ffffff;
    color: var(--text-primary);
}

.processing-error-list {
    min-height: 650px;
    border-radius: 8px;
    box-shadow: none;
}

.processing-error-list .invoice-list-header {
    padding: 12px 18px;
}

.processing-error-list .invoice-item-list {
    min-height: 560px;
    max-height: calc(100vh - 330px);
    padding: 8px;
}

.error-queue-item {
    display: grid;
    grid-template-columns:
        42px
        minmax(0, 1fr)
        auto
        18px;
    align-items: center;
    gap: 10px;
    min-height: 92px;
    margin-bottom: 8px;
    padding: 12px;
    border-radius: 7px;
}

.error-queue-icon {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid #ffaaa4;
    border-radius: 50%;
    background: #fff5f4;
    color: var(--error-text);
    font-size: 20px;
    font-weight: 700;
}

.error-queue-content {
    min-width: 0;
}

.error-queue-customer,
.error-queue-reference,
.error-queue-content .invoice-error-message {
    display: block;
}

.error-queue-customer {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.error-queue-reference {
    margin-top: 4px;
    color: #23314c;
    font-size: 12px;
}

.error-queue-content .invoice-error-message {
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.error-queue-amount {
    align-self: center;
    color: #17213c;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.error-queue-chevron {
    color: #17213c;
    font-size: 25px;
    font-weight: 300;
}

.invoice-detail-panel {
    min-height: 650px;
    border-radius: 8px;
    box-shadow: none;
}

.invoice-review-host {
    min-height: 650px;
    padding: 14px;
    background: #f7f9fc;
}

.invoice-review-form {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: none;
}

.review-card-heading,
.invoice-review-header {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-primary);
}

.review-card-heading h3 {
    margin: 0;
    font-size: 20px;
}

.review-error-pill {
    padding: 5px 11px;
    border: 1px solid #ffaaa4;
    border-radius: 6px;
    background: #fff1f0;
    color: var(--error-text);
    font-size: 12px;
    font-weight: 700;
}

.invoice-review-top-section {
    padding: 18px;
}

.invoice-review-field-grid {
    gap: 14px 18px;
}

.invoice-review-field label {
    margin-bottom: 6px;
    color: #26344d;
    font-size: 11px;
}

.required-mark {
    color: var(--error-text);
}

.invoice-review-field input,
.invoice-review-field select {
    height: 38px;
    padding: 7px 10px;
    border: 1px solid var(--border-dark);
    border-radius: 5px;
    color: var(--text-primary);
}

.invoice-review-field input[readonly] {
    background: #f4f6f9;
    color: #69758a;
}

.invoice-review-error-row {
    margin-top: 16px;
}

.invoice-review-error-box {
    margin-top: 0;
    overflow: hidden;
    border: 1px solid #ffaaa4;
    border-radius: 6px;
    background: #fff4f3;
}

.invoice-review-error-title {
    padding: 8px 12px 0;
    background: transparent;
    color: var(--error-text);
    font-size: 12px;
}

.invoice-review-error-box textarea {
    min-height: 62px;
    padding: 8px 12px 12px;
    background: transparent;
    color: #481b18;
}

.payment-review-error-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 14px;
}

.payment-review-error-box .invoice-review-error-title {
    padding: 0;
}

.payment-review-error-box p {
    margin: 5px 0 0;
    color: #481b18;
    font-size: 12px;
}

.payment-review-error-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 50%;
    background: var(--error-text);
    color: #ffffff;
    font-weight: 800;
}

.invoice-review-gl-section,
.payment-review-lines-section {
    padding: 0 0 18px;
    background: #ffffff;
}

.invoice-review-gl-header,
.payment-review-lines-header {
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    border-bottom: 0;
    background: #ffffff;
    color: var(--text-primary);
}

.invoice-review-add-button {
    border-color: var(--border-dark);
    border-radius: 5px;
    background: #ffffff;
    color: var(--primary);
}

.payment-review-table {
    margin-top: 0;
}

.payment-review-table th {
    background: #f4f6f9;
    color: #26344d;
}

.payment-review-summary {
    width: 330px;
    margin: 6px 18px 0 auto;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
}

.payment-review-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 26px;
    color: #26344d;
    font-size: 12px;
    font-weight: 700;
}

.payment-review-summary-row strong {
    min-width: 90px;
    color: #26344d;
    font-weight: 700;
    text-align: right;
}

.payment-review-summary-difference.payment-review-difference-error {
    color: #d9534f;
}

/*
 * Present Invoice totals with the same compact summary-card styling used by
 * Payment totals. The fields remain inputs, so this changes appearance only
 * and does not change Invoice calculation or submission behavior.
 */
.invoice-review-bottom-row .invoice-review-totals {
    width: 330px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    gap: 0;
}

.invoice-review-bottom-row .invoice-review-total-row {
    justify-content: space-between;
    gap: 16px;
    min-height: 26px;
    width: 100%;
    margin: 0;
    color: #26344d;
    font-size: 12px;
    font-weight: 700;
}

.invoice-review-bottom-row .invoice-review-total-row label {
    color: #26344d;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
}

.invoice-review-bottom-row .invoice-review-total-row input,
.invoice-review-bottom-row .invoice-review-total-row .invoice-review-total-input[readonly] {
    width: 90px;
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #26344d;
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    box-shadow: none;
    outline: 0;
}

.invoice-review-total-row label {
    color: var(--text-primary);
}

.invoice-review-actions {
    justify-content: flex-end;
    gap: 14px;
    margin-top: 12px;
    padding: 12px 18px 0;
    border-top: 1px solid var(--border);
}

.invoice-review-remove-button,
.invoice-review-actions button {
    min-height: 38px;
    padding: 7px 16px;
    border: 1px solid var(--border-dark);
    border-radius: 5px;
    background: #ffffff;
    color: var(--text-primary);
}

.invoice-review-actions button[value="retry_btn"] {
    min-width: 145px;
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.invoice-review-actions button[value="retry_btn"]:hover:not(:disabled) {
    background: var(--primary-hover);
}

.invoice-review-actions button[value="retry_btn"]:disabled {
    border-color: #9ebbf0;
    background: #9ebbf0;
}

.invoice-review-response-message {
    border-radius: 6px;
}

@media (max-width: 1320px) {
    .processing-results-toolbar {
        flex-wrap: wrap;
    }

    .results-title-block {
        flex: 1 1 100%;
    }

    .primary-filter-bar {
        flex: 1 1 680px;
    }
}

@media (max-width: 1100px) {
    .processing-results-workspace.advanced-filter-open {
        grid-template-columns: minmax(0, 1fr);
    }

    .advanced-filter-panel {
        min-height: 0;
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .advanced-filter-form {
        min-height: 0;
    }

    .invoice-processing-layout.processing-error-mode,
    .payment-processing-layout.processing-error-mode {
        grid-template-columns: minmax(0, 1fr);
    }

    .processing-error-list .invoice-item-list {
        min-height: 220px;
        max-height: 360px;
    }
}

@media (max-width: 850px) {
    .primary-filter-bar {
        grid-template-columns: minmax(0, 1fr);
        flex-basis: 100%;
    }

    .processing-toolbar-actions {
        width: 100%;
    }

    .processing-toolbar-actions .button {
        flex: 1 1 0;
    }

    .results-pagination {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .pagination-range,
    .page-size-control {
        justify-self: center;
    }

    .pagination-pages {
        gap: 5px;
    }

    .pagination-arrow,
    .pagination-page-button {
        min-width: 32px;
        height: 34px;
    }

    .payment-review-summary {
        width: calc(100% - 36px);
        margin-left: 18px;
    }
}

@media (max-width: 560px) {
    .processing-subtabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .processing-subtab {
        min-width: 0;
    }

    .primary-date-filter {
        grid-template-columns: minmax(0, 1fr);
        height: auto;
        padding: 6px 9px;
    }

    .primary-date-filter > span {
        display: none;
    }

    .error-queue-item {
        grid-template-columns:
            38px
            minmax(0, 1fr)
            14px;
    }

    .error-queue-amount {
        display: none;
    }
}

/* Invoice and Payment final viewport layout */

body {
    overflow: hidden;
}

.app-shell {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.tab-content {
    min-height: 0;
    padding: 8px 2px 6px;
    overflow: auto;
}

#invoiceProcessingTab,
#paymentProcessingTab {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

#invoiceProcessingTab .processing-page,
#paymentProcessingTab .processing-page {
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    gap: 8px;
}

.processing-subtabs {
    gap: 8px;
}

.processing-subtab {
    min-height: 40px;
    padding: 7px 16px;
}

.invoice-processing-layout,
.payment-processing-layout {
    height: 100%;
    min-height: 0;
}

.processing-results-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.processing-results-toolbar {
    flex: 0 0 auto;
    min-height: 64px;
    padding: 8px 14px;
    align-items: center;
}

.results-title-line {
    gap: 0;
}

/* Make Filter and Export the same size. */
.processing-toolbar-actions .button,
.processing-toolbar-actions .button-export {
    width: 96px;
    min-width: 96px;
    min-height: 42px;
    padding: 8px 12px;
}

.processing-results-workspace {
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0fr);
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
    transition: grid-template-columns 260ms ease;
}

.processing-results-workspace.advanced-filter-open {
    grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
}

.processing-table-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

#customerSyncTableContainer,
#customerErrorTableContainer,
#invoiceSentTableContainer,
#paymentMainTableContainer {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

#customerSyncTableContainer th,
#customerErrorTableContainer th,
#invoiceSentTableContainer th,
#paymentMainTableContainer th {
    padding-top: 8px;
    padding-bottom: 8px;
}

#customerSyncTableContainer td,
#customerErrorTableContainer td,
#invoiceSentTableContainer td,
#paymentMainTableContainer td {
    padding-top: 5px;
    padding-bottom: 5px;
}

.results-state {
    flex: 1 1 auto;
    min-height: 0;
}

/* Pagination remains at the bottom even with few or no results. */
.results-pagination {
    flex: 0 0 56px;
    min-height: 56px;
    margin-top: auto;
    padding: 8px 16px;
}

.pagination-page-button:disabled {
    cursor: default;
}

/* Smooth side-filter open and close animation. */
.advanced-filter-panel {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-left: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(18px);
    transition:
        opacity 180ms ease,
        transform 260ms ease,
        visibility 0s linear 260ms;
}

.advanced-filter-panel.is-open {
    overflow-y: auto;
    border-left: 1px solid var(--border);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
}

.advanced-filter-form {
    height: calc(100% - 58px);
    min-height: 0;
}

.invoice-processing-layout.processing-error-mode,
.payment-processing-layout.processing-error-mode {
    height: 100%;
    min-height: 0;
}

.processing-error-list {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.processing-error-list .invoice-item-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

.invoice-detail-panel,
.invoice-review-host {
    height: 100%;
    min-height: 0;
}

.invoice-detail-panel {
    overflow: auto;
}

/* Invoice table widths, including restored Customer ID. */
.invoice-sent-col-id {
    width: 10%;
}

.invoice-sent-col-invoice-date {
    width: 10%;
}

.invoice-sent-col-customer-id {
    width: 10%;
}

.invoice-sent-col-customer {
    width: 20%;
}

.invoice-sent-col-type {
    width: 10%;
}

.invoice-sent-col-total {
    width: 10%;
}

.invoice-sent-col-sync-method {
    width: 12%;
}

.invoice-sent-col-date {
    width: 18%;
}

.payment-main-group-invoice-total {
    font-weight: 600;
}

/* On smaller screens, allow normal vertical page scrolling. */
@media (max-width: 1100px) {
    body {
        overflow: auto;
    }

    .app-shell {
        display: block;
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    .tab-content {
        overflow: visible;
    }

    #invoiceProcessingTab,
    #paymentProcessingTab,
    #invoiceProcessingTab .processing-page,
    #paymentProcessingTab .processing-page,
    .invoice-processing-layout,
    .payment-processing-layout,
    .processing-results-panel {
        height: auto;
        overflow: visible;
    }

    .processing-results-panel {
        min-height: 620px;
    }

    .processing-results-workspace,
    .processing-results-workspace.advanced-filter-open {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
    }

    .advanced-filter-panel {
        height: auto;
    }

    .advanced-filter-form {
        height: auto;
    }
}

@media (min-width: 1161px) {
    #customerSyncTab,
    .customer-sync-layout {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }
}

@media (max-width: 1160px) {
    .customer-sync-layout {
        grid-template-rows: auto auto;
    }

    #customerSyncTab .processing-results-panel {
        height: auto;
        min-height: 0;
    }

    #customerSyncTableContainer,
    #customerErrorTableContainer {
        flex: 0 0 auto;
        max-height: 65vh;
    }
}

/* Login uses its own scrollable screen outside the portal grid. */
.login-screen {
    display: flex;
    height: 100dvh;
    padding: 24px;
    overflow-y: auto;
}

.login-card {
    display: grid;
    gap: 18px;
    width: min(420px, 100%);
    margin: auto;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-background);
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin: 0;
    font-size: 26px;
}

.login-subtitle {
    margin: 0;
    color: var(--text-secondary);
}

.login-message {
    min-height: 18px;
    margin: 0;
    color: var(--error-text);
    font-size: 13px;
}

.app-header {
    justify-content: space-between;
    gap: 16px;
}

.header-user-area {
    margin-left: auto;
    text-align: right;
}

.header-user-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.current-username {
    font-size: 14px;
    overflow-wrap: anywhere;
}

.logout-button {
    flex-shrink: 0;
    min-height: 36px;
    padding: 7px 14px;
    color: #ffffff;
    border: 1px solid #c9d8e5;
    background: transparent;
}

.logout-button:hover:not(:disabled) {
    background: var(--header-border);
}

.logout-message {
    display: block;
    margin-top: 5px;
    color: #ffd7d7;
    font-size: 12px;
}

@media (max-width: 600px) {
    .app-header {
        flex-wrap: wrap;
    }

    .login-card {
        padding: 24px;
    }
}
