:root {
    --navy-950: #060f20;
    --navy-900: #0a1a33;
    --navy-800: #14305f;
    --gold-600: #c9a55a;
    --gold-500: #d8b76a;
    --bg: #f4f6fb;
    --line: #dbe2ef;
    --ink: #0a1a33;
    --muted: #5f6f8c;
}
* { box-sizing: border-box; }
body {
    font-family: "Inter", Arial, sans-serif;
    margin: 0;
    background: linear-gradient(rgba(10, 26, 51, 0.65), rgba(10, 26, 51, 0.75)), url("../5.jpg") center/cover fixed no-repeat;
    color: var(--ink);
}
a { color: var(--navy-800); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1240px; margin: 0 auto; padding: 20px; }
.shell { background: rgba(255,255,255,0.92); backdrop-filter: blur(6px); border-radius: 14px; padding: 18px; box-shadow: 0 18px 40px rgba(6, 15, 32, 0.25); }
.card { background: #fff; border-radius: 12px; padding: 18px; margin-bottom: 16px; box-shadow: 0 8px 20px rgba(10,26,51,0.08); border: 1px solid #edf1f8; }
h1, h2, h3 { margin-top: 0; font-family: "Cormorant Garamond", serif; color: var(--navy-900); }
label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; display: block; margin-bottom: 4px; color: var(--navy-800); font-weight: 600; }
input, select, textarea, button { width: 100%; padding: 10px 12px; border: 1px solid #d0d7e5; border-radius: 7px; margin-bottom: 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-600); box-shadow: 0 0 0 3px rgba(201,165,90,0.16); }
button { background: linear-gradient(135deg, var(--navy-800), var(--navy-900)); color: #fff; border: 0; cursor: pointer; font-weight: 600; letter-spacing: 0.04em; }
button:hover { filter: brightness(1.08); }
button.secondary { background: linear-gradient(135deg, var(--gold-600), var(--gold-500)); color: var(--navy-900); }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { background: #e8edf7; color: #0a1a33; padding: 8px 12px; border-radius: 20px; text-decoration: none; border: 1px solid #dae2ef; }
.tabs a.active { background: linear-gradient(135deg, var(--navy-800), var(--navy-900)); color: #fff; border-color: transparent; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { border-bottom: 1px solid #e7ebf3; padding: 8px; text-align: left; font-size: 13px; }
th { background: #f7f9fd; color: var(--navy-800); text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em; }
.alert { padding: 10px; border-radius: 6px; margin-bottom: 12px; font-size: 13px; }
.ok { background: #e7f7ed; color: #115d31; }
.err { background: #ffeaea; color: #8b1e1e; }
.muted { color: var(--muted); font-size: 12px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.brand img { width: 56px; height: auto; }
.brand h1 { margin: 0; font-size: 34px; }
.auth-wrap { max-width: 640px; margin: 60px auto; }
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 15, 32, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 18px;
}
.modal-card {
    width: min(1000px, 96vw);
    max-height: 92vh;
    overflow: auto;
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 20px 50px rgba(6, 15, 32, 0.34);
}

/* Monthly Accounts — loan repay cell + popup trigger */
.loan-repay-cell { vertical-align: top; min-width: 160px; }
.loan-repay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
button.loan-repay-open-btn {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    min-width: 20px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid #d0d7e5;
    background: #f7f9fd;
    color: var(--navy-800);
    font-size: 9px;
    line-height: 1;
    cursor: pointer;
    font-weight: 600;
}
button.loan-repay-open-btn:hover {
    border-color: var(--gold-600);
    background: #fff;
}
#loanRepayModal .loan-repay-modal-form .row input[type="number"],
#loanRepayModal .loan-repay-modal-form .row select {
    margin-bottom: 0;
}
#loanRepayModal .loan-repay-modal-form .row button {
    margin-bottom: 0;
    width: auto;
}
