/* ================================================================
   EMPLOYEE LOAN FUND — Stylesheet
   Style: clean, mobile-first, inspired by ebill (blue + yellow)
   ================================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --blue:          #0562b0;
    --blue_dark:     #000034;
    --blue_light:    #e8f3fc;
    --yellow:        #fcd00b;
    --yellow_dark:   #fca80b;
    --yellow_deep:   #cd9100;
    --white:         #ffffff;
    --gray_light:    #f5f7fa;
    --gray_mid:      #e0e4ea;
    --gray_text:     #6b7280;
    --text_dark:     #000034;
    --green:         #00b050;
    --green_light:   #e6f9ee;
    --orange:        #f97316;
    --orange_light:  #fff3e8;
    --red:           #dc2626;
    --red_light:     #fef2f2;
    --radius:        12px;
    --radius_sm:     8px;
    --shadow:        0 4px 20px rgba(0,0,52,0.10);
    --shadow_sm:     0 2px 8px  rgba(0,0,52,0.07);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    border: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ── Base ───────────────────────────────────────────────────── */
body {
    font-family: Arial, sans-serif;
    font-size: 15px;
    background-color: var(--gray_light);
    color: var(--text_dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ================================================================
   NAVBAR
   ================================================================ */
.navbar {
    background: linear-gradient(to right, var(--blue_dark), var(--blue));
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 52px;
    box-shadow: 0 2px 8px rgba(0,0,52,0.25);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav_brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav_logo {
    font-size: 22px;
}

.nav_title {
    font-size: 17px;
    font-weight: bold;
    color: var(--yellow);
    letter-spacing: 0.3px;
}

.nav_user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav_name {
    font-size: 14px;
    color: var(--white);
}

.nav_badge {
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav_badge_admin    { background: var(--red);    color: var(--white); }
.nav_badge_manager  { background: var(--yellow); color: var(--blue_dark); }
.nav_badge_borrower { background: var(--green);  color: var(--white); }

.nav_logout {
    font-size: 13px;
    color: var(--gray_mid);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: var(--radius_sm);
    border: 1px solid rgba(255,255,255,0.25);
    transition: background 0.2s, color 0.2s;
}

.nav_logout:hover {
    background: var(--yellow);
    color: var(--blue_dark);
    border-color: var(--yellow);
}

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
    background: linear-gradient(to right, var(--blue_dark), var(--blue));
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
}

#footer_time {
    color: var(--yellow);
    font-weight: bold;
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login_wrap {
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--blue_dark) 0%, var(--blue) 100%);
}

.login_card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    padding: 36px 30px 28px;
    width: 100%;
    max-width: 380px;
}

.login_head {
    text-align: center;
    margin-bottom: 28px;
}

.login_icon {
    font-size: 44px;
    margin-bottom: 10px;
}

.login_title {
    font-size: 22px;
    font-weight: bold;
    color: var(--blue_dark);
    margin-bottom: 4px;
}

.login_subtitle {
    font-size: 14px;
    color: var(--gray_text);
}

/* Error alert */
.alert_error {
    background: var(--red_light);
    border-left: 4px solid var(--red);
    border-radius: var(--radius_sm);
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--red);
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert_icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Form fields */
.login_form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field_group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field_label {
    font-size: 13px;
    font-weight: bold;
    color: var(--blue_dark);
    -webkit-user-select: text;
    user-select: text;
}

.field_input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-size: 15px;
    font-weight: bold;
    color: var(--blue_dark);
    background: var(--gray_light);
    border: 2px solid var(--gray_mid) !important;
    border-radius: var(--radius_sm);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-user-select: text;
    user-select: text;
}

