/* Advance payments: reference dashboard, scoped to this page. */
#paymentValuesView { --pv-ink:#161651; --pv-muted:#808aba; --pv-blue:#0866ff; font-family:'IBM Plex Sans Arabic',sans-serif; color:var(--pv-ink); background:linear-gradient(135deg,#f2f8ff,#edf5ff) !important; }
#paymentValuesView *, #paymentValuesView *::before, #paymentValuesView *::after { box-sizing:border-box; }
#paymentValuesView .pv-symbols { position:absolute; width:0; height:0; overflow:hidden; }
#paymentValuesView .pv-icon { display:block; flex-shrink:0; width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#paymentValuesView .pv-shell { display:grid; gap:8px; min-width:0; padding:0 6px 6px; }
#paymentValuesView .pv-header { display:flex; align-items:center; justify-content:space-between; }
#paymentValuesView .pv-header h2 { display:flex; align-items:center; gap:8px; margin:0; color:var(--pv-ink); font-size:1.25rem; line-height:1.2; font-weight:700; }
#paymentValuesView .pv-header .pv-icon { color:var(--pv-blue); }
#paymentValuesView .pv-header p { margin:2px 0 0; color:var(--pv-muted); font-size:.6rem; line-height:1.2; }
#paymentValuesView .payment-values-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:0; }
#paymentValuesView .payment-kpi-card { --pv-tone:#ff7c23; --pv-tint:#fff0df; display:grid; position:relative; isolation:isolate; min-width:0; min-height:84px; align-content:center; gap:0; padding:10px 14px 14px 72px; overflow:hidden; border:1px solid #e9f1ff; border-radius:8px; background:#fff; box-shadow:0 4px 16px #3876d00a; animation:none; }
#paymentValuesView .payment-kpi-card::before { content:''; position:absolute; z-index:-1; left:40px; bottom:9px; width:150px; height:46px; background:linear-gradient(0deg,transparent,var(--pv-tint)); clip-path:polygon(0 100%,6% 95%,12% 80%,20% 49%,27% 37%,34% 43%,39% 52%,45% 46%,52% 12%,59% 4%,66% 19%,72% 47%,81% 76%,88% 84%,100% 98%); }
#paymentValuesView .payment-kpi-deducted { --pv-tone:#0bb483; --pv-tint:#d7f4e8; }
#paymentValuesView .payment-kpi-remaining { --pv-tone:#0866ff; --pv-tint:#dceaff; }
#paymentValuesView .payment-kpi-count { --pv-tone:#813cff; --pv-tint:#ede0ff; }
#paymentValuesView .payment-kpi-icon { position:absolute; left:13px; top:12px; display:grid; place-items:center; width:56px; height:56px; border-radius:50%; background:var(--pv-tint); color:var(--pv-tone); font-size:1.4rem; }
#paymentValuesView .payment-kpi-icon .pv-icon { width:26px; height:26px; }
#paymentValuesView .payment-kpi-card { grid-template-columns:minmax(0,1fr); }
#paymentValuesView .payment-kpi-label { grid-column:auto; font-size:.74rem; font-weight:600; color:var(--pv-ink); white-space:normal; }
#paymentValuesView .payment-kpi-card strong { grid-column:auto; color:var(--pv-ink); font-size:1.35rem; font-weight:700; line-height:1.5; direction:ltr; text-align:right; font-variant-numeric:tabular-nums; }
#paymentValuesView .payment-kpi-card small { grid-column:auto; color:var(--pv-muted); font-size:.63rem; line-height:1.5; }
#paymentValuesView .pv-kpi-ratio { position:absolute; bottom:6px; left:14px; color:var(--pv-tone); background:var(--pv-tint); border-radius:20px; padding:1px 9px; font-size:.63rem; line-height:1.4; direction:ltr; font-weight:600; }
#paymentValuesView .pv-register { position:relative; min-width:0; padding:6px 4px 4px; border:1px solid #e9f1ff; border-radius:9px; background:#ffffffee; box-shadow:0 3px 12px #4275c506; }
#paymentValuesView .payment-section-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:0 3px 4px; }
#paymentValuesView .pv-section-title { display:flex; align-items:center; gap:8px; min-width:0; }
#paymentValuesView .pv-section-title>.pv-icon { color:var(--pv-blue); width:23px; height:23px; }
#paymentValuesView .payment-section-heading h3 { margin:0; color:var(--pv-ink); font-weight:700; font-size:.8rem; line-height:1.3; }
#paymentValuesView .payment-section-heading p { margin:3px 0 0; color:var(--pv-muted); font-size:.61rem; line-height:1.5; }
#paymentValuesView .pv-search { display:flex; align-items:center; gap:6px; flex:0 1 205px; min-width:150px; padding:4px 8px; border:1px solid #dce8fc; border-radius:5px; color:var(--pv-muted); background:#fff; }
#paymentValuesView .pv-search .pv-icon { width:14px; height:14px; }
#paymentValuesView .pv-search input { min-width:0; width:100%; padding:0; border:0; outline:0; background:transparent; color:var(--pv-ink); font:inherit; font-size:.66rem; }
#paymentValuesView .pv-search:focus-within { outline:2px solid #0866ff44; outline-offset:2px; }
#paymentValuesView .pv-search input::placeholder { color:var(--pv-muted); }
#paymentValuesView .data-table-wrapper { min-width:0; max-height:410px !important; margin:0 !important; border:1px solid #e0edff !important; border-radius:5px !important; overflow:auto !important; box-shadow:none !important; }
#paymentValuesView table.data-table.payment-values-table { width:100%; min-width:840px; margin:0; table-layout:fixed; border-collapse:collapse; }
#paymentValuesView table.data-table.payment-values-table thead th { height:32px; padding:4px 7px !important; border:1px solid #e0ecfc !important; background:linear-gradient(110deg,#eaf4ff,#e7f1ff) !important; color:var(--pv-ink) !important; font-size:.64rem !important; line-height:1.3 !important; font-weight:600 !important; text-align:center; white-space:normal; }
#paymentValuesView table.data-table.payment-values-table th small { display:block; color:var(--pv-muted); font-size:.55rem; font-weight:500; }
#paymentValuesView table.data-table.payment-values-table tbody td { height:26px; padding:4px 7px !important; border:1px solid #e8effb !important; color:#37396d; font-size:.64rem !important; line-height:1.5; text-align:center; overflow-wrap:anywhere; }
#paymentValuesView table.data-table.payment-values-table tbody td strong { font-weight:500; }
#paymentValuesView table.data-table.payment-values-table tbody tr:nth-child(even) td { background:#f5f9ff; }
#paymentValuesView table.data-table.payment-values-table tbody tr:hover td { background:#edf5ff !important; }





