/* ============================================================
   Citizen Portal — Olive App Redesign
   UI-only layer loaded after all previous portal UX styles.
   ============================================================ */

:root {
    --portal-olive-950: #2f3b16;
    --portal-olive-900: #39491b;
    --portal-olive-800: #465a20;
    --portal-olive-700: #5b712a;
    --portal-olive-600: #71883a;
    --portal-olive-500: #8b9f4c;
    --portal-olive-400: #a9b86a;
    --portal-olive-300: #c8d19a;
    --portal-olive-200: #dce3bd;
    --portal-olive-100: #eff2df;
    --portal-olive-50: #f7f8f0;
    --portal-sand: #f8f7f2;
    --portal-ink: #1d2515;
    --portal-text: #34402d;
    --portal-muted-text: #7c8374;
    --portal-line: rgba(73, 91, 35, .14);
    --portal-line-strong: rgba(73, 91, 35, .22);
    --portal-card: rgba(255, 255, 255, .96);
    --portal-shadow: 0 14px 38px rgba(43, 55, 20, .07);
    --portal-shadow-soft: 0 7px 22px rgba(43, 55, 20, .055);
    --portal-radius-xl: 22px;
    --portal-radius-lg: 17px;
    --portal-radius-md: 13px;
    --portal-radius-sm: 10px;
}

html {
    scroll-behavior: smooth;
}

body.portal-body {
    margin: 0;
    min-height: 100vh;
    color: var(--portal-text);
    background:
        radial-gradient(circle at 13% 10%, rgba(168, 183, 105, .12), transparent 23rem),
        radial-gradient(circle at 87% 20%, rgba(224, 220, 187, .2), transparent 28rem),
        linear-gradient(180deg, #fbfbf8 0%, #f5f6ef 48%, #f8f8f5 100%);
    font-family: Arial, "Segoe UI", Tahoma, sans-serif;
    line-height: 1.6;
}

body.portal-body a {
    color: var(--portal-olive-700);
}

body.portal-body a:hover {
    text-decoration: none;
}

/* App header */
.portal-app-header {
    position: relative;
    z-index: 30;
    color: #fff;
    background:
        linear-gradient(100deg, #334417 0%, #53652b 38%, #85875d 69%, #b3a875 100%);
    box-shadow: 0 5px 22px rgba(43, 55, 20, .12);
}

.portal-app-header::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 72% -80%, rgba(255,255,255,.28), transparent 36%),
        linear-gradient(90deg, transparent 0 48%, rgba(255,255,255,.035) 48% 49%, transparent 49%);
}

.portal-app-header-inner {
    position: relative;
    z-index: 1;
    width: min(1540px, calc(100% - 36px));
    min-height: 78px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
    color: #fff !important;
    text-decoration: none;
}

.portal-brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    color: #f3f0d6;
}

.portal-brand-mark svg {
    width: 100%;
    height: 100%;
}

.portal-brand-title {
    display: block;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.25;
}

.portal-brand-subtitle {
    display: block;
    margin-top: 2px;
    color: rgba(255,255,255,.72);
    font-size: 10px;
    letter-spacing: .01em;
}

.portal-top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
}

.portal-header-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    color: #fff !important;
    background: rgba(255,255,255,.085);
    backdrop-filter: blur(7px);
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: .2s ease;
}

.portal-header-action:hover {
    border-color: rgba(255,255,255,.38);
    background: rgba(255,255,255,.15);
    transform: translateY(-1px);
}

.portal-header-action-primary {
    color: var(--portal-olive-950) !important;
    border-color: rgba(255,255,255,.55);
    background: rgba(255,255,255,.9);
}

.portal-header-action-icon {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    font-size: 16px;
    line-height: 1;
}

.portal-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-inline-start: 4px;
    padding-inline-start: 10px;
    border-inline-start: 1px solid rgba(255,255,255,.22);
}

.portal-user-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,.12);
}

.portal-user-avatar svg {
    width: 22px;
    height: 22px;
}

.portal-user-text {
    display: flex;
    flex-direction: column;
    max-width: 210px;
    line-height: 1.35;
}