.field_input:focus {
    background: var(--yellow_light, #fffde8);
    border-color: var(--yellow_dark) !important;
    box-shadow: 0 0 0 3px rgba(252,208,11,0.25);
}

/* Login button */
.btn_login {
    width: 100%;
    height: 50px;
    background: linear-gradient(to right, var(--blue_dark), var(--blue));
    color: var(--white);
    font-size: 16px;
    font-weight: bold;
    border-radius: var(--radius_sm);
    cursor: pointer;
    margin-top: 6px;
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
    letter-spacing: 0.3px;
}

.btn_login:hover:not(:disabled) {
    background: linear-gradient(to right, var(--blue), var(--blue_dark));
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(5,98,176,0.4);
    color: var(--yellow);
}

.btn_login:active:not(:disabled) {
    transform: translateY(0);
}

.btn_login:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.login_help {
    text-align: center;
    font-size: 12px;
    color: var(--gray_text);
    margin-top: 18px;
}

.login_version {
    color: rgba(255,255,255,0.35);
    font-size: 12px;
    margin-top: 16px;
}

/* ================================================================
   PAGE LAYOUT (my_loan, dashboard)
   ================================================================ */
.page_wrap {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.page_header {
    margin-bottom: 20px;
}

.page_title {
    font-size: 22px;
    font-weight: bold;
    color: var(--blue_dark);
}

.page_sub {
    font-size: 15px;
    color: var(--gray_text);
    margin-top: 2px;
}

/* ================================================================
   LOAN REF BAR
   ================================================================ */
.loan_ref_bar {
    background: var(--blue_dark);
    border-radius: var(--radius);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.loan_ref_label {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loan_ref_no {
    font-size: 18px;
    font-weight: bold;
    color: var(--yellow);
    letter-spacing: 1px;
    font-family: monospace;
}

.status_badge {
    font-size: 12px;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: auto;
}

.status_active  { background: var(--green);  color: var(--white); }
.status_closed  { background: var(--gray_text); color: var(--white); }
.status_early   { background: var(--orange); color: var(--white); }

/* ================================================================
   STATS ROW (3 big number cards)
   ================================================================ */
.stats_row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.stat_card {
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    box-shadow: var(--shadow_sm);
}

.stat_blue   { background: var(--blue_light); }
.stat_green  { background: var(--green_light); }
.stat_orange { background: var(--orange_light); }

.stat_value {
    font-size: 18px;
    font-weight: bold;
    color: var(--blue_dark);
    line-height: 1.2;
    word-break: break-all;
}

.stat_label {
    font-size: 11px;
    color: var(--gray_text);
    margin-top: 4px;
    line-height: 1.3;
}

/* ================================================================
   PROGRESS BAR
   ================================================================ */
.progress_wrap {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow_sm);
}

.progress_labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray_text);
    margin-bottom: 8px;
}

.progress_labels:last-child {
    margin-bottom: 0;
    margin-top: 8px;
}

.progress_bar {
    height: 12px;
    background: var(--gray_mid);
    border-radius: 6px;
    overflow: hidden;
}

.progress_fill {
    height: 100%;
    background: linear-gradient(to right, var(--blue), var(--yellow_dark));
    border-radius: 6px;
    transition: width 0.8s ease;
}

/* ================================================================
   DETAIL CARD + TABLE
   ================================================================ */
.detail_card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow_sm);
}

.detail_title {
    font-size: 15px;
    font-weight: bold;
    color: var(--blue_dark);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray_light);
}

.detail_table {
    width: 100%;
    border-collapse: collapse;
}

.detail_table tr:not(:last-child) td {
    border-bottom: 1px solid var(--gray_light);
}

.dt_label {
    font-size: 13px;
    color: var(--gray_text);
    padding: 8px 0;
    width: 55%;
}

.dt_value {
    font-size: 14px;
    font-weight: bold;
    color: var(--blue_dark);
    text-align: right;
    padding: 8px 0;
}

/* ================================================================
   PAYMENT HISTORY TABLE
   ================================================================ */
.history_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.history_table thead tr {
    background: var(--gray_light);
}

