:root {
    --portal-navy: #183153;
    --portal-navy-deep: #10213c;
    --portal-ivory: #f7f3eb;
    --portal-surface: #fffdfa;
    --portal-surface-alt: #f3eee4;
    --portal-saffron: #c97827;
    --portal-saffron-soft: #f2dfca;
    --portal-border: #d9cfbf;
    --portal-text: #1f2a37;
    --portal-muted: #667085;
    --portal-green: #20744d;
    --portal-green-soft: #dfefe6;
    --portal-water: #2f6f89;
    --portal-water-soft: #e2f1f6;
    --portal-danger: #8f2f2f;
    --portal-danger-soft: #f7e6e6;
    --portal-shadow: 0 16px 42px rgba(23, 35, 53, 0.08);
    --portal-radius-lg: 24px;
    --portal-radius-md: 18px;
    --portal-radius-sm: 14px;
}

body.namuna-portal-page,
body.payment-journey-page {
    background:
        radial-gradient(circle at top right, rgba(201, 120, 39, 0.08), transparent 32%),
        linear-gradient(180deg, #fbf8f2 0%, #f4efe6 100%);
    color: var(--portal-text);
}

.portal-surface {
    background: rgba(255, 253, 250, 0.92);
    border: 1px solid rgba(217, 207, 191, 0.9);
    border-radius: var(--portal-radius-lg);
    box-shadow: var(--portal-shadow);
}

.portal-section {
    margin-bottom: 22px;
}

.portal-section__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.portal-section__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--portal-saffron-soft);
    color: var(--portal-saffron);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-section__title {
    margin: 8px 0 4px;
    color: var(--portal-navy-deep);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.25;
}

.portal-section__subtitle {
    margin: 0;
    color: var(--portal-muted);
    font-size: 0.93rem;
    line-height: 1.6;
}

.dashboard-user-card {
    padding: 22px 18px;
    background: linear-gradient(145deg, var(--portal-navy-deep), var(--portal-navy) 62%, #2a507f);
    color: #fff;
}

.dashboard-user-card .summary-kicker {
    background: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.95);
}

.dashboard-user-card h2 {
    margin: 14px 0 6px;
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-size: 1.55rem;
    line-height: 1.25;
}

.dashboard-user-card .summary-subtitle {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.95rem;
    line-height: 1.5;
}

.dashboard-user-card .user-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.dashboard-user-card .user-details span {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 12px;
}

.dashboard-user-card .user-details strong {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.dashboard-dues-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
}

.due-card {
    padding: 18px;
    border-radius: 20px;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow);
}