.portal-user-text strong {
    overflow: hidden;
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.portal-user-text small {
    margin-top: 2px;
    overflow: hidden;
    color: rgba(255,255,255,.7);
    font-size: 8px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.portal-header-logout {
    margin: 0;
}

/* Main shell and nav */
.portal-shell {
    width: min(1540px, calc(100% - 36px));
    max-width: none !important;
    margin: 0 auto !important;
    padding: 18px 0 54px !important;
}

.portal-nav {
    position: sticky;
    top: 10px;
    z-index: 20;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 12px 0 !important;
    padding: 5px !important;
    display: flex !important;
    gap: 4px !important;
    border: 1px solid var(--portal-line) !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,.9) !important;
    box-shadow: var(--portal-shadow-soft);
    backdrop-filter: blur(14px);
}

.portal-nav-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    min-height: 36px !important;
    padding: 7px 12px !important;
    border-radius: 999px !important;
    color: #67705e !important;
    font-size: 10.5px !important;
    font-weight: 800 !important;
    white-space: nowrap;
    transition: .2s ease;
}

.portal-nav-link:hover {
    color: var(--portal-olive-800) !important;
    background: var(--portal-olive-50) !important;
}

.portal-nav-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--portal-olive-700), var(--portal-olive-900)) !important;
    box-shadow: 0 5px 15px rgba(69, 87, 31, .2);
}

.portal-nav-icon {
    display: inline-grid;
    place-items: center;
    min-width: 15px;
    font-size: 13px;
}

/* Secondary utility / breadcrumbs */
.portal-utility-nav {
    display: flex !important;
    align-items: center;
    gap: 6px !important;
    min-height: 28px;
    margin: 0 0 3px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

.portal-utility-action {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    min-height: 26px !important;
    padding: 3px 7px !important;
    border: 0 !important;
    border-radius: 8px !important;
    color: #8b9283 !important;
    background: transparent !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    cursor: pointer;
}

.portal-utility-action:hover {
    color: var(--portal-olive-700) !important;
    background: var(--portal-olive-50) !important;
}

.portal-utility-nav .portal-utility-logout,
.portal-utility-nav > a[href*="portal/dashboard"] {
    display: none !important;
}

.portal-breadcrumbs {
    margin: 2px 0 14px !important;
}

.portal-breadcrumbs ol {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.portal-breadcrumbs li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #979d90;
    font-size: 9px !important;
}

.portal-breadcrumbs li + li::before {
    content: "‹";
    color: #b0b5aa;
    font-size: 12px;
}

.portal-breadcrumbs a,
.portal-breadcrumbs span {
    color: inherit !important;
}

/* Core content */
.portal-main-content {
    min-height: 45vh;
}

.portal-page-header {
    position: relative;
    min-height: 118px;
    margin: 0 0 16px !important;
    padding: 26px 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 20px !important;
    overflow: hidden;
    border: 1px solid rgba(92, 111, 49, .1);
    border-radius: var(--portal-radius-xl);
    background:
        radial-gradient(circle at 13% 38%, rgba(166,181,102,.15), transparent 11rem),
        linear-gradient(115deg, rgba(255,255,255,.98), rgba(249,249,244,.92));
    box-shadow: var(--portal-shadow-soft);
}

.portal-page-header::after {
    content: "";
    position: absolute;
    inset-inline-start: 28px;
    top: 18px;
    width: 118px;
    height: 82px;
    opacity: .48;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 56%, var(--portal-olive-300) 0 3px, transparent 4px),
        radial-gradient(circle at 30% 42%, var(--portal-olive-400) 0 2px, transparent 3px),
        radial-gradient(circle at 43% 70%, var(--portal-olive-200) 0 3px, transparent 4px),
        radial-gradient(circle at 62% 32%, var(--portal-olive-300) 0 2px, transparent 3px),
        radial-gradient(circle at 76% 58%, var(--portal-olive-400) 0 3px, transparent 4px);
}