.history_table th {
    padding: 8px 6px;
    text-align: left;
    font-size: 12px;
    color: var(--gray_text);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.history_table th:last-child,
.history_table td:last-child {
    text-align: right;
}

.history_table td {
    padding: 9px 6px;
    border-bottom: 1px solid var(--gray_light);
    color: var(--blue_dark);
}

.history_table tr:hover td {
    background: var(--blue_light);
}

.pay_type_badge {
    font-size: 11px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 20px;
}

.badge_daily { background: var(--blue_light); color: var(--blue); }
.badge_early { background: var(--orange_light); color: var(--orange); }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty_card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    box-shadow: var(--shadow_sm);
    color: var(--gray_text);
}

.empty_icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty_card h3 {
    font-size: 18px;
    color: var(--blue_dark);
    margin-bottom: 8px;
}

.empty_card p {
    font-size: 14px;
    line-height: 1.6;
}

/* ================================================================
   RESPONSIVE — phone
   ================================================================ */
@media (max-width: 400px) {
    .stats_row {
        grid-template-columns: 1fr;
    }

    .stat_value {
        font-size: 22px;
    }

    .login_card {
        padding: 28px 20px 22px;
    }

    .loan_ref_no {
        font-size: 15px;
    }
}

@media (min-width: 401px) and (max-width: 600px) {
    .stat_value {
        font-size: 16px;
    }
}

/* ================================================================
   REMAINING BALANCE CARD
   ================================================================ */
