:root{
  --bg:#f4f6f9; --card:#fff; --ink:#1f2933; --muted:#6b7280; --line:#e3e8ef;
  --brand:#c0392b; --brand2:#e57373; --ok:#2e7d32; --okbg:#e8f5e9;
  --warn:#f9a825; --warnbg:#fff8e1; --miss:#ef6c00; --missbg:#fff3e0; --blue:#1565c0;
  --indigo:#4f46e5; --indigobg:#eef2ff;
}
*{box-sizing:border-box}
body{margin:0;font-family:"Microsoft JhengHei","PingFang TC","Segoe UI",system-ui,sans-serif;
  background:var(--bg);color:var(--ink);line-height:1.5;}
.hidden{display:none !important}
button{cursor:pointer;font-family:inherit}
button.primary{background:var(--brand);color:#fff;border:0;border-radius:9px;padding:9px 16px;font-weight:700;font-size:14px}
button.primary:disabled{background:#c4c9d1;cursor:not-allowed}
button.ghost{background:#fff;border:1px solid var(--line);border-radius:9px;padding:8px 14px;font-size:14px;color:var(--ink)}
button.ghost.danger{color:var(--miss);border-color:#f0c9a8}
button.ghost.danger:hover{background:#fff3ec}
.err-line{color:#b71c1c;font-size:13px;min-height:18px;margin-top:6px}

/* login */
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}
.login-card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:30px;width:340px;box-shadow:0 4px 20px rgba(0,0,0,.06)}
.login-card h1{margin:0;font-size:22px}
.login-card .sub{color:var(--muted);margin:2px 0 18px;font-size:14px}
.login-card label{display:block;font-size:13px;color:var(--muted);margin-bottom:12px}
.login-card input{display:block;width:100%;margin-top:4px;padding:10px;border:1px solid var(--line);border-radius:8px;font-size:15px}
.login-card button{width:100%;padding:11px;margin-top:4px}

/* topbar */
.topbar{display:flex;align-items:center;gap:12px;background:var(--card);border-bottom:1px solid var(--line);padding:10px 18px;position:sticky;top:0;z-index:20;flex-wrap:wrap}
.brand{font-weight:800;font-size:17px;color:var(--brand)}
.period-picker{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--muted)}
.period-picker select{padding:7px 10px;border:1px solid var(--line);border-radius:8px;font-size:14px}
.spacer{flex:1}
.who{font-size:13px;color:var(--muted)}

/* dashboard */
.totals-bar{margin:8px 18px 2px;font-size:14px;color:var(--muted);background:var(--card);border:1px solid var(--line);border-radius:10px;padding:9px 14px}
.totals-bar b{color:var(--ink);font-variant-numeric:tabular-nums}
.dash{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;padding:16px 18px 4px}
@media(max-width:760px){.dash{grid-template-columns:repeat(3,1fr)}}
.stat{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px;text-align:center;cursor:pointer;transition:.12s;user-select:none}
.stat:hover{box-shadow:0 2px 10px rgba(0,0,0,.08);transform:translateY(-1px)}
.stat.active{outline:2px solid var(--brand);outline-offset:-2px}
.stat .n{font-size:22px;font-weight:800}.stat .t{font-size:12px;color:var(--muted)}
.stat.match .n{color:var(--ok)}.stat.amt .n{color:#b8860b}.stat.miss .n{color:var(--miss)}
.stat.total .n{color:var(--blue)}.stat.warn .n{color:var(--warn)}

/* toolbar */
.toolbar{display:flex;gap:10px;align-items:center;padding:10px 18px;flex-wrap:wrap}
.toolbar input[type=text],.toolbar input#search{padding:8px 10px;border:1px solid var(--line);border-radius:8px;font-size:14px;min-width:220px}
.toolbar select{padding:8px 10px;border:1px solid var(--line);border-radius:8px;font-size:14px}
.chk{font-size:13px;color:var(--muted);display:flex;align-items:center;gap:5px}
.rowcount{font-size:13px;color:var(--muted);margin-left:auto}
.sel-bar{margin:0 18px 6px;padding:9px 14px;background:#eef4ff;border:1px solid #c7dbff;border-radius:10px;font-size:14px;display:flex;align-items:center;gap:10px}
.sel-bar button{padding:6px 14px;font-size:13px}
.selcell{width:46px;text-align:center;cursor:pointer;padding:0 !important}
#entriesBody .selcell:hover{background:#eef4ff}
.selcell input{cursor:pointer;width:20px;height:20px;vertical-align:middle;margin:0}

/* table */
.table-wrap{margin:0 18px 40px;background:var(--card);border:1px solid var(--line);border-radius:12px;overflow:auto}
table#entriesTable{width:100%;border-collapse:collapse;font-size:13.5px}
#entriesTable th,#entriesTable td{padding:9px 12px;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap}
#entriesTable th{background:#f1f5f9;position:sticky;top:0;font-size:12.5px}
#entriesTable th[data-sort]{cursor:pointer;user-select:none;white-space:nowrap}
#entriesTable th[data-sort]:hover{background:#e6edf5}
#entriesTable th .arr{color:var(--brand);font-size:11px;margin-left:2px}
#entriesTable tbody tr{cursor:pointer}
#entriesTable tbody tr:hover{background:#f8fafc}
.num{text-align:right;font-variant-numeric:tabular-nums}
tr.st-金額不符{background:#fffdf3}tr.st-賠付明細無此單號,tr.st-帳單無此單號{background:#fff8f1}
.badge{font-size:11px;font-weight:700;border-radius:999px;padding:2px 8px;white-space:nowrap}
.b-相符{background:var(--okbg);color:var(--ok)}
.b-金額不符{background:var(--warnbg);color:#b8860b}
.b-賠付明細無此單號,.b-帳單無此單號{background:var(--missbg);color:var(--miss)}
.warnicon{color:var(--warn);font-weight:800}
.note-cell{max-width:220px;overflow:hidden;text-overflow:ellipsis;color:var(--muted);font-size:12.5px}
.empty{padding:40px;text-align:center;color:var(--muted)}

/* drawer */
.drawer{position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:40;display:flex;justify-content:flex-end}
.drawer-panel{width:min(560px,94vw);background:#fff;height:100%;overflow:auto;box-shadow:-4px 0 24px rgba(0,0,0,.15)}
.drawer-head{display:flex;justify-content:space-between;align-items:flex-start;padding:16px 18px;border-bottom:1px solid var(--line);position:sticky;top:0;background:#fff}
.drawer-lp{font-weight:800;font-size:17px}.drawer-status{margin-top:4px}
.drawer-body{padding:16px 18px}
.x{background:none;border:0;font-size:24px;color:var(--muted);line-height:1}
.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;font-size:13.5px;margin-bottom:16px}
.kv .k{color:var(--muted)}
.sec-title{font-weight:700;font-size:14px;margin:16px 0 8px}
.rowcard{border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin-bottom:8px}
.rowcard .rc-top{display:flex;justify-content:space-between;gap:10px;font-size:13px}
.rowcard .amt{font-variant-numeric:tabular-nums;font-weight:700}
.rowcard .amt.neg{color:var(--miss)}.rowcard .amt.pos{color:var(--ok)}
.rowcard textarea,.drawer-body textarea{width:100%;margin-top:6px;border:1px solid var(--line);border-radius:8px;padding:7px;font-family:inherit;font-size:13px;resize:vertical}
.field{margin-bottom:12px}.field label{display:block;font-size:12.5px;color:var(--muted);margin-bottom:4px}
.field select,.field input{padding:8px;border:1px solid var(--line);border-radius:8px;font-size:14px}
.savebtn{margin-top:6px}

/* modal */
.modal{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:50;display:flex;align-items:center;justify-content:center;padding:16px}
.modal-card{background:#fff;border-radius:14px;width:min(520px,96vw);max-height:90vh;display:flex;flex-direction:column;overflow:hidden}
.modal-card.wide{width:min(760px,96vw)}
.modal-head{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;border-bottom:1px solid var(--line)}
.modal-head h2{margin:0;font-size:17px}
.modal-body{padding:18px;overflow:auto}
.modal-foot{padding:14px 18px;border-top:1px solid var(--line);display:flex;gap:10px;flex-direction:row-reverse}

/* import */
.drop{border:2px dashed #cbd5e1;border-radius:12px;padding:26px;text-align:center;cursor:pointer;background:#fbfcfe}
.drop:hover{border-color:var(--brand2);background:#fff7f6}.drop.dragover{border-color:var(--brand);background:#ffeceb}
.drop .big{font-weight:700;font-size:15px}.drop .sub{font-size:12.5px;color:var(--muted);margin-top:4px}
.roles{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
@media(max-width:560px){.roles{grid-template-columns:1fr}}
.role{border:1px solid var(--line);border-radius:10px;padding:10px;display:flex;gap:8px;align-items:center;background:#fbfcfe}
.role.filled{border-color:var(--ok);background:var(--okbg)}
.role .rfile{font-size:12px;color:var(--muted)}.role.filled .rfile{color:var(--ok)}
.period-row{margin-top:14px;font-size:14px}.period-row input{padding:8px;border:1px solid var(--line);border-radius:8px;width:120px;margin-left:6px}
.period-row .hint,.hint{font-size:12px;color:var(--muted);margin-left:8px}
.import-groups{margin-top:14px}
.import-groups:empty{display:none}
.gtable{width:100%;border-collapse:collapse;font-size:13px}
.gtable th,.gtable td{border:1px solid var(--line);padding:7px 9px;text-align:left}
.gtable th{background:#f1f5f9;font-size:12.5px}
.gtable input{padding:6px;border:1px solid var(--line);border-radius:6px;font-size:13px}
.gmiss{color:var(--miss);font-weight:700}
.gok{color:var(--ok);font-weight:700}
.gdel{background:none;border:0;color:var(--muted);font-size:18px;line-height:1;cursor:pointer}
.msg{margin-top:12px;padding:10px 12px;border-radius:8px;font-size:13.5px;white-space:pre-wrap}
.msg.info{background:#e8f0fe;color:#1a4f9c}.msg.err{background:#fdecea;color:#b71c1c}.msg.ok{background:var(--okbg);color:var(--ok)}

/* conflict */
.conflict-bulk{display:flex;gap:10px;align-items:center;margin-bottom:12px;flex-wrap:wrap}
.conflict{border:1px solid var(--line);border-radius:10px;padding:12px;margin-bottom:10px}
.conflict .clp{font-weight:700;margin-bottom:6px}
.difftable{width:100%;font-size:13px;border-collapse:collapse;margin-bottom:8px}
.difftable td,.difftable th{border:1px solid var(--line);padding:5px 8px;text-align:left}
.difftable .old{color:var(--miss)}.difftable .new{color:var(--ok)}
.choose{display:flex;gap:14px;font-size:13.5px}
.audit{width:100%;border-collapse:collapse;font-size:13px}
.audit td{border-bottom:1px solid var(--line);padding:7px 10px}

/* toast */
.toast{position:fixed;top:22px;left:50%;transform:translateX(-50%);background:#1f2933;color:#fff;padding:12px 20px;border-radius:10px;font-size:14px;font-weight:600;z-index:80;box-shadow:0 6px 22px rgba(0,0,0,.28)}
.toast.ok{background:var(--ok)}   /* 成功=綠 */
.toast.err{background:var(--brand)}   /* 失敗/錯誤=紅 */

/* ===== 申訴追蹤 view ===== */
.viewtabs{display:flex;gap:4px;background:#eef1f5;border-radius:10px;padding:3px}
.vtab{background:none;border:0;border-radius:8px;padding:6px 14px;font-size:14px;font-weight:700;color:var(--muted)}
.vtab.active{background:#fff;color:var(--brand);box-shadow:0 1px 3px rgba(0,0,0,.08)}
.stat.ab-no .n{color:#c0392b}.stat.ab-ok .n{color:var(--ok)}.stat.ab-mid .n{color:var(--blue)}.stat.ab-none .n{color:var(--muted)}
/* comp table (mirrors entriesTable) */
#compTable{width:100%;border-collapse:collapse;font-size:13.5px}
#compTable th,#compTable td{padding:9px 12px;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap}
#compTable th{background:#f1f5f9;position:sticky;top:0;font-size:12.5px;cursor:pointer;user-select:none}
#compTable th:hover{background:#e6edf5}
#compTable tbody tr{cursor:pointer}
#compTable tbody tr:hover{background:#f8fafc}
/* appeal-status badge */
.abadge{font-size:11px;font-weight:700;border-radius:999px;padding:2px 9px;white-space:nowrap}
.ab-ok{background:var(--okbg);color:var(--ok)}
.ab-no{background:#fdecea;color:#b71c1c}
.ab-mid{background:#e8f0fe;color:#1a4f9c}
.ab-none{background:#eef1f5;color:var(--muted)}
/* related work-order cards + service-record timeline */
.relcard{border:1px solid var(--line);border-radius:10px;padding:12px;margin-bottom:12px;background:#fbfcfe}
.relhead{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:4px}
.reltype{font-weight:700;font-size:14px}
.relmeta{font-size:12px;color:var(--muted)}
.reldesc{font-size:13px;margin-top:8px;padding:8px 10px;background:#fff;border:1px solid var(--line);border-radius:8px;white-space:pre-wrap}
.tl{border-left:2px solid var(--line);margin-left:6px;padding-left:14px}
.tlitem{position:relative;padding-bottom:12px}
.tlitem:before{content:"";position:absolute;left:-21px;top:4px;width:9px;height:9px;border-radius:50%;background:var(--brand)}
.tlhead{display:flex;justify-content:space-between;gap:10px;font-size:13px}
.tltime{color:var(--muted);font-size:12px;font-variant-numeric:tabular-nums}
.tlmemo{font-size:12.5px;margin-top:3px;white-space:pre-wrap}
.tlwho{font-size:12px;color:var(--muted);margin-top:2px}
/* 對帳 status badges + dashboard group labels */
.dash-label{font-size:12px;color:var(--muted);margin:12px 18px 0;font-weight:700}
.rbadge{font-size:11px;font-weight:700;border-radius:999px;padding:2px 9px;white-space:nowrap}
.rb-ok{background:var(--okbg);color:var(--ok)}
.rb-no{background:#fdecea;color:#b71c1c}
.rb-none{background:#eef1f5;color:var(--muted)}
.stat.rb-ok .n{color:var(--ok)}.stat.rb-no .n{color:#c0392b}.stat.rb-none .n{color:var(--muted)}.stat.rb-orphan .n{color:var(--miss)}

/* ===== v2 refined shell / layout ===== */
:root{ --paper:#f6f5f2; --ink:#23272f; --line2:#e8e5df; --card2:#fff; --shadow:0 1px 2px rgba(20,20,30,.04),0 8px 24px rgba(20,20,30,.05); }
body{ background:var(--paper); }
#appView .shell{ display:flex; min-height:100vh; }
.sidebar{ width:212px; flex:0 0 212px; background:var(--ink); color:#c7cdd8; display:flex; flex-direction:column; padding:18px 14px; position:sticky; top:0; height:100vh; }
.side-brand{ display:flex; align-items:center; gap:10px; font-weight:800; font-size:16px; color:#fff; padding:4px 6px 18px; }
.side-mark{ width:30px; height:30px; border-radius:9px; background:var(--brand); color:#fff; display:grid; place-items:center; font-size:15px; }
.side-nav{ display:flex; flex-direction:column; gap:4px; }
.nav-item{ display:flex; align-items:center; gap:10px; background:none; border:0; color:#aab2c0; font-size:14.5px; font-weight:600; text-align:left; padding:10px 12px; border-radius:9px; cursor:pointer; }
.nav-item:hover{ background:rgba(255,255,255,.06); color:#fff; }
.nav-item.active{ background:rgba(192,57,43,.18); color:#fff; box-shadow:inset 3px 0 0 var(--brand); }
.ni-ico{ opacity:.75; font-size:12px; }
.side-actions{ margin-top:22px; display:flex; flex-direction:column; gap:7px; }
.side-btn{ background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.09); color:#d4d9e2; border-radius:9px; padding:9px 12px; font-size:13.5px; text-align:left; cursor:pointer; }
.side-btn:hover{ background:rgba(255,255,255,.11); color:#fff; }
.side-btn.primary{ background:var(--brand); border-color:var(--brand); color:#fff; font-weight:700; }
.side-btn.primary:hover{ background:#a93226; }
.side-btn.danger{ color:#f0a9a0; }
.side-btn.danger:hover{ background:rgba(192,57,43,.2); color:#fff; }
.side-foot{ margin-top:auto; padding-top:10px; border-top:1px solid rgba(255,255,255,.09); display:flex; flex-direction:column; gap:8px; }
.side-foot .who{ color:#8a93a3; font-size:12.5px; padding:0 4px; }
.nav-item-foot{ margin-bottom:4px; }
.main{ flex:1; min-width:0; padding:24px 30px 60px; }
.page-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:18px; }
.page-title{ margin:0; font-size:22px; font-weight:800; color:var(--ink); }
.page-sub{ font-size:12.5px; color:var(--muted); margin-top:3px; }
.page-actions{ display:flex; gap:8px; }
.chips{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:14px; }
.chip{ display:inline-flex; align-items:center; gap:7px; background:var(--card2); border:1px solid var(--line2); border-radius:999px; padding:6px 13px 6px 8px; font-size:13px; color:var(--ink); cursor:pointer; transition:.12s; }
.chip:hover{ border-color:#cfcabf; box-shadow:var(--shadow); }
.chip b{ font-weight:800; font-variant-numeric:tabular-nums; background:#eef0f3; border-radius:999px; padding:1px 8px; font-size:12px; color:#4b5563; }
.chip.on{ border-color:var(--ink); box-shadow:0 0 0 1px var(--ink); }
.chip.c-all.on{ background:var(--ink); color:#fff; } .chip.c-all.on b{ background:rgba(255,255,255,.2); color:#fff; }
.chip.rb-ok.on{ background:var(--okbg); border-color:var(--ok); box-shadow:0 0 0 1px var(--ok); } .chip.rb-ok b,.chip.ab-ok b{ background:var(--okbg); color:var(--ok); }
.chip.rb-no.on,.chip.ab-no.on{ background:#fdecea; border-color:#c0392b; box-shadow:0 0 0 1px #c0392b; } .chip.rb-no b,.chip.ab-no b{ background:#fdecea; color:#c0392b; }
.chip.rb-none b,.chip.ab-none b{ background:#eef1f5; color:#6b7280; }
.chip.ab-mid.on{ background:#e8f0fe; border-color:var(--blue); box-shadow:0 0 0 1px var(--blue); } .chip.ab-mid b{ background:#e8f0fe; color:#1a4f9c; }
.chip.c-orphan b{ background:var(--missbg); color:var(--miss); } .chip.c-orphan.on{ background:var(--missbg); border-color:var(--miss); box-shadow:0 0 0 1px var(--miss); }
.chip-div{ width:1px; height:20px; background:var(--line2); margin:0 3px; }
/* 分頁底欄:與 .rc-scroll 表格卡片合體(scroll 去下圓角、去下框,底欄補上圓角+上框線) */
.rc-scroll.with-pager{ border-radius:12px 12px 0 0; border-bottom:0; margin-bottom:0; }
/* 金額列「賠付單 267(+3)」的 +N:期間外但因同物流單號一併納入者,用警示色與主數字區隔 */
.mb-extra{ color:var(--miss); font-weight:600; font-size:.82em; margin-left:2px; cursor:pointer; background:none; border:0; padding:0 1px; font-family:inherit; white-space:nowrap; text-decoration:underline dotted; text-underline-offset:2px; }
.mb-extra:hover{ text-decoration:underline solid; }
/* 期間外賠付單 popup:第一行是重點(筆數/金額上色)、第二行 ※ 是固定說明(壓低) */
.ro-lead{ font-size:14px; color:var(--ink); line-height:1.75; margin:0 0 6px; }
.ro-lead b{ font-weight:700; }
.ro-em{ font-style:normal; color:var(--miss); font-weight:800; font-variant-numeric:tabular-nums; }
.ro-note{ font-size:12.5px; color:#9aa1ab; line-height:1.6; margin:0 0 14px; padding-left:1px; }
.ro-tbl{ margin:0; max-height:52vh; overflow-y:auto; }
.ro-tbl .rc-tbl{ min-width:0; }                      /* 不硬撐,避免窄視窗出現水平捲軸 */
.ro-tbl thead th{ position:sticky; top:0; z-index:1; padding:10px 16px; white-space:nowrap; }
/* 這張表不在 #reconOrphanBody 那組 id 選擇器裡,td 沒有 padding → 欄位會黏在一起,必須自己給 */
.ro-tbl tbody td{ padding:11px 16px; white-space:nowrap; border-top:1px solid var(--line); }
.ro-tbl tbody tr:hover{ background:#f8fafc; }
.ro-total td{ border-top:2px solid var(--line) !important; background:#faf9f7; }
.rc-pager{ display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin:0 18px 40px; padding:11px 16px; background:var(--card); border:1px solid var(--line); border-radius:0 0 12px 12px; font-size:13px; color:var(--muted); }
.rc-pager.hidden{ display:none; }
.rc-pgleft,.rc-pgright{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.rc-pgleft b{ color:var(--ink); font-weight:800; font-variant-numeric:tabular-nums; }
.rc-pgleft select{ padding:6px 8px; border:1px solid var(--line); border-radius:8px; font-size:13px; background:var(--card); color:var(--ink); }
.rc-pgdiv{ width:1px; height:18px; background:var(--line); margin:0 7px; }
.rc-pgnum{ min-width:32px; height:32px; padding:0 6px; display:inline-flex; align-items:center; justify-content:center; background:var(--card); border:1px solid var(--line); border-radius:8px; font-size:13px; font-weight:600; color:var(--ink); transition:.12s; font-variant-numeric:tabular-nums; }
.rc-pgnum:hover:not(:disabled):not(.on){ border-color:#cfcabf; }
.rc-pgnum.on{ background:var(--brand); border-color:var(--brand); color:#fff; cursor:default; }
.rc-pgnum:disabled{ color:#c4c9d1; cursor:not-allowed; background:#fafaf8; }
.rc-pgell{ min-width:22px; text-align:center; color:#b6bcc4; }
.rc-pgjump{ display:inline-flex; align-items:center; gap:6px; }
.rc-pgjump input{ width:52px; height:32px; padding:0 8px; border:1px solid var(--line); border-radius:8px; font-size:13px; text-align:center; background:var(--card); color:var(--ink); font-variant-numeric:tabular-nums; }
.money-bar{ display:flex; background:var(--card2); border:1px solid var(--line2); border-radius:12px; margin-bottom:16px; box-shadow:var(--shadow); overflow:hidden; }
.money-bar .mb{ flex:1; display:flex; flex-direction:column; gap:4px; padding:13px 20px; border-right:1px solid var(--line2); }
.money-bar .mb:last-child{ border-right:0; }
.mb-l{ font-size:12px; color:var(--muted); }
.mb-v{ font-size:19px; font-weight:800; font-variant-numeric:tabular-nums; color:var(--ink); }
.mb-v.mb-warn{ color:var(--miss); } .mb-v.mb-ok{ color:var(--ok); }
.filterbar{ display:flex; gap:10px; align-items:center; margin-bottom:12px; }
.filterbar .search{ flex:1; max-width:360px; padding:9px 13px; border:1px solid var(--line2); border-radius:10px; font-size:14px; background:var(--card2); }
.filterbar select{ padding:9px 11px; border:1px solid var(--line2); border-radius:10px; font-size:13.5px; background:var(--card2); }
.filterbar .rowcount{ margin-left:auto; }
.card{ background:var(--card2); border:1px solid var(--line2); border-radius:12px; box-shadow:var(--shadow); overflow:auto; }
#compTable,#orphanTable{ width:100%; border-collapse:collapse; font-size:13.5px; }
#compTable th,#orphanTable th{ background:#faf9f7; color:#6b7280; font-weight:700; font-size:12px; text-align:left; padding:11px 14px; border-bottom:1px solid var(--line2); position:sticky; top:0; cursor:pointer; white-space:nowrap; user-select:none; }
#compTable th:hover,#orphanTable th:hover{ color:var(--ink); }
#compTable td,#orphanTable td{ padding:11px 14px; border-bottom:1px solid #f1efea; white-space:nowrap; }
#compTable tbody tr,#orphanTable tbody tr{ cursor:pointer; }
#compTable tbody tr:hover{ background:#faf8f4; }
.dim{ color:var(--muted); }
#compTable td.mono{ font-variant-numeric:tabular-nums; letter-spacing:.2px; }
#compTable td.biz{ max-width:240px; overflow:hidden; text-overflow:ellipsis; color:#4b5563; }
#compTable td.num,#orphanTable td.num{ text-align:right; font-variant-numeric:tabular-nums; font-weight:600; }
.main .empty{ padding:48px; text-align:center; color:var(--muted); }
@media(max-width:820px){ .sidebar{ width:60px; flex-basis:60px; padding:14px 8px; } .side-name,.nav-item span:not(.ni-ico),.side-btn,.side-foot .who{ display:none; } .nav-item{ justify-content:center; } .main{ padding:18px 16px 40px; } .money-bar{ flex-wrap:wrap; } .money-bar .mb{ min-width:50%; } }

/* ===== 月報 report ===== */
.rep-card{ overflow:auto; margin-bottom:12px; }
.rep-tbl{ width:100%; border-collapse:collapse; font-size:12.5px; }
.rep-tbl th{ background:#faf9f7; color:#6b7280; font-weight:700; font-size:11.5px; padding:8px; border-bottom:1px solid var(--line2); white-space:nowrap; text-align:left; }
.rep-tbl td{ padding:3px 5px; border-bottom:1px solid #f1efea; }
.rep-tbl input.ri,.rep-tbl input.rri{ width:100%; min-width:54px; border:1px solid transparent; background:transparent; border-radius:6px; padding:5px 6px; font-size:12.5px; font-family:inherit; color:var(--ink); }
.rep-tbl input.wide{ min-width:180px; }
.rep-tbl input.num{ text-align:right; font-variant-numeric:tabular-nums; }
.rep-tbl input:hover{ border-color:var(--line2); }
.rep-tbl input:focus{ border-color:var(--brand); background:#fff; outline:none; }
.rc-comp{ text-align:right; font-variant-numeric:tabular-nums; color:var(--muted); background:#faf9f7; padding-right:8px; }
.rep-tot td{ font-weight:800; background:#f4f2ee; font-variant-numeric:tabular-nums; text-align:right; }
.rep-tot td:first-child{ text-align:left; }

/* ===== 月報(新):分組表頭逐期總表 + 業務類型×期間樞紐 ===== */
.rp2-range{ display:flex; align-items:center; gap:8px; font-size:13px; }
.rp2-rlbl{ color:var(--muted); }
.rp2-rsep{ color:var(--muted); }
.rp2-minput{ border:1px solid var(--line2); border-radius:8px; padding:6px 10px; font-size:13px; font-family:inherit; color:var(--ink); background:var(--card2); }
.rp2-minput:focus{ border-color:var(--brand); outline:none; box-shadow:0 0 0 3px rgba(192,57,43,.1); }
.rp2-range .primary.sm{ height:32px; padding:0 16px; font-size:13px; }   /* 對齊期間輸入框高度(32px) */
.rp2-title{ font-size:15px; font-weight:800; color:var(--ink); margin:26px 18px 10px; padding-left:10px; border-left:3px solid var(--brand); line-height:1.25; }
.rp2-title:first-of-type{ margin-top:8px; }
.rp2-card{ margin:0 18px 8px; padding:0; overflow-x:auto; }
.rp2-tbl{ width:100%; border-collapse:collapse; font-size:13px; }
.rp2-tbl th{ padding:8px 12px; font-weight:700; white-space:nowrap; text-align:left; border-bottom:1px solid var(--line); }
.rp2-tbl td{ padding:9px 12px; border-bottom:1px solid #f1efea; white-space:nowrap; }
.rp2-tbl tbody tr:last-child td{ border-bottom:none; }
.rp2-tbl td.num, .rp2-tbl th.num{ text-align:right; font-variant-numeric:tabular-nums; }
.rp2-tbl td.rc-lbl{ font-weight:700; background:transparent; }
.rp2-grp th{ text-align:center; font-size:12px; padding:7px 12px; }
/* 逐期總表:週數多時可內部捲動,兩列表頭固定上方(不固定左側) */
.rp2-scard{ max-height:min(64vh,600px); overflow:auto; }
.rp2-scard thead .rp2-grp th{ position:sticky; top:0; z-index:2; }
.rp2-scard thead .rp2-sub th{ position:sticky; top:31px; z-index:2; }
.rp2-scard thead .rp2-grp th:first-child, .rp2-scard thead .rp2-sub th:first-child{ background:#f4f6f8; }
.rp2-sub th{ font-size:12px; color:#64748b; font-weight:700; }
.rp2-grp th.g-pay, .rp2-grp th.g-appeal, .rp2-grp th.g-corr, .rp2-grp th.g-exapply, .rp2-grp th.g-exres, .rp2-grp th.g-result{ border-left:2px solid #fff; }
.g-pay{ background:#f1f5f9; color:#475569; }
.g-appeal{ background:#ecfdf5; color:#047857; }
.g-corr{ background:#eff6ff; color:#1d4ed8; }
.g-exapply{ background:#fffbeb; color:#b45309; }
.g-exres{ background:#fef3c7; color:#92400e; }
.g-result{ background:#f0fdf4; color:#15803d; }
.rp2-tbl td.rc-comp{ background:transparent; color:var(--ink); font-weight:700; }
.rp2-tbl td.rp2-est, .rp2-sub th.rp2-est{ color:var(--muted); }
.rp2-tbl tr.rep-tot td{ background:#f4f2ee; font-weight:800; }
/* 方案 A:兩個關鍵結論欄點亮(呼應分組色);tr td 特異度=rep-tot,置於其後→總計列同步套色 */
.rp2-tbl tr td.rp2-corr{ background:#eff6ff; color:#1d4ed8; font-weight:800; }
.rp2-tbl tr td.rp2-conf{ background:#f0fdf4; color:#15803d; font-weight:800; font-size:14.5px; }
/* 樞紐 */
.rp2-pcard{ max-height:min(64vh,600px); overflow:auto; }
.rp2-pivot th:first-child, .rp2-pivot td:first-child{ width:220px; min-width:190px; max-width:240px; }
.rp2-pivot td.pv-type{ font-weight:600; white-space:normal; }
.rp2-pivot .pv-a{ font-weight:700; font-variant-numeric:tabular-nums; }
.rp2-pivot .pv-c{ font-size:11.5px; color:var(--muted); margin-top:2px; }
.rp2-pivot td.pv-empty{ color:#cbd5e1; }
.rp2-pivot th.g-total, .rp2-pivot td.g-total{ border-left:2px solid var(--line); }
.rp2-pivot tr.rep-tot td.pv-grand .pv-a{ color:var(--brand); }
/* 交錯列 */
.rp2-pivot tbody td{ background:#fff; }
.rp2-pivot tbody tr.pv-alt td{ background:#f7f9fb; }
.rp2-pivot tbody tr.rep-tot td{ background:#f0ede8; }
/* sticky:表頭固定頂端、業務類型欄固定左側、左上角落最高層;皆不透明底 */
.rp2-pivot thead th{ position:sticky; top:0; z-index:2; background:#eef2f6; }
.rp2-pivot thead th:first-child{ left:0; z-index:3; }
.rp2-pivot tbody td:first-child{ position:sticky; left:0; z-index:1; background:#fff; }
.rp2-pivot tbody tr.pv-alt td:first-child{ background:#f7f9fb; }
.rp2-pivot tbody tr.rep-tot td:first-child{ background:#f0ede8; }
.rc-del{ background:none; border:0; color:#cdd1d8; font-size:15px; cursor:pointer; line-height:1; }
.rc-del:hover{ color:var(--miss); }
.rep-add{ margin:0 0 20px; padding:6px 12px; font-size:13px; }
.rep-reasons{ display:flex; gap:16px; flex-wrap:wrap; margin-top:8px; align-items:stretch; }
.rep-reason{ flex:1 1 330px; min-width:330px; display:flex; flex-direction:column; }
.rep-rhead{ font-weight:800; font-size:13px; padding:12px 12px 8px; color:var(--ink); }
.rr-tbl th.rr-c,.rr-tbl td.rr-c{ width:70px; text-align:right; }
.rr-tbl th.rr-a,.rr-tbl td.rr-a{ width:104px; text-align:right; font-variant-numeric:tabular-nums; }
.rep-rfoot{ margin-top:auto; display:grid; grid-template-columns:1fr 70px 104px; font-weight:800; background:#f4f2ee; padding:9px 5px; border-top:1px solid var(--line2); }
.rep-rfoot .rr-c,.rep-rfoot .rr-a{ text-align:right; font-variant-numeric:tabular-nums; }
/* aligned week period cell */
.rc-wk{ white-space:nowrap; }
.rc-wk .wy{ color:var(--muted); margin-right:8px; font-size:12px; }
.rc-wk .ws{ display:inline-block; width:3.4em; text-align:right; }
.rc-wk .wd{ margin:0 3px; color:var(--muted); }
.rc-wk .we{ display:inline-block; width:3.4em; text-align:left; }

/* ===== 豁免 (exemption) ===== */
.ex-block{ background:#fff7ee; border:1px solid #f0d9be; border-radius:10px; padding:12px; margin-bottom:16px; }
.ex-head{ display:flex; align-items:center; gap:10px; }
.ex-l{ font-weight:700; font-size:13px; color:var(--miss); }
.ex-reason{ font-size:12.5px; margin-top:8px; padding:8px 10px; background:#fff; border:1px solid var(--line2); border-radius:8px; white-space:pre-wrap; }
.ex-times{ display:flex; flex-wrap:wrap; gap:14px; margin-top:8px; font-size:12px; color:var(--muted); }
.upl-btn{ display:inline-block; background:#fff; border:1px solid var(--line2); border-radius:9px; padding:8px 14px; font-size:14px; color:var(--ink); cursor:pointer; }
.upl-btn:hover{ border-color:#cfcabf; }
.page-actions .dinput{ border:1px solid var(--line2); border-radius:9px; padding:8px 10px; font-size:13px; font-family:inherit; }
#exTable{ width:100%; border-collapse:collapse; font-size:13.5px; }
#exTable th,#exTable td{ padding:11px 14px; border-bottom:1px solid #f1efea; text-align:left; white-space:nowrap; }
#exTable th{ background:#faf9f7; color:#6b7280; font-weight:700; font-size:12px; position:sticky; top:0; }
#exTable td.num,#exTable th.num{ text-align:right; font-variant-numeric:tabular-nums; }
#exTable td.biz{ max-width:220px; overflow:hidden; text-overflow:ellipsis; color:#4b5563; }
#exTable td.dcell .d-d{ font-weight:600; }#exTable td.dcell .d-t{ color:var(--muted); font-size:12px; margin-left:5px; }

/* ===== v2.1 search / date / select / sort ===== */
.searchbox{ position:relative; display:flex; align-items:center; flex:1; max-width:340px; }
.searchbox .si{ position:absolute; left:11px; font-size:13px; opacity:.5; pointer-events:none; }
.searchbox .search{ width:100%; padding:9px 30px 9px 32px; border:1px solid var(--line2); border-radius:10px; font-size:14px; background:var(--card2); }
.searchbox .search:focus{ border-color:var(--brand); outline:none; box-shadow:0 0 0 3px rgba(192,57,43,.1); }
.sclear{ position:absolute; right:8px; border:0; background:#e6e3dd; color:#5b6270; width:18px; height:18px; border-radius:50%; font-size:12px; line-height:16px; text-align:center; cursor:pointer; padding:0; }
.sclear:hover{ background:#d6d2ca; }
.daterange{ display:flex; align-items:center; gap:4px; background:var(--card2); border:1px solid var(--line2); border-radius:10px; padding:2px 8px; }
.daterange .dinput{ border:0; background:none; font-size:13px; font-family:inherit; color:var(--ink); padding:6px 2px; }
.daterange .dinput:focus{ outline:none; }
.daterange .dr-sep{ color:var(--muted); font-size:12px; }
/* date picker popover */
.dpick{ position:relative; }
.dpick-btn{ display:inline-flex; align-items:center; gap:6px; background:var(--card2); border:1px solid var(--line2); border-radius:10px; padding:9px 12px; font-size:13.5px; color:var(--ink); cursor:pointer; white-space:nowrap; }
.dpick-btn:hover{ border-color:#cfcabf; }
.dpick-pop{ position:absolute; top:calc(100% + 6px); left:0; z-index:30; background:#fff; border:1px solid var(--line2); border-radius:12px; box-shadow:0 10px 30px rgba(20,20,30,.16); padding:13px; width:308px; }
.dpick-sec{ font-size:11.5px; color:var(--muted); font-weight:700; margin:2px 0 8px; }
.dpick-months{ display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-bottom:14px; }
.mchip{ background:#f4f2ee; border:1px solid var(--line2); border-radius:8px; padding:8px 4px; font-size:12.5px; cursor:pointer; color:var(--ink); font-family:inherit; }
.mchip:hover{ border-color:var(--brand); color:var(--brand); }
.mchip.on{ background:var(--brand); border-color:var(--brand); color:#fff; font-weight:700; }
.dpick-custom{ display:flex; align-items:center; gap:6px; margin-bottom:13px; }
.dpick-custom .dinput{ flex:1; border:1px solid var(--line2); border-radius:8px; padding:8px; font-size:13px; font-family:inherit; }
.dpick-custom .dr-sep{ color:var(--muted); }
.dpick-foot{ display:flex; justify-content:space-between; gap:8px; }
.sm{ padding:8px 16px; font-size:13px; border-radius:8px; cursor:pointer; }
button.primary.sm{ background:var(--brand); color:#fff; border:0; font-weight:700; }
button.primary.sm:hover{ background:#a93226; }
button.ghost.sm{ background:#fff; border:1px solid var(--line2); color:var(--ink); }
.linkbtn{ background:none; border:0; color:var(--brand); font-size:13px; cursor:pointer; padding:6px 4px; font-weight:600; }
.linkbtn:hover{ text-decoration:underline; }
#compTable th .arr{ color:var(--brand); font-size:10px; margin-left:3px; }
#compTable th.selcol{ width:38px; text-align:center; padding:0; cursor:default; }
#compTable td.selcol{ width:38px; text-align:center; padding:0; cursor:pointer; }
#compTable td.selcol:hover{ background:#f0ede7; }
.crowsel,#compSelAll{ width:16px; height:16px; cursor:pointer; vertical-align:middle; margin:0; }
#compTable tr.rowsel-on{ background:#fdf3ec !important; }
#compTable td.dcell{ white-space:nowrap; }
#compTable td.dcell .d-d{ font-weight:600; color:var(--ink); }
#compTable td.dcell .d-t{ color:var(--muted); font-size:12px; margin-left:5px; font-variant-numeric:tabular-nums; }
#compTable mark{ background:#ffe58a; color:inherit; border-radius:3px; padding:0 1px; }
.money-bar.mb-sel{ box-shadow:0 0 0 2px rgba(192,57,43,.4); }
.money-bar.mb-sel .mb-l{ color:var(--brand); }

/* 月/週報 toggle + computed label */
.rep-toolbar{ display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.seg{ display:inline-flex; background:#eef1f5; border-radius:9px; padding:3px; }
.seg-b{ background:none; border:0; border-radius:7px; padding:6px 16px; font-size:13.5px; font-weight:700; color:var(--muted); cursor:pointer; }
.seg-b.on{ background:#fff; color:var(--brand); box-shadow:0 1px 3px rgba(0,0,0,.08); }
.rep-tbl td.rc-lbl{ font-weight:700; white-space:nowrap; }
.rep-tbl td.num,.rep-tbl th.num{ text-align:right; font-variant-numeric:tabular-nums; }

/* ===== 設定 ===== */
.set-card{ max-width:560px; padding:22px 24px; display:flex; flex-direction:column; gap:26px; }
.set-group{ display:flex; flex-direction:column; gap:12px; }
.set-title{ font-size:15px; font-weight:800; color:var(--ink); padding-bottom:8px; border-bottom:1px solid var(--line); }
.set-row{ display:flex; align-items:center; justify-content:space-between; gap:16px; }
.set-row span{ font-size:14px; color:var(--muted); font-weight:600; }
.set-row select{ padding:8px 12px; border:1px solid var(--line); border-radius:8px; font-size:14px; background:#fff; min-width:130px; }
.set-hint{ font-size:12.5px; color:var(--muted); line-height:1.6; background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:9px 12px; }
.set-actions{ display:flex; align-items:center; gap:14px; justify-content:flex-end; }
.set-saved{ color:var(--ok); font-size:13.5px; font-weight:700; }

/* ===== 帳號管理 ===== */
#authzSection .set-card{ max-width:860px; }
#azAddCard{ margin:0 18px 14px; }   /* 與下方 azScroll(rc-scroll)左右對齊 */
#azScroll{ max-width:860px; }        /* 列表寬度對齊上方新增帳號卡片 */
/* (匯出物流單號 popup 的樣式 .bm-exportbody/.bm-optrow/.bm-exportcount 已隨 popup 於 2026-07-29 移除) */
/* 可輸入關鍵字的下拉(combobox):外觀對齊 .filterbar select,展開清單沿用 .dpick-pop 的卡片語彙 */
.cbox{ position:relative; }
.cbox-in{ width:186px; padding:9px 42px 9px 11px; border:1px solid var(--line2); border-radius:10px; font-size:13.5px; font-family:inherit; color:var(--ink); background:var(--card2); }
.cbox-in:focus{ border-color:var(--brand); outline:none; box-shadow:0 0 0 3px rgba(192,57,43,.1); }
.cbox .sclear{ right:24px; }
.cbox-car{ position:absolute; right:10px; top:50%; transform:translateY(-50%); font-size:11px; color:var(--muted); pointer-events:none; }
/* 寬度隨最長選項(代碼+名稱+筆數)撐開,但不小於輸入框、也不無限長 */
.cbox-pop{ position:absolute; top:calc(100% + 6px); left:0; z-index:30; width:max-content; min-width:100%; max-width:330px; max-height:280px; overflow-y:auto;
  background:#fff; border:1px solid var(--line2); border-radius:12px; box-shadow:0 10px 30px rgba(20,20,30,.16); padding:6px; }
.cbox-opt{ display:flex; align-items:center; gap:8px; width:100%; text-align:left; background:none; border:0; border-radius:8px;
  padding:8px 10px; font-size:13px; font-family:inherit; color:var(--ink); cursor:pointer; white-space:nowrap; }
.cbox-opt:hover, .cbox-opt.on{ background:#f4f2ee; }
.cbox-opt.sel{ color:var(--brand); font-weight:700; }
.cbox-opt .co-code{ font-family:ui-monospace,Consolas,monospace; }
.cbox-opt .co-n{ margin-left:auto; padding-left:10px; font-size:11.5px; color:var(--muted); font-variant-numeric:tabular-nums; }
.cbox-empty{ padding:10px; font-size:12.5px; color:var(--muted); }
/* 業務類型對照表:欄位給 min-width 撐開(避免 4 短欄全擠左、右側一大片空白) */
#bizmapScroll th, #bizmapScroll td{ white-space:nowrap; }
#bizmapScroll th:nth-child(1), #bizmapScroll td:nth-child(1){ min-width:180px; }  /* 物流單號 */
#bizmapScroll th:nth-child(2), #bizmapScroll td:nth-child(2){ min-width:130px; }  /* 狀態 */
#bizmapScroll th:nth-child(3), #bizmapScroll td:nth-child(3){ min-width:280px; }  /* 原始業務類型 */
#bizmapScroll th:nth-child(4), #bizmapScroll td:nth-child(4){ min-width:200px; }  /* 對照後類型 */
/* 業務類型對照(新):欄序 1 物流單號 2 狀態 3 貨態 4 貨態時間 5 母子代號 6 配送編號 7 原始業務類型 8 最後查詢 9 重查 10 伸縮
   ⚠ 同 recon/豁免的坑:auto 佈局下 width 會被 .rc-sp(100%)壓回 min-content,一定要用 min-width。
   兩個時間欄 145 才蓋得過「YYYY/MM/DD HH:mm」,否則會折成兩行。 */
#bmNScroll th, #bmNScroll td{ white-space:nowrap; }
#bmNScroll th:nth-child(1), #bmNScroll td:nth-child(1){ min-width:170px; }
#bmNScroll th:nth-child(3), #bmNScroll td:nth-child(3){ min-width:210px; white-space:normal; }  /* 貨態「代碼(名稱)」可長,允許折行 */
#bmNScroll th:nth-child(4), #bmNScroll td:nth-child(4),
#bmNScroll th:nth-child(8), #bmNScroll td:nth-child(8){ min-width:145px; }
#bmNScroll th:nth-child(7), #bmNScroll td:nth-child(7){ min-width:200px; white-space:normal; }   /* 原始業務類型(可能多個,以、串接) */
.authz-add{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.authz-add .dinput{ width:220px; border:1px solid var(--line2); border-radius:10px; padding:9px 13px; font-size:14px; background:var(--card2); }
.authz-add .dinput:focus{ border-color:var(--brand); outline:none; box-shadow:0 0 0 3px rgba(192,57,43,.1); }
.authz-suffix{ color:var(--muted); font-size:14px; }
.authz-table{ width:100%; border-collapse:collapse; font-size:14px; }
.authz-table th, .authz-table td{ text-align:left; padding:9px 12px; border-bottom:1px solid var(--line); white-space:nowrap; }
.authz-table th{ color:var(--muted); font-weight:600; font-size:12.5px; }
.authz-table td:first-child{ width:100%; }        /* email takes the slack; rest stay tight */
.authz-table .linkbtn{ white-space:nowrap; }

/* audit modal: header + failed-login row */
table.audit thead th{ text-align:left; color:var(--muted); font-weight:600; font-size:12px; padding:6px 10px; border-bottom:1px solid var(--line2); position:sticky; top:0; background:var(--card2); }
table.audit td{ padding:6px 10px; border-bottom:1px solid var(--line); }
tr.aud-fail td{ background:rgba(220,38,38,.06); }

/* audit full page */
.audit-card{ padding:6px 6px 10px; overflow:auto; }
table.audit{ width:100%; border-collapse:collapse; font-size:13.5px; }

/* 自訂 Google 登入按鈕(固定文字，非個人化) */
.gbtn{ display:flex; align-items:center; justify-content:center; gap:10px; width:100%; padding:11px 14px;
  background:#fff; border:1px solid var(--line); border-radius:10px; font-size:15px; font-weight:600;
  color:#3c4043; cursor:pointer; font-family:inherit; }
.gbtn:hover{ background:#f7f8fa; }
.gbtn .gicon{ flex:0 0 auto; }
#gsiFallback{ margin-top:10px; display:flex; justify-content:center; }

/* ===== 側欄分組 + 舊版收合 ===== */
.side-grp{ font-size:11px; font-weight:700; color:#8b97a7; letter-spacing:.06em; padding:10px 12px 3px; }
.side-legacy{ margin-top:8px; border-top:1px solid rgba(255,255,255,.08); padding-top:4px; }
.side-legacy-h{ font-size:12.5px; font-weight:700; color:#8b97a7; padding:7px 12px; cursor:pointer; }
.side-legacy-body{ display:none; }
.side-legacy.open .side-legacy-body{ display:block; }

/* ===== 賠付明細(新版)物流單號彙總列表 ===== */
.rc-scroll{ overflow-x:auto; margin:0 18px 40px; border:1px solid var(--line); border-radius:12px; background:var(--card); }
table.rc-tbl{ width:100%; min-width:900px; border-collapse:collapse; font-size:14px; }
.rc-tbl thead th{ background:#f1f5f9; color:#6b7280; font-size:12.5px; font-weight:700; padding:10px 12px; text-align:left; white-space:nowrap; }
.rc-tbl th.rc-c, .rc-tbl td.rc-c{ text-align:center; }
.rc-tbl .rc-sp, .rc-dtbl .rc-sp{ width:100%; padding:0; }  /* 隱形伸縮欄:吸收多餘寬度,真實欄位固定寬、緊接呈現(大螢幕不爆寬) */
.rc-tbl th.rc-r, .rc-tbl td.rc-r{ text-align:right; font-variant-numeric:tabular-nums; }
.rc-exp{ width:30px; }
/* 主清單欄位配置(child combinator 只選主表表頭,不影響展開詳情表/orphan 表):
   加大左右間距;賠付單=帳單 同寬;賠付金額=修正後賠付=帳單淨額 同寬;申訴欄預設放得下成立/不成立 tag。
   ⚠ 要用 min-width:auto 佈局下 width 會被 .rc-sp(100%)壓回 min-content,min-width 才會被尊重 */
#reconMainScroll > .rc-tbl > thead > tr > th{ padding:10px 18px; }
#reconMainScroll .rc-main td{ padding:11px 18px; }
/* 欄序:1 展開 2 物流單號 3 賠付單 4 賠付金額 5 申訴 6 修正後賠付 7 對帳 8 帳單 9 帳單淨額 10 伸縮 */
#reconMainScroll > .rc-tbl > thead > tr > th:nth-child(3), #reconMainScroll > .rc-tbl > thead > tr > th:nth-child(8){ min-width:80px; }
#reconMainScroll > .rc-tbl > thead > tr > th:nth-child(4), #reconMainScroll > .rc-tbl > thead > tr > th:nth-child(6), #reconMainScroll > .rc-tbl > thead > tr > th:nth-child(9){ min-width:130px; }
#reconMainScroll > .rc-tbl > thead > tr > th:nth-child(5){ min-width:170px; }
/* 豁免申請(新)三個帶時間欄同寬:賠付時間(2)/標註申請時間(7)/申請時間(8);
   結果日期(9)只有日期、不限同寬。145 要蓋過最寬內容「YYYY/MM/DD HH:mm」(~140),
   否則個別欄被內容撐開就不等寬 */
#exNScroll > .rc-tbl > thead > tr > th:nth-child(2), #exNScroll > .rc-tbl > thead > tr > th:nth-child(7),
#exNScroll > .rc-tbl > thead > tr > th:nth-child(8){ min-width:145px; }
.rc-main{ cursor:pointer; border-top:1px solid var(--line); }
.rc-main:hover{ background:#f8fafc; }
.rc-main td{ padding:11px 12px; white-space:nowrap; }
/* orphan 清單列:對照主清單的列距/框線/hover(避免擁擠) */
/* ⚠ 這三條是「逐一列 id」的清單 —— 新增清單頁一定要把自己的 tbody id 加進來,
   漏了就會掉回瀏覽器預設 td padding(1px):列高 44px→31px、沒有分隔線也沒有 hover。 */
#reconOrphanBody tr, #exNBody tr, #azBody tr, #auditBody tr, #bizmapBody tr, #bmNBody tr{ border-top:1px solid var(--line); }
#reconOrphanBody tr:hover, #exNBody tr:hover, #azBody tr:hover, #auditBody tr:hover, #bizmapBody tr:hover, #bmNBody tr:hover{ background:#f8fafc; }
#reconOrphanBody td, #exNBody td, #azBody td, #auditBody td, #bizmapBody td, #bmNBody td{ padding:11px 12px; white-space:nowrap; }
.rc-strong{ font-weight:800; }
.rc-mono{ font-family:ui-monospace,Consolas,monospace; font-size:13px; }
.rc-dim{ color:var(--muted); }
.rc-car{ display:inline-block; color:var(--muted); transition:transform .12s; }
.rc-pill{ display:inline-block; font-size:11px; font-weight:700; border-radius:999px; padding:2px 7px; margin:0 2px; }
.rc-pill.ok{ background:var(--okbg); color:var(--ok); } .rc-pill.no{ background:#fdecea; color:var(--brand); }
/* 申訴欄雙格:固定 slot 寬(成立/不成立各一格)、無值淡灰佔位 → 整欄縱向對齊 */
.rc-pill.sl-ok{ min-width:52px; text-align:center; }
.rc-pill.sl-no{ min-width:66px; text-align:center; }
.rc-pill.ph{ background:#f3f5f7; color:#c4c9d1; font-weight:400; }
.rc-badge{ display:inline-block; font-size:12px; font-weight:700; border-radius:8px; padding:3px 10px; }
.rc-badge.rc-ok{ background:var(--okbg); color:var(--ok); }
.rc-badge.rc-mid{ background:var(--warnbg); color:#b8860b; }
.rc-badge.rc-miss{ background:var(--missbg); color:var(--miss); }
.rc-detail{ display:none; } .rc-detail.open{ display:table-row; }
.rc-detail>td{ background:#f7f8fa; padding:12px 16px 18px; border-top:1px solid var(--line); }
.rc-d{ display:flex; flex-direction:column; gap:14px; }
/* 明細卡片:賠付=綠、帳單=靛紫,標題列左標題右彙總 */
.rc-card{ background:var(--card); border:1px solid var(--line); border-radius:11px; overflow:hidden; box-shadow:0 1px 2px rgba(20,20,30,.04); }
.rc-card-h{ display:flex; align-items:baseline; justify-content:space-between; gap:14px; padding:10px 15px; }
.rc-card-t{ font-weight:800; font-size:14px; }
.rc-card-s{ font-size:12.5px; opacity:.92; font-variant-numeric:tabular-nums; text-align:right; }
.rc-card-s b{ font-weight:800; }
.rc-card.pay{ border-color:#b9e0bf; } .rc-card.pay .rc-card-h{ background:var(--okbg); color:#1f6f2b; }
.rc-card.bill{ border-color:#c9d2f2; } .rc-card.bill .rc-card-h{ background:var(--indigobg); color:#3730a3; }
table.rc-dtbl{ width:100%; border-collapse:collapse; font-size:13px; background:var(--card); border-top:1px solid var(--line); }
.rc-dtbl th,.rc-dtbl td{ text-align:left; padding:8px 14px; border-bottom:1px solid var(--line); white-space:nowrap; }
.rc-dtbl tbody tr:last-child td{ border-bottom:0; }
.rc-dtbl th{ color:var(--muted); font-weight:600; font-size:12px; background:#fbfcfe; }
.rc-dtbl tbody tr:hover{ background:#fafbfe; }
.rc-dtbl td.rc-r,.rc-dtbl th.rc-r{ text-align:right; font-variant-numeric:tabular-nums; }
.rc-biz{ color:var(--ink); }
.rc-win{ color:var(--ok); font-weight:600; } .rc-lose{ color:var(--brand); font-weight:600; }
.rc-dtbl td.rc-det,.rc-dtbl th.rc-det{ text-align:right; width:70px; white-space:nowrap; }
.rc-dtbl td.rc-billdate,.rc-dtbl th.rc-billdate{ width:150px; }
.rc-dtbl td.rc-flex,.rc-dtbl th.rc-flex{ }  /* (改用最右 rc-sp 伸縮欄,內容欄不再吸收) */
.rc-detbtn{ background:none; border:0; color:var(--brand); font-size:13px; font-weight:600; cursor:pointer; padding:2px 2px; display:inline-flex; align-items:center; gap:1px; }
.rc-detbtn:hover{ text-decoration:underline; }
.rc-chev{ font-size:15px; line-height:1; }

/* 新版列表:帳單逐筆明細顏色/標籤 */
.rc-dtbl .rc-neg{ color:var(--miss); font-weight:600; } .rc-dtbl .rc-pos{ color:var(--blue); font-weight:600; }
.rc-tag{ display:inline-block; font-size:11px; font-weight:700; border-radius:6px; padding:2px 8px; }
.rc-tag.charge{ background:#fdecd8; color:#b45309; } .rc-tag.refund{ background:#e7f0fb; color:var(--blue); }

/* 新版篩選列 + dashboard 與表格左右對齊(表格 .rc-scroll / .rc-pager 本身是 margin:0 18px,
   所以每個新版頁的 chips/filterbar/money-bar 都要補同樣的 18px,否則會比表格寬一截) */
#reconSection .filterbar, #reconSection .chips, #reconSection .money-bar,
#exemptNSection .filterbar, #exemptNSection .chips, #exemptNSection .money-bar,
#bizmapNSection .filterbar, #bizmapNSection .chips{ margin-left:18px; margin-right:18px; }
.rc-dlab{ display:inline-flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); white-space:nowrap; }
.mb-i{ font-size:11px; color:var(--muted); cursor:help; }
.rc-dlab .dr-sep{ color:var(--muted); }
.filterbar .dinput, #exNUploadPopup .dinput{ border:1px solid var(--line2); border-radius:9px; padding:8px 10px; font-size:13px; font-family:inherit; }

/* B4:批次標記豁免 */
.rc-selbar{ position:fixed; right:28px; bottom:24px; z-index:50; display:flex; align-items:center; gap:12px; margin:0; padding:11px 16px; background:var(--okbg); border:1px solid var(--ok); border-radius:12px; font-size:13px; box-shadow:0 8px 28px rgba(20,20,30,.22); }
.rc-selbar b{ color:var(--brand); }
.rc-dtbl td.rc-ck,.rc-dtbl th.rc-ck{ width:34px; text-align:center; padding-left:6px; padding-right:6px; }
.rc-exck{ width:16px; height:16px; cursor:pointer; accent-color:var(--brand); }
.rc-exbadge{ display:inline-block; font-size:11px; font-weight:700; border-radius:6px; padding:1px 7px; background:var(--warnbg); color:#b8860b; white-space:nowrap; }
/* 豁免說明 popup */
.ep-hint{ font-size:13px; color:var(--muted); margin:0 0 12px; }
.ep-item{ margin:0 0 12px; }
.ep-item .ep-lp{ font-size:13px; font-weight:700; font-family:ui-monospace,Consolas,monospace; margin:0 0 4px; }
textarea.ep-reason{ width:100%; box-sizing:border-box; border:1px solid var(--line); border-radius:8px; padding:8px 10px; font-size:13px; font-family:inherit; resize:vertical; }
textarea.ep-reason:focus{ outline:none; border-color:var(--brand); }