.portal-page-header > div:first-child {
    position: relative;
    z-index: 1;
    max-width: 920px;
}

.portal-page-header h1 {
    margin: 0 !important;
    color: var(--portal-ink);
    font-size: clamp(23px, 2.2vw, 34px) !important;
    font-weight: 900;
    line-height: 1.3 !important;
    letter-spacing: -.02em;
}

.portal-page-description {
    max-width: 920px;
    margin-top: 7px !important;
    color: var(--portal-muted-text) !important;
    font-size: 11px !important;
    line-height: 1.85;
}

.portal-card,
.portal-filter-card,
.portal-finance-currency,
.portal-kpi,
.portal-link-card,
.stat-card,
.cheque-stat-card {
    border: 1px solid var(--portal-line) !important;
    border-radius: var(--portal-radius-lg) !important;
    background: var(--portal-card) !important;
    box-shadow: var(--portal-shadow-soft) !important;
}

.portal-card {
    padding: 16px !important;
}

.portal-section {
    margin-top: 16px !important;
}

.portal-section-header {
    margin-bottom: 11px !important;
}

.portal-section-header h2 {
    color: var(--portal-ink);
    font-size: 16px !important;
    font-weight: 900;
}

.portal-muted,
.portal-kpi-label,
.portal-money-label,
.portal-detail-label {
    color: var(--portal-muted-text) !important;
}

.portal-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
    gap: 10px !important;
}

.portal-kpi,
.portal-link-card {
    position: relative;
    min-height: 96px;
    padding: 15px 16px !important;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.portal-kpi::before,
.portal-link-card::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(var(--portal-olive-500), var(--portal-olive-800));
    opacity: .72;
}

