*{box-sizing:border-box}body{margin:0;background:#f4f6fb;color:#172033;font:15px/1.5 Inter,system-ui,Segoe UI,Arial}.shell{max-width:1200px;margin:auto;padding:28px}header{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px}h1{font-size:30px;margin:2px 0}h2{font-size:19px;margin:0 0 8px}h3{font-size:16px}.eyebrow{font-size:11px;letter-spacing:2px;color:#64748b;font-weight:700}p{color:#64748b;margin:4px 0 14px}.head-actions,.actions,.inline,.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.pill{background:#e0f2fe;color:#075985;border-radius:20px;padding:6px 12px;font-size:12px}.tabs{display:flex;gap:7px;flex-wrap:wrap;margin:20px 0 14px}.tabs button{background:#e8edf5;color:#42506a}.tabs button.active{background:#173b72;color:white}.toolbar{justify-content:space-between;margin:12px 0 18px}.panel{background:white;border:1px solid #e7ebf2;border-radius:16px;padding:22px;margin:16px 0;box-shadow:0 5px 18px #16233b08}.auth{max-width:680px;margin:55px auto}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:13px}.metric{background:#fff;border:1px solid #e7ebf2;border-radius:15px;padding:19px}.metric span,.metric small{display:block;color:#64748b}.metric strong{display:block;font-size:26px;margin:7px 0}.grid{display:grid;gap:14px}.two{grid-template-columns:repeat(2,1fr)}.three{grid-template-columns:repeat(3,1fr)}.four{grid-template-columns:repeat(4,1fr)}label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600;color:#475569;margin:5px 0}input,select{width:100%;padding:11px 12px;border:1px solid #d9e0ea;border-radius:9px;background:#fff;color:#172033;font:inherit;min-width:0}button{border:0;border-radius:9px;padding:11px 16px;background:#1d4ed8;color:white;font-weight:650;cursor:pointer}button:hover{filter:brightness(.96)}button.secondary{background:#e8eef9;color:#21416f}button.ghost{background:transparent;color:#475569;border:1px solid #d9e0ea}.small{padding:8px 10px;font-size:12px;white-space:nowrap}.inline select{flex:1}.muted{color:#64748b;font-size:13px}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;min-width:680px}th,td{text-align:left;padding:11px 10px;border-bottom:1px solid #edf0f5;font-size:13px}th{color:#64748b;font-weight:650;background:#fafbfc}.status{padding:4px 8px;border-radius:20px;background:#fff7ed;color:#9a3412}.status.done{background:#dcfce7;color:#166534}canvas{max-width:100%}footer{text-align:center;color:#94a3b8;padding:25px;font-size:12px}@media(max-width:800px){.shell{padding:15px}.cards{grid-template-columns:repeat(2,1fr)}.four,.three{grid-template-columns:repeat(2,1fr)}header{align-items:flex-start;gap:12px;flex-direction:column}}@media(max-width:480px){.two,.three,.four{grid-template-columns:1fr}.metric strong{font-size:21px}.panel{padding:15px}}
button.danger{background:#fff0f0;color:#a12626;border:1px solid #efcaca}button.danger:hover{background:#ffe1e1}

.manage-row{padding:10px 0;border-bottom:1px solid #e7edf5}.submanage{display:flex;gap:10px;flex-wrap:wrap;margin-top:8px}.submanage span{display:inline-flex;align-items:center;gap:6px;background:#f3f6fa;padding:5px 8px;border-radius:8px}

/* Compact, professional category management */
.category-toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;color:#64748b;font-size:12px;margin:14px 0}.category-toolbar span:first-child{font-weight:700;color:#1e3a5f}.category-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.category-card{border:1px solid #e6ebf2;border-radius:12px;background:#fff;overflow:hidden}.category-card summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:10px;padding:13px 14px}.category-card summary::-webkit-details-marker{display:none}.category-name{font-weight:700;color:#24364b;flex:1}.category-count{font-size:11px;color:#718096;background:#f2f5f9;border-radius:20px;padding:4px 8px;white-space:nowrap}.category-chevron{color:#64748b;font-size:17px}.category-card[open] .category-chevron{transform:rotate(180deg)}.category-card-body{border-top:1px solid #edf1f5;padding:12px 14px}.submanage{display:flex;gap:7px;flex-wrap:wrap;margin:0 0 12px}.sub-chip{display:inline-flex;align-items:center;gap:7px;background:#f5f7fa;border:1px solid #edf0f4;border-radius:7px;padding:5px 8px;font-size:12px;color:#334155}.chip-delete{padding:0!important;width:18px;height:18px;border-radius:5px;background:#fff0f0!important;color:#a12626!important;border:1px solid #efcaca!important;font-size:12px;line-height:1}.category-delete{margin-top:2px}.compact-chart{height:190px;max-width:520px;margin:8px auto 18px;position:relative}.compact-chart canvas{width:100%!important;height:100%!important}@media(max-width:700px){.category-grid{grid-template-columns:1fr}.category-toolbar{align-items:flex-start;flex-direction:column}.compact-chart{height:175px}}

.section-head{display:flex;justify-content:space-between;align-items:end;gap:18px;flex-wrap:wrap}.date-filter{min-width:190px;margin:0}.compact-summary{height:175px;max-width:440px;margin:10px 0 0}.tabs button{font-size:13px}.status.overdue{background:#fee2e2;color:#991b1b}
/* Dashboard date filters and refined charts */
.chart-frame{height:285px;position:relative;margin-top:10px}.chart-frame canvas{width:100%!important;height:100%!important}.section-head .date-filter{min-width:205px}.section-head .date-filter select{background:#f8fafc;border-color:#d8e1ed;font-weight:600}.section-head p{margin-bottom:0}.panel .grid.two{max-width:520px;margin:10px 0}.panel .grid.two label{margin:0}@media(max-width:700px){.chart-frame{height:230px}.section-head .date-filter{width:100%}}

/* Udhaar date filters */
.filter-bar{display:flex;gap:10px;align-items:end;flex-wrap:wrap}.filter-bar label{min-width:135px;font-size:12px;color:#52627a}.filter-bar input,.filter-bar select{display:block;margin-top:5px;min-width:135px}.section-head{display:flex;justify-content:space-between;align-items:end;gap:14px;flex-wrap:wrap;margin-bottom:12px}.section-head h2,.section-head h3{margin-bottom:4px}.section-head p{margin:0}@media(max-width:700px){.filter-bar{width:100%}.filter-bar label,.filter-bar input,.filter-bar select{flex:1;min-width:120px}}

.date-filter-row{display:flex;gap:10px;align-items:end;flex-wrap:wrap}.date-filter-row label{font-size:12px;color:var(--muted);display:flex;flex-direction:column;gap:5px;min-width:130px}.date-filter-row select,.date-filter-row input{padding:9px 10px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--ink)}@media(max-width:700px){.date-filter-row{width:100%}.date-filter-row label{flex:1;min-width:110px}}

/* Visible independent date filters for both Udhaar tables */
.date-filter-row{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin:8px 0 12px}
.date-filter-row label{display:flex;flex-direction:column;gap:5px;min-width:145px;margin:0;font-size:12px;color:#52627a;font-weight:650}
.date-filter-row select,.date-filter-row input{width:100%;padding:9px 11px;border:1px solid #d9e0ea;border-radius:9px;background:#f9fbfe;color:#172033;font:inherit}
.repayment-history{margin-top:18px;padding-top:16px;border-top:1px solid #e8edf4}
@media(max-width:700px){.date-filter-row{width:100%}.date-filter-row label{flex:1;min-width:125px}}
