@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');
/* Provide sufficient contrast against white background */
a {
    color: #0366d6;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

sub {
    vertical-align: middle !important;
    position: relative;
    bottom: 0;
}

/*----*/
html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
    /*font-family: 'Outfit', sans-serif;*/
    background-color: #f8fafe;
    /*font-size: 0.9rem;
    margin-bottom: 60px;*/
    font-size: .875rem;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.btn-sidebar-add {
    color: #16c7ff !important;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.btn-sidebar-add:hover {
    opacity: 1;
    transform: scale(1.1);
    text-shadow: 0 0 8px rgba(22, 199, 255, 0.6);
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item a {
    text-decoration: none;
    color: #6c757d;
}

.breadcrumb-item.active {
    color: #2d3748;
    font-weight: 600;
}

.footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    line-height: 60px;
    text-align: center;
    /*background-color: #fff;
    border-top: 1px solid #edf2f7;*/
    white-space: nowrap;
    /*font-size: 0.85rem;
    color: #718096;*/
}

.feather {
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
}

/* Responsive behavior for the existing portal theme. */
.sidebar-backdrop {
    display: none;
}

.mobile-action-label {
    display: none;
}

#close-sidebar {
    border: 0;
    background: transparent !important;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#show-sidebar {
    background: transparent !important;
}

.member-search-container {
    margin-top: -25px;
}

.member-search-input-group {
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
}

.member-search-input-group .form-control {
    border-color: #ced4da;
}

.member-search-input-group .form-control:focus {
    box-shadow: none;
    border-color: #0d6efd;
}

.member-search-input-group .member-search-btn {
    border-color: #ced4da;
    background: #f8f9fa;
    color: #495057;
    padding-left: 0.9rem;
    padding-right: 0.9rem;
}