.portal-kpi:hover,
.portal-link-card:hover {
    transform: translateY(-2px);
    border-color: var(--portal-line-strong) !important;
    background: linear-gradient(145deg, #fff, #fbfcf6) !important;
    box-shadow: var(--portal-shadow) !important;
}

.portal-kpi-value {
    margin-top: 4px !important;
    color: var(--portal-olive-900);
    font-size: 24px !important;
    font-weight: 900 !important;
}

.portal-click-hint {
    margin-top: 7px;
    color: var(--portal-olive-600) !important;
    font-size: 9px !important;
    font-weight: 800;
}

.portal-finance-currency {
    margin-bottom: 9px !important;
    padding: 14px !important;
}

.portal-money-grid {
    gap: 7px !important;
}

.portal-money-item,
.portal-detail-item {
    padding: 10px 11px !important;
    border: 1px solid rgba(88, 106, 47, .08);
    border-radius: 11px !important;
    background: linear-gradient(145deg, #fafbf5, #f6f8ec) !important;
}

.portal-money-value,
.portal-detail-value {
    color: var(--portal-ink);
}

/* Buttons & form controls */
body.portal-body .btn {
    min-height: 36px;
    padding: 7px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 10.5px;
    font-weight: 900;
    transition: .18s ease;
}

body.portal-body .btn-primary {
    color: #fff;
    border-color: var(--portal-olive-700);
    background: linear-gradient(135deg, var(--portal-olive-600), var(--portal-olive-900));
    box-shadow: 0 7px 16px rgba(76, 95, 36, .16);
}

body.portal-body .btn-primary:hover {
    filter: brightness(.97);
    transform: translateY(-1px);
}

body.portal-body .btn-secondary {
    color: var(--portal-olive-800);
    border-color: var(--portal-line-strong);
    background: #fbfcf7;
}

body.portal-body .btn-secondary:hover {
    background: var(--portal-olive-50);
}

body.portal-body .form-group {
    margin-bottom: 0;
}

body.portal-body .form-group label {
    margin-bottom: 4px;
    color: #6d7565;
    font-size: 9px;
    font-weight: 800;
}

body.portal-body .form-control,
body.portal-body .search-form input {
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid var(--portal-line-strong);
    border-radius: 11px;
    outline: 0;
    color: var(--portal-text);
    background: rgba(255,255,255,.92);
    font-size: 10.5px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

body.portal-body .form-control:focus,
body.portal-body .search-form input:focus {
    border-color: var(--portal-olive-500);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(128, 149, 66, .12);
}

body.portal-body select.form-control {
    cursor: pointer;
}

/* Filters — compact app style */
.portal-filter-card {
    margin-bottom: 12px !important;
    padding: 13px 15px !important;
}

.portal-filter-card .form-grid,
.portal-compact-filter {
    display: grid !important;
    grid-template-columns: minmax(260px, 2.25fr) minmax(125px, .7fr) minmax(125px, .7fr) minmax(105px, .55fr) auto !important;
    align-items: end !important;
    gap: 9px !important;
}

.portal-filter-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    align-self: end;
}

.portal-filter-actions .btn {
    white-space: nowrap;
}

/* Tabs */
.portal-view-tabs {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    background: transparent;
}

.portal-view-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    min-width: 118px;
    padding: 7px 14px;
    border: 1px solid var(--portal-line-strong);
    border-radius: 12px;
    color: #6d7565 !important;
    background: rgba(255,255,255,.85);
    box-shadow: 0 3px 12px rgba(43,55,20,.035);
    font-size: 10.5px;
    font-weight: 900;
    transition: .18s ease;
}

.portal-view-tab:hover {
    color: var(--portal-olive-800) !important;
    background: var(--portal-olive-50);
}

.portal-view-tab.active {
    color: #fff !important;
    border-color: var(--portal-olive-700);
    background: linear-gradient(135deg, var(--portal-olive-600), var(--portal-olive-900));
    box-shadow: 0 7px 18px rgba(67, 85, 28, .18);
}

/* Ledger hero */
.portal-ledger-hero {
    min-height: 134px;
    padding-inline-end: 30px !important;
}

.portal-ledger-title-row {
    display: flex;
    align-items: center;
    gap: 13px;
}

.portal-ledger-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border: 1px solid rgba(100, 120, 52, .15);
    border-radius: 14px;
    color: var(--portal-olive-700);
    background: linear-gradient(145deg, var(--portal-olive-100), #f9faef);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 8px 20px rgba(77,95,35,.08);
}

.portal-ledger-icon svg {
    width: 28px;
    height: 28px;
}

.portal-ledger-hero::before {
    content: "";
    position: absolute;
    inset-inline-start: 36px;
    top: 19px;
    width: 112px;
    height: 94px;
    border-radius: 36% 64% 54% 46% / 43% 38% 62% 57%;
    opacity: .65;
    background:
        radial-gradient(circle at 38% 38%, rgba(112,136,58,.26), transparent 31%),
        linear-gradient(145deg, rgba(213,221,177,.7), rgba(243,245,228,.55));
    transform: rotate(-9deg);
}

.portal-ledger-hero .portal-hero-decoration {
    position: absolute;
    inset-inline-start: 62px;
    top: 39px;
    z-index: 1;
    width: 62px;
    height: 54px;
    color: var(--portal-olive-700);
    opacity: .8;
}

/* Results card and table */
.portal-results-card {
    padding: 12px 14px 14px !important;
}

.portal-results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 9px;
}

.portal-results-meta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--portal-muted-text);
    font-size: 9.5px;
}

.portal-results-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 9px;
    color: var(--portal-olive-800);
    background: var(--portal-olive-50);
    font-size: 10px;
    font-weight: 900;
}

.portal-results-view {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid rgba(89,107,47,.08);
    border-radius: 9px;
    color: var(--portal-olive-700);
    background: #fafbf6;
    font-weight: 900;
}

.portal-table-wrap {
    border: 1px solid rgba(74, 93, 34, .1);
    border-radius: 14px;
    overflow-x: auto !important;
    background: #fff;
}

.portal-table-wrap table {
    width: 100%;
    min-width: 760px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden;
}

.portal-table-wrap th,
.portal-table-wrap td {
    padding: 10px 10px !important;
    border-bottom: 1px solid rgba(77, 96, 37, .09) !important;
    vertical-align: middle;
    font-size: 9.5px;
}

