:root {
    --ikapun-navy: #16213E;
    --ikapun-navy-dark: #0F1B33;
    --ikapun-gold: #D4AF37;
    --ikapun-gold-soft: rgba(212,175,55,.12);
    --ikapun-gold-border: rgba(212,175,55,.28);
}



html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-main);
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--ikapun-navy);
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 28%),
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.06), transparent 24%),
        linear-gradient(180deg, #fbfefd 0%, var(--bg-page) 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.system-status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 34px;
    z-index: 1045;
    background: var(--statusbar-bg);
    color: var(--statusbar-text);
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    padding: 0 0.55rem;
    white-space: nowrap;
    line-height: 1;
    height: 20px;
    font-size: 0.76rem;
    vertical-align: middle;
}

.navbar-fixed {
    position: fixed;
    top: 34px;
    left: 0;
    right: 0;
    min-height: 56px;
    z-index: 1030;
    background: linear-gradient(180deg, rgba(17, 94, 89, 0.98), rgba(15, 118, 110, 0.94)) !important;
    border-bottom: 1px solid rgba(255,255,255,0.09);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.navbar .nav-link {
    font-size: 0.9rem;
    font-weight: 600;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    transition: all 0.15s ease;
    border-radius: 10px;
    color: rgba(255,255,255,0.86) !important;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    background: rgba(255,255,255,0.12);
    color: #ffffff !important;
}

.navbar .dropdown-menu {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.55rem;
}

.navbar .dropdown-header {
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border:1px solid var(--ikapun-gold-border);
}

.navbar .dropdown-item {
    border-radius: 10px;
    padding: 0.62rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.navbar .dropdown-item:hover {
    background: var(--ikapun-gold-soft);
    color: var(--ikapun-gold);
}

.footer-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    z-index: 1020;
    background: rgba(255,255,255,0.94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-light);
}

.footer-fixed .small {
    font-size: 0.84rem;
    color: var(--text-muted) !important;
}

.main-content {
    position: fixed;
    top: 90px;
    bottom: 64px;
    left: 0;
    right: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.65rem 0 0.75rem;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 750;
    letter-spacing: -0.02em;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.4;
    margin-top: 0.1rem;
}

.text-muted,
.form-text,
small {
    color: var(--text-muted) !important;
}

.page-shell {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  /* No max-width — molo-content-wrap controls the outer constraint */
}

/* page-hero rules moved to shared system section below */

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
}

.hero-metric {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.78);
    padding: 0.9rem 1rem;
}

.hero-metric-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-metric-value {
    font-size: 1.15rem;
    font-weight: 850;
    color: var(--text-main);
    margin-top: 0.2rem;
}

.card {
    background: rgba(255,255,255,0.96);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(15,23,42,.05);
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(22,33,62,.18);
}

.card-body {
    padding: 0.5rem 0.7rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 750;
    color: var(--text-main);
    margin-bottom: 0.85rem;
}

.section-card {
    border-radius: var(--radius-lg);
}

.section-card .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    padding: 1rem 1.15rem 0.85rem;
}

.section-card .card-footer {
    background: rgba(248,250,252,0.7);
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

/* OLD metric values — see system definition below */

/* OLD metric-tile replaced — see system definition below */

.btn {
    border-radius: 12px;
    font-weight: 750;
    font-size: 0.9rem;
    padding: 0.58rem 0.95rem;
    box-shadow: none;
}

.btn-sm {
    border-radius: 10px;
    font-size: 0.82rem;
    padding: 0.38rem 0.68rem;
}

.btn-primary,
.btn-success {
    box-shadow: 0 10px 18px rgba(15, 118, 110, 0.14);
}

.btn-primary {
    background-color: var(--ikapun-navy);
    border-color: var(--ikapun-navy);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--ikapun-navy-dark);
    border-color: var(--ikapun-navy-dark);
}

.btn-warning {
    color: #fff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--bg-soft);
    color: var(--text-main);
    border-color: var(--border-mid);
}

label.form-label {
    font-size: 0.88rem;
    font-weight: 750;
    color: var(--text-main);
    margin-bottom: 0.45rem;
}

.form-control,
.form-select,
textarea.form-control {
    border-radius: 12px;
    border: 1px solid var(--border-mid);
    min-height: 44px;
    font-size: 0.92rem;
    color: var(--text-main);
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

textarea.form-control {
    min-height: 110px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.16);
}