.remaining_card {
    background: linear-gradient(135deg, var(--blue_dark), var(--blue));
    border-radius: var(--radius);
    padding: 20px 18px;
    margin-bottom: 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.remaining_label {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.remaining_value {
    font-size: 32px;
    font-weight: bold;
    color: var(--yellow);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.remaining_sub {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
}

/* ================================================================
   LANGUAGE SWITCHER
   ================================================================ */
.lang_switch {
    display: flex;
    gap: 4px;
}

.login_lang {
    position: fixed;
    top: 12px;
    right: 16px;
    display: flex;
    gap: 6px;
    z-index: 200;
}

.lang_btn {
    font-size: 20px;
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
    line-height: 1;
}

.lang_btn:hover  { opacity: 0.9; transform: scale(1.15); }
.lang_active     { opacity: 1 !important; }

/* ================================================================
   DASHBOARD
   ================================================================ */
.page_wide { max-width: 960px; }

.dash_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.dash_card {
    border-radius: var(--radius);
    padding: 18px 14px;
    text-align: center;
    box-shadow: var(--shadow_sm);
}

.dash_green  { background: var(--green_light);  }
.dash_blue   { background: var(--blue_light);   }
.dash_orange { background: var(--orange_light); }
.dash_teal   { background: #e6f7f7; }
.dash_yellow { background: #fffbe6; }
.dash_gray   { background: var(--gray_light);   }

.dash_icon  { font-size: 22px; margin-bottom: 6px; }

.dash_value {
    font-size: 19px;
    font-weight: bold;
    color: var(--blue_dark);
    line-height: 1.2;
    word-break: break-all;
}

.dash_label {
    font-size: 11px;
    color: var(--gray_text);
    margin-top: 4px;
    line-height: 1.3;
}

/* Total profit bar */
.profit_bar {
    background: linear-gradient(to right, var(--blue_dark), var(--blue));
    border-radius: var(--radius);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.profit_bar_label {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profit_bar_value {
    font-size: 20px;
    font-weight: bold;
    color: var(--yellow);
}

/* Table header row */
.table_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.btn_add {
    background: var(--blue);
    color: var(--white);
    font-size: 13px;
    font-weight: bold;
    padding: 7px 14px;
    border-radius: var(--radius_sm);
    text-decoration: none;
    transition: background 0.2s;
}

.btn_add:hover { background: var(--blue_dark); color: var(--yellow); }

/* Loans table */
.table_scroll { overflow-x: auto; }

.loans_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 640px;
}

.loans_table thead tr {
    background: var(--gray_light);
    border-bottom: 2px solid var(--gray_mid);
}

.loans_table th {
    padding: 9px 8px;
    text-align: left;
    font-size: 11px;
    color: var(--gray_text);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.loans_table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--gray_light);
    color: var(--blue_dark);
    vertical-align: middle;
}

.loans_table tr:hover td { background: var(--blue_light); }

.td_num    { text-align: right; font-weight: bold; }
.td_center { text-align: center; }
.td_name   { font-weight: bold; }

.ref_badge {
    font-family: monospace;
    font-size: 12px;
    background: var(--blue_dark);
    color: var(--yellow);
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Mini progress bar inside table */
.mini_bar {
    height: 4px;
    background: var(--gray_mid);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.mini_fill {
    height: 100%;
    background: linear-gradient(to right, var(--blue), var(--yellow_dark));
    border-radius: 2px;
}

.days_badge {
    font-size: 12px;
    font-weight: bold;
    background: var(--blue_light);
    color: var(--blue);
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Responsive dashboard */
@media (max-width: 600px) {
    .dash_grid { grid-template-columns: repeat(2, 1fr); }
    .dash_value { font-size: 16px; }
    .profit_bar_value { font-size: 17px; }
    .page_wide { padding: 16px 12px 40px; }
}

@media (max-width: 360px) {
    .dash_grid { grid-template-columns: 1fr; }
}

/* ================================================================
   LANGUAGE SWITCHER
   ================================================================ */
.lang_switch {
    display: flex;
    gap: 4px;
    margin-right: 6px;
}

/* lang_btn replaced by flag_img in v23 */

/* ================================================================
   DASHBOARD
   ================================================================ */
.page_wrap.page_wide { max-width: 960px; }

.page_header_row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

/* 4 stat cards */
.dash_stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.dash_card {
    border-radius: var(--radius);
    padding: 18px 14px 14px;
    text-align: center;
    box-shadow: var(--shadow_sm);
}

.dash_green  { background: var(--green_light); }
.dash_blue   { background: var(--blue_light); }
.dash_yellow { background: #fffbea; }
.dash_orange { background: var(--orange_light); }

.dash_icon  { font-size: 24px; margin-bottom: 6px; }
.dash_value { font-size: 20px; font-weight: bold; color: var(--blue_dark); }
.dash_label { font-size: 11px; color: var(--gray_text); margin-top: 4px; line-height: 1.3; }
.dash_sub   { font-size: 11px; color: var(--gray_text); }

/* Capital bar */
.capital_bar {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow_sm);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    overflow-x: auto;
}

.cap_item   { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 120px; }
.cap_label  { font-size: 11px; color: var(--gray_text); text-transform: uppercase; letter-spacing: 0.4px; }
.cap_value  { font-size: 14px; font-weight: bold; color: var(--blue_dark); }
.cap_divider { font-size: 20px; color: var(--gray_mid); font-weight: bold; }
.cap_green  { color: var(--green); }
.cap_red    { color: var(--red); }
.cap_bold   { font-size: 16px; color: var(--blue_dark); }

/* Section card */
.section_card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow_sm);
    margin-bottom: 16px;
    overflow: hidden;
}

.section_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 2px solid var(--gray_light);
}

.section_title {
    font-size: 15px;
    font-weight: bold;
    color: var(--blue_dark);
}

/* Data table */
.table_wrap { overflow-x: auto; }

.data_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data_table thead tr { background: var(--gray_light); }

.data_table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    color: var(--gray_text);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.th_right  { text-align: right; }
.th_center { text-align: center; }

.data_table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--gray_light);
    color: var(--blue_dark);
    white-space: nowrap;
}

.data_table tr:last-child td { border-bottom: none; }
.data_table tr:hover td      { background: var(--blue_light); }

.td_right  { text-align: right; }
.td_center { text-align: center; }
.td_mono   { font-family: monospace; font-size: 12px; letter-spacing: 0.5px; }
.td_green  { color: var(--green); font-weight: bold; }
.td_bold   { font-weight: bold; }

.days_badge {
    background: var(--blue_light);
    color: var(--blue);
    font-size: 12px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 20px;
}

/* Buttons */
.btn_primary {
    background: linear-gradient(to right, var(--blue_dark), var(--blue));
    color: var(--white);
    padding: 10px 18px;
    border-radius: var(--radius_sm);
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    display: inline-block;
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.btn_primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5,98,176,0.35);
    color: var(--yellow);
}

.btn_secondary {
    background: var(--green_light);
    color: var(--green);
    padding: 8px 14px;
    border-radius: var(--radius_sm);
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    display: inline-block;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn_secondary:hover { background: var(--green); color: var(--white); }

.btn_action {
    background: var(--blue_light);
    color: var(--blue);
    padding: 5px 10px;
    border-radius: var(--radius_sm);
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn_action:hover { background: var(--blue); color: var(--white); }

.empty_inline {
    padding: 24px 18px;
    color: var(--gray_text);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Responsive dashboard ── */
@media (max-width: 600px) {
    .dash_stats { grid-template-columns: repeat(2, 1fr); }
    .capital_bar { flex-direction: column; align-items: flex-start; }
    .cap_divider { display: none; }
}

@media (max-width: 360px) {
    .dash_stats { grid-template-columns: 1fr; }
}

/* ================================================================
   FORM CARD — register payment / new loan
   ================================================================ */
.form_card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--shadow_sm);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.field_select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230070C0' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.field_optional {
    font-weight: normal;
    color: var(--gray_text);
    font-size: 12px;
}

/* Info bar — auto-filled after loan selection */
.info_bar {
    background: var(--blue_light);
    border-radius: var(--radius_sm);
    padding: 12px 16px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    border-left: 4px solid var(--blue);
}

.info_item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info_label {
    font-size: 11px;
    color: var(--gray_text);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.info_value {
    font-size: 15px;
    font-weight: bold;
    color: var(--blue_dark);
}

/* Radio buttons — payment type */
.radio_group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio_label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius_sm);
    border: 2px solid var(--gray_mid);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    -webkit-user-select: none;
    user-select: none;
}

.radio_label:has(input:checked) {
    border-color: var(--blue);
    background: var(--blue_light);
}

.radio_early:has(input:checked) {
    border-color: var(--orange);
    background: var(--orange_light);
}

.radio_label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
    flex-shrink: 0;
    cursor: pointer;
}

.radio_text {
    font-weight: bold;
    font-size: 14px;
    color: var(--blue_dark);
    flex: 1;
}

.radio_sub {
    font-size: 12px;
    color: var(--gray_text);
}

/* Submit + back buttons */
.btn_submit {
    width: 100%;
    height: 50px;
    background: linear-gradient(to right, var(--green), #007a37);
    color: var(--white);
    font-size: 16px;
    font-weight: bold;
    border-radius: var(--radius_sm);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
    letter-spacing: 0.3px;
    margin-top: 4px;
}

.btn_submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,176,80,0.4);
}

