:root{
  --bg:#f5f7fb;--card:#fff;--text:#1f2937;--muted:#6b7280;--line:#e5e7eb;
  --primary:#0f766e;--primary2:#115e59;--danger:#b91c1c;--warning:#b45309;
  --success:#15803d;--blue:#1d4ed8;--shadow:0 8px 24px rgba(15,23,42,.06)
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Tahoma,Arial,sans-serif;background:var(--bg);color:var(--text);direction:rtl;overflow-x:hidden;line-height:1.55}
.install-body{display:grid;min-height:100vh;place-items:center;padding:24px}
.install-card{width:min(850px,100%);background:#fff;border:1px solid var(--line);border-radius:18px;padding:28px;box-shadow:var(--shadow)}
h1,h2,h3{margin:0 0 14px;line-height:1.35}
h1{font-size:clamp(24px,2vw,34px)}
h2{font-size:clamp(20px,1.5vw,28px)}
a{text-decoration:none;color:inherit}

.topbar{background:#0f172a;color:#fff;padding:10px clamp(14px,2vw,28px);display:flex;align-items:center;justify-content:space-between;gap:16px;position:sticky;top:0;z-index:100;box-shadow:0 2px 10px rgba(15,23,42,.15)}
.topbar>div{flex:0 0 auto;min-width:max-content}
.brand{font-weight:700;font-size:15px}
.nav{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:center;gap:5px;min-width:0}
.nav a{padding:7px 9px;border-radius:9px;color:#e5e7eb;white-space:nowrap;font-size:14px}
.nav a:hover,.nav a.active{background:#1e293b;color:#fff}

.container{width:min(1500px,calc(100% - 32px));margin:20px auto 36px;padding:0}
.card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:clamp(16px,1.7vw,24px);box-shadow:var(--shadow);margin-bottom:18px;max-width:100%;overflow:hidden}
.grid{display:grid;gap:14px;min-width:0}
.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}
.account-edit-grid{max-width:1100px;gap:16px 20px;margin-bottom:12px}
.stat{background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px;min-width:0}
.stat small{color:var(--muted)}
.stat strong{display:block;font-size:24px;margin-top:6px;overflow-wrap:anywhere}

.btn{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:9px;padding:9px 14px;cursor:pointer;font-weight:700;min-height:38px}
.btn.primary{background:var(--primary);color:#fff}.btn.primary:hover{background:var(--primary2)}
.btn.secondary{background:#e2e8f0;color:#0f172a}.btn.danger{background:#fee2e2;color:#991b1b}.btn.warning{background:#fef3c7;color:#92400e}.btn.small{padding:6px 10px;font-size:12px;min-height:30px}
.alert{padding:12px 14px;border-radius:10px;margin-bottom:14px}.alert.success{background:#dcfce7;color:#166534}.alert.danger{background:#fee2e2;color:#991b1b}.alert.warning{background:#fef3c7;color:#92400e}.alert.info{background:#dbeafe;color:#1e40af}

form{max-width:100%}
label{display:block;font-size:13px;font-weight:700;color:#374151;min-width:0}
input,select,textarea{display:block;width:100%;max-width:100%;margin-top:7px;border:1px solid #cbd5e1;border-radius:9px;padding:10px 12px;background:#fff;color:#111827;font:inherit;min-height:42px}
input:focus,select:focus,textarea:focus{outline:2px solid rgba(15,118,110,.18);border-color:var(--primary)}
textarea{min-height:85px;resize:vertical}

.table-wrap{width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;border:1px solid var(--line);border-radius:12px;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
table{width:100%;min-width:760px;border-collapse:collapse;background:#fff}
th,td{padding:11px 12px;border-bottom:1px solid var(--line);text-align:right;vertical-align:middle;overflow-wrap:normal}
th{background:#f8fafc;font-size:12px;color:#475569;white-space:nowrap;position:static}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover{background:#fcfcfd}
td .btn{white-space:nowrap}

.badge{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:12px;font-weight:700}.badge.pending{background:#fef3c7;color:#92400e}.badge.approved{background:#dcfce7;color:#166534}.badge.rejected,.badge.cancelled{background:#fee2e2;color:#991b1b}.badge.info{background:#dbeafe;color:#1e40af}
.muted{color:var(--muted)}.num{font-variant-numeric:tabular-nums;white-space:nowrap}.login-wrap{min-height:100vh;display:grid;place-items:center;padding:20px}.login-card{width:min(430px,100%);background:#fff;border:1px solid var(--line);border-radius:16px;padding:24px;box-shadow:var(--shadow)}
.actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.line-row{display:grid;grid-template-columns:1.1fr 1.2fr 1fr 1fr 1fr 1fr auto;gap:8px;align-items:end;padding:10px;background:#f8fafc;border-radius:10px;margin-bottom:8px}.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;flex-wrap:wrap}.section-title h1,.section-title h2{margin-bottom:0}.kpi-danger{border-right:4px solid #dc2626}.kpi-warning{border-right:4px solid #d97706}.kpi-success{border-right:4px solid #16a34a}.footer{padding:20px 18px 28px;color:#64748b;text-align:center;font-size:12px}.ltr{direction:ltr;text-align:left}.nowrap{white-space:nowrap}.hr{height:1px;background:var(--line);margin:18px 0}

@media(max-width:1200px){
  .grid.four{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}
  .topbar{align-items:flex-start;flex-direction:column}
  .nav{width:100%;overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px}
  .nav a{flex:0 0 auto}
}
@media(max-width:760px){
  .container{width:min(100% - 20px,1500px);margin-top:12px}
  .card{border-radius:12px;padding:14px}
  .grid.two,.grid.three,.grid.four{grid-template-columns:1fr}
  .line-row{grid-template-columns:1fr}
  table{min-width:680px}
  .topbar{position:static;padding:10px 12px}
  .nav{gap:3px}
  .nav a{font-size:13px;padding:7px 8px}
  .stat strong{font-size:21px}
}
@media print{.topbar,.no-print,.footer{display:none!important}.container{width:100%;max-width:none;margin:0;padding:0}.card{box-shadow:none;border:0;overflow:visible}.table-wrap{overflow:visible;border:0}table{min-width:0}body{background:#fff}}


/* v1.2 printable transaction vouchers */
.print-only{display:none}
.voucher-meta{margin-top:10px}
.voucher-note{grid-column:1/-1}
.print-voucher-head{text-align:center;border-bottom:2px solid #111827;padding-bottom:12px;margin-bottom:18px}
.print-company{font-size:16px;font-weight:700;margin-bottom:8px}
.voucher-signatures{grid-template-columns:repeat(3,1fr);gap:28px;margin-top:34px;page-break-inside:avoid}
.voucher-signatures>div{border-top:1px solid #9ca3af;padding-top:12px;display:flex;flex-direction:column;gap:12px}
@media print{
  .print-only{display:grid!important}
  .print-voucher-head{display:block!important}
  .printable-voucher{margin-top:0}
  .voucher-signatures{display:grid!important}
  .card{page-break-inside:avoid}
  a{color:#000;text-decoration:none}
}

/* v1.3 branding, transaction entry, permissions and simplified print */
.brand-wrap{display:flex;align-items:center;gap:10px;min-width:0}
.brand-logo{width:34px;height:46px;object-fit:contain;flex:0 0 auto}
.txn-parties{margin-top:14px}
.item-line-row{display:grid;grid-template-columns:minmax(220px,2fr) minmax(130px,.8fr) minmax(150px,.8fr) auto;gap:10px;align-items:end;padding:12px;border:1px solid var(--line);border-radius:11px;background:#f8fafc;margin-bottom:9px}
.line-value{min-height:42px;display:flex;align-items:center;gap:6px;padding:0 8px;color:#475569}
.cash-box{margin-top:14px;align-items:end}
.auto-cash-help{display:flex;gap:8px;align-items:center;justify-content:flex-start;flex-wrap:wrap;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:10px;padding:10px 12px;color:#475569}
.permission-table{min-width:780px}
.permission-table td:not(:first-child),.permission-table th:not(:first-child){text-align:center}
.perm-check{width:20px;height:20px;min-height:0;margin:0 auto;display:block}

.simple-voucher{display:none}
.simple-voucher-head{display:flex;align-items:center;gap:16px;border-bottom:1.5px solid #111;padding-bottom:12px;margin-bottom:14px}
.simple-voucher-head img{width:110px;height:82px;object-fit:contain}
.simple-voucher-head h1{font-size:24px;margin:2px 0 0}
.voucher-company{font-size:17px;font-weight:700}
.simple-meta{display:flex;gap:24px;flex-wrap:wrap;font-size:13px;margin-bottom:14px}
.simple-parties{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:14px}
.simple-parties>div{border:1px solid #d1d5db;border-radius:8px;padding:10px 12px}
.simple-parties small{display:block;color:#6b7280;margin-bottom:3px}
.simple-parties strong{font-size:16px}
.simple-lines{width:100%;min-width:0;border-collapse:collapse;margin-top:8px}
.simple-lines th,.simple-lines td{border:1px solid #d1d5db;padding:8px 10px}
.simple-lines th{background:#f3f4f6}
.cash-total td{background:#fafafa}
.simple-note{margin-top:12px;padding:9px 10px;border:1px solid #d1d5db;border-radius:8px}
.two-signatures{grid-template-columns:repeat(2,1fr)!important;gap:50px!important}

@media(max-width:760px){
  .item-line-row{grid-template-columns:1fr}
  .brand-logo{width:30px;height:42px}
}

@media print{
  @page{size:A4;margin:14mm}
  body{font-family:Tahoma,Arial,sans-serif;color:#111}
  main.container{width:100%;margin:0;padding:0}
  .print-only.simple-voucher{display:block!important}
  .simple-voucher{padding:0;margin:0}
  .simple-voucher-head{display:flex!important}
  .voucher-signatures{display:grid!important}
  .two-signatures{margin-top:34px}
  .two-signatures>div{min-height:70px}
  .card.no-print{display:none!important}
}

/* v1.6 exact logo + brand-inspired theme */
:root{
  --bg:#eef2f7;
  --card:#ffffff;
  --text:#101828;
  --muted:#667085;
  --line:#d8e0ee;
  --primary:#4052cf;
  --primary2:#0f172a;
  --danger:#b42318;
  --warning:#b54708;
  --success:#15803d;
  --blue:#4052cf;
  --shadow:0 12px 30px rgba(15,23,42,.08)
}
body{background:linear-gradient(180deg,#eef2f7 0,#f7f9fd 260px,#eef2f7 100%)}
.topbar{background:linear-gradient(90deg,#05070c 0%,#101828 42%,#4052cf 100%);border-bottom:3px solid #5568e8;box-shadow:0 10px 28px rgba(5,7,12,.22)}
.brand-wrap{display:flex;align-items:center;gap:12px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.18);padding:6px 10px;border-radius:18px;backdrop-filter:blur(8px)}
.brand-logo-full{width:96px;height:64px;object-fit:contain;flex:0 0 auto;background:#fff;border-radius:14px;padding:4px 8px;box-shadow:0 6px 18px rgba(0,0,0,.18)}
.brand{font-size:17px;font-weight:800;letter-spacing:.2px}
.brand-wrap small{color:#dbe4ff}
.nav a{border:1px solid transparent}
.nav a:hover,.nav a.active{background:rgba(255,255,255,.14);border-color:rgba(255,255,255,.16);color:#fff}
.container{margin-top:24px}
.card{border:1px solid var(--line);border-top:4px solid var(--primary);border-radius:18px;box-shadow:var(--shadow)}
.stat{background:linear-gradient(180deg,#fff 0,#fbfcff 100%);border:1px solid #d9e0ef;border-top:4px solid #101828;border-radius:18px;box-shadow:var(--shadow)}
.stat small,.muted{color:#667085}
.section-title h1,.section-title h2,h1,h2{color:#0f172a}
.btn.primary{background:linear-gradient(135deg,#4052cf 0%,#2436a9 100%);color:#fff;box-shadow:0 8px 18px rgba(64,82,207,.25)}
.btn.primary:hover{background:linear-gradient(135deg,#3244bf 0%,#1e2f97 100%)}
.btn.secondary{background:#edf2ff;color:#2436a9}
.btn.secondary:hover{background:#dde5ff}
.badge.pending{background:#fff4d6;color:#9a6700}.badge.approved{background:#dcfae6;color:#166534}.badge.rejected,.badge.cancelled{background:#fee4e2;color:#b42318}
.table-wrap{border-radius:14px;border-color:#dbe2ef}
th{background:#f7f9fc;color:#344054}
input:focus,select:focus,textarea:focus{outline:2px solid rgba(64,82,207,.15);border-color:#4052cf}
.login-wrap{background:radial-gradient(circle at top right,rgba(64,82,207,.14),transparent 28%),radial-gradient(circle at top left,rgba(0,0,0,.06),transparent 25%);min-height:calc(100vh - 80px)}
.login-card.login-branded{border-top:5px solid var(--primary);max-width:480px}
.login-logo{display:block;width:190px;max-width:78%;height:auto;margin:0 auto 16px;background:#fff;border-radius:18px;padding:8px 10px;box-shadow:0 10px 24px rgba(15,23,42,.12)}
.login-card h1{text-align:center;margin-bottom:6px}.login-card .muted{text-align:center;display:block;margin-bottom:16px}
.footer{padding:24px 18px 30px;color:#667085}
.simple-voucher-head{border-bottom:2px solid #101828;padding-bottom:14px}
.simple-voucher-head img{width:128px;height:auto;object-fit:contain;border-radius:12px;background:#fff;padding:6px 8px;border:1px solid #d0d5dd}
.simple-voucher-head h1{font-size:26px;color:#101828}
.voucher-company{font-size:18px;color:#2436a9}
.simple-meta strong,.simple-parties strong{color:#101828}
.simple-lines th{background:#eef2ff;color:#101828}
.cash-total td{background:#f8faff}
@media(max-width:760px){
  .brand-wrap{width:100%;justify-content:center;flex-wrap:wrap;text-align:center}
  .brand-logo-full{width:120px;height:78px}
  .topbar{padding:12px}
}
@media print{
  .simple-voucher-head img{width:118px;height:auto}
}

/* v1.8 electronic signatures */
.signature-approval-box{margin-top:8px;padding:16px;border:1px solid #cfd8ea;border-radius:14px;background:#fbfcff}
.signature-approval-box h3{margin-bottom:6px}
.signature-pad-shell{position:relative;width:min(720px,100%);height:190px;margin:12px 0;border:2px dashed #9aa9c4;border-radius:14px;background:#fff;overflow:hidden;box-shadow:inset 0 0 0 1px rgba(64,82,207,.04)}
.signature-pad{display:block;width:100%;height:100%;touch-action:none;cursor:crosshair;background:#fff}
.signature-pad-hint{position:absolute;inset:auto 14px 10px auto;color:#98a2b3;font-size:12px;pointer-events:none}
.signature-actions{margin-top:8px}
.reject-inline{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:10px;align-items:end;max-width:720px}
.signature-thumb-wrap{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.signature-thumb{width:120px;height:46px;object-fit:contain;background:#fff;border:1px solid #d0d5dd;border-radius:8px;padding:3px}
.signature-thumb-wrap small{color:#667085;font-size:11px}
.electronic-signatures>div{min-height:125px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;text-align:center;gap:6px}
.printed-signature{width:210px;max-width:100%;height:72px;object-fit:contain;border-bottom:1px solid #98a2b3;padding:4px 8px;background:#fff}
.electronic-signatures small{font-size:10px;color:#667085}
.signature-missing{display:flex;min-height:72px;align-items:center;color:#98a2b3;font-size:11px}
@media(max-width:760px){
  .signature-pad-shell{height:170px}
  .reject-inline{grid-template-columns:1fr}
  .signature-thumb{width:100px}
}
@media print{
  .electronic-signatures{margin-top:28px!important}
  .printed-signature{width:190px;height:68px}
}

/* v1.9 transaction ownership + custody visibility */
.locked-select{background:#eef2ff!important;color:#344054!important;border-color:#aebaf5!important;font-weight:700;cursor:not-allowed}

/* v2.0 workflow controls + clearer review/ledger */
.review-card{border-top-color:#101828;background:linear-gradient(180deg,#fff 0,#f8faff 100%)}
.review-parties{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
.review-party{border:1px solid #d7deeb;border-radius:14px;padding:14px;background:#fff}
.review-party.mine{border:2px solid #4052cf;background:#f3f5ff}
.review-party-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.review-description{font-size:15px;font-weight:700;color:#101828;line-height:1.7}
.review-effect{margin-top:8px;padding:8px 10px;border-radius:9px;background:#f6f8fc;color:#344054;font-size:13px}
.ledger-readable{min-width:1050px}
.ledger-desc{min-width:320px;white-space:normal;line-height:1.7;font-weight:700;color:#101828}
.ledger-effect{min-width:280px;white-space:normal;line-height:1.7;color:#344054}
.cash-insufficient{color:#b42318!important;font-weight:700}
.reset-card{max-width:900px;margin-inline:auto;border-top-color:#b42318}
.reset-card .btn.danger{background:#b42318;color:#fff}
.reset-card .btn.danger:hover{background:#912018}
@media(max-width:760px){
  .review-parties{grid-template-columns:1fr}
  .ledger-readable{min-width:900px}
}
.review-cash{display:flex;flex-wrap:wrap;gap:10px 18px;margin-top:10px;padding-top:10px;border-top:1px dashed #d0d5dd;font-size:12px;color:#667085}
.review-cash strong{color:#101828}

/* v2.1 onsite recipient signature + company settings + formal voucher */
.movement-overview{border-top-color:#101828}
.movement-overview-grid{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:14px;align-items:stretch}
.movement-side{border:1px solid #dbe2ef;border-radius:14px;padding:16px;background:#fbfcff}
.movement-side.seller{border-right:4px solid #4052cf}.movement-side.buyer{border-right:4px solid #101828}
.movement-side small{display:block;color:#667085;margin-bottom:4px}.movement-side>strong{font-size:18px}.movement-side p{margin:8px 0}
.effect-pill{display:inline-block;background:#eef2ff;color:#2436a9;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:700}
.movement-arrow{align-self:center;font-weight:800;color:#4052cf;white-space:nowrap}
.onsite-sign-box{background:#f7f9ff;border:1px solid #cbd5ff;border-radius:14px;padding:16px;margin-top:12px}
.onsite-ack{margin:12px 0}.onsite-ack input{display:inline-block;width:auto;min-height:0;margin:0 0 0 8px}
.settings-logo{width:150px;height:auto;object-fit:contain;border-radius:14px;border:1px solid #d0d5dd;background:#fff;padding:6px 8px}
.voucher-branch{font-weight:700;margin-top:2px}.voucher-legal{font-size:11px;color:#475467;margin-top:4px}.formal-meta{padding:8px 0;border-bottom:1px solid #e4e7ec}
.formal-voucher .simple-lines th{font-size:12px}.voucher-footer-note{text-align:center;font-size:10px;color:#667085;border-top:1px solid #d0d5dd;margin-top:20px;padding-top:8px}
@media(max-width:760px){.movement-overview-grid{grid-template-columns:1fr}.movement-arrow{text-align:center;transform:rotate(90deg)}.settings-logo{width:120px}}
@media print{.formal-voucher{font-size:12px}.formal-voucher .simple-voucher-head{align-items:flex-start}.voucher-legal{font-size:10px}.formal-voucher .simple-lines th,.formal-voucher .simple-lines td{padding:7px 8px}}

/* v2.2 approval summary, buyer controls, employee credit report, warehouse count */
.approval-quick-summary{display:grid;gap:7px;background:#f7f9ff;border:1px solid #cfd7ff;border-right:5px solid var(--primary);border-radius:12px;padding:13px 15px;margin:10px 0 14px}
.approval-quick-summary strong{font-size:16px;color:#101828}.approval-quick-summary span{color:#475467}.approval-quick-summary b{color:#2436a9}
.buyer-check-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.buyer-check{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:12px;padding:11px 12px;background:#fff;cursor:pointer}
.buyer-check:hover{border-color:#aebaff;background:#f8faff}.buyer-check input{width:20px;height:20px;min-height:0;margin:0;flex:0 0 auto}.buyer-check span{display:flex;flex-direction:column}.buyer-check small{color:var(--muted);font-weight:400;margin-top:2px}
.negative-balance{color:#b42318!important;font-weight:800}
.print-report-head{display:flex;align-items:center;gap:16px;border-bottom:2px solid #101828;padding-bottom:12px;margin-bottom:16px}.print-report-head img{width:120px;height:auto;object-fit:contain}.print-report-head>div{display:flex;flex-direction:column;gap:3px}
.warehouse-ack{display:flex;align-items:flex-start;gap:9px;background:#fff8e8;border:1px solid #f1d18b;border-radius:12px;padding:12px 14px;margin:14px 0}.warehouse-ack input{width:20px;height:20px;min-height:0;margin:2px 0 0;flex:0 0 auto}
.warehouse-declaration{margin-top:16px;padding:13px 15px;border:1px solid #d0d5dd;border-radius:12px;background:#f9fafb}
.warehouse-sign-status{margin-top:18px}.warehouse-sign-status>div{border:1px solid var(--line);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:8px;min-height:130px}.warehouse-signature{max-width:260px;max-height:100px;object-fit:contain;background:#fff;border:1px solid #eaecf0;border-radius:8px;padding:5px}
.warehouse-print{font-family:Tahoma,Arial,sans-serif}.warehouse-print .warehouse-declaration{page-break-inside:avoid}
@media(max-width:1000px){.buyer-check-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.buyer-check-grid{grid-template-columns:1fr}.approval-quick-summary{font-size:14px}.warehouse-sign-status{grid-template-columns:1fr!important}}
@media print{.print-report-head{display:flex!important}.print-report-head img{width:100px}.negative-balance{color:#000!important}.warehouse-print{display:block!important}.warehouse-signature{border:0;max-width:220px}}

/* v2.3 custody count redesign */
.custody-count-create,.custody-count-view{border-top-color:#4052cf}
.custody-owner-chip{background:linear-gradient(135deg,#101828,#3546ba);color:#fff;border-radius:14px;padding:10px 16px;min-width:210px;box-shadow:0 8px 22px rgba(16,24,40,.15)}
.custody-owner-chip small{display:block;color:#dbe4ff;margin-bottom:2px}.custody-owner-chip strong{font-size:17px}
.custody-entry-table,.custody-count-table{min-width:820px}
.custody-entry-table th,.custody-count-table th{background:#eef2ff;color:#2436a9;font-size:13px}
.custody-entry-table td,.custody-count-table td{padding:13px 12px}
.cash-row td{background:#fafbff}
.count-face{display:block;color:#667085;font-size:11px;margin-top:3px;font-weight:400}
.count-demanded-box{margin-top:16px;background:linear-gradient(135deg,#101828,#2436a9);color:#fff;border-radius:16px;padding:16px 20px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-shadow:0 10px 24px rgba(36,54,169,.18)}
.count-demanded-box small{color:#dbe4ff;font-size:13px}.count-demanded-box strong{font-size:27px;white-space:nowrap}
.count-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0}
.count-summary-grid>div{border:1px solid #dbe2ef;border-radius:14px;padding:14px 16px;background:#fff}
.count-summary-grid small{display:block;color:#667085}.count-summary-grid strong{display:block;font-size:22px;margin-top:5px}.count-summary-grid span{display:inline-block;margin-top:4px;font-size:12px;font-weight:700}
.summary-diff{border-color:#f6c7c4!important;background:#fff8f7!important}.summary-diff strong,.summary-diff span{color:#b42318}
.summary-ok{border-color:#b7e4c7!important;background:#f3fff7!important}.summary-ok strong,.summary-ok span{color:#15803d}
.custody-declaration,.custody-ack{background:#f8faff;border:1px solid #dce3f7;border-right:4px solid #4052cf;border-radius:12px;padding:14px 16px;margin:16px 0;line-height:1.9}

/* Formal custody count print */
.custody-count-print{display:none}
.custody-print-border{border:1.6px solid #19213a;border-radius:14px;padding:12mm 11mm 10mm;background:#fff;position:relative}
.custody-print-border:before{content:"";position:absolute;inset:5mm;border:1px solid #d9dfed;border-radius:9px;pointer-events:none}
.custody-print-head{position:relative;z-index:1;display:grid;grid-template-columns:120px 1fr 230px;align-items:center;gap:16px;border-bottom:2px solid #2436a9;padding:0 4px 12px;margin-bottom:12px}
.custody-print-head img{width:110px;height:auto;object-fit:contain;background:#fff}
.custody-print-title{text-align:center}.custody-print-title h2{font-size:25px;margin:0 0 5px;color:#101828}.custody-print-title strong{display:block;font-size:17px;color:#2436a9;margin-bottom:3px}.custody-print-title span{font-size:12px;color:#475467}
.custody-company-ids{display:flex;flex-direction:column;gap:7px;font-size:11px;color:#344054;border-right:1px solid #d0d5dd;padding-right:12px}
.custody-meta{position:relative;z-index:1;display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin:10px 0 12px;padding:9px 10px;background:#f7f9ff;border:1px solid #d9e0f4;border-radius:9px;font-size:11px}
.custody-print-table{position:relative;z-index:1;width:100%;border-collapse:collapse;margin-top:8px;font-size:11px}
.custody-print-table th,.custody-print-table td{border:1px solid #cfd6e6;padding:9px 8px;text-align:center}
.custody-print-table th{background:#eaf0ff;color:#101828;font-weight:800}.custody-print-table td:first-child{text-align:right}.custody-print-table .cash-row td{background:#f9faff}
.custody-print-summary{position:relative;z-index:1;display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:8px;margin:14px 0}
.custody-print-summary>div{border:1px solid #cfd6e6;border-radius:9px;padding:10px 12px;background:#fbfcff}.custody-print-summary>div:first-child{background:#101828;color:#fff;border-color:#101828}
.custody-print-summary span{display:block;font-size:10px;margin-bottom:4px}.custody-print-summary strong{font-size:17px}.custody-print-summary em{display:block;font-style:normal;font-size:10px;margin-top:2px}
.custody-print-declaration{position:relative;z-index:1;border:1px solid #cfd6e6;border-right:4px solid #4052cf;border-radius:9px;padding:10px 12px;line-height:1.75;font-size:10.5px;margin:12px 0 16px;background:#f9faff}
.custody-print-signatures{position:relative;z-index:1;display:grid;grid-template-columns:1fr 1fr;gap:35px;margin-top:16px;page-break-inside:avoid}
.custody-print-signatures>div{border-top:1px solid #667085;padding-top:9px;min-height:92px;text-align:center}.custody-print-signatures h4{margin:0 0 5px;font-size:12px}.custody-print-signatures small{display:block;font-size:9px;color:#667085}.custody-print-signatures .printed-signature{display:block;max-width:150px;max-height:58px;margin:4px auto;object-fit:contain}
@media(max-width:760px){.count-summary-grid{grid-template-columns:1fr}.count-demanded-box{align-items:flex-start;flex-direction:column}.custody-owner-chip{width:100%}}
@media print{
  @page{size:A4 portrait;margin:9mm}
  .print-only.custody-count-print{display:block!important}
  .custody-count-print{margin:0!important;padding:0!important}
  .custody-print-border{min-height:270mm;box-shadow:none}
  .custody-print-table{page-break-inside:avoid}
}