.portal-table-wrap th {
    color: #5f6857;
    background: linear-gradient(180deg, #fafbf7, #f5f6f0) !important;
    font-size: 8.8px;
    font-weight: 900;
    white-space: nowrap;
}

.portal-table-wrap tbody tr {
    transition: background .16s ease, transform .16s ease;
}

.portal-table-wrap tbody tr:last-child td {
    border-bottom: 0 !important;
}

.portal-table-wrap tbody tr[data-portal-href] {
    cursor: pointer;
}

.portal-table-wrap tbody tr[data-portal-href]:hover {
    background: #fbfcf7;
}

.portal-record-link {
    color: var(--portal-ink) !important;
    font-weight: 900;
}

.portal-record-link:hover {
    color: var(--portal-olive-700) !important;
}

.portal-owner-cell {
    min-width: 150px;
}

.portal-owner-line,
.portal-charge-line {
    display: flex;
    align-items: center;
    gap: 7px;
}

.portal-mini-icon {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border: 1px solid rgba(104, 124, 56, .13);
    border-radius: 50%;
    color: var(--portal-olive-700);
    background: var(--portal-olive-50);
    font-size: 12px;
}

.portal-money-positive {
    color: #4f7b2a !important;
    font-weight: 900;
}

.portal-money-pending {
    color: #b26a13 !important;
    font-weight: 900;
}

.portal-money-danger {
    color: #bd2b1f !important;
    font-weight: 900;
}

.portal-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 27px;
    padding: 4px 9px;
    border: 1px solid var(--portal-olive-200);
    border-radius: 999px;
    color: var(--portal-olive-800);
    background: var(--portal-olive-50);
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
}

.portal-status-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--portal-olive-600);
}

.portal-status-pill.is-paid {
    color: #377025;
    border-color: #cfe4c2;
    background: #f2faee;
}

.portal-status-pill.is-overdue,
.portal-status-pill.is-cancelled {
    color: #a63a2e;
    border-color: #f0c8c2;
    background: #fff4f2;
}

.portal-status-pill.is-overdue::before,
.portal-status-pill.is-cancelled::before {
    background: #c84a3b;
}

.portal-status-pill.is-pending {
    color: #9a6519;
    border-color: #edd8b0;
    background: #fff9eb;
}

.portal-status-pill.is-pending::before {
    background: #c58423;
}

.empty {
    color: #8b9283 !important;
    padding: 28px !important;
}

.pagination {
    margin-top: 14px !important;
}

/* Alerts */
.portal-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 12px !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    box-shadow: var(--portal-shadow-soft);
}

.portal-alert-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    background: rgba(255,255,255,.7);
    font-weight: 900;
}

.portal-alert ul {
    margin: 0;
    padding-right: 18px;
}

body.portal-body .alert-success {
    color: #356b28;
    border: 1px solid #cfe3c5;
    background: #f3faef;
}

body.portal-body .alert-errors {
    color: #9e3d32;
    border: 1px solid #efd0cb;
    background: #fff5f3;
}

/* Status badges from existing pages */
body.portal-body .status-badge {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 9px;
}

/* Footer */
.portal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    padding: 11px;
    color: #9aa093;
    font-size: 8.5px;
}

/* Tablet */
@media (max-width: 1080px) {
    .portal-app-header-inner,
    .portal-shell {
        width: min(100% - 24px, 1540px);
    }

    .portal-user-text,
    .portal-public-site-link .portal-header-action-label,
    .portal-header-logout .portal-header-action-label {
        display: none;
    }

    .portal-user-chip {
        padding-inline-start: 6px;
    }

    .portal-filter-card .form-grid,
    .portal-compact-filter {
        grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(110px, .65fr)) !important;
    }

    .portal-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