#paymentValuesView table.data-table.payment-values-table tfoot td { padding:6px !important; background:#e8f3ff !important; border:1px solid #deebfd !important; color:var(--pv-blue); font-size:.88rem; text-align:center; font-weight:700; direction:ltr; }
#paymentValuesView table.data-table.payment-values-table tfoot td.pv-total-label { direction:rtl; text-align:right; color:var(--pv-ink); font-size:.76rem; }
#paymentValuesView #tblPaymentValueHistory { min-width:900px; }




#paymentValuesView .payment-history-kind { padding:1px 12px; font-size:.65rem; line-height:1.6; font-weight:500; background:#fff0de; color:#ef8a33; }
#paymentValuesView .payment-history-kind.is-create { background:#def8ed; color:#0ba77b; }
#paymentValuesView .payment-transaction-amount { color:#37396d !important; font-weight:500; }
#paymentValuesView .payment-values-overdrawn { color:#df465d !important; }
#paymentValuesView [id^=pagination-]:empty { display:none; }
#paymentValuesView [id^=pagination-] { margin-top:5px; }
#paymentValuesView .table-date-sort { margin:0 0 5px; padding:0 4px; justify-content:flex-end; font-size:.65rem; }
#paymentValuesView .table-date-sort select { min-height:27px; padding:2px 6px; font-size:.64rem; }
#paymentValuesView .table-date-sort select[aria-label="عمود التاريخ للترتيب"] { display:none; }
#paymentValuesView .payment-values-charts { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,.9fr) minmax(0,1.3fr); gap:10px; min-width:0; }
#paymentValuesView .payment-chart-card { position:relative; min-width:0; margin:0; padding:10px 10px 5px; border:1px solid #e5efff; border-radius:9px; background:#ffffffed; box-shadow:0 4px 14px #3978d00a; animation:none; }
#paymentValuesView .payment-chart-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
#paymentValuesView .payment-chart-heading h3 { margin:0; color:var(--pv-ink); font-size:.86rem; line-height:1.5; font-weight:700; }
#paymentValuesView .payment-chart-heading p { margin:3px 0 0; color:var(--pv-muted); font-size:.6rem; line-height:1.5; }
#paymentValuesView .payment-chart-heading>span { display:grid; flex:0 0 32px; place-items:center; width:32px; height:32px; border-radius:7px; background:#e7f2ff; color:var(--pv-blue); }
#paymentValuesView .payment-chart-heading .pv-icon { width:20px; height:20px; }
#paymentValuesView .pv-chart-body { position:relative; height:160px; min-width:0; margin-top:7px; }
#paymentValuesView .pv-chart-body canvas { display:block; width:100% !important; height:100% !important; }
#paymentValuesView .pv-chart-empty { position:absolute; top:47%; inset-inline:15px; margin:0; padding:8px; border-radius:6px; background:#ffffffea; color:var(--pv-muted); font-size:.75rem; text-align:center; }
#paymentValuesView .pv-chart-empty[hidden], #paymentValuesView .pv-chart-note[hidden] { display:none; }
#paymentValuesView .pv-chart-note { margin:4px 0; font-size:.7rem; color:#d3485c; }
#paymentValuesView .pv-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media (min-width:1500px) { #paymentValuesView .pv-chart-body { height:260px; } #paymentValuesView table.data-table.payment-values-table tbody td { padding:8px !important; font-size:.8rem !important; } }
@media (max-width:1100px) { #paymentValuesView .payment-kpi-card { padding-inline-start:10px; padding-inline-end:65px; } #paymentValuesView .payment-kpi-label { font-size:.66rem; } #paymentValuesView .payment-kpi-card strong { font-size:1.2rem; } #paymentValuesView .payment-kpi-icon { left:8px; width:48px; height:48px; } }
@media (max-width:850px) { #paymentValuesView .payment-values-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } #paymentValuesView .payment-values-charts { grid-template-columns:repeat(2,minmax(0,1fr)); } #paymentValuesView .pv-projects-card { grid-column:1/-1; } }
@media (max-width:560px) { #paymentValuesView .pv-shell { padding:10px 6px; gap:12px; } #paymentValuesView .pv-header h2 { font-size:1.2rem; } #paymentValuesView .payment-kpi-card { min-height:103px; padding-inline-end:52px; } #paymentValuesView .payment-kpi-icon { width:36px; height:36px; top:17px; } #paymentValuesView .payment-kpi-icon .pv-icon { width:22px; height:22px; } #paymentValuesView .payment-kpi-card strong { font-size:1.15rem; } #paymentValuesView .payment-kpi-card small { font-size:.59rem; } #paymentValuesView .payment-section-heading { flex-wrap:wrap; gap:8px; } #paymentValuesView .pv-search { flex:1 1 100%; padding:7px; } #paymentValuesView .pv-search input { font-size:.76rem; } #paymentValuesView .payment-values-charts { grid-template-columns:minmax(0,1fr); } #paymentValuesView .pv-projects-card { grid-column:auto; } #paymentValuesView .pv-chart-body { height:245px; } #paymentValuesView table.data-table.payment-values-table tbody td { font-size:.78rem !important; padding:7px !important; } }
@media print { #paymentValuesView .pv-search, #paymentValuesView [id^=pagination-] { display:none; } #paymentValuesView .pv-register, #paymentValuesView .payment-chart-card { break-inside:avoid; } }

/* Compact reference rhythm; keep ordering controls available in the heading. */
#paymentValuesView .payment-kpi-card strong, #paymentValuesView .payment-kpi-card small { margin:0; }
#paymentValuesView .payment-kpi-card strong { line-height:1.25; }
#paymentValuesView .pv-register>.table-date-sort { position:absolute; top:8px; left:8px; margin:0; }
#paymentValuesView .payment-values-charts { margin-bottom:0; }
#paymentValuesView table.data-table.payment-values-table tbody td { white-space:normal; }
@media (max-width:560px) { #paymentValuesView .pv-register>.table-date-sort { position:static; margin:4px 0; } }
#paymentValuesView .payment-kpi-deducted .payment-kpi-label, #paymentValuesView .payment-kpi-count .payment-kpi-label { color:var(--pv-tone); }
#paymentValuesView .payment-kpi-card::before { clip-path:none; mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 46'%3E%3Cpath fill='black' d='M0 46C15 46 20 12 33 16S49 38 62 13 83 1 97 21 120 40 150 46Z'/%3E%3C/svg%3E"); mask-size:100% 100%; mask-repeat:no-repeat; }
#paymentValuesView table.data-table.payment-values-table th small { line-height:1.2; }
#paymentValuesView #tblPaymentValueHistory tbody td { height:23px; padding:3px 7px !important; font-size:.62rem !important; line-height:1.35; }
#paymentValuesView .payment-chart-heading p { font-size:.55rem; line-height:1.35; }
@media (max-width:560px) { #paymentValuesView #tblPaymentValueHistory tbody td { height:32px; padding:6px !important; font-size:.75rem !important; } }
#paymentValuesView .pv-register[aria-labelledby="pvHistoryTitle"] .payment-section-heading { margin-bottom:2px; }
#paymentValuesView .pv-register[aria-labelledby="pvHistoryTitle"] .payment-section-heading p { font-size:.55rem; line-height:1.2; margin-top:1px; }
#paymentValuesView .payment-history-kind { line-height:1.3; }

/* Readable dashboard register styling for both advance-payment tables. */
#paymentValuesView .pv-register{padding:14px;border-color:#e5efff;border-radius:12px}
#paymentValuesView .payment-section-heading{margin:0 0 16px;gap:16px}
#paymentValuesView .payment-section-heading h3{font-size:20px;line-height:1.6;color:#182540}
#paymentValuesView .pv-register .payment-section-heading p{font-size:13px;line-height:1.8;margin-top:4px}
#paymentValuesView .pv-search{padding:8px 10px;border-radius:7px;flex-basis:260px}
#paymentValuesView .pv-search input{font-size:14px}
#paymentValuesView .data-table-wrapper{border-color:#dbeaff!important;border-radius:7px!important;scrollbar-width:thin;scrollbar-color:#bdd4fa #f3f8ff}
#paymentValuesView table.data-table.payment-values-table{min-width:1300px;table-layout:fixed;border-collapse:separate;border-spacing:0}
#paymentValuesView table.data-table.payment-values-table thead th{height:auto;padding:7px 8px!important;font-size:14px!important;font-weight:400!important;line-height:1.7!important;background:linear-gradient(100deg,#e5f2ff,#dfedff)!important;color:#1031a3!important;border-color:#e1ecff!important;position:sticky;top:0;z-index:4}
#paymentValuesView table.data-table.payment-values-table th small{font-size:12px;line-height:1.5}
#paymentValuesView table.data-table.payment-values-table tbody td,
#paymentValuesView #tblPaymentValueHistory tbody td{height:auto;padding:7px 8px!important;font-size:16px!important;font-weight:400;line-height:1.7;background:#fff;color:#21399b;border-color:#e1ecff!important}
#paymentValuesView table.data-table.payment-values-table tbody tr:nth-child(even) td{background:#f7fbff}
#paymentValuesView table.data-table.payment-values-table tbody tr:hover td{background:#eaf3ff!important}
#paymentValuesView table.data-table.payment-values-table tbody td{transition:background .18s ease;font-variant-numeric:tabular-nums}
#paymentValuesView #tblPaymentValueHistory{min-width:1500px}
#paymentValuesView .payment-history-kind{font-size:14px;line-height:1.7;padding:3px 12px;border-radius:20px}
#paymentValuesView table.data-table.payment-values-table thead th:first-child{z-index:6}
#paymentValuesView .pv-totals-bar{display:grid;grid-template-columns:1fr repeat(4,1.3fr);align-items:center;gap:16px;border-radius:9px;margin:12px 0;background:linear-gradient(100deg,#fff5e7,#f4f8ff 45%,#eff4ff);padding:14px 18px}
#paymentValuesView .pv-totals-bar>strong{display:flex;align-items:center;gap:12px;font-size:19px;color:#142442}
#paymentValuesView .pv-totals-bar>strong svg{color:#0865ff}
#paymentValuesView .pv-totals-bar>div{min-width:0;border-inline-start:1px solid #d6e3fb;padding-inline-start:22px;color:#0865ff;font-size:12px}
#paymentValuesView .pv-totals-bar b{display:block;font-size:23px;font-variant-numeric:tabular-nums;margin-top:3px}
#paymentValuesView .pv-totals-bar b[dir=ltr]{unicode-bidi:isolate;text-align:right;white-space:nowrap}
#paymentValuesView .pv-totals-bar>div:nth-child(2){color:#943dff}
#paymentValuesView .pv-totals-bar>div:last-child{color:#f49a00}
@media(max-width:900px){#paymentValuesView .pv-totals-bar{grid-template-columns:repeat(2,minmax(0,1fr))}#paymentValuesView .pv-totals-bar>strong{grid-column:1/-1}}
@media(max-width:650px){#paymentValuesView .pv-totals-bar{gap:14px 10px;padding:14px 12px}#paymentValuesView .pv-totals-bar>div{padding-inline-start:10px}#paymentValuesView .pv-totals-bar b{font-size:21px}}
@media print{#paymentValuesView table.data-table.payment-values-table{min-width:0;table-layout:auto}#paymentValuesView table.data-table.payment-values-table thead th{position:static}#paymentValuesView .pv-totals-bar{break-inside:avoid}}

/* Six/eight actual data columns: project names replace the removed row index. */
#paymentValuesView #tblPaymentValues{min-width:1380px}
#paymentValuesView #tblPaymentValueHistory{min-width:1610px}
#paymentValuesView #tblPaymentValues th:nth-child(1){width:280px}
#paymentValuesView #tblPaymentValues th:nth-child(2){width:300px}
#paymentValuesView #tblPaymentValues th:nth-child(3){width:210px}
#paymentValuesView #tblPaymentValues th:nth-child(4){width:170px}
#paymentValuesView #tblPaymentValues th:nth-child(5){width:210px}
#paymentValuesView #tblPaymentValues th:nth-child(6){width:210px}
#paymentValuesView #tblPaymentValueHistory th:nth-child(1){width:280px}
#paymentValuesView #tblPaymentValueHistory th:nth-child(2){width:300px}
#paymentValuesView #tblPaymentValueHistory th:nth-child(3){width:170px}
#paymentValuesView #tblPaymentValueHistory th:nth-child(4){width:210px}
#paymentValuesView #tblPaymentValueHistory th:nth-child(5){width:210px}
#paymentValuesView #tblPaymentValueHistory th:nth-child(6){width:160px}
#paymentValuesView #tblPaymentValueHistory th:nth-child(7){width:150px}
#paymentValuesView #tblPaymentValueHistory th:nth-child(8){width:130px}
#paymentValuesView table.data-table.payment-values-table tbody td:first-child{background:#fff;z-index:2}
#paymentValuesView #tblPaymentValues tbody td:nth-child(n+3),
#paymentValuesView #tblPaymentValueHistory tbody td:nth-child(4),
#paymentValuesView #tblPaymentValueHistory tbody td:nth-child(5){direction:ltr;white-space:nowrap}
/* Reuse the dashboard entry and icon keyframes with the same timings and easing. */
#paymentValuesView .payment-kpi-card{transition:transform .3s cubic-bezier(.2,.7,.2,1),box-shadow .3s,border-color .3s,background .3s}
#paymentValuesView.active .payment-kpi-card{animation:dashboard-card-enter .65s cubic-bezier(.2,.7,.2,1) backwards}
#paymentValuesView.active .payment-kpi-card:nth-child(2){animation-delay:70ms}
#paymentValuesView.active .payment-kpi-card:nth-child(3){animation-delay:140ms}
#paymentValuesView.active .payment-kpi-card:nth-child(4){animation-delay:210ms}
#paymentValuesView .payment-kpi-icon{transition:transform .35s cubic-bezier(.2,.7,.2,1),box-shadow .3s}
#paymentValuesView .payment-kpi-card::before{left:-35px;bottom:-62px;width:130px;height:130px;mask-image:none;clip-path:none;border:14px solid color-mix(in srgb,var(--pv-tone) 7%,transparent);border-radius:50%;background:transparent;transition:transform .55s ease,border-color .35s ease}
#paymentValuesView .payment-kpi-card::after{content:"";position:absolute;inset:0;z-index:3;pointer-events:none;border-radius:inherit;background:linear-gradient(110deg,transparent 25%,#ffffffa8 50%,transparent 75%);transform:translateX(120%);transition:transform .75s ease}
#paymentValuesView .payment-kpi-card strong{transition:color .3s ease,transform .3s ease}
@media(hover:hover) and (pointer:fine){
 #paymentValuesView .payment-kpi-card:hover{z-index:2;transform:translateY(-6px) scale(1.012);border-color:color-mix(in srgb,var(--pv-tone) 65%,#dbeaff);background:linear-gradient(125deg,#fff,color-mix(in srgb,var(--pv-tone) 6%,white));box-shadow:0 14px 28px #173d8029,0 0 0 2px color-mix(in srgb,var(--pv-tone) 12%,transparent)}
 #paymentValuesView .payment-kpi-card:hover::after{transform:translateX(-120%)}
 #paymentValuesView .payment-kpi-card:hover::before{transform:translate(8px,-8px) scale(1.1);border-color:color-mix(in srgb,var(--pv-tone) 13%,transparent)}
 #paymentValuesView .payment-kpi-card:hover .payment-kpi-icon{transform:translateY(-3px) rotate(-10deg) scale(1.13);box-shadow:0 6px 14px color-mix(in srgb,var(--pv-tone) 25%,transparent)}
 #paymentValuesView .payment-kpi-card:hover .payment-kpi-icon svg{animation:dashboard-icon-pop .55s cubic-bezier(.2,.7,.2,1)}
 #paymentValuesView .payment-kpi-card:hover strong{color:var(--pv-tone);transform:translateY(-1px)}
}
@media(prefers-reduced-motion:reduce){
 #paymentValuesView .payment-kpi-card,#paymentValuesView .payment-kpi-card *,#paymentValuesView .payment-kpi-card::before,#paymentValuesView .payment-kpi-card::after{animation:none!important;transition:none!important;transform:none!important}
 #paymentValuesView .payment-kpi-card::after{display:none}
}
@media print{#paymentValuesView #tblPaymentValues,#paymentValuesView #tblPaymentValueHistory{min-width:0}}
