/* AMARSVATI SMART ONE | Dashboard Keuangan V2 — clean presentation layer
 * Figma source: 966:1071 desktop, 966:1315 mobile, 971:1070 component.
 * CSS only. Existing financial-dashboard-ui.js / D1 / APIs and events unchanged.
 * Avoid global selectors so all other modules are unaffected.
 */
.pagebody:has(>.aso-fd){padding:26px;max-width:none;background:#eef7fb;container:finance-area / inline-size}
.aso-fd{--fd-ink:#0b304e;--fd-muted:#64809a;--fd-line:#dfebf1;--fd-forest:#07865f;--fd-blue:#075180;color:var(--fd-ink);background:#eef7fb;min-width:0;width:100%;padding:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}
.aso-fd *, .aso-fd *::before, .aso-fd *::after{box-sizing:border-box}
.aso-fd button,.aso-fd select{font:inherit}
.aso-fd button{cursor:pointer}
.aso-fd button:focus-visible,.aso-fd select:focus-visible{outline:3px solid #6ab5eb;outline-offset:2px}
.aso-fd .fd-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* Title from Figma 974:1079 */
.aso-fd .fd-header{min-height:112px;margin-bottom:17px;padding:19px 24px;border:1px solid #dcebe7;border-radius:18px;background:radial-gradient(circle at 105% -34%,rgba(255,255,255,.32) 0 132px,transparent 133px),radial-gradient(circle at 78% 125%,transparent 0 70px,rgba(139,212,189,.30) 71px 72px,transparent 73px),linear-gradient(116deg,#d9f3e8 0%,#e7f4f6 52%,#fff3e1 100%);display:flex;align-items:center;justify-content:space-between;gap:16px}
.aso-fd .fd-header small{display:block;margin-bottom:5px;font-size:10px;font-weight:800;color:#287b6c}
.aso-fd .fd-header h1{font-size:27px;font-weight:800;line-height:1.25;color:#15344d;margin:0 0 6px}
.aso-fd .fd-header p{margin:0;font-size:12px;line-height:1.5;color:#64809a}
.aso-fd .fd-head-actions{display:flex;align-items:center;gap:12px;min-width:0}
.aso-fd .fd-head-actions label{display:block;min-width:0}
.aso-fd .fd-head-actions select,.aso-fd .fd-head-actions button{appearance:none;height:42px;min-height:42px;padding:0 15px;border:1px solid #d5e9df;border-radius:10px;background:#f0f8f3;color:#176650;font-size:12px;font-weight:800}
.aso-fd .fd-head-actions select{min-width:170px;cursor:pointer}
.aso-fd .fd-head-actions button{min-width:125px}
.aso-fd .fd-head-actions button[aria-busy="true"]{opacity:.65;cursor:progress}
/* Top finance cards, Figma 966:1080 / 1090 / 1099 */
.aso-fd .fd-hero-grid{display:grid;grid-template-columns:1fr 1fr 1.035fr;gap:13px;margin-bottom:18px}
.aso-fd .fd-hero,.aso-fd .fd-panel{min-width:0;border-radius:17px}
.aso-fd .fd-hero{height:216px;padding:20px 18px 15px;color:#fff;display:flex;flex-direction:column;overflow:hidden}
.aso-fd .fd-managed{background:linear-gradient(125deg,#145276,#317fa0 52%,#145276)}
.aso-fd .fd-rt{background:linear-gradient(125deg,#136849,#38a17c 52%,#136849)}
.aso-fd .fd-hero>span{font-size:12px;font-weight:800;line-height:1.35}
.aso-fd .fd-hero>strong{font-size:clamp(20px,2vw,30px);font-weight:800;line-height:1.2;margin:16px 0 3px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.aso-fd .fd-hero>small{font-size:10px;color:#d8f2fa}
.aso-fd .fd-hero-split{margin-top:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.aso-fd .fd-hero-split>div{padding:8px 9px;min-width:0;min-height:56px;border-radius:9px;background:#ffffff25}
.aso-fd .fd-hero-split span{display:block;font-size:10px;color:#fff;margin-bottom:5px}
.aso-fd .fd-hero-split strong{font-size:clamp(10px,1vw,14px);font-weight:800;color:#bdffe2;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.aso-fd .fd-hero-split>div:last-child strong{color:#ffcfcd}
.aso-fd .fd-panel{background:#fff;border:1px solid var(--fd-line);padding:17px 18px}
.aso-fd .fd-panel>header{display:flex;align-items:start;justify-content:space-between;gap:12px;margin-bottom:18px}
.aso-fd .fd-panel h2{margin:0 0 6px;font-size:17px;font-weight:800;color:var(--fd-ink)}
.aso-fd .fd-panel header p{margin:0;font-size:11px;color:var(--fd-muted);line-height:1.5}
.aso-fd .fd-hero-grid>.fd-panel{height:216px;overflow:hidden}
.aso-fd .fd-bars{display:grid;gap:10px;max-height:133px;overflow:auto}
.aso-fd .fd-bar-row{display:grid;grid-template-columns:86px minmax(0,1fr);align-items:center;gap:8px}
.aso-fd .fd-bar-row span{font-size:11px;color:var(--fd-muted)}
.aso-fd .fd-bar-row b{display:none}
.aso-fd .fd-track{height:10px;background:#e8f0f5;border-radius:8px;overflow:hidden}
.aso-fd .fd-track i{display:block;height:100%;border-radius:8px}
/* Obligation and overdue row */
.aso-fd .fd-mid{display:grid;grid-template-columns:minmax(0,1.92fr) minmax(0,1fr);gap:13px;margin-bottom:18px}
.aso-fd .fd-mid>.fd-panel{height:300px;min-height:300px;overflow:hidden}
.aso-fd .fd-obligation{display:grid;grid-template-columns:132px minmax(0,1fr) minmax(0,1.1fr);gap:14px;align-items:center;padding:10px 6px}
.aso-fd .fd-donut{width:130px;height:130px;border-radius:50%;padding:19px;background:conic-gradient(#07865f calc(var(--val,0)*1%),#f76b63 0)}
.aso-fd .fd-donut>div{width:100%;height:100%;border-radius:50%;background:#fff;display:flex;align-items:center;justify-content:center;flex-direction:column}
.aso-fd .fd-donut strong{font-size:25px;font-weight:800;color:#07865f}
.aso-fd .fd-donut small{font-size:10px;color:var(--fd-muted)}
.aso-fd .fd-legend{display:grid;gap:12px;min-width:0}
.aso-fd .fd-legend>div{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--fd-muted)}
.aso-fd .fd-legend>div b{margin-left:auto;font-size:12px;color:var(--fd-ink);white-space:nowrap}
.aso-fd .fd-legend i{display:inline-block;flex:none;width:9px;height:9px;border-radius:3px}
.aso-fd .fd-legend i.fd-green{background:#07865f}
.aso-fd .fd-legend i.fd-red{background:#f76b63}
.aso-fd .fd-legend>small{font-size:10px;line-height:1.4;color:var(--fd-muted)}
.aso-fd .fd-obligation-totals{display:grid;gap:12px}
.aso-fd .fd-obligation-totals span{display:block;font-size:11px;color:var(--fd-muted)}
.aso-fd .fd-obligation-totals strong{display:block;margin-top:3px;font-size:16px;font-weight:800;color:var(--fd-ink);overflow-wrap:anywhere}
.aso-fd .fd-overdue-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.aso-fd .fd-mini{min-width:0;padding:12px;border-radius:10px;background:#f1f7fd}
.aso-fd .fd-mini>span{display:block;font-size:10px;line-height:1.5;color:var(--fd-muted)}
.aso-fd .fd-mini>strong{display:block;margin-top:13px;font-size:13px;font-weight:800;color:var(--fd-ink);overflow-wrap:anywhere}
.aso-fd .fd-panel h3{font-size:15px;font-weight:800;color:var(--fd-ink);margin:14px 0 11px}
.aso-fd .fd-counts{display:grid;gap:6px}
.aso-fd .fd-count-bar{display:grid;grid-template-columns:83px minmax(0,1fr) 66px;align-items:center;gap:7px;min-height:17px}
.aso-fd .fd-count-bar span,.aso-fd .fd-count-bar b{font-size:10px;color:var(--fd-muted)}
.aso-fd .fd-count-bar b{text-align:right;color:var(--fd-ink);white-space:nowrap}
.aso-fd .fd-count-bar .fd-track{height:9px}
.aso-fd .fd-count-bar .fd-track i{background:#07865f}
.aso-fd .fd-textlink{border:0;background:transparent;color:#008c59;font-size:11px;white-space:nowrap}
/* Six component cards follow the Figma 971:1070 anatomy */
.aso-fd .fd-panel:has(.fd-component-grid){margin-bottom:18px;min-height:530px;background:linear-gradient(125deg,#fafffc,#f0f9f5 54%,#eaf5ef);overflow-x:auto;scrollbar-width:thin}
.aso-fd .fd-component-grid{display:grid;grid-template-columns:repeat(6,minmax(225px,1fr));gap:7px;min-width:1385px}
.aso-fd .fd-component{--fd-accent:#1975ef;--fd-card:linear-gradient(125deg,#e5f1ff 0%,#f5faff 52%,#d4e8ff 100%);height:405px;min-width:0;position:relative;isolation:isolate;display:flex;flex-direction:column;overflow:hidden;border-radius:11px;background:var(--fd-card);padding:0 12px 14px}
.aso-fd .fd-component::before{content:"";position:absolute;top:0;left:0;right:0;height:6px;background:var(--fd-accent);z-index:2}
.aso-fd .fd-component::after{content:"";position:absolute;pointer-events:none;width:158px;height:158px;right:-55px;top:-66px;border-radius:50%;background:rgba(255,255,255,.35);box-shadow:-15px 118px 0 -29px rgba(255,255,255,.17);z-index:-1}
.aso-fd .fd-component-pkk{--fd-accent:#e52882;--fd-card:linear-gradient(125deg,#fbe6ef,#fffafc,#f4d9e5)}
.aso-fd .fd-component-rukem{--fd-accent:#f68b18;--fd-card:linear-gradient(125deg,#e6f7ec,#f7fcf8 54%,#d8f1e4)}
.aso-fd .fd-component-keamanan{--fd-accent:#08a56d;--fd-card:linear-gradient(125deg,#e0f5ea,#f8fdf9,#cfebdd)}
.aso-fd .fd-component-air{--fd-accent:#079be8;--fd-card:linear-gradient(125deg,#e0f4fc,#f8fdff,#d2eef8)}
.aso-fd .fd-component-sampah{--fd-accent:#9349e5;--fd-card:linear-gradient(125deg,#fff0d8,#fffbf1 54%,#ffe3c1)}
.aso-fd .fd-component-head{display:flex;align-items:center;gap:9px;height:70px;min-height:70px;padding-top:17px;border-bottom:1px solid #dce9f1;position:relative;z-index:1}
.aso-fd .fd-component-icon{display:grid;place-items:center;width:32px;height:32px;flex:none;border-radius:9px;background:var(--fd-accent);color:#fff;font-size:18px}
.aso-fd .fd-component-head h3{font-size:13px;font-weight:800;line-height:1.2;margin:0;overflow-wrap:anywhere}
.aso-fd .fd-component-lines{margin-top:10px;display:grid;gap:0}
.aso-fd .fd-component-line{display:grid;grid-template-columns:minmax(0,1.04fr) minmax(0,1fr);align-items:center;gap:4px;min-height:32px;font-size:9px;position:relative;z-index:1}
.aso-fd .fd-component-line span{font-size:9px;color:#55758e;overflow-wrap:anywhere}
.aso-fd .fd-component-line b{font-size:10px;font-weight:800;color:#0b304e;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.aso-fd .fd-component-line.fd-incoming b{color:#008c59}
.aso-fd .fd-component-line.fd-opening b,.aso-fd .fd-component-line b.fd-negative{color:#d83d46}
.aso-fd .fd-component-line.fd-outgoing b{color:#d57a00}
.aso-fd .fd-component-foot{margin-top:auto}
.aso-fd .fd-component-saldo{height:68px;padding:8px;border-radius:9px;border:1px solid #d7e5f0;background:color-mix(in srgb,var(--fd-accent) 6%,white);margin-bottom:10px}
.aso-fd .fd-component-saldo span{display:block;font-size:11px;color:var(--fd-ink)}
.aso-fd .fd-component-saldo strong{display:block;margin-top:5px;font-size:16px;font-weight:800;line-height:1.25;white-space:nowrap;color:var(--fd-ink)}
.aso-fd .fd-component-saldo strong.fd-negative{color:#d83d46}
.aso-fd .fd-component-progress{display:grid;grid-template-columns:minmax(0,1fr) 34px;align-items:center;gap:4px}
.aso-fd .fd-component-progress .fd-component-track{height:7px;border-radius:7px;background:#dce9f7;overflow:hidden}
.aso-fd .fd-component-progress .fd-component-track i{display:block;height:100%;background:var(--fd-accent);border-radius:7px}
.aso-fd .fd-component-progress b{font-size:10px;color:var(--fd-accent);text-align:right}
/* Titipan & Talangan */
.aso-fd .fd-panel:has(.fd-split){min-height:300px;margin-bottom:18px;background:linear-gradient(125deg,#fafffc,#f0f9f5 54%,#eaf5ef)}
.aso-fd .fd-split{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.aso-fd .fd-split h3{margin:3px 0 15px}
.aso-fd .fd-three{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.aso-fd .fd-four{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.aso-fd .fd-three .fd-mini,.aso-fd .fd-four .fd-mini{min-height:122px;padding:13px 9px}
.aso-fd .fd-three .fd-mini:last-child{background:#e6faed}
.aso-fd .fd-status{display:inline-block;background:#e6faed;color:#07865f;border-radius:11px;padding:9px 12px;font-size:12px;font-weight:800}
/* Debt table and detail */
.aso-fd .fd-panel:has(.fd-debt-table){min-height:470px;background:#fff}
.aso-fd .fd-debt-table{max-width:100%;overflow-x:auto}
.aso-fd .fd-debt-table table{width:100%;min-width:850px;border-collapse:collapse}
.aso-fd .fd-debt-table th{background:#f1f7fd;padding:13px 10px;text-align:left;color:#64809a;font-size:11px}
.aso-fd .fd-debt-table td{height:56px;padding:13px 10px;color:var(--fd-ink);font-size:11px;border-bottom:1px solid var(--fd-line)}
.aso-fd .fd-debt-table td:nth-child(2),.aso-fd .fd-debt-table td:nth-child(5){font-weight:800}
.aso-fd .fd-debt-table button{border:0;background:transparent;color:#008c59;font-size:11px;white-space:nowrap}
.aso-fd .fd-empty{text-align:center!important;color:#64809a!important;padding:28px!important}
.aso-fd .fd-last{margin-top:12px;font-size:10px;color:#64809a}
.aso-fd .fd-error,.aso-fd .fd-loading{margin-bottom:14px;padding:14px;border-radius:10px;font-size:12px}
.aso-fd .fd-error{border:1px solid #f5b5a3;background:#fff4f1;color:#9d4029}
.aso-fd .fd-loading{background:#fff;color:#64809a}
.aso-fd .fd-detail-page{min-height:500px;background:#fff;border-radius:16px;padding:24px}
.aso-fd .fd-detail-page>button:first-child{border:0;background:transparent;color:#1766a8;margin-bottom:25px}
.aso-fd .fd-detail-page header small{color:#2d7fd3;font-weight:800}
.aso-fd .fd-detail-page h1{font-size:25px;color:#15344d}
.aso-fd .fd-detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin:22px 0}
.aso-fd .fd-detail-grid>div{background:#f1f7fd;border-radius:10px;padding:16px}
.aso-fd .fd-detail-grid span{display:block;font-size:11px;color:#64809a;margin-bottom:7px}
.aso-fd .fd-detail-grid strong{font-size:14px;color:#0b304e}
.aso-fd .fd-btn{background:#075180;border:0;border-radius:10px;padding:11px 18px;color:#fff}
/* Intermediate layouts: respect available panel width with sidebar */
@container finance-area (max-width:1270px){
 .aso-fd .fd-hero-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .aso-fd .fd-hero-grid>.fd-panel{grid-column:1/-1;height:auto;min-height:180px}
 .aso-fd .fd-panel:has(.fd-component-grid){min-height:0}
 .aso-fd .fd-four{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@container finance-area (max-width:920px){
 .aso-fd .fd-hero-grid,.aso-fd .fd-mid,.aso-fd .fd-split{grid-template-columns:1fr}
 .aso-fd .fd-hero-grid>.fd-panel{grid-column:auto;min-height:216px}
 .aso-fd .fd-mid>.fd-panel{height:auto;min-height:300px;overflow:visible}
 .aso-fd .fd-obligation{grid-template-columns:130px minmax(0,1fr)}
 .aso-fd .fd-obligation-totals{grid-column:1/-1;grid-template-columns:repeat(3,minmax(0,1fr))}
 .aso-fd .fd-three,.aso-fd .fd-four{grid-template-columns:repeat(2,minmax(0,1fr))}
}
/* Figma mobile 390px: stacked 216px heroes, 240px saldo, 510px obligation;
 * individual 248px component cards, 2-column mini fund metrics. */
@media(max-width:760px){
 .pagebody:has(>.aso-fd){padding:12px}
 .aso-fd{padding:0}
 .aso-fd .fd-header{min-height:150px;align-items:flex-start;flex-direction:column;padding:17px 16px;gap:12px}
 .aso-fd .fd-header h1{font-size:24px}
 .aso-fd .fd-header p{font-size:11px}
 .aso-fd .fd-head-actions{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .aso-fd .fd-head-actions label,.aso-fd .fd-head-actions select,.aso-fd .fd-head-actions button{width:100%;min-width:0}
 .aso-fd .fd-hero-grid,.aso-fd .fd-mid,.aso-fd .fd-split{grid-template-columns:1fr}
 .aso-fd .fd-hero-grid{gap:14px}
 .aso-fd .fd-hero{height:216px}
 .aso-fd .fd-hero>strong{font-size:29px}
 .aso-fd .fd-hero-split strong{font-size:12px}
 .aso-fd .fd-hero-grid>.fd-panel{height:240px;min-height:240px}
 .aso-fd .fd-mid>.fd-panel{height:auto;min-height:0;overflow:visible}
 .aso-fd .fd-mid>.fd-panel:first-child{min-height:510px}
 .aso-fd .fd-mid>.fd-panel:last-child{min-height:490px}
 .aso-fd .fd-obligation{display:flex;flex-direction:column;align-items:stretch;gap:17px}
 .aso-fd .fd-donut{align-self:center;margin:5px 0 6px}
 .aso-fd .fd-legend{width:100%;max-width:none}
 .aso-fd .fd-obligation-totals{grid-template-columns:1fr;gap:10px}
 .aso-fd .fd-panel:has(.fd-component-grid){overflow-x:visible}
 .aso-fd .fd-component-grid{grid-template-columns:1fr;min-width:0;width:100%;gap:10px}
 .aso-fd .fd-component{height:248px;min-height:248px;padding:0 12px 10px}
 .aso-fd .fd-component-head{height:63px;min-height:63px;padding-top:13px}
 .aso-fd .fd-component-line{min-height:17px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);line-height:1.15}
 .aso-fd .fd-component-line span{font-size:10px}
 .aso-fd .fd-component-line b{font-size:11px}
 .aso-fd .fd-component-lines{margin-top:8px;gap:0;min-height:0}
 .aso-fd .fd-component-saldo{height:49px;min-height:49px;border:0;padding:5px 8px;margin-bottom:0}
 .aso-fd .fd-component-saldo span{font-size:10px}
 .aso-fd .fd-component-saldo strong{font-size:17px;margin-top:0}
 .aso-fd .fd-component-progress{margin-top:1px;position:relative}
 .aso-fd .fd-three,.aso-fd .fd-four{grid-template-columns:repeat(2,minmax(0,1fr))}
 .aso-fd .fd-three .fd-mini,.aso-fd .fd-four .fd-mini{min-height:87px;padding:11px;display:flex;flex-direction:column;justify-content:space-between;overflow:hidden}
 .aso-fd .fd-split{gap:28px}
 .aso-fd .fd-panel:has(.fd-component-grid),.aso-fd .fd-panel:has(.fd-split){min-height:0}
 .aso-fd .fd-panel:has(.fd-debt-table){min-height:500px}
 .aso-fd .fd-detail-grid{grid-template-columns:1fr}
}
@media(max-width:390px){
 .aso-fd .fd-component{min-width:0}
 .aso-fd .fd-hero>strong{font-size:25px}
 .aso-fd .fd-mini>strong{font-size:12px}
}
