:root {
    --brand-navy: #12385f;
    --brand-navy-deep: #0b2442;
    --brand-red: #e31c24;
    --brand-violet: #5a4688;
    --brand-gold: #f3b33d;
    --brand-teal: #0d8b86;
    --surface: #ffffff;
    --surface-soft: #f6f9fd;
    --border: #d8e1ec;
    --ink: #14263d;
    --muted: #617389;
    --shadow-soft: 0 18px 40px rgba(17, 39, 68, 0.08);
    --shadow-strong: 0 22px 44px rgba(17, 39, 68, 0.12);
    --tone-positive-start: #0b8f6a;
    --tone-positive-end: #16b67f;
    --tone-positive-border: #0e9f72;
    --tone-positive-shadow: rgba(11, 143, 106, 0.24);
    --tone-neutral-start: #f8fbff;
    --tone-neutral-end: #eef4fb;
    --tone-neutral-border: #cfdae8;
    --tone-neutral-text: #1c476f;
    --tone-warm-start: #fff4de;
    --tone-warm-end: #ffe7ba;
    --tone-warm-border: #f5c56c;
    --tone-warm-text: #9a5a00;
    --tone-warn-start: #fff8d9;
    --tone-warn-end: #ffe9a3;
    --tone-warn-border: #f1c85d;
    --tone-warn-text: #8c5b00;
    --tone-negative-start: #fff2f4;
    --tone-negative-end: #ffd9de;
    --tone-negative-border: #f3a4af;
    --tone-negative-text: #b2273b;
    --radius-card: 22px;
    --radius-card-lg: 26px;
    --radius-control: 8px;
    --radius-button: 10px;
    --radius-pill: 999px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
    color: var(--ink);
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

body.portal-page {
    background:
        radial-gradient(circle at 10% 0%, rgba(13, 139, 134, 0.18), transparent 26%),
        radial-gradient(circle at 92% 4%, rgba(243, 179, 61, 0.18), transparent 20%),
        linear-gradient(180deg, #0f2643 0%, #102f53 22%, #edf3fa 22%, #f5f8fc 58%, #f1f5fa 100%);
}

.portal-page .page-shell {
    margin: 0 auto;
    max-width: 1560px;
}

.member-form-page .page-shell {
    padding: 28px 20px 40px;
}

.member-list-page .page-shell {
    padding: 28px 20px 36px;
}

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

.portal-page .portal-main {
    min-width: 0;
}

.member-form-page .portal-main {
    max-width: 1120px;
}

.portal-page .portal-sidebar {
    position: sticky;
    top: 20px;
}

.portal-page .mobile-nav-open,
.portal-page .mobile-nav-close,
.portal-page .mobile-nav-overlay,
.portal-page .desktop-nav-open,
.portal-page .desktop-nav-close {
    display: none;
}

@media (min-width: 981px) {
    .portal-page .portal-sidebar {
        align-self: start;
        max-height: calc(100vh - 40px);
        min-height: 0;
    }

    .portal-page .app-sidebar-card {
        height: calc(100vh - 40px);
        max-height: calc(100vh - 40px);
        min-height: 0;
        overflow: hidden;
    }

    .portal-page .desktop-nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        align-self: flex-end;
        min-height: 30px;
        padding: 0 10px;
        border-radius: 9px;
        border: 1px solid rgba(180, 199, 224, 0.9);
        background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
        color: var(--brand-navy-deep);
        font-size: 11px;
        font-weight: 700;
        cursor: pointer;
    }

    .portal-page .desktop-nav-open {
        position: fixed;
        top: 16px;
        left: 14px;
        z-index: 1080;
        align-items: center;
        justify-content: center;
        min-height: 34px;
        padding: 0 12px;
        border-radius: 10px;
        border: 1px solid rgba(170, 197, 229, 0.95);
        background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
        color: var(--brand-navy-deep);
        font-size: 12px;
        font-weight: 800;
        box-shadow: 0 10px 22px rgba(13, 34, 57, 0.14);
        cursor: pointer;
    }

    body.portal-page.desktop-sidebar-collapsed .portal-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    body.portal-page.desktop-sidebar-collapsed .portal-sidebar {
        display: none;
    }

    body.portal-page.desktop-sidebar-collapsed .desktop-nav-open {
        display: inline-flex;
    }
}

.portal-page .app-sidebar-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(216, 225, 236, 0.92);
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(17, 39, 68, 0.08);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: hidden;
}

.portal-page .app-sidebar-brand {
    display: flex;
    gap: 10px;
    align-items: center;
}

