*{box-sizing:border-box}body{margin:0;font-family:Inter,Arial;color:#08234D;background:#f5f7fa}a{text-decoration:none;color:inherit}.shell{display:grid;grid-template-columns:220px 1fr;min-height:100vh}.sidebar{background:#08234D;color:#dbe4ee;padding:22px 14px}.logo{display:flex;gap:9px;align-items:center}.logo>span{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:linear-gradient(145deg,#08234D,#008CA8 65%,#35B4CB);color:white;font:700 24px Inter;border:1px solid #ffffff24}.logo strong{font:600 20px Inter;color:white}.logo strong span{color:#008CA8}.sidebar>small{font-size:9px;letter-spacing:.14em;display:block;margin:3px 0 24px 47px;color:#7f91a8}.sidebar nav{display:flex;flex-direction:column;gap:3px}.sidebar nav a{padding:11px 12px;border-radius:8px;font-size:13px}.sidebar nav a:hover,.sidebar nav a.active{background:#008CA8;color:#fff}.content{padding:28px 32px;min-width:0}.content header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.content h1{font:600 30px Inter;margin:0}.content p{margin:5px 0;color:#66758a}.user{background:white;border:1px solid #dde5ed;padding:10px 14px;border-radius:9px}.kpis{display:grid;grid-template-columns:repeat(6,1fr);gap:12px}.kpis article,.panel,.loan-top article,.customer-head{background:#fff;border:1px solid #e0e6ec;border-radius:12px;box-shadow:0 6px 18px #19304b0a}.kpis article{padding:16px;display:flex;flex-direction:column;gap:6px}.kpis small{color:#6c7a8d}.kpis b{font:600 21px Inter}.kpis em{font-style:normal;color:#27AE60;font-size:11px}.kpis em.warn{color:#F39C12}.dash-grid{display:grid;grid-template-columns:1.6fr .8fr 1.1fr;gap:14px;margin-top:15px}.panel{padding:20px}.panel h3{font:600 16px Inter;margin-top:0}.chart.line{height:210px;display:flex;align-items:end;gap:10px;border-bottom:1px solid #dfe5eb;padding:0 10px}.chart.line i{flex:1;background:linear-gradient(#008CA8,#1FA8C4);border-radius:5px 5px 0 0}.donut{width:145px;height:145px;border-radius:50%;margin:24px auto;background:conic-gradient(#008CA8 0 68%,#e8edf1 68%);display:grid;place-items:center}.donut:before{content:'';background:#fff;width:100px;height:100px;border-radius:50%;grid-area:1/1}.donut span{z-index:1;grid-area:1/1;font:700 25px Inter}.bars{display:grid;gap:14px;padding-top:18px}.bars i{background:#008CA8;color:#fff;padding:9px;border-radius:5px;font-size:11px;font-style:normal}.primary{background:#008CA8;color:#fff;border:0;border-radius:8px;padding:11px 15px;font-weight:700}.block{display:block;width:100%;text-align:center;margin-top:16px}.filters{display:grid;grid-template-columns:160px 160px 160px 1fr;gap:10px;margin-bottom:12px}.filters select,.filters input{height:42px;border:1px solid #dce4ec;border-radius:8px;background:#fff;padding:0 11px}.table-wrap{overflow:auto;padding:0}.table-wrap table{width:100%;border-collapse:collapse;font-size:13px}.table-wrap th,.table-wrap td{text-align:left;padding:15px 16px;border-bottom:1px solid #edf0f4;white-space:nowrap}.table-wrap th{background:#f9fafb;font-size:11px;color:#657389;text-transform:uppercase}.tag{padding:5px 8px;border-radius:5px;font-size:10px}.tag.green{background:#e6f7ec;color:#198441}.tag.new{background:#eaf2ff;color:#346ec6}.tag.info{background:#eef0ff;color:#1FA8C4}.tag.orange{background:#fff1d9;color:#bd7500}.customer-head{display:grid;grid-template-columns:auto 1fr 220px;gap:16px;padding:20px;align-items:center}.avatar{width:64px;height:64px;border-radius:50%;background:#dceceb;display:grid;place-items:center;font-weight:700}.customer-head h2{margin:0;font:600 23px Inter}.risk{display:grid;grid-template-columns:1fr auto;gap:8px;font-size:12px}.risk b{color:#218e4b}.tabs{padding:15px 4px;border-bottom:1px solid #dfe5ea;margin:12px 0 14px;color:#52647b;font-size:12px;word-spacing:12px}.three{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.panel dl{display:grid;grid-template-columns:1fr auto;gap:11px;font-size:12px}.panel dd{margin:0;font-weight:600}.activity{list-style:none;padding:0;line-height:2.5}.loan-top{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}.loan-top article{padding:15px}.loan-top small{display:block;color:#708095;font-size:11px}.loan-top b{display:block;margin-top:8px;font:600 16px Inter}.staff-login{min-height:100vh;background:#08234D;display:grid;place-items:center;padding:20px;position:relative;overflow:hidden}.staff-login:after{content:'N';position:absolute;right:-80px;bottom:-260px;font:700 600px Inter;color:#ffffff05}.staff-card{width:min(420px,100%);z-index:1;color:white}.staff-card>.logo{margin-bottom:4px}.staff-card>small{display:block;margin-left:47px;color:#9eb0c4}.staff-card h1{font:600 34px Inter;margin:45px 0 5px}.staff-card p{color:#b8c5d4}.staff-card form{display:grid;gap:8px}.staff-card label{font-size:12px;margin-top:11px}.staff-card input{height:45px;border-radius:7px;border:1px solid #446078;padding:0 11px}.staff-card .remember{display:flex;gap:7px;align-items:center}.staff-card .remember input{height:auto}.staff-card button{margin-top:10px;height:46px;border:0;border-radius:7px;background:#008CA8;color:#fff;font-weight:700}.staff-card>a{display:block;text-align:center;color:#25c7b7;margin-top:18px;font-size:12px}.staff-card footer{text-align:center;margin-top:90px;color:#8192a5;font-size:11px}@media(max-width:1100px){.kpis{grid-template-columns:repeat(3,1fr)}.dash-grid,.three{grid-template-columns:1fr}.loan-top{grid-template-columns:repeat(3,1fr)}}@media(max-width:760px){.shell{grid-template-columns:1fr}.sidebar{display:none}.content{padding:18px}.kpis{grid-template-columns:1fr 1fr}.filters{grid-template-columns:1fr}.customer-head{grid-template-columns:auto 1fr}.risk{grid-column:1/-1}.loan-top{grid-template-columns:1fr 1fr}}

/* ---- ExpressCredit MIS additions -------------------------------------- */
.staff-login:after{content:'»'}
.logo strong i{font-style:italic;font-weight:800;letter-spacing:-.02em}
.tag{display:inline-flex;gap:5px;align-items:center;font-weight:600;white-space:nowrap}
.tag.red{background:#fdeceb;color:#b32b1d}.tag.grey{background:#eef2f6;color:#52647a}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:40px;padding:0 15px;border-radius:8px;font:600 13px Inter;cursor:pointer;border:1.5px solid transparent;white-space:nowrap}
.btn.primary{background:#008CA8;color:#fff}.btn.primary:hover{background:#00738A}
.btn.navy{background:#08234D;color:#fff}
.btn.outline{background:#fff;color:#08234D;border-color:#08234D}.btn.outline:hover{background:#eaf7fa}
.btn.danger{background:#fff;color:#b32b1d;border-color:#e0a49d}.btn.danger:hover{background:#fdeceb}
.btn[disabled]{background:#eef2f6;color:#9fadbe;border-color:transparent;cursor:not-allowed}
.btn:focus-visible{outline:3px solid #1FA8C4;outline-offset:2px}
.flash{padding:13px 16px;border-radius:10px;margin-bottom:18px;font-size:13px;font-weight:500;border:1px solid}
.flash.ok{background:#e9f7ef;border-color:#b7e3cb;color:#1b7a43}.flash.bad{background:#fdeceb;border-color:#f6c3bd;color:#b32b1d}
.grid2{display:grid;grid-template-columns:1.25fr 1fr;gap:16px}.grid2>div{display:grid;gap:16px;align-content:start}
.sec{margin-top:16px}
.panel h3{display:flex;justify-content:space-between;align-items:center}
.panel dl dt{color:#66758a}
.checkrow{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:start;padding:14px 0;border-bottom:1px solid #edf0f4}
.checkrow:last-child{border-bottom:0}.checkrow .ic{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-weight:700;font-size:13px;background:#eef2f6;color:#52647a}
.checkrow .ic.green{background:#e6f7ec;color:#198441}.checkrow .ic.red{background:#fdeceb;color:#b32b1d}
.checkrow b{display:block;font-size:13px}.checkrow small{color:#66758a;font-size:12px}
.actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.actions form{display:inline}
.note{width:100%;min-height:64px;border:1px solid #dce4ec;border-radius:8px;padding:9px 11px;font:13px Inter;margin-top:10px}
.audit{list-style:none;margin:0;padding:0;font-size:12px}.audit li{padding:10px 0;border-bottom:1px solid #edf0f4}.audit li:last-child{border:0}
.audit b{color:#08234D}.audit time{color:#7f91a8;display:block;margin-bottom:2px}
.progress{height:8px;background:#e8edf1;border-radius:99px;overflow:hidden;margin-top:10px}.progress i{display:block;height:100%;background:linear-gradient(90deg,#008CA8,#35B4CB)}
.mock{display:inline-block;margin-left:8px;font-size:10px;font-weight:700;letter-spacing:.06em;color:#8a5606;background:#fef5e6;border:1px dashed #f7dca9;border-radius:99px;padding:3px 8px;vertical-align:middle}
.num{text-align:right!important;font-variant-numeric:tabular-nums}
.muted{color:#7f91a8}.empty-row td{text-align:center;color:#7f91a8;padding:28px}
.kpis article a{color:inherit;display:flex;flex-direction:column;gap:6px}
.filters{grid-template-columns:200px 1fr auto}
.filters .btn{height:42px}
@media(max-width:1100px){.grid2{grid-template-columns:1fr}}

/* ---- disbursements / notifications / reports ---------------------------- */
.stack{display:grid;gap:8px}.stack label{font-size:12px;font-weight:600;color:#3d4f66;margin-top:6px}
.stack input,.stack select,.stack textarea{height:40px;border:1px solid #dce4ec;border-radius:8px;padding:0 11px;font:13px Inter;background:#fff;width:100%}
.stack textarea{height:auto;min-height:80px;padding:9px 11px}
.stack .btn{margin-top:10px;justify-self:start}
.stack .two{display:grid;grid-template-columns:1fr 1fr;gap:10px}.stack .two label{display:block;margin-bottom:6px}
.stack label.check{display:flex;gap:8px;align-items:center;font-weight:500}.stack label.check input{width:auto;height:auto}
.small{font-size:12px}.tag.orange{background:#fff1d9;color:#bd7500}
.table-wrap tfoot td{padding:14px 16px;border-top:2px solid #e0e6ec;background:#f9fafb}
.table-wrap td small{font-size:11px}
.report-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.report-cards a{display:block;background:#fff;border:1px solid #e0e6ec;border-radius:12px;padding:20px;box-shadow:0 6px 18px #19304b0a}
.report-cards a:hover{border-color:#008CA8}.report-cards b{display:block;font:600 16px Inter;margin-bottom:6px}.report-cards span{color:#66758a;font-size:13px;line-height:1.5}
.period{display:flex;flex-wrap:wrap;gap:10px;align-items:end;margin-bottom:16px}
.period label{display:grid;gap:4px;font-size:12px;font-weight:600;color:#3d4f66}
.period input,.period select{height:40px;border:1px solid #dce4ec;border-radius:8px;padding:0 11px;font:13px Inter;background:#fff}
.report-table{margin-top:16px}.report-table h3{padding:18px 20px 0;margin:0 0 10px}
.timeline{list-style:none;margin:0;padding:0}
.timeline li{display:grid;grid-template-columns:150px 110px 1fr;gap:14px;padding:12px 0;border-bottom:1px solid #edf0f4;font-size:13px}
.timeline li:last-child{border:0}.timeline time{color:#66758a;font-size:12px}
.timeline .src{font-size:10px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;border-radius:99px;padding:3px 8px;justify-self:start;height:max-content}
.src.Staff{background:#eaf2ff;color:#346ec6}.src.Customer{background:#e6f7ec;color:#198441}.src.System{background:#eef2f6;color:#52647a}.src.SMS{background:#fef5e6;color:#8a5606}
.timeline b{color:#08234D}.timeline p{margin:3px 0 0;color:#52647a}.timeline small{color:#7f91a8}
@media(max-width:1100px){.report-cards{grid-template-columns:1fr 1fr}.timeline li{grid-template-columns:1fr}}
.filters:not(:has(select)){grid-template-columns:1fr auto}
.panel p > a,.loan-top b > a{color:#008CA8;font-weight:600}.panel p > a:hover,.loan-top b > a:hover{text-decoration:underline}
.runlog{white-space:pre-wrap;font:12px/1.6 ui-monospace,Consolas,monospace;background:#0b1f3f;color:#dbe7f5;border-radius:8px;padding:14px;max-height:560px;overflow:auto;margin:0}
.quote{width:100%;border-collapse:collapse;font-size:12px;margin-top:8px}.quote td,.quote th{padding:6px 8px;border-bottom:1px solid #edf0f4;text-align:right}.quote td:first-child,.quote th:first-child{text-align:left}
.plan-options{display:grid;grid-template-columns:1fr 1fr;gap:14px}.plan-options .panel{margin:0}

/* two-step login (staff) */
.staff-card.mfa-wide{width:min(560px,100%)}
.staff-card h2{font:600 16px Inter;margin:0 0 4px;color:#fff}
.mfa-option{margin-top:22px;padding:18px;border:1px solid #ffffff1f;border-radius:10px;background:#ffffff08}
.mfa-option p{margin:0 0 10px;font-size:13px}
.mfa-qr{display:flex;gap:18px;align-items:center;margin:8px 0 6px;flex-wrap:wrap}
.mfa-qr img{background:#fff;border-radius:8px;padding:6px}
.mfa-qr code{display:block;font-size:15px;letter-spacing:.05em;color:#25c7b7;word-break:break-all}
.mfa-ok{color:#7ee0c3}.mfa-err{color:#ff9d9d}.mfa-dev{color:#ffd27a;font-size:13px}
.mfa-link{background:none!important;border:0;color:#25c7b7!important;font-size:12px!important;height:auto!important;margin:0!important;cursor:pointer;width:100%;font-weight:400!important}
.mfa-codes{columns:2;font:16px/2 monospace;list-style:none;padding:14px;margin:16px 0;background:#ffffff0d;border-radius:8px}
.mfa-btn{display:block;text-align:center;margin-top:16px;padding:13px;border-radius:7px;background:#008CA8;color:#fff!important;font-weight:700;text-decoration:none}
.staff-card [data-valmsg-summary] ul,.staff-card .validation-summary-errors ul{color:#ff9d9d;padding-left:18px;margin:6px 0}

/* ==========================================================================
   PHONE LAYOUT (<= 760px): app-style top bar, bottom tab bar with the main
   screens, and a "More" menu (slides in from the right) with every option.
   ========================================================================== */
.mobile-topbar,.mobile-tabbar,.mobile-sheet{display:none}
@media(max-width:760px){
  body{padding-bottom:calc(68px + env(safe-area-inset-bottom))}
  .mobile-topbar{display:flex;position:sticky;top:0;z-index:30;align-items:center;justify-content:space-between;gap:12px;padding:calc(10px + env(safe-area-inset-top)) 16px 10px;background:#08234D;color:#fff;box-shadow:0 4px 14px #08234d33}
  .mobile-topbar .logo>span{width:32px;height:32px;font-size:20px;border-radius:9px}
  .mobile-topbar .logo strong{font-size:18px}
  .mobile-burger{display:grid;place-items:center;width:42px;height:42px;border-radius:10px;border:1px solid #ffffff33;cursor:pointer}
  .mobile-tabbar{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:0;right:0;bottom:0;z-index:30;background:#fff;border-top:1px solid #e0e6ec;box-shadow:0 -6px 20px #19304b14;padding-bottom:env(safe-area-inset-bottom)}
  .mobile-tabbar a,.mobile-tabbar label{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:60px;padding:6px 2px;font-size:11px;color:#66758a;cursor:pointer;-webkit-tap-highlight-color:transparent}
  .mobile-tabbar a.active{color:#008CA8;font-weight:700}
  .mobile-tabbar a.active svg{stroke-width:2.4}
  .mobile-sheet{display:block;position:fixed;inset:0;z-index:40;pointer-events:none}
  .sheet-backdrop{position:absolute;inset:0;background:#08234d99;opacity:0;transition:opacity .2s}
  .sheet-panel{position:absolute;top:0;right:0;bottom:0;width:min(320px,86vw);background:#08234D;color:#dbe4ee;padding:calc(16px + env(safe-area-inset-top)) 14px calc(20px + env(safe-area-inset-bottom));overflow-y:auto;display:flex;flex-direction:column;gap:12px;transform:translateX(105%);transition:transform .22s ease}
  .mis-more-toggle:checked ~ .mobile-sheet{pointer-events:auto}
  .mis-more-toggle:checked ~ .mobile-sheet .sheet-backdrop{opacity:1}
  .mis-more-toggle:checked ~ .mobile-sheet .sheet-panel{transform:none}
  .sheet-head{display:flex;justify-content:space-between;align-items:center;padding:0 4px 8px}
  .sheet-close{font-size:30px;line-height:1;width:42px;height:42px;display:grid;place-items:center;cursor:pointer;color:#fff}
  .sheet-panel nav{display:flex;flex-direction:column;gap:2px}
  .sheet-panel nav a{padding:13px 14px;border-radius:9px;font-size:15px}
  .sheet-panel nav a.active{background:#008CA8;color:#fff}
  .sheet-user{margin-top:auto;padding:14px 6px 0;border-top:1px solid #ffffff1f;display:grid;gap:6px;font-size:13px}
  .sheet-user small{color:#9eb0c4}
  .sheet-user b{color:#fff;font-weight:600;word-break:break-all}
  .sheet-user a{color:#25c7b7}
  .sheet-user .btn{width:100%;height:42px;margin-top:6px}
  .content{padding:16px 14px 24px}
  .content header{flex-wrap:wrap;gap:12px;margin-bottom:16px}
  .content header .actions{flex-wrap:wrap}
  .content h1{font-size:24px}
  .report-cards{grid-template-columns:1fr}
  .kpis b{font-size:18px}
}

/* ==========================================================================
   PHONE: ONE LAYOUT FOR EVERY PAGE (<= 760px). Kept LAST so it wins over the
   desktop rules above. Every MIS page uses the same shell as the dashboard:
   slim top bar, content, bottom tab bar. Nothing may be wider than the screen;
   wide tables scroll sideways inside their own panel.
   ========================================================================== */
@media(max-width:760px){
  html,body{overflow-x:hidden;max-width:100%}
  @supports(overflow:clip){html,body{overflow-x:clip}}
  /* the shell stops being a grid: the top bar never stretches, on any page */
  .shell{display:block;min-height:100vh}
  .mobile-topbar{height:auto;min-height:0}
  .content{display:block;width:100%;max-width:100vw;min-width:0}
  .content :where(div,section,article,form,header,aside,main,nav,label,dl,fieldset,ul,ol,li,p,h1,h2,h3){min-width:0;max-width:100%}
  .content header{display:flex;flex-wrap:wrap;align-items:flex-start;gap:10px}
  .content header>*{max-width:100%}
  .content header .mock{margin-left:0;white-space:normal}
  /* every grid collapses to one column (KPI tiles to two) */
  .grid2,.dash-grid,.three,.plan-options,.report-cards,.stack .two,.customer-head{grid-template-columns:1fr!important}
  .kpis,.loan-top{grid-template-columns:1fr 1fr!important}
  .kpis article,.loan-top article{min-width:0;overflow-wrap:anywhere}
  .kpis b,.loan-top b{font-size:16px}
  /* filter bars: one control per row, full width */
  .filters,.filters:not(:has(select)),form.filters[style]{display:grid;grid-template-columns:1fr!important;gap:8px}
  .filters>*{width:100%;min-width:0}
  .period{display:grid;grid-template-columns:1fr;gap:8px}
  .period label,.period label[style]{flex:none!important;min-width:0!important;width:100%}
  .period input,.period select,.period .btn{width:100%}
  input,select,textarea,button{max-width:100%}
  .content input:not([type=checkbox]):not([type=radio]):not([type=hidden]),.content select,.content textarea{min-width:0}
  /* tables scroll inside their panel instead of pushing the page wider */
  .panel,.table-wrap{max-width:100%;min-width:0}
  .table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .panel:not(.table-wrap)>table:not(.quote){display:block;overflow-x:auto}
  .table-wrap th,.table-wrap td{padding:12px 12px}
  .table-wrap td[style*="width"]{min-width:200px!important;max-width:none!important}
  .table-wrap td input[type=password]{width:150px!important}
  /* rows of buttons wrap */
  .actions,.panel h3,.content header .actions{flex-wrap:wrap;gap:8px}
  .panel h3[style]{flex-wrap:wrap;gap:8px}
  .checkrow{grid-template-columns:auto 1fr}
  .checkrow>*:nth-child(3){grid-column:2}
  .timeline li{grid-template-columns:1fr;gap:4px}
  .tabs{word-spacing:normal;display:flex;flex-wrap:wrap;gap:6px 14px}
  .runlog{max-width:100%}
  .mfa-codes{columns:1}
  pre,code{white-space:pre-wrap;overflow-wrap:anywhere}
}