.input-group-text {
    border-radius: 12px;
    border-color: var(--border-mid);
    background: rgba(248,250,252,0.95);
}

.table-responsive {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--radius-lg);
    overflow: auto;
    background: #fff;
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom-color: rgba(148, 163, 184, 0.14);
}

.table-sm > :not(caption) > * > * {
    padding: 0.58rem 0.68rem;
}

.table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 850;
    color:#fff;
    background: linear-gradient(180deg,#1B2A49,#16213E);
    white-space: nowrap;
}

.table-hover tbody tr:hover {
    background: rgba(15, 118, 110, 0.045);
}

/* ===== Smart table readability =====
   Default: allow useful text such as member/product/profile names to wrap.
   Opt-in utilities below can be used only where truncation is intentional.
*/
.table td,
.table th {
    overflow-wrap: anywhere;
}

.table .text-nowrap,
.table td.text-nowrap,
.table th.text-nowrap,
.table .badge,
.table .badge-soft,
.table .btn {
    overflow-wrap: normal;
}

.table .cell-nowrap {
    white-space: nowrap;
}

.table .cell-wrap {
    white-space: normal;
    overflow-wrap: anywhere;
}

.table .cell-truncate,
.table .cell-truncate-sm,
.table .cell-truncate-md,
.table .cell-truncate-lg {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.table .cell-truncate-sm {
    max-width: 120px;
}

.table .cell-truncate-md {
    max-width: 180px;
}

.table .cell-truncate-lg {
    max-width: 260px;
}

.table .cell-actions {
    white-space: nowrap;
    text-align: right;
}

.table-light,
.table-light > th,
.table-light > td {
    --bs-table-bg: #f8fafc;
}

.badge {
    border-radius: 999px;
    font-weight: 750;
    padding: 0.42rem 0.68rem;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.34rem 0.68rem;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-soft.info {
    color: var(--info);
    background: var(--info-soft);
    border-color: rgba(2, 132, 199, 0.14);
}

.badge-soft.approved,
.badge-soft.paid {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(22, 163, 74, 0.14);
}

.badge-soft.pending {
    color: var(--warning);
    background: var(--warning-soft);
    border-color: rgba(217, 119, 6, 0.16);
}

.badge-soft.rejected,
.badge-soft.danger {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: rgba(220, 38, 38, 0.14);
}

.alert {
    border: 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.flash-stack {
    position: sticky;
    top: 0;
    z-index: 5;
}

.pagination .page-link {
    border-radius: 10px;
    margin: 0 0.16rem;
    border-color: rgba(148, 163, 184, 0.24);
    color: var(--text-main);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--ikapun-navy);
}

.empty-state {
    border: 1px dashed rgba(148, 163, 184, 0.42);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    color: var(--text-muted);
    background: rgba(248, 250, 252, 0.7);
}

.info-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.info-item {
    border-bottom: 1px dashed rgba(148, 163, 184, 0.2);
    padding-bottom: 0.65rem;
}

.info-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.info-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 800;
    margin-bottom: 0.15rem;
}

.info-value {
    color: var(--text-main);
    font-weight: 750;
}

.detail-list {
    display: grid;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.18);
}

.detail-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.detail-label {
    color: var(--text-muted);
    font-weight: 650;
}

.detail-value {
    color: var(--text-main);
    font-weight: 750;
    text-align: right;
}

.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.surface-muted {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-md);
    background: rgba(248,250,252,0.85);
    padding: 1rem;
}

.teller-panel {
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    border-radius: var(--radius-lg) !important;
    background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(248,250,252,0.9)) !important;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.quick-link {
    display: block;
    color: inherit;
    text-decoration: none;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius-lg);
    padding: 1rem;
    background: rgba(255,255,255,0.96);
    box-shadow: var(--shadow-sm);
}

.quick-link:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: rgba(15, 118, 110, 0.28);
}

.login-shell {
    min-height: calc(100vh - 170px);
    display: grid;
    place-items: center;
}