/* Mobile app mode */
@media (max-width: 760px) {
    body.portal-body {
        padding-bottom: 74px;
        background: #f6f7f1;
    }

    .portal-app-header {
        position: sticky;
        top: 0;
        z-index: 40;
    }

    .portal-app-header-inner {
        width: calc(100% - 20px);
        min-height: 64px;
        gap: 8px;
    }

    .portal-brand {
        min-width: 0;
        gap: 8px;
    }

    .portal-brand-mark {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
    }

    .portal-brand-title {
        font-size: 15px;
    }

    .portal-brand-subtitle {
        display: none;
    }

    .portal-top-actions {
        gap: 4px;
    }

    .portal-header-action {
        width: 34px;
        min-height: 34px;
        padding: 5px;
    }

    .portal-header-action-primary,
    .portal-header-action-label,
    .portal-public-site-link,
    .portal-header-logout {
        display: none !important;
    }

    .portal-user-chip {
        margin: 0;
        padding: 0;
        border: 0;
    }

    .portal-user-avatar {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .portal-shell {
        width: calc(100% - 18px);
        padding: 10px 0 24px !important;
    }

    .portal-nav {
        position: fixed !important;
        right: 8px;
        bottom: 8px;
        left: 8px;
        top: auto;
        z-index: 60;
        width: auto !important;
        max-width: none;
        margin: 0 !important;
        padding: 5px !important;
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 2px !important;
        border-radius: 18px !important;
        box-shadow: 0 14px 34px rgba(43,55,20,.2) !important;
    }

    .portal-nav-link {
        min-width: 0;
        min-height: 48px !important;
        padding: 5px 3px !important;
        flex-direction: column;
        gap: 1px;
        border-radius: 13px !important;
        font-size: 8px !important;
        line-height: 1.25;
    }

    .portal-nav-icon {
        font-size: 15px;
    }

    .portal-utility-nav {
        margin-bottom: 1px !important;
    }

    .portal-utility-action {
        min-height: 24px !important;
        font-size: 8px !important;
    }

    .portal-breadcrumbs {
        margin-bottom: 8px !important;
    }

    .portal-breadcrumbs li {
        font-size: 8px !important;
    }

    .portal-page-header {
        min-height: 104px;
        padding: 18px 16px !important;
        border-radius: 17px;
    }

    .portal-page-header::after,
    .portal-ledger-hero::before,
    .portal-ledger-hero .portal-hero-decoration {
        display: none;
    }

    .portal-page-header h1 {
        font-size: 22px !important;
    }

    .portal-page-description {
        font-size: 9.5px !important;
    }

    .portal-ledger-title-row {
        align-items: flex-start;
    }

    .portal-ledger-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 12px;
    }

    .portal-view-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .portal-view-tab {
        min-width: 0;
        min-height: 36px;
        padding: 6px 5px;
        border-radius: 11px;
        font-size: 9px;
    }

    .portal-filter-card {
        padding: 11px !important;
    }

    .portal-filter-card .form-grid,
    .portal-compact-filter {
        grid-template-columns: 1fr 1fr !important;
        gap: 7px !important;
    }

    .portal-filter-card .form-group:first-of-type {
        grid-column: 1 / -1;
    }

    .portal-filter-actions {
        grid-column: 1 / -1;
    }

    .portal-filter-actions .btn {
        flex: 1;
    }

    body.portal-body .form-control {
        min-height: 36px;
        font-size: 10px;
    }

    .portal-card {
        padding: 11px !important;
        border-radius: 15px !important;
    }

    .portal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .portal-kpi,
    .portal-link-card {
        min-height: 92px;
        padding: 12px !important;
        border-radius: 14px !important;
    }

    .portal-kpi-value {
        font-size: 20px !important;
    }

    .portal-results-card {
        padding: 9px !important;
    }

    .portal-results-toolbar {
        margin: 1px 2px 8px;
    }

    .portal-table-wrap.portal-ledger-table-wrap {
        overflow: visible !important;
        border: 0;
        background: transparent;
    }

    .portal-ledger-table {
        min-width: 0 !important;
        display: block;
        background: transparent;
    }

    .portal-ledger-table thead {
        display: none;
    }

    .portal-ledger-table tbody {
        display: grid;
        gap: 8px;
    }

    .portal-ledger-table tr {
        position: relative;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        padding: 10px;
        border: 1px solid var(--portal-line) !important;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 6px 18px rgba(43,55,20,.05);
    }

    .portal-ledger-table td {
        min-width: 0;
        padding: 7px 6px !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        border-bottom: 1px dashed rgba(77, 96, 37, .1) !important;
        font-size: 9px;
    }

    .portal-ledger-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: #91978c;
        font-size: 7.5px;
        font-weight: 800;
    }

    .portal-ledger-table td.portal-owner-cell,
    .portal-ledger-table td.portal-charge-cell {
        grid-column: 1 / -1;
        justify-content: flex-start;
        border-bottom-style: solid !important;
    }

    .portal-ledger-table td.portal-owner-cell::before,
    .portal-ledger-table td.portal-charge-cell::before {
        display: none;
    }

    .portal-ledger-table td.portal-status-cell {
        grid-column: 1 / -1;
        justify-content: flex-end;
        border-bottom: 0 !important;
    }

    .portal-ledger-table td.portal-status-cell::before {
        margin-inline-end: auto;
    }

    .portal-ledger-table tr:has(.empty) {
        display: block !important;
    }

    .portal-ledger-table .empty {
        display: block;
        border: 0 !important;
        text-align: center;
    }

    .portal-ledger-table .empty::before {
        display: none;
    }
}

