:root {
    color-scheme: light only;
    --navy-950: #0b192c;
    --navy-900: #0f233c;
    --navy-800: #163254;
    --navy-700: #1e426e;
    --ink: #142233;
    --ink-soft: #2c3e52;
    --muted: #56687c;
    --muted-light: #7c8da1;
    --line: #dbe3ec;
    --line-strong: #c4d0de;
    --surface: #ffffff;
    --surface-subtle: #f7f9fc;
    --background: #f2f5f9;
    --blue: #1a4d8f;
    --blue-dark: #13396b;
    --focus: #2563eb;
    --shadow-sm: 0 1px 2px rgba(15, 35, 60, .05), 0 1px 3px rgba(15, 35, 60, .04);
    --shadow-md: 0 4px 14px rgba(15, 35, 60, .07), 0 1px 3px rgba(15, 35, 60, .05);
    --shadow-lg: 0 16px 40px rgba(15, 35, 60, .10), 0 2px 6px rgba(15, 35, 60, .05);
    --radius-sm: .45rem;
    --radius-md: .7rem;
    --radius-lg: .95rem;
    --inset: clamp(1rem, 3.5vw, 2.25rem);
    font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
    color: var(--ink);
    background: var(--background);
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: .95rem;
    line-height: 1.48;
    color: var(--ink);
    background: var(--background);
    cursor: default;
    caret-color: var(--navy-900);
}
main { flex: 1 0 auto; width: 100%; }
a { color: var(--blue); text-underline-offset: .2em; cursor: pointer; }
button, input, select { font: inherit; color-scheme: light only; }
button, select, summary { cursor: pointer; }
input:not([type=checkbox]) {
    cursor: url("text-cursor.svg") 10 12, text;
    caret-color: var(--navy-900);
}
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
h1 { font-size: clamp(1.55rem, 3vw, 2.15rem); font-weight: 760; letter-spacing: -.03em; line-height: 1.18; color: var(--navy-900); }
h2 { font-size: 1.18rem; font-weight: 720; letter-spacing: -.02em; color: var(--navy-900); }
h3 { font-size: 1.04rem; font-weight: 700; color: var(--navy-900); }

.icon { width: 1.08rem; height: 1.08rem; flex: none; display: inline-block; }
.container {
    width: 100%;
    max-width: 84rem;
    margin-inline: auto;
    padding-inline: var(--inset);
    padding-left: max(var(--inset), env(safe-area-inset-left));
    padding-right: max(var(--inset), env(safe-area-inset-right));
}
.muted { color: var(--muted); font-size: .85rem; }
.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; }
.skip-link {
    position: absolute;
    top: .6rem;
    left: .6rem;
    z-index: 100;
    padding: .55rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--navy-900);
    font-weight: 650;
    box-shadow: var(--shadow-md);
    transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

/* Executive Top Header */
.site-header {
    padding-top: env(safe-area-inset-top);
    background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 55%, var(--navy-800) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 2px 10px rgba(11, 25, 44, .18);
    color: #fff;
}
.header-content {
    min-height: 4.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: .72rem;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}
.brand-mark {
    position: relative;
    flex: none;
    width: 2.3rem;
    height: 2.25rem;
    overflow: hidden;
    border-radius: .5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .28), 0 0 0 1px rgba(255, 255, 255, .14);
}
.brand-mark img {
    position: absolute;
    top: -7.7%;
    left: -8.75%;
    width: 117.5%;
    height: 107.7%;
}
.brand-text { display: grid; gap: .08rem; line-height: 1.1; }
.brand-text strong { font-size: .96rem; font-weight: 800; letter-spacing: .06em; color: #ffffff; }
.brand-text small { color: #b7c9dc; font-size: .76rem; font-weight: 600; letter-spacing: .01em; }
.brand-divider {
    width: 1px;
    height: 1.65rem;
    background: rgba(255, 255, 255, .18);
    margin-inline: .15rem;
}
.brand-scope {
    color: #c9d8e8;
    font-size: .82rem;
    font-weight: 560;
    letter-spacing: .01em;
}

.account { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.account-badge {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    max-width: 18rem;
    padding: .34rem .7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .14);
    color: #e6eef7;
    font-size: .82rem;
    font-weight: 580;
}
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-role {
    flex: none;
    padding: .08rem .42rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .15);
    color: #ffffff;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.logout-form { margin: 0; }
.install-action[hidden] { display: none; }

/* Buttons & Form Controls */
.button {
    min-height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    padding: .44rem .88rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: .86rem;
    font-weight: 640;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .12s ease;
}
.button-header {
    color: #f1f6fb;
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .2);
}
.button-header:hover {
    background: rgba(255, 255, 255, .19);
    border-color: rgba(255, 255, 255, .34);
}
.button-outline {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line-strong);
}
.button-outline:hover {
    background: var(--surface-subtle);
    border-color: #a9b9cc;
}
.button-utility {
    color: var(--ink-soft);
    background: var(--surface);
    border-color: var(--line);
    box-shadow: 0 1px 2px rgba(15, 35, 60, .03);
}
.button-utility:hover {
    color: var(--navy-900);
    background: var(--surface-subtle);
    border-color: var(--line-strong);
}
.button-excel {
    color: #0b5d3f;
    background: #eefaf4;
    border-color: #b7e4cf;
    box-shadow: 0 1px 2px rgba(11, 93, 63, .06);
}
.button-excel:hover {
    color: #084a32;
    background: #dff4ea;
    border-color: #8fd4b5;
}
.button-excel.is-disabled {
    opacity: .5;
    pointer-events: none;
}
.button-danger-ghost {
    color: #a61e36;
    background: transparent;
    border-color: transparent;
    padding-inline: .6rem;
}
.button-danger-ghost:hover {
    background: #fff0f2;
    border-color: #f6c9d2;
}
.button-danger-ghost[hidden] { display: none; }
.button-primary {
    color: #fff;
    background: linear-gradient(180deg, var(--navy-700) 0%, var(--navy-900) 100%);
    border-color: var(--navy-900);
    box-shadow: 0 2px 6px rgba(15, 35, 60, .2);
}
.button-primary:hover {
    background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-950) 100%);
    box-shadow: 0 4px 10px rgba(15, 35, 60, .26);
}
.button-lg { min-height: 2.85rem; font-size: .94rem; border-radius: .55rem; }