.member-search-input-group .member-search-btn:hover {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

/* Single-Line Loan Lineage Bar with Full-Height Blended Edge Buttons */
.loan-lineage-bar {
    display: flex;
    align-items: stretch;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #dbe3ec;
    border-radius: 0.65rem;
    overflow: hidden;
    min-height: 58px;
}

.loan-lineage-bar .lineage-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    align-self: stretch;
    border: 0;
    padding: 0.65rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #0d6efd;
    background: linear-gradient(180deg, #eef4ff 0%, #e2ecff 100%);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

.loan-lineage-bar .lineage-nav-prev {
    border-right: 1px solid #d0def5;
}

.loan-lineage-bar .lineage-nav-next {
    border-left: 1px solid #d0def5;
}

.loan-lineage-bar .lineage-nav-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #0d6efd 0%, #0b5ed7 100%);
    color: #ffffff;
}

.loan-lineage-bar .lineage-nav-btn:active:not(:disabled) {
    background: #0a58ca;
    color: #ffffff;
}

.loan-lineage-bar .lineage-nav-btn:disabled,
.loan-lineage-bar .lineage-nav-btn.disabled {
    background: linear-gradient(180deg, #f1f3f5 0%, #e9ecef 100%);
    color: #adb5bd;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.75;
}

.loan-lineage-bar .lineage-center-stage {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.65rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.loan-lineage-bar .lineage-meta-strip {
    border-top-color: #e2e8f0 !important;
}

#docViewerContainer,
#docApprovalPanel {
    min-height: 550px;
}

@media (max-width: 767.98px) {
    html { font-size: 16px; }
    body { font-size: 1rem; }
    body.mobile-menu-open { overflow: hidden; }

    #show-sidebar {
        z-index: 1001;
        width: 40px;
        height: 40px;
        min-height: 40px;
        top: 10px;
        left: 12px;
        border-radius: 0.5rem;
        background: #ffffff !important;
        border: 1px solid #ced4da !important;
        color: #0d6efd !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 998;
        border: 0;
        padding: 0;
        background: rgba(0, 0, 0, .45);
    }

    /* Mobile sidebar behavior: hidden by default on load, visible only when mobile menu is opened */
    .page-wrapper .sidebar-wrapper,
    .page-wrapper.toggled:not(.mobile-open) .sidebar-wrapper {
        left: -300px;
    }
    .page-wrapper #show-sidebar,
    .page-wrapper.toggled:not(.mobile-open) #show-sidebar {
        left: 12px;
    }
    .page-wrapper .sidebar-backdrop,
    .page-wrapper.toggled:not(.mobile-open) .sidebar-backdrop {
        display: none;
    }

    body.mobile-menu-open .page-wrapper .sidebar-wrapper,
    body.mobile-menu-open .page-wrapper.toggled .sidebar-wrapper,
    .page-wrapper.mobile-open .sidebar-wrapper {
        left: 0px;
    }
    body.mobile-menu-open .page-wrapper #show-sidebar,
    body.mobile-menu-open .page-wrapper.toggled #show-sidebar,
    .page-wrapper.mobile-open #show-sidebar {
        left: -50px;
    }
    body.mobile-menu-open .page-wrapper .sidebar-backdrop,
    body.mobile-menu-open .page-wrapper.toggled .sidebar-backdrop,
    .page-wrapper.mobile-open .sidebar-backdrop {
        display: block;
    }

    .page-wrapper .page-content { padding-top: 10px !important; }
    .page-wrapper .page-content > .container-fluid { padding: 0 12px 16px 12px; }
    .member-search-container {
        margin-top: 0 !important;
        margin-bottom: 0.75rem !important;
        padding-left: 48px;
        padding-bottom: 0.65rem !important;
        min-height: 40px;
        display: flex;
        align-items: center;
        clear: both;
    }
    .member-search-container .member-search-form {
        width: 100%;
        margin: 0;
    }
    .member-search-container .member-search-input-group {
        height: 40px;
        border-radius: 0.5rem;
    }
    .member-search-container .member-search-input-group .form-control,
    .member-search-container .member-search-input-group .member-search-btn {
        height: 40px;
        min-height: 40px;
        font-size: 0.9rem;
    }
    .page-wrapper .page-content > .container-fluid > :first-child:not(.member-search-container) {
        margin-top: 44px;
    }

    .loan-lineage-bar .lineage-nav-btn {
        padding: 0.5rem 0.65rem;
    }
    .loan-lineage-bar .lineage-nav-label {
        display: none;
    }
    .loan-lineage-bar .lineage-center-stage {
        padding: 0.55rem 0.65rem;
    }

    .page-content .breadcrumb { flex-wrap: wrap; gap: .25rem 0; margin-bottom: 1rem; }
    .page-content .card-header.d-flex,
    .page-content .bg-white.d-flex.justify-content-between.align-items-center,
    .member-dashboard .d-flex.justify-content-between.align-items-center {
        flex-wrap: wrap;
        align-items: flex-start !important;
        gap: .75rem;
    }
    .page-content .card-header.d-flex > .btn,
    .page-content .bg-white.d-flex.justify-content-between.align-items-center > .btn { width: 100%; }
    .page-content .card-header .d-flex.gap-2,
    .page-content .bg-white .d-flex.gap-2 { flex-wrap: wrap; width: 100%; }

    ul.statistics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    ul.statistics li {
        display: block;
        width: auto;
        height: auto;
        min-height: 116px;
        padding: 12px;
        min-width: 0;
    }
    ul.statistics li div.number {
        margin-top: 42px;
        font-size: clamp(1rem, 4vw, 1.25rem);
        overflow-wrap: anywhere;
    }
    ul.statistics li div.title { font-size: .75rem; }
    ul.statistics li i { font-size: 30px; }
    .member-mobile-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
    .member-mobile-actions .btn { min-height: 44px; display: flex; align-items: center; justify-content: center; }
    .page-content .h3,
    .page-content .display-6 { font-size: clamp(1.25rem, 6vw, 2rem); overflow-wrap: anywhere; }
    .member-dashboard + .row .d-flex.gap-2.flex-wrap > .btn { min-height: 44px; }
    .page-content .card-body > .d-flex.gap-2 { flex-wrap: wrap; }
    .page-content .card-body > .d-flex.gap-2 > .btn { flex: 1 1 100%; min-height: 44px; }

    .page-content .form-control-sm,
    .page-content .form-select-sm,
    .page-content .input-group-sm > .form-control,
    .page-content .input-group-sm > .form-select,
    .page-content .btn-sm {
        min-height: 40px;
        min-width: 40px;
        font-size: .95rem;
    }
    .page-content .card-body.p-4 { padding: 1rem !important; }
    .mobile-form-actions { display: flex; flex-direction: column-reverse; gap: .5rem; }
    .mobile-form-actions > .btn,
    .mobile-form-actions > button { width: 100%; min-height: 44px; margin: 0 !important; }
    .page-content .modal-dialog { margin: .5rem; }
    #showIdDoc .modal-dialog { max-width: none; }
    #docViewerContainer { min-height: 0; height: min(50vh, 420px); overflow: auto; }
    #docViewerContainer object { height: 100% !important; }
    #docApprovalPanel { min-height: 0; }

    .mobile-list { overflow-x: visible; }
    .mobile-cards { border-collapse: separate; border-spacing: 0 12px; }
    .mobile-cards thead { display: none; }
    .mobile-cards tbody,
    .mobile-cards tr,
    .mobile-cards td { display: block; width: 100%; }
    .mobile-cards tr:not(.mobile-empty) {
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: .5rem;
        padding: .5rem .75rem;
        box-shadow: 0 2px 6px rgba(0, 0, 0, .04);
    }
    .mobile-cards tr:not(.mobile-empty) td {
        border: 0;
        padding: .35rem 0 !important;
        text-align: left !important;
        overflow-wrap: anywhere;
    }
    .mobile-cards tr:not(.mobile-empty) td::before {
        content: attr(data-label);
        display: block;
        color: #6c757d;
        font-size: .75rem;
        font-weight: 600;
        margin-bottom: .1rem;
    }
    .mobile-cards .mobile-card-actions .btn,
    .mobile-cards .mobile-card-actions button { min-height: 40px; }
    .mobile-cards .mobile-card-actions .btn-group { display: flex; flex-wrap: wrap; gap: .35rem; }
    .mobile-cards .mobile-card-actions .btn-group > form { display: inline-flex !important; }
    .mobile-cards .mobile-card-actions .btn-group > .btn { border-radius: .375rem !important; }
    .mobile-cards .mobile-card-actions .mobile-action-label { display: inline; }
    .mobile-cards .mobile-empty td { display: block; width: 100%; }

    .dataTables_filter,
    .dataTables_paginate { justify-content: flex-start !important; }
    .dataTables_filter input { min-width: 0 !important; max-width: 100%; }
    .footer {
        position: static;
        height: auto;
        line-height: 1.5;
        white-space: normal;
        text-align: left;
        overflow-wrap: anywhere;
    }
    .page-content { padding-bottom: 1rem !important; }
}

.page-wrapper {
    position: relative;
    min-height: 100vh;
}

.page-content {
    padding-bottom: 80px !important;
}

/* Universal Button & Link Spinner Enhancements */
.has-spinner,
.btn-loading,
.isPgPrcs {
    transition: opacity 0.15s ease-in-out;
}

.spinner-prepended {
    display: inline-block;
    vertical-align: middle;
}

.btn .fa-spinner,
button .fa-spinner,
a .fa-spinner {
    vertical-align: middle;
}
