:root {
    --portal-bg: #e8eef4;
    --portal-surface: #ffffff;
    --portal-ink: #102a43;
    --portal-muted: #627d98;
    --portal-line: #d9e2ec;
    --portal-accent: #0b3d66;
    --portal-accent-2: #0f7a3c;
    --portal-danger: #b42318;
    --portal-header: #0b3d66;
    --cms-sidebar: #edf2f7;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Metropolis, system-ui, sans-serif; color: var(--portal-ink); background: var(--portal-bg); }

/* ---------- CMS chrome (screenshot) ---------- */
.cms-shell { min-height: 100vh; display: flex; flex-direction: column; }
.cms-header {
    background: var(--portal-header);
    color: #fff;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}
.cms-header-copy h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.cms-header-copy p {
    margin: 6px 0 0;
    font-size: 13px;
    opacity: .92;
    max-width: 70ch;
}
.cms-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.cms-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #fff;
    color: var(--portal-header);
    border: 1px solid rgba(255,255,255,.5);
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
}
.cms-user {
    font-size: 13px;
    font-weight: 600;
    opacity: .95;
}
.cms-user-branch {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.35);
    background: rgba(255,255,255,.08);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cms-logout {
    border: 1px solid rgba(255,255,255,.35);
    background: transparent;
    color: #fff;
    border-radius: 999px;
    padding: 8px 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.cms-body-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    flex: 1;
    min-height: 0;
}
.cms-sidebar {
    background: var(--cms-sidebar);
    border-right: 1px solid var(--portal-line);
    padding: 16px 12px 24px;
    overflow: auto;
}
.cms-nav-quick {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--portal-line);
}
.cms-nav-quick-item {
    display: block;
    padding: 10px 12px 10px 14px;
    text-decoration: none;
    color: #2d4a6f;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    border-left: 4px solid transparent;
    border-radius: 0 8px 8px 0;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.cms-nav-quick-item:hover {
    background: rgba(29, 79, 145, .07);
    border-left-color: rgba(29, 79, 145, .35);
    color: #1d4f91;
}
.cms-nav-quick-item.is-active {
    border-left-color: #1d4f91;
    background: rgba(29, 79, 145, .12);
    color: #1d4f91;
    font-weight: 700;
}
.cms-nav { display: flex; flex-direction: column; gap: 8px; }
.cms-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--portal-ink);
    background: #fff;
    border: 1px solid #d7e0ea;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 14px;
    font-weight: 700;
}
.cms-nav-item:hover,
.cms-nav-item.is-active {
    border-color: #9fb4c9;
    box-shadow: 0 4px 12px rgba(16, 42, 67, .06);
}
.cms-nav-arrow {
    width: 14px;
    color: var(--portal-ink);
    font-size: 10px;
    line-height: 1;
}

.cms-nav.is-disabled {
    opacity: .55;
    pointer-events: none;
    user-select: none;
}
.cms-nav.is-disabled .cms-nav-group-toggle {
    cursor: not-allowed;
    background: #eef1f4;
    color: #8a96a3;
}
.cms-nav.is-disabled .cms-nav-group {
    border-color: #e2e6ea;
    background: #f3f5f7;
}
.cms-nav.is-disabled .cms-nav-item {
    background: #f3f5f7;
    color: #8a96a3;
    border-color: #e2e6ea;
    cursor: not-allowed;
}

.cms-nav-group {
    background: #fff;
    border: 1px solid #d7e0ea;
    border-radius: 10px;
    overflow: hidden;
}
.cms-nav-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: #f5f9fc;
    color: var(--portal-ink);
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
}
.cms-nav-caret {
    font-size: 10px;
    transition: transform .15s ease;
    transform: rotate(-90deg);
}
.cms-nav-group.is-open .cms-nav-caret { transform: rotate(0deg); }
.cms-nav-children {
    display: none;
    padding: 6px 10px 10px 28px;
    background: #fff;
}
.cms-nav-group.is-open .cms-nav-children { display: grid; gap: 6px; }
.cms-nav-child {
    text-decoration: none;
    color: #1d4f91;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 0;
}
.cms-nav-child.is-active,
.cms-nav-child:hover {
    color: var(--portal-header);
    text-decoration: underline;
}

.cms-main {
    padding: 18px 20px 36px;
    min-width: 0;
}
.cms-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.cms-stat {
    background: #fff;
    border: 1px solid #cfe0f2;
    border-radius: 12px;
    padding: 14px 16px;
}
.cms-stat span {
    display: block;
    color: var(--portal-muted);
    font-size: 13px;
    font-weight: 600;
}
.cms-stat strong {
    display: block;
    margin-top: 6px;
    font-size: 20px;
    letter-spacing: -.01em;
}

.cms-card {
    background: #fff;
    border: 1px solid #cfe0f2;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 8px 18px rgba(16, 42, 67, .04);
}
.cms-gap-card { margin-bottom: 14px; }
.cms-gap-card h2,
.cms-service-card h2 {
    margin: 0 0 8px;
    font-size: 22px;
}
.cms-ok {
    margin: 0 0 8px;
    color: var(--portal-accent-2);
    font-weight: 700;
    font-size: 14px;
}
.cms-gap-note {
    margin: 0;
    color: var(--portal-muted);
    font-size: 13px;
    line-height: 1.55;
}
.cms-service-id {
    margin: 0 0 14px;
    color: var(--portal-muted);
    font-size: 13px;
}
.cms-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.cms-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    background: var(--portal-header);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.cms-action:disabled {
    opacity: .55;
    cursor: default;
}

