:root{--navy:#102e5b;--navy-deep:#0c2348;--blue:#3788e8;--blue-light:#eaf4ff;--ink:#172b4d;--muted:#5f6f84;--line:#e9eef5;--bg:#f6f9fd;--white:#fff;--green:#24a879;--shadow:0 8px 28px rgba(25,57,99,.055)}
  *{box-sizing:border-box}
  [hidden]{display:none!important}
  body{margin:0;background:var(--bg);color:var(--ink);font-family:'Segoe UI',Arial,sans-serif;font-size:14px;-webkit-font-smoothing:antialiased}
  button,input,select,textarea{font:inherit}
  button{cursor:pointer}
  .app-shell{min-height:100vh}
  .app-shell{display:none}
  .auth-screen{position:fixed;inset:0;z-index:40;display:grid;place-items:center;overflow:auto;padding:32px 18px;background:radial-gradient(ellipse at 15% 5%,#cbe6ff 0,transparent 42%),linear-gradient(145deg,#f5faff,#eaf3ff 55%,#d8e8fb)}
  .auth-screen[hidden]{display:none}
  .auth-card{width:min(100%,430px);padding:33px 36px 25px;border:1px solid #ffffffc9;border-radius:18px;background:rgba(255,255,255,.96);box-shadow:0 22px 70px rgba(23,63,112,.15)}
  .auth-brand{display:flex;align-items:center;gap:12px;margin-bottom:31px;color:#163760}
  .auth-brand strong{display:block;font:800 15px Manrope,sans-serif;letter-spacing:.55px}
  .auth-brand small{display:block;margin-top:4px;color:#64758b;font-size:10px}
  .auth-card h1{font-size:24px}
  .auth-description{margin:0 0 22px}
  .auth-form{gap:14px}
  .data-form .remember-password{display:flex;grid-template-columns:none;align-items:center;gap:8px;margin-top:-4px;color:#687991;font-size:10px;font-weight:500;cursor:pointer}
  .data-form .remember-password input{width:15px;height:15px;min-width:15px;margin:0;accent-color:#3788e8}
  .data-form .remember-password span{line-height:1.4}
  .auth-error{display:none;padding:9px 11px;border-radius:7px;background:#fff0f1;color:#a53243;font-size:11px;line-height:1.45}
  .auth-error.visible{display:block}
  .setup-unavailable{margin-top:13px;padding:10px 11px;border-radius:7px;background:#f3f7fc;color:#61758e;font-size:10px;line-height:1.55}
  .auth-security{margin:20px 0 0;padding-top:15px;border-top:1px solid #edf1f6;color:#65758a;text-align:center;font-size:9px}
  .auth-developer{margin:11px 0 0;color:#617187;text-align:center;font-size:10px}
  .auth-developer strong{color:#426f9f}
  .auth-background-note{position:fixed;right:22px;bottom:17px;color:#607c9f;font-size:10px}
  .sidebar{width:252px;position:fixed;inset:0 auto 0 0;z-index:10;padding:27px 17px 19px;background:linear-gradient(165deg,#163a70 0%,#102d59 53%,#0c2348 100%);color:#fff;display:flex;flex-direction:column}
  .brand{display:flex;align-items:center;gap:12px;margin:0 9px 45px;color:#fff;text-decoration:none}
  .brand-mark{position:relative;height:42px;width:42px;flex:0 0 42px;overflow:hidden;display:grid;place-items:center;border:1px solid rgba(255,255,255,.25);border-radius:14px;background:linear-gradient(145deg,#8cc5ff,#4a91e9);color:white;font-family:Manrope,sans-serif;font-size:23px;font-weight:800;box-shadow:0 5px 17px rgba(4,18,42,.2)}
  .brand-logo{width:100%;height:100%;object-fit:contain;border-radius:12px;background:#fff}
  .brand-fallback{line-height:1}
  .brand strong{font:800 15px Manrope,sans-serif;letter-spacing:.65px;display:block}
  .brand small{color:#aac0df;font-size:11px;display:block;margin-top:3px}
  .nav-label{padding:0 12px;margin-bottom:12px;font-size:9px;letter-spacing:1.45px;font-weight:700;color:#b2c6e2}
  .navigation{display:grid;gap:6px}
  .nav-link{display:flex;align-items:center;gap:13px;width:100%;padding:12px 13px;border:0;border-radius:9px;background:transparent;text-align:left;color:#c3d0e2;font-size:13px;transition:.2s}
  .nav-link:hover{background:rgba(255,255,255,.08);color:white}
  .nav-link.active{background:linear-gradient(100deg,rgba(116,176,250,.24),rgba(116,176,250,.1));color:#fff;box-shadow:inset 3px 0 #8cc5ff}
  .nav-icon{width:19px;text-align:center;font-size:17px;color:#a8c9f3}
  .sidebar-bottom{margin-top:auto}
  .sidebar-note{display:flex;gap:10px;align-items:center;padding:13px 11px;border:1px solid rgba(255,255,255,.12);border-radius:10px;background:rgba(255,255,255,.055)}
  .note-icon{display:grid;place-items:center;width:31px;height:31px;border-radius:9px;background:rgba(145,193,255,.16);color:#add2ff}
  .sidebar-note strong,.sidebar-note small{display:block}
  .sidebar-note strong{font-size:11px}
  .sidebar-note small{margin-top:4px;color:#c0cfe3;font-size:9px}
  .version{display:block;padding:20px 10px 0;color:#b1c2da;font-size:9px;letter-spacing:.7px}
  .main-area{min-height:100vh;margin-left:252px}
  .topbar{height:70px;padding:0 37px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #edf1f6;background:rgba(255,255,255,.88)}
  .breadcrumb{font-size:11px;font-weight:700;color:#64758b;letter-spacing:.55px}
  .breadcrumb span{padding:0 9px;color:#c2cad5}
  .breadcrumb strong{color:#273d5d;font-weight:600;letter-spacing:0}
  .topbar-right{display:flex;align-items:center;gap:9px;color:#64758b;font-size:11px}
  .account-label{max-width:155px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#536781;font-size:10px;font-weight:600}
  .password-settings-button{padding:7px 10px;border:1px solid #dce9f7;border-radius:7px;background:#f5f9ff;color:#3979bd;font-size:10px;font-weight:700}
  .password-settings-button:hover{border-color:#b9d3ef;background:#edf5ff}
  .logout-button{padding:7px 10px;border:1px solid #e5edf6;border-radius:7px;background:#fff;color:#5076a0;font-size:10px;font-weight:700}
  .logout-button:hover{border-color:#b9d3ef;background:#f5f9ff}
  .status-dot,.live-dot{width:7px;height:7px;border-radius:50%;background:#32bb89;display:inline-block}
  .avatar{margin-left:10px;width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:#e7f1ff;color:#3479cb;font-size:11px;font-weight:700}
  .menu-toggle{display:none;border:0;background:none;color:var(--navy);font-size:20px}
  .content{max-width:1450px;padding:32px 38px 20px;margin:auto}
  .view{display:none;animation:fade-in .25s ease}
  .view.active{display:block}
  @keyframes fade-in{from{opacity:.6;transform:translateY(4px)}to{opacity:1;transform:none}}
  .page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 24px}
  .eyebrow{margin:0 0 8px;color:#4c91df;font-size:9px;font-weight:700;letter-spacing:1.45px}
  h1,h2,p{margin-top:0}
  h1{margin-bottom:6px;font:800 25px Manrope,sans-serif;letter-spacing:-.65px;color:#142d52}
  h2{margin:0;font:700 14px Manrope,sans-serif;letter-spacing:-.15px;color:#1c3355}
  .muted{margin:0;color:var(--muted);font-size:11px;line-height:1.6}
  .button{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 16px;border:0;border-radius:8px;font-size:11px;font-weight:700;transition:.2s}
  .button-primary{background:linear-gradient(110deg,#438fe8,#3477cf);color:white;box-shadow:0 5px 13px rgba(53,124,210,.19)}
  .button-primary:hover{filter:brightness(1.06);transform:translateY(-1px)}
  .button:disabled{opacity:.65;cursor:wait}
  .stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin-bottom:18px}
  .stat-grid.user-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  #dashboard-stat-grid .stat-card.stat-main .stat-icon{background:rgba(255,255,255,.16);color:#fff}
  .stat-card{position:relative;overflow:hidden;min-height:135px;padding:18px 19px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:var(--shadow)}
  .stat-card.stat-main{border:0;color:white;background:linear-gradient(125deg,#458fe7 0%,#2869bc 55%,#214f98 100%);box-shadow:0 9px 24px rgba(44,107,190,.2)}
  .stat-main:after{content:"";position:absolute;width:145px;height:145px;right:-36px;top:39px;border-radius:50%;border:1px solid rgba(255,255,255,.13);box-shadow:0 0 0 19px rgba(255,255,255,.045),0 0 0 40px rgba(255,255,255,.035)}
  .stat-top{display:flex;align-items:center;justify-content:space-between;color:#5f7086;font-size:11px}
  .stat-main .stat-top{color:#d5e8ff}
  .stat-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:#eaf4ff;color:#3984d8;font-size:15px}
  .stat-icon.blue{background:#eaf4ff;color:#428fe2}.stat-icon.violet{background:#f0edff;color:#7966d9}.stat-icon.green{background:#e8f8f2;color:#24a879}
  .stat-value{position:relative;z-index:1;display:block;margin:13px 0 8px;font:800 24px Manrope,sans-serif;letter-spacing:-.7px;color:#17345d}
  .stat-main .stat-value{color:white;font-size:25px}
  .stat-foot{position:relative;z-index:1;color:#5f7086;font-size:10px}
  .stat-main .stat-foot{color:#d7e8fb}.live-dot{margin-right:6px;background:#8ff0c7}
  .dashboard-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:17px;margin-bottom:17px}
  .dashboard-grid.user-dashboard-grid{grid-template-columns:1fr}
  .panel{min-width:0;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:var(--shadow)}
  .chart-panel,.dashboard-grid>.panel{min-height:242px;padding:20px}
  .panel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:17px}
  .panel-heading h2{margin-bottom:5px}
  .panel-badge,.count-pill{padding:6px 8px;border-radius:6px;background:#f0f6ff;color:#356da9;font-size:8px;font-weight:700;letter-spacing:.5px;white-space:nowrap}
  .chart{display:grid;gap:14px;padding-top:4px}
  .chart-row{min-width:0}
  .chart-label{display:flex;justify-content:space-between;gap:10px;margin-bottom:6px;font-size:10px;color:#78869a}
  .chart-label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .chart-label strong{color:#4b5d76;font-size:10px}
  .bar-track{height:6px;overflow:hidden;border-radius:8px;background:#eef3f9}
  .bar-fill{height:100%;min-width:2px;border-radius:8px;background:linear-gradient(90deg,#86c3ff,#418be2)}
  .user-summary-list{display:grid;gap:13px}
  .user-summary-item{display:flex;align-items:center;gap:9px;min-width:0}
  .mini-avatar{flex:0 0 32px;height:32px;display:grid;place-items:center;border-radius:10px;background:#eaf3ff;color:#4a83c5;font-size:9px;font-weight:700}
  .summary-person{flex:1;min-width:0}
  .summary-person strong,.summary-person small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .summary-person strong{font-size:10px;color:#3b4f6b}.summary-person small{margin-top:4px;color:#5f7086;font-size:9px}
  .summary-amount{white-space:nowrap;font-size:10px;color:#315f9d}
  .recent-panel{padding:20px 20px 5px}
  .text-button{padding:5px 0;border:0;background:transparent;color:#4986d0;font-size:10px;font-weight:700}
  .text-button span{padding-left:5px}
  .table-wrap{width:100%;overflow:auto}
  table{width:100%;border-collapse:collapse;text-align:left;white-space:nowrap}
  th{padding:11px 12px;border-bottom:1px solid #edf1f6;color:#5f7086;font-size:8px;font-weight:700;letter-spacing:.7px}
  td{padding:12px;border-bottom:1px solid #f0f3f7;color:#53657b;font-size:10px}
  tr:last-child td{border-bottom:0}
  .table-primary{color:#354b68;font-weight:600}
  .amount-cell{color:#3174bd;font-weight:700}
  .action-button{padding:6px 10px;border:1px solid #dce9f7;border-radius:6px;background:#f5f9ff;color:#3979bd;font-size:9px;font-weight:700}
  .action-button:hover{border-color:#b9d3ef;background:#edf5ff}
  .empty-table{text-align:center;padding:28px 12px;color:#5f7086}
  .empty-state{padding:26px 10px;text-align:center;color:#5f7086;font-size:10px}
  .about-panel{max-width:600px;margin:0 auto;padding:38px 32px;text-align:center}
  .about-mark{width:76px;height:76px;margin:0 auto 20px;overflow:hidden;border:1px solid #e5eef8;border-radius:22px;background:#fff;box-shadow:0 8px 22px rgba(28,70,122,.09)}
  .about-mark img{width:100%;height:100%;object-fit:contain}
  .about-panel>.eyebrow{margin-bottom:8px}
  .about-title{margin-bottom:11px;font:800 23px Manrope,sans-serif;letter-spacing:.2px;color:#17345d}
  .about-description{max-width:420px;margin:0 auto;color:#5f6f84;font-size:12px;line-height:1.8}
  .about-divider{width:48px;height:2px;margin:24px auto;background:linear-gradient(90deg,#9bcaff,#428be0);border-radius:2px}
  .about-label,.about-developer{display:block}
  .about-label{margin-bottom:6px;color:#5f7086;font-size:10px}
  .about-developer{color:#285c98;font:700 15px Manrope,sans-serif}
  .footer{display:grid;gap:7px;padding:23px 0 7px;color:#5f7086;text-align:center;font-size:9px;letter-spacing:.3px}
  .footer-brand{color:#5f7086}
  .footer-separator{padding:0 5px;color:#526781}
  .footer-meta{display:flex;justify-content:center;flex-wrap:wrap;gap:4px 14px;color:#5f7086}
  .footer-meta strong{color:#365879;font-weight:700}
  .split-layout{display:grid;grid-template-columns:minmax(255px,.72fr) minmax(0,1.8fr);align-items:start;gap:17px}
  .loan-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:17px}
  .loan-summary-card{display:grid;gap:9px;padding:18px 20px}
  .loan-summary-card span{color:#5f7086;font-size:10px;font-weight:600}
  .loan-summary-card strong{color:#285c98;font:800 19px Manrope,sans-serif}
  .form-panel,.table-panel{padding:20px}
  .dashboard-loan-summary-panel{margin-top:17px}
  .form-panel{position:sticky;top:20px}
  .form-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:#eaf4ff;color:#4186d5;font-size:16px}
  .data-form{display:grid;gap:15px}
  .data-form label{display:grid;gap:7px;color:#53647c;font-size:10px;font-weight:600}
  .data-form input,.data-form select,.data-form textarea{width:100%;min-width:0;padding:10px 11px;border:1px solid #e4eaf2;border-radius:7px;outline:none;background:white;color:#334966;font-size:11px;transition:border .2s,box-shadow .2s}
  .data-form input::placeholder,.data-form textarea::placeholder{color:#687991}
  .data-form input:focus,.data-form select:focus,.data-form textarea:focus{border-color:#82b6f0;box-shadow:0 0 0 3px rgba(75,143,222,.1)}
  .data-form textarea{resize:vertical}
  .data-form select:invalid{color:#687991}
  .password-field{position:relative;display:block}
  .data-form .password-field input{padding-right:82px}
  .password-toggle{position:absolute;top:50%;right:7px;transform:translateY(-50%);padding:6px;border:0;border-radius:5px;background:transparent;color:#4383c7;font-size:9px;font-weight:700}
  .password-toggle:hover{background:#f0f6fd}
  .dialog-backdrop{position:fixed;inset:0;z-index:35;display:grid;place-items:center;overflow:auto;padding:20px;background:rgba(13,35,69,.42);backdrop-filter:blur(3px)}
  .dialog-backdrop[hidden]{display:none}
  .dialog-card{width:min(100%,450px);padding:23px;border:1px solid #e9eef5;border-radius:14px;background:#fff;box-shadow:0 20px 65px rgba(13,35,69,.22)}
  .dialog-card>.panel-heading{align-items:flex-start;margin-bottom:18px}
  .dialog-card .eyebrow{margin-bottom:7px}
  .dialog-card h2{margin-bottom:6px;font-size:17px}
  .dialog-close{flex:0 0 auto;width:30px;height:30px;border:0;border-radius:7px;background:#f3f6fa;color:#52647b;font-size:20px;line-height:1}
  .dialog-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:3px}
  .button-secondary{border:1px solid #e1e8f1;background:#fff;color:#64758a}
  .optional{color:#5f7086;font-weight:400}
  .form-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .payment-report-panel{margin-bottom:17px;padding:20px}
  .payment-report-panel[hidden]{display:none}
  .report-filters{max-width:680px;margin-bottom:14px}
  .report-filters label{display:grid;gap:7px;color:#53647c;font-size:10px;font-weight:600}
  .report-filters select{width:100%;min-width:0;padding:10px 11px;border:1px solid #e4eaf2;border-radius:7px;outline:none;background:#fff;color:#334966;font-size:11px}
  .report-filters select:focus{border-color:#82b6f0;box-shadow:0 0 0 3px rgba(75,143,222,.1)}
  .report-summary{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;min-height:42px;margin-bottom:10px;padding:10px 12px;border-radius:8px;background:#f5f9ff;color:#53657b;font-size:10px}
  .report-summary>strong:first-child{color:#354b68;font-size:11px}
  .report-summary .report-total{margin-left:auto;color:#3174bd;font:800 15px Manrope,sans-serif}
  .loan-note-cell{min-width:130px;max-width:240px;white-space:normal;line-height:1.5}
  .loan-edit-status{margin:0;padding:10px;border-radius:7px;background:#f5f9ff;font-size:10px;line-height:1.6}
  .loan-member-summary-panel{margin-top:17px}
  .report-actions{display:flex;justify-content:flex-end;margin-bottom:10px}
  .report-print-button{padding:9px 13px}
  .report-letterhead{display:none}
  .letterhead-settings-panel{max-width:760px;padding:22px}
  .letterhead-preview{display:flex;align-items:center;gap:18px;margin-bottom:22px;padding:18px;border:1px dashed #cbd9e9;border-radius:9px;background:#fbfdff}
  .letterhead-preview img{width:76px;height:76px;object-fit:contain}
  .letterhead-preview h2{margin-bottom:5px;color:#172b4d;font-size:17px}
  .letterhead-preview p{margin:3px 0;color:#526984;font-size:11px;line-height:1.5}
  #letterhead-preview-details{white-space:pre-line}
  .letterhead-remove-logo{display:flex!important;grid-template-columns:16px 1fr;align-items:center;gap:8px!important}
  .letterhead-remove-logo input{width:15px!important;height:15px;margin:0;accent-color:#3788e8}
  .payment-report-panel table thead th{text-align:center}
  #dashboard-report-print-area{display:none}
  .dashboard-report-menu-card{max-width:560px}
  .dashboard-report-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .dashboard-report-option{display:grid;gap:5px;padding:14px;border:1px solid #e1e8f1;border-radius:9px;background:#fff;text-align:left;color:#263d5c}
  .dashboard-report-option:hover{border-color:#9fc5ee;background:#f5f9ff}
  .dashboard-report-option strong{font-size:12px}
  .dashboard-report-option span{color:#64758a;font-size:10px;line-height:1.5}
  .dashboard-report-menu-card .dialog-actions{margin-top:15px}
  .dashboard-report-print-title{margin:0 0 14px;color:#172b4d;text-align:center;font-size:18px}
  .report-grand-totals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0 0}
  .report-grand-totals>div{display:flex;flex-direction:column;gap:6px;padding:14px 16px;border:1px solid #e4ecf6;border-radius:11px;background:linear-gradient(145deg,#fbfdff,#f4f8fe)}
  .report-grand-totals span{color:#64758b;font-size:10px;font-weight:600}
  .report-grand-totals strong{color:#1d4678;font:800 16px Manrope,sans-serif}
  .report-table-wrap{min-width:0;overflow-x:auto;overflow-y:hidden;border:1px solid #e7edf5;border-radius:11px;background:#fff}
  .report-table-wrap table{min-width:760px}
  #loan-report-panel .report-table-wrap table{min-width:1050px}
  .report-table-wrap thead th{padding-top:13px;padding-bottom:13px;background:#f5f8fc}
  .payment-report-panel .report-panel-heading{align-items:center;margin-bottom:19px;padding-bottom:16px;border-bottom:1px solid #e9eef5}
  .report-panel-heading .eyebrow{margin-bottom:5px}
  .report-panel-heading h2{margin-bottom:4px;font-size:17px}
  .report-panel-heading .muted{font-size:11px}
  .payment-report-panel .report-filters{max-width:none;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:15px;padding:16px;border:1px solid #e9eef5;border-radius:11px;background:#f8fafd}
  .payment-report-panel .report-summary{margin-bottom:14px}
  .payment-report-panel .report-actions{margin-bottom:12px}
  .report-signature{display:none}
  @media(max-width:600px){
    .dashboard-report-options{grid-template-columns:1fr}
  }
  .currency-input{position:relative}
  .currency-input span{position:absolute;left:11px;top:10px;color:#8d9aab;font-size:10px}
  .currency-input input{padding-left:33px}
  .button-full{width:100%;margin-top:3px}
  .table-panel .panel-heading{margin-bottom:14px}
  .older-payments{margin-top:16px;border:1px solid #e7edf5;border-radius:10px;background:#fbfdff}
  .older-payments summary{padding:12px 14px;color:#526781;font-size:11px;font-weight:700;cursor:pointer}
  .older-payments[open] summary{border-bottom:1px solid #e7edf5}
  .older-payments .table-wrap{border:0;border-radius:0 0 10px 10px}
  .user-id{font-family:monospace;font-size:10px;font-weight:700;color:#4c83c1}
  .address-cell{min-width:150px;max-width:240px;white-space:normal;line-height:1.5}
  .status-badge{display:inline-block;padding:5px 9px;border-radius:20px;font-size:9px;font-weight:700}
  .status-active{background:#e8f8f2;color:#21875f}
  .status-inactive{background:#f1f3f6;color:#58677a}
  .status-loan-active{background:#fff4de;color:#946313}
  .status-loan-paid{background:#e8f8f2;color:#21875f}
  .toast{position:fixed;z-index:30;right:24px;bottom:24px;max-width:min(400px,calc(100% - 32px));padding:13px 17px;border-radius:9px;background:#163b6f;color:white;font-size:12px;box-shadow:0 9px 28px #102e5b30;opacity:0;pointer-events:none;transform:translateY(9px);transition:.25s}
  .toast.show{opacity:1;transform:translateY(0)}
  .toast.error{background:#a53243}
  .loading-overlay{position:fixed;z-index:25;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:rgba(247,250,254,.76);color:#476789;font-size:11px;opacity:0;pointer-events:none;transition:opacity .2s}
  .loading-overlay.visible{opacity:1;pointer-events:auto}
  .spinner{height:29px;width:29px;border:3px solid #d8e8f8;border-top-color:#428be0;border-radius:50%;animation:spin .75s linear infinite}
  @keyframes spin{to{transform:rotate(360deg)}}
  @media(max-width:1100px){
    .content{padding-right:25px;padding-left:25px}
    .topbar{padding:0 25px}
    .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .stat-grid.user-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .split-layout{grid-template-columns:minmax(230px,.75fr) minmax(0,1.5fr)}
  }
  @media(max-width:900px){
    .sidebar{overflow-y:auto;transform:translateX(-100%);transition:transform .25s ease;box-shadow:12px 0 30px #102e5b22}
    .sidebar.open{transform:translateX(0)}
    .main-area{margin-left:0}
    .menu-toggle{display:grid;place-items:center;width:40px;height:40px;flex:0 0 40px;border-radius:9px;background:#eff6ff}
    .topbar{justify-content:flex-start;gap:12px;height:64px;padding:0 20px}
    .topbar-right{margin-left:auto}
    .content{padding:25px 20px 15px}
    .dashboard-grid{grid-template-columns:1fr}
    .split-layout{grid-template-columns:minmax(0,1fr)}
    .loan-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
    .loan-summary-card{padding:15px}
    .form-panel{position:static}
    .page-heading{align-items:flex-start}
    .page-heading>.button{white-space:nowrap}
    .chart-panel,.dashboard-grid>.panel{min-height:unset}
  }
  @media(max-width:600px){
    body{font-size:13px}
    .topbar{height:auto;min-height:60px;flex-wrap:wrap;gap:7px 10px;padding:9px 13px}
    .breadcrumb{font-size:10px}
    .breadcrumb span{padding:0 5px}
    .topbar-right{width:100%;margin:0;justify-content:flex-end;gap:7px}
    .topbar-right>#today-label{margin-right:auto;font-size:10px}
    .account-label{display:block;max-width:95px;font-size:9px}
    .avatar{width:30px;height:30px;margin-left:0;flex:0 0 30px;font-size:10px}
    .password-settings-button,.logout-button{min-height:36px;padding:7px 9px;font-size:9px;white-space:nowrap}
    .content{padding:20px 13px 12px}
    .page-heading{flex-direction:column;align-items:stretch;gap:12px;margin-bottom:18px}
    .page-heading>.button{width:100%;min-height:42px}
    h1{font-size:22px}
    .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
    .loan-summary-grid{grid-template-columns:1fr;gap:9px}
    .loan-summary-card{gap:6px;padding:13px 15px}
    .loan-summary-card strong{font-size:17px}
    .stat-card{min-height:116px;padding:14px}
    .stat-top{gap:5px;font-size:10px}
    .stat-value,.stat-main .stat-value{font-size:20px}
    .stat-foot{font-size:9px;line-height:1.45}
    .form-row{grid-template-columns:1fr}
    .report-filters{grid-template-columns:1fr}
    .report-summary .report-total{margin-left:0}
    .payment-report-panel .table-wrap{min-width:0;overflow:hidden}
    .payment-report-panel .table-wrap table,.payment-report-panel .table-wrap tbody{min-width:0;max-width:100%}
    .panel-heading{align-items:flex-start}
    .chart-panel,.dashboard-grid>.panel,.form-panel,.table-panel,.recent-panel{padding:15px}
    .panel-badge{font-size:7px}
    .recent-panel{padding-bottom:5px}
    .form-panel .data-form{gap:13px}
    .data-form input,.data-form select,.data-form textarea{min-height:42px;font-size:13px}
    .data-form textarea{min-height:76px}
    .button{min-height:42px;font-size:12px}
    .button-full{width:100%}
    .table-wrap{overflow:visible}
    .table-wrap table,.table-wrap tbody{display:block;width:100%}
    .table-wrap thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
    .table-wrap tbody tr{display:grid;grid-template-columns:minmax(0,1fr);gap:0;margin:0 0 10px;padding:5px 12px;border:1px solid var(--line);border-radius:9px;background:#fff}
    .table-wrap tbody tr:last-child{margin-bottom:0}
    .table-wrap tbody td{display:grid;grid-template-columns:minmax(96px,38%) minmax(0,1fr);align-items:start;gap:10px;padding:9px 0;border-bottom:1px solid #f0f3f7;white-space:normal;text-align:left;font-size:11px;line-height:1.45;overflow-wrap:anywhere}
    .table-wrap tbody td:last-child{border-bottom:0}
    .table-wrap tbody td:before{content:attr(data-label);color:#52647b;font-size:9px;font-weight:700}
    .table-wrap tbody td.empty-table{display:block;padding:13px 2px;border:0;text-align:center}
    .table-wrap tbody td.empty-table:before{content:none}
    .table-wrap .address-cell{min-width:0;max-width:none}
    .table-wrap .loan-note-cell{min-width:0;max-width:none}
    .action-button{min-height:34px;padding:7px 12px;font-size:10px}
    .auth-screen{place-items:start center;padding:18px 12px}
    .auth-card{width:100%;max-width:430px;margin:auto;padding:25px 20px 20px}
    .auth-brand{margin-bottom:24px}
    .auth-background-note{display:none}
    .dialog-backdrop{align-items:start;padding:12px}
    .dialog-card{width:100%;max-width:450px;margin:auto;padding:17px}
    .about-panel{padding:30px 19px}
    .dialog-actions{flex-wrap:wrap}
    .dialog-actions .button{flex:1;min-height:42px;padding:10px;font-size:11px}
    .footer{padding-top:18px}
  }
  @media(max-width:380px){
    .content{padding-right:10px;padding-left:10px}
    .topbar{padding-right:10px;padding-left:10px}
    .account-label{display:none}
    .topbar-right{gap:5px}
    .password-settings-button,.logout-button{padding-right:7px;padding-left:7px;font-size:8px}
    .stat-card{padding:12px}
    .stat-value,.stat-main .stat-value{font-size:18px}
    .table-wrap tbody tr{padding-right:9px;padding-left:9px}
    .table-wrap tbody td{grid-template-columns:minmax(82px,36%) minmax(0,1fr);gap:7px}
  }
  @media print{
    @page{size:A4 portrait;margin:12mm}
    html,body{background:#fff!important}
    body{overflow:visible!important}
    body > *:not(.app-shell){display:none!important}
    .app-shell,.main-area{display:block!important;width:auto!important;margin:0!important;padding:0!important;max-width:none!important}
    body.payment-report-printing #view-payments,
    body.loan-report-printing #view-loans{display:block!important;width:auto!important;margin:0!important;padding:0!important;max-width:none!important}
    body.payment-report-printing #view-loans,
    body.loan-report-printing #view-payments{display:none!important}
    body.payment-report-printing .content > :not(#view-payments),
    body.loan-report-printing .content > :not(#view-loans){display:none!important}
    body.dashboard-data-report-printing .content > :not(#dashboard-report-print-area){display:none!important}
    body.dashboard-data-report-printing #dashboard-report-print-area{display:block!important;width:100%!important;margin:0!important;padding:0!important}
    #view-payments > :not(.payment-report-panel),
    #view-loans > :not(#loan-report-panel){display:none!important}
    .payment-report-panel,#loan-report-panel{display:block!important;position:static!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important;background:transparent!important}
    .payment-report-panel *,#loan-report-panel *{visibility:visible!important}
    .payment-report-panel .panel-heading .muted,
    #loan-report-panel .panel-heading .muted,
    .payment-report-panel .panel-heading .form-icon,
    #loan-report-panel .panel-heading .form-icon{display:none!important}
    body.dashboard-data-report-printing .dashboard-report-print-title{display:block!important}
    body.dashboard-data-report-printing #dashboard-report-totals,
    body.payment-report-printing #payment-report-totals,
    body.loan-report-printing #loan-report-totals{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0;padding:10px 12px;border:1px solid #dfe8f3;border-radius:6px;break-inside:avoid;page-break-inside:avoid}
    .report-grand-totals>div{gap:4px;padding:8px 10px;border:0;border-radius:0;background:transparent}
    .report-grand-totals span{color:#53657b;font-size:9px}
    .report-grand-totals strong{color:#1d4678;font-size:12px}
    body.dashboard-data-report-printing #dashboard-report-print-area table thead th{text-align:center!important}
    body.dashboard-data-report-printing #dashboard-report-print-area .report-row-number{text-align:center!important;white-space:nowrap!important}
    body.dashboard-data-report-printing #dashboard-report-signature,
    body.payment-report-printing #payment-report-signature,
    body.loan-report-printing #loan-report-signature{display:flex!important;flex-direction:column;align-items:flex-end;gap:4px;width:100%;margin:28px 0 0;break-inside:avoid;page-break-inside:avoid;text-align:right}
    .report-qr{display:block;width:25mm;height:25mm;flex:0 0 25mm;fill:#101010;shape-rendering:crispEdges}
    .report-signature-details{display:flex;flex-direction:column;align-items:flex-end;color:#26384d;font-size:9px;line-height:1.45}
    .report-signature-details strong{margin-bottom:2px;font-size:10px}
    .report-letterhead{display:flex!important;align-items:center;justify-content:flex-start;gap:20px;margin:0 0 18px;padding:0 0 14px;border-bottom:3px double #253c5b;text-align:left}
    .report-letterhead img{width:76px;height:76px;object-fit:contain}
    .report-letterhead h1{margin:0;color:#172b4d;font-size:19px;line-height:1.4;letter-spacing:.6px}
    .report-letterhead p{margin:4px 0 0;color:#354b68;font-size:12px;font-weight:700;letter-spacing:.5px}
    .report-letterhead .report-letterhead-details{font-size:10px;font-weight:500;letter-spacing:0;white-space:pre-line}
    .report-filters,
    .period-filter-toolbar,
    .report-print-button,
    .heading-actions,
    .button,
    .nav-link,
    .sidebar,
    .topbar,
    .auth-screen,
    .page-heading{display:none!important}
    .report-summary{display:flex!important;align-items:center;flex-wrap:wrap;gap:8px 16px;visibility:visible!important}
    .report-summary strong,.report-summary span,.report-summary .report-total{display:inline!important;visibility:visible!important}
    .table-wrap{display:block!important;visibility:visible!important;width:100%!important;overflow:visible!important}
    .table-wrap table{display:table!important;visibility:visible!important;width:100%!important;max-width:none!important;border-collapse:collapse!important;table-layout:auto!important;white-space:normal!important}
    .report-table-wrap table,#loan-report-panel .report-table-wrap table{min-width:0!important}
    .table-wrap thead{display:table-header-group!important;position:static!important;width:auto!important;height:auto!important;padding:0!important;margin:0!important;overflow:visible!important;clip:auto!important}
    .table-wrap tbody{display:table-row-group!important;visibility:visible!important}
    .table-wrap tbody tr{display:table-row!important;break-inside:avoid;page-break-inside:avoid;border:0!important;padding:0!important;background:transparent!important}
    .table-wrap th,.table-wrap tbody td{display:table-cell!important;max-width:none!important;overflow:visible!important;white-space:normal!important;padding:7px 8px!important;border:1px solid #dfe8f3!important;text-align:left!important;vertical-align:top!important}
    .payment-report-panel table thead th{text-align:center!important}
    .payment-report-panel .report-panel-heading .eyebrow{display:none!important}
    .table-wrap tbody td:before{content:none!important}
    .table-primary{color:#304967!important}
    td[data-label="Anggota"],
    td[data-label="Nama anggota"],
    td[data-label="Peminjam"]{display:table-cell!important;visibility:visible!important}
  }

  :root{--navy:#102e5b;--navy-deep:#0b2144;--blue:#347fda;--blue-light:#edf5ff;--ink:#192f50;--muted:#60728a;--line:#e5ecf5;--bg:#f4f7fc;--shadow:0 10px 30px rgba(24,54,94,.06)}
  body{font-size:14px;line-height:1.5}
  button{transition:background-color .18s,border-color .18s,color .18s,box-shadow .18s,transform .18s}
  button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid rgba(63,137,224,.28);outline-offset:2px}
  .sidebar{width:260px;padding:28px 18px 20px}
  .brand{margin-bottom:40px}
  .navigation{gap:7px}
  .nav-link{min-height:45px;padding:11px 13px;border-radius:10px;font-size:13px}
  .nav-link.active{background:linear-gradient(105deg,rgba(116,176,250,.27),rgba(116,176,250,.11));box-shadow:inset 3px 0 #9dceff,0 5px 14px rgba(5,20,45,.08)}
  .main-area{margin-left:260px}
  .topbar{position:sticky;top:0;z-index:8;height:72px;padding:0 clamp(22px,3.2vw,46px);backdrop-filter:blur(14px);background:rgba(255,255,255,.92)}
  .topbar-right{gap:11px}
  .content{max-width:1520px;padding:36px clamp(22px,3.2vw,46px) 24px}
  .page-heading{margin-bottom:27px}
  .heading-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px}
  .eyebrow{font-size:10px;letter-spacing:1.5px}
  h1{font-size:28px;letter-spacing:-.7px}
  h2{font-size:15px}
  .muted{font-size:12px;line-height:1.65}
  .button{min-height:40px;padding:10px 16px;border-radius:9px;font-size:12px}
  .button-primary{background:linear-gradient(115deg,#438fe8,#3477cf);box-shadow:0 5px 13px rgba(53,124,210,.16)}
  .button-primary:hover{box-shadow:0 8px 18px rgba(53,124,210,.22)}
  .stat-grid{gap:16px;margin-bottom:20px}
  .stat-card{min-height:145px;padding:20px;border-radius:15px}
  .stat-top{font-size:12px}
  .stat-value{margin:14px 0 8px;font-size:27px}
  .stat-main .stat-value{font-size:28px}
  .stat-foot{font-size:11px}
  .dashboard-grid{gap:19px;margin-bottom:19px}
  .panel{border-radius:15px;box-shadow:var(--shadow)}
  .chart-panel,.dashboard-grid>.panel{min-height:250px;padding:23px}
  .panel-heading{gap:15px;margin-bottom:19px}
  .panel-heading h2{margin-bottom:6px}
  .panel-badge,.count-pill{padding:7px 10px;border-radius:8px;font-size:9px;letter-spacing:.4px}
  .chart{gap:16px}
  .chart-label{font-size:11px}
  .chart-label strong{font-size:11px}
  .bar-track{height:8px}
  .user-summary-list{gap:15px}
  .user-summary-item{gap:11px}
  .mini-avatar{flex-basis:36px;height:36px;border-radius:11px;font-size:10px}
  .summary-person strong{font-size:11px}
  .summary-person small{font-size:10px}
  .summary-amount{font-size:11px}
  .recent-panel{padding:22px 23px 7px}
  .table-wrap{border-radius:10px}
  table{white-space:nowrap}
  th{padding:13px 14px;border-bottom-color:#e5edf7;background:#f7faff;color:#5b6e86;font-size:9px;letter-spacing:.75px}
  td{padding:13px 14px;border-bottom-color:#edf1f6;color:#4d6078;font-size:11px;line-height:1.5}
  tbody tr{transition:background-color .16s}
  tbody tr:hover{background:#f9fbff}
  .table-primary{color:#304967}
  .amount-cell{color:#286db5}
  .action-button{min-height:32px;padding:7px 11px;border-radius:7px;font-size:10px}
  .empty-table{padding:34px 14px;color:#657890;font-size:12px}
  .empty-state{padding:30px 12px;font-size:12px}
  .split-layout{gap:19px}
  .form-panel,.table-panel{padding:23px}
  .form-panel{top:92px}
  .loan-summary-grid{gap:16px;margin-bottom:19px}
  .loan-summary-card{gap:10px;padding:21px 22px;border-radius:14px}
  .loan-summary-card span{font-size:11px}
  .loan-summary-card strong{font-size:21px}
  .form-icon{width:38px;height:38px;border-radius:11px}
  .data-form{gap:17px}
  .data-form label,.report-filters label{gap:8px;color:#405771;font-size:11px}
  .data-form input,.data-form select,.data-form textarea,.report-filters select{min-height:42px;padding:10px 12px;border-color:#dce5f0;border-radius:9px;background:#fff;color:#293f5d;font-size:12px}
  .data-form input::placeholder,.data-form textarea::placeholder{color:#78899e}
  .data-form input:focus,.data-form select:focus,.data-form textarea:focus,.report-filters select:focus{border-color:#78aee9;box-shadow:0 0 0 3px rgba(75,143,222,.12)}
  .data-form textarea{min-height:82px}
  .password-toggle{font-size:10px}
  .form-row{gap:13px}
  .payment-report-panel{margin-bottom:19px;padding:23px}
  .report-filters{gap:13px;margin-bottom:16px}
  .report-summary{gap:9px 18px;min-height:48px;margin-bottom:13px;padding:12px 14px;border:1px solid #e7eff9;border-radius:10px;font-size:11px}
  .report-summary>strong:first-child{font-size:12px}
  .report-summary .report-total{font-size:16px}
  .report-actions{margin-bottom:13px}
  .report-print-button{padding:10px 15px}
  .status-badge{padding:6px 10px;font-size:10px}
  .about-panel{padding:44px 36px;border-radius:18px}
  .about-mark{width:84px;height:84px}
  .about-title{font-size:25px}
  .about-description{font-size:13px}
  .footer{gap:8px;padding:26px 0 10px;font-size:10px}
  .footer-meta{gap:5px 17px}
  .dialog-card{padding:26px;border-radius:17px}
  .dialog-close{width:34px;height:34px;border-radius:9px}
  .toast{right:24px;bottom:24px;padding:14px 18px;border-radius:11px;font-size:13px}

  @media(max-width:1100px){
    .main-area{margin-left:260px}
    .content{padding-right:25px;padding-left:25px}
    .topbar{padding-right:25px;padding-left:25px}
    .split-layout{grid-template-columns:minmax(235px,.78fr) minmax(0,1.6fr)}
  }
  @media(max-width:900px){
    .main-area{margin-left:0}
    .topbar{height:68px;padding:0 22px}
    .content{padding:28px 22px 20px}
    .sidebar{z-index:20}
    .split-layout{grid-template-columns:minmax(0,1fr)}
    .loan-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
  }
  @media(max-width:600px){
    .topbar{min-height:62px;padding:9px 14px}
    .topbar-right{gap:7px}
    .content{padding:23px 14px 16px}
    .page-heading{gap:13px;margin-bottom:20px}
    .heading-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
    .heading-actions .button{width:100%;padding-right:10px;padding-left:10px}
    h1{font-size:24px}
    h2{font-size:14px}
    .muted{font-size:11px}
    .button{min-height:42px}
    .stat-grid{gap:10px;margin-bottom:13px}
    .stat-card{min-height:126px;padding:15px;border-radius:13px}
    .stat-top{font-size:10px}
    .stat-value,.stat-main .stat-value{font-size:21px}
    .stat-foot{font-size:9px}
    .dashboard-grid{gap:13px;margin-bottom:13px}
    .chart-panel,.dashboard-grid>.panel,.form-panel,.table-panel,.recent-panel,.payment-report-panel{padding:16px;border-radius:13px}
    .panel-heading{gap:9px;margin-bottom:15px}
    .panel-badge,.count-pill{padding:6px 8px;font-size:8px}
    .loan-summary-grid{grid-template-columns:1fr;gap:9px;margin-bottom:13px}
    .loan-summary-card{grid-template-columns:1fr auto;align-items:center;gap:4px 10px;padding:13px 15px}
    .loan-summary-card span{font-size:10px}
    .loan-summary-card strong{font-size:17px}
    .form-panel,.table-panel{padding:16px}
    .form-panel .data-form{gap:14px}
    .data-form label,.report-filters label{font-size:11px}
    .data-form input,.data-form select,.data-form textarea,.report-filters select{min-height:44px;font-size:13px}
    .data-form textarea{min-height:78px}
    .table-wrap tbody tr{margin-bottom:11px;padding:7px 13px;border-color:#e6edf5;border-radius:11px;box-shadow:0 4px 12px rgba(24,54,94,.035)}
    .table-wrap tbody td{grid-template-columns:minmax(100px,38%) minmax(0,1fr);gap:9px;padding:10px 0;font-size:11px}
    .table-wrap tbody td:before{font-size:9px}
    .action-button{min-height:36px;padding:8px 11px;font-size:10px}
    .report-summary{gap:8px 12px;padding:11px 12px}
    .report-summary .report-total{margin-left:0;font-size:15px}
    .about-panel{padding:32px 20px}
    .footer{padding-top:20px;font-size:9px}
    .toast{right:14px;bottom:14px}
  }
  @media(max-width:380px){
    .content{padding-right:11px;padding-left:11px}
    .heading-actions{grid-template-columns:1fr}
    .topbar{padding-right:11px;padding-left:11px}
    .stat-card{padding:12px}
    .table-wrap tbody tr{padding-right:10px;padding-left:10px}
    .table-wrap tbody td{grid-template-columns:minmax(86px,36%) minmax(0,1fr);gap:7px}
  }
  #view-payments .split-layout,
  #view-loans .split-layout,
  #view-members .split-layout,
  #view-users .split-layout,
  #view-schedules .split-layout{grid-template-columns:minmax(0,1fr)}
  .add-form-dialog .add-form-card{width:min(100%,560px);max-width:560px;max-height:calc(100vh - 40px);overflow-y:auto}
  @media(max-width:600px){
    .add-form-dialog .add-form-card{max-height:calc(100vh - 24px)}
    .payment-report-panel .report-panel-heading{align-items:flex-start}
    .payment-report-panel .report-panel-heading .form-icon{display:none}
    .payment-report-panel .report-filters{grid-template-columns:minmax(0,1fr);padding:12px}
    .payment-report-panel .report-actions .report-print-button{width:100%}
    .payment-report-panel .report-table-wrap{min-width:0;overflow-x:auto;overflow-y:hidden}
    .payment-report-panel .report-table-wrap table{display:table;width:auto;min-width:700px;max-width:none}
    #loan-report-panel .report-table-wrap table{min-width:940px}
    .report-table-wrap thead{display:table-header-group}
    .report-table-wrap tbody{display:table-row-group}
    .report-table-wrap tbody tr{display:table-row;margin:0;padding:0;border:0;border-radius:0;box-shadow:none}
    .report-table-wrap tbody td{display:table-cell;padding:10px 9px;border:1px solid #edf1f6}
    .report-table-wrap tbody td:before{content:none}
  }
a {
  color: #3788e8;
  text-decoration: none;
}
a:hover {
  color: #0c2348;
  text-decoration: underline;
}
.period-filter-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 20px;padding:12px 15px;border:1px solid #e3ebf5;border-radius:11px;background:#fff;box-shadow:var(--shadow)}
.period-filter-toolbar>div{display:flex;align-items:baseline;flex-wrap:wrap;gap:7px 12px;min-width:0}
.period-filter-toolbar strong{color:#405771;font-size:11px}
.period-filter-toolbar span{color:#60728a;font-size:11px}
.period-filter-card{max-width:520px}
.period-filter-card>.panel-heading{align-items:flex-start}
.period-filter-card .dialog-actions{margin-top:0}
@media(max-width:600px){
  .period-filter-toolbar{align-items:stretch;flex-direction:column;gap:10px;padding:13px}
  .period-filter-toolbar .button{width:100%}
  .period-filter-card .form-row{grid-template-columns:1fr}
}