:root{--bg:#f4f7fb;--panel:#fff;--text:#162033;--muted:#657087;--border:#dfe5ee;--primary:#1d5fe5;--green:#20a744;--red:#e32727;--pink:#e500cc;--blue:#061be7;--shadow:0 8px 24px rgba(22,32,51,.07)}*{box-sizing:border-box}body{margin:0;font-family:"Sarabun","Noto Sans Thai",Tahoma,sans-serif;background:var(--bg);color:var(--text)}button,input,select,textarea{font:inherit}.topbar{padding:20px 3vw 24px;display:flex;justify-content:space-between;align-items:center;color:#fff;background:linear-gradient(120deg,#173f8f,#2563eb 60%,#52a0ff)}.topbar h1{margin:3px 0;font-size:28px}.topbar p{margin:0;opacity:.85}.eyebrow{letter-spacing:.15em;font-size:10px;font-weight:800}.prototype-badge{border:1px solid #ffffff88;border-radius:999px;padding:8px 14px;font-weight:800}.module-nav{display:flex;gap:7px;padding:10px 2vw;background:#fff;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:5}.nav-btn{border:0;background:transparent;padding:10px 14px;border-radius:9px;font-weight:700;cursor:pointer}.nav-btn.active{background:#e9f0ff;color:var(--primary)}.nav-btn.settings{margin-left:auto}.page-shell{max-width:1920px;margin:auto;padding:12px}.notice{background:#fff6d7;border:1px solid #f0d67c;padding:10px 14px;border-radius:10px;margin-bottom:12px}.app-page{display:none}.app-page.active{display:block}.panel,.print-sheet{background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:18px;margin-bottom:12px;box-shadow:var(--shadow)}.section-heading,.page-title,.points-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:13px}.section-heading h2,.page-title h2,.panel h2{margin:0;font-size:20px}.section-heading p,.page-title p,.points-head p{margin:3px 0 0;color:var(--muted);font-size:13px}.filter-grid{display:grid;gap:10px;align-items:end}.filter-grid.five{grid-template-columns:1.2fr 1fr 1fr 1fr auto}.filter-grid label,.report-toolbar label,.dialog-body label,.rate-editor label,.rule-calc label{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:700}.filter-grid input,.filter-grid select,.report-toolbar input,.dialog-body input,.dialog-body select,.dialog-body textarea,.rate-editor input,.rule-calc input{border:1px solid #cfd7e5;border-radius:8px;padding:9px;background:#fff;min-width:0}.filter-actions{display:flex;gap:7px}.btn{border:0;border-radius:8px;padding:9px 14px;font-weight:700;cursor:pointer}.btn.primary{background:var(--primary);color:#fff}.btn.secondary{background:#edf1f7;color:#26344e}.btn.redeem{background:#f3a000;color:#fff}.overview-grid{display:grid;grid-template-columns:1fr 2fr;gap:12px}.info-list{margin:0}.info-list>div{display:grid;grid-template-columns:105px 1fr;padding:5px 0}.info-list dt{color:var(--muted)}.info-list dd{margin:0;font-weight:600}.card-title{font-weight:800;font-size:17px}.points-kpis,.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.points-kpis>div,.kpi-grid>div{border:1px solid var(--border);border-radius:10px;padding:12px}.points-kpis span,.kpi-grid span{display:block;color:var(--muted);font-size:12px}.points-kpis strong,.kpi-grid strong{font-size:21px}.points-kpis .highlight{background:#eaf8f0;border-color:#9ad9b7}.table-fit{width:100%;overflow:hidden}.table-fit table{width:100%;border-collapse:collapse;table-layout:fixed}.table-fit th,.table-fit td{border-bottom:1px solid #d9e0ea;padding:6px 5px;vertical-align:middle;line-height:1.15;overflow-wrap:anywhere}.table-fit th{background:var(--green);color:#fff;text-align:center;font-size:11px;font-weight:800;white-space:normal}.table-fit td{font-size:11px}.table-fit .num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}.table-fit tfoot td{font-weight:800;background:#edf2fa}.summary-fit th,.summary-fit td{font-size:10px;padding:5px 3px}.summary-fit th:nth-child(1){width:5.5%}.summary-fit th:not(:first-child){width:6.3%}.company-link{color:#0c55de;font-weight:800;cursor:pointer;text-decoration:underline}.company-link.all-link{color:#111}.detail-fit th,.detail-fit td{font-size:9.5px;padding:5px 3px}.detail-fit th:nth-child(1){width:4%}.detail-fit th:nth-child(2),.detail-fit th:nth-child(3){width:6.3%}.detail-fit th:nth-child(4){width:5%}.detail-fit th:nth-child(5){width:4.5%}.detail-fit th:nth-child(6){width:6%}.detail-fit th:nth-child(7){width:8%}.detail-fit th:nth-child(n+8){width:4.7%}.detail-fit td:nth-child(7){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.segmented{display:flex;border:1px solid var(--border);border-radius:9px;overflow:hidden}.segmented button{border:0;background:#fff;padding:8px 13px}.segmented .active{background:var(--primary);color:#fff}.status{display:inline-block;padding:3px 7px;border-radius:999px;font-weight:700}.status.yes{background:#e0f5e9;color:#11804f}.status.no{background:#ffe7e8;color:#b92b35}.empty-state{text-align:center;color:var(--muted);padding:25px}.report-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:end;background:#fff;padding:12px;border-radius:12px;margin-bottom:12px;border:1px solid var(--border)}.report-toolbar label{min-width:140px}.report-title{text-align:center;color:#061be7;font-size:22px;margin:0 0 10px}.report-dates{display:flex;gap:45px;margin:0 0 10px 12px;font-size:12px}.print-table th,.print-table td{font-size:8.5px;padding:4px 2px;border:1px solid #222}.print-table th{height:54px}.print-table .group-head{background:#145b98}.print-table .subhead{background:#f39a00}.print-table .pink{background:#f000d4}.print-table .red{background:#e90000}.print-table .blue{background:#071bea}.print-table .yellow{background:#fff800;color:#111}.print-table tbody tr:nth-child(even) td{background:#e5f1e2}.sales-grid th,.sales-grid td{font-size:9px}.sales-grid thead tr:nth-child(1) th{background:#fff800;color:#111}.sales-grid thead tr:nth-child(2) th{background:#155c98}.sales-grid thead tr:nth-child(3) th{background:#f39a00}.sales-grid .company-alt{background:#37a94b!important}.sales-grid .company-pink{background:#ef00cf!important}.sales-grid .company-red{background:#e00000!important}.rate-editor{display:grid;grid-template-columns:1fr auto 1fr 1fr 1fr auto;gap:10px;align-items:end}.equals{font-size:25px;font-weight:900;padding-bottom:7px}.hint{color:var(--muted);font-size:12px}.rule-calc{display:grid;grid-template-columns:repeat(4,1fr) 1.2fr;gap:10px;align-items:end}.calc-result{background:#eaf8f0;border-radius:10px;padding:10px}.calc-result span{display:block;font-size:12px}.calc-result strong{font-size:20px}.customer-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.customer-card-mini,.vendor-card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:14px;cursor:pointer}.mini-line{display:flex;justify-content:space-between;padding:4px 0}.dialog-head,.dialog-actions{display:flex;justify-content:space-between;align-items:center;gap:12px}.dialog-body{display:grid;gap:11px;padding:14px 0}.dialog-actions{justify-content:flex-end}.icon-btn{border:0;background:transparent;font-size:25px}dialog{border:0;border-radius:14px;min-width:420px;box-shadow:0 20px 70px #0005}.redeem-preview{background:#eef4ff;border-radius:10px;padding:10px}.redeem-preview span{display:block;font-size:12px}.redeem-preview strong{font-size:20px}.redeem-preview small{display:block;color:#d4202f}
@media(max-width:1200px){.page-shell{padding:8px}.summary-fit th,.summary-fit td{font-size:8px}.detail-fit th,.detail-fit td{font-size:8px}.overview-grid{grid-template-columns:1fr}.filter-grid.five{grid-template-columns:repeat(2,1fr)}.rate-editor,.rule-calc{grid-template-columns:repeat(2,1fr)}}
@media print{@page{size:A4 landscape;margin:7mm}body{background:#fff}.topbar,.module-nav,.notice,.no-print{display:none!important}.page-shell{padding:0;max-width:none}.app-page{display:none!important}.app-page.active{display:block!important}.panel,.print-sheet{box-shadow:none;border:0;border-radius:0;padding:0;margin:0}.report-title{font-size:18px}.report-dates{font-size:10px}.print-table th,.print-table td{font-size:7px;padding:2px 1px}.print-table th{height:44px}.report-page .print-sheet{display:block}.report-page{page-break-after:always}}

/* V4 refinements */
.table-fit table{min-width:0!important}
.summary-fit th{background:#21a545}.summary-fit th:nth-child(4){background:#e90000}.summary-fit th:nth-child(14){background:#071bea}.summary-fit th:nth-child(15),.summary-fit th:nth-child(16){background:#e600ce}
.detail-table thead th{background:#20a747}.detail-table thead th:nth-child(5){background:#e42626}.detail-table thead th:nth-child(18){background:#df06c9}
.print-table th{height:auto;min-height:42px;line-height:1.05;white-space:normal}.sales-grid th{height:auto;min-height:30px;line-height:1.05}
.customer-filter{grid-template-columns:1.4fr 1fr 1fr auto}.customer-ledger-head{display:grid;grid-template-columns:1fr 2fr;gap:12px}.customer-kpis{height:100%;align-items:stretch}
.po-select-block{border:1px solid #d7dfeb;border-radius:10px;padding:10px}.po-select-title{font-weight:800}.po-select-block p{font-size:11px;color:var(--muted);margin:3px 0 8px}.po-check-list{max-height:190px;overflow:auto;border:1px solid #e2e7ef;border-radius:8px}.po-check-row{display:grid;grid-template-columns:24px 1.2fr 1fr 1fr;gap:7px;align-items:center;padding:7px;border-bottom:1px solid #eef1f6;font-size:11px}.po-check-row.used{opacity:.5;background:#f5f5f5}.po-selected-total{text-align:right;padding-top:8px}
@media(max-width:1000px){.customer-ledger-head{grid-template-columns:1fr}.customer-filter{grid-template-columns:1fr 1fr}}
@media print{
*{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;color-adjust:exact!important}
.print-sheet{width:100%;overflow:visible}.print-table table{table-layout:fixed;width:100%}.print-table th,.print-table td{font-size:6.6px!important;padding:2px 1px!important;line-height:1.05!important}.print-table th{height:auto!important;min-height:30px!important}.sales-grid th,.sales-grid td{font-size:6.3px!important;padding:2px 1px!important}.report-title{font-size:16px!important;margin-bottom:6px!important}.report-dates{margin-bottom:5px!important}
}


/* FIFO PO redemption details */
.fifo-row{display:grid;grid-template-columns:44px 110px minmax(150px,1fr) minmax(120px,1fr) 140px;gap:10px;align-items:center}
.fifo-order{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:#eef2ff;font-weight:700}
.allocation-table{width:100%;font-size:12px;border-collapse:collapse}
.allocation-table th,.allocation-table td{padding:6px 8px;white-space:nowrap}
.allocation-table th{background:#f5f7fb}

/* V6: readable redemption history, redeemed PO highlight, rule deletion, chronological ledgers */
.redemption-history-fit{overflow-x:auto}
.redemption-history-table{table-layout:fixed!important;min-width:1050px!important}
.redemption-history-table>thead>tr>th:nth-child(1){width:10%}
.redemption-history-table>thead>tr>th:nth-child(2){width:17%}
.redemption-history-table>thead>tr>th:nth-child(3){width:47%}
.redemption-history-table>thead>tr>th:nth-child(4){width:13%}
.redemption-history-table>thead>tr>th:nth-child(5){width:13%}
.redemption-history-table>tbody>tr>td{vertical-align:top;padding:8px}
.allocation-table{table-layout:fixed;width:100%!important;min-width:560px;border-collapse:collapse;background:#fff}
.allocation-table th,.allocation-table td{padding:6px 8px!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis}
.allocation-table th:nth-child(1){width:34%}
.allocation-table th:nth-child(2){width:24%}
.allocation-table th:nth-child(3){width:20%}
.allocation-table th:nth-child(4){width:22%}

.redeemed-row>td{background:#fff4cf!important}
.redeemed-row.partially-used>td{background:#fff4cf!important}
.redeemed-row.fully-used>td{background:#ffe1e1!important}
.redeemed-row>td:first-child{box-shadow:inset 5px 0 0 #f59e0b}
.redeemed-row.fully-used>td:first-child{box-shadow:inset 5px 0 0 #dc2626}
.statement-redeem-row>td{background:#fff0c7!important;font-weight:700}
.statement-redeem-row>td:first-child{box-shadow:inset 5px 0 0 #f59e0b}

.rules-table th:nth-child(1){width:24%}.rules-table th:nth-child(2){width:17%}.rules-table th:nth-child(3){width:14%}.rules-table th:nth-child(4){width:13%}.rules-table th:nth-child(5){width:16%}.rules-table th:nth-child(6){width:9%}.rules-table th:nth-child(7){width:7%}
.action-cell{text-align:center}.btn-delete-rule{border:1px solid #dc2626;background:#fff;color:#b91c1c;border-radius:7px;padding:5px 12px;font-weight:700;cursor:pointer}.btn-delete-rule:hover{background:#fee2e2}

.po-ledger-table,.statement-ledger-table{table-layout:fixed}
.po-ledger-table th:nth-child(1){width:10%}.po-ledger-table th:nth-child(2){width:9%}.po-ledger-table th:nth-child(3){width:15%}.po-ledger-table th:nth-child(4){width:13%}.po-ledger-table th:nth-child(5){width:9%}.po-ledger-table th:nth-child(n+6){width:11%}
.statement-ledger-table th:nth-child(1){width:10%}.statement-ledger-table th:nth-child(2){width:9%}.statement-ledger-table th:nth-child(3){width:19%}.statement-ledger-table th:nth-child(4){width:29%}.statement-ledger-table th:nth-child(n+5){width:11%}

/* V7: direct points redemption, flat history headings and edit action */
#rewardQty[readonly]{background:#f3f6fb;font-weight:800;color:#0f172a}
.redemption-history-table{min-width:1320px!important}
.redemption-history-table>thead>tr>th:nth-child(1){width:9%}
.redemption-history-table>thead>tr>th:nth-child(2){width:13%}
.redemption-history-table>thead>tr>th:nth-child(3){width:17%}
.redemption-history-table>thead>tr>th:nth-child(4){width:13%}
.redemption-history-table>thead>tr>th:nth-child(5){width:11%}
.redemption-history-table>thead>tr>th:nth-child(6){width:12%}
.redemption-history-table>thead>tr>th:nth-child(7){width:11%}
.redemption-history-table>thead>tr>th:nth-child(8){width:9%}
.redemption-history-table>thead>tr>th:nth-child(9){width:5%}
.redemption-history-table td{vertical-align:middle!important}
.redemption-history-table .allocation-continuation td{border-top:0}
.redemption-history-table .allocation-continuation td:nth-child(-n+2),
.redemption-history-table .allocation-continuation td:nth-child(n+7){background:#fafbfe}
.btn-edit-redemption{border:1px solid #2563eb;background:#fff;color:#1d4ed8;border-radius:7px;padding:5px 10px;font-weight:700;cursor:pointer;white-space:nowrap}
.btn-edit-redemption:hover{background:#eff6ff}
.points-explanation{display:block;color:#64748b;font-size:10px;margin-top:2px}

/* REV44: report readability and numeric display */
table td.num.negative, table td.negative, .loss-text { color:#d71920 !important; font-weight:700; }
#summaryReportTable table { table-layout:fixed; min-width:1500px; }
#summaryReportTable th:nth-child(1), #summaryReportTable td:nth-child(1){width:42px;min-width:42px;max-width:42px;text-align:center;padding-left:3px;padding-right:3px;}
#summaryReportTable th:nth-child(2), #summaryReportTable td:nth-child(2){width:165px;min-width:165px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#summaryReportTable th:nth-child(n+3), #summaryReportTable td:nth-child(n+3){min-width:92px;}
#salesReportTable table { table-layout:fixed; }
#salesReportTable th:first-child, #salesReportTable td:first-child { min-width:165px; width:165px; white-space:nowrap; }
@media print {
 #summaryReportTable table{font-size:8px;min-width:100%;}
 #summaryReportTable th,#summaryReportTable td{padding:2px 3px;}
 #summaryReportTable th:nth-child(1),#summaryReportTable td:nth-child(1){width:28px;min-width:28px;}
 #summaryReportTable th:nth-child(2),#summaryReportTable td:nth-child(2){width:105px;min-width:105px;}
}
/* REV53: settings used only by the accumulated-sales report. */
.routing-editor{display:grid;grid-template-columns:1fr 1fr 1.4fr 1fr auto;gap:10px;align-items:end}.routing-editor label{display:flex;flex-direction:column;gap:5px}.routing-editor input,.routing-editor select{min-height:40px;border:1px solid #ccd7e8;border-radius:8px;padding:8px 10px;background:#fff}.routing-rules-table td:last-child{width:80px;text-align:center}.routing-default-note{margin:8px 0 14px;color:#52647d}@media(max-width:900px){.routing-editor{grid-template-columns:1fr 1fr}.routing-editor .btn{width:100%}}

/* REV55: report totals row matching Excel layout */
.sales-grid thead .report-total-row th.yellow-total{background:#fff200!important;color:#0033cc!important;font-weight:800;border:1px solid #222;white-space:nowrap;}
.sales-grid thead .report-total-row th:first-child{color:#111!important;text-align:center;}

/* REV58: enlarge text only on Summary and Accumulated Sales report pages */
#summaryReportTable,
#salesReportTable {
  overflow-x: auto;
}

#summaryReportTable th,
#salesReportTable th {
  font-size: 12px !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
  padding: 7px 5px !important;
  min-height: 34px;
}

#summaryReportTable td,
#salesReportTable td {
  font-size: 12px !important;
  line-height: 1.25 !important;
  padding: 6px 5px !important;
  height: 30px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

#summaryReportTable tfoot td,
#salesReportTable thead .report-total-row th {
  font-size: 13px !important;
  font-weight: 800 !important;
}

#summaryReportTable th:nth-child(1),
#summaryReportTable td:nth-child(1) {
  width: 46px;
  min-width: 46px;
  max-width: 46px;
}

#summaryReportTable th:nth-child(2),
#summaryReportTable td:nth-child(2) {
  width: 190px;
  min-width: 190px;
}

#salesReportTable th:first-child,
#salesReportTable td:first-child {
  width: 205px;
  min-width: 205px;
}

@media print {
  #summaryReportTable th,
  #salesReportTable th {
    font-size: 9.5px !important;
    padding: 4px 3px !important;
  }
  #summaryReportTable td,
  #salesReportTable td {
    font-size: 9px !important;
    padding: 3px 3px !important;
    height: 24px;
  }
  #summaryReportTable tfoot td,
  #salesReportTable thead .report-total-row th {
    font-size: 10px !important;
  }
}

/* REV60: adjust only the requested columns; keep table/page/print sizes unchanged */
@media screen {
  /* Summary report: reduce Vendor and give the saved width to the final eligible-points column. */
  #summaryReportTable th:nth-child(2),
  #summaryReportTable td:nth-child(2) {
    width: 130px !important;
    min-width: 130px !important;
  }
  #summaryReportTable th:last-child,
  #summaryReportTable td:last-child {
    width: 127px !important;
    min-width: 127px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }

  /* Accumulated-sales report: reduce customer/Vendor and widen only the deducted-sales column. */
  #salesReportTable th:first-child,
  #salesReportTable td:first-child {
    width: 125px !important;
    min-width: 125px !important;
  }
  #salesReportTable th:nth-child(14),
  #salesReportTable td:nth-child(14) {
    width: 125px !important;
    min-width: 125px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }

  /* Only shrink the numbers in the yellow total row enough to stay inside each existing cell. */
  #salesReportTable thead .report-total-row th {
    font-size: 9.5px !important;
    line-height: 1.05 !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
    white-space: nowrap !important;
  }
}


/* REV61: exact requested column redistribution only; no page/table/print expansion. */
@media screen {
  /* Summary report: 20px moved from the final points column back to Vendor. */
  #summaryReportTable th:nth-child(2),
  #summaryReportTable td:nth-child(2) {
    width: 150px !important;
    min-width: 150px !important;
  }
  #summaryReportTable th:last-child,
  #summaryReportTable td:last-child {
    width: 107px !important;
    min-width: 107px !important;
    max-width: 107px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }
  #summaryReportTable th:last-child {
    white-space: normal !important;
    line-height: 1.15 !important;
  }

  /* Accumulated-sales report: 20px moved from deducted-sales to Vendor/customer. */
  #salesReportTable th:first-child,
  #salesReportTable td:first-child {
    width: 145px !important;
    min-width: 145px !important;
  }
  #salesReportTable th:nth-child(14),
  #salesReportTable td:nth-child(14) {
    width: 105px !important;
    min-width: 105px !important;
    max-width: 105px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }

  /* Only the yellow total-row figures are reduced to fit their existing cells. */
  #salesReportTable thead .report-total-row th {
    font-size: 8.5px !important;
    line-height: 1 !important;
    padding-left: 1px !important;
    padding-right: 1px !important;
  }
}

/* REV80: multi-select customer filter for รายงานยอดสะสม only */
.report-customer-filter{min-width:250px!important;position:relative}.multi-customer-filter{position:relative}.multi-customer-toggle{width:100%;border:1px solid #cfd7e5;border-radius:8px;padding:9px 12px;background:#fff;text-align:left;font-weight:700;cursor:pointer}.multi-customer-dropdown{position:absolute;z-index:30;top:calc(100% + 5px);left:0;width:360px;max-width:80vw;background:#fff;border:1px solid #cfd7e5;border-radius:10px;box-shadow:0 12px 32px #0002;padding:10px}.multi-customer-search-row{display:flex;gap:6px}.multi-customer-search-row input{flex:1}.multi-customer-search-row .btn{padding:8px 12px}.multi-customer-actions{display:flex;gap:8px;padding:8px 0;border-bottom:1px solid #e6eaf0}.multi-customer-actions button{border:0;background:transparent;color:#1d5fe5;font-weight:700;cursor:pointer;padding:3px}.multi-customer-options{max-height:260px;overflow:auto;padding-top:5px}.multi-customer-option{display:flex!important;flex-direction:row!important;align-items:center;gap:8px!important;padding:6px 4px;font-size:12px!important;cursor:pointer}.multi-customer-option input{width:auto;min-width:auto;padding:0}.multi-customer-empty{padding:12px;text-align:center;color:#657087;font-size:12px}.multi-customer-selected{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px;max-width:360px}.multi-customer-chip{display:inline-flex;align-items:center;gap:4px;background:#e9f0ff;color:#174ea6;border-radius:999px;padding:3px 7px;font-size:10px;font-weight:700}.multi-customer-chip button{border:0;background:transparent;color:inherit;font-weight:900;cursor:pointer;padding:0;line-height:1}.report-customer-filter:has(.multi-customer-selected:empty) .multi-customer-selected{display:none}


/* REV98: Redemption history - PO earned points + one-line company reward summary */
.redemption-history-table{min-width:1500px!important}
.redemption-history-table>thead>tr>th:nth-child(1){width:8%}
.redemption-history-table>thead>tr>th:nth-child(2){width:11%}
.redemption-history-table>thead>tr>th:nth-child(3){width:14%}
.redemption-history-table>thead>tr>th:nth-child(4){width:11%}
.redemption-history-table>thead>tr>th:nth-child(5){width:10%}
.redemption-history-table>thead>tr>th:nth-child(6){width:10%}
.redemption-history-table>thead>tr>th:nth-child(7){width:10%}
.redemption-history-table>thead>tr>th:nth-child(8){width:10%}
.redemption-history-table>thead>tr>th:nth-child(9){width:11%}
.redemption-history-table>thead>tr>th:nth-child(10){width:5%}
.redemption-company-summary-row td{background:#fff8cc!important;border-top:2px solid #e5c900!important;border-bottom:2px solid #e5c900!important;padding:7px 10px!important}
.redemption-company-summary{display:flex;align-items:center;gap:7px;white-space:nowrap;font-size:12px;overflow-x:auto;padding-bottom:2px}
.redemption-company-part{display:inline-flex;align-items:center;gap:4px}
.redemption-company-total{display:inline-flex;align-items:center;gap:4px;font-weight:700}
.redemption-company-sep{color:#9ca3af}


/* REV99: separate redemption workspace */
body:not(.redemption-only-page) .search-redemption-history{display:none}
.redemption-only-page .search-company-summary,
.redemption-only-page .search-detail-table{display:none!important}
.redemption-only-page #page-summary,
.redemption-only-page #page-report,
.redemption-only-page #page-customers,
.redemption-only-page #page-redemption-summary,
.redemption-only-page #page-rules{display:none!important}
.redemption-only-page .module-nav .nav-btn[data-page]{display:none}
.redemption-only-page .module-nav .campaign-page-link{display:none}
.redemption-only-page .module-nav .settings{display:none}
.redemption-only-page .page-shell{max-width:1500px}
.redemption-only-page .search-filter-panel{margin-bottom:12px}
.redemption-only-page .search-overview{grid-template-columns:minmax(300px,.8fr) minmax(620px,1.8fr)}
.redemption-only-page .search-redemption-history{display:block}
.redemption-only-page .redemption-history-fit{max-height:430px;overflow:auto}
.redemption-only-page .points-card{position:relative}
.redemption-only-page #redeemBtn{font-size:16px;padding:11px 22px}
@media(max-width:1000px){.redemption-only-page .search-overview{grid-template-columns:1fr}}


/* REV102: company summary as table + print/edit actions */
.redemption-company-summary-row>td{padding:0!important;background:#fff!important;border-top:3px solid #e4c500!important;border-bottom:3px solid #e4c500!important}
.redemption-company-table-wrap{width:100%;overflow-x:auto;padding:6px 8px;background:#fffce5}
.redemption-company-table{min-width:1450px!important;width:100%;border-collapse:collapse!important;margin:0!important}
.redemption-company-table th,.redemption-company-table td{border:1px solid #9ca3af!important;padding:5px 6px!important;font-size:11px!important}
.redemption-company-table thead tr:first-child th{background:#17639b!important;color:#fff!important;font-size:13px!important}
.redemption-company-table thead tr:first-child th:nth-child(2),
.redemption-company-table thead tr:first-child th:nth-child(5){background:#36a94e!important}
.redemption-company-table thead tr:first-child th:nth-child(3),
.redemption-company-table thead tr:first-child th:nth-child(6){background:#ed00bf!important}
.redemption-company-table thead tr:nth-child(2) th{background:#f5a000!important;color:#fff!important}
.redemption-company-table .redemption-total-head{background:#e60000!important;color:#fff!important}
.redemption-company-table thead tr:nth-child(2) th:nth-last-child(-n+3){background:#e60000!important}
.redemption-actions{display:flex;gap:5px;justify-content:center;align-items:center;flex-wrap:wrap}
.btn-print-redemption,.btn-edit-redemption{border:1px solid #2563eb;background:#fff;color:#1d4ed8;border-radius:7px;padding:5px 9px;font-weight:700;cursor:pointer}
.btn-print-redemption{border-color:#0f8a43;color:#087236}


/* REV104: ตรึงหัวตารางประวัติการแลกคะแนนขณะเลื่อน */
.redemption-only-page .redemption-history-fit{
  position:relative;
}
.redemption-only-page .redemption-history-table thead th{
  position:sticky;
  top:0;
  z-index:20;
  background:var(--green);
  color:#fff;
  box-shadow:0 1px 0 #d9e0ea;
}