/* ---------- Shared portal components ---------- */
.portal-btn { border: 1px solid transparent; border-radius: 8px; padding: 9px 14px; font-weight: 600; cursor: pointer; font: inherit; }
.portal-btn--primary { background: var(--portal-accent); color: #fff; }
.portal-btn--ghost { background: transparent; border-color: var(--portal-line); color: var(--portal-ink); }
.portal-btn--block { width: 100%; }
.portal-btn--danger { background: var(--portal-danger); color: #fff; }

.portal-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.portal-card { background: var(--portal-surface); border: 1px solid var(--portal-line); border-radius: 12px; padding: 16px; }
.portal-card h3 { margin: 0 0 6px; font-size: 13px; color: var(--portal-muted); font-weight: 600; }
.portal-card .metric { font-size: 28px; font-weight: 700; }
.portal-panel { background: var(--portal-surface); border: 1px solid var(--portal-line); border-radius: 12px; overflow: hidden; }
.portal-panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--portal-line); }
.portal-panel-head h2 { margin: 0; font-size: 16px; }
.portal-toolbar { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--portal-line); }
.portal-toolbar input, .portal-toolbar select, .portal-field input, .portal-field select, .portal-field textarea {
    border: 1px solid var(--portal-line); border-radius: 8px; padding: 9px 11px; font: inherit; background: #fff;
}
.portal-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.portal-table th, .portal-table td { padding: 10px 12px; border-bottom: 1px solid var(--portal-line); text-align: left; vertical-align: top; }
.portal-table th { background: #f7fafc; color: var(--portal-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.cms-table-empty { color: #829ab1; font-weight: 600; }
.portal-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #e8eef7; color: #234; }
.portal-state { padding: 28px 16px; text-align: center; color: var(--portal-muted); }
.portal-state--error { color: var(--portal-danger); }
.portal-alert { background: #eef8f1; border: 1px solid #b7e0c4; color: #0f7a3c; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.portal-alert--error { background: #fef3f2; border-color: #f3b4ae; color: var(--portal-danger); }
.portal-alert ul { margin: 0; padding-left: 18px; }

.portal-auth-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #d9e6f4, #eef2f6 45%, #e7f3ea); padding: 20px; }
.portal-auth-card { width: min(100%, 420px); background: #fff; border-radius: 14px; border: 1px solid var(--portal-line); box-shadow: 0 18px 40px rgba(15, 23, 42, .08); padding: 26px; }
.portal-auth-brand { margin-bottom: 18px; }
.portal-auth-brand strong { display: block; font-size: 22px; }
.portal-auth-brand span { color: var(--portal-muted); font-size: 13px; }
.portal-form { display: grid; gap: 12px; }
.portal-field { display: grid; gap: 6px; }
.portal-field label { font-size: 13px; font-weight: 600; }
.portal-help { color: var(--portal-muted); font-size: 12px; margin: 0; }

.cms-service-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.cms-kicker {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #3d6ea3;
}
.cms-overview {
    margin: 0;
    color: var(--portal-ink);
    font-size: 14px;
    line-height: 1.55;
    max-width: 78ch;
}
.cms-purpose {
    margin: 8px 0 0;
    color: #3d6ea3;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    max-width: 78ch;
}
.cms-notes {
    margin: 12px 0 0;
    padding-left: 18px;
    color: var(--portal-muted);
    font-size: 12px;
    line-height: 1.5;
}
.cms-stat-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}
.cms-mini-stat {
    background: #fff;
    border: 1px solid #cfe0f2;
    border-radius: 12px;
    padding: 12px 14px;
}
.cms-mini-stat span {
    display: block;
    color: var(--portal-muted);
    font-size: 12px;
    font-weight: 600;
}
.cms-mini-stat strong {
    display: block;
    margin-top: 6px;
    font-size: 20px;
}
.cms-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
.cms-card + .cms-card,
.cms-split + .cms-card,
.cms-stat-row + .cms-split { margin-top: 0; }
.cms-main > .cms-card,
.cms-main > .cms-split,
.cms-main > .cms-stat-row { margin-bottom: 14px; }
.cms-section-title {
    margin: 0 0 12px;
    font-size: 16px;
}
.cms-bullet-list,
.cms-check-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    color: var(--portal-ink);
    font-size: 14px;
    line-height: 1.45;
}
.cms-check-list { list-style: none; padding-left: 0; }
.cms-check-list li {
    position: relative;
    padding-left: 22px;
}
.cms-check-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--portal-accent-2);
    font-weight: 800;
}
.cms-workflow {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}
.cms-workflow li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.cms-step-no {
    flex: 0 0 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--portal-header);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}
