
    :root {
      --primary: #2563eb;
      --primary-dark: #1d4ed8;
      --bg: #f8fafc;
      --card: #ffffff;
      --text: #0f172a;
      --text-light: #64748b;
      --border: #e2e8f0;
      --success: #16a34a;
      --warning: #ca8a04;
      --danger: #dc2626;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
    body { background-color: var(--bg); color: var(--text); display: flex; height: 100vh; overflow: hidden; }

    /* Sidebar Navigation */
    .sidebar { width: 260px; background-color: #0f172a; color: white; padding: 20px 0; display: flex; flex-direction: column; flex-shrink: 0; }
    .sidebar .logo-container { padding: 0 20px 20px; border-bottom: 1px solid #334155; }
    .sidebar .logo { font-size: 1.3rem; font-weight: bold; color: #38bdf8; }
    .sidebar .proprietor { font-size: 0.78rem; color: #94a3b8; margin-top: 4px; }
    
    .nav-menu { list-style: none; margin-top: 15px; flex: 1; overflow-y: auto; }
    .nav-item { padding: 12px 20px; display: flex; align-items: center; gap: 10px; cursor: pointer; color: #94a3b8; transition: all 0.2s; font-size: 0.9rem; }
    .nav-item:hover, .nav-item.active { background-color: #1e293b; color: white; border-left: 4px solid var(--primary); }

    /* Main Content Area */
    .main-content { flex: 1; padding: 25px; overflow-y: auto; }
    
    .top-company-bar {
      background: #ffffff;
      padding: 15px 20px;
      border-radius: 8px;
      border: 1px solid var(--border);
      margin-bottom: 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    }
    .company-title-area h2 { font-size: 1.3rem; color: #0f172a; font-weight: 700; }
    .company-title-area p { font-size: 0.85rem; color: var(--text-light); margin-top: 2px; }

    .tab-content { display: none; }
    .tab-content.active { display: block; }

    .header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
    .title { font-size: 1.4rem; font-weight: bold; }

    /* Cards & Grids */
    .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin-bottom: 25px; }
    .card { background: var(--card); padding: 18px; border-radius: 8px; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
    .card-title { font-size: 0.8rem; color: var(--text-light); font-weight: 600; text-transform: uppercase; }
    .card-value { font-size: 1.3rem; font-weight: bold; margin-top: 8px; color: var(--primary); }

    /* Forms & Inputs */
    .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; }
    .form-group { margin-bottom: 15px; }
    .form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; }
    .form-control { width: 100%; padding: 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; }
    .btn { padding: 8px 14px; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; transition: background 0.2s; font-size: 0.85rem; }
    .btn-primary { background: var(--primary); color: white; }
    .btn-primary:hover { background: var(--primary-dark); }
    .btn-success { background: var(--success); color: white; }
    .btn-danger { background: var(--danger); color: white; }
    .btn-warning { background: var(--warning); color: white; }
    .btn-sm { padding: 4px 8px; font-size: 0.78rem; margin-right: 4px; }
    .btn-outline { background: transparent; border: 1px solid var(--border); }

    /* Tables */
    .table-container { background: var(--card); border-radius: 8px; border: 1px solid var(--border); overflow-x: auto; margin-top: 15px; }
    .sticky-table-container { max-height: 65vh; overflow-y: auto; }
    table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.88rem; }
    th, td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
    th {
      background: #cbd5e1;
      font-weight: 700;
      color: #0f172a;
      border-bottom: 2px solid #94a3b8;
      position: sticky;
      top: 0;
      z-index: 5;
    }
    tr:hover { background: #f8fafc; }

    /* Badges */
    .badge { padding: 3px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: bold; display: inline-block; }
    .badge-success { background: #dcfce7; color: #15803d; }
    .badge-warning { background: #fef9c3; color: #a16207; }
    .badge-danger { background: #fee2e2; color: #b91c1c; }

    /* Modal */
    .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); justify-content: center; align-items: center; z-index: 100; }
    .modal.active { display: flex; }
    .modal-content { background: white; padding: 25px; border-radius: 8px; width: 100%; max-width: 700px; max-height: 90vh; overflow-y: auto; }

    /* Invoice / Statement of Account styling */
    .invoice-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 32px; font-family: 'Segoe UI', Tahoma, sans-serif; }
    .invoice-top { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 16px; border-bottom: 2px solid #0f172a; }
    .invoice-brand h1 { font-size: 1.7rem; font-weight: 700; color: #0f172a; }
    .invoice-brand p { font-size: 0.9rem; color: var(--text-light); margin-top: 2px; }
    .invoice-meta { text-align: right; }
    .invoice-meta h3 { font-size: 1.15rem; font-weight: 700; color: #0f172a; }
    .invoice-meta p { font-size: 0.85rem; color: var(--text-light); margin-top: 4px; }
    .invoice-billto { margin-top: 22px; }
    .invoice-billto .label { font-size: 1.02rem; font-weight: 700; color: #0f172a; }
    .invoice-billto .sub { font-size: 0.85rem; color: var(--text-light); margin-top: 4px; }
    .invoice-section-title { font-size: 1rem; font-weight: 700; color: #0f172a; margin-top: 24px; margin-bottom: 8px; }
    .invoice-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
    .invoice-table th { text-align: left; font-weight: 700; color: #0f172a; padding: 8px 6px; background: #cbd5e1; border-bottom: 2px solid #94a3b8; position: sticky; top: 0; z-index: 5; }
    .invoice-table td { padding: 10px 6px; border-bottom: 1px solid #f1f5f9; }
    .invoice-table th.num, .invoice-table td.num { text-align: right; }
    .invoice-totals { text-align: right; margin-top: 18px; }
    .invoice-totals p { font-size: 0.95rem; color: #0f172a; margin-bottom: 4px; }
    .invoice-totals .due { font-size: 1.35rem; font-weight: 700; margin-top: 6px; }
    .invoice-balance { text-align: right; font-size: 0.85rem; color: var(--text-light); margin-top: 6px; }
    .invoice-balance .amt-pay { color: var(--warning); font-weight: 700; }
    .invoice-balance .amt-receive { color: var(--success); font-weight: 700; }
    .invoice-divider { border: none; border-top: 1px dashed var(--border); margin: 22px 0 14px; }
    .invoice-pay-check { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; color: #0f172a; }
    .invoice-pay-check input { width: 18px; height: 18px; }


    /* ERP Report Center */
    #erpReportsTab .erp-report-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
    #erpReportsTab .erp-report-selector { min-width:280px; }
    #erpReportsTab .erp-report-filters { margin-bottom:18px; }
    #erpReportsTab .erp-filter-hidden { display:none !important; }
    #erpReportsTab .erp-selected-report { margin-top:4px; }
    #erpReportsTab .erp-selected-report > h3 { margin-top:0 !important; }
    #erpReportsTab .table-container { margin-top:10px; }
    #erpReportsTab .erp-report-empty { padding:28px; text-align:center; color:var(--text-light); background:#fff; border:1px dashed var(--border); border-radius:8px; }

    /* Accounts Receivable — Payment Hub visual standard */
    #erpReportsTab{font-family:Inter,"Segoe UI",Roboto,Arial,sans-serif;}
    #erpReportsTab .erp-center-header{padding:12px 16px;margin-bottom:12px;border-radius:10px;box-shadow:0 2px 10px rgba(15,23,42,.04);}
    #erpReportsTab .erp-center-title-wrap{display:flex;align-items:center;gap:12px;}
    #erpReportsTab .erp-center-icon{width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#6366f1,#7c3aed);color:white;font-size:16px;box-shadow:0 5px 12px rgba(99,102,241,.22);}
    #erpReportsTab .erp-center-header .title{font-size:22px;font-weight:600;letter-spacing:0;margin:0;}
    #erpReportsTab .erp-header-actions .btn{height:34px;padding:0 12px;border-radius:7px;font-size:12px;font-weight:500;}
    #erpReportsTab .erp-ar-hero{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:2px 0 10px;padding:0 2px;}
    #erpReportsTab .erp-ar-hero h2{font-size:20px;font-weight:600;margin:0 0 3px;color:#0f172a;}
    #erpReportsTab .erp-ar-hero>div:first-child>div{font-size:12px;color:#64748b;}
    #erpReportsTab .erp-report-date{display:flex;align-items:center;gap:9px;border:1px solid #dbe5f0;background:#f8fbff;border-radius:9px;padding:8px 12px;min-width:175px;}
    #erpReportsTab .erp-date-icon{width:28px;height:28px;border-radius:7px;background:#e8f2ff;color:#1677ff;display:flex;align-items:center;justify-content:center;}
    #erpReportsTab .erp-report-date strong{display:block;font-size:11px;font-weight:600;color:#334155;}
    #erpReportsTab .erp-report-date span:last-child{display:block;font-size:11px;color:#64748b;margin-top:1px;}
    #erpReportsTab .erp-ar-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:12px;}
    #erpReportsTab .erp-ar-card{min-height:84px;background:#fff;border:1px solid #e2e8f0;border-radius:10px;display:flex;align-items:center;gap:12px;padding:12px 14px;box-shadow:0 3px 12px rgba(15,23,42,.045);}
    #erpReportsTab .erp-ar-icon{width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:15px;flex:0 0 34px;}
    #erpReportsTab .erp-ar-icon.blue{background:#5865f2}.erp-ar-icon.green{background:#16b364}.erp-ar-icon.orange{background:#ff9818}.erp-ar-icon.red{background:#ef4050}
    #erpReportsTab .erp-ar-card small{display:block;color:#475569;font-size:11.5px;font-weight:500;margin-bottom:2px;}
    #erpReportsTab .erp-ar-card strong{display:block;color:#0f2a55;font-size:18px;font-weight:600;line-height:1.15;letter-spacing:0;}
    #erpReportsTab .erp-ar-card em{display:block;color:#64748b;font-size:10.5px;font-style:normal;margin-top:3px;}
    #erpReportsTab.erp-view-receivable .erp-report-filters{padding:12px 14px;margin-bottom:12px;border-radius:10px;}
    #erpReportsTab.erp-view-receivable .erp-report-toolbar{margin-bottom:10px;}
    #erpReportsTab.erp-view-receivable .erp-report-selector{height:34px;font-size:12px;}
    #erpReportsTab.erp-view-receivable .form-grid{gap:10px;grid-template-columns:1fr 1fr 1.25fr;}
    #erpReportsTab.erp-view-receivable .form-group label{font-size:11px;font-weight:600;margin-bottom:4px;}
    #erpReportsTab.erp-view-receivable .form-control{height:36px;font-size:12px;border-radius:7px;}
    #erpReportsTab .erp-ar-report{background:#fff;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden;box-shadow:0 3px 12px rgba(15,23,42,.035);}
    #erpReportsTab .erp-ar-table-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px 8px;}
    #erpReportsTab .erp-ar-table-head h3{font-size:17px;font-weight:600;margin:0;color:#0f172a;}
    #erpReportsTab .erp-ar-search{height:34px;width:245px;border:1px solid #dbe5f0;border-radius:7px;display:flex;align-items:center;gap:6px;padding:0 9px;color:#94a3b8;background:#fff;}
    #erpReportsTab .erp-ar-search input{border:0;outline:0;width:100%;font:inherit;font-size:11.5px;color:#334155;background:transparent;}
    #erpReportsTab .erp-ar-report .table-container{margin:0;overflow-x:auto;}
    #erpReportsTab .erp-ar-table{width:100%;table-layout:fixed;font-size:11.5px;}
    #erpReportsTab .erp-ar-table th{background:#dfe9f4;color:#172554;font-size:10.5px;font-weight:600;padding:9px 7px;white-space:nowrap;}
    #erpReportsTab .erp-ar-table td{padding:9px 7px;color:#334155;vertical-align:middle;}
    #erpReportsTab .erp-ar-table th:nth-child(1){width:4%}.erp-ar-table th:nth-child(2){width:16%}.erp-ar-table th:nth-child(3){width:10%}.erp-ar-table th:nth-child(4){width:13%}.erp-ar-table th:nth-child(5){width:12%}.erp-ar-table th:nth-child(6){width:12%}.erp-ar-table th:nth-child(7){width:12%}.erp-ar-table th:nth-child(8){width:9%}.erp-ar-table th:nth-child(9){width:12%}
    #erpReportsTab .erp-ar-table tfoot td{background:#edf6ff;font-weight:600;color:#0f2a55;border-top:1px solid #cbd5e1;}
    #erpReportsTab .erp-ar-status{display:inline-flex;align-items:center;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:500;white-space:nowrap;}
    #erpReportsTab .erp-ar-status.partial{background:#fff0cf;color:#c46b00}.erp-ar-status.unpaid{background:#ffe0e4;color:#e11d48}.erp-ar-status.open{background:#e1f7ec;color:#07854c}
    #erpReportsTab .erp-ar-view{border:1px solid #bfdbfe;background:#eff6ff;color:#1677ff;border-radius:6px;padding:5px 8px;font-size:10px;font-weight:500;cursor:pointer;white-space:nowrap;}
    #erpReportsTab .erp-ar-table-footer{display:flex;justify-content:space-between;padding:9px 14px;color:#64748b;font-size:10.5px;border-top:1px solid #edf2f7;}
    #erpReportsTab:not(.erp-view-receivable) #erpReceivableHero,#erpReportsTab:not(.erp-view-receivable) #erpReceivableKpis{display:none;}
    @media(max-width:1100px){#erpReportsTab .erp-ar-kpis{grid-template-columns:repeat(2,1fr)}#erpReportsTab .erp-ar-table{min-width:980px}}

    @media print {
      #erpReportsTab .table-container { overflow:visible !important; }
      #erpReportsTab table { page-break-inside:auto; }
      #erpReportsTab tr { page-break-inside:avoid; break-inside:avoid; }
      #erpReportsTab thead { display:table-header-group; }
    }

    @media print {
      body * { visibility: hidden; }
      #printableInvoice, #printableInvoice * { visibility: visible; }
      #printableInvoice { position: absolute; left: 0; top: 0; width: 100%; padding: 20px; }
      .no-print { display: none !important; }
    }
    /* sort bar + Pakistani (DD-MM-YYYY) date boxes */
    .sort-bar{display:flex;align-items:center;gap:8px;margin:0 0 10px;flex-wrap:wrap}
    .sort-bar label{font-size:13px;color:var(--text-light);font-weight:600}
    .sort-bar select.form-control{width:auto;padding:6px 10px;font-size:13px}
    .pk-date-wrap{position:relative;display:flex;align-items:center;gap:6px}
    .pk-date-wrap input[type=text]{flex:1;min-width:0}
    .pk-date-btn{border:1px solid #cbd5e1;background:#fff;border-radius:6px;padding:6px 9px;cursor:pointer;font-size:15px;line-height:1}
    .pk-date-native{position:absolute;right:0;bottom:0;width:1px;height:1px;opacity:0;pointer-events:none;border:0;padding:0}
    .pk-date-invalid{border-color:#dc2626 !important}
    /* keep DD-MM-YYYY on one line in the list tables */
    #openingStockTableBody td:first-child,#danaTableBody td:first-child,#molderJobsTableBody td:first-child,#dispatchTableBody td:first-child,#paymentsTableBody td:first-child,#billsTableBody td:nth-child(2),#ledgerTableBody td:first-child{white-space:nowrap}


    /* ===== Payment Hub Reference Theme — fresh v16 ===== */
    body:has(#paymentsTab.active) .top-company-bar{display:none!important}
    body:has(#paymentsTab.active) .main-content{padding:0!important;overflow:hidden!important;background:#f3f7fc}
    #paymentsTab.active{display:flex!important;flex-direction:column;height:100vh;min-height:0;padding:20px 22px 18px;overflow:hidden;background:linear-gradient(180deg,#eef6ff 0,#f8fbff 150px,#f3f7fc 100%)}
    #paymentsTab .ph-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:16px;flex:0 0 auto}
    #paymentsTab .ph-title-wrap{display:flex;align-items:center;gap:14px;min-width:0}
    #paymentsTab .ph-title-icon{width:42px;height:42px;border-radius:12px;background:linear-gradient(145deg,#1688ff,#3b9cff);box-shadow:0 7px 16px rgba(37,99,235,.22);display:grid;place-items:center;color:#fff;font-size:19px}
    #paymentsTab .ph-title{font-size:25px;line-height:1.05;font-weight:800;color:#102344;letter-spacing:-.5px}
    #paymentsTab .ph-subtitle{font-size:12px;color:#4f6b91;margin-top:5px}
    #paymentsTab .ph-head-actions{display:flex;align-items:center;gap:10px}
    #paymentsTab .ph-date-now{font-size:12px;color:#4f6b91;text-align:right;line-height:1.35;padding-right:4px}
    #paymentsTab .ph-date-now strong{display:block;color:#173a6b;font-size:13px}
    #paymentsTab .ph-record{height:38px;padding:0 14px;border:0;border-radius:8px;background:#1677f2;color:#fff;font-weight:700;cursor:pointer;box-shadow:0 4px 10px rgba(22,119,242,.18)}
    #paymentsTab .ph-backup{height:38px;padding:0 13px;border:1px solid #d7e3f1;border-radius:8px;background:#fff;color:#1d4f91;font-weight:700;cursor:pointer}
    #paymentsTab .ph-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0 10px 14px;flex:0 0 auto}
    #paymentsTab .ph-kpi{height:96px;background:rgba(255,255,255,.94);border:1px solid #e4edf7;border-radius:12px;box-shadow:0 5px 16px rgba(15,49,91,.06);padding:13px 15px;display:flex;align-items:flex-start;gap:12px}
    #paymentsTab .ph-kpi-icon{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;color:#fff;font-size:19px;flex:0 0 36px;box-shadow:0 6px 13px rgba(15,23,42,.12)}
    #paymentsTab .ph-kpi.green .ph-kpi-icon{background:#16b85b} #paymentsTab .ph-kpi.red .ph-kpi-icon{background:#ef3f4d} #paymentsTab .ph-kpi.orange .ph-kpi-icon{background:#ff9f1a} #paymentsTab .ph-kpi.purple .ph-kpi-icon{background:#8a35df}
    #paymentsTab .ph-kpi-label{font-size:13px;color:#314d72;margin:0 0 5px}
    #paymentsTab .ph-kpi-value{font-size:21px;font-weight:800;color:#112b53;white-space:nowrap}
    #paymentsTab .ph-kpi-note{font-size:10px;margin-top:5px;color:#7890ad}
    #paymentsTab .ph-kpi.green .ph-kpi-note{color:#14a953} #paymentsTab .ph-kpi.red .ph-kpi-note{color:#ef3f4d} #paymentsTab .ph-kpi.orange .ph-kpi-note{color:#e88b00} #paymentsTab .ph-kpi.purple .ph-kpi-note{color:#8336db}
    #paymentsTab .ph-panel{background:#fff;border:1px solid #e1ebf5;border-radius:13px;box-shadow:0 5px 18px rgba(15,49,91,.055);display:flex;flex-direction:column;min-height:0;flex:1;overflow:hidden}
    #paymentsTab .ph-toolbar{min-height:62px;padding:12px 14px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #e9f0f7;flex:0 0 auto}
    #paymentsTab .ph-tabs{display:flex;align-items:center;gap:7px;white-space:nowrap}
    #paymentsTab .ph-tab{border:0;background:#f7faff;color:#244469;height:34px;padding:0 13px;border-radius:18px;font-size:12px;font-weight:700;cursor:pointer}
    #paymentsTab .ph-tab.active{background:#187cf4;color:#fff;box-shadow:0 4px 10px rgba(24,124,244,.22)}
    #paymentsTab .ph-count{display:inline-grid;place-items:center;min-width:19px;height:19px;padding:0 5px;border-radius:10px;background:#e7eef7;color:#54708f;font-size:10px;margin-left:4px}
    #paymentsTab .ph-tab.active .ph-count{background:rgba(255,255,255,.24);color:#fff}
    #paymentsTab .ph-tools{display:flex;align-items:center;gap:9px;min-width:0}
    #paymentsTab .ph-search{width:230px;height:36px;border:1px solid #d9e5f2;border-radius:8px;padding:0 12px;font-size:12px;color:#173a6b;outline:none;background:#fff}
    #paymentsTab .ph-date-range{height:36px;border:1px solid #d9e5f2;border-radius:8px;padding:0 10px;display:flex;align-items:center;gap:6px;color:#59728f;background:#fff;white-space:nowrap}
    #paymentsTab .ph-date-range input{width:112px;border:0;outline:0;font-size:11px;color:#27486e;background:transparent}
    #paymentsTab .ph-clear{border:0;background:transparent;color:#7a90aa;cursor:pointer;font-size:15px;padding:0 2px}
    #paymentsTab .ph-table-wrap{flex:1;min-height:0;overflow-x:auto;overflow-y:hidden;padding:10px 10px 0}
    #paymentsTab table.ph-table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0;font-size:11.5px;color:#17365e}
    #paymentsTab .ph-table th{position:sticky;top:0;z-index:4;height:46px;padding:0 9px;background:#eef6fc;color:#17365e;border-bottom:1px solid #dce8f3;font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.15px;white-space:nowrap}
    #paymentsTab .ph-table td{height:48px;padding:6px 9px;border-bottom:1px solid #e7eef6;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:#fff}
    #paymentsTab .ph-table tbody tr:hover td{background:#f8fbff}
    #paymentsTab .ph-table .c-num{width:34px;text-align:center}.ph-table .c-date{width:88px}.ph-table .c-party{width:120px}.ph-table .c-ref{width:130px}.ph-table .c-type{width:94px}.ph-table .c-amount{width:108px}.ph-table .c-mode{width:102px}.ph-table .c-pstatus{width:128px}.ph-table .c-bstatus{width:128px}.ph-table .c-balance{width:104px}.ph-table .c-actions{width:82px;text-align:center}
    #paymentsTab .ph-pill{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:27px;padding:4px 10px;border-radius:16px;font-size:10.5px;font-weight:800;line-height:1.05}
    #paymentsTab .ph-in{background:#d9f8e7;color:#078343}.ph-out{background:#ffe1e1;color:#e02424}.ph-advance{background:#e5edff;color:#2759c7}
    #paymentsTab .ph-cleared,.ph-paid{background:#d9f8e7;color:#078343}.ph-pending,.ph-partial{background:#fff0d5;color:#e38a00}.ph-bounced,.ph-unpaid{background:#ffe0e4;color:#dc3145}.ph-cancelled,.ph-unallocated{background:#edf2f7;color:#5c718c}
    #paymentsTab .ph-actions{display:inline-flex;align-items:center;gap:5px;position:relative;overflow:visible}
    #paymentsTab .ph-eye{width:34px;height:30px;border:0;border-radius:6px;background:#0b4ca3;color:#fff;cursor:pointer;font-size:14px;box-shadow:0 2px 5px rgba(11,76,163,.18)}
    #paymentsTab details.ph-menu{position:relative} #paymentsTab details.ph-menu>summary{list-style:none;width:34px;height:30px;border:1px solid #d8e3ef;border-radius:6px;background:#fff;color:#173a6b;display:grid;place-items:center;cursor:pointer;font-size:13px} #paymentsTab details.ph-menu>summary::-webkit-details-marker{display:none}
    #paymentsTab .ph-menu-box{position:absolute;right:0;top:35px;z-index:30;width:150px;padding:5px;background:#fff;border:1px solid #dce6f0;border-radius:8px;box-shadow:0 10px 25px rgba(15,49,91,.16)}
    #paymentsTab .ph-menu-box button{width:100%;border:0;background:#fff;text-align:left;padding:8px 9px;border-radius:6px;font-size:11px;color:#244469;cursor:pointer}.ph-menu-box button:hover{background:#f0f6fd}.ph-menu-box button.danger{color:#dc2626}
    #paymentsTab .ph-footer{height:46px;padding:0 14px;display:flex;align-items:center;justify-content:space-between;color:#6380a1;font-size:10.5px;flex:0 0 auto;border-top:1px solid #edf2f7} #paymentsTab .ph-pagination{display:flex;align-items:center;gap:5px} #paymentsTab .ph-page-btn{min-width:30px;height:30px;padding:0 8px;border:1px solid #dbe6f2;border-radius:6px;background:#fff;color:#31577f;font-size:11px;font-weight:600;cursor:pointer} #paymentsTab .ph-page-btn:hover:not(:disabled){background:#f2f7fd} #paymentsTab .ph-page-btn.active{background:#187cf4;border-color:#187cf4;color:#fff;box-shadow:0 3px 8px rgba(24,124,244,.18)} #paymentsTab .ph-page-btn:disabled{opacity:.38;cursor:default}
    #paymentsTab .ph-empty{text-align:center!important;color:#7890ad;padding:28px!important}
    @media(max-width:1180px){#paymentsTab.active{padding:14px}.ph-date-now{display:none!important}#paymentsTab .ph-toolbar{align-items:flex-start;flex-direction:column}#paymentsTab .ph-tools{width:100%}#paymentsTab .ph-search{flex:1;width:auto}#paymentsTab .ph-kpis{gap:10px}#paymentsTab .ph-kpi{padding:14px 12px}.ph-kpi-note{display:none}}

  
/* === V17 REFERENCE SHELL: sidebar + spacing foundation === */
.sidebar{
  width:296px !important; padding:0 !important;
  background:linear-gradient(180deg,#0b2343 0%,#081d38 100%) !important;
  border-right:1px solid rgba(148,163,184,.12); box-shadow:none !important;
}
.sidebar .logo-container{
  height:93px; padding:20px 22px !important; border-bottom:1px solid rgba(255,255,255,.14) !important;
  display:grid; grid-template-columns:42px 1fr; grid-template-rows:auto auto; column-gap:16px; align-content:center;
}
.sidebar .logo-container:before{
  content:'FK'; grid-row:1/3; width:42px;height:42px;border-radius:11px;
  display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:14px;
  background:linear-gradient(145deg,#2563eb,#38bdf8);box-shadow:0 7px 18px rgba(37,99,235,.35);
}
.sidebar .logo{grid-column:2;color:#fff !important;font-size:20px !important;line-height:1.2;font-weight:750 !important;letter-spacing:-.2px}
.sidebar .proprietor{grid-column:2;color:#a9bdd3 !important;font-size:11px !important;margin-top:5px !important}
.nav-menu{margin-top:8px !important;padding:5px 8px 14px !important;scrollbar-width:thin;scrollbar-color:#6b7f96 transparent}
.nav-item{
  min-height:48px;padding:0 18px !important;margin:0 !important;border-radius:9px;
  gap:11px !important;color:#b7c6d8 !important;font-size:14px !important;font-weight:600;
  border-left:0 !important;white-space:nowrap;
}
.nav-item:hover{background:rgba(255,255,255,.055) !important;color:#fff !important}
.nav-item.active{
  background:linear-gradient(90deg,#113766,#173f75) !important;color:#fff !important;
  box-shadow:inset 4px 0 0 #38bdf8, inset 0 0 0 1px rgba(96,165,250,.14);
  border-left:0 !important;
}
.main-content{padding:22px 24px !important;background:#f3f7fc;}
.top-company-bar{margin-bottom:16px !important}
.tab-content > .header-bar{margin-bottom:16px !important}
#paymentsTab{margin:0 !important;padding:0 !important}
#paymentsTab .ph-shell{gap:16px !important}
#paymentsTab .ph-kpis{gap:14px !important;margin:0 10px 14px !important}
#paymentsTab .ph-workspace{margin-top:0 !important}
#paymentsTab .ph-toolbar{padding:13px 12px !important;gap:12px !important}
#paymentsTab .ph-table-wrap{margin-top:0 !important}
@media(max-width:1100px){.sidebar{width:260px !important}.sidebar .logo-container{padding-left:18px !important}.nav-item{padding-left:15px !important}}



/* === V22 SIDEBAR: compact 35px rows, zero inter-item spacing === */
.sidebar{
  height:100vh !important;
  min-height:0 !important;
  overflow:hidden !important;
}
.sidebar .logo-container{
  box-sizing:border-box !important;
  height:82px !important;
  min-height:82px !important;
  padding:14px 18px !important;
}
.sidebar .logo-container:before{
  width:40px !important;
  height:40px !important;
  font-size:13px !important;
}
.sidebar .logo{font-size:18px !important;line-height:1.1 !important;}
.sidebar .proprietor{font-size:10.5px !important;margin-top:3px !important;}
.nav-menu{
  box-sizing:border-box !important;
  height:calc(100vh - 82px) !important;
  min-height:0 !important;
  margin:0 !important;
  padding:5px 8px 5px !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
  gap:0 !important;
  scrollbar-width:none !important;
}
.nav-menu::-webkit-scrollbar{display:none !important;width:0 !important;height:0 !important;}
.nav-item,
.nav-item:hover,
.nav-item.active{
  box-sizing:border-box !important;
  flex:0 0 35px !important;
  height:35px !important;
  min-height:35px !important;
  max-height:35px !important;
  margin:0 !important;
  padding:0 12px !important;
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  border-radius:8px !important;
  font-size:12.5px !important;
  line-height:1 !important;
  white-space:nowrap !important;
}
.nav-item.active{
  padding-left:12px !important;
  box-shadow:inset 4px 0 0 #38bdf8, inset 0 0 0 1px rgba(96,165,250,.14) !important;
}
@media(max-height:620px){
  .sidebar .logo-container{height:72px !important;min-height:72px !important;padding:10px 16px !important;}
  .sidebar .logo-container:before{width:36px !important;height:36px !important;}
  .sidebar .logo{font-size:17px !important;}
  .nav-menu{height:calc(100vh - 72px) !important;padding-top:3px !important;padding-bottom:3px !important;}
  .nav-item,.nav-item:hover,.nav-item.active{flex-basis:35px !important;height:35px !important;min-height:35px !important;max-height:35px !important;font-size:12px !important;}
}


/* === V23 SIDEBAR WIDTH: 240px; keep V22 35px row geometry === */
.sidebar{
  width:230px !important;
  min-width:230px !important;
  max-width:230px !important;
  flex:0 0 240px !important;
}
.sidebar .logo-container{
  grid-template-columns:40px minmax(0,1fr) !important;
  column-gap:12px !important;
}
.nav-item,.nav-item:hover,.nav-item.active{
  width:100% !important;
}
@media(max-width:1100px){
  .sidebar{width:230px !important;min-width:230px !important;max-width:230px !important;flex-basis:240px !important;}
}


/* v28 Payment Hub typography: softer reference-like weights only */
#paymentsHub .page-title, #paymentsHub h1, #paymentsHub .section-title { font-weight: 600 !important; }
#paymentsHub .subtitle, #paymentsHub .page-subtitle { font-weight: 400 !important; }
#paymentsHub .kpi-label, #paymentsHub .stat-label, #paymentsHub .summary-label,
#paymentsHub .card-title { font-weight: 500 !important; }
#paymentsHub .kpi-value, #paymentsHub .stat-value, #paymentsHub .summary-value,
#paymentsHub .metric-value { font-weight: 600 !important; }
#paymentsHub table thead th, #paymentsHub .table-header { font-weight: 600 !important; }
#paymentsHub table tbody td { font-weight: 400 !important; }
#paymentsHub .filter-btn, #paymentsHub .filter-pill, #paymentsHub .status-badge,
#paymentsHub .badge { font-weight: 500 !important; }
#paymentsHub .amount, #paymentsHub .payment-amount { font-weight: 500 !important; }


    /* v37: ERP Reports layout only — sidebar remains untouched */
    .main-content:has(#erpReportsTab.active) > .top-company-bar{display:none !important;}
    #erpReportsTab.active{padding-top:0 !important;}
    #erpReportsTab .erp-center-header{margin-top:0 !important;margin-bottom:10px !important;}
    #erpReportsTab .erp-report-filters{margin-top:0 !important;margin-bottom:12px !important;}
    #erpReportsTab .erp-ar-hero{margin-top:0 !important;}

  

/* v38 — Accounts Receivable visual polish to match approved reference.
   Formatting only: no report calculations/data logic and no sidebar/menu changes. */
#erpReportsTab.erp-view-receivable{font-family:Inter,Roboto,"Segoe UI",Arial,sans-serif!important;}
#erpReportsTab.erp-view-receivable .erp-center-header{
  min-height:78px!important;padding:14px 18px!important;margin-bottom:14px!important;
  border:1px solid #e6edf6!important;border-radius:12px!important;
  box-shadow:0 5px 18px rgba(15,23,42,.055)!important;background:#fff!important;
}
#erpReportsTab.erp-view-receivable .erp-center-title-wrap{gap:14px!important;}
#erpReportsTab.erp-view-receivable .erp-center-icon{
  width:42px!important;height:42px!important;flex:0 0 42px!important;border-radius:11px!important;font-size:18px!important;
}
#erpReportsTab.erp-view-receivable .erp-center-header .title{font-size:25px!important;font-weight:600!important;line-height:1.15!important;}
#erpReportsTab.erp-view-receivable .erp-center-header .subtitle{font-size:12.5px!important;line-height:1.4!important;margin-top:3px!important;color:#64748b!important;}
#erpReportsTab.erp-view-receivable .erp-header-actions{gap:9px!important;}
#erpReportsTab.erp-view-receivable .erp-header-actions .btn{height:38px!important;padding:0 14px!important;border-radius:8px!important;font-size:12.5px!important;font-weight:500!important;}

#erpReportsTab.erp-view-receivable .erp-report-filters{
  padding:14px 16px!important;margin-bottom:15px!important;border-radius:12px!important;
  border:1px solid #e2e8f0!important;box-shadow:0 4px 15px rgba(15,23,42,.045)!important;background:#fff!important;
}
#erpReportsTab.erp-view-receivable .erp-report-toolbar{margin-bottom:12px!important;}
#erpReportsTab.erp-view-receivable .erp-report-toolbar label{font-size:12.5px!important;font-weight:600!important;margin-bottom:5px!important;}
#erpReportsTab.erp-view-receivable .erp-report-selector{height:40px!important;font-size:12.5px!important;border-radius:8px!important;}
#erpReportsTab.erp-view-receivable .form-grid{gap:14px!important;}
#erpReportsTab.erp-view-receivable .form-group label{font-size:12px!important;font-weight:600!important;margin-bottom:6px!important;}
#erpReportsTab.erp-view-receivable .form-control{height:40px!important;font-size:12.5px!important;border-radius:8px!important;}
#erpReportsTab.erp-view-receivable .erp-report-filters .text-light{font-size:11.5px!important;line-height:1.4!important;}

#erpReportsTab.erp-view-receivable .erp-ar-hero{margin:3px 0 12px!important;padding:0 2px!important;gap:18px!important;}
#erpReportsTab.erp-view-receivable .erp-ar-hero h2{font-size:24px!important;font-weight:600!important;line-height:1.2!important;margin:0 0 4px!important;}
#erpReportsTab.erp-view-receivable .erp-ar-hero>div:first-child>div{font-size:12.5px!important;line-height:1.4!important;}
#erpReportsTab.erp-view-receivable .erp-report-date{min-width:190px!important;padding:9px 13px!important;border-radius:10px!important;gap:10px!important;}
#erpReportsTab.erp-view-receivable .erp-date-icon{width:32px!important;height:32px!important;border-radius:8px!important;font-size:14px!important;}
#erpReportsTab.erp-view-receivable .erp-report-date strong{font-size:12px!important;font-weight:600!important;}
#erpReportsTab.erp-view-receivable .erp-report-date span:last-child{font-size:11.5px!important;}

#erpReportsTab.erp-view-receivable .erp-ar-kpis{gap:14px!important;margin-bottom:16px!important;}
#erpReportsTab.erp-view-receivable .erp-ar-card{
  min-height:102px!important;padding:16px 18px!important;gap:14px!important;border-radius:12px!important;
  box-shadow:0 5px 18px rgba(15,23,42,.055)!important;
}
#erpReportsTab.erp-view-receivable .erp-ar-icon{width:42px!important;height:42px!important;flex:0 0 42px!important;border-radius:10px!important;font-size:17px!important;}
#erpReportsTab.erp-view-receivable .erp-ar-card small{font-size:12.5px!important;font-weight:500!important;margin-bottom:4px!important;}
#erpReportsTab.erp-view-receivable .erp-ar-card strong{font-size:21px!important;font-weight:600!important;line-height:1.15!important;}
#erpReportsTab.erp-view-receivable .erp-ar-card em{font-size:11.5px!important;margin-top:5px!important;line-height:1.25!important;}

#erpReportsTab.erp-view-receivable .erp-ar-report{border-radius:12px!important;box-shadow:0 5px 18px rgba(15,23,42,.05)!important;}
#erpReportsTab.erp-view-receivable .erp-ar-table-head{padding:14px 16px 10px!important;gap:14px!important;}
#erpReportsTab.erp-view-receivable .erp-ar-table-head h3{font-size:20px!important;font-weight:600!important;line-height:1.25!important;}
#erpReportsTab.erp-view-receivable .erp-ar-search{height:38px!important;width:270px!important;border-radius:8px!important;padding:0 11px!important;}
#erpReportsTab.erp-view-receivable .erp-ar-search input{font-size:12px!important;}
#erpReportsTab.erp-view-receivable .erp-ar-table{font-size:12.5px!important;}
#erpReportsTab.erp-view-receivable .erp-ar-table th{font-size:11.5px!important;font-weight:600!important;padding:11px 8px!important;background:#dbe7f3!important;}
#erpReportsTab.erp-view-receivable .erp-ar-table td{font-size:12.5px!important;padding:11px 8px!important;line-height:1.25!important;}
#erpReportsTab.erp-view-receivable .erp-ar-table tfoot td{padding-top:12px!important;padding-bottom:12px!important;}
#erpReportsTab.erp-view-receivable .erp-ar-status{padding:5px 10px!important;font-size:11px!important;font-weight:500!important;}
#erpReportsTab.erp-view-receivable .erp-ar-view{padding:6px 10px!important;border-radius:7px!important;font-size:11px!important;font-weight:500!important;}
#erpReportsTab.erp-view-receivable .erp-ar-table-footer{padding:11px 16px!important;font-size:11.5px!important;}


/* v42: Accounts Payable uses the tested Payment Hub/Receivable one-screen geometry. */
body:has(#erpReportsTab.active) .top-company-bar{display:none!important}
body:has(#erpReportsTab.active) .main-content{padding:0!important;overflow:hidden!important;background:#f3f7fc}
#erpReportsTab.active{display:flex!important;flex-direction:column;height:100vh;min-height:0;padding:14px 20px 12px;overflow:hidden;background:linear-gradient(180deg,#eef6ff 0,#f8fbff 150px,#f3f7fc 100%)}
#erpReportsTab.erp-view-payable .erp-center-header{flex:0 0 auto;height:62px;min-height:62px;padding:9px 14px!important;margin-bottom:9px!important}
#erpReportsTab.erp-view-payable .erp-report-filters{flex:0 0 auto;padding:10px 13px!important;margin-bottom:9px!important;border-radius:10px}
#erpReportsTab.erp-view-payable .erp-report-toolbar{display:contents!important}
#erpReportsTab.erp-view-payable .erp-report-filters{display:grid;grid-template-columns:minmax(300px,1.55fr) minmax(165px,.72fr) minmax(165px,.72fr) minmax(220px,1fr);column-gap:10px;align-items:end}
#erpReportsTab.erp-view-payable .erp-report-toolbar>div:first-child{min-width:0!important;grid-column:1}
#erpReportsTab.erp-view-payable #erpReportSelectionNote,#erpReportsTab.erp-view-payable #erpReportFilterHint{display:none!important}
#erpReportsTab.erp-view-payable .erp-report-filters>.form-grid{display:contents!important}
#erpReportsTab.erp-view-payable .erp-report-filter{min-width:0;margin:0!important}
#erpReportsTab.erp-view-payable .erp-report-selector,#erpReportsTab.erp-view-payable .form-control{width:100%;min-width:0;height:36px;font-size:12px;border-radius:7px}
#erpReportsTab.erp-view-payable .form-group label,#erpReportsTab.erp-view-payable .erp-report-toolbar label{font-size:11px!important;font-weight:600!important;margin-bottom:5px!important}
#erpReportsTab.erp-view-payable #erpPayableHero{flex:0 0 auto;margin:2px 0 9px}
#erpReportsTab.erp-view-payable #erpPayableKpis{flex:0 0 auto;margin-bottom:9px}
#erpReportsTab.erp-view-payable #erpPayableKpis .erp-ar-card{height:76px;min-height:76px;padding:10px 12px}
#erpReportsTab.erp-view-payable #erpSelectedReportArea{min-height:0;flex:1;display:flex;flex-direction:column}
#erpReportsTab.erp-view-payable #erpSourcePayable{display:flex;flex-direction:column;min-height:0;flex:1}
#erpReportsTab.erp-view-payable .erp-ar-table-head{flex:0 0 auto;padding:10px 13px 8px}
#erpReportsTab.erp-view-payable .erp-ar-table-head h3{font-size:14px}
#erpReportsTab.erp-view-payable .erp-ar-report .table-container{flex:1;min-height:0;overflow:auto}
#erpReportsTab.erp-view-payable .erp-ap-table{width:100%;table-layout:fixed;font-size:12px}
#erpReportsTab.erp-view-payable .erp-ap-table th{background:#dfe9f4;color:#172554;font-weight:600;font-size:11px;padding:10px 9px}
#erpReportsTab.erp-view-payable .erp-ap-table td{padding:10px 9px;font-size:12px}
#erpReportsTab.erp-view-payable .erp-ap-table th:nth-child(1){width:6%}
#erpReportsTab.erp-view-payable .erp-ap-table th:nth-child(2){width:44%}
#erpReportsTab.erp-view-payable .erp-ap-table th:nth-child(3){width:28%}
#erpReportsTab.erp-view-payable .erp-ap-table th:nth-child(4){width:22%}
#erpReportsTab.erp-view-payable .erp-ar-table-footer{flex:0 0 auto;min-height:39px;align-items:center}
#erpReportsTab.erp-view-payable .erp-ar-pagination{display:flex;gap:5px}
#erpReportsTab.erp-view-payable .erp-ar-page-btn{min-width:28px;height:28px;border:1px solid #dbe5f0;border-radius:6px;background:white;cursor:pointer}
#erpReportsTab.erp-view-payable .erp-ar-page-btn.active{background:#2563eb;color:white;border-color:#2563eb}
#erpReportsTab.erp-view-payable .erp-ar-page-btn:disabled{opacity:.4;cursor:default}
@media(max-height:760px){#erpReportsTab.erp-view-payable #erpPayableKpis .erp-ar-card{height:66px;min-height:66px}#erpReportsTab.erp-view-payable .erp-center-header{height:54px;min-height:54px}}
@media print{body:has(#erpReportsTab.active) .main-content{overflow:visible!important}#erpReportsTab.active{height:auto!important;overflow:visible!important}}


/* v43 — Global table-header standard: no prominent bottom line.
   Payment Hub remains the visual reference; data/logic/layout unchanged. */
#erpReportsTab table thead th,
#erpReportsTab .erp-ar-table th,
#erpReportsTab .erp-ap-table th {
  border-bottom: none !important;
}

/* v44 Party Account Summary — Payment Hub universal geometry */
#erpReportsTab.erp-view-party{overflow:hidden!important;}
#erpReportsTab.erp-view-party .erp-center-header{margin-bottom:10px!important;}
#erpReportsTab.erp-view-party .erp-report-filters{margin-bottom:9px!important;padding:10px 14px!important;}
#erpReportsTab.erp-view-party #erpPartyHero{min-height:42px;margin:0 10px 7px!important;padding:0 2px!important;}
#erpReportsTab.erp-view-party #erpPartyHero h2{font-size:22px!important;font-weight:600!important;margin:0 0 2px!important;}
#erpReportsTab.erp-view-party #erpPartyHero>div:first-child>div{font-size:12px!important;}
#erpReportsTab.erp-view-party #erpPartyKpis{gap:12px!important;margin:0 10px 10px!important;}
#erpReportsTab.erp-view-party #erpPartyKpis .erp-ar-card{height:74px;min-height:74px;padding:9px 12px;}
#erpReportsTab.erp-view-party #erpPartyKpis .erp-ar-icon{width:36px;height:36px;flex:0 0 36px;border-radius:10px;}
#erpReportsTab.erp-view-party #erpPartyKpis .erp-ar-card strong{font-size:18px;}
#erpReportsTab.erp-view-party #erpSelectedReportArea{margin:0 10px!important;}
#erpReportsTab.erp-view-party .erp-party-report{display:flex;flex-direction:column;border-radius:11px!important;overflow:hidden;}
#erpReportsTab.erp-view-party .erp-ar-table-head{padding:10px 13px!important;}
#erpReportsTab.erp-view-party .erp-ar-search{width:44%;max-width:470px;height:34px;}
#erpReportsTab.erp-view-party .erp-party-page-size{display:flex;align-items:center;gap:7px;font-size:11.5px;color:#334155;white-space:nowrap;}
#erpReportsTab.erp-view-party .erp-party-page-size select{height:32px;border:1px solid #dbe5f0;border-radius:7px;padding:0 24px 0 9px;background:#fff;color:#334155;}
#erpReportsTab.erp-view-party .erp-party-table{font-size:11.5px!important;table-layout:fixed;}
#erpReportsTab.erp-view-party .erp-party-table th{font-size:10.5px!important;padding:9px 6px!important;background:#dfe9f4!important;border-bottom:0!important;}
#erpReportsTab.erp-view-party .erp-party-table td{padding:8px 6px!important;}
#erpReportsTab.erp-view-party .erp-party-table th:nth-child(1){width:4%}#erpReportsTab.erp-view-party .erp-party-table th:nth-child(2){width:14%}#erpReportsTab.erp-view-party .erp-party-table th:nth-child(3){width:10%}#erpReportsTab.erp-view-party .erp-party-table th:nth-child(4){width:10%}#erpReportsTab.erp-view-party .erp-party-table th:nth-child(5){width:12%}#erpReportsTab.erp-view-party .erp-party-table th:nth-child(6){width:12%}#erpReportsTab.erp-view-party .erp-party-table th:nth-child(7){width:12%}#erpReportsTab.erp-view-party .erp-party-table th:nth-child(8){width:11%}#erpReportsTab.erp-view-party .erp-party-table th:nth-child(9){width:15%}
#erpReportsTab .erp-party-role,#erpReportsTab .erp-party-status{display:inline-flex;align-items:center;justify-content:center;border-radius:6px;padding:4px 9px;font-size:10px;font-weight:500;white-space:nowrap;}
#erpReportsTab .erp-party-role.client{background:#e3f1ff;color:#1677ff}#erpReportsTab .erp-party-role.supplier{background:#ffe7e7;color:#e53935}#erpReportsTab .erp-party-role.molder{background:#eee6ff;color:#7c3aed}
#erpReportsTab .erp-party-status.party-rec{background:#e3f1ff;color:#1677ff}#erpReportsTab .erp-party-status.party-pay{background:#ffe4e6;color:#dc2626}#erpReportsTab .erp-party-status.party-settled{background:#e1f7ec;color:#07854c}
#erpReportsTab.erp-view-party .erp-ar-table-footer{padding:9px 13px!important;min-height:38px;align-items:center;}
#erpReportsTab.erp-view-party .erp-ar-pagination{display:flex;gap:5px}#erpReportsTab.erp-view-party .erp-ar-page-btn{min-width:28px;height:28px;border:1px solid #dbe5f0;border-radius:6px;background:#fff;cursor:pointer}#erpReportsTab.erp-view-party .erp-ar-page-btn.active{background:#2563eb;color:#fff;border-color:#2563eb}#erpReportsTab.erp-view-party .erp-ar-page-btn:disabled{opacity:.4;cursor:default}
@media(max-height:760px){#erpReportsTab.erp-view-party #erpPartyKpis .erp-ar-card{height:66px;min-height:66px}#erpReportsTab.erp-view-party #erpPartyHero{min-height:36px;margin-bottom:5px!important}#erpReportsTab.erp-view-party .erp-report-filters{padding-top:8px!important;padding-bottom:8px!important}}

/* v45: Accounts Payable universal compact filter row — Report View | Date From | Date To | Party / Client */
#erpReportsTab.erp-view-payable .erp-report-filters{padding:6px 10px!important;min-height:58px!important;}
#erpReportsTab.erp-view-payable .erp-report-selector,
#erpReportsTab.erp-view-payable .erp-report-filter .form-control{height:34px!important;}
#erpReportsTab.erp-view-payable .erp-report-toolbar label,
#erpReportsTab.erp-view-payable .erp-report-filter label{margin-bottom:3px!important;line-height:1.05!important;}

/* v46: Party Account Summary uses the same universal compact filter row */
#erpReportsTab.erp-view-party .erp-report-filters{
  display:grid!important;
  grid-template-columns:minmax(300px,1.55fr) minmax(165px,.72fr) minmax(165px,.72fr) minmax(220px,1fr)!important;
  column-gap:10px!important;
  align-items:end!important;
  padding:6px 10px!important;
  min-height:58px!important;
  margin-bottom:9px!important;
}
#erpReportsTab.erp-view-party .erp-report-toolbar{display:contents!important;}
#erpReportsTab.erp-view-party .erp-report-toolbar>div:first-child{min-width:0!important;grid-column:1!important;}
#erpReportsTab.erp-view-party #erpReportSelectionNote,
#erpReportsTab.erp-view-party #erpReportFilterHint{display:none!important;}
#erpReportsTab.erp-view-party .erp-report-filters>.form-grid{display:contents!important;}
#erpReportsTab.erp-view-party .erp-report-filter{min-width:0!important;margin:0!important;}
#erpReportsTab.erp-view-party .erp-report-selector,
#erpReportsTab.erp-view-party .erp-report-filter .form-control{width:100%!important;min-width:0!important;height:34px!important;font-size:12px!important;border-radius:7px!important;}
#erpReportsTab.erp-view-party .erp-report-toolbar label,
#erpReportsTab.erp-view-party .erp-report-filter label{font-size:11px!important;font-weight:600!important;margin-bottom:3px!important;line-height:1.05!important;}

/* v49 — Party / Client Statement aligned to locked v48 global ERP report standard. */
#erpReportsTab.erp-view-client-statement{font-family:Inter,Roboto,"Segoe UI",Arial,sans-serif!important;}
#erpReportsTab.erp-view-client-statement .erp-center-header{height:62px!important;min-height:62px!important;padding:9px 14px!important;margin-bottom:9px!important;background:#fff!important;border:1px solid #e6edf6!important;border-radius:11px!important;box-shadow:0 4px 15px rgba(15,23,42,.045)!important;}
#erpReportsTab.erp-view-client-statement .erp-center-icon{width:34px!important;height:34px!important;flex:0 0 34px!important;border-radius:9px!important;font-size:15px!important;}
#erpReportsTab.erp-view-client-statement .erp-center-header .title{font-size:22px!important;font-weight:600!important;line-height:1.1!important;}
#erpReportsTab.erp-view-client-statement .erp-header-actions .btn{height:34px!important;padding:0 12px!important;border-radius:7px!important;font-size:11.5px!important;font-weight:500!important;}
#erpReportsTab.erp-view-client-statement .erp-report-filters{display:grid!important;grid-template-columns:minmax(300px,1.55fr) minmax(165px,.72fr) minmax(165px,.72fr) minmax(220px,1fr)!important;column-gap:10px!important;align-items:end!important;padding:6px 10px!important;min-height:58px!important;margin-bottom:9px!important;border-radius:10px!important;background:#fff!important;}
#erpReportsTab.erp-view-client-statement .erp-report-toolbar{display:contents!important;}
#erpReportsTab.erp-view-client-statement .erp-report-toolbar>div:first-child{min-width:0!important;grid-column:1!important;}
#erpReportsTab.erp-view-client-statement .erp-report-filters>.form-grid{display:contents!important;}
#erpReportsTab.erp-view-client-statement #erpReportSelectionNote,#erpReportsTab.erp-view-client-statement #erpReportFilterHint{display:none!important;}
#erpReportsTab.erp-view-client-statement .erp-report-filter{min-width:0!important;margin:0!important;}
#erpReportsTab.erp-view-client-statement .erp-report-selector,#erpReportsTab.erp-view-client-statement .form-control{width:100%!important;min-width:0!important;height:34px!important;font-size:12px!important;border-radius:7px!important;}
#erpReportsTab.erp-view-client-statement .form-group label,#erpReportsTab.erp-view-client-statement .erp-report-toolbar label{font-size:11px!important;font-weight:600!important;margin-bottom:3px!important;line-height:1.05!important;}
#erpReportsTab.erp-view-client-statement #erpClientStatementHero{margin:0 10px 7px!important;min-height:42px!important;padding:0 2px!important;}
#erpReportsTab.erp-view-client-statement #erpClientStatementHero h2{font-size:22px!important;font-weight:600!important;margin:0 0 2px!important;}
#erpReportsTab.erp-view-client-statement #erpClientStatementHero>div:first-child>div{font-size:12px!important;}
#erpReportsTab.erp-view-client-statement .erp-report-date{min-width:174px!important;padding:7px 11px!important;border-radius:9px!important;}
#erpReportsTab.erp-view-client-statement .erp-date-icon{width:30px!important;height:30px!important;border-radius:8px!important;font-size:13px!important;}
#erpReportsTab.erp-view-client-statement #erpClientStatementKpis{gap:12px!important;margin:0 10px 10px!important;}
#erpReportsTab.erp-view-client-statement #erpClientStatementKpis .erp-ar-card{height:74px!important;min-height:74px!important;padding:9px 12px!important;border-radius:10px!important;}
#erpReportsTab.erp-view-client-statement #erpClientStatementKpis .erp-ar-icon{width:36px!important;height:36px!important;flex:0 0 36px!important;border-radius:9px!important;font-size:14px!important;}
#erpReportsTab.erp-view-client-statement #erpClientStatementKpis .erp-ar-card small{font-size:11.5px!important;}
#erpReportsTab.erp-view-client-statement #erpClientStatementKpis .erp-ar-card strong{font-size:18px!important;}
#erpReportsTab.erp-view-client-statement #erpSelectedReportArea{margin:0 10px!important;min-height:0!important;flex:1!important;display:flex!important;flex-direction:column!important;}
#erpReportsTab.erp-view-client-statement .erp-client-statement-report{display:flex!important;flex-direction:column!important;min-height:0!important;flex:1!important;border-radius:11px!important;overflow:hidden!important;background:#fff!important;}
#erpReportsTab.erp-view-client-statement .erp-ar-table-head{padding:10px 13px 8px!important;flex:0 0 auto!important;}
#erpReportsTab.erp-view-client-statement .erp-ar-table-head h3{font-size:14px!important;font-weight:600!important;margin:0 0 4px!important;}
#erpReportsTab.erp-view-client-statement .erp-client-role-line{display:flex!important;gap:18px!important;color:#64748b!important;font-size:10.5px!important;}
#erpReportsTab.erp-view-client-statement .erp-client-statement-report .table-container{margin:0!important;min-height:0!important;flex:1!important;overflow:auto!important;}
#erpReportsTab.erp-view-client-statement .erp-client-statement-table{width:100%!important;table-layout:fixed!important;font-size:10.5px!important;}
#erpReportsTab.erp-view-client-statement .erp-client-statement-table th{background:#dfe9f4!important;color:#172554!important;font-size:9.5px!important;font-weight:600!important;padding:8px 5px!important;border-bottom:0!important;white-space:nowrap!important;}
#erpReportsTab.erp-view-client-statement .erp-client-statement-table td{font-size:10.5px!important;padding:8px 5px!important;line-height:1.2!important;}
#erpReportsTab.erp-view-client-statement .erp-client-statement-table th:nth-child(1){width:8%}#erpReportsTab.erp-view-client-statement .erp-client-statement-table th:nth-child(2){width:10%}#erpReportsTab.erp-view-client-statement .erp-client-statement-table th:nth-child(3){width:10%}#erpReportsTab.erp-view-client-statement .erp-client-statement-table th:nth-child(4){width:10%}#erpReportsTab.erp-view-client-statement .erp-client-statement-table th:nth-child(5){width:11%}#erpReportsTab.erp-view-client-statement .erp-client-statement-table th:nth-child(6){width:13%}#erpReportsTab.erp-view-client-statement .erp-client-statement-table th:nth-child(7){width:6%}#erpReportsTab.erp-view-client-statement .erp-client-statement-table th:nth-child(8){width:10%}#erpReportsTab.erp-view-client-statement .erp-client-statement-table th:nth-child(9){width:10%}#erpReportsTab.erp-view-client-statement .erp-client-statement-table th:nth-child(10){width:12%}
@media(max-height:760px){#erpReportsTab.erp-view-client-statement #erpClientStatementKpis .erp-ar-card{height:66px!important;min-height:66px!important}#erpReportsTab.erp-view-client-statement #erpClientStatementHero{min-height:36px!important;margin-bottom:5px!important}}
    /* ===================== v93 — Molder Job Orders: styled to match ERP Report Center (display only) ===================== */
    #molderJobsTab .mj-hero{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 12px;flex-wrap:wrap}
    #molderJobsTab .mj-title-wrap{display:flex;align-items:center;gap:12px}
    #molderJobsTab .mj-icon{width:42px;height:42px;border-radius:11px;background:linear-gradient(135deg,#7c5cff,#5b3df5);color:#fff;display:flex;align-items:center;justify-content:center;font-size:18px;box-shadow:0 6px 14px rgba(91,61,245,.28);flex:0 0 42px}
    #molderJobsTab .mj-hero h1{font-size:24px;font-weight:600;margin:0;line-height:1.2;color:#0f172a}
    #molderJobsTab .mj-hero p{margin:2px 0 0;font-size:12.5px;color:#64748b}
    #molderJobsTab .mj-hero-actions{display:flex;gap:8px;flex-wrap:wrap}
    #molderJobsTab .mj-hbtn{height:36px;padding:0 14px;border-radius:8px;border:1px solid #dbe5f0;background:#fff;color:#334155;font-size:12.5px;font-weight:500;cursor:pointer;display:inline-flex;align-items:center;gap:6px}
    #molderJobsTab .mj-hbtn:hover{background:#f8fafc}
    #molderJobsTab .mj-hbtn.primary{background:#2563eb;border-color:#2563eb;color:#fff}
    #molderJobsTab .mj-hbtn.primary:hover{background:#1d4ed8}
    #molderJobsTab .mj-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:14px}
    #molderJobsTab .mj-card{background:#fff;border:1px solid #e2e8f0;border-radius:12px;display:flex;align-items:center;gap:13px;padding:14px 16px;box-shadow:0 5px 18px rgba(15,23,42,.045);min-height:84px}
    #molderJobsTab .mj-ki{width:42px;height:42px;border-radius:10px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:17px;flex:0 0 42px}
    #molderJobsTab .mj-ki.blue{background:#5865f2}#molderJobsTab .mj-ki.orange{background:#ff9818}#molderJobsTab .mj-ki.green{background:#16b364}#molderJobsTab .mj-ki.red{background:#ef4050}
    #molderJobsTab .mj-card small{display:block;color:#475569;font-size:12.5px;font-weight:500;margin-bottom:3px}
    #molderJobsTab .mj-card strong{display:block;color:#0f2a55;font-size:21px;font-weight:600;line-height:1.15}
    #molderJobsTab .mj-card strong.neg{color:#e11d48}
    #molderJobsTab .mj-card em{display:block;color:#64748b;font-size:11.5px;font-style:normal;margin-top:4px}
    #molderJobsTab .mj-strip{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 14px;padding:10px 14px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 3px 12px rgba(15,23,42,.035)}
    #molderJobsTab .mj-strip-title{font-size:11.5px;font-weight:600;color:#475569;text-transform:uppercase;letter-spacing:.04em;margin-right:4px}
    #molderJobsTab .mj-mchip{display:inline-flex;align-items:center;gap:8px;padding:5px 12px 5px 6px;border:1px solid #e2e8f0;border-radius:999px;background:#f8fafc;font-size:12px;color:#334155}
    #molderJobsTab .mj-av{width:24px;height:24px;border-radius:50%;background:#e0e7ff;color:#3730a3;font-size:10.5px;font-weight:700;display:flex;align-items:center;justify-content:center}
    #molderJobsTab .mj-mchip b{font-weight:600;color:#0f2a55}
    #molderJobsTab .mj-mchip.warn{background:#fff8e6;border-color:#fde7b0}#molderJobsTab .mj-mchip.warn b{color:#c46b00}
    #molderJobsTab .mj-mchip.neg{background:#fff1f2;border-color:#fecdd3}#molderJobsTab .mj-mchip.neg b{color:#e11d48}
    #molderJobsTab .mj-report{background:#fff;border:1px solid #e2e8f0;border-radius:12px;overflow:hidden;box-shadow:0 5px 18px rgba(15,23,42,.05)}
    #molderJobsTab .mj-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;flex-wrap:wrap;border-bottom:1px solid #edf2f7}
    #molderJobsTab .mj-seg{display:inline-flex;background:#f1f5f9;border-radius:9px;padding:3px;gap:2px;flex-wrap:wrap}
    #molderJobsTab .mj-seg-btn{border:0;background:transparent;padding:7px 14px;border-radius:7px;font-size:12.5px;font-weight:500;color:#475569;cursor:pointer;display:inline-flex;align-items:center;gap:7px}
    #molderJobsTab .mj-seg-btn .n{background:#e2e8f0;color:#475569;border-radius:999px;padding:1px 8px;font-size:11px}
    #molderJobsTab .mj-seg-btn.on{background:#fff;color:#1d4ed8;box-shadow:0 1px 3px rgba(15,23,42,.12);font-weight:600}
    #molderJobsTab .mj-seg-btn.on .n{background:#dbeafe;color:#1d4ed8}
    #molderJobsTab .mj-search{height:36px;width:260px;border:1px solid #dbe5f0;border-radius:8px;display:flex;align-items:center;gap:7px;padding:0 11px;color:#94a3b8;background:#fff}
    #molderJobsTab .mj-search input{border:0;outline:0;width:100%;font:inherit;font-size:12.5px;color:#334155;background:transparent}
    #molderJobsTab .mj-section{display:none}
    #molderJobsTab[data-view="jobs"] .mj-section[data-v="jobs"],#molderJobsTab[data-view="issues"] .mj-section[data-v="issues"],#molderJobsTab[data-view="receipts"] .mj-section[data-v="receipts"]{display:block}
    #molderJobsTab .mj-toolbar{display:flex;align-items:center;gap:10px;padding:10px 16px 0;flex-wrap:wrap}
    #molderJobsTab .mj-fchip{border:1px solid #dbe5f0;background:#fff;color:#475569;border-radius:999px;padding:4px 12px;font-size:12px;cursor:pointer}
    #molderJobsTab .mj-fchip.on{background:#2563eb;border-color:#2563eb;color:#fff}
    #molderJobsTab .mj-toolbar label{font-size:12px;color:#64748b}
    #molderJobsTab .mj-toolbar select{height:32px;border:1px solid #dbe5f0;border-radius:7px;background:#fff;font-size:12px;padding:0 8px;color:#334155}
    #molderJobsTab .mj-section .table-container{margin:10px 0 0;border:0;box-shadow:none;border-radius:0;overflow-x:auto}
    #molderJobsTab .mj-table{width:100%;font-size:12px;border-collapse:collapse}
    #molderJobsTab .mj-table th{background:#dbe7f3;color:#172554;font-size:11.5px;font-weight:600;padding:11px 8px;text-align:left;white-space:nowrap;text-transform:none;letter-spacing:0;border:0}
    #molderJobsTab .mj-table td{padding:11px 8px;color:#334155;vertical-align:middle;border-bottom:1px solid #edf2f7;line-height:1.3;white-space:nowrap}
    #molderJobsTab .mj-table tbody tr:hover td{background:#f5f9ff}
    #molderJobsTab .mj-table tbody tr:last-child td{border-bottom:0}
    #molderJobsTab .mj-main{font-weight:600;color:#0f2a55}
    #molderJobsTab .mj-sub{font-size:11px;color:#64748b;margin-top:2px;font-weight:400}
    #molderJobsTab .mj-dim{color:#94a3b8}
    #molderJobsTab .mj-chip{display:inline-flex;align-items:center;border-radius:999px;padding:4px 10px;font-size:11px;font-weight:500;white-space:nowrap}
    #molderJobsTab .mj-chip.open,#molderJobsTab .mj-chip.warn{background:#fff0cf;color:#c46b00}
    #molderJobsTab .mj-chip.closed,#molderJobsTab .mj-chip.ok{background:#e1f7ec;color:#07854c}
    #molderJobsTab .mj-chip.cancel,#molderJobsTab .mj-chip.neg{background:#ffe0e4;color:#e11d48}
    #molderJobsTab .mj-chip.posted{background:#e0ecff;color:#1d4ed8}
    #molderJobsTab .mj-actions{display:flex;gap:6px;flex-wrap:nowrap}
    #molderJobsTab .mj-btn{border:1px solid #bfdbfe;background:#eff6ff;color:#1677ff;border-radius:7px;padding:5px 10px;font-size:11.5px;font-weight:500;cursor:pointer;white-space:nowrap;margin:0}
    #molderJobsTab .mj-btn:hover{filter:brightness(.97)}
    #molderJobsTab .mj-btn.warn{background:#fff7ed;border-color:#fed7aa;color:#c2410c}
    #molderJobsTab .mj-btn.danger{background:#fff1f2;border-color:#fecdd3;color:#e11d48}
    #molderJobsTab .mj-btn.ghost{background:#fff;border-color:#cbd5e1;color:#334155}
    #molderJobsTab .mj-empty td,#molderJobsTab .mj-nomatch td{text-align:center;padding:34px 10px;color:#64748b;white-space:normal}
    #molderJobsTab .mj-empty b{display:block;color:#334155;font-size:14px;margin-bottom:4px}
    #molderJobsTab .mj-nomatch{display:none}
    #molderJobsTab .mj-footer{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:10px 16px;color:#64748b;font-size:11.5px;border-top:1px solid #edf2f7}
    #molderJobsTab .mj-flow{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 14px;font-size:12px;color:#475569}
    #molderJobsTab .mj-flow span{background:#fff;border:1px solid #e2e8f0;border-radius:999px;padding:4px 11px}
    #molderJobsTab .mj-flow i{font-style:normal;color:#94a3b8}
    @media(max-width:1100px){#molderJobsTab .mj-kpis{grid-template-columns:repeat(2,1fr)}}
    @media(max-width:700px){#molderJobsTab .mj-kpis{grid-template-columns:1fr}#molderJobsTab .mj-search{width:100%}}

    /* ---- Molder modals ---- */
    #joModal .modal-content,#miModal .modal-content,#prModal .modal-content{max-width:600px;padding:0;overflow:hidden;border-radius:14px}
    .mj-mhead{display:flex;align-items:center;gap:12px;padding:18px 22px;border-bottom:1px solid #e8eef6;background:linear-gradient(180deg,#fafcff,#fff)}
    .mj-mhead .mj-icon{width:38px;height:38px;border-radius:10px;background:linear-gradient(135deg,#7c5cff,#5b3df5);color:#fff;display:flex;align-items:center;justify-content:center;font-size:16px;flex:0 0 38px}
    .mj-mhead h3{margin:0;font-size:17px;font-weight:600;color:#0f172a}.mj-mhead p{margin:2px 0 0;font-size:12px;color:#64748b}
    .mj-mbody{padding:18px 22px 6px}
    .mj-mbody .form-group{margin-bottom:12px}
    .mj-mbody label{font-size:12px;font-weight:600;color:#334155}
    .mj-legend{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:#64748b;margin:6px 0 8px;padding-bottom:5px;border-bottom:1px dashed #dbe5f0}
    .mj-hint{background:#eff6ff;border:1px solid #bfdbfe;color:#1e3a8a;border-radius:9px;padding:9px 12px;font-size:12px;margin:4px 0 12px;line-height:1.5}
    .mj-mfoot{display:flex;justify-content:flex-end;gap:8px;padding:14px 22px;background:#f8fafc;border-top:1px solid #e8eef6}
    .mj-mfoot .btn{margin:0}
  