.login-card {
    width: min(100%, 460px);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.login-panel {
    background: linear-gradient(145deg, rgba(17,94,89,0.98), rgba(15,118,110,0.96));
    color: white;
}


.login-panel .muted {
    color: rgba(255,255,255,0.76);
}

/* ===== Responsive Compact Mode =====
   Automatically tightens spacing on shorter displays.
*/
@media (max-height: 800px) {
    body {
        font-size: 0.88rem;
        line-height: 1.4;
    }

    .system-status-bar {
        height: 28px;
        font-size: 0.72rem;
    }

    .status-pill {
        padding: 0 0.45rem;
        font-size: 0.72rem;
    }

    .navbar-fixed {
        top: 28px;
        min-height: 48px;
    }

    .navbar-brand {
        font-size: 0.95rem;
    }

    .navbar .nav-link {
        font-size: 0.82rem;
        padding-left: 0.55rem;
        padding-right: 0.55rem;
        border-radius: 8px;
    }

    .navbar .dropdown-menu {
        padding: 0.35rem;
        border-radius: 12px;
    }

    .navbar .dropdown-item {
        padding: 0.42rem 0.62rem;
        font-size: 0.82rem;
        border-radius: 8px;
    }

    .navbar .dropdown-header {
        font-size: 0.66rem;
        padding: 0.35rem 0.62rem 0.2rem;
    }

    .main-content {
        top: 82px;
        bottom: 56px;
        padding: 0.9rem 0 1rem;
    }

    .footer-fixed {
        height: 50px;
    }

    .footer-fixed .small {
        font-size: 0.74rem;
    }

    .page-shell {
        gap: 0.7rem; /* keep spacing slightly tighter but preserve width */
    }

    .page-hero {
        padding: 0.75rem 0.9rem;
        border-radius: 14px;
    }

    .page-hero .eyebrow {
        padding: 0.22rem 0.52rem;
        font-size: 0.64rem;
    }

    .page-title {
        font-size: 1.22rem;
    }

    .page-subtitle {
        font-size: 0.82rem;
    }

    .hero-metrics {
        gap: 0.5rem;
        margin-top: 0.65rem;
        grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
    }

    .hero-metric {
        padding: 0.55rem 0.65rem;
        border-radius: 12px;
    }

    .hero-metric-label {
        font-size: 0.66rem;
    }

    .hero-metric-value {
        font-size: 0.98rem;
    }

    .card {
        border-radius: 12px;
    }

    .card-body {
        padding: 0.72rem;
    }

    .card-title {
        font-size: 0.9rem;
        margin-bottom: 0.55rem;
    }

    .section-card .card-header {
        padding: 0.7rem 0.8rem 0.6rem;
    }

    /* metric-tile sizing handled by system rules */

    .metric-tile .card-body {
        padding: 0.35rem 0.45rem;
    }

    .metric-card-value,
    .metric-tile-value {
        font-size: 1.18rem;
        line-height: 1.08;
    }

    .metric-tile .label {
        font-size: 0.68rem;
        margin-bottom: 0.1rem;
    }

    .btn {
        border-radius: 9px;
        font-size: 0.78rem;
        padding: 0.36rem 0.62rem;
    }

    .btn-sm {
        border-radius: 8px;
        font-size: 0.72rem;
        padding: 0.28rem 0.5rem;
    }

    label.form-label {
        font-size: 0.76rem;
        margin-bottom: 0.25rem;
    }

    .form-control,
    .form-select,
    textarea.form-control {
        min-height: 34px;
        border-radius: 9px;
        font-size: 0.82rem;
    }

    textarea.form-control {
        min-height: 78px;
    }

    .input-group-text {
        border-radius: 9px;
        font-size: 0.82rem;
        padding: 0.35rem 0.55rem;
    }

    .table-responsive {
        border-radius: 12px;
        max-height: calc(100vh - 260px);
    }

    .table {
        font-size: 0.82rem;
    }

    .table > :not(caption) > * > * {
        padding: 0.42rem 0.5rem;
    }

    .table-sm > :not(caption) > * > * {
        padding: 0.34rem 0.44rem;
    }

    .table .cell-truncate-sm {
        max-width: 105px;
    }

    .table .cell-truncate-md {
        max-width: 155px;
    }

    .table .cell-truncate-lg {
        max-width: 220px;
    }

    .table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        font-size: 0.66rem;
    }

    .badge {
        padding: 0.28rem 0.5rem;
        font-size: 0.7rem;
    }

    .badge-soft {
        padding: 0.24rem 0.48rem;
        font-size: 0.66rem;
    }

    .pagination .page-link {
        border-radius: 8px;
        padding: 0.25rem 0.48rem;
        font-size: 0.76rem;
    }

    .empty-state {
        padding: 0.85rem;
        border-radius: 12px;
    }

    .surface-muted,
    .quick-link {
        padding: 0.65rem;
        border-radius: 12px;
    }

    .quick-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 0.6rem;
    }

    .row.g-3 {
        --bs-gutter-x: 0.6rem;
        --bs-gutter-y: 0.6rem;
    }

    .mb-4 {
        margin-bottom: 0.8rem !important;
    }

    .mb-3 {
        margin-bottom: 0.6rem !important;
    }

    .mt-4 {
        margin-top: 0.8rem !important;
    }

    .mt-3 {
        margin-top: 0.6rem !important;
    }
}