@media (max-width: 420px) {
    .portal-grid {
        grid-template-columns: 1fr !important;
    }

    .portal-filter-card .form-grid,
    .portal-compact-filter {
        grid-template-columns: 1fr !important;
    }

    .portal-filter-card .form-group,
    .portal-filter-card .form-group:first-of-type,
    .portal-filter-actions {
        grid-column: auto !important;
    }

    .portal-view-tab {
        font-size: 8.5px;
    }
}

/* Login / password screens */
body.login-page {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--portal-text);
    background:
        radial-gradient(circle at 14% 16%, rgba(167,181,101,.2), transparent 24rem),
        radial-gradient(circle at 84% 13%, rgba(224,217,180,.32), transparent 26rem),
        linear-gradient(145deg, #f7f8f1, #fbfbf8);
    font-family: Arial, "Segoe UI", Tahoma, sans-serif;
}

body.login-page::before {
    content: "";
    position: fixed;
    inset: 0 0 auto 0;
    height: 10px;
    background: linear-gradient(90deg, var(--portal-olive-900), var(--portal-olive-600), #aea56f);
}

body.login-page .login-container {
    width: min(100%, 480px);
}

body.login-page .login-card {
    position: relative;
    overflow: hidden;
    padding: 28px !important;
    border: 1px solid var(--portal-line) !important;
    border-radius: 24px !important;
    background: rgba(255,255,255,.96) !important;
    box-shadow: 0 24px 60px rgba(43,55,20,.12) !important;
}

body.login-page .login-card::before {
    content: "";
    position: absolute;
    top: -70px;
    inset-inline-start: -45px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(150,166,84,.2), rgba(150,166,84,0) 70%);
    pointer-events: none;
}

body.login-page .login-header {
    position: relative;
    z-index: 1;
    margin-bottom: 22px;
}

body.login-page .login-header h1 {
    margin-bottom: 5px;
    color: var(--portal-ink);
    font-size: 27px;
    font-weight: 900;
}

body.login-page .login-header p {
    color: var(--portal-muted-text);
    font-size: 11px;
}

body.login-page .form-group {
    margin-bottom: 14px;
}

body.login-page .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #626b59;
    font-size: 10px;
    font-weight: 900;
}

body.login-page .form-control {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--portal-line-strong);
    border-radius: 12px;
    background: #fbfcf8;
    outline: 0;
}

body.login-page .form-control:focus {
    border-color: var(--portal-olive-500);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(128,149,66,.12);
}

body.login-page .login-submit {
    width: 100%;
    min-height: 43px;
    border-radius: 12px;
    font-weight: 900;
}

body.login-page .login-remember {
    color: #747c6c;
    font-size: 10px;
}

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

    body.login-page .login-card {
        padding: 20px !important;
        border-radius: 18px !important;
    }
}
