*{box-sizing:border-box}
body{margin:0;background:#f4f7fb;color:#14213d;font:13px Segoe UI,Arial,sans-serif}
aside{position:fixed;inset:0 auto 0 0;width:250px;background:#111a2b;color:white;padding:20px 16px;display:flex;flex-direction:column;z-index:5}
.brand{display:flex;gap:12px;align-items:center;padding:5px 10px 25px;border-bottom:1px solid #2c3547}
.brand b{background:#2868ea;border-radius:11px;width:42px;height:42px;display:grid;place-items:center;font-size:20px}
.brand small{display:block;color:#9ca9bc;font-size:10px;margin-top:4px}
.brand strong{font-size:14px}
nav{display:grid;gap:6px;margin-top:20px}
nav a,.logout{color:#dce4f1;text-decoration:none;padding:13px 12px;border-radius:9px;font-weight:650;cursor:pointer}
nav a.active,nav a:hover{background:#2868ea;color:#fff}
.logout{margin-top:auto}
main{margin-left:250px}
header{height:72px;background:#fff;border-bottom:1px solid #e2e7ef;display:flex;align-items:center;padding:0 38px;gap:18px}
header input{width:420px;border:1px solid #dce3ec;border-radius:8px;padding:10px 13px;outline:0}
.admin{margin-left:auto;color:#53627a}
.admin b{color:#14213d}
.content{padding:30px 38px}
.head{display:flex;justify-space-between;align-items:start;margin-bottom:22px}
.ey{font-size:10px;color:#2868ea;font-weight:800;letter-spacing:1.2px;text-transform:uppercase}
.head h1{margin:5px 0;font-size:25px}
.head p{margin:0;color:#78869a}
.btn{border:0;border-radius:8px;padding:10px 14px;font-weight:700;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease}
.btn:hover{transform:translateY(-1px);box-shadow:0 4px 10px rgba(20,33,61,.10)}
.primary{background:#2868ea;color:#fff}
.secondary{background:#eef3fa;color:#29415f}
.danger{background:#ffe4e6;color:#c32c39}
.success{background:#ddf7e7;color:#187c48}
.card{background:#fff;border:1px solid #e0e6ef;border-radius:14px;box-shadow:0 3px 14px #1f325108;overflow:hidden}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.stat{padding:20px}
.stat span{color:#77849a;font-size:10px;text-transform:uppercase;font-weight:800}
.stat strong{display:block;font-size:28px;margin-top:7px}
.stat small{display:block;color:#7b889b;margin-top:4px}
.toolbar{padding:15px 18px;border-bottom:1px solid #e7ebf1;display:flex;justify-content:space-between;align-items:center}
.toolbar input{border:1px solid #dce3ec;border-radius:8px;padding:9px}
.table{overflow:auto}
table{width:100%;border-collapse:collapse;min-width:700px}
th,td{text-align:left;padding:14px 18px;border-bottom:1px solid #e8edf3;font-size:12px}
th{font-size:10px;color:#6d7a8e;text-transform:uppercase;background:#fbfcfe}
.badge{padding:6px 10px;border-radius:20px;font-size:10px;font-weight:800}
.active{background:#d9f7e6;color:#17804a}
.inactive{background:#fff0ca;color:#956700}
.merged{background:#eee6ff;color:#6744b8}
.pending{background:#fff0cf;color:#986700}
.rejected{background:#ffe0e3;color:#bd2634}
.actions{display:flex;gap:5px}
.actions .btn{padding:7px 9px;font-size:10px}
.form{padding:22px}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}
.field label{display:block;font-size:10px;text-transform:uppercase;font-weight:800;color:#68758a;margin-bottom:6px}
.field input,.field select,.field textarea{width:100%;padding:10px;border:1px solid #dbe2eb;border-radius:8px;outline:0}
.field input:disabled{background:#f1f3f6;color:#8a94a3;cursor:not-allowed}
.field textarea{min-height:80px}
.full{grid-column:1/-1}
.title{grid-column:1/-1;font-weight:800;border-bottom:1px solid #e8edf3;padding-bottom:9px;margin-top:4px}
.formfoot{display:flex;justify-content:flex-end;gap:14px!important;margin-top:18px;padding-top:4px}
.formfoot .btn{min-width:96px}
.modal{position:fixed;inset:0;background:#111b2ba8;display:none;align-items:center;justify-content:center;padding:25px;z-index:10}
.modal.open{display:flex}
.box{background:#fff;border-radius:16px;width:min(1050px,96vw);max-height:92vh;overflow:auto}
.mhead{padding:20px 24px;border-bottom:1px solid #e3e8ef;display:flex;justify-content:space-between;align-items:center}
.mhead h2{margin:0}
.close{border:0;border-radius:50%;width:34px;height:34px;cursor:pointer;background:#f1f4f8;font-size:20px;font-weight:700;line-height:1}
.close:hover{background:#e7ecf3}
.details{display:grid;grid-template-columns:repeat(3,1fr);margin:20px 24px;background:#e1e6ed;gap:1px}
.detail{background:#fff;padding:14px}
.detail label,.person label{display:block;color:#7a8799;font-size:9px;text-transform:uppercase;font-weight:800;margin-bottom:6px}
.detail b{font-size:12px}
.people{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:0 24px 22px}
.person{border:1px solid #dfe5ed;border-radius:12px;overflow:hidden}
.person h3{margin:0;padding:13px;background:#f7faff}
.personbody{padding:15px;display:grid;grid-template-columns:1fr 1fr;gap:12px}
.foot{padding:0 24px 22px;text-align:right}
#toast{position:fixed;right:25px;bottom:25px;background:#152238;color:white;padding:12px 17px;border-radius:9px;display:none;z-index:20}
#toast.show{display:block}
#menu{display:none}

.welcome{padding:24px;display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;background:linear-gradient(135deg,#fff,#f4f8ff)}
.welcome h2{margin:6px 0;font-size:22px}
.welcome p{margin:0;color:#77869a}
.dash-date{font-weight:700;color:#2868ea;background:#eef4ff;padding:10px 13px;border-radius:9px}
.dash-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:16px;margin-top:16px}
.dash-card{padding:20px}
.dash-title{display:flex;justify-content:space-between;margin-bottom:20px}
.dash-title span{font-size:11px;color:#8a96a7}
.progress-row{display:flex;justify-content:space-between;margin:14px 0 7px}
.progress{height:8px;background:#edf1f6;border-radius:20px;overflow:hidden}
.progress i{display:block;height:100%;background:#2868ea;border-radius:20px}
.quick-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.quick-actions button{border:1px solid #dce4ef;background:#f8faff;border-radius:9px;padding:12px;text-align:left;font-weight:700;color:#29415f;cursor:pointer}
.quick-actions button:hover{background:#eef4ff}
.form-help{margin:0 0 4px;color:#77869a;font-size:11px}

/* Wallet Card Styles */
.wallet-card{background:#f8faff;border:1px solid #dce4ef;padding:15px;border-radius:12px;display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.wallet-info h4{margin:0 0 4px 0;font-size:15px;color:#14213d}
.wallet-info p{margin:0;color:#78869a;font-size:11px}
.wallet-bal{text-align:right}
.wallet-bal strong{display:block;font-size:18px;color:#187c48}

.dashboard-stats{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:16px}
.dashboard-panels{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,.8fr);gap:16px}
.dashboard-loans{padding:20px}
.dashboard-loans .dash-title{align-items:center;margin-bottom:12px}
.dashboard-link{border:0;background:transparent;color:#3157d5;font:inherit;font-size:12px;font-weight:700;cursor:pointer;padding:6px}
.dashboard-link:hover{text-decoration:underline}
.dashboard-loan-row{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(100px,.7fr) minmax(0,1fr) auto;gap:14px;align-items:center;padding:13px 0;border-top:1px solid #edf0f5}
.dashboard-loan-row>div{min-width:0}
.dashboard-loan-row b,.dashboard-loan-row small{display:block;overflow-wrap:anywhere}
.dashboard-loan-row b{font-size:12px;color:#253044}
.dashboard-loan-row small{margin-top:4px;color:#7b8799;font-size:10px}
.dashboard-loan-row .btn{white-space:nowrap}
.dashboard-empty{padding:22px 4px;color:#7b8799;font-size:12px;line-height:1.6}

@media(max-width:850px){
    aside{transform:translateX(-100%);transition:.2s}
    aside.open{transform:none}
    main{margin-left:0}
    #menu{display:block;border:0;background:none;font-size:20px}
    .stats{grid-template-columns:1fr 1fr}
    .grid,.people{grid-template-columns:1fr}
    .details{grid-template-columns:1fr 1fr}
    .full{grid-column:auto}
    .dash-grid{grid-template-columns:1fr}
    .dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
    .dashboard-panels{grid-template-columns:1fr}
    .welcome{align-items:flex-start;gap:12px;flex-direction:column}
}
@media(max-width:520px){
    .stats{grid-template-columns:1fr}
    .dashboard-stats{grid-template-columns:1fr}
    .dashboard-loan-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
    .dashboard-loan-row .btn{grid-column:1/-1;width:100%}
    .details{grid-template-columns:1fr}
    header{padding:0 15px}
    .content{padding:20px 15px}
}

/* Executive Portal Theme - shared visual system */
:root{
  --exec-bg:#f4f7fb;
  --exec-panel:#fff;
  --exec-text:#172033;
  --exec-muted:#6f7a8f;
  --exec-primary:#3157d5;
  --exec-primary-dark:#2446b5;
  --exec-border:#e3e8f1;
  --exec-shadow:0 14px 36px rgba(30,49,93,.08);
  --exec-radius:18px;
}
body{font-family:Arial,Helvetica,sans-serif!important;background:var(--exec-bg)!important;color:var(--exec-text)!important}
button,input,select,textarea{font:inherit}
aside,.sidebar{
  background:#111a2e!important;color:#fff!important;
}
nav a,.logout,.nav-link{
  color:#dce4f1!important;border-radius:11px!important;
}
nav a.active,nav a:hover,.nav-link.active,.nav-link:hover{
  background:#3157d5!important;color:#fff!important;
}
.brand b,.brand-icon,.login-logo{
  background:#fff!important;color:#3157d5!important;border-radius:12px!important;
}
main{background:var(--exec-bg)}
header,.topbar{
  background:#fff!important;border-bottom:1px solid var(--exec-border)!important;
}
.content{padding:30px!important}
.card,.panel,.stat-card,.dash-card{
  background:#fff!important;border:1px solid var(--exec-border)!important;
  border-radius:18px!important;box-shadow:var(--exec-shadow)!important;
}
.stat,.stat-card{border-radius:18px!important}
.btn,.login-btn{
  border-radius:11px!important;
}
.primary,.login-btn,.btn.primary{
  background:#3157d5!important;color:#fff!important;
}
.primary:hover,.login-btn:hover,.btn.primary:hover{background:#2446b5!important}
.secondary,.btn.secondary{background:#eef2f8!important;color:#37445b!important}
input,select,textarea{
  border:1px solid #d9e0eb!important;border-radius:11px!important;
}
input:focus,select:focus,textarea:focus{
  border-color:#8da3eb!important;box-shadow:0 0 0 3px rgba(49,87,213,.10)!important;
}
th{background:#fafbfe!important;color:#6b7588!important}
.modal{background:rgba(16,25,46,.58)!important}
.box,.modal-card,.login-card{
  border-radius:20px!important;box-shadow:0 30px 80px rgba(0,0,0,.20)!important;
}
.close,.close-btn{
  background:#eef2f8!important;border-radius:10px!important;
}
.badge.active,.active{background:#e8f7f1!important;color:#11714d!important}
.badge.rejected,.rejected{background:#fff0f2!important;color:#ae3745!important}
.badge.pending,.pending{background:#fff5dc!important;color:#9b6710!important}
.badge.merged,.merged{background:#eef2ff!important;color:#4e5fb0!important}

aside{width:265px!important;padding:22px 16px!important}
.brand{padding:4px 6px 25px!important;border-bottom:0!important}
.brand b{width:42px!important;height:42px!important}
nav{gap:6px!important;margin-top:0!important}
nav a,.logout{padding:12px 13px!important}
main{margin-left:265px!important}
header{height:78px!important;padding:0 30px!important}
.content{padding:30px!important}
.card{border-radius:18px!important}
.stats{gap:17px!important}
.stat{padding:20px!important}
.toolbar{padding:16px 20px!important}
.btn{padding:11px 17px!important}
.login-body{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at top,#edf3ff 0%,#f4f7fb 36%,#eaf0f9 100%);font-family:Segoe UI,Arial,sans-serif}
.login-shell{width:min(420px,calc(100% - 32px));}
.login-card{background:#fff;border:1px solid #dee7f3;border-radius:22px;box-shadow:0 32px 70px rgba(17,20,40,.12);padding:30px}
.login-brand{display:flex;align-items:center;gap:14px;margin-bottom:20px}
.login-logo{width:48px;height:48px;border-radius:14px;background:#2759d8;color:#fff;display:grid;place-items:center;font-weight:800;font-size:20px}
.login-brand small{display:block;color:#7c8aa5;font-size:11px;letter-spacing:1.2px;text-transform:uppercase}
.login-brand h1{margin:5px 0 0;font-size:28px;color:#172033}
.login-form{display:grid;gap:16px}
.login-form label{display:grid;gap:8px;font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#68778d}
.login-form input{width:100%;padding:12px 14px;border-radius:11px;border:1px solid #d9e1ee;background:#f9fbff;color:#172033;outline:none}
.login-form input:focus{border-color:#6c86e8;box-shadow:0 0 0 4px rgba(39,89,216,.10)}
.login-btn{border:0;border-radius:12px;padding:12px 14px;background:#2759d8;color:#fff;font-weight:800;cursor:pointer;transition:.15s ease}
.login-btn:hover{background:#204ac1;transform:translateY(-1px)}
.login-message{min-height:20px;margin:0;color:#b3374d;font-size:12px;font-weight:600}
.login-meta{margin-top:18px;text-align:center;color:#7a879c;font-size:11px}
.login-meta strong{color:#1c2d46}
@media(max-width:850px){
 aside{width:265px!important}
 main{margin-left:0!important}
}


/* ===== Green Finance Profile Master ===== */
.head{justify-content:space-between!important;align-items:center!important;gap:18px}
.top-add-btn{margin-left:auto;white-space:nowrap}
.profile-list-card{margin-top:4px}
.profile-search{width:min(390px,45vw)!important}
.record-count{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:22px;padding:0 7px;margin-left:6px;border-radius:12px;background:#eef2ff;color:#3157d5;font-size:10px}
.empty-table{text-align:center!important;padding:35px!important;color:#7b889b}
.profile-section{padding:22px 24px;border-bottom:1px solid #e8edf3}
.profile-section-title{font-size:14px;font-weight:800;color:#172033;margin-bottom:17px}
.profile-form .grid{gap:16px}
.profile-section .field label{font-size:10px}
.profile-section input,.profile-section select{background:#fff}
.other-contact-head{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:14px}
.other-contact-head .profile-section-title{margin:0}
.other-contact-head p{margin:4px 0 0;color:#7b889b;font-size:11px}
.other-contact-row{display:grid;grid-template-columns:1.15fr 1fr 1fr 40px;gap:12px;align-items:end;padding:13px;background:#f8faff;border:1px solid #e0e6ef;border-radius:12px;margin-bottom:10px}
.other-delete{width:34px;height:38px;border:0;border-radius:9px;background:#fff0f2;color:#bd2634;font-size:20px;cursor:pointer}
.other-delete:hover{background:#ffe0e4}
.contact-limit-msg{font-size:11px;font-weight:700;color:#bd2634;margin-top:8px}
.profile-drawer{position:fixed;right:0;top:0;bottom:0;width:min(650px,92vw);background:#fff;z-index:31;display:flex;flex-direction:column;box-shadow:-20px 0 55px rgba(16,25,46,.18);animation:drawerIn .22s ease}
.drawer-backdrop{position:fixed;inset:0;background:rgba(16,25,46,.42);z-index:30}
@keyframes drawerIn{from{transform:translateX(100%)}to{transform:translateX(0)}}
.drawer-head{display:flex;justify-content:space-between;align-items:center;padding:22px 25px;border-bottom:1px solid #e3e8f1;flex:0 0 auto}
.drawer-head h2{margin:4px 0 0;font-size:21px}
.drawer-close{border:0;background:#eef2f8;color:#37445b;width:36px;height:36px;border-radius:10px;font-size:23px;cursor:pointer}
.drawer-scroll{overflow:auto;flex:1}
.drawer-foot{display:flex;justify-content:flex-end;gap:12px;padding:16px 25px;border-top:1px solid #e3e8f1;background:#fff;flex:0 0 auto}
.drawer-foot .btn{min-width:105px}
.profile-drawer .field input:invalid:not(:placeholder-shown){border-color:#d95863!important}
.profile-drawer .btn:disabled{opacity:.5;cursor:not-allowed;transform:none!important;box-shadow:none!important}
.profile-view{padding:0 24px 8px}
.profile-view-section{border:1px solid #e0e6ef;border-radius:14px;margin:20px 0;padding:18px}
.profile-view-section h3{margin:0 0 15px;font-size:14px}
.profile-view-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.profile-view-grid label{display:block;color:#7a8799;font-size:9px;text-transform:uppercase;font-weight:800;margin-bottom:5px}
.profile-view-grid b{font-size:12px}
.profile-contact-view{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:10px;padding:11px 0;border-top:1px solid #edf0f5;font-size:12px}
.profile-contact-view span{color:#65738a}
.empty-contact{text-align:center;color:#7b889b;padding:15px}

/* Customer Add button position: keep it aligned at the top-right of the page header. */
.head>.top-add-btn{align-self:center;margin:0 0 0 auto}
.head .btn{flex:0 0 auto}

@media(max-width:700px){
  .head{align-items:flex-start!important}
  .top-add-btn{padding:9px 11px!important}
  .profile-search{width:100%!important;margin-top:10px}
  .profile-list-card .toolbar{align-items:flex-start;flex-direction:column}
  .other-contact-row{grid-template-columns:1fr 1fr}
  .other-delete{width:100%}
  .other-contact-head{align-items:flex-start;flex-direction:column}
  .profile-drawer{width:100%;max-width:none}
  .profile-view-grid{grid-template-columns:1fr}
  .profile-contact-view{grid-template-columns:1fr}
}
@media(max-width:520px){
  .head{flex-direction:column!important}
  .head>.btn{width:100%}
  .other-contact-row{grid-template-columns:1fr}
}


/* Profile drawer: keep the existing modal shell, but make the drawer behave like a native side panel. */
#modal.drawer-mode{display:block!important;padding:0!important;overflow:hidden!important;background:rgba(16,25,46,.42)!important;z-index:40!important}
#modal.drawer-mode .drawer-backdrop{display:block}
#modal.drawer-mode .profile-drawer{position:absolute;right:0;top:0;bottom:0;height:100vh;max-height:none;margin:0;border-radius:0;animation:drawerIn .22s ease}
#modal.drawer-mode .drawer-scroll{min-height:0;padding:22px 25px}
#modal.drawer-mode .profile-section{background:#fff;border:1px solid #e3e8f1;border-radius:14px;padding:18px;margin-bottom:16px}
#modal.drawer-mode .profile-section:last-child{margin-bottom:0}
#modal.drawer-mode .profile-section-title{font-size:13px;font-weight:800;color:#172033;margin-bottom:16px}
#modal.drawer-mode .grid{gap:14px}
#modal.drawer-mode .drawer-foot{position:relative;z-index:2;box-shadow:0 -4px 14px rgba(30,49,93,.05)}
#modal.drawer-mode .other-contact-row{background:#fbfcff}
#modal.drawer-mode .other-contact-row input,#modal.drawer-mode .other-contact-row select{min-height:40px}
@media(max-width:700px){
  #modal.drawer-mode .profile-drawer{width:100%}
  #modal.drawer-mode .drawer-scroll{padding:16px}
  #modal.drawer-mode .drawer-head{padding:18px 16px}
  #modal.drawer-mode .drawer-foot{padding:14px 16px}
  #modal.drawer-mode .drawer-foot .btn{flex:1}
}


/* Profile popup: same centered modal style as Add Customer */
#modal:not(.drawer-mode) .profile-form{max-height:calc(92vh - 75px);overflow:auto}
#modal:not(.drawer-mode) .profile-section{padding:20px 24px}
#modal:not(.drawer-mode) .profile-formfoot{padding:16px 24px 22px;margin-top:0;border-top:1px solid #e3e8ef;background:#fff}
#modal:not(.drawer-mode) .profile-section-title{margin-bottom:15px}
#modal:not(.drawer-mode) .other-contact-head{align-items:center}
@media(max-width:700px){
  #modal:not(.drawer-mode) .other-contact-head{align-items:flex-start}
  #modal:not(.drawer-mode) .profile-form{max-height:calc(92vh - 65px)}
}
.profile-form .file-help{display:block;margin-top:6px;font-size:12px;color:#6b7280;line-height:1.4}
.profile-form input[type="file"]{padding:9px;background:#fff}

/* Prefix Loan - Custom Loan popup */
.custom-loan-form .title{
  margin-top:0;
  padding-bottom:11px;
}
.custom-loan-form .formfoot{
  padding-left:0;
  padding-right:0;
}

/* Add Loan */
.loan-party-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:0 0 18px}
.loan-person-card{border:1px solid #e1e7f0;border-radius:15px;padding:16px;background:#fbfcff;min-width:0;position:relative;}
.loan-person-card.selected{border-color:#b9c9e5;background:#fff}
.loan-person-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;min-height:44px;}
.loan-role{font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:800;color:#7b8799}
.loan-person-head h3{margin:4px 0 0;font-size:15px;color:#172033}
.loan-person-photo-wrap{width:78px;height:78px;margin:10px 0 12px;border-radius:14px;overflow:hidden;border:1px solid #dce4ef;background:#eef2f8;position:relative;display:flex;align-items:center;justify-content:center;flex:0 0 78px;}
.loan-person-photo{width:100%;height:100%;object-fit:cover;display:block;position:absolute;inset:0;}
.loan-person-photo-fallback{width:100%;height:100%;align-items:center;justify-content:center;font-size:20px;font-weight:800;color:#3157d5;background:#eef2f8;display:none}
.loan-plus{width:34px;height:34px;border:0;border-radius:10px;background:#172033;color:#fff;font-size:21px;cursor:pointer;line-height:1;display:flex;align-items:center;justify-content:center;flex:0 0 34px;}
.loan-person-basic{display:grid;gap:7px;margin:14px 0;font-size:11px;color:#526176}
.loan-person-basic span{display:flex;flex-direction:column;gap:2px}.loan-person-basic b{font-size:9px;text-transform:uppercase;color:#8995a7}
.loan-view-btn{padding:7px 12px!important;font-size:11px!important}
.loan-muted{font-size:11px;color:#8a95a6;margin:15px 0 2px}
.loan-detail-section{border:1px solid #e1e7f0;border-radius:15px;padding:18px;background:#fff}
.profile-search-popup{padding:0 24px 24px}.profile-search-popup>p{color:#69778b;font-size:12px;margin:0 0 15px}.profile-search-popup>.btn{margin-top:5px}
.loan-found-profile{margin-top:16px;border:1px solid #dfe6f0;border-radius:14px;padding:15px;background:#f8faff;display:grid;gap:12px}.loan-found-profile>div:first-child{display:flex;justify-content:space-between;gap:15px}.loan-found-profile label{display:block;color:#7d899b;font-size:9px;text-transform:uppercase;font-weight:800;margin-bottom:4px}.loan-found-profile span{font-size:12px;color:#65748a}.loan-no-result{margin-top:15px;padding:14px;border-radius:12px;background:#fff4f4;color:#b34b55;font-size:12px}
.loan-view-wrap{padding:0 24px 10px}.loan-view-wrap .loan-person-card .loan-plus{display:none}
.loan-view-wrap + .foot{display:flex;justify-content:flex-end;padding:18px 24px 20px;border-top:1px solid #e6edf5;background:#fff}
.loan-view-wrap + .foot .btn{min-width:120px;padding:10px 18px;border-radius:12px;border:1px solid #dfe5ee;background:#fff;color:#1f2a3a;font-weight:700;box-shadow:none}
.loan-view-wrap + .foot .btn:hover{background:#f7f9fc;border-color:#cfd9e8}
@media(max-width:850px){.loan-party-grid{grid-template-columns:1fr}.loan-detail-section .grid{grid-template-columns:1fr 1fr}}
@media(max-width:520px){.loan-detail-section .grid{grid-template-columns:1fr}.profile-search-popup{padding:0 16px 18px}.loan-view-wrap{padding:0 16px 8px}.loan-view-wrap + .foot{padding:14px 16px 16px}.loan-view-wrap + .foot .btn{width:100%}}

.loan-person-photo-wrap + .loan-person-basic{margin-top:2px}


/* Profile and Executive photo previews */
.profile-self-image-field{min-height:120px}
.profile-self-image{display:block;width:110px;height:110px;object-fit:cover;border-radius:14px;border:1px solid #dce4ef;margin-top:8px;background:#eef2f8}
.profile-document-field{min-width:0}
.profile-proof-preview{display:block;max-width:180px;max-height:150px;object-fit:contain;margin-top:8px;border:1px solid #dce4ef;border-radius:10px;background:#f8fafc}
.executive-view-head{display:flex;align-items:center;gap:16px;padding:18px 24px 4px}
.executive-view-head h3{margin:0 0 4px;font-size:18px}
.executive-view-head span{color:#7a8799;font-size:12px}
.executive-view-photo{width:88px;height:88px;border-radius:16px;object-fit:cover;border:1px solid #dce4ef;background:#eef2f8;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:22px;color:#3157d5}
.executive-photo-fallback{background:#eef2f8}

.profile-image-empty{width:110px;min-height:70px;margin-top:8px;border:1px dashed #cbd5e1;border-radius:12px;display:flex;align-items:center;justify-content:center;color:#8a96a8;font-size:11px;background:#f8fafc}
.edit-self-image,.executive-edit-photo{width:110px;height:110px;object-fit:cover;border-radius:14px;border:1px solid #dce4ef;margin-top:8px;background:#eef2f8;display:block}


/* Payment workflow */
.payment-action{background:#1f6feb!important;color:#fff!important;border-color:#1f6feb!important}
.payment-action:hover{filter:brightness(.95)}
.payment-mhead{align-items:center}
.payment-head-actions{display:flex;align-items:center;gap:10px}
.payment-history-modal-card{margin:0 24px}
.payment-form{padding-bottom:6px}
.payment-top-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:16px;padding:0 24px}
.payment-card,.payment-history-card{border:1px solid #e1e7f0;border-radius:15px;background:#fff}
.payment-card{padding:18px}
.payment-card-title{font-size:12px;text-transform:uppercase;letter-spacing:.08em;font-weight:800;color:#526176;margin-bottom:14px}
.payment-info-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.payment-info-grid .field input[readonly]{background:#f6f8fb;color:#344154}
.payment-entry-card{margin:16px 24px 0}
.payment-entry-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.payment-remark{margin-top:14px}
.payment-remark textarea{width:100%;resize:vertical;border:1px solid #dce3ed;border-radius:10px;padding:11px 12px;font:inherit;box-sizing:border-box;outline:none}
.payment-remark textarea:focus{border-color:#8da9d8;box-shadow:0 0 0 3px rgba(49,87,213,.08)}
.payment-day-meta{display:flex;flex-wrap:wrap;gap:18px;margin-top:14px;padding-top:12px;border-top:1px solid #edf0f5;color:#7a8799;font-size:11px}
.payment-day-meta b{color:#253044;margin-left:4px}
.payment-history-card{margin:16px 24px 0;overflow:hidden}
.payment-history-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;border-bottom:1px solid #edf0f5}
.payment-history-head h3{margin:3px 0 0;font-size:15px}
.payment-history-head>span{font-size:11px;color:#7a8799}
.payment-history-scroll{overflow:auto}
.payment-history-table{width:100%;min-width:860px;border-collapse:collapse;font-size:11px}
.payment-history-table th,.payment-history-table td{padding:10px 12px;border-bottom:1px solid #edf0f5;text-align:left;white-space:nowrap}
.payment-history-table th{font-size:9px;text-transform:uppercase;letter-spacing:.05em;color:#7b8798;background:#f8fafc}
.payment-history-table tr:last-child td{border-bottom:0}
.payment-edit-btn{padding:5px 9px!important;font-size:10px!important}
.payment-footer{display:flex;justify-content:flex-end;align-items:center;gap:12px;padding:18px 24px;flex-wrap:wrap}
.payment-footer .btn{min-width:150px;padding:11px 16px;border-radius:12px;font-weight:800;transition:.15s ease}
.payment-footer .btn:hover{transform:translateY(-1px)}
.payment-empty{margin:0 24px;padding:42px 20px;text-align:center;border:1px dashed #d4dce8;border-radius:15px;background:#f9fbfd}
.payment-empty-icon{width:44px;height:44px;border-radius:50%;margin:0 auto 12px;display:flex;align-items:center;justify-content:center;background:#e8f7ee;color:#25834a;font-size:22px;font-weight:800}
.payment-empty h3{margin:0 0 7px;font-size:17px;color:#1f2937}
.payment-empty p{margin:0;color:#7b8798;font-size:12px}
.btn.warning{background:#fff3dc;color:#9a6100;border:1px solid #f1d18d;box-shadow:0 3px 10px rgba(154,97,0,.12)}
.btn.warning:hover{background:#ffe8b8}
@media(max-width:900px){
  .payment-top-grid{grid-template-columns:1fr}
  .payment-entry-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:600px){
  .payment-top-grid,.payment-entry-card,.payment-history-card{margin-left:10px;margin-right:10px}
  .payment-top-grid{padding:0}
  .payment-info-grid,.payment-entry-grid{grid-template-columns:1fr}
  .payment-footer{padding:14px;flex-wrap:wrap;justify-content:stretch}
  .payment-footer .btn{flex:1 1 100%;width:100%;min-width:0}
}

.proof-download{margin-top:8px;padding:6px 10px!important;font-size:10px!important}

/* Reports page styling */
.report-page-shell{padding-left:18px;padding-right:8px;box-sizing:border-box}
.report-account-shell{display:grid;gap:18px;margin-top:8px}
.report-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.report-summary-card{background:#f4f6f9;border:1px solid #dfe5ee;border-radius:14px;padding:18px 20px;min-height:112px;display:flex;flex-direction:column;justify-content:center}
.report-summary-card label{display:block;font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:#69768b;font-weight:800;margin-bottom:10px}
.report-summary-card strong{display:block;font-size:26px;line-height:1.2;color:#172033;font-weight:800}
.report-summary-card small{display:block;margin-top:8px;font-size:11px;color:#7b8799}
.report-table-wrap .card{background:#fff;border:1px solid #dfe5ee;border-radius:14px;overflow:hidden;box-shadow:none}
.report-table-wrap .toolbar{padding:16px 18px;border-bottom:1px solid #edf0f5;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#f9fafc}
.report-table-wrap .toolbar b{font-size:14px;color:#202b3d}
.report-table-wrap .toolbar .btn{padding:8px 12px;border-radius:10px;font-size:12px;font-weight:700}
.report-table-wrap .toolbar input{width:220px;border:1px solid #dfe5ee;border-radius:10px;padding:9px 12px;background:#fff;color:#273244}
.report-table-wrap table{min-width:100%;border-collapse:collapse}
.report-table-wrap th,.report-table-wrap td{padding:13px 14px;border-bottom:1px solid #edf0f5;text-align:left;font-size:12px}
.report-table-wrap th{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:#69768b;background:#f8fafc;font-weight:800}
.report-table-wrap td{color:#1f2a3a}
.report-table-wrap tbody tr:last-child td{border-bottom:0}
.report-table-wrap .empty-table{padding:18px 14px;color:#7c8797;text-align:center}
@media(max-width:820px){
  .report-summary-grid{grid-template-columns:1fr}
  .report-table-wrap .toolbar{flex-wrap:wrap}
  .report-table-wrap .toolbar input{width:100%}
}

/* Role and password controls */
.status-toggle{display:inline-flex;align-items:center;gap:8px;font-size:11px;color:#52627a;cursor:pointer;white-space:nowrap}
.status-toggle input{position:absolute;opacity:0;pointer-events:none}
.status-toggle span{width:38px;height:21px;border-radius:20px;background:#cbd5e1;position:relative;transition:.2s}
.status-toggle span:after{content:"";position:absolute;width:17px;height:17px;top:2px;left:2px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.2);transition:.2s}
.status-toggle input:checked+span{background:#2759d8}
.status-toggle input:checked+span:after{transform:translateX(17px)}
.password-wrap{position:relative;display:flex;align-items:center}
.password-wrap input{width:100%;padding-right:42px}
.password-eye{position:absolute;right:6px;border:0;background:transparent;cursor:pointer;font-size:16px;width:32px;height:32px;border-radius:8px}
.password-eye:hover{background:#eef3ff}
.check-row{display:flex!important;align-items:center;gap:8px;height:40px;text-transform:none!important;letter-spacing:0!important;font-size:13px!important;font-weight:650!important}
.check-row input{width:17px!important;height:17px!important}


/* ===== Transactions ===== */
.tx-id{display:block;color:#8792a5;font-size:9px;margin-top:4px;font-weight:600}
.transaction-form .field select:disabled{background:#f1f3f6;color:#697487;cursor:not-allowed}

/* Branded, touch-friendly portal header and navigation. */
.brand b img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.header-brand{display:flex;flex:0 0 auto;align-items:center;gap:9px;color:#17392e;white-space:nowrap}
.header-brand img{display:block;width:36px;height:36px;object-fit:contain}
.header-brand strong{font-size:14px}
header #menu{
  display:none;flex:0 0 42px;place-items:center;width:42px;height:42px;padding:0;
  border:0;border-radius:10px;background:#edf4ef;color:#164832;font-size:22px;
  line-height:1;cursor:pointer;touch-action:manipulation;position:relative;z-index:12;
}
header #menu svg{display:block;width:24px;height:24px;pointer-events:none}
header #menu:hover,header #menu:focus-visible{background:#dcebe0;outline:2px solid #7aa88d;outline-offset:2px}
header #search{
  flex:1 1 240px;width:auto!important;min-width:0;height:44px;padding:10px 13px!important;
  font-size:16px!important;touch-action:manipulation;
}
header .admin{flex:0 0 auto;white-space:nowrap}
nav a:focus-visible{outline:2px solid #a6c5ff;outline-offset:2px}
@media(max-width:850px){
  header{gap:10px!important;padding:0 14px!important}
  header #menu{display:grid}
  .header-brand img{width:34px;height:34px}
  header #search{flex:1 1 0}
}
@media(max-width:480px){
  .header-brand strong{display:none}
  header{gap:8px!important;padding:0 10px!important}
  header #menu{flex-basis:40px;width:40px;height:40px}
  header #search{padding:9px 10px!important}
}
.login-logo img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}

@media(max-width:700px){
  #app .table{overflow:visible}
  #app .table table{
    display:block;width:100%;min-width:0!important;border-collapse:separate;border-spacing:0;
  }
  #app .table thead{display:none}
  #app .table tbody{display:grid;gap:12px}
  #app .table tbody tr{
    display:block;min-width:0;overflow:hidden;padding:9px 13px;
    border:1px solid #e1e8ef;border-radius:14px;background:#fff;
    box-shadow:0 3px 12px rgba(23,57,46,.06);
  }
  #app .table tbody tr[hidden],#app .dashboard-loan-row[hidden]{display:none!important}
  #app .table tbody td{
    display:grid;grid-template-columns:minmax(92px,.65fr) minmax(0,1.35fr);
    gap:10px;align-items:start;min-width:0;padding:10px 2px;
    border-bottom:1px solid #edf1f4;text-align:right;font-size:12px;
    overflow-wrap:anywhere;
  }
  #app .table tbody td:last-child{border-bottom:0}
  #app .table tbody td[data-label]::before{
    content:attr(data-label);text-align:left;color:#6f7d76;
    font-size:10px;font-weight:800;letter-spacing:.045em;
    line-height:1.5;text-transform:uppercase;
  }
  #app .table tbody td .actions{
    justify-content:flex-end;flex-wrap:wrap;gap:6px;
  }
  #app .table tbody td .btn{min-height:36px;padding:8px 10px!important}
  #app .table tbody td.empty-table{display:block;text-align:center!important}
  #app .table tbody td.empty-table::before{content:none}
}

@media(max-width:380px){
  #app .table tbody tr{padding:7px 10px}
  #app .table tbody td{
    grid-template-columns:minmax(78px,.6fr) minmax(0,1.4fr);
    gap:7px;font-size:11px;
  }
}