.portal-page .app-sidebar-logo {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 6px;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f3f7fc 100%);
    border: 1px solid rgba(207, 218, 232, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.portal-page .app-sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/*
 * Shared entry-screen layout.
 * Sales, receipt, expense, purchase, returns, and payment screens should use
 * these base rules; JSP-level styles should only keep column widths or truly
 * screen-specific behavior.
 */
.entry-form-page .form-card {
    padding: 24px 26px 26px;
    overflow: hidden;
}

.entry-form-page .section-head {
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(216, 225, 236, 0.88);
}

.entry-form-page .entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.entry-form-page .entry-grid .full {
    grid-column: 1 / -1;
}

.entry-form-page textarea {
    min-height: 86px;
    resize: vertical;
}

.entry-form-page .transaction-lines-wrap {
    max-width: 100%;
    margin-top: 24px;
    overflow-x: auto;
    padding-bottom: 2px;
    border: 1px solid rgba(216, 225, 236, 0.92);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.entry-form-page .transaction-lines-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.entry-form-page .transaction-lines-table th,
.entry-form-page .transaction-lines-table td {
    padding: 12px 10px;
    vertical-align: top;
    border-bottom: 1px solid #e7edf5;
}

.entry-form-page .transaction-lines-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #f8fbff 0%, #f1f6fd 100%);
    color: var(--brand-navy-deep);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.entry-form-page .transaction-lines-table tbody tr:last-child td {
    border-bottom: none;
}

.entry-form-page .transaction-lines-table input,
.entry-form-page .transaction-lines-table select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 12px;
    box-sizing: border-box;
}

.entry-form-page .transaction-lines-table input[readonly] {
    background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
    color: #44556c;
    cursor: default;
}

.entry-form-page .line-tools {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.entry-form-page .line-action-cell {
    text-align: center;
    white-space: nowrap;
}

.entry-form-page .js-remove-line,
.entry-form-page .js-remove-receipt-line {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0 14px;
}

.portal-page .app-sidebar-kicker {
    margin-bottom: 4px;
    color: var(--brand-teal);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.portal-page .app-sidebar-brandtext h2 {
    margin: 0;
    color: var(--brand-navy-deep);
    font-size: 18px;
    line-height: 1.15;
}

.portal-page .app-sidebar-brandtext p {
    display: none;
}

.portal-page .app-sidebar-user {
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    border: 1px solid rgba(207, 218, 232, 0.9);
}

.portal-page .app-sidebar-user strong,
.portal-page .app-sidebar-user span {
    display: block;
}

.portal-page .app-sidebar-user strong {
    color: var(--brand-navy-deep);
    font-size: 15px;
}

.portal-page .app-sidebar-user span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.portal-page .app-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portal-page .app-nav-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.portal-page .app-nav-group-title {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.portal-page .app-nav-accordion {
    gap: 0;
}

.portal-page .app-nav-accordion .app-nav-group-title {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 2px 0;
}

.portal-page .app-nav-accordion .app-nav-group-title::-webkit-details-marker {
    display: none;
}

.portal-page .app-nav-accordion .app-nav-group-title::after {
    content: "+";
    font-size: 14px;
    font-weight: 700;
    color: #6f8299;
}

.portal-page .app-nav-accordion[open] .app-nav-group-title::after {
    content: "-";
}

.portal-page .app-nav-group-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.portal-page .app-nav-link {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(216, 225, 236, 0.92);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.portal-page .app-nav-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(17, 39, 68, 0.08);
    border-color: rgba(18, 56, 95, 0.2);
}

.portal-page .app-nav-link.is-active {
    border-color: rgba(18, 56, 95, 0.26);
    background: linear-gradient(180deg, #edf4fd 0%, #e5eef9 100%);
    box-shadow: inset 0 0 0 1px rgba(18, 56, 95, 0.06);
}

.portal-page .app-nav-link.is-disabled {
    opacity: 0.72;
    cursor: default;
    box-shadow: none;
}

.portal-page .app-nav-link.is-disabled:hover {
    transform: none;
    box-shadow: none;
}

.portal-page .app-nav-link-title {
    display: block;
    color: var(--brand-navy-deep);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.portal-page .app-nav-link-meta {
    display: none;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.portal-page .app-nav-section-label {
    display: block;
    margin: 2px 10px 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-page .app-sidebar-footer {
    margin-top: auto;
}

.portal-page .app-sidebar-logout {
    width: 100%;
}

.portal-page .app-sidebar-drawer {
    margin: 0;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
}

.portal-page .app-sidebar-toggle {
    display: none;
}

.portal-page .app-sidebar-drawer-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
    overflow: visible;
    padding-right: 0;
}

.portal-page .hero-card,
.portal-page .form-card,
.portal-page .filters-card,
.portal-page .table-card {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(216, 225, 236, 0.95);
    border-radius: var(--radius-card);
    box-shadow: 0 22px 42px rgba(15, 36, 63, 0.08);
    backdrop-filter: blur(10px);
}

.portal-page .hero-card {
    position: relative;
    overflow: hidden;
    padding: 28px 30px 74px;
    margin-bottom: 0;
    border-radius: var(--radius-card-lg);
    background:
        radial-gradient(circle at 88% 16%, rgba(243, 179, 61, 0.22), transparent 18%),
        radial-gradient(circle at 12% 82%, rgba(13, 139, 134, 0.18), transparent 22%),
        linear-gradient(145deg, rgba(8, 24, 44, 0.98) 0%, rgba(15, 41, 72, 0.98) 48%, rgba(18, 56, 95, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 28px 56px rgba(9, 24, 43, 0.24);
}

.portal-page .hero-card::before,
.portal-page .hero-card::after {
    content: "";
    position: absolute;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.portal-page .hero-card::before {
    width: 360px;
    height: 360px;
    right: -120px;
    top: -120px;
}

.portal-page .hero-card::after {
    width: 240px;
    height: 240px;
    left: -80px;
    bottom: -110px;
}

.member-form-page .form-card {
    position: relative;
    z-index: 2;
    margin-top: -38px;
    padding: 26px 28px 28px;
}

.member-list-page .filters-card {
    position: relative;
    z-index: 2;
    margin-top: -38px;
    padding: 22px 22px;
    margin-bottom: 18px;
}

.member-list-page .table-card {
    padding: 22px;
}

.portal-page .hero-grid {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
}

.portal-page .brand-block {
    display: flex;
    gap: 0;
    align-items: flex-start;
}

.portal-page .brand-logo {
    display: none;
}

.portal-page .brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.portal-page .brand-kicker {
    margin-bottom: 6px;
    color: #74e6de;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.member-form-page .brand-name {
    margin: 0;
    font-size: 36px;
    line-height: 1.06;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.member-list-page .brand-name {
    margin: 0;
    font-size: 40px;
    line-height: 1.04;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.portal-page .brand-desc {
    margin: 10px 0 12px;
    max-width: 760px;
    color: rgba(230, 238, 247, 0.84);
    font-size: 16px;
    line-height: 1.7;
}

.portal-page .brand-powered {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(231, 238, 245, 0.84);
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.portal-page .brand-powered::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-gold);
    box-shadow: 0 0 0 4px rgba(243, 179, 61, 0.16);
}

.member-form-page .hero-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
    width: 340px;
    min-width: 340px;
    margin-top: 24px;
}

.member-list-page .hero-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
    width: 340px;
    min-width: 340px;
    margin-top: 24px;
}

.member-form-page .status-chip {
    width: 100%;
    min-width: 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    text-align: left;
    box-shadow: 0 16px 32px rgba(3, 12, 24, 0.16);
    backdrop-filter: blur(8px);
}

.member-form-page .status-chip strong {
    display: block;
    font-size: 18px;
    line-height: 1.1;
}

.member-form-page .status-chip span {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.84;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.member-form-page .hero-action-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
}

.member-form-page .hero-actions .btn {
    width: auto;
    min-width: 0;
    min-height: 44px;
}

.member-list-page .stats-card {
    width: 100%;
    min-width: 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    box-shadow: 0 16px 32px rgba(3, 12, 24, 0.16);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.member-list-page .stats-card strong {
    display: block;
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.member-list-page .stats-card span {
    display: block;
    margin-top: 0;
    font-size: 11px;
    opacity: 0.84;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.member-list-page .hero-action-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
}

.member-list-page .hero-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
}

.portal-page .section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.member-form-page .section-head {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(216, 225, 236, 0.88);
}

.member-list-page .section-head {
    margin-bottom: 18px;
}

.portal-page .section-head h2 {
    margin: 0;
    color: var(--brand-navy-deep);
    font-size: 26px;
    letter-spacing: -0.02em;
}

.portal-page .section-head p,
.member-list-page .filters-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.portal-page .section-badge {
    padding: 9px 14px;
    border-radius: var(--radius-pill);
    background: linear-gradient(180deg, #f9fbff 0%, #f1f7ff 100%);
    border: 1px solid rgba(170, 197, 229, 0.7);
    color: var(--brand-navy);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.portal-page .section-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.member-form-page .grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.sales-invoice-view-page .invoice-detail-grid,
.sales-invoice-view-page .invoice-amount-grid {
    display: grid;
    gap: 16px;
}

.sales-invoice-view-page .invoice-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.sales-invoice-view-page .invoice-amount-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sales-invoice-view-page .detail-item,
.sales-invoice-view-page .amount-item {
    min-width: 0;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(207, 218, 232, 0.95);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.sales-invoice-view-page .detail-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sales-invoice-view-page .detail-value,
.sales-invoice-view-page .amount-value {
    display: block;
    color: var(--brand-navy-deep);
    font-size: 26px;
    line-height: 1.2;
    letter-spacing: 0;
    word-break: break-word;
}

.sales-invoice-view-page .detail-value {
    font-size: 18px;
    font-weight: 700;
}

.sales-invoice-view-page .amount-item {
    background: linear-gradient(180deg, #fbfdff 0%, #f3f8ff 100%);
}

.sales-invoice-view-page .amount-value {
    font-size: 24px;
    font-weight: 800;
}

.sales-invoice-view-page .amount-item-total {
    border-color: rgba(243, 179, 61, 0.78);
    background: linear-gradient(180deg, #fff9ef 0%, #fff3d8 100%);
}

.sales-invoice-view-page .amount-item-balance {
    border-color: rgba(18, 56, 95, 0.22);
    background: linear-gradient(180deg, #f4f8fd 0%, #eaf1fb 100%);
}

.payment-view-page .form-card,
.expense-entry-view-page .form-card,
.purchase-entry-view-page .form-card,
.purchase-return-view-page .form-card {
    position: relative;
    z-index: 2;
    margin-top: -38px;
    padding: 24px 26px 26px;
}

.payment-view-page .section-head,
.expense-entry-view-page .section-head,
.purchase-entry-view-page .section-head,
.purchase-return-view-page .section-head {
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(216, 225, 236, 0.88);
}

.payment-view-page .grid,
.expense-entry-view-page .grid,
.purchase-entry-view-page .grid,
.purchase-return-view-page .grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.payment-view-page .grid > div,
.expense-entry-view-page .grid > div,
.purchase-entry-view-page .grid > div,
.purchase-return-view-page .grid > div {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(207, 218, 232, 0.95);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.payment-view-page .grid label,
.expense-entry-view-page .grid label,
.purchase-entry-view-page .grid label,
.purchase-return-view-page .grid label {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 11px;
}

.payment-view-page .grid input[readonly],
.expense-entry-view-page .grid input[readonly],
.purchase-entry-view-page .grid input[readonly],
.purchase-return-view-page .grid input[readonly] {
    min-height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--brand-navy-deep);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
}

.member-form-page .member-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.85fr);
    gap: 22px;
    align-items: start;
}

.member-form-page .member-form-layout.member-form-layout-single {
    grid-template-columns: minmax(0, 1fr);
}

.member-form-page .member-form-primary {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.member-form-page .member-form-aside {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.member-form-page .member-panel,
.member-form-page .member-summary-card,
.member-form-page .member-reference-card {
    padding: 20px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(216, 225, 236, 0.96);
    box-shadow: 0 14px 28px rgba(17, 39, 68, 0.06);
}

.member-form-page .member-info-card {
    border: 1px solid rgba(184, 201, 222, 0.96);
    box-shadow:
        0 16px 30px rgba(17, 39, 68, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.member-form-page .member-panel-head {
    margin-bottom: 16px;
}

.member-form-page .member-panel-head h3 {
    margin: 0;
    color: var(--brand-navy-deep);
    font-size: 20px;
    letter-spacing: -0.02em;
}

.member-form-page .member-panel-head p,
.member-form-page .member-reference-card p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.member-form-page .gl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.member-form-page .member-summary-card {
    background:
        radial-gradient(circle at top right, rgba(243, 179, 61, 0.18), transparent 28%),
        linear-gradient(160deg, #0f2a48 0%, #12385f 100%);
    border-color: rgba(116, 163, 219, 0.42);
    color: #ffffff;
    box-shadow: 0 18px 34px rgba(10, 28, 47, 0.18);
}

.member-form-page .member-reference-card summary small,
.member-form-page .ivx-card-title {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.member-form-page .ivx-card.highlight {
    padding: 18px 18px 20px;
    background:
        radial-gradient(circle at top right, rgba(243, 179, 61, 0.18), transparent 28%),
        linear-gradient(160deg, #0f2a48 0%, #12385f 100%);
    color: #ffffff;
    border-color: rgba(116, 163, 219, 0.42);
    box-shadow: 0 18px 34px rgba(10, 28, 47, 0.18);
}

.member-form-page .ivx-card-title {
    color: rgba(116, 230, 222, 0.94);
}

.member-form-page .ivx-gl-main {
    margin-top: 10px;
    font-size: 24px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.member-form-page .ivx-gl-sub {
    margin-top: 8px;
    color: rgba(234, 240, 247, 0.88);
    font-size: 13px;
    line-height: 1.5;
}

.member-form-page .member-reference-card summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    color: var(--brand-navy-deep);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.member-form-page .member-reference-card summary::-webkit-details-marker {
    display: none;
}

.member-form-page .member-reference-card summary::after {
    content: "+";
    color: var(--brand-teal);
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.member-form-page .member-reference-card[open] summary::after {
    content: "-";
}

.member-form-page .member-reference-body {
    margin-top: 14px;
}

.member-form-page .member-reference-card p,
.member-form-page .member-reference-card .table-container {
    margin-top: 14px;
}

.member-form-page .member-reference-tablewrap {
    max-height: 320px;
    overflow: auto;
    border: 1px solid rgba(216, 225, 236, 0.9);
    border-radius: 14px;
    background: #ffffff;
    padding: 2px;
}

.member-form-page .member-reference-card table {
    width: 100%;
    min-width: 640px;
    border-collapse: separate;
    border-spacing: 0;
}

.member-form-page .member-reference-card th,
.member-form-page .member-reference-card td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(216, 225, 236, 0.8);
    vertical-align: top;
}

.member-form-page .member-reference-card thead th {
    position: sticky;
    top: 0;
    background: #f7fbff;
    color: var(--brand-navy-deep);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.member-form-page .full {
    grid-column: 1 / -1;
}

.portal-page label {
    display: block;
    margin-bottom: 7px;
    color: var(--brand-navy-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-page input,
.portal-page select,
.portal-page textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d7e0ea;
    border-radius: var(--radius-control);
    background: linear-gradient(180deg, #fbfdff 0%, #f6f9fd 100%);
    color: var(--ink);
    font: inherit;
    min-height: 46px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.portal-page input:focus,
.portal-page select:focus,
.portal-page textarea:focus {
    outline: none;
    border-color: rgba(11, 87, 208, 0.32);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(11, 87, 208, 0.12);
}

.portal-page .searchable-select {
    position: relative;
}

.portal-page .searchable-select-input {
    padding-right: 42px;
}

.portal-page .searchable-select::after {
    content: "";
    position: absolute;
    top: 19px;
    right: 16px;
    width: 9px;
    height: 9px;
    border-right: 2px solid #617389;
    border-bottom: 2px solid #617389;
    transform: rotate(45deg);
    pointer-events: none;
}

.portal-page .searchable-select-native {
    display: none !important;
}

.portal-page .searchable-select-menu {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    display: none;
    padding: 6px;
    border: 1px solid rgba(203, 216, 232, 0.98);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 18px 36px rgba(17, 39, 68, 0.16);
}

.portal-page .searchable-select.is-open .searchable-select-menu {
    display: block;
}

.portal-page .searchable-select-option,
.portal-page .searchable-select-empty {
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    line-height: 1.35;
    text-align: left;
}

.portal-page .searchable-select-option {
    cursor: pointer;
}

.portal-page .searchable-select-option:hover,
.portal-page .searchable-select-option.is-active {
    background: #eef5fc;
    color: var(--brand-navy-deep);
}

.portal-page .searchable-select-empty {
    color: var(--muted);
}

.member-form-page textarea {
    min-height: 96px;
    resize: vertical;
}

.member-form-page .field-hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.member-form-page .transaction-lines-wrap,
.member-form-page .invoice-lines-wrap {
    border: 1px solid rgba(203, 216, 232, 0.95);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    overflow-x: auto;
}

.member-form-page .transaction-lines-table,
.member-form-page .invoice-lines-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.member-form-page .transaction-lines-table th,
.member-form-page .invoice-lines-table th {
    padding: 11px 10px;
    background: #eef5fc;
    color: var(--brand-navy-deep);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid #dbe6f2;
}

.member-form-page .transaction-lines-table td,
.member-form-page .invoice-lines-table td {
    padding: 9px 8px;
    vertical-align: middle;
    border-bottom: 1px solid #edf2f7;
    background: #fff;
}

.member-form-page .transaction-lines-table tbody tr:last-child td,
.member-form-page .invoice-lines-table tbody tr:last-child td {
    border-bottom: 0;
}

.member-form-page .transaction-lines-table tbody tr,
.member-form-page .invoice-lines-table tbody tr {
    transition: background 0.16s ease, box-shadow 0.16s ease;
}

.member-form-page .transaction-lines-table tbody tr.is-active td,
.member-form-page .invoice-lines-table tbody tr.is-active td {
    background: #f8fbff;
    box-shadow: inset 0 1px 0 rgba(13, 139, 134, 0.16), inset 0 -1px 0 rgba(13, 139, 134, 0.16);
}

.member-form-page .transaction-lines-table input,
.member-form-page .transaction-lines-table select,
.member-form-page .invoice-lines-table input,
.member-form-page .invoice-lines-table select {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 7px;
    background: #ffffff;
}

.member-form-page .transaction-lines-table input[readonly],
.member-form-page .invoice-lines-table input[readonly] {
    background: #f4f7fb;
    color: #52677f;
}

.member-form-page .line-picker {
    font-weight: 700;
}

.member-form-page .line-description-input {
    min-width: 220px;
}

.member-form-page .line-number-input {
    text-align: right;
}

.member-form-page .line-code-input,
.member-form-page .line-account-label,
.member-form-page .line-account-select {
    font-size: 12px;
}

.member-form-page .line-action-cell {
    text-align: center;
}

.member-form-page .line-action-cell .btn {
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
    border-radius: 8px;
}

.member-form-page .line-tools {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.member-form-page .line-tools-top {
    margin: 18px 0 10px;
}

.member-form-page .line-tools-top .btn-add {
    min-width: 132px;
}

.member-form-page .summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.member-form-page .summary-grid-single {
    grid-template-columns: minmax(260px, 360px);
    justify-content: end;
}

.member-form-page .summary-card {
    min-height: 132px;
    padding: 16px 18px;
    border: 1px solid rgba(207, 218, 232, 0.95);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 10px 22px rgba(15, 35, 62, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.member-form-page .summary-card label {
    display: block;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.member-form-page .summary-card input {
    min-height: 0;
    height: auto;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 34px;
    font-weight: 800;
    color: var(--brand-navy-deep);
    line-height: 1.05;
}

.member-form-page .summary-card input:focus {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.member-form-page .summary-card-total {
    border-color: rgba(243, 179, 61, 0.78);
    background: linear-gradient(180deg, #fff9ef 0%, #fff3d8 100%);
}

.member-form-page .document-toolbar {
    margin: 18px 0 14px;
    padding: 12px;
    border: 1px solid rgba(216, 225, 236, 0.92);
    border-radius: 12px;
    background: #f8fbff;
}

.member-form-page .jv-lines-card {
    margin-top: 18px;
    padding: 0;
    overflow: hidden;
}

.member-form-page .jv-lines-card .section-head {
    margin: 0;
    padding: 18px 20px;
    border-bottom: 1px solid #dbe6f2;
}

.member-form-page .jv-lines-card .section-head h2 {
    margin-bottom: 6px;
}

.member-form-page .jv-lines-card .field-hint {
    margin: 0;
    max-width: 520px;
}

.member-form-page .jv-lines-wrap {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.member-form-page .jv-lines-table {
    min-width: 1120px;
}

.member-form-page .jv-lines-table th:nth-child(1),
.member-form-page .jv-lines-table td:nth-child(1) {
    width: 26%;
}

.member-form-page .jv-lines-table th:nth-child(2),
.member-form-page .jv-lines-table td:nth-child(2),
.member-form-page .jv-lines-table th:nth-child(3),
.member-form-page .jv-lines-table td:nth-child(3) {
    width: 14%;
}

.member-form-page .jv-lines-table th:nth-child(4),
.member-form-page .jv-lines-table td:nth-child(4) {
    width: 9%;
}

.member-form-page .jv-lines-table th:nth-child(5),
.member-form-page .jv-lines-table td:nth-child(5) {
    width: 13%;
}

.member-form-page .jv-lines-table th:nth-child(6),
.member-form-page .jv-lines-table td:nth-child(6) {
    width: 15%;
}

.member-form-page .jv-lines-table th:nth-child(7),
.member-form-page .jv-lines-table td:nth-child(7) {
    width: 9%;
}

.member-form-page .jv-lines-table .btn-delete {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
}

.portal-page .actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.member-form-page .actions {
    align-items: stretch;
}

.portal-page .actions > a,
.portal-page .actions > button,
.portal-page .actions > form {
    margin: 0;
}

.portal-page .actions form {
    display: inline-flex;
    align-items: stretch;
}

.portal-page .actions form .btn,
.portal-page .actions form button.btn,
.portal-page .actions form button {
    min-height: 46px;
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-height: 46px;
    padding: 0 20px;
    border-radius: var(--radius-button);
    border: none;
    text-decoration: none;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    appearance: none;
    background: #ffffff;
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.portal-page button.btn,
.portal-page .actions .btn,
.portal-page .actions button.btn {
    width: auto;
    min-width: 140px;
}

.btn-compact {
    min-width: 0;
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 700;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(20, 92, 214, 0.14);
}

.btn-save,
.btn-add {
    background: linear-gradient(135deg, var(--tone-positive-start) 0%, var(--tone-positive-end) 100%);
    color: #fff;
    border: 1px solid var(--tone-positive-border);
    box-shadow: 0 16px 28px var(--tone-positive-shadow);
}

.btn-search {
    background: linear-gradient(135deg, #12385f 0%, #145d84 100%);
    color: #fff;
    border: 1px solid rgba(19, 78, 113, 0.82);
    box-shadow: 0 14px 26px rgba(18, 56, 95, 0.18);
}

.btn-back {
    background: linear-gradient(180deg, var(--tone-neutral-start) 0%, var(--tone-neutral-end) 100%);
    color: var(--tone-neutral-text);
    border: 1px solid var(--tone-neutral-border);
    box-shadow: 0 10px 20px rgba(28, 71, 111, 0.08);
}

.btn-reset {
    background: linear-gradient(180deg, var(--tone-warn-start) 0%, var(--tone-warn-end) 100%);
    color: var(--tone-warn-text);
    border: 1px solid var(--tone-warn-border);
    box-shadow: 0 10px 20px rgba(171, 117, 0, 0.12);
}

.btn-edit {
    background: linear-gradient(180deg, var(--tone-warm-start) 0%, var(--tone-warm-end) 100%);
    color: var(--tone-warm-text);
    border: 1px solid var(--tone-warm-border);
    box-shadow: 0 12px 22px rgba(154, 90, 0, 0.12);
}

.btn-delete,
.btn-logout {
    background: linear-gradient(180deg, var(--tone-negative-start) 0%, var(--tone-negative-end) 100%);
    color: var(--tone-negative-text);
    border: 1px solid var(--tone-negative-border);
    box-shadow: 0 12px 22px rgba(178, 39, 59, 0.12);
}

.member-form-page .actions .btn-save {
    min-width: 190px;
}

.member-form-page .actions .btn-back,
.member-form-page .actions .btn-reset {
    min-width: 140px;
}

@media (max-width: 1320px) {
    .member-form-page .member-form-layout {
        grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.95fr);
        gap: 18px;
    }
}

@media (max-width: 1180px) {
    .member-form-page .member-form-layout {
        grid-template-columns: 1fr;
    }

    .member-form-page .member-form-aside {
        position: static;
        top: auto;
    }

    .member-form-page .member-reference-tablewrap {
        max-height: 280px;
    }
}

@media (max-width: 1100px) {
    .member-form-page .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .member-form-page .summary-grid {
        grid-template-columns: 1fr;
    }
}

.member-list-page .filters-head {
    margin-bottom: 16px;
}

.member-list-page .filters-head h2 {
    margin: 0;
    color: var(--brand-navy-deep);
    font-size: 24px;
    letter-spacing: -0.02em;
}

.member-list-page .search-bar {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(190px, 1fr) minmax(170px, 0.9fr) minmax(140px, 0.8fr) auto auto;
    gap: 12px;
    align-items: end;
}

.auth-user-list-page .search-bar {
    grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr) auto auto;
}

.coa-list-page .search-bar,
.mapping-list-page .search-bar {
    grid-template-columns: minmax(0, 2fr) minmax(190px, 1fr) minmax(150px, 0.9fr) auto auto;
}

.member-list-page .field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.member-list-page .field label {
    margin-bottom: 0;
}

.member-list-page .search-bar button[type="submit"] {
    min-width: 140px;
}

.member-list-page .search-bar .btn-reset {
    min-width: 140px;
}

.member-list-page .table-container {
    overflow-x: auto;
    padding-bottom: 2px;
}

.member-list-page table {
    width: 100%;
    min-width: 1260px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    overflow: hidden;
    border: 1px solid rgba(216, 225, 236, 0.9);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.member-list-page th,
.member-list-page td {
    padding: 15px 14px;
    font-size: 13px;
    vertical-align: top;
    word-break: break-word;
    border-bottom: 1px solid #e7edf5;
}

.member-list-page th:last-child,
.member-list-page td:last-child {
    width: 248px;
}

.member-list-page th:nth-last-child(2),
.member-list-page td:nth-last-child(2) {
    width: 130px;
}

.member-list-page th {
    background: linear-gradient(180deg, #f8fbff 0%, #f1f6fd 100%);
    color: var(--brand-navy-deep);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.member-list-page tbody tr {
    transition: background 0.16s ease, transform 0.16s ease;
}

.member-list-page tbody tr:hover {
    background: rgba(246, 250, 255, 0.96);
}

.member-list-page tr:last-child td {
    border-bottom: none;
}

.member-list-page .empty {
    text-align: center;
    padding: 26px 16px;
    color: var(--muted);
    font-size: 14px;
}

.member-list-page .member-name {
    font-size: 19px;
    font-weight: 800;
    color: var(--brand-navy-deep);
    margin-bottom: 6px;
}

.member-list-page .meta,
.member-list-page .meta-tight {
    color: #4d5f75;
    font-size: 12.5px;
    line-height: 1.6;
    word-break: break-word;
}

.member-list-page .meta-tight {
    margin-top: 4px;
}

.member-list-page .status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
    white-space: nowrap;
    min-width: 78px;
}

.member-list-page .status-active {
    background: #ecfdf3;
    color: #0f8a47;
}

.member-list-page .status-inactive {
    background: #fff1f2;
    color: #c62828;
}

.member-list-page .actions-cell {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    min-width: 208px;
    white-space: normal;
}

.member-list-page .actions-cell .btn {
    margin: 0;
    min-width: 84px;
    min-height: 42px;
    padding: 0 14px;
    flex: 0 0 auto;
}

.member-list-page .more-details {
    margin-top: 10px;
}

.member-list-page .more-details summary {
    cursor: pointer;
    color: #0b57d0;
    font-size: 12px;
    font-weight: 700;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.member-list-page .more-details summary::-webkit-details-marker {
    display: none;
}

.member-list-page .details-card {
    margin-top: 10px;
    padding: 14px;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
    border: 1px solid #e3eaf3;
    border-radius: 12px;
}

.auth-user-form-page .role-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.coa-form-page .coa-posting-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #d7e0ea;
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfdff 0%, #f6f9fd 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.coa-form-page .coa-posting-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 2px 0 0;
    padding: 0;
    border-radius: 4px;
    box-shadow: none;
    accent-color: var(--brand-teal);
}

.coa-form-page .coa-posting-option span {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.coa-form-page .coa-posting-option strong {
    color: var(--brand-navy-deep);
    font-size: 14px;
    line-height: 1.3;
}

.coa-form-page .coa-posting-option small {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-user-form-page .role-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #d7e0ea;
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfdff 0%, #f6f9fd 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.auth-user-form-page .role-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 2px 0 0;
    padding: 0;
    border-radius: 4px;
    box-shadow: none;
    accent-color: var(--brand-teal);
}

.auth-user-form-page .role-option span {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-user-form-page .role-option strong {
    color: var(--brand-navy-deep);
    font-size: 14px;
    line-height: 1.3;
}

.auth-user-form-page .role-option small {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.portal-page .inline-error {
    margin-bottom: 18px;
    padding: 13px 14px;
    border-radius: 12px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #b42318;
    font-size: 13px;
    font-weight: 700;
}

.portal-page .inline-success {
    margin-bottom: 18px;
    padding: 13px 14px;
    border-radius: 12px;
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
    font-size: 13px;
    font-weight: 700;
}

.portal-page .pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.portal-page .page-summary {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.portal-page .pagination-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

body.login-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px 20px;
    background:
        radial-gradient(circle at 16% 18%, rgba(90, 70, 136, 0.34), transparent 24%),
        radial-gradient(circle at 84% 82%, rgba(227, 28, 36, 0.22), transparent 22%),
        radial-gradient(circle at 68% 12%, rgba(13, 139, 134, 0.2), transparent 18%),
        linear-gradient(135deg, #061426 0%, #0b2442 42%, #0a213b 100%);
    overflow: auto;
}

body.login-page::before,
body.login-page::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    filter: blur(26px);
}

body.login-page::before {
    top: 72px;
    left: 28px;
    width: 240px;
    height: 240px;
    background: rgba(243, 179, 61, 0.14);
}

body.login-page::after {
    right: 44px;
    bottom: 46px;
    width: 300px;
    height: 300px;
    background: rgba(90, 70, 136, 0.16);
}

.login-shell {
    position: relative;
    z-index: 1;
    width: min(1280px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(360px, 420px);
    gap: 32px;
    align-items: stretch;
}

.innervex-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
}

.login-hero-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 736px;
    padding: 52px 56px 40px;
    background:
        radial-gradient(circle at 84% 14%, rgba(243, 179, 61, 0.24), transparent 18%),
        radial-gradient(circle at 16% 86%, rgba(13, 139, 134, 0.18), transparent 22%),
        linear-gradient(150deg, rgba(7, 22, 40, 0.98) 0%, rgba(13, 36, 63, 0.98) 48%, rgba(17, 57, 96, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    box-shadow: 0 36px 82px rgba(4, 18, 34, 0.34);
}

.login-hero-card::before,
.login-hero-card::after {
    content: "";
    position: absolute;
    z-index: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-hero-card::before {
    width: 440px;
    height: 440px;
    right: -150px;
    top: -120px;
}

.login-hero-card::after {
    width: 340px;
    height: 340px;
    left: -140px;
    bottom: -160px;
}

.login-access-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: stretch;
    min-height: 736px;
    padding: 52px 42px 40px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.985) 0%, rgba(248, 251, 255, 0.985) 100%);
    border: 1px solid rgba(216, 225, 236, 0.95);
    box-shadow: 0 28px 60px rgba(8, 22, 40, 0.24);
}

.login-access-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 34px;
    right: 34px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, rgba(13, 139, 134, 0.95), rgba(11, 87, 208, 0.9), rgba(90, 70, 136, 0.9));
}

.innervex-stack > * + * {
    margin-top: 12px;
}

.login-hero-top,
.login-access-head,
.innervex-form,
.innervex-caption,
.login-feature-grid {
    position: relative;
    z-index: 1;
}

.login-hero-top {
    display: flex;
    flex-direction: column;
    gap: 26px;
    max-width: 860px;
}

.login-brandbar {
    display: flex;
    align-items: center;
    gap: 22px;
    width: 100%;
}

.login-brandline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-width: 0;
    flex: 1;
}

.login-inline-title {
    margin: 0;
    font-size: clamp(24px, 2.8vw, 38px);
    line-height: 1.08;
    letter-spacing: -0.03em;
    min-width: 0;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.login-inline-kicker {
    margin: 0;
    white-space: nowrap;
    align-self: center;
    justify-self: end;
    letter-spacing: 0.14em;
}

.innervex-eyebrow {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand-teal);
}

.innervex-title {
    margin: 0;
    font-size: 34px;
    line-height: 1.06;
    color: var(--brand-navy-deep);
}

.innervex-text {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.login-hero-card .innervex-eyebrow {
    color: #74e6de;
}

.login-hero-card .innervex-title {
    max-width: 760px;
    font-size: clamp(52px, 5.8vw, 76px);
    color: #ffffff;
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.login-hero-card .login-inline-title {
    max-width: none;
    font-size: clamp(24px, 2.8vw, 38px);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.login-hero-card .innervex-text {
    max-width: 620px;
    color: rgba(232, 240, 248, 0.86);
    font-size: 20px;
    line-height: 1.7;
}

.login-access-card .innervex-title {
    font-size: clamp(40px, 4vw, 54px);
    line-height: 1;
    letter-spacing: -0.05em;
}

.login-access-card .innervex-text {
    font-size: 17px;
    color: #5d7088;
}

.login-copy {
    max-width: 760px;
}

.login-feature-grid {
    margin: 40px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 680px;
}

.login-feature-card {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    column-gap: 18px;
    align-items: start;
    min-height: auto;
    padding: 18px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
}

.login-feature-card:first-child {
    padding-top: 0;
    border-top: none;
}

.login-feature-index {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    height: auto;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.46);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.login-feature-copy {
    min-width: 0;
}

.innervex-feature-title {
    display: block;
    margin-bottom: 6px;
    font-size: 20px;
    line-height: 1.3;
}

.innervex-feature-text {
    margin: 0;
    line-height: 1.65;
}

.login-hero-card .innervex-feature-title {
    color: #ffffff;
}

.login-hero-card .innervex-feature-text {
    color: rgba(230, 238, 247, 0.8);
}

.innervex-button {
    width: 100%;
    min-height: 56px;
    margin-top: 14px;
    border: none;
    border-radius: var(--radius-button);
    background: linear-gradient(135deg, #0d4ec2 0%, #1769f2 60%, #2a7ef6 100%);
    color: #fff;
    font: inherit;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 20px 34px rgba(11, 87, 208, 0.28);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.innervex-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 40px rgba(11, 87, 208, 0.32);
}

.innervex-caption {
    margin: 26px 0 0;
    font-size: 12px;
    color: rgba(227, 235, 244, 0.74);
    align-self: flex-end;
    text-align: right;
}

.login-logo-wrap {
    width: 92px;
    height: 92px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow:
        0 20px 36px rgba(3, 12, 24, 0.24),
        0 0 0 1px rgba(255, 255, 255, 0.4);
}

.login-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.innervex-form {
    margin-top: 42px;
}

.login-page .error-banner {
    margin-bottom: 18px;
    padding: 13px 14px;
    border-radius: 12px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #b42318;
    font-size: 13px;
    font-weight: 700;
}

.login-page .field {
    margin-bottom: 20px;
}

.login-page .field label {
    display: block;
    margin-bottom: 7px;
    color: var(--brand-navy-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-page .field input {
    width: 100%;
    min-height: 56px;
    padding: 15px 16px;
    border: 1px solid #d5e0ed;
    border-radius: var(--radius-control);
    background: linear-gradient(180deg, #fbfdff 0%, #f7fafe 100%);
    color: var(--ink);
    font: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.login-page .field input:focus {
    outline: none;
    border-color: rgba(90, 70, 136, 0.45);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(90, 70, 136, 0.12);
}

@media (max-width: 980px) {
    .portal-page .portal-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .portal-page .portal-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(84vw, 320px);
        height: 100vh;
        z-index: 1100;
        transform: translateX(-104%);
        transition: transform 0.22s ease;
        margin: 0;
        pointer-events: none;
    }

    body.portal-page.mobile-nav-active .portal-sidebar {
        transform: translateX(0);
        pointer-events: auto;
    }

    .portal-page .mobile-nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(10, 25, 44, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 1090;
    }

    body.portal-page.mobile-nav-active .mobile-nav-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .portal-page .mobile-nav-open {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 12px;
        left: 12px;
        min-height: 38px;
        min-width: 86px;
        padding: 0 14px;
        border-radius: 10px;
        border: 1px solid rgba(170, 197, 229, 0.95);
        background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
        color: var(--brand-navy-deep);
        font-size: 13px;
        font-weight: 800;
        box-shadow: 0 10px 24px rgba(13, 34, 57, 0.16);
        z-index: 1110;
        cursor: pointer;
    }

    .portal-page .desktop-nav-open,
    .portal-page .desktop-nav-close {
        display: none !important;
    }

    .portal-page .mobile-nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        align-self: flex-end;
        min-height: 34px;
        padding: 0 12px;
        border-radius: 9px;
        border: 1px solid rgba(180, 199, 224, 0.9);
        background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
        color: var(--brand-navy-deep);
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
    }

    .portal-page .portal-main {
        padding-top: 50px;
    }

    .portal-page .app-sidebar-card {
        height: 100vh;
        max-height: 100vh;
        padding: 14px;
        gap: 12px;
        border-radius: 0 18px 18px 0;
        border-left: none;
    }

    .portal-page .app-sidebar-brand {
        gap: 12px;
        align-items: center;
    }

    .portal-page .app-sidebar-logo {
        width: 52px;
        height: 52px;
        min-width: 52px;
        padding: 7px;
        border-radius: 14px;
    }

    .portal-page .app-sidebar-kicker {
        margin-bottom: 2px;
        font-size: 10px;
    }

    .portal-page .app-sidebar-brandtext h2 {
        font-size: 18px;
    }

    .portal-page .app-sidebar-brandtext p {
        display: none;
    }

    .portal-page .app-sidebar-user {
        display: none;
    }

    .portal-page .app-sidebar-brandtext p {
        display: none;
    }

    .portal-page .app-sidebar-user {
        display: none;
    }

    .portal-page .app-sidebar-drawer {
        border-top: 1px solid rgba(216, 225, 236, 0.92);
        padding-top: 12px;
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
    }

    .portal-page .app-sidebar-toggle {
        list-style: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
        border-radius: 12px;
        border: 1px solid rgba(180, 199, 224, 0.92);
        background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
        color: var(--brand-navy-deep);
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
    }

    .portal-page .app-sidebar-toggle::-webkit-details-marker {
        display: none;
    }

    .portal-page .app-sidebar-toggle::after {
        content: "Open";
        color: var(--muted);
        font-size: 11px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .portal-page .app-sidebar-drawer[open] .app-sidebar-toggle::after {
        content: "Close";
    }

    .portal-page .app-sidebar-drawer-body {
        display: none;
        flex: 1 1 auto;
        padding-top: 10px;
        overflow: visible;
    }

    .portal-page .app-sidebar-drawer[open] .app-sidebar-drawer-body {
        display: flex;
        gap: 12px;
        min-height: 0;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .portal-page .app-nav-accordion .app-nav-group-title {
        font-size: 10px;
    }

    .portal-page .app-sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .portal-page .app-nav-group-title {
        padding: 0 2px;
    }

    .portal-page .app-nav-link {
        min-width: 0;
        padding: 11px 12px;
        border-radius: 12px;
    }

    .portal-page .app-sidebar-footer {
        margin-top: 0;
        display: flex;
        justify-content: stretch;
    }

    .portal-page .app-sidebar-logout {
        width: 100%;
        min-width: 0;
    }

    .member-list-page .page-shell {
        padding: 14px 12px 24px;
    }

    .member-list-page .hero-card,
    .member-list-page .filters-card,
    .member-list-page .table-card {
        border-radius: 18px;
        padding: 18px;
    }

    .member-list-page .filters-card {
        margin-top: -18px;
    }

    .member-list-page .hero-grid,
    .member-list-page .brand-block,
    .member-list-page .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .member-list-page .hero-actions {
        width: 100%;
        align-items: stretch;
    }

    .member-list-page .hero-action-list {
        grid-template-columns: 1fr;
    }

    .member-list-page .stats-card {
        width: 100%;
    }

    .member-list-page .search-bar {
        grid-template-columns: 1fr;
    }

    .member-list-page .search-bar > * {
        width: 100%;
    }

    .member-list-page .search-bar button[type="submit"] {
        width: 100%;
    }
}

@media (max-width: 1180px) {
    .login-brandline {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .login-inline-title {
        white-space: normal;
        text-wrap: balance;
    }

    .login-inline-kicker {
        justify-self: start;
    }
}

@media (max-width: 920px) {
    body.login-page {
        padding: 16px 12px;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .innervex-card {
        min-height: auto;
    }

    .innervex-caption {
        align-self: flex-start;
        text-align: left;
    }

    .login-hero-card .innervex-title,
    .login-access-card .innervex-title {
        font-size: 34px;
    }

    .login-brandbar,
    .login-brandline {
        align-items: flex-start;
    }

    .login-brandline {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .login-inline-title {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .login-inline-kicker {
        justify-self: start;
    }

    .login-hero-card .innervex-text {
        font-size: 16px;
    }

    .login-logo-wrap {
        width: 82px;
        height: 82px;
        border-radius: 16px;
    }

    .login-feature-card {
        grid-template-columns: 48px minmax(0, 1fr);
        min-height: auto;
    }

    .login-hero-card,
    .login-access-card {
        padding: 26px 22px;
    }

    .login-hero-card {
        min-height: auto;
    }

    .login-access-card {
        min-height: auto;
    }
}

@media (max-width: 900px) {
    .member-list-page .table-container {
        overflow-x: visible;
    }

    .member-list-page table,
    .member-list-page tbody,
    .member-list-page tr,
    .member-list-page td {
        display: block;
        width: 100%;
    }

    .member-list-page thead,
    .member-list-page th {
        display: none;
    }

    .member-list-page table {
        border: none;
    }

    .member-list-page tr {
        margin-bottom: 14px;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 14px;
        overflow: hidden;
        box-shadow: 0 10px 26px rgba(17, 39, 68, 0.06);
    }

    .member-list-page td {
        border-bottom: 1px solid #eef2f7;
    }

    .member-list-page td:last-child {
        border-bottom: none;
    }

    .member-list-page td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 5px;
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .member-list-page .actions-cell {
        white-space: normal;
    }

    .member-list-page .actions-cell .btn {
        min-width: 96px;
        margin-right: 8px;
    }
}

@media (max-width: 820px) {
    .member-form-page .page-shell {
        padding: 14px 12px 24px;
    }

    .member-form-page .hero-card,
    .member-form-page .form-card {
        border-radius: 18px;
        padding: 18px;
    }

    .member-form-page .form-card {
        margin-top: -18px;
    }

    .member-form-page .hero-grid,
    .member-form-page .brand-block,
    .member-form-page .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .member-form-page .hero-actions {
        width: 100%;
        align-items: stretch;
        margin-top: 16px;
    }

    .member-form-page .hero-action-list {
        grid-template-columns: 1fr;
    }

    .member-form-page .status-chip {
        width: 100%;
    }

    .member-form-page .grid {
        grid-template-columns: 1fr;
    }

    .payment-view-page .form-card,
    .expense-entry-view-page .form-card,
    .purchase-entry-view-page .form-card,
    .purchase-return-view-page .form-card {
        margin-top: -18px;
        padding: 18px;
    }

    .payment-view-page .section-head,
    .expense-entry-view-page .section-head,
    .purchase-entry-view-page .section-head,
    .purchase-return-view-page .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .payment-view-page .grid,
    .expense-entry-view-page .grid,
    .purchase-entry-view-page .grid,
    .purchase-return-view-page .grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .payment-view-page .grid > div,
    .expense-entry-view-page .grid > div,
    .purchase-entry-view-page .grid > div,
    .purchase-return-view-page .grid > div {
        padding: 12px 14px;
    }

    .sales-invoice-view-page .invoice-detail-grid,
    .sales-invoice-view-page .invoice-amount-grid {
        grid-template-columns: 1fr;
    }

    .sales-invoice-view-page .detail-item,
    .sales-invoice-view-page .amount-item {
        padding: 13px 14px;
    }

    .sales-invoice-view-page .detail-value {
        font-size: 17px;
    }

    .sales-invoice-view-page .amount-value {
        font-size: 22px;
    }

    .member-form-page .member-form-layout {
        grid-template-columns: 1fr;
    }

    .member-form-page .member-form-aside {
        position: static;
    }

    .member-form-page .member-reference-tablewrap {
        max-height: 260px;
    }

    .member-form-page .member-panel,
    .member-form-page .member-summary-card,
    .member-form-page .member-reference-card {
        padding: 16px;
    }

    .member-form-page .member-summary-detail-list {
        gap: 10px;
    }

    .auth-user-form-page .role-checklist {
        grid-template-columns: 1fr;
    }

    .member-form-page .full {
        grid-column: auto;
    }

    .portal-page .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-page .app-sidebar-nav {
        gap: 8px;
    }

    .portal-page .app-sidebar-card {
        padding: 12px;
    }

    .portal-page .app-sidebar-brand {
        gap: 10px;
    }

    .portal-page .app-sidebar-logo {
        width: 46px;
        height: 46px;
        min-width: 46px;
        padding: 6px;
    }

    .portal-page .app-sidebar-brandtext h2 {
        font-size: 17px;
    }

    .portal-page .app-nav-link {
        padding: 10px 11px;
    }

    .portal-page .app-nav-link-title {
        font-size: 14px;
    }

    .portal-page .actions .btn,
    .portal-page .actions button,
    .portal-page .actions form {
        width: 100%;
    }

    .portal-page .actions form .btn,
    .portal-page .actions form button {
        width: 100%;
    }

    .member-form-page .brand-name {
        font-size: 27px;
    }
}