.btn_submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn_back {
    display: block;
    text-align: center;
    font-size: 14px;
    color: var(--gray_text);
    text-decoration: none;
    padding: 8px;
    transition: color 0.2s;
}

.btn_back:hover { color: var(--blue); }

/* Success alert */
.alert_success {
    background: var(--green_light);
    border-left: 4px solid var(--green);
    border-radius: var(--radius_sm);
    padding: 12px 14px;
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

/* ================================================================
   REGISTER PAYMENT — info panel styles
   ================================================================ */

/* Status bar container */
.status_bar {
    background: var(--blue_light);
    border-radius: var(--radius_sm);
    border-left: 4px solid var(--blue);
    overflow: hidden;
}

.status_row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px 16px 10px;
}

/* Last payment status bar — colour coded */
.last_pay_bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: bold;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.lpb_green  { background: var(--green_light);  color: var(--green);     border-left: 4px solid var(--green); }
.lpb_yellow { background: #fffbea;             color: #92660a;          border-left: 4px solid #f59e0b; }
.lpb_red    { background: var(--red_light);    color: var(--red);       border-left: 4px solid var(--red); }
.lpb_gray   { background: var(--gray_light);   color: var(--gray_text); border-left: 4px solid var(--gray_mid); }

/* Recent payments mini-table */
.recent_panel {
    background: var(--white);
    border-radius: var(--radius_sm);
    border: 1px solid var(--gray_mid);
    overflow: hidden;
    margin-top: 8px;
}

.recent_title {
    font-size: 12px;
    font-weight: bold;
    color: var(--gray_text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    background: var(--gray_light);
    border-bottom: 1px solid var(--gray_mid);
}

.mini_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mini_table th {
    padding: 6px 10px;
    text-align: left;
    font-size: 11px;
    color: var(--gray_text);
    text-transform: uppercase;
    background: var(--gray_light);
}

.mini_table th:nth-child(2) { text-align: right; }

.mini_table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--gray_light);
    color: var(--blue_dark);
}

