/* Accounts payable intake workspace
   All component classes are scoped with the ap- prefix so this workspace can
   coexist with Bootstrap and the existing purchasing styles. */

.ap-page {
    --ap-ink: #142b38;
    --ap-ink-soft: #49616e;
    --ap-muted: #6f838d;
    --ap-faint: #8fa0a8;
    --ap-navy: #17384b;
    --ap-teal: #126b68;
    --ap-teal-dark: #0d5553;
    --ap-teal-soft: #e4f3f1;
    --ap-blue: #287599;
    --ap-green: #28734c;
    --ap-green-soft: #e6f4eb;
    --ap-amber: #9a6811;
    --ap-amber-soft: #fff4d8;
    --ap-red: #a23e38;
    --ap-red-soft: #fce9e7;
    --ap-violet: #6954a4;
    --ap-violet-soft: #f0ecfb;
    --ap-surface: #ffffff;
    --ap-surface-alt: #f7fafb;
    --ap-canvas: #eef3f5;
    --ap-line: #d8e2e6;
    --ap-line-strong: #becdd3;
    --ap-radius-sm: 8px;
    --ap-radius: 12px;
    --ap-radius-lg: 18px;
    --ap-shadow-sm: 0 2px 8px rgba(20, 48, 61, .055);
    --ap-shadow: 0 10px 30px rgba(20, 48, 61, .09);
    color: var(--ap-ink);
    margin: 0 auto;
    max-width: 1800px;
    padding: 20px;
}

.ap-page,
.ap-page * {
    box-sizing: border-box;
}

.ap-page button,
.ap-page input,
.ap-page select,
.ap-page textarea {
    font: inherit;
}

.ap-page a {
    color: var(--ap-teal);
}

/* Anchor buttons need to win over the generic link color above. */
.ap-page a.ap-button--primary,
.ap-page a.ap-button--success {
    color: #fff;
}

.ap-page :focus-visible {
    outline: 3px solid rgba(35, 137, 132, .24);
    outline-offset: 2px;
}

/* Header and inbox KPIs */

.ap-hero {
    background:
        radial-gradient(circle at 90% 8%, rgba(88, 202, 174, .22), transparent 34%),
        linear-gradient(128deg, #143447 0%, #155b5b 72%, #176c68 100%);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--ap-radius-lg);
    box-shadow: 0 12px 30px rgba(17, 57, 70, .14);
    color: #fff;
    margin-bottom: 14px;
    overflow: hidden;
    padding: 22px 24px;
    position: relative;
}

.ap-hero::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .14), transparent);
    content: "";
    height: 1px;
    left: 24px;
    position: absolute;
    right: 24px;
    top: 0;
}

.ap-hero-main {
    align-items: flex-start;
    display: flex;
    gap: 24px;
    justify-content: space-between;
}

.ap-hero-copy {
    min-width: 0;
}

.ap-eyebrow {
    align-items: center;
    color: #9edbd4;
    display: flex;
    font-size: .68rem;
    font-weight: 900;
    gap: 8px;
    letter-spacing: .12em;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.ap-eyebrow::before {
    background: #5bc3b5;
    border-radius: 999px;
    content: "";
    height: 6px;
    width: 6px;
}

.ap-hero h1 {
    color: #fff;
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    font-weight: 900;
    letter-spacing: -.035em;
    line-height: 1.12;
    margin: 0;
}

.ap-hero p {
    color: #d4e9e8;
    font-size: .85rem;
    margin: 7px 0 0;
    max-width: 720px;
}

.ap-hero-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.ap-kpi-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(4, minmax(125px, 1fr));
    margin-top: 19px;
}

.ap-kpi-card {
    backdrop-filter: blur(6px);
    background: rgba(255, 255, 255, .095);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 11px;
    min-width: 0;
    padding: 11px 13px;
}

.ap-kpi-card small {
    color: #cce2e2;
    display: block;
    font-size: .6rem;
    font-weight: 850;
    letter-spacing: .07em;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.ap-kpi-value {
    align-items: baseline;
    display: flex;
    font-size: 1.45rem;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    gap: 7px;
    letter-spacing: -.025em;
    line-height: 1.2;
    margin-top: 3px;
}

.ap-kpi-value span {
    color: #c8dddd;
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: 0;
}

.ap-kpi-card--warning {
    background: rgba(196, 133, 30, .16);
    border-color: rgba(255, 214, 141, .28);
}

.ap-kpi-card--danger {
    background: rgba(175, 65, 59, .16);
    border-color: rgba(255, 184, 178, .25);
}

/* Buttons and compact controls */

.ap-button {
    align-items: center;
    appearance: none;
    background: var(--ap-surface);
    border: 1px solid var(--ap-line-strong);
    border-radius: var(--ap-radius-sm);
    color: #294957;
    cursor: pointer;
    display: inline-flex;
    font-size: .73rem;
    font-weight: 850;
    gap: 7px;
    justify-content: center;
    line-height: 1.15;
    min-height: 38px;
    padding: 9px 12px;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, filter .15s ease, transform .15s ease;
    white-space: nowrap;
}

.ap-button:hover {
    border-color: #9db3bb;
    box-shadow: var(--ap-shadow-sm);
    color: #173b49;
    text-decoration: none;
    transform: translateY(-1px);
}

.ap-button:disabled,
.ap-button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .52;
    transform: none;
}

.ap-button--primary {
    background: var(--ap-teal);
    border-color: var(--ap-teal);
    color: #fff;
}

.ap-button--primary:hover {
    background: var(--ap-teal-dark);
    border-color: var(--ap-teal-dark);
    color: #fff;
}

.ap-button--hero {
    background: #fff;
    border-color: rgba(255, 255, 255, .7);
    color: #155d5b;
}

.ap-button--hero-secondary {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .3);
    color: #fff;
}

.ap-button--hero-secondary:hover {
    background: rgba(255, 255, 255, .15);
    border-color: rgba(255, 255, 255, .46);
    color: #fff;
}

.ap-button--success {
    background: var(--ap-green);
    border-color: var(--ap-green);
    color: #fff;
}

.ap-button--danger {
    background: #fff;
    border-color: #e5b7b3;
    color: var(--ap-red);
}

.ap-button--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--ap-teal);
}

.ap-button--sm {
    font-size: .66rem;
    min-height: 31px;
    padding: 6px 9px;
}

.ap-icon-button {
    align-items: center;
    appearance: none;
    background: #fff;
    border: 1px solid var(--ap-line);
    border-radius: 8px;
    color: #47616d;
    cursor: pointer;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    padding: 0;
    transition: background .15s ease, border-color .15s ease;
    width: 34px;
}

.ap-icon-button:hover {
    background: var(--ap-teal-soft);
    border-color: #98c8c4;
    color: var(--ap-teal-dark);
}

/* Inbox filtering and status navigation */

.ap-toolbar {
    align-items: end;
    background: var(--ap-surface);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius);
    box-shadow: var(--ap-shadow-sm);
    display: grid;
    gap: 9px;
    grid-template-columns: minmax(230px, 1.4fr) repeat(3, minmax(130px, .55fr)) auto;
    margin-bottom: 12px;
    padding: 10px;
}

.ap-toolbar-group {
    display: flex;
    gap: 7px;
    min-width: 0;
}

.ap-toolbar-actions {
    align-items: center;
    display: flex;
    gap: 7px;
    justify-content: flex-end;
}

.ap-control {
    min-width: 0;
}

.ap-control label {
    color: var(--ap-ink-soft);
    display: block;
    font-size: .58rem;
    font-weight: 900;
    letter-spacing: .055em;
    margin: 0 0 4px 1px;
    text-transform: uppercase;
}

.ap-input,
.ap-select,
.ap-textarea {
    appearance: none;
    background: #fff;
    border: 1px solid var(--ap-line-strong);
    border-radius: 8px;
    color: var(--ap-ink);
    font-size: .75rem;
    min-height: 38px;
    padding: 8px 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
    width: 100%;
}

.ap-input:hover,
.ap-select:hover,
.ap-textarea:hover {
    border-color: #9fb4bc;
}

.ap-input:focus,
.ap-select:focus,
.ap-textarea:focus {
    border-color: #4a9a96;
    box-shadow: 0 0 0 3px rgba(31, 133, 128, .12);
    outline: 0;
}

.ap-input:disabled,
.ap-select:disabled,
.ap-textarea:disabled {
    background: #f1f4f5;
    color: #70818a;
}

.ap-input::placeholder,
.ap-textarea::placeholder {
    color: #98a7ae;
}