@media (max-width: 991.98px) {
    html, body {
        overflow: auto;
    }

    .navbar-fixed {
        height: auto;
    }

    .main-content {
        position: static;
        padding-top: 96px;
        min-height: calc(100vh - 64px);
        overflow-x: hidden;
        overflow-y: visible;
    }

    .footer-fixed {
        position: static;
        height: auto;
        padding: 0.75rem 0;
    }

}

/* ===== Mobile Responsiveness Tuning =====
   Keeps desktop layout unchanged while improving phones and small tablets.
*/
@media (max-width: 767.98px) {
    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body {
        font-size: 0.86rem;
        line-height: 1.42;
    }

    .system-status-bar {
        position: static;
        height: auto;
        min-height: 30px;
        padding: 0.25rem 0;
        font-size: 0.7rem;
    }

    .system-status-bar .container-fluid {
        gap: 0.35rem;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .system-status-bar .container-fluid::-webkit-scrollbar {
        display: none;
    }

    .status-pill {
        padding: 0.12rem 0.42rem;
        font-size: 0.68rem;
        flex: 0 0 auto;
    }

    .navbar-fixed {
        position: sticky;
        top: 0;
        min-height: auto;
        z-index: 1030;
    }

    .navbar-brand {
        font-size: 0.95rem;
        max-width: 58vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .navbar-toggler {
        padding: 0.25rem 0.45rem;
        border-radius: 10px;
    }

    .navbar-collapse {
        max-height: calc(100vh - 96px);
        overflow-y: auto;
        padding-top: 0.5rem;
    }

    .navbar .nav-link {
        padding: 0.48rem 0.65rem;
        font-size: 0.84rem;
        border-radius: 9px;
    }

    .navbar .dropdown-menu {
        box-shadow: none;
        border-radius: 12px;
        margin: 0.2rem 0 0.45rem;
        max-height: none;
        overflow: visible;
    }

    .navbar .dropdown-item {
        padding: 0.45rem 0.65rem;
        font-size: 0.82rem;
    }

    .main-content {
        position: static;
        min-height: auto;
        padding: 0.65rem 0 0.9rem;
        overflow: visible;
    }

    .main-content > .container,
    .main-content > .container-fluid,
    .main-content > .molo-content-wrap {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .footer-fixed {
        position: static;
        height: auto;
        padding: 0.55rem 0;
        font-size: 0.72rem;
    }

    .footer-fixed .row > * {
        text-align: center !important;
    }

    .page-shell {
        gap: 0.6rem;
    }

    .page-hero {
        padding: 0.75rem 0.8rem;
        border-radius: 14px;
    }

    .page-title {
        font-size: 1.12rem;
        line-height: 1.2;
    }

    .page-subtitle {
        font-size: 0.78rem;
    }

    .page-hero .eyebrow {
        font-size: 0.62rem;
        padding: 0.2rem 0.48rem;
    }

    .page-hero-actions,
    .page-hero .d-flex.gap-2,
    .action-bar {
        width: 100%;
        justify-content: flex-start;
    }

    .page-hero .btn,
    .page-hero-actions .btn,
    .action-bar .btn {
        flex: 1 1 auto;
        min-width: 120px;
    }

    .hero-metrics {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        margin-top: 0.6rem;
    }

    .hero-metric,
    /* metric-tile sizing handled by system rules */

    .metric-card-value,
    .metric-tile-value {
        font-size: 1.05rem;
        line-height: 1.1;
    }

    .card {
        border-radius: 13px;
    }

    .card-body {
        padding: 0.75rem;
    }

    .section-card .card-header {
        padding: 0.65rem 0.75rem;
    }

    .row.g-3,
    .row.g-2 {
        --bs-gutter-x: 0.55rem;
        --bs-gutter-y: 0.55rem;
    }

    .btn {
        font-size: 0.78rem;
        padding: 0.36rem 0.58rem;
        border-radius: 9px;
    }

    .btn-sm {
        font-size: 0.72rem;
        padding: 0.28rem 0.48rem;
        border-radius: 8px;
    }

    .d-flex.gap-2.flex-wrap .btn,
    .d-grid .btn {
        min-height: 32px;
    }

    label.form-label {
        font-size: 0.76rem;
        margin-bottom: 0.22rem;
    }

    .form-control,
    .form-select,
    textarea.form-control {
        min-height: 34px;
        font-size: 0.82rem;
        border-radius: 9px;
    }

    textarea.form-control {
        min-height: 84px;
    }

    .input-group,
    .input-group .form-control,
    .input-group .form-select,
    .input-group .input-group-text,
    .input-group .btn {
        min-width: 0;
    }

    .table-responsive {
        border-radius: 12px;
        overflow-x: auto;
        overflow-y: auto;
        max-height: none;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        font-size: 0.78rem;
        min-width: 640px;
    }

    .table > :not(caption) > * > *,
    .table-sm > :not(caption) > * > * {
        padding: 0.34rem 0.42rem;
    }

    .table thead th {
        font-size: 0.64rem;
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .table .cell-actions,
    .table td.cell-actions {
        white-space: nowrap;
    }

    .member-name,
    .product-name,
    .profile-name,
    .account-name {
        min-width: 150px;
    }

    .badge,
    .badge-soft {
        font-size: 0.66rem;
        padding: 0.22rem 0.46rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.18rem;
    }

    .pagination .page-link {
        font-size: 0.72rem;
        padding: 0.24rem 0.44rem;
    }

    .empty-state {
        padding: 0.75rem;
        border-radius: 12px;
    }

    .info-list {
        gap: 0.45rem;
    }

    .info-item,
    .detail-row {
        padding-bottom: 0.45rem;
    }

    .detail-row {
        flex-direction: column;
        gap: 0.2rem;
    }

    .detail-value {
        text-align: left;
    }

    .quick-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .quick-link,
    .surface-muted {
        padding: 0.65rem;
        border-radius: 12px;
    }

    .flash-stack {
        position: static;
    }

    .alert {
        padding: 0.55rem 0.7rem;
        border-radius: 12px;
    }
}

@media (max-width: 575.98px) {
    .main-content > .container,
    .main-content > .container-fluid,
    .main-content > .molo-content-wrap {
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }

    .page-hero {
        padding: 0.65rem;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .page-hero .btn,
    .page-hero-actions .btn,
    .action-bar .btn,
    .d-flex.gap-2.flex-wrap .btn {
        flex: 1 1 100%;
        width: 100%;
    }

    .card-body {
        padding: 0.65rem;
    }

    .metric-tile .card-body {
        padding: 0.45rem;
    }

    .table {
        min-width: 720px;
    }

    .footer-fixed .small {
        font-size: 0.68rem;
    }
}

/* Preserve important business names unless a template explicitly chooses truncation. */
.member-name,
.product-name,
.profile-name,
.account-name {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Privacy and cookie notice */
.footer-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.footer-link:hover {
    text-decoration: underline;
}

.cookie-privacy-notice {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--app-footer-height, 58px);
    z-index: 1090;
    padding: 0.85rem;
    background: rgba(15, 23, 42, 0.18);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.cookie-privacy-box {
    max-width: 1080px;
    margin: 0 auto;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-privacy-copy p {
    font-size: 0.88rem;
    line-height: 1.45;
}

.cookie-privacy-copy a {
    color: #198754;
    font-weight: 700;
    text-decoration: none;
}

.cookie-privacy-copy a:hover {
    text-decoration: underline;
}

.cookie-privacy-accept {
    min-width: 92px;
}

@media (max-width: 767.98px) {
    .cookie-privacy-notice {
        bottom: 0;
        padding: 0.65rem;
    }

    .cookie-privacy-box {
        align-items: flex-start;
        flex-direction: column;
        border-radius: 0.85rem;
    }

    .cookie-privacy-accept {
        width: 100%;
    }
}


/* =============================================================================
   MOLO SHARED DESIGN SYSTEM — appended to ui.css
   All templates reference these; page-specific rules stay in <style> blocks.
   ============================================================================= */

/* ── Hero (dark navy/gold banner at top of every page) ─────────────────────── */
.page-hero,
[class$="-hero"]:not(.auth-page):not(.login-shell) {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 82% 18%, rgba(255,255,255,0.08), transparent 26%),
    linear-gradient(135deg, rgba(7,20,42,0.99), rgba(20,33,61,0.96));
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(11,29,58,0.12);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

/* Eyebrow pill inside any hero */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.62rem;
  border: 1px solid rgba(212,175,55,0.55);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  color: var(--fedha-gold, #d4af37) !important;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

/* Hero title / subtitle */
.page-hero .page-title,
[class$="-hero"] .page-title { color: #ffffff !important; }
.page-hero .page-subtitle,
[class$="-hero"] .page-subtitle { color: rgba(255,255,255,0.74) !important; }

/* Hero buttons — ALL buttons inside hero get white ghost style by default */
.page-hero .btn,
.page-hero-actions .btn,
[class$="-hero"] .btn {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  padding: 0.28rem 0.72rem !important;
  border-radius: 0.55rem !important;
  line-height: 1.3 !important;
  min-height: 28px !important;
  white-space: nowrap !important;
}

/* Secondary / nav buttons on dark hero — white ghost */
.page-hero .btn-outline-secondary,
.page-hero-actions .btn-outline-secondary,
[class$="-hero"] .btn-outline-secondary {
  border-color: rgba(255,255,255,0.3) !important;
  background: rgba(255,255,255,0.08) !important;
  color: rgba(255,255,255,0.92) !important;
  font-weight: 700 !important;
  border-radius: 0.55rem !important;
}
.page-hero .btn-outline-secondary:hover,
.page-hero .btn-outline-secondary:focus,
.page-hero-actions .btn-outline-secondary:hover,
.page-hero-actions .btn-outline-secondary:focus,
[class$="-hero"] .btn-outline-secondary:hover,
[class$="-hero"] .btn-outline-secondary:focus {
  background: rgba(255,255,255,0.16) !important;
  border-color: rgba(255,255,255,0.5) !important;
  color: #ffffff !important;
}

/* Primary / CTA buttons on dark hero — gold */
.page-hero .btn-gold,
.page-hero-actions .btn-gold,
[class$="-hero"] .btn-gold {
  background: var(--fedha-gold, #d4af37) !important;
  border-color: var(--fedha-gold, #d4af37) !important;
  color: var(--fedha-navy, #0b1d3a) !important;
  font-weight: 800 !important;
}
.page-hero .btn-gold:hover,
.page-hero .btn-gold:focus,
.page-hero-actions .btn-gold:hover,
.page-hero-actions .btn-gold:focus,
[class$="-hero"] .btn-gold:hover,
[class$="-hero"] .btn-gold:focus {
  background: var(--fedha-gold-dark, #b88a13) !important;
  border-color: var(--fedha-gold-dark, #b88a13) !important;
  color: #ffffff !important;
}

/* ── Section card surface ─────────────────────────────────────────────────── */
.section-card {
  border: 1px solid var(--fedha-border, #e2e8f0) !important;
  border-radius: 1rem;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(11,29,58,0.06);
}
.section-card .card-body {
  padding: 0.45rem 0.75rem !important;
}
.section-card h5,
.section-card h6 { color: var(--fedha-navy, #0b1d3a); font-weight: 800 !important; }
.section-card .text-muted.small { color: var(--fedha-muted, #64748b) !important; font-size: 0.78rem; }

/* ── Metric tile ──────────────────────────────────────────────────────────── */
.metric-tile {
  border: 1px solid var(--fedha-border, #e2e8f0);
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(11,29,58,0.06);
  overflow: hidden;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.metric-tile::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--fedha-gold, #d4af37);
}
.metric-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(11,29,58,0.1);
}
.metric-tile .card-body {
  min-height: 52px;
  padding: 0.45rem 0.75rem 0.45rem 0.9rem;
}
.metric-tile small {
  color: var(--fedha-muted, #64748b) !important;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  display: block;
  margin-bottom: 0.15rem;
}
.metric-card-value {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--fedha-navy, #0b1d3a);
}

/* ── Badge-soft tokens ────────────────────────────────────────────────────── */
.badge-soft {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.24rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-soft.info    { background: #eef3f8; border-color: var(--fedha-border, #e2e8f0); color: var(--fedha-navy, #0b1d3a); }
.badge-soft.pending { background: var(--fedha-gold-soft, #fff7d6); border-color: rgba(212,175,55,0.34); color: #7a5600; }
.badge-soft.approved,
.badge-soft.paid    { background: #dcfce7; border-color: #16a34a; color: #14532d; }
.badge-soft.rejected { background: #fee2e2; border-color: #dc2626; color: #7f1d1d; }
.badge-soft.active  { background: #dcfce7; border-color: #16a34a; color: #14532d; }

/* ── Table shared styles ──────────────────────────────────────────────────── */
.sys-table { font-size: 0.84rem; }
.sys-table th {
  white-space: nowrap;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
  color: var(--fedha-navy, #0b1d3a) !important;
  background: #eef3f8 !important;
  border-bottom: 1px solid var(--fedha-border-strong, #cbd5e1) !important;
  position: sticky;
  top: 0;
  z-index: 5;
}
.sys-table td {
  vertical-align: middle;
  border-color: var(--fedha-border, #e2e8f0);
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}
.sys-table tbody tr:hover { --bs-table-hover-bg: rgba(212,175,55,0.07); }

/* ── Table wrapper with scroll ────────────────────────────────────────────── */
.sys-table-wrap {
  border: 1px solid var(--fedha-border, #e2e8f0);
  border-radius: 0.85rem;
  overflow: auto;
  max-height: calc(100vh - 310px);
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.sys-pagination .page-link {
  color: var(--fedha-navy, #0b1d3a);
  border-color: var(--fedha-border, #e2e8f0);
  font-size: 0.82rem;
  padding: 0.25rem 0.55rem;
}
.sys-pagination .page-item.active .page-link {
  background: var(--fedha-gold, #d4af37);
  border-color: var(--fedha-gold, #d4af37);
  color: var(--fedha-navy, #0b1d3a);
  font-weight: 800;
}
.sys-pagination .page-link:hover {
  background: var(--fedha-gold-soft, #fff7d6);
  border-color: var(--fedha-gold, #d4af37);
  color: var(--fedha-navy, #0b1d3a);
}

/* ── Primary gold action button ───────────────────────────────────────────── */
.btn-gold {
  background: var(--fedha-gold, #d4af37) !important;
  border-color: var(--fedha-gold, #d4af37) !important;
  color: var(--fedha-navy, #0b1d3a) !important;
  font-weight: 800;
  border-radius: 0.75rem;
}
.btn-gold:hover, .btn-gold:focus {
  background: var(--fedha-gold-dark, #b88a13) !important;
  border-color: var(--fedha-gold-dark, #b88a13) !important;
  color: #ffffff !important;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
  border-radius: 0.9rem;
  background: #f8fafc;
  border: 1px dashed var(--fedha-border-strong, #cbd5e1) !important;
  color: var(--fedha-muted, #64748b);
  text-align: center;
  font-size: 0.84rem;
  padding: 1rem;
}

/* ── Info list (label/value pairs) ───────────────────────────────────────── */
.info-list {
  border: 1px solid var(--fedha-border, #e2e8f0);
  border-radius: 0.9rem;
  overflow: hidden;
}
.info-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.52rem 0.7rem;
  border-bottom: 1px solid var(--fedha-border, #e2e8f0);
  background: #ffffff;
}
.info-item:last-child { border-bottom: 0; }
.info-label {
  color: var(--fedha-muted, #64748b);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.info-value {
  color: var(--fedha-navy, #0b1d3a);
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

/* ── Money amount ─────────────────────────────────────────────────────────── */
.money {
  font-weight: 800;
  color: var(--fedha-navy, #0b1d3a);
  letter-spacing: -0.02em;
}

/* ── Loan cost preview card ───────────────────────────────────────────────── */
.loan-cost-preview-card {
  border: 1px solid rgba(212,175,55,0.22) !important;
  border-radius: 0.95rem;
  background: linear-gradient(135deg, rgba(212,175,55,0.07), rgba(212,175,55,0.02)) !important;
}
.loan-cost-preview-card h6 { color: var(--fedha-navy, #0b1d3a); font-weight: 800 !important; }
.loan-cost-preview-card small {
  font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--fedha-muted, #64748b) !important;
}
.loan-cost-preview-card strong,
.loan-cost-preview-card .fw-bold { color: var(--fedha-navy, #0b1d3a); font-weight: 800 !important; }

/* ── Payoff preview card border ───────────────────────────────────────────── */
.payoff-preview-card {
  border: 1px solid rgba(212,175,55,0.35) !important;
}
.payoff-preview-header {
  background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(212,175,55,0.05));
  border-bottom: 1px solid rgba(212,175,55,0.18);
  color: var(--fedha-navy, #0b1d3a);
}
.payoff-alert {
  border: 1px solid rgba(212,175,55,0.22);
  border-radius: 0.9rem;
  background: linear-gradient(135deg, rgba(212,175,55,0.10), rgba(212,175,55,0.04));
  color: var(--fedha-navy, #0b1d3a);
}

/* ── Surface muted (teller workspace, summary tiles) ─────────────────────── */
.surface-muted {
  border: 1px solid var(--fedha-border, #e2e8f0);
  border-radius: 0.85rem;
  background: #f8fafc;
  padding: 0.85rem;
}

/* ── Responsive shared ────────────────────────────────────────────────────── */
@media (max-height: 800px) {
  .metric-tile .card-body { min-height: 60px; padding: 0.7rem 0.85rem 0.7rem 1rem; }
  .metric-card-value { font-size: 1.18rem; }
  .sys-table-wrap { max-height: none; }
  .page-hero, [class$="-hero"]:not(.auth-page):not(.login-shell) {
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.5rem;
  }
}
@media (max-width: 768px) {
  .page-hero, [class$="-hero"]:not(.auth-page):not(.login-shell) {
    border-radius: 0.85rem;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.5rem;
  }
  .info-item { flex-direction: column; gap: 0.2rem; }
  .info-value { text-align: left; }
  .sys-table-wrap { max-height: none; }
}

/* ══════════════════════════════════════════════════════════════════
   CANONICAL METRIC TILE — this rule is last and wins everything
   ══════════════════════════════════════════════════════════════════ */

/* Row stretches all columns to equal height */
.row:has(> [class*="col"] > .metric-tile) {
  align-items: stretch;
}

/* Each col that contains a metric-tile fills the row height */
.row > [class*="col"]:has(> .metric-tile) {
  display: flex;
  flex-direction: column;
}

.metric-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--fedha-border, #e2e8f0);
  border-radius: 0.85rem;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(11,29,58,0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  /* Fill the column height so all tiles in a row are equal */
  min-height: unset !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
}

.metric-tile::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--fedha-gold, #d4af37);
}

.metric-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(11,29,58,0.1);
}

.metric-tile .card-body {
  padding: 0.5rem 0.75rem 0.5rem 0.85rem !important;
  /* Fill tile height — content stays top-aligned */
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.metric-tile small,
.metric-tile .metric-label {
  display: block;
  color: var(--fedha-muted, #64748b) !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-card-value,
.metric-tile-value,
.metric-tile .metric-value {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.03em;
  color: var(--fedha-navy, #0b1d3a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Eyebrow — always gold on dark hero, never overridden */
.page-hero .eyebrow,
[class$="-hero"] .eyebrow,
.eyebrow {
  color: var(--fedha-gold, #d4af37) !important;
}
/* Bootstrap-compatible equal-height metric tiles (no :has() needed) */
.metric-row {
  align-items: stretch;
}
.metric-row > [class*="col"] {
  display: flex;
  flex-direction: column;
}
.metric-row > [class*="col"] > .metric-tile {
  flex: 1;
}

/* ── Content area — expanded width, edge-to-edge feel ─────────────────────── */
.molo-content-wrap {
  width: 100%;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (min-width: 1400px) {
  .molo-content-wrap {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (max-width: 768px) {
  .molo-content-wrap {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Scale down metric values on narrow phones so large currency
     figures (e.g. "4,710,784,312") don't overflow or get clipped. */
  .metric-card-value,
  .metric-tile-value,
  .metric-tile .metric-value {
    font-size: 1rem !important;
  }
}

@media (max-width: 400px) {
  .metric-card-value,
  .metric-tile-value,
  .metric-tile .metric-value {
    font-size: 0.9rem !important;
  }
}