.mini_table td:nth-child(2) { text-align: right; font-weight: bold; }

.mini_table tr:last-child td { border-bottom: none; }

.mini_loading {
    text-align: center;
    color: var(--gray_text);
    padding: 12px;
    font-style: italic;
}

/* Today highlight */
.row_today td { background: #fffbea !important; }

.today_mark {
    background: var(--yellow);
    color: var(--blue_dark);
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

/* ================================================================
   NAVBAR LINK
   ================================================================ */
.nav_link {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: var(--radius_sm);
    transition: background 0.2s, color 0.2s;
}
.nav_link:hover {
    background: rgba(255,255,255,0.12);
    color: var(--yellow);
}

/* ================================================================
   USERS TABLE — badges and dots
   ================================================================ */
.count_badge {
    font-size: 12px;
    background: var(--blue_light);
    color: var(--blue);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: bold;
}

.role_badge {
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.role_admin    { background: #fef2f2; color: var(--red); }
.role_manager  { background: #fffbea; color: #92660a; }
.role_borrower { background: var(--green_light); color: var(--green); }

.status_dot {
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}
.status_dot::before { content: '●'; font-size: 8px; }
.dot_green  { color: var(--green); }
.dot_red    { color: var(--red); }
.dot_gray   { color: var(--gray_text); }

.td_gray { color: var(--gray_text); font-size: 13px; }

/* ================================================================
   MODAL
   ================================================================ */
.modal_overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,52,0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal_overlay.modal_open {
    display: flex;
}

.modal_box {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,52,0.3);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modal_in 0.2s ease;
}

@keyframes modal_in {
    from { opacity:0; transform: translateY(-16px) scale(0.97); }
    to   { opacity:1; transform: translateY(0)     scale(1); }
}

.modal_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 14px;
    border-bottom: 2px solid var(--gray_light);
}

.modal_header h3 {
    font-size: 16px;
    color: var(--blue_dark);
}

.modal_close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--gray_text);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}
.modal_close:hover { background: var(--gray_light); color: var(--red); }

.modal_body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal_footer {
    padding: 14px 20px 18px;
    border-top: 1px solid var(--gray_light);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Two-column field row inside modal */
.field_row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

.btn_cancel {
    padding: 9px 18px;
    border-radius: var(--radius_sm);
    background: var(--gray_light);
    color: var(--gray_text);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
}
.btn_cancel:hover { background: var(--gray_mid); }

.btn_submit_sm {
    padding: 9px 20px;
    border-radius: var(--radius_sm);
    background: linear-gradient(to right, var(--green), #007a37);
    color: var(--white);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn_submit_sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,176,80,0.35);
}

.btn_submit_sm.btn_blue {
    background: linear-gradient(to right, var(--blue_dark), var(--blue));
}
.btn_submit_sm.btn_blue:hover {
    box-shadow: 0 4px 12px rgba(5,98,176,0.35);
}

/* ================================================================
   NAVBAR + FOOTER — constrained width (v11)
   Content centered to match page_wrap width
   ================================================================ */
.nav_inner {
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Footer inner — same constraint */
.footer .nav_inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ================================================================
   NEW LOAN — preview card + borrower status bar
   ================================================================ */
.loan_preview {
    background: var(--blue_light);
    border-radius: var(--radius_sm);
    border-left: 4px solid var(--blue);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview_row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(5,98,176,0.1);
}

.preview_row:last-child { border-bottom: none; }
.preview_row_bold .preview_label,
.preview_row_bold .preview_value {
    font-weight: bold;
    font-size: 15px;
}

.preview_label { color: var(--gray_text); }
.preview_value { color: var(--blue_dark); font-weight: bold; }
.preview_value.mono { font-family: monospace; letter-spacing: 1px; }

.borrower_status {
    border-radius: var(--radius_sm);
    padding: 10px 14px;
    font-size: 14px;
}

.bs_green {
    background: var(--green_light);
    border-left: 4px solid var(--green);
    color: #1a5c35;
}

.bs_red {
    background: var(--red_light);
    border-left: 4px solid var(--red);
    color: var(--red);
}

.alert_link {
    color: inherit;
    font-weight: bold;
    margin-left: 8px;
    text-decoration: underline;
}

/* ================================================================
   CAPITAL PAGE
   ================================================================ */
.amt_green { color: var(--green);    font-weight: bold; }
.amt_blue  { color: var(--blue);     font-weight: bold; }
.amt_red   { color: var(--red);      font-weight: bold; }

.tfoot_total td {
    border-top: 2px solid var(--gray_mid);
    padding: 10px 12px;
    background: var(--gray_light);
    font-size: 13px;
}

/* Reinvest banner */
.reinvest_banner {
    background: linear-gradient(to right, #fffbea, #fef3c7);
    border: 2px solid var(--yellow_dark);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.reinvest_info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: var(--blue_dark);
    flex: 1;
}

.reinvest_icon { font-size: 24px; flex-shrink: 0; }

.reinvest_info small {
    display: block;
    color: var(--gray_text);
    margin-top: 2px;
    font-size: 12px;
}

.btn_reinvest {
    background: linear-gradient(to right, var(--yellow_deep), var(--yellow_dark));
    color: var(--blue_dark);
    font-size: 14px;
    font-weight: bold;
    padding: 10px 18px;
    border-radius: var(--radius_sm);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn_reinvest:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(205,145,0,0.4);
}

/* Event type info box */
.event_info_box {
    background: var(--blue_light);
    border-left: 4px solid var(--blue);
    border-radius: var(--radius_sm);
    padding: 10px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    color: var(--blue_dark);
}

.event_info_icon { font-size: 20px; flex-shrink: 0; }

.reinvest_warn_box {
    background: #fffbea;
    border-left: 4px solid var(--yellow_dark);
    border-radius: var(--radius_sm);
    padding: 10px 14px;
    font-size: 13px;
    color: #92660a;
}

.field_readonly {
    height: 46px;
    padding: 0 14px;
    background: var(--gray_light);
    border-radius: var(--radius_sm);
    display: flex;
    align-items: center;
    font-weight: bold;
    color: var(--blue_dark);
    font-size: 15px;
    border: 2px solid var(--gray_mid);
}

/* ================================================================
   REINVEST BANNER — colour coded (v14)
   ================================================================ */
.reinvest_green {
    background: linear-gradient(to right, #e6f9ee, #d1f5e0);
    border: 2px solid var(--green);
}

.reinvest_green .reinvest_info { color: #1a5c35; }

.reinvest_red {
    background: linear-gradient(to right, #fef2f2, #fde8e8);
    border: 2px solid var(--red);
}

.reinvest_red .reinvest_info { color: var(--red); }

/* ================================================================
   LOAN HISTORY
   ================================================================ */
.filter_row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter_btn {
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    color: var(--gray_text);
    background: var(--gray_light);
    border: 2px solid var(--gray_mid);
    transition: all 0.15s;
    white-space: nowrap;
}

.filter_btn:hover  { background: var(--blue_light); color: var(--blue); border-color: var(--blue); }
.filter_active     { background: var(--blue_dark) !important; color: var(--white) !important; border-color: var(--blue_dark) !important; }

.mini_progress {
    height: 6px;
    background: var(--gray_mid);
    border-radius: 3px;
    overflow: hidden;
    width: 80px;
    margin: 0 auto 2px;
}

.mini_bar {
    height: 100%;
    background: linear-gradient(to right, var(--blue), var(--yellow_dark));
    border-radius: 3px;
}

.mini_pct {
    font-size: 11px;
    color: var(--gray_text);
}

/* Status pills */
.status_pill {
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.pill_active { background: var(--green_light);  color: var(--green); }
.pill_closed { background: var(--blue_light);   color: var(--blue);  }
.pill_early  { background: var(--orange_light); color: var(--orange);}

/* ================================================================
   FLAGS v23 — PNG images, same mechanism as ebill app
   flag_active = current language (dimmed, pointer-events none)
   no class    = other language (bright, clickable, pulsing)
   ================================================================ */
.flag_img {
    height: 28px;
    width: auto;
    margin: 0 3px;
    cursor: pointer;
    opacity: 1;
    border-radius: 3px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: flag_pulse 2.5s ease-in-out infinite;
}

.flag_img:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(252,208,11,0.6);
}

.flag_img.flag_active {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
    animation: none;
    transform: scale(0.85);
    box-shadow: none;
}

@keyframes flag_pulse {
    0%,100% { transform: scale(1.0);  }
    50%      { transform: scale(1.1); }
}

/* ================================================================
   FOOTER v21 — taller, bigger clock
   ================================================================ */
.footer_tall {
    min-height: 44px;
    padding: 10px 20px;
}

.footer_tall #footer_time {
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.footer_tall .footer_copy {
    font-size: 13px;
}

/* ================================================================
   PROGRESS BAR v22 — fixed alignment
   ================================================================ */
.mini_progress_wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    line-height: 1;
}

.mini_progress_wrap .mini_progress {
    width: 80px;
    height: 8px;
    background: var(--gray_mid);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.mini_progress_wrap .mini_bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 8px;
    background: linear-gradient(to right, var(--blue), var(--yellow_dark));
    border-radius: 4px;
    max-width: 100%;
}

.mini_progress_wrap .mini_pct {
    font-size: 11px;
    color: var(--gray_text);
    line-height: 1;
    display: block;
}

/* Print agreement button */
.btn_print {
    background: linear-gradient(to right, #7c3aed, #6d28d9);
    color: var(--white);
    padding: 5px 10px;
    border-radius: var(--radius_sm);
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    transition: background 0.15s;
    white-space: nowrap;
}
.btn_print:hover { background: #5b21b6; color: var(--white); }


/* ================================================================
   NAVBAR LAYOUT v24 — 3 sections: menu | flags | user info
   Order: Dashboard/Capital/Users/History | FLAGS | name/role/logout
   ================================================================ */
.nav_inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.nav_left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.nav_right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav_brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 14px;
    padding-right: 14px;
    border-right: 1px solid rgba(255,255,255,0.2);
}

/* Flags get a visual divider on both sides — "natural border" */
.lang_switch {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    border-left: 1px solid rgba(255,255,255,0.15);
    border-right: 1px solid rgba(255,255,255,0.15);
}

/* ── New Password button in navbar ── */
.nav_newpass {
    background: rgba(255,255,255,0.15);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: var(--radius_sm);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.15s;
}
.nav_newpass:hover { background: rgba(255,255,255,0.28); }

/* ── Alert boxes ── */
.alert_success {
    background: #d4edda; color: #155724;
    border: 1px solid #c3e6cb; border-radius: var(--radius_sm);
    padding: 10px 14px; margin-bottom: 14px; font-size: 14px;
}
.alert_error {
    background: #f8d7da; color: #721c24;
    border: 1px solid #f5c6cb; border-radius: var(--radius_sm);
    padding: 10px 14px; margin-bottom: 14px; font-size: 14px;
}