.due-card--primary {
    background: linear-gradient(145deg, #fff8f0, #fff2e0);
}

.due-card--water {
    background: linear-gradient(145deg, #f2f8fb, #e6f2f7);
}

.due-card--receipt {
    background: linear-gradient(145deg, #fcfbf7, #f4f0e8);
}

.due-label {
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.due-value {
    margin-top: 10px;
    color: var(--portal-navy-deep);
    font-size: 1.95rem;
    font-weight: 800;
    line-height: 1;
}

.due-note {
    margin-top: 10px;
    color: var(--portal-muted);
    font-size: 13px;
    line-height: 1.55;
}

.dashboard-action-strip {
    position: sticky;
    bottom: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
    padding: 12px;
    border-radius: 22px;
    background: rgba(255, 253, 250, 0.92);
    border: 1px solid rgba(217, 207, 191, 0.8);
    box-shadow: 0 20px 38px rgba(23, 35, 53, 0.12);
    backdrop-filter: blur(14px);
}

.summary-action-btn {
    border: none;
    border-radius: 18px;
    min-height: 74px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.summary-action-btn strong {
    font-size: 15px;
    font-weight: 700;
}

.summary-action-btn span {
    font-size: 12px;
    line-height: 1.4;
}

.summary-action-btn:active {
    transform: scale(0.98);
}

.summary-action-btn--solid {
    background: linear-gradient(145deg, var(--portal-saffron), #d88b3f);
    color: #fff;
    box-shadow: 0 16px 28px rgba(201, 120, 39, 0.22);
}

.summary-action-btn--outline {
    background: var(--portal-surface);
    color: var(--portal-navy-deep);
    border: 1px solid var(--portal-border);
}

.dashboard-detail-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.dashboard-detail-item {
    padding: 18px;
    border-radius: 20px;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow);
}

.dashboard-detail-item h3 {
    margin: 0 0 6px;
    color: var(--portal-navy-deep);
    font-size: 1rem;
}

.dashboard-detail-item p {
    margin: 0;
    color: var(--portal-muted);
    font-size: 13px;
    line-height: 1.55;
}

.detail-item-action {
    margin-top: 12px;
    background: transparent;
    border: none;
    color: var(--portal-navy);
    font-weight: 700;
    padding: 0;
    cursor: pointer;
    font-size: 13px;
}

.n8-modern-view {
    display: grid;
    gap: 18px;
}

.n8-profile-grid,
.n8-meta-grid,
.n8-boundary-grid,
.n8-tax-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.info-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    padding: 16px;
}

.info-card__label {
    display: block;
    color: var(--portal-muted);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.info-card__value {
    display: block;
    color: var(--portal-navy-deep);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
}

.record-module {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 22px;
    padding: 18px;
    box-shadow: var(--portal-shadow);
}

.record-module__header {
    margin-bottom: 14px;
}

.record-module__title {
    margin: 0 0 4px;
    color: var(--portal-navy-deep);
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.record-module__note {
    margin: 0;
    color: var(--portal-muted);
    font-size: 13px;
    line-height: 1.55;
}

.record-kv-list {
    display: grid;
    gap: 10px;
}

.record-kv {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px dashed var(--portal-border);
}

.record-kv:last-child {
    border-bottom: none;
}

.record-kv__label {
    color: var(--portal-muted);
    font-size: 13px;
    min-width: 120px;
}

.record-kv__value {
    color: var(--portal-text);
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    line-height: 1.5;
}

.building-grid,
.ledger-grid,
.water-ledger-grid,
.receipt-grid,
.pay-options-grid {
    display: grid;
    gap: 12px;
}

.building-card,
.ledger-card,
.receipt-card,
.pay-option-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--portal-shadow);
}

.building-card__title,
.ledger-card__title,
.receipt-card__title,
.pay-option-card__title {
    margin: 0 0 8px;
    color: var(--portal-navy-deep);
    font-size: 1rem;
    font-weight: 700;
}

.building-card__meta,
.ledger-card__meta,
.receipt-card__meta {
    color: var(--portal-muted);
    font-size: 13px;
    line-height: 1.55;
}

.ledger-card {
    position: relative;
    overflow: hidden;
}

.ledger-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--portal-saffron);
}

.ledger-card--water::before {
    background: var(--portal-water);
}

.ledger-card__summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.ledger-stat {
    padding: 12px;
    background: var(--portal-surface-alt);
    border-radius: 14px;
}

.ledger-stat__label {
    display: block;
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ledger-stat__value {
    display: block;
    margin-top: 6px;
    color: var(--portal-navy-deep);
    font-size: 1rem;
    font-weight: 800;
}

.ledger-breakdown {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--portal-border);
    display: grid;
    gap: 10px;
}

.ledger-breakdown__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.ledger-breakdown__row span:first-child {
    color: var(--portal-muted);
}

.ledger-breakdown__row span:last-child {
    color: var(--portal-text);
    font-weight: 700;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.summary-strip__card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    padding: 16px;
    text-align: center;
}

.summary-strip__label {
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.summary-strip__value {
    margin-top: 8px;
    display: block;
    color: var(--portal-navy-deep);
    font-size: 1.2rem;
    font-weight: 800;
}

.pay-hub {
    display: grid;
    gap: 14px;
}

.pay-overview-card {
    background: linear-gradient(145deg, #fdf8ee, #f7efe0);
    border: 1px solid var(--portal-border);
    border-radius: 22px;
    padding: 18px;
}

.pay-overview-card__amount {
    color: var(--portal-navy-deep);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 10px;
}

.pay-overview-card__note {
    margin-top: 10px;
    color: var(--portal-muted);
    font-size: 13px;
    line-height: 1.6;
}

.pay-option-card {
    position: relative;
}

.pay-option-card--water {
    background: linear-gradient(145deg, #f1f9fb, #e8f3f7);
}

.pay-option-card--property {
    background: linear-gradient(145deg, #fffaf3, #f6ecdd);
}

.pay-option-card__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pay-option-card__status--due {
    background: var(--portal-danger-soft);
    color: var(--portal-danger);
}

.pay-option-card__status--clear {
    background: var(--portal-green-soft);
    color: var(--portal-green);
}

.pay-option-card__amount {
    margin-top: 10px;
    color: var(--portal-navy-deep);
    font-size: 1.8rem;
    font-weight: 800;
}

.pay-option-card__meta {
    margin-top: 10px;
    color: var(--portal-muted);
    font-size: 13px;
    line-height: 1.6;
}

.portal-btn {
    border: none;
    border-radius: 16px;
    min-height: 50px;
    padding: 14px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.portal-btn:active {
    transform: scale(0.98);
}

.portal-btn--primary {
    background: linear-gradient(145deg, var(--portal-saffron), #d88b3f);
    color: #fff;
    box-shadow: 0 14px 28px rgba(201, 120, 39, 0.18);
}

.portal-btn--water {
    background: linear-gradient(145deg, var(--portal-water), #4a89a3);
    color: #fff;
    box-shadow: 0 14px 28px rgba(47, 111, 137, 0.18);
}

.portal-btn--neutral {
    background: var(--portal-surface);
    color: var(--portal-navy-deep);
    border: 1px solid var(--portal-border);
}

.portal-btn[disabled],
.portal-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.receipt-card__action {
    margin-top: 12px;
    display: inline-flex;
    color: var(--portal-navy);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.portal-empty-state,
.portal-loading-state {
    background: var(--portal-surface);
    border: 1px dashed var(--portal-border);
    border-radius: 18px;
    padding: 18px;
    color: var(--portal-muted);
    text-align: center;
    font-size: 14px;
}

.portal-context-card {
    background: linear-gradient(145deg, #f8f5ef, #efe8dc);
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    padding: 16px;
}

.portal-context-card__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.portal-context-card__item {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    padding: 12px;
}

.portal-context-card__item span {
    display: block;
    color: var(--portal-muted);
    font-size: 12px;
}

.portal-context-card__item strong {
    display: block;
    margin-top: 6px;
    color: var(--portal-navy-deep);
    font-size: 14px;
}

.legacy-hidden {
    display: none !important;
}

.payment-page .back-link {
    color: var(--portal-navy);
}

@media (min-width: 768px) {
    .dashboard-dues-grid,
    .dashboard-detail-list,
    .n8-profile-grid,
    .n8-meta-grid,
    .n8-boundary-grid,
    .n8-tax-grid,
    .building-grid,
    .ledger-grid,
    .water-ledger-grid,
    .receipt-grid,
    .pay-options-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-action-strip {
        position: static;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        background: transparent;
        border: none;
        padding: 0;
        box-shadow: none;
        backdrop-filter: none;
    }

    .summary-action-btn {
        min-height: 92px;
    }

    .n8-profile-grid--three,
    .summary-strip,
    .pay-options-grid--two,
    .receipt-grid--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .dashboard-user-card .user-details,
    .portal-context-card__grid,
    .ledger-card__summary,
    .summary-strip {
        grid-template-columns: 1fr;
    }

    .dashboard-action-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