.ap-select {
    background-image: linear-gradient(45deg, transparent 50%, #607883 50%), linear-gradient(135deg, #607883 50%, transparent 50%);
    background-position: calc(100% - 14px) 16px, calc(100% - 10px) 16px;
    background-repeat: no-repeat;
    background-size: 4px 4px, 4px 4px;
    padding-right: 28px;
}

.ap-textarea {
    min-height: 76px;
    resize: vertical;
}

.ap-search {
    position: relative;
}

.ap-search .ap-input {
    padding-left: 36px;
}

.ap-search-icon {
    color: #70868f;
    left: 12px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.ap-tabs {
    align-items: center;
    border-bottom: 1px solid var(--ap-line);
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.ap-tab {
    align-items: center;
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    color: #607883;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .72rem;
    font-weight: 850;
    gap: 7px;
    min-height: 42px;
    padding: 9px 12px 7px;
    text-decoration: none;
}

.ap-tab:hover {
    color: var(--ap-teal);
    text-decoration: none;
}

.ap-tab[aria-current="page"],
.ap-tab--active {
    border-bottom-color: var(--ap-teal);
    color: var(--ap-teal-dark);
}

.ap-tab-count {
    background: #e6edef;
    border-radius: 999px;
    color: #546d78;
    font-size: .59rem;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    min-width: 21px;
    padding: 3px 6px;
    text-align: center;
}

.ap-tab--active .ap-tab-count,
.ap-tab[aria-current="page"] .ap-tab-count {
    background: var(--ap-teal-soft);
    color: var(--ap-teal-dark);
}

.ap-chip-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ap-chip {
    align-items: center;
    background: #e9eff2;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #516a76;
    display: inline-flex;
    font-size: .6rem;
    font-weight: 900;
    gap: 5px;
    line-height: 1;
    max-width: 100%;
    padding: 5px 8px;
    text-transform: uppercase;
    white-space: nowrap;
}

.ap-chip--new,
.ap-chip--info {
    background: #e5f1f7;
    color: #246681;
}

.ap-chip--processing,
.ap-chip--warning {
    background: var(--ap-amber-soft);
    color: var(--ap-amber);
}

.ap-chip--matched,
.ap-chip--approved,
.ap-chip--success {
    background: var(--ap-green-soft);
    color: var(--ap-green);
}

.ap-chip--exception,
.ap-chip--failed,
.ap-chip--danger {
    background: var(--ap-red-soft);
    color: var(--ap-red);
}

.ap-chip--hold {
    background: var(--ap-violet-soft);
    color: var(--ap-violet);
}

.ap-chip--outline {
    background: #fff;
    border-color: var(--ap-line-strong);
}

/* Inbox document queue */

.ap-inbox-layout {
    align-items: start;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr);
}

.ap-queue-panel,
.ap-panel {
    background: var(--ap-surface);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius);
    box-shadow: var(--ap-shadow-sm);
    overflow: hidden;
}

.ap-panel-header {
    align-items: center;
    background: linear-gradient(180deg, #fbfcfc, #f5f8f9);
    border-bottom: 1px solid var(--ap-line);
    display: flex;
    gap: 14px;
    justify-content: space-between;
    min-height: 52px;
    padding: 11px 14px;
}

.ap-panel-heading {
    min-width: 0;
}

.ap-panel-heading h2,
.ap-panel-heading h3 {
    color: var(--ap-ink);
    font-size: .88rem;
    font-weight: 900;
    letter-spacing: -.01em;
    margin: 0;
}

.ap-panel-heading p {
    color: var(--ap-muted);
    font-size: .64rem;
    line-height: 1.35;
    margin: 3px 0 0;
}

.ap-panel-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.ap-panel-body {
    padding: 14px;
}

.ap-panel-body--flush {
    padding: 0;
}

.ap-queue-head,
.ap-queue-item {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 34px minmax(235px, 1.45fr) minmax(145px, .75fr) minmax(115px, .5fr) minmax(105px, .5fr) minmax(125px, .55fr) 34px;
    padding: 11px 14px;
}

.ap-queue-head {
    background: #f2f6f7;
    color: #627985;
    font-size: .57rem;
    font-weight: 900;
    letter-spacing: .07em;
    min-height: 35px;
    text-transform: uppercase;
}

.ap-queue-item {
    border-top: 1px solid #e4ebee;
    color: inherit;
    min-height: 70px;
    position: relative;
    text-decoration: none;
    transition: background .15s ease, box-shadow .15s ease;
}

.ap-queue-head + .ap-queue-item {
    border-top: 0;
}

.ap-queue-item:hover {
    background: #f7fbfb;
    color: inherit;
    text-decoration: none;
}

.ap-queue-item--selected,
.ap-queue-item[aria-current="true"] {
    background: #edf8f7;
    box-shadow: inset 4px 0 0 var(--ap-teal);
}

.ap-queue-item--exception {
    box-shadow: inset 4px 0 0 #d09a34;
}

.ap-queue-item--selected.ap-queue-item--exception {
    box-shadow: inset 4px 0 0 var(--ap-red);
}

.ap-checkbox {
    accent-color: var(--ap-teal);
    height: 16px;
    margin: 0;
    width: 16px;
}

.ap-document-id {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    min-width: 0;
}

.ap-document-icon {
    align-items: center;
    background: var(--ap-teal-soft);
    border-radius: 9px;
    color: var(--ap-teal);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .65rem;
    font-weight: 950;
    height: 38px;
    justify-content: center;
    letter-spacing: -.02em;
    width: 34px;
}

.ap-document-icon--image {
    background: #e8f0f7;
    color: #336d8e;
}

.ap-document-icon--email {
    background: var(--ap-violet-soft);
    color: var(--ap-violet);
}

.ap-document-copy {
    min-width: 0;
}

.ap-document-copy strong {
    color: #173e50;
    display: block;
    font-size: .77rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-document-copy small,
.ap-queue-meta {
    color: var(--ap-muted);
    display: block;
    font-size: .63rem;
    line-height: 1.35;
    margin-top: 3px;
}

.ap-queue-value {
    color: #294754;
    font-size: .72rem;
    min-width: 0;
}

.ap-queue-value strong {
    display: block;
    font-size: .76rem;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
}

.ap-queue-amount {
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    text-align: right;
}

.ap-queue-empty,
.ap-empty-state {
    align-items: center;
    color: var(--ap-muted);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 210px;
    padding: 34px;
    text-align: center;
}

.ap-empty-icon {
    align-items: center;
    background: #e9f1f3;
    border-radius: 50%;
    color: var(--ap-teal);
    display: flex;
    font-size: 1.2rem;
    height: 48px;
    justify-content: center;
    margin-bottom: 11px;
    width: 48px;
}

.ap-empty-state strong {
    color: #294956;
    font-size: .85rem;
}

.ap-empty-state p {
    font-size: .7rem;
    margin: 5px 0 14px;
    max-width: 420px;
}

.ap-pagination {
    align-items: center;
    background: #fbfcfc;
    border-top: 1px solid var(--ap-line);
    color: var(--ap-muted);
    display: flex;
    font-size: .65rem;
    gap: 8px;
    justify-content: space-between;
    padding: 9px 14px;
}

.ap-pagination-actions {
    display: flex;
    gap: 5px;
}

/* Invoice review workbench */

.ap-review-workbench {
    align-items: start;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(340px, .78fr) minmax(620px, 1.22fr);
}

.ap-review-header {
    align-items: center;
    background: var(--ap-surface);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius);
    box-shadow: var(--ap-shadow-sm);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 12px 14px;
}

.ap-review-title {
    min-width: 0;
}

.ap-review-title h1 {
    color: var(--ap-ink);
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: -.025em;
    margin: 0;
}

.ap-review-title p {
    color: var(--ap-muted);
    font-size: .68rem;
    margin: 4px 0 0;
}

.ap-review-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
}

.ap-review-stack {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.ap-preview-column {
    align-self: start;
    min-width: 0;
    position: sticky;
    top: 12px;
}

.ap-preview-panel {
    background: #26343b;
    border: 1px solid #23363e;
    border-radius: var(--ap-radius);
    box-shadow: var(--ap-shadow);
    overflow: hidden;
}

.ap-preview-toolbar {
    align-items: center;
    background: #1c2f38;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: #e8f1f3;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    min-height: 48px;
    padding: 8px 10px;
}

.ap-preview-name {
    min-width: 0;
}

.ap-preview-name strong {
    display: block;
    font-size: .7rem;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-preview-name small {
    color: #a9bec6;
    display: block;
    font-size: .56rem;
    margin-top: 2px;
}

.ap-preview-tools {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 5px;
}

.ap-preview-tool {
    align-items: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 7px;
    color: #eef6f7;
    cursor: pointer;
    display: inline-flex;
    font-size: .62rem;
    height: 30px;
    justify-content: center;
    min-width: 30px;
    padding: 0 8px;
}

.ap-preview-tool:hover {
    background: rgba(255, 255, 255, .15);
}

.ap-preview-frame {
    align-items: flex-start;
    background: #dbe1e3;
    display: flex;
    height: calc(100vh - 190px);
    justify-content: center;
    min-height: 540px;
    overflow: auto;
    padding: 18px;
}

.ap-preview-frame iframe {
    background: #fff;
    border: 0;
    height: 100%;
    min-height: 500px;
    width: 100%;
}

.ap-preview-frame img {
    background: #fff;
    box-shadow: 0 4px 18px rgba(17, 36, 44, .2);
    display: block;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.ap-preview-empty {
    align-items: center;
    color: #526871;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    min-height: 420px;
    padding: 28px;
    text-align: center;
}

.ap-preview-empty strong {
    color: #294550;
    font-size: .85rem;
    margin-top: 10px;
}

.ap-preview-empty span {
    font-size: .68rem;
    margin-top: 4px;
}

.ap-preview-footer {
    align-items: center;
    background: #1c2f38;
    color: #b9cbd1;
    display: flex;
    font-size: .6rem;
    gap: 8px;
    justify-content: space-between;
    min-height: 34px;
    padding: 6px 10px;
}

/* Detail and coding forms */

.ap-detail-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ap-field {
    min-width: 0;
    position: relative;
}

.ap-field--span-2 {
    grid-column: span 2;
}

.ap-field--span-3 {
    grid-column: span 3;
}

.ap-field--full {
    grid-column: 1 / -1;
}

.ap-field label {
    align-items: center;
    color: #526b76;
    display: flex;
    font-size: .58rem;
    font-weight: 900;
    justify-content: space-between;
    letter-spacing: .05em;
    margin: 0 0 4px 1px;
    text-transform: uppercase;
}

.ap-required {
    color: var(--ap-red);
}

.ap-field-hint {
    color: var(--ap-muted);
    display: block;
    font-size: .57rem;
    line-height: 1.35;
    margin-top: 4px;
}

.ap-field-error {
    color: var(--ap-red);
    display: block;
    font-size: .57rem;
    font-weight: 700;
    margin-top: 4px;
}

.ap-field--invalid .ap-input,
.ap-field--invalid .ap-select {
    background: #fffafa;
    border-color: #d98a85;
}

.ap-field--verified .ap-input,
.ap-field--verified .ap-select {
    border-color: #7bb694;
}

.ap-confidence {
    align-items: center;
    color: var(--ap-muted);
    display: inline-flex;
    font-size: .53rem;
    font-weight: 800;
    gap: 4px;
    letter-spacing: 0;
    text-transform: none;
}

.ap-confidence::before {
    background: #6cad88;
    border-radius: 50%;
    content: "";
    height: 5px;
    width: 5px;
}

.ap-confidence--low::before {
    background: #d59333;
}

.ap-suggestion-list {
    background: #fff;
    border: 1px solid var(--ap-line-strong);
    border-radius: 9px;
    box-shadow: 0 14px 28px rgba(21, 50, 62, .16);
    display: none;
    left: 0;
    max-height: 240px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 30;
}

.ap-suggestion-list--open {
    display: block;
}

.ap-suggestion {
    background: #fff;
    border: 0;
    border-top: 1px solid #e6edef;
    color: var(--ap-ink);
    cursor: pointer;
    display: block;
    padding: 9px 10px;
    text-align: left;
    width: 100%;
}

.ap-suggestion:first-child {
    border-top: 0;
}

.ap-suggestion:hover,
.ap-suggestion[aria-selected="true"] {
    background: #edf8f7;
}

.ap-suggestion strong,
.ap-suggestion small {
    display: block;
}

.ap-suggestion strong {
    font-size: .7rem;
}

.ap-suggestion small {
    color: var(--ap-muted);
    font-size: .59rem;
    margin-top: 2px;
}

/* Three-way match */

.ap-match-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ap-match-card {
    background: #fbfcfc;
    border: 1px solid var(--ap-line);
    border-radius: 10px;
    min-width: 0;
    padding: 10px 11px;
    position: relative;
}

.ap-match-card::before {
    background: #7d929c;
    border-radius: 3px;
    content: "";
    height: 3px;
    left: 10px;
    position: absolute;
    right: 10px;
    top: 0;
}

.ap-match-card--invoice::before {
    background: var(--ap-blue);
}

.ap-match-card--po::before {
    background: var(--ap-teal);
}

.ap-match-card--received::before {
    background: var(--ap-green);
}

.ap-match-card--variance::before {
    background: #ca9230;
}

.ap-match-card--exception {
    background: #fff9f8;
    border-color: #e5bab6;
}

.ap-match-card--exception::before {
    background: var(--ap-red);
}

.ap-match-label {
    color: #617984;
    display: block;
    font-size: .55rem;
    font-weight: 900;
    letter-spacing: .065em;
    margin-top: 2px;
    text-transform: uppercase;
}

.ap-match-value {
    color: #193948;
    display: block;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    letter-spacing: -.02em;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-match-meta {
    color: var(--ap-muted);
    display: block;
    font-size: .56rem;
    line-height: 1.35;
    margin-top: 3px;
}

.ap-match-result {
    align-items: center;
    background: var(--ap-green-soft);
    border: 1px solid #bcdfca;
    border-radius: 9px;
    color: var(--ap-green);
    display: flex;
    font-size: .66rem;
    font-weight: 850;
    gap: 8px;
    justify-content: space-between;
    margin-top: 9px;
    padding: 8px 10px;
}

.ap-match-result--warning {
    background: var(--ap-amber-soft);
    border-color: #ebd39b;
    color: var(--ap-amber);
}

.ap-match-result--danger {
    background: var(--ap-red-soft);
    border-color: #e9bcb8;
    color: var(--ap-red);
}

/* Exceptions and alerts */

.ap-exception-banner {
    align-items: flex-start;
    background: var(--ap-amber-soft);
    border: 1px solid #ecd59d;
    border-left: 4px solid #ce9130;
    border-radius: 9px;
    color: #6e511c;
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
}

.ap-exception-banner--danger {
    background: var(--ap-red-soft);
    border-color: #e8bbb7;
    border-left-color: var(--ap-red);
    color: #7f312d;
}

.ap-exception-banner--info {
    background: #e9f3f8;
    border-color: #c4dde8;
    border-left-color: var(--ap-blue);
    color: #275c73;
}

.ap-exception-banner--success {
    background: var(--ap-green-soft);
    border-color: #c0dfca;
    border-left-color: var(--ap-green);
    color: #275e40;
}

.ap-exception-icon {
    align-items: center;
    background: rgba(255, 255, 255, .55);
    border-radius: 50%;
    display: flex;
    flex: 0 0 auto;
    font-size: .7rem;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.ap-exception-copy {
    min-width: 0;
}

.ap-exception-copy strong {
    display: block;
    font-size: .7rem;
    font-weight: 900;
}

.ap-exception-copy p {
    font-size: .63rem;
    line-height: 1.45;
    margin: 2px 0 0;
}

.ap-exception-action {
    flex: 0 0 auto;
    margin-left: auto;
}

.ap-exception-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.ap-exception-item {
    align-items: center;
    background: #fbfcfc;
    border: 1px solid var(--ap-line);
    border-radius: 8px;
    display: flex;
    font-size: .64rem;
    gap: 8px;
    justify-content: space-between;
    padding: 8px 9px;
}

.ap-exception-item--open {
    background: #fff9ee;
    border-color: #ead6aa;
}

/* Editable invoice lines */

.ap-line-table-wrap {
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

.ap-line-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: .66rem;
    min-width: 1080px;
    width: 100%;
}

.ap-line-table th {
    background: #f0f5f6;
    border-bottom: 1px solid var(--ap-line);
    color: #5a727d;
    font-size: .54rem;
    font-weight: 900;
    letter-spacing: .06em;
    padding: 7px 6px;
    position: sticky;
    text-align: left;
    text-transform: uppercase;
    top: 0;
    white-space: nowrap;
    z-index: 2;
}

.ap-line-table td {
    background: #fff;
    border-bottom: 1px solid #e6edef;
    color: #294753;
    padding: 6px;
    vertical-align: top;
}

.ap-line-table tbody tr:hover td {
    background: #fbfdfd;
}

.ap-line-table tbody tr.ap-line--exception td {
    background: #fffaf1;
}

.ap-line-table tbody tr.ap-line--exception td:first-child {
    box-shadow: inset 3px 0 0 #d29a36;
}

.ap-line-table tbody tr.ap-line--matched td:first-child {
    box-shadow: inset 3px 0 0 #4f9870;
}

.ap-line-table .ap-input,
.ap-line-table .ap-select {
    border-radius: 6px;
    font-size: .65rem;
    min-height: 32px;
    padding: 6px 7px;
}

.ap-line-number {
    color: var(--ap-muted);
    display: block;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
    padding-top: 8px;
    text-align: center;
}

.ap-line-description {
    min-width: 230px;
}

.ap-line-code {
    min-width: 125px;
}

.ap-line-match {
    min-width: 190px;
    position: relative;
}

.ap-line-quantity,
.ap-line-rate,
.ap-line-tax,
.ap-line-amount {
    min-width: 84px;
}

.ap-line-amount {
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    padding-top: 9px;
    text-align: right;
}

.ap-line-note {
    color: var(--ap-muted);
    display: block;
    font-size: .53rem;
    line-height: 1.3;
    margin-top: 3px;
}

.ap-line-note--warning {
    color: var(--ap-amber);
    font-weight: 750;
}

.ap-line-action {
    align-items: center;
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    min-width: 68px;
}

.ap-bulk-bar {
    align-items: end;
    background: #edf6f5;
    border-bottom: 1px solid #cee1df;
    border-top: 1px solid #cee1df;
    display: grid;
    gap: 8px;
    grid-template-columns: auto repeat(4, minmax(105px, 1fr)) auto;
    padding: 9px 10px;
}

.ap-bulk-label {
    align-self: center;
    color: var(--ap-teal-dark);
    font-size: .62rem;
    font-weight: 900;
    white-space: nowrap;
}

.ap-bulk-bar .ap-control label {
    font-size: .51rem;
}

.ap-bulk-bar .ap-select,
.ap-bulk-bar .ap-input {
    background-color: #fff;
    font-size: .64rem;
    min-height: 32px;
    padding-bottom: 5px;
    padding-top: 5px;
}

.ap-table-footer {
    align-items: center;
    background: #fbfcfc;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 9px 11px;
}

.ap-table-summary {
    color: var(--ap-muted);
    font-size: .61rem;
}

/* Totals and reconciliation */

.ap-reconciliation {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(270px, .72fr);
}

.ap-totals-list {
    display: grid;
    gap: 7px;
    margin: 0;
}

.ap-total-row {
    align-items: center;
    color: #4a626d;
    display: flex;
    font-size: .68rem;
    gap: 12px;
    justify-content: space-between;
}

.ap-total-row dd,
.ap-total-row dt {
    margin: 0;
}

.ap-total-row dd {
    color: #263f4a;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
}

.ap-total-row--grand {
    border-top: 1px solid var(--ap-line);
    color: var(--ap-ink);
    font-size: .82rem;
    font-weight: 900;
    margin-top: 2px;
    padding-top: 8px;
}

.ap-total-row--grand dd {
    font-size: 1rem;
}

.ap-total-row--variance dd {
    color: var(--ap-amber);
}

.ap-total-row--balanced dd {
    color: var(--ap-green);
}

.ap-reconcile-status {
    align-items: center;
    background: var(--ap-green-soft);
    border: 1px solid #bfdcca;
    border-radius: 10px;
    color: var(--ap-green);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 118px;
    padding: 14px;
    text-align: center;
}

.ap-reconcile-status--warning {
    background: var(--ap-amber-soft);
    border-color: #e5ce98;
    color: var(--ap-amber);
}

.ap-reconcile-status--danger {
    background: var(--ap-red-soft);
    border-color: #e4b8b4;
    color: var(--ap-red);
}

.ap-reconcile-value {
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
    font-weight: 950;
    letter-spacing: -.025em;
}

.ap-reconcile-status span {
    font-size: .6rem;
    font-weight: 800;
    margin-top: 3px;
}

.ap-progress {
    background: #e1e9ec;
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
    width: 100%;
}

.ap-progress-bar {
    background: linear-gradient(90deg, #288982, #4aa883);
    border-radius: inherit;
    height: 100%;
    min-width: 2px;
}

.ap-progress-bar--warning {
    background: #d39832;
}

.ap-progress-bar--danger {
    background: #c6554e;
}

/* Approval footer */

.ap-action-bar {
    align-items: center;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius);
    bottom: 10px;
    box-shadow: 0 10px 32px rgba(18, 48, 61, .16);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 10px 12px;
    position: sticky;
    z-index: 20;
}

.ap-action-summary {
    color: var(--ap-muted);
    font-size: .62rem;
    line-height: 1.4;
    min-width: 0;
}

.ap-action-summary strong {
    color: var(--ap-ink);
    display: block;
    font-size: .72rem;
}

.ap-action-buttons {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
}

/* Timeline and audit history */

.ap-timeline {
    list-style: none;
    margin: 0;
    padding: 2px 0 0;
}

.ap-timeline-item {
    display: grid;
    gap: 10px;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    min-height: 52px;
    padding: 0 0 12px;
    position: relative;
}

.ap-timeline-item::before {
    background: #d9e3e6;
    bottom: 0;
    content: "";
    left: 11px;
    position: absolute;
    top: 23px;
    width: 1px;
}

.ap-timeline-item:last-child {
    min-height: 24px;
    padding-bottom: 0;
}

.ap-timeline-item:last-child::before {
    display: none;
}

.ap-timeline-dot {
    align-items: center;
    background: #e6eef1;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #cedadd;
    color: #56717d;
    display: flex;
    font-size: .48rem;
    height: 22px;
    justify-content: center;
    position: relative;
    width: 22px;
    z-index: 1;
}

.ap-timeline-dot--success {
    background: #cfe9da;
    color: var(--ap-green);
}

.ap-timeline-dot--warning {
    background: #fae7b9;
    color: var(--ap-amber);
}

.ap-timeline-dot--danger {
    background: #f5d4d1;
    color: var(--ap-red);
}

.ap-timeline-copy {
    min-width: 0;
}

.ap-timeline-copy strong {
    color: #294650;
    display: block;
    font-size: .68rem;
}

.ap-timeline-copy p {
    color: var(--ap-muted);
    font-size: .59rem;
    line-height: 1.4;
    margin: 2px 0 0;
}

.ap-timeline-time {
    color: var(--ap-faint);
    font-size: .55rem;
    padding-top: 2px;
    text-align: right;
    white-space: nowrap;
}

.ap-audit-toggle {
    align-items: center;
    color: var(--ap-teal);
    cursor: pointer;
    display: flex;
    font-size: .66rem;
    font-weight: 850;
    gap: 6px;
    justify-content: space-between;
    list-style: none;
}

.ap-audit-toggle::-webkit-details-marker {
    display: none;
}

.ap-audit-content {
    border-top: 1px solid var(--ap-line);
    margin-top: 10px;
    padding-top: 12px;
}

/* Loading and utility states */

.ap-skeleton {
    animation: ap-pulse 1.35s ease-in-out infinite;
    background: linear-gradient(90deg, #e8edef 25%, #f5f7f8 50%, #e8edef 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    display: block;
    height: 12px;
}

.ap-skeleton--title {
    height: 17px;
    width: 55%;
}

.ap-skeleton--short {
    width: 34%;
}

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

.ap-text-muted {
    color: var(--ap-muted) !important;
}

.ap-text-success {
    color: var(--ap-green) !important;
}

.ap-text-warning {
    color: var(--ap-amber) !important;
}

.ap-text-danger {
    color: var(--ap-red) !important;
}

.ap-number {
    font-variant-numeric: tabular-nums;
}

@keyframes ap-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive workbench */

@media (max-width: 1320px) {
    .ap-toolbar {
        grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(125px, .55fr)) auto;
    }

    .ap-toolbar > .ap-control:nth-of-type(4) {
        display: none;
    }

    .ap-review-workbench {
        grid-template-columns: minmax(320px, .7fr) minmax(560px, 1.3fr);
    }

    .ap-detail-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ap-field--span-3 {
        grid-column: 1 / -1;
    }

    .ap-queue-head,
    .ap-queue-item {
        grid-template-columns: 30px minmax(220px, 1.35fr) minmax(140px, .75fr) minmax(105px, .5fr) minmax(115px, .55fr) 30px;
    }

    .ap-queue-head > :nth-child(5),
    .ap-queue-item > :nth-child(5) {
        display: none;
    }
}

@media (max-width: 1060px) {
    .ap-page {
        padding: 14px;
    }

    .ap-review-workbench {
        grid-template-columns: 1fr;
    }

    .ap-preview-column {
        position: static;
    }

    .ap-preview-frame {
        height: 560px;
        min-height: 440px;
    }

    .ap-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ap-match-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ap-bulk-bar {
        grid-template-columns: auto repeat(2, minmax(125px, 1fr)) auto;
    }

    .ap-bulk-bar > .ap-control:nth-of-type(n+3) {
        display: none;
    }
}

@media (max-width: 820px) {
    .ap-page {
        padding: 10px;
    }

    .ap-hero {
        padding: 18px;
    }

    .ap-hero-main,
    .ap-review-header {
        align-items: stretch;
        flex-direction: column;
    }

    .ap-hero-actions,
    .ap-review-actions {
        justify-content: flex-start;
    }

    .ap-toolbar {
        align-items: stretch;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ap-toolbar .ap-search {
        grid-column: 1 / -1;
    }

    .ap-toolbar-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .ap-toolbar > .ap-control:nth-of-type(4) {
        display: block;
    }

    .ap-queue-head {
        display: none;
    }

    .ap-queue-item {
        align-items: start;
        gap: 9px 12px;
        grid-template-columns: 22px minmax(0, 1fr) auto;
        padding: 12px;
    }

    .ap-queue-item > :nth-child(n+4):not(:last-child) {
        display: block;
        grid-column: 2 / 3;
    }

    .ap-queue-item > :last-child {
        grid-column: 3;
        grid-row: 1;
    }

    .ap-queue-amount {
        text-align: left;
    }

    .ap-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ap-field--span-3 {
        grid-column: span 2;
    }

    .ap-reconciliation {
        grid-template-columns: 1fr;
    }

    .ap-action-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .ap-action-buttons {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .ap-hero h1 {
        font-size: 1.4rem;
    }

    .ap-kpi-grid,
    .ap-match-grid,
    .ap-detail-grid,
    .ap-toolbar {
        grid-template-columns: 1fr;
    }

    .ap-toolbar .ap-search,
    .ap-toolbar-actions,
    .ap-field--span-2,
    .ap-field--span-3,
    .ap-field--full {
        grid-column: 1;
    }

    .ap-kpi-card {
        align-items: center;
        display: flex;
        justify-content: space-between;
    }

    .ap-kpi-value {
        margin-top: 0;
    }

    .ap-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .ap-panel-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .ap-preview-frame {
        height: 420px;
        min-height: 340px;
        padding: 10px;
    }

    .ap-preview-name small {
        display: none;
    }

    .ap-bulk-bar {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .ap-bulk-bar > .ap-control:nth-of-type(n+3) {
        display: block;
    }

    .ap-exception-banner {
        flex-wrap: wrap;
    }

    .ap-exception-action {
        margin-left: 34px;
    }

    .ap-action-buttons .ap-button {
        flex: 1 1 auto;
    }

    .ap-timeline-item {
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .ap-timeline-time {
        grid-column: 2;
        text-align: left;
    }
}

.ap-template-strip {
    align-items: center;
    background: linear-gradient(110deg, #eef8ff, #f7fbff);
    border: 1px solid #cfe2ef;
    border-radius: 12px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(220px, 1fr) minmax(230px, .8fr) auto auto;
    margin-bottom: 12px;
    padding: 12px 14px;
}

.ap-template-strip > div strong,
.ap-template-strip > div span {
    display: block;
}

.ap-template-strip > div span {
    color: var(--ap-muted);
    font-size: .76rem;
    margin-top: 2px;
}

@media (max-width: 960px) {
    .ap-template-strip { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
    .ap-template-strip { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .ap-page *,
    .ap-page *::before,
    .ap-page *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media print {
    .ap-page {
        max-width: none;
        padding: 0;
    }

    .ap-hero,
    .ap-toolbar,
    .ap-tabs,
    .ap-preview-column,
    .ap-action-bar,
    .ap-button,
    .ap-icon-button {
        display: none !important;
    }

    .ap-review-workbench {
        display: block;
    }

    .ap-panel {
        break-inside: avoid;
        box-shadow: none;
        margin-bottom: 12px;
    }
}

/* Dense AP inbox --------------------------------------------------------- */

.ap-inbox-active {
    overflow: hidden;
}

.ap-inbox-active .app-main {
    height: calc(100dvh - 70px);
    min-height: 0;
    padding-bottom: 14px;
}

.ap-inbox-page {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    max-width: none;
    min-height: 0;
    padding: 0;
}

.ap-inbox-topbar {
    align-items: center;
    background:
        radial-gradient(circle at 72% -30%, rgba(94, 211, 188, .22), transparent 35%),
        linear-gradient(118deg, #123345 0%, #155653 67%, #126863 100%);
    border: 1px solid rgba(10, 70, 69, .24);
    border-radius: 14px;
    box-shadow: 0 7px 20px rgba(18, 55, 67, .12);
    color: #fff;
    display: grid;
    flex: 0 0 auto;
    gap: clamp(14px, 2vw, 30px);
    grid-template-columns: minmax(255px, .9fr) minmax(430px, 1.45fr) auto;
    min-height: 84px;
    overflow: hidden;
    padding: 13px 16px;
    position: relative;
}

.ap-inbox-topbar::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .17), transparent);
    content: "";
    height: 1px;
    left: 18px;
    position: absolute;
    right: 18px;
    top: 0;
}

.ap-inbox-title {
    min-width: 0;
}

.ap-inbox-kicker {
    align-items: center;
    color: #9ddbd4;
    display: flex;
    font-size: .56rem;
    font-weight: 900;
    gap: 6px;
    letter-spacing: .11em;
    line-height: 1;
    text-transform: uppercase;
}

.ap-live-dot {
    background: #66d2b7;
    border: 2px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(102, 210, 183, .12);
    display: inline-block;
    height: 7px;
    width: 7px;
}

.ap-inbox-title-line {
    align-items: center;
    display: flex;
    gap: 9px;
    margin-top: 4px;
}

.ap-inbox-title h1 {
    color: #fff;
    font-size: clamp(1.12rem, 1.5vw, 1.48rem);
    font-weight: 920;
    letter-spacing: -.03em;
    line-height: 1.08;
    margin: 0;
}

.ap-inbox-title p {
    color: #cae0df;
    font-size: .62rem;
    line-height: 1.25;
    margin: 4px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-live-label {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    color: #dff4f1;
    font-size: .51rem;
    font-weight: 900;
    letter-spacing: .055em;
    padding: 4px 7px;
    text-transform: uppercase;
    white-space: nowrap;
}

.ap-inbox-metrics {
    align-items: stretch;
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(5, minmax(74px, 1fr));
    min-width: 0;
}

.ap-inbox-metric {
    background: rgba(255, 255, 255, .07);
    border-left: 1px solid rgba(255, 255, 255, .13);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 6px 11px;
}

.ap-inbox-metric:first-child {
    border-left: 0;
    border-radius: 9px 0 0 9px;
}

.ap-inbox-metric:last-child {
    border-radius: 0 9px 9px 0;
}

.ap-inbox-metric span {
    color: #bdd5d5;
    font-size: .52rem;
    font-weight: 850;
    letter-spacing: .045em;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.ap-inbox-metric strong {
    color: #fff;
    font-size: 1.12rem;
    font-variant-numeric: tabular-nums;
    font-weight: 920;
    line-height: 1.1;
    margin-top: 3px;
}

.ap-inbox-metric--working strong {
    color: #ffe1a1;
}

.ap-inbox-metric--danger strong {
    color: #ffc1bb;
}

.ap-inbox-metric--success strong {
    color: #aff0cb;
}

.ap-inbox-actions {
    align-items: center;
    display: flex;
    gap: 7px;
    justify-content: flex-end;
}

.ap-inbox-actions form {
    margin: 0;
}

.ap-button--inbox-primary,
.ap-button--inbox-secondary {
    border-radius: 8px;
    min-height: 36px;
    padding: 8px 11px;
}

.ap-button--inbox-primary {
    background: #fff;
    border-color: #fff;
    color: #145e5a;
}

.ap-button--inbox-primary:hover {
    background: #ecf8f6;
    border-color: #ecf8f6;
    color: #104d4a;
}

.ap-button--inbox-primary.is-busy {
    opacity: .72;
    pointer-events: none;
}

.ap-button--inbox-secondary {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .3);
    color: #fff;
}

.ap-button--inbox-secondary:hover {
    background: rgba(255, 255, 255, .15);
    border-color: rgba(255, 255, 255, .42);
    color: #fff;
}

.ap-page a.ap-button--inbox-secondary,
.ap-page a.ap-button--inbox-secondary:hover {
    color: #fff;
}

.ap-inbox-alert {
    align-items: center;
    border: 1px solid;
    border-radius: 9px;
    display: flex;
    flex: 0 0 auto;
    font-size: .64rem;
    gap: 8px;
    min-height: 34px;
    padding: 7px 10px;
}

.ap-inbox-alert strong {
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ap-inbox-alert--success {
    background: #e8f5ed;
    border-color: #badfc9;
    color: #245f3e;
}

.ap-inbox-alert--danger {
    background: #fcebe9;
    border-color: #e7bbb6;
    color: #853a34;
}

.ap-inbox-controls {
    background: #fff;
    border: 1px solid var(--ap-line);
    border-radius: 11px;
    box-shadow: var(--ap-shadow-sm);
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: minmax(500px, 1fr) minmax(620px, 1.2fr);
    min-height: 50px;
    overflow: hidden;
}

.ap-inbox-tabs {
    align-items: stretch;
    display: flex;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.ap-inbox-tab {
    align-items: center;
    border-bottom: 3px solid transparent;
    color: #607681;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .61rem;
    font-weight: 850;
    gap: 5px;
    min-height: 49px;
    padding: 8px 9px 5px;
    text-decoration: none;
    white-space: nowrap;
}

.ap-inbox-tab:hover {
    background: #f6fafb;
    color: var(--ap-teal);
    text-decoration: none;
}

.ap-inbox-tab b {
    background: #edf2f4;
    border-radius: 999px;
    color: #667b85;
    font-size: .52rem;
    font-variant-numeric: tabular-nums;
    min-width: 19px;
    padding: 3px 5px;
    text-align: center;
}

.ap-inbox-tab--active {
    background: #f0f8f7;
    border-bottom-color: var(--ap-teal);
    color: var(--ap-teal-dark);
}

.ap-inbox-tab--active b {
    background: #d9edeb;
    color: var(--ap-teal-dark);
}

.ap-inbox-filters {
    align-items: center;
    border-left: 1px solid var(--ap-line);
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(190px, 1fr) 112px 113px 113px auto auto;
    margin: 0;
    min-width: 0;
    padding: 6px 8px;
}

.ap-inbox-search {
    margin: 0;
    min-width: 0;
    position: relative;
}

.ap-inbox-search i {
    border: 1.6px solid #69818b;
    border-radius: 50%;
    height: 10px;
    left: 10px;
    pointer-events: none;
    position: absolute;
    top: 11px;
    width: 10px;
}

.ap-inbox-search i::after {
    background: #69818b;
    content: "";
    height: 1.5px;
    left: 7px;
    position: absolute;
    top: 8px;
    transform: rotate(45deg);
    width: 6px;
}

.ap-inbox-search input,
.ap-inbox-filter input,
.ap-inbox-filter select {
    background-color: #fff;
    border: 1px solid #c8d4d9;
    border-radius: 7px;
    color: var(--ap-ink);
    font-size: .62rem;
    height: 34px;
    min-width: 0;
    outline: none;
    padding: 6px 8px;
    width: 100%;
}

.ap-inbox-search input {
    padding-left: 28px;
}

.ap-inbox-search input:focus,
.ap-inbox-filter input:focus,
.ap-inbox-filter select:focus {
    border-color: #4b9995;
    box-shadow: 0 0 0 3px rgba(37, 133, 128, .1);
}

.ap-inbox-filter {
    margin: 0;
    min-width: 0;
    position: relative;
}

.ap-inbox-filter > span {
    background: #fff;
    color: #72858e;
    font-size: .48rem;
    font-weight: 850;
    left: 6px;
    line-height: 1;
    padding: 0 3px;
    position: absolute;
    top: -3px;
    z-index: 1;
}

.ap-inbox-filter-button {
    background: var(--ap-teal);
    border: 1px solid var(--ap-teal);
    border-radius: 7px;
    color: #fff;
    cursor: pointer;
    font-size: .61rem;
    font-weight: 900;
    height: 34px;
    padding: 6px 10px;
}

.ap-inbox-filter-button:hover {
    background: var(--ap-teal-dark);
}

.ap-inbox-clear {
    color: #637983;
    font-size: .58rem;
    font-weight: 850;
    padding: 7px 3px;
    text-decoration: none;
}

.ap-inbox-clear:hover {
    color: var(--ap-teal);
}

.ap-live-queue {
    background: #fff;
    border: 1px solid var(--ap-line);
    border-radius: 11px;
    box-shadow: var(--ap-shadow-sm);
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.ap-live-queuebar {
    align-items: center;
    background: #f9fbfb;
    border-bottom: 1px solid var(--ap-line);
    display: flex;
    flex: 0 0 auto;
    gap: 14px;
    justify-content: space-between;
    min-height: 38px;
    padding: 7px 11px;
}

.ap-live-queuebar > div:first-child {
    align-items: baseline;
    display: flex;
    gap: 8px;
    min-width: 0;
}

.ap-live-queuebar strong {
    color: #243f4a;
    font-size: .7rem;
    font-weight: 900;
}

.ap-live-queuebar span {
    color: var(--ap-muted);
    font-size: .56rem;
}

.ap-live-runtime {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    min-width: 0;
}

.ap-live-runtime > span {
    align-items: center;
    display: inline-flex;
    gap: 5px;
    white-space: nowrap;
}

.ap-live-runtime i {
    background: #d29b38;
    border-radius: 50%;
    display: inline-block;
    height: 6px;
    width: 6px;
}

.ap-live-runtime i.is-ready {
    background: #3f9767;
}

.ap-live-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-color: #b8c8ce #edf2f3;
    scrollbar-width: thin;
}

.ap-live-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: .62rem;
    min-width: 1450px;
    table-layout: fixed;
    width: 100%;
}

.ap-live-table .ap-col-document { width: 260px; }
.ap-live-table .ap-col-received { width: 86px; }
.ap-live-table .ap-col-capture { width: 92px; }
.ap-live-table .ap-col-vendor { width: 94px; }
.ap-live-table .ap-col-route { width: 130px; }
.ap-live-table .ap-col-match { width: 100px; }
.ap-live-table .ap-col-netsuite { width: 118px; }
.ap-live-table .ap-col-status { width: 112px; }
.ap-live-table .ap-col-owner { width: 112px; }
.ap-live-table .ap-col-amount { width: 104px; }
.ap-live-table .ap-col-updated { width: 86px; }
.ap-live-table .ap-col-open { width: 36px; }

.ap-live-table th {
    background: #edf3f4;
    border-bottom: 1px solid #cfdcdf;
    color: #607680;
    font-size: .51rem;
    font-weight: 920;
    height: 32px;
    letter-spacing: .06em;
    padding: 7px 8px;
    position: sticky;
    text-align: left;
    text-transform: uppercase;
    top: 0;
    white-space: nowrap;
    z-index: 3;
}

.ap-live-table th:first-child {
    left: 0;
    z-index: 5;
}

.ap-live-table td {
    background: #fff;
    border-bottom: 1px solid #e5ecee;
    color: #344f5a;
    height: 54px;
    overflow: hidden;
    padding: 7px 8px;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.ap-live-row {
    cursor: pointer;
    position: relative;
}

.ap-live-row:hover td {
    background: #f5faf9;
}

.ap-live-row:focus {
    outline: none;
}

.ap-live-row:focus td {
    background: #edf7f6;
    box-shadow: inset 0 1px 0 #8ec4bf, inset 0 -1px 0 #8ec4bf;
}

.ap-live-row td:first-child {
    box-shadow: inset 3px 0 0 #9aadb5;
    left: 0;
    position: sticky;
    z-index: 2;
}

.ap-live-row--success td:first-child { box-shadow: inset 3px 0 0 #3f9466; }
.ap-live-row--warning td:first-child { box-shadow: inset 3px 0 0 #ce9230; }
.ap-live-row--danger td:first-child { box-shadow: inset 3px 0 0 #bf5049; }
.ap-live-row--working td:first-child { box-shadow: inset 3px 0 0 #3282a1; }

.ap-live-row:hover td:first-child,
.ap-live-row:focus td:first-child {
    background: #edf7f6;
}

.ap-document-cell {
    padding-left: 10px !important;
}

.ap-doc-link {
    align-items: center;
    color: inherit !important;
    display: flex;
    gap: 9px;
    min-width: 0;
    text-decoration: none;
}

.ap-doc-link:hover {
    text-decoration: none;
}

.ap-doc-kind {
    align-items: center;
    background: #e3f1ef;
    border: 1px solid #c2dfdb;
    border-radius: 7px;
    color: #1b6e69;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .48rem;
    font-weight: 950;
    height: 30px;
    justify-content: center;
    letter-spacing: .025em;
    width: 34px;
}

.ap-doc-kind--statement {
    background: #e8eff6;
    border-color: #ccdbe7;
    color: #376681;
}

.ap-doc-kind--card {
    background: #f0ecf8;
    border-color: #d9cfee;
    color: #66519b;
}

.ap-doc-kind--quote {
    background: #fff1d8;
    border-color: #ead3a5;
    color: #8c621a;
}

.ap-doc-copy {
    display: block;
    min-width: 0;
}

.ap-doc-copy strong {
    color: #1c4353;
    display: block;
    font-size: .68rem;
    font-weight: 900;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-doc-copy small {
    color: #758891;
    display: block;
    font-size: .54rem;
    line-height: 1.25;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-doc-copy small span {
    color: #afbbc0;
    padding: 0 2px;
}

.ap-date-stack,
.ap-route-label {
    display: block;
    min-width: 0;
}

.ap-date-stack strong,
.ap-route-label b {
    color: #34505b;
    display: block;
    font-size: .61rem;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-date-stack small,
.ap-route-label small {
    color: #84959c;
    display: block;
    font-size: .5rem;
    line-height: 1.15;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-route-label--linked b {
    color: #26704d;
}

.ap-gate {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-flex;
    font-size: .51rem;
    font-weight: 900;
    gap: 5px;
    line-height: 1;
    max-width: 100%;
    padding: 5px 7px;
    white-space: nowrap;
}

.ap-gate i {
    background: currentColor;
    border-radius: 50%;
    flex: 0 0 auto;
    height: 5px;
    opacity: .78;
    width: 5px;
}

.ap-gate--neutral {
    background: #edf2f4;
    border-color: #dce4e7;
    color: #667b84;
}

.ap-gate--success {
    background: #e5f3ea;
    border-color: #c8e3d2;
    color: #2b754d;
}

.ap-gate--warning {
    background: #fff2d8;
    border-color: #edd7a9;
    color: #946619;
}

.ap-gate--danger {
    background: #fbe9e7;
    border-color: #e9c2be;
    color: #a1423b;
}

.ap-gate--working {
    background: #e5f1f6;
    border-color: #c7dee8;
    color: #2d718e;
}

.ap-status-pill {
    border-radius: 5px;
    display: inline-flex;
    font-size: .5rem;
    font-weight: 920;
    letter-spacing: .02em;
    line-height: 1;
    padding: 6px 7px;
    text-transform: uppercase;
    white-space: nowrap;
}

.ap-status-pill--neutral { background: #ebf0f2; color: #5a707a; }
.ap-status-pill--success { background: #dff1e6; color: #256d47; }
.ap-status-pill--warning { background: #fff0d2; color: #8f6115; }
.ap-status-pill--danger { background: #f9e5e2; color: #9c3d36; }
.ap-status-pill--working { background: #dfedf4; color: #286b87; }

.ap-owner {
    color: #536b75;
    display: block;
    font-size: .57rem;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-cell-right {
    text-align: right !important;
}

.ap-row-amount {
    color: #1d3e4b;
    font-size: .68rem;
    font-variant-numeric: tabular-nums;
    font-weight: 920;
    white-space: nowrap;
}

.ap-row-open {
    align-items: center;
    border-radius: 6px;
    color: #6d828b;
    display: inline-flex;
    font-size: 1.15rem;
    height: 27px;
    justify-content: center;
    line-height: 1;
    width: 25px;
}

.ap-live-row:hover .ap-row-open {
    background: #dfeeed;
    color: var(--ap-teal);
}

.ap-live-empty-row td {
    border: 0;
    height: auto;
}

.ap-live-empty {
    align-items: center;
    color: #607781;
    display: flex;
    gap: 13px;
    justify-content: center;
    min-height: 220px;
    padding: 24px;
}

.ap-live-empty-icon {
    align-items: center;
    background: #e5f2f0;
    border: 1px solid #c6e0dc;
    border-radius: 50%;
    color: var(--ap-teal);
    display: flex;
    flex: 0 0 auto;
    font-size: 1rem;
    font-weight: 700;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.ap-live-empty strong {
    color: #2a4854;
    display: block;
    font-size: .72rem;
}

.ap-live-empty p {
    font-size: .6rem;
    margin: 3px 0 0;
}

.ap-live-footer {
    align-items: center;
    background: #f8fafb;
    border-top: 1px solid var(--ap-line);
    color: #73868e;
    display: flex;
    flex: 0 0 auto;
    font-size: .54rem;
    gap: 16px;
    justify-content: space-between;
    min-height: 31px;
    padding: 6px 10px;
}

.ap-live-footer strong {
    color: #395661;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1450px) {
    .ap-inbox-topbar {
        grid-template-columns: minmax(235px, .85fr) minmax(360px, 1.3fr) auto;
    }

    .ap-inbox-metric {
        padding-left: 8px;
        padding-right: 8px;
    }

    .ap-inbox-controls {
        grid-template-columns: minmax(470px, .9fr) minmax(560px, 1.1fr);
    }

    .ap-inbox-filters {
        grid-template-columns: minmax(175px, 1fr) 105px 106px 106px auto auto;
    }
}

@media (max-width: 1200px) {
    .ap-inbox-topbar {
        gap: 12px;
        grid-template-columns: minmax(230px, .9fr) minmax(270px, 1fr) auto;
    }

    .ap-inbox-metric:nth-child(2),
    .ap-inbox-metric:nth-child(5) {
        display: none;
    }

    .ap-inbox-metrics {
        grid-template-columns: repeat(3, minmax(72px, 1fr));
    }

    .ap-inbox-controls {
        grid-template-columns: 1fr;
    }

    .ap-inbox-tabs {
        border-bottom: 1px solid var(--ap-line);
    }

    .ap-inbox-filters {
        border-left: 0;
    }
}

@media (max-width: 800px) {
    .ap-inbox-active {
        overflow: auto;
    }

    .ap-inbox-active .app-main {
        height: auto;
        min-height: calc(100dvh - 70px);
    }

    .ap-inbox-page {
        height: auto;
        min-height: calc(100dvh - 104px);
    }

    .ap-inbox-topbar {
        align-items: start;
        grid-template-columns: 1fr auto;
    }

    .ap-inbox-metrics {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .ap-inbox-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .ap-inbox-filters {
        grid-template-columns: minmax(180px, 1fr) 110px 110px auto auto;
    }

    .ap-inbox-filter:nth-of-type(4) {
        display: none;
    }

    .ap-live-queue {
        min-height: 58vh;
    }

    .ap-live-table-scroll {
        max-height: 62vh;
    }

    .ap-live-runtime > span:last-child {
        display: none;
    }
}

@media (max-width: 560px) {
    .ap-inbox-topbar {
        grid-template-columns: 1fr;
        padding: 13px;
    }

    .ap-inbox-actions {
        grid-column: 1;
        grid-row: 3;
        justify-content: flex-start;
    }

    .ap-inbox-actions .ap-button {
        flex: 1 1 auto;
    }

    .ap-inbox-actions form {
        display: flex;
        flex: 1 1 auto;
    }

    .ap-inbox-actions form .ap-button {
        width: 100%;
    }

    .ap-inbox-metrics {
        grid-template-columns: repeat(3, 1fr);
    }

    .ap-inbox-filters {
        grid-template-columns: 1fr 1fr auto;
    }

    .ap-inbox-search {
        grid-column: 1 / -1;
    }

    .ap-inbox-filter:nth-of-type(3),
    .ap-inbox-filter:nth-of-type(4) {
        display: none;
    }

    .ap-inbox-filter-button {
        min-width: 58px;
    }

    .ap-live-queuebar {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .ap-live-runtime {
        justify-content: flex-start;
    }

    .ap-live-runtime > span:nth-child(2) {
        display: none;
    }

    .ap-live-footer span:nth-child(n+2) {
        display: none;
    }
}

@media print {
    .ap-inbox-active,
    .ap-inbox-active .app-main,
    .ap-inbox-page {
        height: auto !important;
        overflow: visible !important;
    }

    .ap-inbox-topbar,
    .ap-inbox-controls,
    .ap-live-queuebar,
    .ap-live-footer {
        display: none !important;
    }

    .ap-live-queue,
    .ap-live-table-scroll {
        border: 0;
        box-shadow: none;
        max-height: none;
        overflow: visible;
    }
}

/* Full-height AP review workspace. The page stays fixed while the coding,
   document, line, and audit surfaces each own their scrolling region. */

body.ap-workspace-mode {
    overflow: hidden;
}

body.ap-workspace-mode .app-main {
    height: calc(100dvh - 70px);
    max-width: none;
    overflow: hidden;
    padding-bottom: 8px;
    padding-top: 8px;
}

.ap-workspace-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: none;
    overflow: hidden;
    padding: 0;
}

.ap-workspace-page .ap-review-header {
    border-radius: 8px;
    flex: 0 0 auto;
    gap: 10px;
    margin: 0;
    min-height: 48px;
    padding: 6px 10px;
}

.ap-workspace-page .ap-review-title {
    flex: 0 1 300px;
}

.ap-workspace-page .ap-review-title h1 {
    font-size: .88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-workspace-page .ap-review-title p {
    font-size: .56rem;
    margin-top: 1px;
}

.ap-workspace-page .ap-gate-rail {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    gap: 3px;
    justify-content: center;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.ap-workspace-page .ap-gate {
    align-items: center;
    background: #f0f4f5;
    border: 1px solid #dae4e7;
    border-radius: 999px;
    color: #667b84;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .52rem;
    font-weight: 850;
    gap: 4px;
    padding: 4px 6px;
    white-space: nowrap;
}

.ap-workspace-page .ap-gate i {
    background: #9aa9af;
    border-radius: 50%;
    height: 6px;
    width: 6px;
}

.ap-workspace-page .ap-gate--pass {
    background: var(--ap-green-soft);
    border-color: #c3dfce;
    color: var(--ap-green);
}

.ap-workspace-page .ap-gate--pass i { background: #3f9564; }

.ap-workspace-page .ap-gate--fail {
    background: var(--ap-red-soft);
    border-color: #e6bfbb;
    color: var(--ap-red);
}

.ap-workspace-page .ap-gate--fail i { background: #bd514a; }

.ap-workspace-page .ap-gate--wait {
    background: var(--ap-amber-soft);
    border-color: #ebd7a6;
    color: var(--ap-amber);
}

.ap-workspace-page .ap-gate--wait i { background: #c58c28; }

.ap-workspace-page > .ap-exception-banner {
    align-items: center;
    flex: 0 0 auto;
    margin: 4px 0 0;
    min-height: 30px;
    padding: 4px 8px;
}

.ap-workspace-page > .ap-exception-banner .ap-exception-icon {
    height: 18px;
    width: 18px;
}

.ap-workspace-page > .ap-exception-banner .ap-exception-copy {
    align-items: baseline;
    display: flex;
    gap: 7px;
    overflow: hidden;
}

.ap-workspace-page > .ap-exception-banner .ap-exception-copy strong {
    flex: 0 0 auto;
    font-size: .61rem;
}

.ap-workspace-page > .ap-exception-banner .ap-exception-copy p {
    font-size: .56rem;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-workspace-page .ap-review-workbench {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
}

.ap-workspace-form {
    display: grid;
    gap: 6px;
    grid-template-rows: minmax(270px, 58%) minmax(230px, 42%);
    height: 100%;
    min-height: 0;
    padding-top: 6px;
}

.ap-review-stage {
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(360px, 29%) minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
}

.ap-coding-column {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
}

.ap-preview-column {
    align-self: stretch;
    display: grid;
    gap: 4px;
    grid-column: 2;
    grid-row: 1;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
    position: static;
}

.ap-preview-column .ap-preview-panel {
    display: grid;
    grid-template-rows: 38px minmax(0, 1fr) 24px;
    height: 100%;
    min-height: 0;
}

.ap-preview-column .ap-preview-toolbar {
    min-height: 38px;
    padding: 5px 8px;
}

.ap-preview-column .ap-preview-frame {
    height: auto;
    min-height: 0;
    overflow: auto;
    padding: 6px;
}

.ap-preview-column .ap-preview-frame iframe {
    height: 100%;
    min-height: 0;
}

.ap-preview-column .ap-preview-empty {
    min-height: 0;
}

.ap-preview-column .ap-preview-footer {
    min-height: 24px;
    padding: 3px 8px;
}

.ap-preview-upload {
    align-items: center;
    background: #fff;
    border: 1px solid var(--ap-line);
    border-radius: 8px;
    display: grid;
    gap: 5px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 4px 5px;
}

.ap-preview-upload .ap-input,
.ap-preview-upload .ap-button {
    font-size: .6rem;
    min-height: 30px;
}

.ap-coding-column .ap-template-strip {
    border-radius: 8px;
    gap: 5px;
    grid-template-columns: minmax(90px, .7fr) minmax(120px, 1fr) auto auto;
    margin-bottom: 6px;
    padding: 5px 6px;
}

.ap-coding-column .ap-template-strip > div span {
    display: none;
}

.ap-coding-column .ap-template-strip > div strong {
    font-size: .62rem;
}

.ap-coding-column .ap-template-strip .ap-select,
.ap-coding-column .ap-template-strip .ap-button {
    font-size: .58rem;
    min-height: 29px;
    padding-bottom: 4px;
    padding-top: 4px;
}

.ap-coding-column .ap-panel {
    border-radius: 8px;
    margin-bottom: 6px;
}

.ap-coding-column .ap-panel-header {
    gap: 6px;
    min-height: 36px;
    padding: 5px 7px;
}

.ap-coding-column .ap-panel-heading h2 {
    font-size: .7rem;
}

.ap-coding-column .ap-panel-heading p {
    display: none;
}

.ap-coding-column .ap-panel-actions {
    gap: 3px;
}

.ap-coding-column .ap-chip {
    font-size: .48rem;
    padding: 4px 5px;
}

.ap-coding-column .ap-panel-body {
    padding: 7px;
}

.ap-coding-column .ap-detail-grid {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ap-coding-column .ap-field--span-3,
.ap-coding-column .ap-field--full {
    grid-column: 1 / -1;
}

.ap-coding-column .ap-field label {
    font-size: .49rem;
    margin-bottom: 2px;
}

.ap-coding-column .ap-input,
.ap-coding-column .ap-select,
.ap-coding-column .ap-textarea {
    border-radius: 6px;
    font-size: .62rem;
    min-height: 30px;
    padding: 5px 7px;
}

.ap-coding-column .ap-select {
    background-position: calc(100% - 12px) 12px, calc(100% - 8px) 12px;
}

.ap-coding-column .ap-textarea {
    min-height: 38px;
    resize: vertical;
}

.ap-coding-column .ap-field-hint,
.ap-coding-column .ap-line-note {
    font-size: .48rem;
    margin-top: 1px;
}

.ap-coding-column #po-match-panel {
    margin-top: 6px !important;
}

.ap-coding-column #po-match-panel .ap-detail-grid {
    align-items: end;
    grid-template-columns: minmax(0, 1fr) auto;
}

.ap-coding-column #po-match-panel .po-reference {
    grid-column: 1;
}

.ap-coding-column .ap-match-grid {
    gap: 4px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ap-coding-column .ap-match-card {
    border-radius: 6px;
    padding: 5px 6px;
}

.ap-coding-column .ap-match-label { font-size: .47rem; }
.ap-coding-column .ap-match-value { font-size: .76rem; margin-top: 1px; }
.ap-coding-column .ap-match-meta { font-size: .48rem; margin-top: 1px; }
.ap-coding-column .ap-match-result { font-size: .52rem; margin-top: 4px; padding: 4px 6px; }

.ap-lines-workspace {
    border-radius: 8px;
    display: grid;
    grid-template-rows: 34px auto minmax(0, 1fr) 31px auto 45px;
    margin: 0 !important;
    min-height: 0;
    overflow: hidden;
}

.ap-lines-workspace > .ap-panel-header {
    min-height: 34px;
    padding: 4px 8px;
}

.ap-lines-workspace > .ap-panel-header h2 { font-size: .72rem; }
.ap-lines-workspace > .ap-panel-header p { display: none; }

.ap-lines-workspace .ap-bulk-bar {
    gap: 5px;
    grid-template-columns: auto minmax(130px, 1fr) auto minmax(130px, 1fr) auto minmax(105px, .6fr) auto;
    padding: 4px 7px;
}

.ap-lines-workspace .ap-bulk-bar .ap-input,
.ap-lines-workspace .ap-bulk-bar .ap-select,
.ap-lines-workspace .ap-bulk-bar .ap-button {
    font-size: .56rem;
    min-height: 28px;
}

.ap-lines-workspace .ap-line-table-wrap {
    min-height: 0;
    overflow: auto;
    scrollbar-width: thin;
}

.ap-lines-workspace .ap-line-table th {
    padding: 5px;
}

.ap-lines-workspace .ap-line-table td {
    padding: 4px 5px;
}

.ap-lines-workspace .ap-line-table .ap-input,
.ap-lines-workspace .ap-line-table .ap-select {
    font-size: .58rem;
    min-height: 28px;
    padding: 4px 5px;
}

.ap-lines-workspace .ap-table-footer {
    min-height: 31px;
    padding: 3px 7px;
}

.ap-lines-workspace > .ap-panel-body {
    overflow-x: auto;
    padding: 4px 7px;
}

.ap-lines-workspace .ap-reconciliation {
    align-items: center;
    gap: 8px;
    grid-template-columns: minmax(780px, 1fr) minmax(240px, .35fr);
}

.ap-lines-workspace .ap-totals-list {
    align-items: end;
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(7, minmax(92px, 1fr));
}

.ap-lines-workspace .ap-total-row {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    font-size: .5rem;
    gap: 1px;
}

.ap-lines-workspace .ap-total-row > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-lines-workspace .ap-total-row .ap-input {
    font-size: .6rem;
    min-height: 25px;
    padding: 3px 5px;
}

.ap-lines-workspace .ap-total-row strong {
    align-items: center;
    display: flex;
    font-size: .65rem;
    min-height: 25px;
}

.ap-lines-workspace .ap-total-row--grand {
    border: 0;
    font-size: .5rem;
    margin: 0;
    padding: 0;
}

.ap-lines-workspace .ap-reconcile-status {
    align-items: center;
    flex-direction: row;
    gap: 6px;
    justify-content: flex-start;
    min-height: 32px;
    padding: 4px 7px;
    text-align: left;
}

.ap-lines-workspace .ap-reconcile-status strong { font-size: .65rem; white-space: nowrap; }
.ap-lines-workspace .ap-reconcile-status > span { font-size: .5rem; margin: 0; }
.ap-lines-workspace .ap-reconcile-status label { font-size: .5rem; margin: 0 !important; }

.ap-lines-workspace .ap-action-bar {
    border: 0;
    border-radius: 0;
    border-top: 1px solid var(--ap-line);
    bottom: auto;
    box-shadow: none;
    min-height: 45px;
    padding: 4px 7px;
    position: static;
}

.ap-lines-workspace .ap-action-summary { font-size: .52rem; }
.ap-lines-workspace .ap-action-summary strong { font-size: .62rem; }
.ap-lines-workspace .ap-action-buttons .ap-button { min-height: 30px; }

.ap-audit-drawer {
    position: absolute;
    right: 78px;
    top: -43px;
    z-index: 60;
}

.ap-audit-drawer > summary {
    background: #fff;
    border: 1px solid var(--ap-line-strong);
    border-radius: 7px;
    color: var(--ap-teal-dark);
    cursor: pointer;
    font-size: .58rem;
    font-weight: 850;
    list-style: none;
    padding: 5px 7px;
}

.ap-audit-drawer > summary::-webkit-details-marker { display: none; }

.ap-audit-sheet {
    background: #fff;
    border: 1px solid var(--ap-line);
    border-radius: 10px;
    bottom: 12px;
    box-shadow: 0 18px 48px rgba(18, 42, 52, .24);
    display: none;
    overflow-y: auto;
    position: fixed;
    right: 12px;
    top: 78px;
    width: min(430px, calc(100vw - 24px));
    z-index: 1050;
}

.ap-audit-drawer[open] .ap-audit-sheet { display: block; }

@media (max-width: 1100px) {
    body.ap-workspace-mode { overflow: auto; }
    body.ap-workspace-mode .app-main { height: auto; overflow: visible; }
    .ap-workspace-page { height: auto; overflow: visible; }
    .ap-workspace-form { display: block; height: auto; }
    .ap-review-stage { grid-template-columns: 1fr; overflow: visible; }
    .ap-coding-column { grid-column: 1; grid-row: 1; max-height: none; overflow: visible; }
    .ap-preview-column { grid-column: 1; grid-row: 2; height: 560px; margin-top: 8px; }
    .ap-lines-workspace { display: block; margin-top: 8px !important; }
    .ap-lines-workspace .ap-line-table-wrap { max-height: 420px; }
    .ap-lines-workspace .ap-reconciliation { grid-template-columns: 1fr; }
    .ap-lines-workspace .ap-totals-list { grid-template-columns: repeat(4, minmax(105px, 1fr)); }
    .ap-workspace-page .ap-gate-rail { justify-content: flex-start; order: 3; width: 100%; }
    .ap-workspace-page .ap-review-header { flex-wrap: wrap; }
}

/* AP live workspace refinements: denser information, larger working text,
   no page-level refresh, and inline inbox review. */
body.app-chrome-hidden .app-main {
    height: 100dvh;
    max-width: none;
    min-height: 100dvh;
    overflow: hidden;
    padding: 10px 14px;
}

body.app-chrome-hidden.ap-inbox-active .app-main,
body.app-chrome-hidden.ap-workspace-mode .app-main {
    height: 100dvh;
}

.ap-inbox-page { gap: 8px; }

.ap-inbox-controls {
    grid-template-columns: minmax(820px, 1.25fr) minmax(650px, .9fr);
}

.ap-inbox-tabs {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    overflow: hidden;
}

.ap-inbox-tab {
    font-size: .68rem;
    justify-content: center;
    min-width: 0;
    padding-left: 4px;
    padding-right: 4px;
}

.ap-inbox-tab span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.ap-inbox-tab b { font-size: .58rem; }

.ap-inbox-filters {
    grid-template-columns: minmax(210px, 300px) 110px 112px 112px auto auto;
    justify-content: end;
}

.ap-inbox-search { max-width: 300px; }

.ap-inbox-search input,
.ap-inbox-filter input,
.ap-inbox-filter select,
.ap-inbox-filter-button {
    font-size: .72rem;
    height: 36px;
}

.ap-inbox-search i {
    height: 13px;
    top: 10px;
    width: 13px;
}

.ap-inbox-search i::after { left: 9px; top: 10px; width: 7px; }

.ap-live-table {
    font-size: .7rem;
    min-width: 1370px;
}

.ap-live-table th { font-size: .57rem; }
.ap-live-table td { height: 62px; }

.ap-doc-kind {
    font-size: .58rem;
    height: 38px;
    width: 42px;
}

.ap-doc-copy strong { font-size: .78rem; }
.ap-doc-copy small { font-size: .63rem; }
.ap-date-stack strong,
.ap-row-amount,
.ap-owner { font-size: .7rem; }

.ap-row-open {
    align-items: center;
    background: transparent;
    border: 0;
    color: #2b6972;
    cursor: pointer;
    display: inline-flex;
    font-size: 1.15rem;
    font-weight: 900;
    height: 30px;
    justify-content: center;
    padding: 0;
    transform: rotate(-90deg);
    transition: transform .15s ease;
    width: 30px;
}

.ap-live-row.is-expanded .ap-row-open { transform: rotate(0deg); }

.ap-duplicate-flag {
    background: #fbe4e1;
    border-radius: 999px;
    color: #a23d36;
    font-size: .55rem;
    margin-left: 5px;
    padding: 2px 5px;
}

.ap-live-detail-row > td {
    background: #f4f8f8;
    border-bottom: 1px solid #cbd9dc;
    height: auto;
    padding: 10px 12px;
}

.ap-live-detail {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 32%);
    min-height: 270px;
}

.ap-live-detail-lines,
.ap-live-detail-document {
    background: #fff;
    border: 1px solid #d6e1e3;
    border-radius: 9px;
    min-width: 0;
    overflow: hidden;
}

.ap-live-detail-lines { display: flex; flex-direction: column; }
.ap-live-detail-lines > header,
.ap-live-detail-lines > footer {
    align-items: center;
    background: #f8fbfb;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 8px 10px;
}
.ap-live-detail-lines > header { border-bottom: 1px solid #dfe8ea; }
.ap-live-detail-lines > footer { border-top: 1px solid #dfe8ea; margin-top: auto; }
.ap-live-detail-actions { align-items: center; display: flex; gap: 7px; }
.ap-live-detail-actions form,
.ap-review-actions form { margin: 0; }
.ap-live-detail-lines header strong { color: #1d414d; font-size: .78rem; margin-right: 7px; }
.ap-live-detail-lines header span,
.ap-live-detail-lines footer span { color: #617983; font-size: .64rem; }
.ap-duplicate-alert { color: #9b3d36 !important; font-weight: 850; }
.ap-duplicate-clear { color: #347551 !important; font-weight: 800; }
.ap-lines-pending { color: #637a84; display: grid; flex: 1; font-size: .76rem; place-items: center; }

.ap-inbox-line-table { border-collapse: collapse; font-size: .69rem; table-layout: fixed; width: 100%; }
.ap-inbox-line-table th { background: #edf3f4; color: #607680; font-size: .56rem; padding: 6px 7px; text-transform: uppercase; }
.ap-inbox-line-table td { border-bottom: 1px solid #e4ebed; color: #304e59; height: auto; padding: 7px; }
.ap-inbox-line-table th:nth-child(1) { width: 38px; }
.ap-inbox-line-table th:nth-child(2) { width: 25%; }
.ap-inbox-line-table th:nth-child(3) { width: 15%; }
.ap-inbox-line-table th:nth-child(4) { width: 20%; }
.ap-inbox-line-table th:nth-child(n+5) { width: 11%; }

.ap-live-detail-document { min-height: 260px; position: relative; }
.ap-live-detail-document iframe { border: 0; height: 100%; min-height: 260px; width: 100%; }
.ap-live-detail-document > a { background: rgba(20,68,76,.88); border-radius: 6px; bottom: 8px; color: #fff; font-size: .68rem; padding: 5px 8px; position: absolute; right: 8px; text-decoration: none; }
.ap-live-detail-document > div { color: #6c8088; display: grid; height: 100%; place-items: center; }

.ap-mode-select { align-items: center; display: flex; gap: 5px; margin: 0; }
.ap-mode-select span { color: #657a83; font-size: .52rem; font-weight: 850; text-transform: uppercase; }
.ap-mode-select .ap-select { min-height: 29px; min-width: 128px; }

.ap-coding-column .ap-template-strip {
    grid-template-columns: auto minmax(120px, 1fr) repeat(4, auto);
}

.ap-lines-workspace .ap-bulk-bar {
    grid-template-columns: auto minmax(180px, 1fr) auto minmax(125px, .65fr) auto;
}

.ap-line-description {
    display: grid;
    gap: 4px;
    grid-template-columns: minmax(180px, 1fr) minmax(100px, .42fr);
}

.ap-lines-workspace .ap-line-table { min-width: 1040px; }
.ap-lines-workspace .ap-line-table th:nth-child(3) { min-width: 320px; }
.ap-lines-workspace .ap-line-table th:nth-child(7) { min-width: 240px; }
.ap-lines-workspace .ap-line-table th,
.ap-lines-workspace .ap-line-table td { font-size: .64rem; }
.ap-lines-workspace .ap-line-table .ap-input,
.ap-lines-workspace .ap-line-table .ap-select { font-size: .66rem; }

.ap-audit-sheet .ap-panel-header { align-items: center; display: flex; justify-content: space-between; }
.ap-suggestion-error { color: #9d3e36; font-size: .68rem; padding: 9px; }

@media (max-width: 1500px) {
    .ap-inbox-controls { grid-template-columns: 1fr; }
    .ap-inbox-tabs { border-bottom: 1px solid var(--ap-line); }
    .ap-inbox-filters { border-left: 0; grid-template-columns: minmax(220px, 300px) 110px 112px 112px auto auto; }
}

@media (max-width: 900px) {
    body.app-chrome-hidden .app-main { overflow: auto; padding: 8px; }
    .ap-inbox-tabs { grid-template-columns: repeat(3, 1fr); }
    .ap-live-detail { grid-template-columns: 1fr; }
    .ap-live-detail-document { min-height: 420px; }
}

/* AP review workbench: keep the page focused and move secondary tools into dialogs. */
.ap-lines-workspace {
    grid-template-rows: 42px minmax(0, 1fr) 35px 50px;
}

.ap-lines-workspace > .ap-panel-header {
    align-items: center;
    min-height: 42px;
    padding: 5px 9px;
}

.ap-lines-workspace > .ap-panel-header h2 { font-size: .79rem; }
.ap-heading-count { color: #71868e; font-size: .62rem; font-weight: 650; margin-left: 5px; }
.ap-line-tools { align-items: center; display: flex; gap: 5px; }
.ap-line-tools .ap-button { font-size: .61rem; min-height: 29px; padding: 5px 9px; }

.ap-lines-workspace .ap-line-table {
    min-width: 1120px;
    table-layout: fixed;
}

.ap-lines-workspace .ap-line-table th,
.ap-lines-workspace .ap-line-table td {
    font-size: .69rem;
    padding: 5px 6px;
    vertical-align: middle;
}

.ap-lines-workspace .ap-line-table th { font-size: .57rem; }
.ap-lines-workspace .ap-line-table th:nth-child(1) { width: 44px; }
.ap-lines-workspace .ap-line-table th:nth-child(2) { width: 34px; }
.ap-lines-workspace .ap-line-table th:nth-child(3) { min-width: 0; width: 22%; }
.ap-lines-workspace .ap-line-table th:nth-child(4) { width: 12%; }
.ap-lines-workspace .ap-line-table th:nth-child(5),
.ap-lines-workspace .ap-line-table th:nth-child(6) { min-width: 0; width: 22%; }
.ap-lines-workspace .ap-line-table th:nth-child(7) { min-width: 0; width: 7%; }
.ap-lines-workspace .ap-line-table th:nth-child(8) { width: 9%; }
.ap-lines-workspace .ap-line-table th:nth-child(9) { width: 19%; }
.ap-lines-workspace .ap-line-table th:nth-child(10) { width: 9%; }
.ap-lines-workspace .ap-line-table th:last-child { width: 36px; }

.ap-lines-workspace .ap-line-table .ap-input,
.ap-lines-workspace .ap-line-table .ap-select {
    font-size: .69rem;
    min-height: 32px;
    padding: 5px 7px;
}

.ap-lines-workspace .ap-line-table .ap-cell-input,
.ap-lines-workspace .ap-line-table .po-line,
.ap-lines-workspace .ap-line-table .account-search,
.ap-lines-workspace .ap-line-table .line-tax {
    background-color: transparent;
    border-color: transparent;
    box-shadow: none;
}

.ap-lines-workspace .ap-line-table tr:hover .ap-cell-input,
.ap-lines-workspace .ap-line-table tr:hover .po-line,
.ap-lines-workspace .ap-line-table tr:hover .account-search,
.ap-lines-workspace .ap-line-table tr:hover .line-tax,
.ap-lines-workspace .ap-line-table .ap-input:focus,
.ap-lines-workspace .ap-line-table .ap-select:focus {
    background-color: #fff;
    border-color: #9ebbc0;
}

.ap-tax-cell { align-items: center; display: grid; gap: 3px; grid-template-columns: minmax(105px, 1fr) 78px; }
.ap-tax-cell .line-tax-amount { text-align: right; }
.ap-lines-workspace .ap-line-note { display: block; font-size: .51rem; margin: 1px 5px 0; }
.ap-lines-workspace .ap-action-bar { min-height: 50px; padding: 5px 9px; }
.ap-lines-workspace .ap-action-summary { font-size: .57rem; }
.ap-lines-workspace .ap-action-summary strong { font-size: .68rem; }
.ap-lines-workspace .ap-action-buttons .ap-button { font-size: .64rem; min-height: 32px; }

.ap-workbench-dialog {
    background: #fff;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(12, 46, 53, .3);
    color: var(--ap-ink);
    max-height: calc(100dvh - 40px);
    max-width: calc(100vw - 32px);
    padding: 0;
    width: min(720px, calc(100vw - 32px));
}

.ap-workbench-dialog--wide { width: min(980px, calc(100vw - 32px)); }
.ap-workbench-dialog--line-settings { width: min(1120px, calc(100vw - 32px)); }
.ap-workbench-dialog::backdrop { backdrop-filter: blur(2px); background: rgba(9, 35, 42, .48); }
.ap-dialog-header { align-items: center; background: #f4f8f8; border-bottom: 1px solid var(--ap-line); display: flex; justify-content: space-between; padding: 14px 16px; }
.ap-dialog-header h2 { color: var(--ap-teal-dark); font-size: 1rem; margin: 0; }
.ap-dialog-header p { color: #667e87; font-size: .69rem; margin: 3px 0 0; }
.ap-dialog-close { align-items: center; background: transparent; border: 0; border-radius: 7px; color: #48626c; cursor: pointer; display: inline-flex; font-size: 1.5rem; height: 34px; justify-content: center; width: 34px; }
.ap-dialog-close:hover { background: #e2ebed; }
.ap-dialog-body { max-height: calc(100dvh - 130px); overflow: auto; padding: 16px; }
.ap-line-settings-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ap-workbench-dialog--line-settings .ap-dialog-body { min-height: min(540px, calc(100dvh - 150px)); overflow: visible; }
.ap-workbench-dialog--line-settings .ap-line-settings-grid { align-items: start; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
.ap-workbench-dialog--line-settings .bulk-item .ap-suggestion-list { margin-top: 8px; max-height: 360px; position: static; }
.ap-dialog-setting { background: #f7fafa; border: 1px solid var(--ap-line); border-radius: 9px; display: grid; gap: 8px; padding: 12px; }
.ap-dialog-setting > label { color: #45606a; font-size: .65rem; font-weight: 850; text-transform: uppercase; }
.ap-dialog-setting > p { color: #647b84; font-size: .65rem; line-height: 1.45; margin: 0; }
.ap-po-search-row { align-items: end; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) auto auto; margin-bottom: 15px; }
.ap-po-search-row .po-reference { position: relative; }
.ap-workbench-dialog .ap-match-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ap-workbench-dialog .ap-reconciliation { align-items: stretch; display: grid; gap: 14px; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); }
.ap-workbench-dialog .ap-totals-list { display: grid; gap: 7px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ap-workbench-dialog .ap-total-row { align-items: center; border-bottom: 1px solid #e3ebed; display: grid; gap: 8px; grid-template-columns: 1fr minmax(100px, .55fr); padding: 5px 0; }
.ap-workbench-dialog .ap-total-row > span { color: #667c85; font-size: .67rem; }
.ap-workbench-dialog .ap-total-row strong { font-size: .78rem; text-align: right; }
.ap-workbench-dialog .ap-total-row .ap-input { min-height: 33px; text-align: right; }
.ap-workbench-dialog .ap-reconcile-status { min-height: 100%; }
.ap-workbench-dialog .ap-reconcile-status label { display: block; font-size: .64rem; margin-top: 10px; text-align: left; }
.ap-dialog-gates { display: grid; gap: 7px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
.ap-dialog-gate { border: 1px solid #e0c3bd; border-radius: 8px; display: grid; gap: 2px; padding: 8px 10px; }
.ap-dialog-gate strong { color: #963f37; font-size: .68rem; }
.ap-dialog-gate span { color: #687c84; font-size: .61rem; }
.ap-dialog-gate.is-pass { background: #f1f8f3; border-color: #c4ddcb; }
.ap-dialog-gate.is-pass strong { color: #33734c; }
.ap-dialog-gate.is-warning { background: #fff8e5; border-color: #e9d189; }
.ap-dialog-gate.is-warning strong { color: #8a650e; }
.ap-reconcile-status--warning { background: #fff8e5; border-color: #e9d189; color: #795b13; }

@media (max-width: 900px) {
    .ap-line-settings-grid,
    .ap-workbench-dialog .ap-reconciliation,
    .ap-dialog-gates { grid-template-columns: 1fr; }
    .ap-workbench-dialog .ap-match-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