.cms-workflow strong { display: block; font-size: 14px; }
.cms-workflow p {
    margin: 2px 0 0;
    color: var(--portal-muted);
    font-size: 13px;
    line-height: 1.45;
}
.cms-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}
.cms-field {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}
.cms-field input {
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    padding: 9px 11px;
    font: inherit;
    font-weight: 500;
    background: #f7fafc;
    color: var(--portal-ink);
}
.cms-muted {
    margin: 0;
    color: var(--portal-muted);
    font-size: 12px;
    line-height: 1.45;
}
.cms-ops-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.cms-ops-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cms-ops-tools input,
.cms-ops-tools select {
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    padding: 9px 11px;
    font: inherit;
    background: #fff;
    min-width: 160px;
}
.cms-table-wrap { overflow-x: auto; }
.cms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.cms-table th,
.cms-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--portal-line);
    text-align: left;
}
.cms-table th {
    background: #f7fafc;
    color: var(--portal-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.cms-live-mount { margin-top: 14px; }

/* ---------- Dashboard home (metric board) ---------- */
.dash-home { max-width: 1100px; }
.dash-home-title {
    margin: 0 0 18px;
    font-size: 34px;
    font-weight: 800;
    color: #102a43;
    letter-spacing: -.02em;
}
.dash-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.dash-metric-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    min-height: 96px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.dash-metric-card:hover {
    border-color: #9fb4c9;
    box-shadow: 0 8px 18px rgba(16, 42, 67, .08);
}
.dash-metric-label {
    display: block;
    color: #627d98;
    font-size: 14px;
    font-weight: 600;
    text-transform: lowercase;
}
.dash-metric-value {
    display: block;
    margin-top: 10px;
    font-size: 36px;
    font-weight: 800;
    color: #102a43;
    letter-spacing: -.03em;
    line-height: 1;
}
.dash-core-rule {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 22px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
}
.dash-core-rule h2 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #102a43;
}
.dash-core-rule p {
    margin: 0;
    color: #627d98;
    font-size: 14px;
    line-height: 1.5;
}
.dash-live-title {
    margin: 0 0 12px;
    font-size: 16px;
    color: #102a43;
}

/* ---------- Branches panel ---------- */
.branch-page { max-width: 1200px; }
.branch-page-title {
    margin: 0 0 16px;
    font-size: 34px;
    font-weight: 800;
    color: #102a43;
    letter-spacing: -.02em;
}
.branch-panel {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 0;
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
}
.branch-create {
    padding: 22px 20px;
    border-right: 1px solid #e4edf5;
    background: #fff;
}
.branch-create-title {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 700;
    color: #102a43;
}
.branch-field {
    display: block;
    margin-bottom: 12px;
}
.branch-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #486581;
    letter-spacing: .02em;
}
.branch-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #829ab1;
    line-height: 1.4;
}
.branch-field input {
    width: 100%;
    border: 1px solid #d7e3ef;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    color: #102a43;
    background: #fff;
}
.branch-field input::placeholder { color: #829ab1; }
.branch-field input:focus {
    outline: none;
    border-color: #627d98;
    box-shadow: 0 0 0 3px rgba(98, 125, 152, .12);
}
.branch-submit {
    margin-top: 4px;
    border: none;
    border-radius: 8px;
    padding: 11px 16px;
    background: var(--portal-header);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.branch-submit:disabled { opacity: .6; cursor: default; }
.branch-list {
    min-width: 0;
    padding: 22px 20px;
    overflow: auto;
    background: #fff;
}
.branch-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.branch-list-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #102a43;
}
.branch-refresh {
    border: 1px solid #d7e3ef;
    background: #fff;
    color: #334e68;
    border-radius: 8px;
    padding: 8px 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.branch-refresh:hover { background: #eef4fa; }
.branch-list-empty {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #627d98;
    font-size: 13px;
    background: #f8fbff;
}
.branch-list .portal-table { min-width: 960px; }
.branch-list .portal-table th {
    font-size: 13px;
    text-transform: lowercase;
    letter-spacing: 0;
}
.branch-form-alert {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}
.branch-form-alert--ok {
    background: #eef8f1;
    border: 1px solid #b7e0c4;
    color: #0f7a3c;
}
.branch-form-alert--error {
    background: #fef3f2;
    border: 1px solid #f3b4ae;
    color: var(--portal-danger);
}

/* ---------- Customer / CIF panel ---------- */
.cif-page { max-width: 1100px; }
.cif-page-title {
    margin: 0 0 16px;
    font-size: 34px;
    font-weight: 800;
    color: #102a43;
    letter-spacing: -.02em;
}
.cif-filter-panel {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    padding: 20px 24px 18px;
    margin-bottom: 20px;
}
.cif-filter-form {
    max-width: 720px;
}
.cif-filter-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
@media (max-width: 640px) {
    .cif-filter-row { grid-template-columns: 1fr; gap: 4px; }
}
.cif-filter-label {
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: #243b53;
}
@media (max-width: 640px) {
    .cif-filter-label { text-align: left; }
}
.cif-filter-required { color: #d64545; }
.cif-filter-control { display: flex; align-items: center; gap: 0; }
.cif-filter-control--search .cif-filter-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}
.cif-filter-input {
    width: 100%;
    max-width: 320px;
    border: 1px solid #bcccdc;
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
    font-size: 14px;
    color: #102a43;
    background: #fff;
}
.cif-filter-input:focus {
    outline: none;
    border-color: #627d98;
    box-shadow: 0 0 0 3px rgba(98, 125, 152, .12);
}
.cif-filter-input[readonly],
.cif-filter-input--locked {
    background: #e5e7eb;
    color: #374151;
    border-color: #d1d5db;
    cursor: not-allowed;
}
.cif-filter-search-btn {
    flex: 0 0 auto;
    border: 1px solid #bcccdc;
    border-left: none;
    border-radius: 0 6px 6px 0;
    padding: 8px 10px;
    background: #f0f4f8;
    color: #334e68;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cif-filter-search-btn:hover { background: #e4edf5; }
.cif-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-left: 152px;
}
@media (max-width: 640px) {
    .cif-filter-actions { padding-left: 0; }
}
.cif-filter-btn {
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.cif-filter-btn--primary {
    background: #2563eb;
    color: #fff;
}
.cif-filter-btn--primary:hover { background: #1d4ed8; }
.cif-filter-btn--secondary {
    background: #2563eb;
    color: #fff;
}
.cif-filter-btn--secondary:hover { background: #1d4ed8; }

/* ---------- Accounts lookup panel ---------- */
.acct-page { max-width: 900px; }
.acct-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.acct-page-title {
    margin: 0;
    font-size: 34px;
    font-weight: 800;
    color: #102a43;
    letter-spacing: -.02em;
}
.acct-details-panel {
    background: #fff;
    border: 1px solid #c8d4e0;
    border-radius: 4px;
    overflow: hidden;
    max-width: 560px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(16, 42, 67, .04);
}
.acct-details-panel-head {
    background: #f3f4f6;
    border-bottom: 1px solid #d1d5db;
    padding: 8px 12px;
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.acct-create-btn {
    font-size: 13px;
    padding: 6px 14px;
}
.acct-details-panel-body { padding: 24px 28px 20px; }
.acct-filter-form { max-width: none; margin: 0 auto; }
.acct-filter-form .cif-filter-actions { justify-content: center; padding-left: 0; }
.acct-detail-mount {
    margin-top: 20px;
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    padding: 16px 18px;
}
.acct-detail-mount[hidden] { display: none !important; }
.acct-detail-empty {
    color: #627d98;
    font-size: 14px;
    text-align: center;
    padding: 12px 0;
}
.acct-back-link { text-decoration: none; white-space: nowrap; font-size: 13px; color: #2563eb; font-weight: 600; }
.acct-back-link:hover { text-decoration: underline; }
.accounts-cash-layout--create { max-width: 1180px; }

/* ---------- Account Opening form ---------- */
.acct-open-panel { max-width: 620px; }
.acct-open-body { padding: 20px 28px 24px; }
.acct-open-form { max-width: 520px; margin: 0 auto; }
.acct-open-row {
    display: grid;
    grid-template-columns: 190px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
@media (max-width: 640px) {
    .acct-open-row { grid-template-columns: 1fr; gap: 4px; }
}
.acct-open-label {
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: #243b53;
}
@media (max-width: 640px) {
    .acct-open-label { text-align: left; }
}
.acct-open-req { color: #d64545; }
.acct-open-input {
    width: 100%;
    max-width: 320px;
    border: 1px solid #bcccdc;
    border-radius: 4px;
    padding: 7px 10px;
    font: inherit;
    font-size: 14px;
    color: #102a43;
    background: #fff;
}
.acct-open-input--locked,
.acct-open-input[readonly]:not(.acct-open-input--hint) {
    background: #e5e7eb;
    color: #374151;
    border-color: #d1d5db;
    cursor: not-allowed;
}
.acct-open-select { background: #fff; }
.acct-open-input:focus {
    outline: none;
    border-color: #627d98;
    box-shadow: 0 0 0 2px rgba(98, 125, 152, .15);
}
.acct-open-control {
    display: flex;
    align-items: center;
    max-width: 320px;
}
.acct-open-field { max-width: 320px; }
.acct-open-field .acct-open-control { max-width: none; width: 100%; }
.acct-open-control--search .acct-open-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    max-width: none;
    flex: 1;
}
.acct-open-search-btn {
    flex: 0 0 auto;
    border: 1px solid #bcccdc;
    border-left: none;
    border-radius: 0 4px 4px 0;
    padding: 7px 10px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.acct-open-search-btn:hover { background: #1d4ed8; }
.acct-open-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}
.acct-open-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #243b53;
    cursor: pointer;
}
.acct-open-spacer { height: 18px; }
.acct-open-hint {
    display: block;
    font-size: 12px;
    color: #627d98;
    margin-top: 4px;
}
.acct-open-hint--error { color: #d64545; }
@media (max-width: 640px) {
    .acct-open-hint { grid-column: 1; }
}
.acct-open-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
    padding-top: 4px;
}
.acct-open-alert {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
}
.acct-open-alert--ok {
    background: #ecfdf3;
    border: 1px solid #a7f3d0;
    color: #047857;
}
.acct-open-alert--error {
    background: #fef3f2;
    border: 1px solid #f3b4ae;
    color: #b42318;
}

.cif-list-section {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    min-height: 320px;
    display: flex;
    flex-direction: column;
}
.cif-layout {
    display: grid;
    grid-template-columns: minmax(280px, 420px) 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .cif-layout { grid-template-columns: 1fr; }
}
.cif-panel {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
}
.cif-list-panel {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    min-height: 320px;
    display: flex;
    flex-direction: column;
}
.cif-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #e4edf5;
}
.cif-list-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cif-list-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #102a43;
}
.cif-add-new-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    background: var(--portal-header);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.cif-add-new-btn:hover { opacity: .92; }
.cif-list-refresh {
    border: 1px solid #d7e3ef;
    border-radius: 8px;
    padding: 6px 12px;
    background: #fff;
    color: #486581;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.cif-list-refresh:hover { background: #f0f4f8; }
.cif-list-mount {
    flex: 1;
    overflow: auto;
    padding: 12px 14px 16px;
}
.cif-list-empty {
    padding: 24px 12px;
    text-align: center;
    color: #829ab1;
    font-size: 14px;
}
.cif-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.cif-list-table th,
.cif-list-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #edf2f7;
    vertical-align: top;
}
.cif-list-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #627d98;
}
.cif-list-table tr:last-child td { border-bottom: none; }
.cif-list-table tr.cif-list-row--new {
    background: #eef8f1;
}
.cif-list-cif {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    color: #102a43;
    word-break: break-all;
}
.cif-list-password {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
    color: #0f7a3c;
    letter-spacing: .04em;
}
.cif-list-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: #eef8f1;
    color: #0f7a3c;
}
.cif-list-status--pending { background: #fff8e6; color: #b7791f; }
.cif-list-status--inactive { background: #fef3f2; color: #c53030; }
.cif-create-page {
    max-width: 480px;
    margin: 0 auto;
    padding: 8px 0 24px;
}
.cif-create-card {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    overflow: hidden;
}
.cif-create-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 12px;
    border-bottom: 1px solid #e4edf5;
}
.cif-create-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #102a43;
}
.cif-create-back {
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
}
.cif-create-back:hover { text-decoration: underline; }
.cif-create { padding: 22px 20px; }
.cif-field {
    display: block;
    margin-bottom: 12px;
}
.cif-field-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #102a43;
    margin-bottom: 6px;
}
.cif-field input {
    width: 100%;
    border: 1px solid #d7e3ef;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    color: #102a43;
    background: #fff;
}
.cif-field input::placeholder { color: #829ab1; }
.cif-field input:focus {
    outline: none;
    border-color: #627d98;
    box-shadow: 0 0 0 3px rgba(98, 125, 152, .12);
}
.cif-submit {
    width: 100%;
    margin-top: 4px;
    border: none;
    border-radius: 8px;
    padding: 11px 16px;
    background: var(--portal-header);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.cif-submit:disabled { opacity: .6; cursor: default; }
.cif-form-alert {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}
.cif-form-alert--ok {
    background: #eef8f1;
    border: 1px solid #b7e0c4;
    color: #0f7a3c;
}
.cif-form-alert--error {
    background: #fef3f2;
    border: 1px solid #f3b4ae;
    color: var(--portal-danger);
}
.cif-modal[hidden] { display: none !important; }
.cif-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cif-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 42, 67, .45);
}
.cif-modal-dialog {
    position: relative;
    width: min(100%, 440px);
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(16, 42, 67, .18);
    padding: 0 0 20px;
}
.cif-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 12px;
    border-bottom: 1px solid #e4edf5;
}
.cif-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #102a43;
}
.cif-modal-close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: #627d98;
    cursor: pointer;
    padding: 0 4px;
}
.cif-modal-close:hover { color: #102a43; }
.cif-modal .cif-create { padding-top: 16px; }

/* ---------- Member Registration page ---------- */
.member-reg-page { max-width: 1180px; }
.member-reg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #ececec;
    border: 1px solid #d0d0d0;
    padding: 10px 16px;
    margin-bottom: 0;
}
.member-reg-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #243b53;
}
.member-reg-fin-day {
    font-size: 14px;
    font-weight: 700;
    color: #d97706;
    white-space: nowrap;
}
.member-reg-form {
    background: #fff;
    border: 1px solid #d0d0d0;
    border-top: none;
}
.member-reg-layout {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 0;
}
@media (max-width: 900px) {
    .member-reg-layout { grid-template-columns: 1fr; }
}
.member-reg-main { padding: 16px 20px 24px; }
.member-reg-side {
    border-left: 1px solid #e2e8f0;
    padding: 16px 14px;
    background: #fafbfc;
}
@media (max-width: 900px) {
    .member-reg-side {
        border-left: none;
        border-top: 1px solid #e2e8f0;
    }
}
.member-reg-section { margin-bottom: 8px; }
.member-reg-section-title {
    margin: 0 0 10px;
    padding: 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: #334e68;
}
.member-reg-divider {
    height: 1px;
    background: #cbd5e0;
    margin: 14px 0 12px;
}
.member-reg-row {
    display: grid;
    grid-template-columns: 190px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
@media (max-width: 640px) {
    .member-reg-row { grid-template-columns: 1fr; gap: 4px; }
}
.member-reg-label {
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: #243b53;
}
@media (max-width: 640px) {
    .member-reg-label { text-align: left; }
}
.member-reg-req { color: #d64545; }
.member-reg-input {
    width: 100%;
    max-width: 340px;
    border: 1px solid #bcccdc;
    border-radius: 4px;
    padding: 7px 10px;
    font: inherit;
    font-size: 14px;
    color: #102a43;
    background: #fff;
}
.member-reg-input--readonly,
.member-reg-input--calc {
    background: #6b7280;
    color: #fff;
    border-color: #4b5563;
}
.member-reg-input--locked,
.member-reg-input--readonly[readonly] {
    background: #e5e7eb;
    color: #374151;
    border-color: #d1d5db;
    cursor: not-allowed;
}
.member-reg-select { background: #fff; color: #102a43; }
.member-reg-input:focus {
    outline: none;
    border-color: #627d98;
    box-shadow: 0 0 0 2px rgba(98, 125, 152, .15);
}
.member-reg-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}
.member-reg-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #243b53;
    cursor: pointer;
}
.member-reg-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #243b53;
    cursor: pointer;
}
.member-reg-range {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 340px;
}
.member-reg-range .member-reg-input { max-width: 120px; flex: 1 1 100px; }
.member-reg-range-sep { font-size: 14px; color: #486581; }
.member-reg-control {
    display: flex;
    align-items: center;
    max-width: 340px;
}
.member-reg-control--search .member-reg-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    max-width: none;
    flex: 1;
}
.member-reg-search-btn {
    flex: 0 0 auto;
    border: 1px solid #bcccdc;
    border-left: none;
    border-radius: 0 4px 4px 0;
    padding: 7px 10px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.member-reg-search-btn:hover { background: #1d4ed8; }
.member-reg-name-group {
    display: grid;
    grid-template-columns: 72px 1fr 1fr 1fr;
    gap: 6px;
    max-width: 520px;
    width: 100%;
}
@media (max-width: 760px) {
    .member-reg-name-group { grid-template-columns: 1fr 1fr; }
    .member-reg-name-group .member-reg-title { grid-column: 1 / -1; }
}
.member-reg-name-group .member-reg-input { max-width: none; }
.member-reg-title { min-width: 0; padding-left: 6px; padding-right: 6px; }
.member-reg-textarea {
    max-width: 340px;
    min-height: 72px;
    resize: vertical;
    font-family: inherit;
}
.member-reg-row--full { grid-template-columns: 1fr; }
.member-reg-same-address {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-left: 152px;
    cursor: pointer;
}
@media (max-width: 640px) {
    .member-reg-same-address { padding-left: 0; }
}
.member-reg-same-address-text {
    color: #d64545;
    font-size: 13px;
    line-height: 1.4;
}
.member-reg-declaration {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #334e68;
    cursor: pointer;
}
.member-reg-declaration input { margin-top: 4px; flex: 0 0 auto; }
.member-reg-actions--center { justify-content: center; padding-left: 0; }
.member-reg-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}
.member-reg-btn {
    border: none;
    border-radius: 6px;
    padding: 9px 20px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.member-reg-btn--primary { background: #2563eb; color: #fff; }
.member-reg-btn--primary:hover { background: #1d4ed8; }
.member-reg-btn--secondary { background: #64748b; color: #fff; }
.member-reg-btn--secondary:hover { background: #475569; }
.member-reg-photo-box { margin-bottom: 16px; }
.member-reg-photo-preview {
    width: 100%;
    min-height: 140px;
    border: 1px solid #cbd5e0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 8px;
}
.member-reg-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 140px;
}
.member-reg-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    text-align: center;
    color: #829ab1;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}
.member-reg-upload-btn {
    display: block;
    text-align: center;
    border: 1px solid #bcccdc;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #334e68;
    cursor: pointer;
    background: #f0f4f8;
}
.member-reg-upload-btn:hover { background: #e4edf5; }
.member-reg-signature-box {
    min-height: 70px;
    border: 1px solid #cbd5e0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.member-reg-signature-label {
    font-family: "Segoe Script", "Brush Script MT", cursive;
    font-size: 28px;
    color: #334e68;
}
.member-reg-alert {
    margin: 12px 20px 0;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
}
.member-reg-alert--ok {
    background: #eef8f1;
    border: 1px solid #b7e0c4;
    color: #0f7a3c;
}
.member-reg-alert--error {
    background: #fef3f2;
    border: 1px solid #f3b4ae;
    color: var(--portal-danger);
}

/* ---------- Account management (create page) ---------- */
.account-mgmt-page { max-width: 1100px; }
.account-mgmt-head { margin-bottom: 20px; }
.account-mgmt-title {
    margin: 0 0 4px;
    font-size: 34px;
    font-weight: 800;
    color: #102a43;
    letter-spacing: -.02em;
}
.account-mgmt-subtitle {
    margin: 0;
    font-size: 14px;
    color: #627d98;
}
.account-mgmt-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
@media (max-width: 860px) {
    .account-mgmt-grid { grid-template-columns: 1fr; }
}
.account-mgmt-card {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    padding: 22px 20px;
}
.account-mgmt-card-title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
    color: #102a43;
}
.account-mgmt-form { display: flex; flex-direction: column; gap: 0; }
.account-mgmt-field { display: block; margin-bottom: 14px; }
.account-mgmt-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #243b53;
}
.account-mgmt-field input,
.account-mgmt-field select {
    width: 100%;
    border: 1px solid #d7e3ef;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    color: #102a43;
    background: #fff;
}
.account-mgmt-field input:focus,
.account-mgmt-field select:focus {
    outline: none;
    border-color: #627d98;
    box-shadow: 0 0 0 3px rgba(98, 125, 152, .12);
}
.account-mgmt-field input[type="file"],
.account-mgmt-file {
    padding: 8px;
}
.account-mgmt-input--locked,
.account-mgmt-field input[readonly] {
    background: #f1f5f9;
    color: #475569;
    cursor: not-allowed;
}
.account-mgmt-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #0f7a3c;
}
.account-mgmt-hint--error { color: #c53030; }
.account-mgmt-btn {
    border: none;
    border-radius: 8px;
    padding: 11px 20px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.account-mgmt-btn:disabled { opacity: .6; cursor: default; }
.account-mgmt-btn--open {
    align-self: flex-start;
    margin-top: 4px;
    background: #2563eb;
    color: #fff;
}
.account-mgmt-btn--open:hover { background: #1d4ed8; }
.account-mgmt-txn-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.account-mgmt-btn--deposit {
    flex: 1;
    background: #d1fae5;
    color: #065f46;
}
.account-mgmt-btn--deposit:hover { background: #a7f3d0; }
.account-mgmt-btn--withdraw {
    flex: 1;
    background: #fee2e2;
    color: #991b1b;
}
.account-mgmt-btn--withdraw:hover { background: #fecaca; }
.account-mgmt-records {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    min-height: 180px;
    padding: 22px 20px;
}
.account-mgmt-records-empty {
    color: #829ab1;
    font-size: 14px;
    text-align: center;
    padding: 48px 16px;
}
.account-mgmt-alert {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}
.account-mgmt-alert--ok {
    background: #eef8f1;
    border: 1px solid #b7e0c4;
    color: #0f7a3c;
}
.account-mgmt-alert--error {
    background: #fef3f2;
    border: 1px solid #f3b4ae;
    color: var(--portal-danger);
}
.account-mgmt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.account-mgmt-table th,
.account-mgmt-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e4edf5;
    text-align: left;
}
.account-mgmt-table th {
    font-size: 12px;
    font-weight: 700;
    color: #486581;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.account-mgmt-table tr:last-child td { border-bottom: none; }
.account-mgmt-mono { font-family: ui-monospace, monospace; font-size: 13px; }

/* ---------- Accounts & Cash panel ---------- */
.accounts-cash-page { max-width: 1180px; }
.accounts-cash-title {
    margin: 0 0 16px;
    font-size: 34px;
    font-weight: 800;
    color: #102a43;
    letter-spacing: -.02em;
}
.accounts-cash-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(300px, 420px);
    gap: 20px;
    align-items: start;
}
@media (max-width: 960px) {
    .accounts-cash-layout { grid-template-columns: 1fr; }
}
.accounts-cash-main { display: flex; flex-direction: column; gap: 16px; }
.accounts-cash-side { display: flex; flex-direction: column; gap: 16px; }
.accounts-cash-panel {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    padding: 22px 20px;
}
.accounts-cash-main .accounts-cash-panel { margin-bottom: 0; }
.accounts-cash-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #486581;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.accounts-cash-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #0f7a3c;
}
.accounts-cash-hint--error { color: var(--portal-danger); }
.accounts-cash-row {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}
.accounts-cash-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.accounts-cash-field { display: block; position: relative; }
.accounts-cash-field--amount .accounts-cash-currency {
    position: absolute;
    left: 12px;
    bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #627d98;
    pointer-events: none;
}
.accounts-cash-field--amount input { padding-left: 28px; }
.accounts-cash-field input,
.accounts-cash-field select {
    width: 100%;
    border: 1px solid #d7e3ef;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    color: #102a43;
    background: #fff;
}
.accounts-cash-field input::placeholder { color: #829ab1; }
.accounts-cash-field input:focus,
.accounts-cash-field select:focus {
    outline: none;
    border-color: #627d98;
    box-shadow: 0 0 0 3px rgba(98, 125, 152, .12);
}
.accounts-cash-btn {
    border: none;
    border-radius: 8px;
    padding: 11px 16px;
    background: var(--portal-header);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.accounts-cash-btn:disabled { opacity: .6; cursor: default; }
.accounts-cash-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}
.accounts-cash-col-title {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 800;
    color: #102a43;
}
.accounts-cash-txn .accounts-cash-field { margin-bottom: 12px; }
.accounts-cash-flow-title,
.accounts-cash-records-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #102a43;
}
.accounts-cash-flow-list {
    margin: 14px 0 0;
    padding-left: 20px;
    color: #334e68;
    font-size: 13px;
    line-height: 1.5;
}
.accounts-cash-flow-list li { margin-bottom: 12px; }
.accounts-cash-flow-list li:last-child { margin-bottom: 0; }
.accounts-cash-flow-list strong {
    display: block;
    color: #102a43;
    font-size: 13px;
    margin-bottom: 2px;
}
.accounts-cash-flow-list span { color: #627d98; }
.accounts-cash-records-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.accounts-cash-refresh {
    border: 1px solid #d7e3ef;
    border-radius: 8px;
    padding: 6px 12px;
    background: #fff;
    color: #486581;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.accounts-cash-refresh:hover { background: #f0f4f8; }
.accounts-cash-records { min-height: 200px; }
.accounts-cash-records-empty {
    color: #829ab1;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 0;
}
.accounts-cash-records .portal-table,
.accounts-cash-records .accounts-cash-table { margin: 0; width: 100%; }
.accounts-cash-table {
    border-collapse: collapse;
    font-size: 12px;
}
.accounts-cash-table th,
.accounts-cash-table td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid #edf2f7;
    vertical-align: top;
}
.accounts-cash-table th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #627d98;
}
.accounts-cash-table tr:last-child td { border-bottom: none; }
.accounts-cash-table tr.accounts-cash-row--new { background: #eef8f1; }
.accounts-cash-table tr.accounts-cash-row--txn { background: #f8fafc; }
.accounts-cash-table .accounts-cash-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    word-break: break-all;
}
.accounts-cash-section-label {
    margin: 14px 0 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #829ab1;
}
.accounts-cash-section-label:first-child { margin-top: 0; }
.accounts-cash-alert {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}
.accounts-cash-alert--ok {
    background: #eef8f1;
    border: 1px solid #b7e0c4;
    color: #0f7a3c;
}
.accounts-cash-alert--error {
    background: #fef3f2;
    border: 1px solid #f3b4ae;
    color: var(--portal-danger);
}

/* ---------- Loan Products panel ---------- */
.loan-products-page { max-width: 980px; }
.loan-products-title {
    margin: 0 0 16px;
    font-size: 34px;
    font-weight: 800;
    color: #102a43;
    letter-spacing: -.02em;
}
.loan-products-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.loan-product-card {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 12px;
    padding: 14px 12px;
    display: grid;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(16, 42, 67, .04);
}
.loan-product-card strong {
    font-size: 13px;
    font-weight: 800;
    color: #102a43;
    line-height: 1.35;
}
.loan-product-card span {
    font-size: 12px;
    font-weight: 700;
    color: #486581;
}
.loan-product-card em {
    font-style: normal;
    font-size: 13px;
    font-weight: 700;
    color: #102a43;
}
.loan-products-panel {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    padding: 22px 20px;
    margin-bottom: 16px;
}
.loan-products-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}
.loan-products-col-title {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 800;
    color: #102a43;
}
.loan-products-field {
    display: block;
    margin-bottom: 12px;
}
.loan-products-field input,
.loan-products-field select {
    width: 100%;
    border: 1px solid #d7e3ef;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    color: #102a43;
    background: #fff;
}
.loan-products-field input::placeholder { color: #829ab1; }
.loan-products-field input:focus,
.loan-products-field select:focus {
    outline: none;
    border-color: #627d98;
    box-shadow: 0 0 0 3px rgba(98, 125, 152, .12);
}
.loan-products-btn {
    border: none;
    border-radius: 8px;
    padding: 11px 16px;
    background: var(--portal-header);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.loan-products-btn:disabled { opacity: .6; cursor: default; }
.loan-products-records { min-height: 72px; }
.loan-products-records-empty {
    color: #829ab1;
    font-size: 14px;
    font-weight: 600;
}
.loan-products-footnote {
    margin: 0;
    font-size: 12px;
    color: #829ab1;
    line-height: 1.5;
}
.loan-products-footnote a { color: #243b53; font-weight: 700; }
.loan-action-btn {
    border: 1px solid #bcccdc;
    background: #fff;
    color: #243b53;
    border-radius: 8px;
    padding: 6px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    margin-right: 6px;
}
.loan-action-btn--ok { background: #1f8f7a; border-color: #1f8f7a; color: #fff; }
.loan-action-btn--danger { background: #fff5f5; border-color: #f3b4ae; color: #b42318; }
.loan-action-btn:disabled { opacity: .6; cursor: default; }

.approvals-page { max-width: 980px; }
.approvals-title { margin: 0 0 8px; font-size: 34px; font-weight: 800; color: #102a43; }
.approvals-note { margin: 0 0 16px; color: #627d98; font-size: 13px; }
.approvals-panel {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    padding: 18px 20px;
}
.approvals-loading { color: #829ab1; font-size: 14px; font-weight: 600; }
.loan-products-alert {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}
.loan-products-alert--ok {
    background: #eef8f1;
    border: 1px solid #b7e0c4;
    color: #0f7a3c;
}
.loan-products-alert--error {
    background: #fef3f2;
    border: 1px solid #f3b4ae;
    color: var(--portal-danger);
}

/* ---------- Agent Cash Settlement panel ---------- */
.settlement-page { max-width: 980px; }
.settlement-title {
    margin: 0 0 16px;
    font-size: 34px;
    font-weight: 800;
    color: #102a43;
    letter-spacing: -.02em;
}
.settlement-panel {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    padding: 22px 20px;
}
.settlement-records-empty {
    color: #829ab1;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}
.settlement-records-empty:empty { display: none; }
#settlement-records-mount:not(.settlement-records-empty) {
    margin-bottom: 16px;
}
.settlement-action {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
}
.settlement-field {
    flex: 1 1 220px;
    display: block;
    margin: 0;
}
.settlement-field input {
    width: 100%;
    height: 100%;
    min-height: 42px;
    border: 1px solid #d7e3ef;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    color: #102a43;
    background: #fff;
}
.settlement-field input::placeholder { color: #829ab1; }
.settlement-field input:focus {
    outline: none;
    border-color: #627d98;
    box-shadow: 0 0 0 3px rgba(98, 125, 152, .12);
}
.settlement-btn {
    border: none;
    border-radius: 8px;
    padding: 11px 16px;
    background: var(--portal-header);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.settlement-btn:disabled { opacity: .6; cursor: default; }
.settlement-alert {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}
.settlement-alert--ok {
    background: #eef8f1;
    border: 1px solid #b7e0c4;
    color: #0f7a3c;
}
.settlement-alert--error {
    background: #fef3f2;
    border: 1px solid #f3b4ae;
    color: var(--portal-danger);
}

/* ---------- Charges / GST panel ---------- */
.charges-gst-page { max-width: 980px; }
.charges-gst-title {
    margin: 0 0 16px;
    font-size: 34px;
    font-weight: 800;
    color: #102a43;
    letter-spacing: -.02em;
}
.charges-gst-panel {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    padding: 22px 20px;
}
.charges-gst-example {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #486581;
}
.charges-gst-action {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
}
.charges-gst-field {
    flex: 0 0 160px;
    display: block;
    margin: 0;
}
.charges-gst-field input {
    width: 100%;
    height: 100%;
    min-height: 42px;
    border: 1px solid #d7e3ef;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    color: #102a43;
    background: #fff;
}
.charges-gst-field input:focus {
    outline: none;
    border-color: #627d98;
    box-shadow: 0 0 0 3px rgba(98, 125, 152, .12);
}
.charges-gst-btn {
    border: none;
    border-radius: 8px;
    padding: 11px 16px;
    background: var(--portal-header);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.charges-gst-btn:disabled { opacity: .6; cursor: default; }
.charges-gst-alert {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}
.charges-gst-alert--ok {
    background: #eef8f1;
    border: 1px solid #b7e0c4;
    color: #0f7a3c;
}
.charges-gst-alert--error {
    background: #fef3f2;
    border: 1px solid #f3b4ae;
    color: var(--portal-danger);
}

/* ---------- Legacy CMS Migration panel ---------- */
.legacy-migration-page { max-width: 980px; }
.legacy-migration-title {
    margin: 0 0 16px;
    font-size: 34px;
    font-weight: 800;
    color: #102a43;
    letter-spacing: -.02em;
}
.legacy-migration-panel {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    padding: 22px 20px;
    margin-bottom: 16px;
}
.legacy-migration-hint {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.5;
    color: #829ab1;
}
.legacy-migration-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}
.legacy-migration-field {
    width: 100%;
    display: block;
    margin: 0;
}
.legacy-migration-field input[type="text"],
.legacy-migration-field input[type="file"] {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d7e3ef;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    color: #102a43;
    background: #fff;
}
.legacy-migration-field input[type="text"]:focus {
    outline: none;
    border-color: #627d98;
    box-shadow: 0 0 0 3px rgba(98, 125, 152, .12);
}
.legacy-migration-field input[type="text"]::placeholder { color: #829ab1; }
.legacy-migration-btn {
    border: none;
    border-radius: 8px;
    padding: 11px 16px;
    background: var(--portal-header);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.legacy-migration-btn:disabled { opacity: .6; cursor: default; }
.legacy-migration-records { min-height: 72px; }
.legacy-migration-records-empty {
    color: #829ab1;
    font-size: 14px;
    font-weight: 600;
}
.legacy-migration-alert {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}
.legacy-migration-alert--ok {
    background: #eef8f1;
    border: 1px solid #b7e0c4;
    color: #0f7a3c;
}
.legacy-migration-alert--error {
    background: #fef3f2;
    border: 1px solid #f3b4ae;
    color: var(--portal-danger);
}

/* ---------- External API Adapters panel ---------- */
.api-integrations-page { max-width: 980px; }
.api-integrations-title {
    margin: 0 0 16px;
    font-size: 34px;
    font-weight: 800;
    color: #102a43;
    letter-spacing: -.02em;
}
.api-integrations-panel {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    padding: 22px 20px;
}
.api-integrations-loading {
    color: #829ab1;
    font-size: 14px;
    font-weight: 600;
}
.api-integrations-panel .portal-table th {
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
    color: #486581;
    font-weight: 700;
}
.api-integrations-panel-head { margin-bottom: 12px; }
.api-integrations-panel-head h2 { margin: 0; font-size: 17px; font-weight: 800; color: #102a43; }
.api-integrations-simulator { margin-top: 16px; }
.api-integrations-note { margin: 0 0 14px; color: #627d98; font-size: 13px; }
.api-sim-form { display: grid; gap: 8px; margin-bottom: 14px; }
.api-sim-form label { font-size: 12px; font-weight: 700; color: #486581; }
.api-sim-form .portal-input,
.api-sim-payload {
    width: 100%; border: 1px solid #d7e3ef; border-radius: 10px;
    padding: 10px 12px; font: inherit; font-size: 13px; background: #fff;
}
.api-sim-result {
    margin: 0; background: #0f172a; color: #e2e8f0; border-radius: 10px;
    padding: 14px; font-size: 12px; line-height: 1.45; overflow: auto; max-height: 360px;
}

/* ---------- Immutable-style Audit Events panel ---------- */
.audit-events-page { max-width: 1100px; }
.audit-events-title {
    margin: 0 0 16px;
    font-size: 34px;
    font-weight: 800;
    color: #102a43;
    letter-spacing: -.02em;
}
.audit-events-panel {
    background: #fff;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(16, 42, 67, .04);
    padding: 22px 20px;
}
.audit-events-loading {
    color: #829ab1;
    font-size: 14px;
    font-weight: 600;
}
.audit-events-panel .portal-table th {
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
    color: #486581;
    font-weight: 700;
}
.audit-events-details {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    word-break: break-word;
}

@media (max-width: 1100px) {
    .portal-grid, .cms-stats, .cms-stat-row, .dash-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cms-split, .cms-field-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .cms-body-grid { grid-template-columns: 1fr; }
    .cms-header { flex-direction: column; align-items: flex-start; }
    .cms-header-copy h1 { font-size: 22px; }
    .cms-nav { flex-direction: row; flex-wrap: wrap; }
    .cms-nav-item { flex: 1 1 220px; }
    .portal-grid, .cms-stats, .cms-stat-row, .dash-metric-grid { grid-template-columns: 1fr; }
    .dash-home-title { font-size: 28px; }
    .branch-panel { grid-template-columns: 1fr; }
    .branch-create { border-right: 0; border-bottom: 1px solid #e4edf5; }
    .branch-page-title { font-size: 28px; }
    .cif-page-title { font-size: 28px; }
    .accounts-cash-title { font-size: 28px; }
    .accounts-cash-split,
    .accounts-cash-row--2 { grid-template-columns: 1fr; }
    .loan-products-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .loan-products-split { grid-template-columns: 1fr; }
    .loan-products-title { font-size: 28px; }
    .settlement-title { font-size: 28px; }
    .settlement-action { flex-direction: column; align-items: stretch; }
    .settlement-btn { width: 100%; white-space: normal; }
    .charges-gst-title { font-size: 28px; }
    .charges-gst-action { flex-direction: column; align-items: stretch; }
    .charges-gst-field { flex: 1 1 auto; }
    .charges-gst-btn { width: 100%; white-space: normal; }
    .legacy-migration-title { font-size: 28px; }
    .legacy-migration-btn { width: 100%; white-space: normal; }
    .api-integrations-title { font-size: 28px; }
    .audit-events-title { font-size: 28px; }
}