input:not([type=checkbox]), select {
    width: 100%;
    min-width: 0;
    min-height: 2.55rem;
    padding: .5rem .78rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--ink);
    background: var(--surface);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
input:not([type=checkbox]):hover, select:hover { border-color: #9eb1c6; }
input:not([type=checkbox]):focus, select:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* Overview & Executive KPI Summary */
.overview { padding-top: clamp(1.35rem, 3vw, 2.15rem); }
.overview-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .65rem 1rem;
}
.overview-title { display: grid; gap: .2rem; }
.eyebrow {
    font-size: .72rem;
    font-weight: 740;
    letter-spacing: .09em;
    color: var(--blue);
    text-transform: uppercase;
}
.today {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .46rem .82rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: .86rem;
    font-weight: 640;
    box-shadow: var(--shadow-sm);
}
.today .icon { color: var(--blue); }

.summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
    margin-top: 1.15rem;
}
.summary-card {
    position: relative;
    display: grid;
    align-content: space-between;
    gap: .45rem;
    min-width: 0;
    padding: .92rem 1.05rem .85rem;
    border: 1px solid var(--line);
    border-top: 3.5px solid var(--accent);
    border-radius: var(--radius-md);
    color: var(--ink);
    background: var(--surface);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease;
}
.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-soft);
    background: var(--surface);
}
.summary-card[aria-current=true] {
    background: linear-gradient(180deg, var(--tint) 0%, #ffffff 78%);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}
.summary-top {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.summary-icon {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: .45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    background: var(--tint);
    color: var(--badge);
}
.summary-card[aria-current=true] .summary-icon {
    background: var(--accent);
    color: #fff;
}
.summary-label {
    color: var(--ink-soft);
    font-size: .84rem;
    font-weight: 680;
    line-height: 1.25;
}
.summary-card[aria-current=true] .summary-label { color: var(--badge); }
.summary-active-dot {
    margin-left: auto;
    width: .5rem;
    height: .5rem;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    flex: none;
}
.summary-value {
    font-size: clamp(1.15rem, 2.1vw, 1.6rem);
    font-weight: 780;
    line-height: 1.2;
    letter-spacing: -.025em;
    color: var(--navy-900);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.summary-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .4rem;
    font-size: .78rem;
    line-height: 1.2;
}
.summary-meta { color: var(--muted); font-weight: 620; font-variant-numeric: tabular-nums; }
.summary-share { color: var(--badge); font-weight: 680; font-variant-numeric: tabular-nums; }
.summary-meter {
    width: 100%;
    height: .28rem;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    background: #eaeff5;
    appearance: none;
    -webkit-appearance: none;
}
.summary-meter::-webkit-progress-bar { background: #eaeff5; border-radius: 999px; }
.summary-meter::-webkit-progress-value { background: var(--accent); border-radius: 999px; transition: width .25s ease; }
.summary-meter::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

/* Semantic Status Palette */
.summary-total { --accent: #1d5fd1; --tint: #eef4ff; --badge: #174494; --accent-soft: #c9dcff; }
.payment-row, .payment-detail-row, .schedule-item { --accent: #7e90a4; --tint: #f1f4f8; --badge: #42566b; --accent-soft: #d9e2ec; }
.summary-today, .payment-row.due-today, .payment-detail-row.due-today, .schedule-item.due-today { --accent: #0c8c62; --tint: #ebfaf3; --badge: #0a5e42; --accent-soft: #bdebd7; }
.summary-upcoming, .payment-row.upcoming, .payment-detail-row.upcoming, .schedule-item.upcoming { --accent: #d97706; --tint: #fff7e6; --badge: #8a4b06; --accent-soft: #fbd9a2; }
.summary-overdue, .payment-row.overdue, .payment-detail-row.overdue, .schedule-item.overdue { --accent: #cf2942; --tint: #fff0f2; --badge: #981b31; --accent-soft: #f9c7d0; }

/* Payments Workspace */
.payments {
    padding-block: 1.05rem 2.5rem;
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
}
.payments-toolbar {
    display: grid;
    gap: .62rem;
    padding: .78rem 1rem;
    margin-bottom: .75rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.payments-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .6rem 1rem;
}
.payments-title-group { display: grid; gap: .12rem; }
.toolbar-utilities { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.payment-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .65rem;
}
.filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem;
    flex: 1 1 28rem;
    min-width: 0;
}
.search-box {
    position: relative;
    flex: 1 1 16rem;
    max-width: 24rem;
    min-width: 11rem;
}
.search-icon {
    position: absolute;
    left: .78rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.02rem;
    height: 1.02rem;
    color: var(--muted-light);
    pointer-events: none;
}
.search-box input[type=search] {
    padding-left: 2.35rem;
    padding-right: 3.1rem;
    background: var(--surface-subtle);
}
.search-box input[type=search]:focus { background: var(--surface); }
.search-clear {
    position: absolute;
    right: .45rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.search-clear:hover { background: #e5ecf3; color: var(--ink); }
.search-clear[hidden] { display: none; }
.search-hint {
    position: absolute;
    right: .62rem;
    top: 50%;
    transform: translateY(-50%);
    padding: .1rem .38rem;
    border: 1px solid var(--line-strong);
    border-radius: .3rem;
    background: var(--surface);
    color: var(--muted-light);
    font-family: inherit;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.2;
    pointer-events: none;
}
.search-box:focus-within .search-hint,
.search-box.has-value .search-hint { display: none; }

.type-box { position: relative; flex: 1 1 15rem; max-width: 21rem; min-width: 12rem; }
.multi-select { position: relative; width: 100%; }
.multi-select-trigger {
    list-style: none;
    min-height: 2.55rem;
    padding: .46rem .75rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-subtle);
    color: var(--ink);
    font-size: .86rem;
    font-weight: 560;
    display: flex;
    align-items: center;
    gap: .45rem;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.multi-select-trigger::-webkit-details-marker { display: none; }
.multi-select-trigger:hover { border-color: #9eb1c6; }
.multi-select[open] > .multi-select-trigger,
.multi-select-trigger:focus-visible {
    outline: none;
    border-color: var(--focus);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.multi-select.has-selection > .multi-select-trigger {
    border-color: #94b8ef;
    background: #f2f7ff;
    color: var(--navy-900);
}
.multi-select-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.multi-select-badge {
    flex: none;
    min-width: 1.35rem;
    height: 1.35rem;
    padding-inline: .35rem;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: .74rem;
    font-weight: 720;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}
.multi-select-caret {
    flex: none;
    width: .98rem;
    height: .98rem;
    color: var(--muted);
    transition: transform .16s ease;
}
.multi-select[open] .multi-select-caret { transform: rotate(180deg); }
.multi-select-panel {
    position: absolute;
    top: calc(100% + .35rem);
    left: 0;
    z-index: 40;
    width: min(24rem, calc(100vw - 2rem));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.multi-select-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .62rem .8rem;
    background: #f5f8fc;
    border-bottom: 1px solid var(--line);
    font-size: .78rem;
    font-weight: 720;
    color: var(--ink-soft);
}
.multi-select-head-actions { display: flex; align-items: center; gap: .45rem; }
.multi-select-clear,
.multi-select-close {
    padding: .18rem .46rem;
    border: 1px solid transparent;
    border-radius: .3rem;
    background: transparent;
    font-size: .76rem;
    font-weight: 660;
    cursor: pointer;
}
.multi-select-clear { color: #b4233b; }
.multi-select-clear:hover { background: #fff0f2; }
.multi-select-clear[hidden] { display: none; }
.multi-select-close { color: var(--blue); border-color: #d4e1f0; background: var(--surface); }
.multi-select-close:hover { background: #eef4fc; }
.multi-select-list {
    max-height: 18.5rem;
    overflow-y: auto;
    padding: .35rem;
    display: grid;
    gap: .15rem;
}
.multi-select-option {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .46rem .58rem;
    border-radius: .38rem;
    font-size: .83rem;
    color: var(--ink);
    cursor: pointer;
    transition: background-color .12s ease;
}
.multi-select-option:hover { background: #f2f6fb; }
.multi-select-option.is-checked { background: #ebf3ff; color: var(--navy-900); font-weight: 620; }
.multi-select-option input[type=checkbox] {
    flex: none;
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--blue);
    cursor: pointer;
}
.multi-select-name { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.multi-select-search { padding: .4rem .45rem 0; }
.multi-select-search input {
    width: 100%;
    padding: .38rem .55rem;
    border: 1px solid var(--line-strong);
    border-radius: .34rem;
    font: inherit;
    font-size: .82rem;
}
.multi-select-search input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.multi-select-option[hidden], .multi-select-empty[hidden] { display: none; }
.multi-select-empty { padding: .5rem .6rem; color: var(--muted); font-size: .8rem; }
.multi-select-count {
    flex: none;
    padding: .08rem .42rem;
    border-radius: 999px;
    background: #eef2f7;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 680;
    font-variant-numeric: tabular-nums;
}
.multi-select-option.is-checked .multi-select-count { background: #d6e5ff; color: var(--blue-dark); }

.amount-box { position: relative; flex: 0 1 11.5rem; min-width: 9.25rem; }
.amount-filter-panel { width: min(21rem, calc(100vw - 2rem)); }
.amount-filter-body {
    padding: .75rem .82rem .8rem;
    display: grid;
    gap: .75rem;
}
.amount-group {
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    gap: .36rem;
}
.amount-group legend {
    padding: 0;
    font-size: .79rem;
    font-weight: 700;
    color: var(--navy-900);
}
.amount-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: .38rem;
}
.amount-field { display: grid; gap: .2rem; }
.amount-field label {
    font-size: .72rem;
    font-weight: 640;
    color: var(--muted);
}
.amount-field input {
    min-height: 2.18rem;
    padding: .32rem .55rem;
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
}
.amount-sep {
    padding-bottom: .45rem;
    color: var(--muted-light);
    font-weight: 700;
}
.amount-hint {
    font-size: .72rem;
    color: var(--muted);
    line-height: 1.35;
}

.sort-box { flex: 0 1 14.25rem; min-width: 10.5rem; }
.sort-box select {
    background-color: var(--surface-subtle);
    font-size: .86rem;
    font-weight: 560;
    cursor: pointer;
}
.sort-box select:focus { background-color: var(--surface); }

.view-choice {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    padding: .18rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--background);
}
.view-choice[hidden] { display: none; }
.view-choice button {
    min-height: 2.15rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .72rem;
    border: 1px solid transparent;
    border-radius: .34rem;
    background: transparent;
    color: var(--muted);
    font-size: .84rem;
    font-weight: 650;
    cursor: pointer;
    transition: background-color .14s ease, color .14s ease, box-shadow .14s ease;
}
.view-choice button:hover { color: var(--ink); }
.view-choice button[aria-pressed=true] {
    border-color: var(--line);
    background: var(--surface);
    color: var(--navy-900);
    box-shadow: 0 1px 2px rgba(15, 35, 60, .07);
}

/* Active Filter Context Strip */
.active-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem .85rem;
    padding-top: .75rem;
    border-top: 1px solid #edf2f7;
    font-size: .82rem;
}
.active-filter-bar[hidden] { display: none; }
.active-filter-chips { display: flex; align-items: center; flex-wrap: wrap; gap: .42rem; }
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    padding: .22rem .58rem;
    border-radius: 999px;
    background: #eef3f9;
    border: 1px solid #d6e1ee;
    color: var(--ink-soft);
}
.filter-chip strong { color: var(--navy-900); font-weight: 680; }
.filter-chip-removable { padding-right: .32rem; }
.chip-remove {
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.chip-remove:hover { background: #d6e1ee; color: var(--navy-900); }
.reset-filters {
    color: var(--blue);
    font-weight: 660;
    text-decoration: none;
    white-space: nowrap;
}
.reset-filters:hover { text-decoration: underline; }

/* Error & Loading States */
.filter-error {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .72rem .95rem;
    margin-bottom: .75rem;
    border-radius: var(--radius-sm);
    border: 1px solid #f4c2cc;
    background: #fff1f3;
    color: #981b31;
    font-size: .88rem;
    font-weight: 600;
}
.filter-error[hidden] { display: none; }

.payment-display {
    position: relative;
    transition: opacity .16s ease;
}
.payment-display[aria-busy="true"] { opacity: .62; pointer-events: none; }
.payment-display[aria-busy="true"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 5;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--blue), transparent);
    animation: loading-slide 1.1s ease-in-out infinite;
}
@keyframes loading-slide {
    0% { transform: translateX(-60%); }
    100% { transform: translateX(60%); }
}

/* Corporate Data Table */
.table-shell {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.payment-list {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
}
.payment-list th, .payment-list td {
    padding: .6rem clamp(.42rem, .85vw, .78rem);
    vertical-align: middle;
}
.payment-list thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    text-align: left;
    color: var(--muted);
    background: #f4f7fb;
    border-bottom: 1px solid var(--line);
    font-size: .78rem;
    font-weight: 740;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.payment-list .amount-column { text-align: right; }
.payment-list tbody .payment-row > * { border-top: 1px solid #edf1f6; }
.payment-list tbody .payment-row:first-child > * { border-top: 0; }
.payment-list tbody .payment-row {
    transition: background-color .12s ease;
    content-visibility: auto;
    contain-intrinsic-size: auto 3.8rem;
}
.payment-list tbody .payment-row:hover { background: #f8fafd; }
.payment-list tbody .payment-row.is-favorite { background: #fffdf4; }
.payment-list tbody .payment-row.is-favorite:hover { background: #fef9e7; }
.payment-list tbody .payment-row.is-expanded { background: #f6f9fd; }
.payment-list .supplier-cell {
    width: auto;
    max-width: 24rem;
    border-left: 3.5px solid var(--accent);
    text-align: left;
    overflow-wrap: anywhere;
}
.supplier-wrap { display: flex; align-items: center; gap: .55rem; }
.supplier-info { min-width: 0; display: grid; gap: .16rem; }
.supplier-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .28rem .4rem;
}
.meta-icon-btn {
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: .34rem;
    background: var(--surface);
    color: var(--muted-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease, transform .12s ease;
}
.meta-icon-btn .icon { width: .88rem; height: .88rem; }
.meta-icon-btn:hover { border-color: var(--line-strong); color: var(--ink); background: #f3f6fa; }
.fav-btn.is-active {
    background: #fff6db;
    border-color: #f0c351;
    color: #d97706;
}
.fav-btn.is-active:hover { background: #ffefc2; border-color: #e0aa2b; }
.lock-btn.is-active {
    background: #fff0f2;
    border-color: #ef99a8;
    color: #b4233b;
}
.lock-btn.is-active:hover { background: #ffe1e6; border-color: #dc6e82; }
.meta-indicator {
    flex: none;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: .3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.meta-indicator .icon { width: .82rem; height: .82rem; }
.meta-indicator-fav { background: #fff6db; color: #d97706; }
.meta-indicator-lock { background: #fff0f2; color: #b4233b; }
.supplier-code {
    display: inline-block;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    font-size: .75rem;
    font-weight: 680;
    letter-spacing: .02em;
    line-height: 1.2;
}
.payment-type-tag {
    display: inline-block;
    max-width: 14rem;
    padding: .08rem .42rem;
    border-radius: .28rem;
    background: #eef3f9;
    border: 1px solid #d7e2ee;
    color: #2f4b6b;
    font-size: .7rem;
    font-weight: 660;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.supplier-name {
    display: block;
    color: var(--ink);
    font-size: .93rem;
    font-weight: 680;
    line-height: 1.28;
}
.installment-cell { width: 9rem; max-width: 11rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.installment-badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    border-radius: .34rem;
    background: #f0f4f9;
    border: 1px solid #d5e0ec;
    color: var(--navy-900);
    font-size: .81rem;
    font-weight: 680;
    line-height: 1.25;
    white-space: normal;
}
.installment-empty { color: var(--muted-light); font-size: .85rem; }

/* Expandable Detail Controls */
.detail-toggle {
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: .38rem;
    background: var(--surface);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.detail-toggle:hover { background: #edf3f9; border-color: var(--line-strong); color: var(--navy-900); }
.detail-toggle[aria-expanded="true"] {
    background: var(--navy-900);
    border-color: var(--navy-900);
    color: #fff;
}
.detail-spacer { flex: none; width: 1.75rem; }
.chevron-icon { width: .95rem; height: .95rem; transition: transform .18s ease; }
.detail-toggle[aria-expanded="true"] .chevron-icon { transform: rotate(90deg); }

.status {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    padding: .24rem .58rem;
    border-radius: 999px;
    color: var(--badge);
    background: var(--tint);
    border: 1px solid var(--accent-soft);
    font-size: .8rem;
    font-weight: 680;
    line-height: 1.25;
    white-space: nowrap;
}
.status-sm { padding: .16rem .46rem; font-size: .75rem; }
.status-editable {
    cursor: pointer;
    transition: filter .14s ease, box-shadow .14s ease, transform .12s ease;
}
.status-editable:hover {
    filter: brightness(.96);
    box-shadow: 0 1px 4px rgba(15, 35, 60, .12);
}
.status-editable.is-manual {
    box-shadow: inset 0 0 0 1px var(--accent);
}
.status-edit-icon {
    width: .78rem;
    height: .78rem;
    opacity: .72;
    flex: none;
}
.status-editable:hover .status-edit-icon { opacity: 1; }
.status-dot {
    width: .42rem;
    height: .42rem;
    border-radius: 999px;
    background: var(--accent);
    flex: none;
}

.due-cell { color: var(--ink-soft); font-size: .88rem; font-weight: 560; white-space: nowrap; font-variant-numeric: tabular-nums; }
.primary-amount, .total-amount, .footer-amount, .schedule-amount { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.primary-amount { color: var(--badge); font-size: 1.02rem; font-weight: 760; letter-spacing: -.015em; }
.total-amount { display: block; color: var(--ink); font-size: .96rem; font-weight: 680; }
.payment-count { display: block; margin-top: .08rem; color: var(--muted); font-size: .76rem; }
.payment-count-link {
    margin-top: .12rem;
    padding: .1rem .35rem;
    margin-right: -.35rem;
    border: 0;
    border-radius: .3rem;
    background: transparent;
    color: var(--blue);
    font-size: .76rem;
    font-weight: 660;
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    cursor: pointer;
}
.payment-count-link:hover { background: #eaf1fc; color: var(--blue-dark); }
.payment-count-link[aria-expanded="true"] .chevron-icon { transform: rotate(180deg); }
.mobile-label { display: none; }

/* Row Action Buttons (Portal Info + External Link) */
.payment-list .actions-column { width: 1%; text-align: center; white-space: nowrap; }
.actions-cell { width: 1%; white-space: nowrap; text-align: right; }
.row-actions {
    display: inline-grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .26rem;
    width: 8.35rem;
}
.action-btn {
    width: 100%;
    min-height: 1.72rem;
    padding: .2rem .44rem;
    border: 1px solid var(--line-strong);
    border-radius: .36rem;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: .73rem;
    font-weight: 650;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .28rem;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.action-btn .icon { width: .82rem; height: .82rem; }
.action-locked {
    background: #f4f6f9;
    border-color: var(--line);
    color: var(--muted-light);
    cursor: default;
}
.action-edit:hover {
    background: #eef4fc;
    border-color: #9ebae2;
    color: var(--navy-900);
}
.action-edit.has-info {
    background: #eef4ff;
    border-color: #a9c6f5;
    color: #174494;
}
.action-edit.has-info:hover {
    background: #dfeaff;
    border-color: #7ea8ec;
}
.action-link {
    background: var(--navy-900);
    border-color: var(--navy-900);
    color: #fff;
}
.action-link:hover {
    background: var(--navy-700);
    border-color: var(--navy-700);
    color: #fff;
}
.action-link.is-disabled {
    background: #f2f5f9;
    border-color: var(--line);
    color: var(--muted-light);
    pointer-events: none;
    cursor: default;
}

/* Corporate Portal Modal */
.portal-modal {
    width: min(100% - 1.5rem, 30rem);
    padding: 0;
    border: 1px solid var(--line-strong);
    border-top: 4px solid var(--navy-900);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 24px 60px rgba(11, 25, 44, .28);
    overflow: hidden;
}
.portal-modal::backdrop {
    background: rgba(11, 25, 44, .52);
    backdrop-filter: blur(2px);
}
.portal-modal-form { display: grid; }
.portal-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: 1.05rem 1.2rem .9rem;
    background: #f7f9fc;
    border-bottom: 1px solid var(--line);
}
.portal-modal-eyebrow {
    display: block;
    font-size: .68rem;
    font-weight: 760;
    letter-spacing: .09em;
    color: var(--blue);
    margin-bottom: .15rem;
}
.portal-modal-head h2 { font-size: 1.1rem; line-height: 1.25; }
.portal-modal-head p { margin-top: .18rem; font-size: .8rem; }
.portal-modal-close {
    flex: none;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: .4rem;
    background: transparent;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.portal-modal-close:hover { background: #e6edf5; color: var(--navy-900); }
.portal-modal-body {
    padding: 1.05rem 1.2rem;
    display: grid;
    gap: .82rem;
}
.portal-field { display: grid; gap: .32rem; }
.portal-field label { font-size: .82rem; font-weight: 660; color: var(--ink-soft); }
.portal-input-row {
    display: flex;
    align-items: center;
    gap: .38rem;
}
.portal-input-row input { flex: 1 1 auto; }
.portal-icon-btn {
    flex: none;
    width: 2.45rem;
    height: 2.55rem;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-subtle);
    color: var(--ink-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.portal-icon-btn:hover { background: #e9f0f8; border-color: #9eb1c6; color: var(--navy-900); }
.portal-feedback {
    padding: .58rem .78rem;
    border-radius: var(--radius-sm);
    font-size: .82rem;
    font-weight: 600;
}
.portal-feedback[hidden] { display: none; }
.portal-feedback-error {
    background: #fff0f2;
    border: 1px solid #f4c2cc;
    color: #981b31;
}
.portal-feedback-info {
    background: #ebfaf3;
    border: 1px solid #bdebd7;
    color: #0a5e42;
}
.portal-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .85rem 1.2rem;
    background: #f7f9fc;
    border-top: 1px solid var(--line);
}
.portal-modal-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.due-modal { width: min(100% - 1.5rem, 26rem); }
.due-help-box {
    padding: .68rem .82rem;
    border-radius: var(--radius-sm);
    background: #eef4fc;
    border: 1px solid #d0e1f7;
    color: var(--ink-soft);
    font-size: .8rem;
    line-height: 1.48;
}
.due-help-box code {
    padding: .05rem .32rem;
    border-radius: .25rem;
    background: #fff;
    border: 1px solid #c7daf3;
    color: var(--navy-900);
    font-family: inherit;
    font-weight: 740;
}
input[readonly] {
    background: #f4f7fb;
    color: var(--ink);
}

/* Expanded Due-Date Breakdown Panel */
.payment-detail-row[hidden] { display: none; }
.payment-detail-row td {
    padding: 0;
    background: #f8fafd;
    border-top: 1px dashed #d6e0ec;
    border-left: 3.5px solid var(--accent);
}
.schedule-panel {
    padding: .8rem 1.15rem .95rem 3.2rem;
    display: grid;
    gap: .55rem;
}
.schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .4rem 1rem;
    font-size: .8rem;
    color: var(--muted);
}
.schedule-title { font-weight: 700; color: var(--ink-soft); }
.schedule-total strong { color: var(--navy-900); font-variant-numeric: tabular-nums; }
.schedule-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: .35rem;
}
.schedule-item {
    display: grid;
    grid-template-columns: minmax(7.5rem, 1.1fr) minmax(8rem, 1.2fr) minmax(4.5rem, .7fr) minmax(7rem, 1fr);
    align-items: center;
    gap: .5rem .85rem;
    padding: .46rem .72rem;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid #e4ebf3;
    border-left: 3px solid var(--accent);
    font-size: .84rem;
}
.schedule-item-no-amount {
    grid-template-columns: minmax(7.5rem, 1.1fr) minmax(8rem, 1.3fr) minmax(4.5rem, .8fr);
}
.schedule-item .status { justify-self: start; }
.schedule-date { font-weight: 640; color: var(--ink); font-variant-numeric: tabular-nums; }
.schedule-count { color: var(--muted); font-size: .78rem; text-align: right; }
.schedule-amount { color: var(--navy-900); font-weight: 730; text-align: right; }

/* Table Footer Summary */
.payment-list tfoot .payment-footer-row > * {
    background: #f2f6fb;
    border-top: 2px solid var(--line-strong);
    padding-block: .82rem;
    color: var(--navy-900);
}
.payment-list tfoot th { text-align: left; font-size: .84rem; font-weight: 700; color: var(--ink-soft); }
.footer-amount { font-size: .96rem; font-weight: 720; color: var(--ink); }
.footer-amount-strong { font-size: 1.04rem; font-weight: 780; color: var(--navy-900); }

/* Empty, Error & Status Panels */
.empty, .status-panel {
    padding: clamp(2rem, 5vw, 3.2rem) 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    text-align: center;
    color: var(--muted);
    box-shadow: var(--shadow-sm);
    display: grid;
    justify-items: center;
    gap: .6rem;
}
.empty-icon { width: 2.5rem; height: 2.5rem; color: var(--muted-light); margin-bottom: .15rem; }
.empty-reset { margin-top: .5rem; }

.status-panel {
    width: min(100%, 30rem);
    margin: clamp(2.5rem, 10vh, 5.5rem) auto 2rem;
    box-shadow: var(--shadow-md);
}
.status-panel h1 { font-size: 1.45rem; }
.status-panel .button { margin-top: .65rem; }
.status-panel-icon {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 999px;
    background: #edf3fa;
    color: var(--blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .2rem;
}
.status-panel-icon .icon { width: 1.6rem; height: 1.6rem; }
.status-panel-danger { background: #fff0f2; color: #cf2942; }

/* Corporate Login Page */
.page-login {
    background: radial-gradient(circle at 18% 12%, #e6eef8 0%, transparent 45%),
                radial-gradient(circle at 82% 88%, #e9f0f7 0%, transparent 45%),
                var(--background);
}
.login-shell {
    display: grid;
    place-items: center;
    padding-block: clamp(1.75rem, 7vh, 4.5rem) 2rem;
}
.login-card {
    width: min(100%, 28.5rem);
    padding: clamp(1.6rem, 4.5vw, 2.35rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--navy-900);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.login-brand {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: 1rem;
}
.brand-mark-lg { width: 2.85rem; height: 2.75rem; border-radius: .6rem; }
.login-eyebrow {
    display: block;
    font-size: .7rem;
    font-weight: 760;
    letter-spacing: .09em;
    color: var(--blue);
    margin-bottom: .15rem;
}
.login-card h1 { font-size: 1.48rem; }
.login-lead { color: var(--muted); font-size: .88rem; line-height: 1.5; margin-bottom: 1.35rem; }
.login-form, .field { display: grid; gap: .42rem; }
.login-form { gap: 1rem; }
.field > label { font-size: .85rem; font-weight: 660; color: var(--ink-soft); }
.input-icon-wrap { position: relative; }
.field-icon {
    position: absolute;
    left: .8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.05rem;
    height: 1.05rem;
    color: var(--muted-light);
    pointer-events: none;
}
.input-icon-wrap input { padding-left: 2.4rem; min-height: 2.75rem; }
.input-icon-wrap.has-toggle input { padding-right: 2.75rem; }
.password-toggle {
    position: absolute;
    right: .4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: .38rem;
    background: transparent;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.password-toggle:hover { background: #edf2f7; color: var(--ink); }
.password-toggle[hidden] { display: none; }
.login-form button[type=submit] { margin-top: .35rem; width: 100%; }
.login-note {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin-top: 1.35rem;
    padding-top: 1.05rem;
    border-top: 1px solid #edf2f7;
    color: var(--muted);
    font-size: .79rem;
    line-height: 1.45;
}
.login-note .icon { color: var(--blue); margin-top: .1rem; }

.validation-summary-errors {
    padding: .72rem .9rem;
    border-radius: var(--radius-sm);
    border: 1px solid #f5c2cb;
    background: #fff1f3;
    color: #981b31;
    font-size: .86rem;
    font-weight: 560;
}
.validation-summary-errors ul { padding-left: 1.15rem; }
.field-validation-error { color: #b4233b; font-size: .82rem; font-weight: 560; }
.validation-summary-valid, .field-validation-valid { display: none; }

/* Floating Back-to-Top */
.back-to-top {
    position: fixed;
    right: max(1.15rem, env(safe-area-inset-right));
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    z-index: 30;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 999px;
    background: var(--navy-900);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(15, 35, 60, .26);
    transition: transform .16s ease, background-color .16s ease;
}
.back-to-top:hover { background: var(--navy-700); transform: translateY(-2px); }
.back-to-top[hidden] { display: none; }

/* Institutional Footer */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: .8rem;
}
.footer-content {
    min-height: 3.1rem;
    padding-block: .65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .35rem 1rem;
}

/* Responsive Tablet & Mobile */
@media (max-width: 64rem) {
    .brand-divider, .brand-scope { display: none; }
    .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 48rem) {
    .header-content { min-height: 3.35rem; }
    .brand-mark { width: 1.95rem; height: 1.9rem; }
    .brand-text strong { font-size: .88rem; }
    .brand-text small { font-size: .7rem; }

    .overview { padding-top: .7rem; }
    .eyebrow { font-size: .65rem; }
    h1 { font-size: 1.32rem; }
    .today { padding: .3rem .6rem; font-size: .76rem; }
    .summary { gap: .42rem; margin-top: .55rem; }
    .summary-card { padding: .52rem .64rem .5rem; gap: .2rem; }
    .summary-top { gap: .38rem; }
    .summary-icon { width: 1.35rem; height: 1.35rem; border-radius: .35rem; }
    .summary-icon .icon { width: .82rem; height: .82rem; }
    .summary-label { font-size: .74rem; }
    .summary-value { font-size: 1rem; }
    .summary-foot { font-size: .69rem; }
    .summary-meter { height: .22rem; }

    .payments { padding-top: .72rem; }
    .payments-toolbar { padding: .58rem .68rem; gap: .45rem; margin-bottom: .58rem; }
    .payments-heading { flex-wrap: wrap; align-items: center; gap: .38rem .5rem; }
    .payments-title-group { flex: 1 1 12rem; min-width: 0; gap: .08rem; }
    .payments-title-group h2 { font-size: .98rem; line-height: 1.2; }
    .payments-title-group .muted { font-size: .74rem; line-height: 1.3; white-space: normal; }
    .toolbar-utilities { width: auto; flex: none; gap: .32rem; margin-left: auto; }
    .toolbar-utilities .button { min-height: 2rem; padding: .28rem .6rem; font-size: .76rem; }

    .payment-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .38rem;
    }
    .filters { display: contents; }
    .search-box { order: 1; flex: 1 1 9.5rem; max-width: none; min-width: 0; }
    .search-box input[type=search] { min-height: 2.12rem; padding: .32rem 1.9rem .32rem 1.95rem; font-size: .81rem; }
    .search-icon { left: .58rem; width: .92rem; height: .92rem; }
    .search-clear { right: .22rem; width: 1.55rem; height: 1.55rem; }
    .search-hint { display: none; }

    .view-choice { order: 2; flex: none; margin-left: 0; padding: .12rem; }
    .view-choice button { min-height: 1.84rem; padding: .2rem .48rem; gap: .25rem; font-size: .76rem; }
    .view-choice .icon { width: .88rem; height: .88rem; }

    .type-box { order: 3; flex: 1 1 calc(50% - .2rem); max-width: none; min-width: 0; }
    .amount-box { order: 4; flex: 1 1 calc(50% - .2rem); max-width: none; min-width: 0; }
    .multi-select-trigger { min-height: 2.12rem; padding: .3rem .52rem; font-size: .78rem; gap: .26rem; }
    .multi-select-badge { min-width: 1.15rem; height: 1.15rem; font-size: .68rem; }
    .multi-select-panel { width: min(22rem, calc(100vw - 2rem)); }
    .amount-filter-panel { left: auto; right: 0; width: min(20rem, calc(100vw - 2rem)); }

    .sort-box { order: 5; flex: 1 1 100%; min-width: 0; }
    .sort-box select { min-height: 2.12rem; padding: .3rem .52rem; font-size: .78rem; }

    .active-filter-bar { padding-top: .45rem; gap: .32rem .5rem; font-size: .74rem; }
    .filter-chip { padding: .14rem .45rem; }

    .table-shell { overflow: visible; border-radius: var(--radius-md); }
    .payment-list, .payment-list tbody, .payment-list tfoot { display: block; }
    .payment-list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .payment-list .payment-row {
        display: grid;
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        grid-template-areas: "supplier primary" "status due" "installment installment" "total total" "actions actions";
        align-items: start;
        gap: .28rem .55rem;
        padding: .68rem .75rem;
        border-left: 3.5px solid var(--accent);
    }
    .payment-list.no-amounts .payment-row {
        grid-template-areas: "supplier status" "due installment" "total total" "actions actions";
    }
    .payment-list.no-amounts .due-cell { text-align: left; }
    .payment-list.no-amounts .installment-cell { justify-content: flex-end; }
    .payment-list.no-amounts .payment-count-visible { display: inline-block; margin-left: auto; }
    .payment-list tbody .payment-row + .payment-row,
    .payment-list tbody .payment-detail-row + .payment-row { border-top: 1px solid var(--line); }
    .payment-list .payment-row > * { min-width: 0; padding: 0; border: 0; }
    .payment-list .supplier-cell { grid-area: supplier; width: auto; border-left: 0; }
    .detail-toggle, .detail-spacer { display: none; }
    .supplier-name { font-size: .91rem; line-height: 1.22; }
    .installment-cell { grid-area: installment; display: flex; align-items: center; gap: .38rem; width: auto; max-width: none; }
    .installment-cell.is-empty { display: none; }
    .status-cell { grid-area: status; }
    .due-cell { grid-area: due; align-self: center; text-align: right; font-size: .8rem; white-space: normal; }
    .primary-payment { grid-area: primary; align-self: center; }
    .primary-payment .mobile-label { display: block; color: var(--badge); line-height: 1.2; }
    .primary-amount { display: block; font-size: .98rem; line-height: 1.22; }
    .payment-list .total-cell {
        grid-area: total;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: .15rem .45rem;
        padding-top: .38rem;
        border-top: 1px solid #edf1f6;
        text-align: left;
    }
    .total-cell .total-amount { font-size: .88rem; }
    .payment-count { display: none; }
    .payment-count-link { margin-left: auto; margin-top: 0; margin-right: 0; padding: .18rem .45rem; background: #eef4fc; }
    .payment-list .actions-cell {
        grid-area: actions;
        width: 100%;
        padding-top: .38rem;
        border-top: 1px solid #edf1f6;
        text-align: left;
    }
    .row-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; width: 100%; }
    .action-btn { width: 100%; }
    .payment-list tfoot .footer-spacer { display: none; }
    .mobile-label { display: inline-block; color: var(--muted); font-size: .74rem; font-weight: 650; line-height: 1.2; }
    .due-cell .mobile-label { margin-right: .22rem; }

    .payment-detail-row:not([hidden]) { display: block; }
    .payment-detail-row td { display: block; border-top: 1px dashed #d6e0ec; }
    .schedule-panel { padding: .68rem .75rem .78rem; }
    .schedule-item {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: .22rem .5rem;
        padding: .46rem .58rem;
    }
    .schedule-count { display: none; }
    .schedule-amount { grid-column: 2; grid-row: 1; }
    .schedule-item .status { grid-column: 1 / -1; justify-self: start; }

    .payment-list tfoot .payment-footer-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .4rem .65rem;
        padding: .75rem;
        background: #f2f6fb;
        border-top: 2px solid var(--line-strong);
        border-bottom-left-radius: var(--radius-md);
        border-bottom-right-radius: var(--radius-md);
    }
    .payment-list tfoot .payment-footer-row > * { padding: 0; border: 0; background: transparent; text-align: left; }
    .payment-list tfoot th { grid-column: 1 / -1; }
    .payment-list tfoot .mobile-label { display: block; margin-bottom: .1rem; }
    .back-to-top {
        width: 2.3rem;
        height: 2.3rem;
        right: max(.7rem, env(safe-area-inset-right));
        bottom: max(.85rem, env(safe-area-inset-bottom));
        opacity: .8;
    }
    .back-to-top:hover, .back-to-top:focus-visible { opacity: 1; }
}

@media (max-width: 36rem) {
    .header-content { padding-block: .4rem; }
    .account { gap: .4rem; }
    .account-badge { padding: .3rem .48rem; }
    .account-name { max-width: 5.5rem; font-size: .76rem; }
    .account-role { display: none; }
    .button-header span { font-size: .78rem; }
}

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

/* Official Corporate Print Report Layout */
@media print {
    @page { margin: 12mm; }
    body { background: #fff; color: #000; font-size: 9.5pt; }
    .site-header {
        background: #fff !important;
        color: #000 !important;
        border-bottom: 2px solid #0f233c;
        box-shadow: none;
    }
    .brand-text strong { color: #0f233c !important; }
    .brand-text small, .brand-scope { color: #334155 !important; }
    .brand-divider { background: #cbd5e1 !important; }
    .account, .toolbar-utilities, .payment-actions, .reset-filters,
    .detail-toggle, .payment-count-link .chevron-icon, .back-to-top,
    .filter-error, .preview-note, .skip-link { display: none !important; }

    .overview { padding-top: .5rem; }
    .summary { grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .6rem; }
    .summary-card {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        border-top: 3px solid var(--accent) !important;
        padding: .5rem .65rem;
        break-inside: avoid;
    }
    .summary-meter, .summary-active-dot { display: none; }
    .payments { padding-block: .85rem 0; }
    .payments-toolbar { box-shadow: none; border: 0; padding: 0 0 .5rem; margin-bottom: .35rem; }
    .table-shell { border: 1px solid #94a3b8; border-radius: 0; box-shadow: none; overflow: visible; }
    .payment-list { display: table !important; width: 100%; border-collapse: collapse; }
    .payment-list thead { position: static; width: auto; height: auto; overflow: visible; clip-path: none; display: table-header-group !important; }
    .payment-list tbody { display: table-row-group !important; }
    .payment-list tfoot { display: table-footer-group !important; }
    .payment-list .payment-row { display: table-row !important; break-inside: avoid; content-visibility: visible !important; }
    .payment-list th, .payment-list td { display: table-cell !important; padding: .38rem .5rem; border-bottom: 1px solid #cbd5e1; }
    .mobile-label { display: none !important; }
    .payment-count { display: block !important; }
    .site-footer { border-top: 1px solid #cbd5e1; margin-top: 1rem; font-size: 8pt; }
}
