:root {
    --ink: #203040;
    --muted: #667085;
    --surface: #ffffff;
    --background: #f3f6f9;
    --border: #d9e1e8;
    --primary: #1769aa;
    --primary-dark: #0f4f82;
    --success: #18794e;
    --danger: #b42318;
    --warning: #9a6700;
    --shadow: 0 10px 30px rgba(32, 48, 64, 0.08);
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--background);
    color: var(--ink);
    line-height: 1.55;
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

.container {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding: 18px 22px;
    color: #fff;
    background: linear-gradient(135deg, #203b53, #1769aa);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.navbar h1 { margin: 0; font-size: clamp(1.2rem, 2vw, 1.55rem); }
.navbar a { color: #fff; }
.navbar > div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

h1, h2, h3, h4 { line-height: 1.2; }
h2 { margin: 0 0 18px; font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { margin-top: 0; }

form, .filter-bar, .log-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

form { padding: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 650; }
.form-group input,
.form-group textarea,
.form-group select,
input,
textarea,
select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}

textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus {
    outline: 3px solid rgba(23, 105, 170, 0.18);
    border-color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 15px;
    color: #fff;
    background: var(--primary);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    transition: background .15s ease, transform .15s ease;
}
.btn:hover { color: #fff; background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(23, 105, 170, .3); outline-offset: 2px; }

#message { margin-top: 16px; padding: 12px 14px; border-radius: 8px; }
#message:empty { display: none; }
#message.success { color: #115c39; background: #e8f7ef; border: 1px solid #a6dfc2; }
#message.error { color: #8c1d18; background: #fceceb; border: 1px solid #f1b5b0; }

.menu ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; padding: 0; list-style: none; }
.menu li a { display: block; padding: 18px; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); text-decoration: none; }
.menu li a:hover { color: var(--primary-dark); border-color: var(--primary); }

.filter-bar { padding: 20px; margin-bottom: 20px; }
.filter-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; background: transparent; border: 0; box-shadow: none; padding: 0; }
.filter-group { flex: 1 1 160px; }
.filter-group:last-child { flex: 0 0 auto; }
.multi-select { min-height: 96px; }

.table-wrap { width: 100%; overflow-x: auto; border-radius: 12px; box-shadow: var(--shadow); }
table { width: 100%; min-width: 720px; border-collapse: collapse; background: var(--surface); overflow: hidden; }
thead { background: #203b53; color: #fff; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:hover { background: #f7fafc; }

.balance-positive { color: var(--success); font-weight: 750; }
.balance-negative { color: var(--danger); font-weight: 750; }
.balance-zero { color: var(--muted); }
.status-void { color: #87909a; text-decoration: line-through; }
.status-edited { color: var(--warning); font-style: italic; }

.modal { display: none; position: fixed; z-index: 1000; inset: 0; padding: 20px; overflow-y: auto; background: rgba(19, 32, 43, .62); }
.modal-content { width: min(600px, 100%); margin: 4vh auto; padding: 24px; background: var(--surface); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.24); }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; padding-bottom: 8px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab-btn { flex: 0 0 auto; padding: 10px 14px; border-radius: 8px; cursor: pointer; }
.tab-btn.active { color: #fff; background: var(--primary); }
.snapshot-view { max-width: 560px; padding: 10px; color: #263238; background: #f4f7f9; border-radius: 8px; font: .78rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; white-space: pre-wrap; }

@media (max-width: 720px) {
    .container { padding: 14px; }
    .navbar { align-items: flex-start; flex-direction: column; padding: 16px; }
    .navbar > div { width: 100%; justify-content: space-between; }
    form { padding: 16px; }
    .filter-row { display: block; }
    .filter-group, .filter-group:last-child { margin-bottom: 14px; }
    .filter-group:last-child { margin-bottom: 0; }
    .filter-group .btn { width: 100%; }
    .modal { padding: 10px; }
    .modal-content { margin: 2vh auto; padding: 16px; }
    th, td { padding: 10px; }
    .btn { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Authenticated-page navigation: a dedicated menu row directly beneath the top bar. */
.navbar { margin-bottom: 12px; }
.app-navigation {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 28px;
    padding: 9px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.app-navigation__link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    color: var(--ink);
    border-radius: 8px;
    font-size: .93rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.app-navigation__link:hover,
.app-navigation__link:focus-visible {
    color: var(--primary-dark);
    background: #eaf3fb;
}
.app-navigation__link.is-active {
    color: #fff;
    background: var(--primary);
}
.app-navigation__divider {
    width: 1px;
    height: 24px;
    margin: 0 4px;
    background: var(--border);
}
@media (max-width: 720px) {
    .app-navigation { align-items: stretch; gap: 5px; margin-bottom: 20px; }
    .app-navigation__link { flex: 1 1 calc(50% - 5px); justify-content: center; }
    .app-navigation__divider { display: none; }
}

/* Mobile-first authenticated app shell and tap-friendly menu buttons. */
.container {
    width: min(1180px, 100%);
    padding: 12px;
}
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    margin-bottom: 10px;
    border-radius: 16px;
}
.navbar h1 { font-size: 1.22rem; letter-spacing: -.02em; }
.navbar > div { justify-content: flex-end; gap: 8px; }
.navbar > div > span {
    max-width: 185px;
    overflow: hidden;
    color: rgba(255,255,255,.84);
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.navbar .btn { min-height: 36px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.32); background: rgba(255,255,255,.14); }
.navbar .btn:hover { background: rgba(255,255,255,.25); }

.app-navigation {
    display: grid;
    gap: 12px;
    margin: 0 0 22px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.app-navigation__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}
.app-navigation__section {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}
.app-navigation__section-title {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.app-navigation__button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 62px;
    padding: 11px 12px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.app-navigation__button:hover,
.app-navigation__button:focus-visible {
    color: var(--ink);
    border-color: var(--primary);
    box-shadow: 0 10px 22px rgba(25, 69, 107, .15);
    transform: translateY(-1px);
}
.app-navigation__button:focus-visible { outline: 3px solid rgba(23,105,170,.25); outline-offset: 2px; }
.app-navigation__button.is-active { color: #fff; background: linear-gradient(135deg, var(--primary), #164e86); border-color: transparent; }
.app-navigation__icon {
    display: inline-grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    color: #fff;
    background: var(--primary);
    border-radius: 10px;
    font-size: .8rem;
    font-weight: 850;
}
.app-navigation__button.is-active .app-navigation__icon { color: var(--primary-dark); background: #fff; }
.app-navigation__button--transactions .app-navigation__icon { background: #0e7490; }
.app-navigation__button--balances .app-navigation__icon { background: #047857; }
.app-navigation__button--settlements .app-navigation__icon { background: #9a5b12; }
.app-navigation__button--users .app-navigation__icon { background: #7c3aed; }
.app-navigation__button--currencies .app-navigation__icon { background: #a64d06; }
.app-navigation__button--cache .app-navigation__icon { background: #4338ca; }
.app-navigation__button--audit .app-navigation__icon { background: #be123c; }
.app-navigation__button--security .app-navigation__icon { background: #475569; }
.app-navigation__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-navigation__utility { display: flex; }
.app-navigation__utility .app-navigation__button { width: 100%; min-height: 48px; box-shadow: none; }

@media (min-width: 700px) {
    .container { padding: 24px; }
    .navbar { padding: 18px 20px; }
    .navbar h1 { font-size: 1.45rem; }
    .app-navigation { gap: 14px; }
    .app-navigation__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
    .app-navigation__grid--admin { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .app-navigation__button { min-height: 54px; }
    .app-navigation__utility .app-navigation__button { width: auto; }
}
@media (min-width: 980px) {
    .app-navigation { display: flex; align-items: center; padding: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
    .app-navigation__grid { display: flex; gap: 6px; }
    .app-navigation__section { display: flex; align-items: center; gap: 8px; padding: 0 0 0 10px; background: transparent; border: 0; border-left: 1px solid var(--border); border-radius: 0; box-shadow: none; }
    .app-navigation__section-title { display: none; }
    .app-navigation__button { min-height: 42px; padding: 7px 10px; border-color: transparent; box-shadow: none; }
    .app-navigation__icon { width: 24px; height: 24px; flex-basis: 24px; border-radius: 7px; font-size: .68rem; }
    .app-navigation__utility { margin-left: auto; padding-left: 8px; border-left: 1px solid var(--border); }
    .app-navigation__utility .app-navigation__button { min-height: 42px; }
}

/* Balances checkbox person filter. */
.filter-label { display: block; margin-bottom: 6px; font-weight: 650; }
.person-filter { position: relative; }
.person-filter__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    padding: 9px 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.person-filter__toggle:hover,
.person-filter.is-open .person-filter__toggle { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23,105,170,.12); }
.person-filter__toggle-text { display: grid; gap: 2px; min-width: 0; }
.person-filter__toggle-text small { overflow: hidden; color: var(--muted); font-size: .78rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.person-filter__chevron { color: var(--primary); font-size: 1.35rem; line-height: 1; transition: transform .15s ease; }
.person-filter.is-open .person-filter__chevron { transform: rotate(180deg); }
.person-filter__panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    width: min(360px, calc(100vw - 28px));
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(19,32,43,.18);
}
.person-filter__panel[hidden] { display: none; }
.person-filter__panel-header,
.person-filter__panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.person-filter__panel-header { padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.person-filter__select-all { padding: 4px 0; color: var(--primary); background: transparent; border: 0; cursor: pointer; font: inherit; font-size: .83rem; font-weight: 750; }
.person-filter__options { display: grid; max-height: 240px; gap: 4px; margin: 10px 0; overflow-y: auto; }
.person-filter__option { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 9px; border-radius: 8px; cursor: pointer; }
.person-filter__option:hover { background: #edf5fb; }
.person-filter__option input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.person-filter__option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-filter__panel-actions { justify-content: flex-end; padding-top: 10px; border-top: 1px solid var(--border); }
.btn-secondary { color: var(--ink); background: #edf2f6; border: 1px solid var(--border); }
.btn-secondary:hover { color: var(--ink); background: #dfe8ef; }
@media (max-width: 720px) {
    .person-filter__panel { position: fixed; top: auto; right: 14px; bottom: 14px; left: 14px; width: auto; max-height: min(72vh, 520px); margin: 0 auto; }
    .person-filter__options { max-height: min(44vh, 300px); }
}


/* Dashboard information cards and mobile-first application layout. */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-intro { margin: 0; color: var(--muted); }
.eyebrow { display: block; margin-bottom: 5px; color: var(--primary); font-size: .72rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.dashboard-status { min-height: 20px; margin-bottom: 10px; color: var(--muted); font-size: .82rem; }
.dashboard-status.is-success { color: var(--success); }
.dashboard-status.is-error { color: var(--danger); }
.summary-cards { display: grid; grid-template-columns: 1fr; gap: 11px; margin-bottom: 16px; }
.summary-card { display: flex; align-items: center; gap: 12px; min-height: 112px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.summary-card__icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; color: #fff; background: var(--primary); border-radius: 13px; font-weight: 900; }
.summary-card__label, .summary-card small { display: block; color: var(--muted); }
.summary-card__label { font-size: .78rem; font-weight: 750; }
.summary-card strong { display: block; margin: 2px 0; color: var(--ink); font-size: 1.45rem; line-height: 1.1; }
.summary-card small { font-size: .75rem; }
.summary-card--users .summary-card__icon { background: #7c3aed; }
.summary-card--transactions .summary-card__icon { background: #0e7490; }
.summary-card--settlements .summary-card__icon { background: #047857; }
.summary-card--last .summary-card__icon { background: #9a5b12; }
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.dashboard-panel { min-width: 0; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.dashboard-panel--wide { grid-column: 1 / -1; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.panel-heading h3 { margin: 0; font-size: 1.05rem; }
.panel-heading .btn { flex: 0 0 auto; min-height: 36px; padding: 7px 10px; font-size: .8rem; }
.person-balance-list { display: grid; gap: 8px; }
.person-balance-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; background: #f7fafc; border: 1px solid #e6edf2; border-radius: 12px; }
.person-balance-row__person, .person-balance-row__meta { display: flex; align-items: center; gap: 9px; min-width: 0; }
.person-balance-row__person strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-balance-row__meta { flex: 0 0 auto; color: var(--muted); font-size: .76rem; }
.person-balance-row__meta strong { font-size: .9rem; }
.avatar-badge { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; color: #fff; background: var(--primary); border-radius: 10px; font-size: .75rem; font-weight: 850; }
.activity-card { min-height: 112px; padding: 13px; background: #f7fafc; border: 1px solid #e6edf2; border-radius: 12px; }
.activity-card__amount { color: var(--primary-dark); font-size: 1.45rem; font-weight: 850; }
.activity-card p { margin: 7px 0; font-size: .9rem; }
.activity-card small { color: var(--muted); line-height: 1.45; }
.empty-state { padding: 16px 4px; color: var(--muted); font-size: .88rem; }

/* Mobile hamburger menu. */
.app-navigation__toggle { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 48px; padding: 10px 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); cursor: pointer; font: inherit; font-weight: 800; text-align: left; }
.app-navigation__toggle:hover, .app-navigation.is-open .app-navigation__toggle { border-color: var(--primary); }
.app-navigation__hamburger { display: grid; gap: 4px; width: 22px; }
.app-navigation__hamburger i { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform .15s ease; }
.app-navigation__toggle-state { margin-left: auto; color: var(--muted); font-size: .76rem; font-weight: 650; }
.app-navigation__content { display: grid; gap: 12px; margin-top: 9px; }
.app-navigation__content[hidden] { display: none; }

/* Stack every data table into readable mobile cards instead of horizontal scrolling. */
@media (max-width: 720px) {
    .page-heading { align-items: stretch; flex-direction: column; gap: 10px; }
    .page-heading .btn { width: 100%; }
    .summary-card { min-height: 96px; }
    .dashboard-panel { padding: 13px; }
    .panel-heading { flex-direction: column; }
    .panel-heading .btn { width: 100%; }
    .person-balance-row { align-items: flex-start; flex-direction: column; }
    .person-balance-row__meta { width: 100%; justify-content: space-between; }
    .table-wrap { overflow: visible; }
    table.stack-mobile, table.stack-mobile tbody, table.stack-mobile tr, table.stack-mobile td { display: block; width: 100%; min-width: 0; }
    table.stack-mobile { background: transparent; border-collapse: separate; }
    table.stack-mobile thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
    table.stack-mobile tr { margin-bottom: 12px; padding: 10px 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow); }
    table.stack-mobile td { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; min-height: 0; padding: 9px 0; border: 0; text-align: right; }
    table.stack-mobile td::before { content: attr(data-label); flex: 0 0 38%; color: var(--muted); font-size: .73rem; font-weight: 800; letter-spacing: .02em; text-align: left; text-transform: uppercase; }
    table.stack-mobile td > * { max-width: 62%; }
    table.stack-mobile td[data-label="Actions"] { align-items: stretch; flex-direction: column; text-align: left; }
    table.stack-mobile td[data-label="Actions"]::before { flex-basis: auto; }
    table.stack-mobile td[data-label="Actions"] > * { max-width: 100%; }
    table.stack-mobile .snapshot-view { max-width: 62%; font-size: .69rem; text-align: left; }
}
@media (min-width: 560px) {
    .summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 820px) {
    .summary-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-panel--wide { grid-column: span 2; }
}
@media (min-width: 980px) {
    .app-navigation__toggle { display: none; }
    .app-navigation__content { display: flex !important; align-items: center; gap: 12px; margin-top: 0; }
    .app-navigation__content .app-navigation__grid { display: flex; }
    .app-navigation__content .app-navigation__section { display: flex; }
    .app-navigation__content .app-navigation__utility { margin-left: auto; }
}


/* Transactions Edit/Void confirmation dialog. */
body.modal-open { overflow: hidden; }
.confirmation-modal { position: fixed; z-index: 1200; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(19, 32, 43, .68); }
.confirmation-modal[hidden] { display: none; }
.confirmation-modal__dialog { width: min(460px, 100%); padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.confirmation-modal__header { display: flex; align-items: flex-start; gap: 12px; }
.confirmation-modal__badge { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; color: #fff; background: var(--primary); border-radius: 12px; font-size: 1.05rem; font-weight: 900; }
.confirmation-modal__eyebrow { display: block; margin-bottom: 3px; color: var(--primary); font-size: .7rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.confirmation-modal h3 { margin: 0; font-size: 1.18rem; }
.confirmation-modal__message { margin: 18px 0 8px; color: var(--ink); font-size: .98rem; font-weight: 700; line-height: 1.5; }
.confirmation-modal__hint { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.confirmation-modal__actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.confirmation-modal__actions .btn { min-width: 92px; }
@media (max-width: 520px) {
    .confirmation-modal { align-items: end; padding: 10px; }
    .confirmation-modal__dialog { padding: 18px; border-radius: 18px 18px 14px 14px; }
    .confirmation-modal__actions { display: grid; grid-template-columns: 1fr 1fr; }
    .confirmation-modal__actions .btn { width: 100%; }
}

/* Shared password visibility controls and page-level status messages. */
.password-field {
    position: relative;
    display: block;
}
.password-field > input {
    width: 100%;
    padding-right: 68px;
}
.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    min-height: 32px;
    padding: 4px 9px;
    color: var(--primary-dark);
    background: #edf5fb;
    border: 1px solid #bad1e4;
    border-radius: 7px;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 750;
    line-height: 1;
    transform: translateY(-50%);
}
.password-toggle:hover,
.password-toggle:focus-visible {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}
.password-toggle:focus-visible {
    outline: 3px solid rgba(23,105,170,.25);
    outline-offset: 2px;
}
.page-message {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 8px;
}
.page-message:empty { display: none; }
.page-message.success { color: #115c39; background: #e8f7ef; border: 1px solid #a6dfc2; }
.page-message.error { color: #8c1d18; background: #fceceb; border: 1px solid #f1b5b0; }

/* Shared pagination controls and lightweight performance footer. */
.pagination-host { margin-top: 16px; }
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0 0;
    color: var(--muted);
    font-size: .85rem;
}
.pagination__summary { font-weight: 650; }
.pagination__controls { display: flex; gap: 8px; }
.pagination__button {
    min-height: 36px;
    padding: 7px 12px;
    color: var(--primary-dark);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}
.pagination__button:hover:not(:disabled),
.pagination__button:focus-visible:not(:disabled) {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}
.pagination__button:disabled { color: #94a3b8; background: #f1f5f9; cursor: not-allowed; }
.performance-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px 16px;
    margin: 26px 0 4px;
    padding: 13px 10px;
    color: #64748b;
    background: #f8fafc;
    border-top: 1px solid #dbe4ed;
    font-size: .76rem;
}
.performance-footer strong { color: #334155; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
    .pagination { align-items: stretch; }
    .pagination__summary { width: 100%; }
    .pagination__controls { width: 100%; }
    .pagination__button { flex: 1; }
}
