:root{
  --surface-2:#ffffff; --surface-1:#f5f5f2; --surface-0:#f0f0ec; --border:#e8e8e3; --border-strong:#dcdcd6;
  --text-primary:#1a1a18; --text-secondary:#6b6b64; --text-muted:#9a9a92;
  --brand:#F5C445; --brand-t:#7a5a06;
  --exp:#E5484D; --exp-bg:#FDECED;
  --inc:#12B76A; --inc-bg:#E7F9F1;
  --navy:#2b3548;
}
*{box-sizing:border-box;}
html,body{margin:0; padding:0; background:var(--surface-0); font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Helvetica Neue",Arial,sans-serif; color:var(--text-primary);}
.wrap{max-width:1160px; margin:0 auto; padding:28px 24px 60px;}
.topbar{display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; flex-wrap:wrap; gap:12px;}
.topbar h1{font-size:20px; font-weight:700; margin:0;}
.topbar .sub{font-size:12.5px; color:var(--text-muted); margin-top:2px;}
.btn{border:none; border-radius:9px; padding:9px 16px; font-size:13.5px; cursor:pointer; font-weight:500; display:inline-flex; align-items:center; gap:6px;}
.btn-primary{background:var(--brand); color:var(--brand-t);}
.btn-primary:hover{filter:brightness(0.97);}
.btn-primary:disabled{opacity:0.6; cursor:default;}
.btn-outline{background:#fff; color:var(--text-secondary); border:1px solid var(--border-strong);}
.btn-outline:hover{background:var(--surface-1);}
.btn-text{background:transparent; color:var(--text-secondary); padding:6px 8px;}
.btn-danger{background:var(--exp); color:#fff;}
.actions-right{display:flex; gap:10px;}

.statrow{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px; margin-bottom:18px;}
.statcard{background:#fff; border:0.5px solid var(--border); border-radius:14px; padding:16px 18px;}
.statcard .lbl{font-size:12.5px; color:var(--text-muted); margin-bottom:6px;}
.statcard .val{font-size:22px; font-weight:700;}
.statcard .val.exp{color:var(--exp);}
.statcard .val.inc{color:var(--inc);}

.toolbar{display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; flex-wrap:wrap; gap:10px;}
.filtertabs{display:flex; gap:6px; background:#fff; border:0.5px solid var(--border); border-radius:10px; padding:4px;}
.filtertab{font-size:13px; color:var(--text-secondary); padding:8px 22px; border-radius:8px; cursor:pointer;}
.filtertab.active{background:var(--navy); color:#fff;}
.customrange{display:flex; align-items:center; gap:6px; font-size:13px; color:var(--text-secondary);}
.customrange input[type=date]{border:1px solid var(--border-strong); border-radius:8px; padding:6px 8px; font-size:12.5px; color:var(--text-primary);}
.searchbox{display:flex; align-items:center; gap:6px; background:#fff; border:1px solid var(--border); border-radius:10px; padding:6px 12px; min-width:240px;}
.searchbox i{color:var(--text-muted); font-size:15px;}
.searchbox input{border:none; outline:none; font-size:13px; flex:1; background:transparent; color:var(--text-primary);}
.filtertab.warn{background:var(--exp-bg); color:var(--exp);}
.filtertab.warn.active{background:var(--exp); color:#fff;}
.diff-badge{font-size:10.5px; padding:1px 7px; border-radius:20px; margin-left:6px; white-space:nowrap;}
.diff-badge.under{background:var(--exp-bg); color:var(--exp);}
.diff-badge.over{background:var(--inc-bg); color:var(--inc);}
.unsettled-fab{position:fixed; right:26px; bottom:26px; background:var(--exp); color:#fff; border-radius:24px; padding:10px 18px; font-size:13px; font-weight:600; box-shadow:0 8px 20px rgba(0,0,0,0.18); cursor:pointer; display:none; align-items:center; gap:8px; z-index:80;}
.unsettled-fab i{font-size:16px;}

.loaderror{background:var(--exp-bg); color:var(--exp); border-radius:10px; padding:10px 14px; font-size:13px; margin-bottom:14px;}

table.tbl{width:100%; min-width:880px; border-collapse:collapse; background:#fff; border-radius:14px; overflow:hidden; border:0.5px solid var(--border);}
table.tbl th{text-align:left; font-size:12px; color:var(--text-muted); font-weight:600; padding:11px 14px; background:var(--surface-1); border-bottom:1px solid var(--border); white-space:nowrap;}
table.tbl td{padding:11px 14px; font-size:13.5px; border-bottom:1px solid var(--border); vertical-align:middle; white-space:nowrap;}
table.tbl td:nth-child(7){white-space:normal; max-width:200px;}
table.tbl tr:last-child td{border-bottom:none;}
table.tbl tr:hover td{background:#fafaf8;}
.pill{display:inline-flex; align-items:center; font-size:11.5px; padding:3px 9px; border-radius:20px; font-weight:500;}
.pill-exp{background:var(--exp-bg); color:var(--exp);}
.pill-inc{background:var(--inc-bg); color:var(--inc);}
.pill-settled{background:var(--inc-bg); color:var(--inc);}
.pill-unsettled{background:var(--exp-bg); color:var(--exp);}
.pill-muted{background:var(--surface-1); color:var(--text-muted);}
.amt{font-weight:600;}
.amt.exp{color:var(--exp);}
.amt.inc{color:var(--inc);}
.thumb-cell{width:36px; height:36px; border-radius:7px; overflow:hidden; cursor:pointer; border:0.5px solid var(--border-strong);}
.thumb-cell img{width:100%; height:100%; object-fit:cover;}
.rowbtn{background:none; border:none; cursor:pointer; color:var(--text-muted); font-size:16px; padding:4px 6px; border-radius:6px;}
.rowbtn:hover{background:var(--surface-1); color:var(--text-primary);}
.rowbtn.del:hover{color:var(--exp);}
.emptyrow td{text-align:center; padding:50px 0; color:var(--text-muted); font-size:13.5px;}

.modal-overlay{position:fixed; inset:0; background:rgba(20,20,18,0.4); display:none; align-items:center; justify-content:center; z-index:100; padding:24px;}
.modal-box{background:#fff; border-radius:16px; padding:22px; width:100%; max-width:520px; max-height:88vh; overflow-y:auto;}
.modal-box.narrow{max-width:380px;}

.modal-box h2{font-size:16px; margin:0 0 16px;}
.frow{margin-bottom:16px;}
.frow label{display:block; font-size:12.5px; color:var(--text-muted); margin-bottom:6px; font-weight:500;}
.frow .req{color:var(--exp);}
.finput2{width:100%; border:1px solid var(--border-strong); border-radius:9px; padding:9px 11px; font-size:13.5px; outline:none; color:var(--text-primary); background:var(--surface-1);}
.finput2:focus{border-color:var(--brand);}
.frow-2col{display:grid; grid-template-columns:1fr 1fr; gap:14px;}
.typeseg2{display:flex; gap:8px; background:var(--surface-1); padding:3px; border-radius:9px;}
.typeseg2 .seg{flex:1; text-align:center; padding:8px 0; border-radius:7px; font-size:13.5px; font-weight:500; color:var(--text-secondary); cursor:pointer;}
.typeseg2 .seg.sel-exp{background:var(--exp); color:#fff;}
.typeseg2 .seg.sel-inc{background:var(--inc); color:#fff;}
.catwrap{display:flex; flex-wrap:wrap; gap:14px 10px;}
.catitem3{display:flex; flex-direction:column; align-items:center; gap:5px; font-size:11px; color:var(--text-secondary); cursor:pointer; width:56px;}
.caticon3{width:42px; height:42px; border-radius:50%; background:var(--surface-1); border:1px solid var(--border-strong); display:flex; align-items:center; justify-content:center; font-size:18px; color:var(--text-secondary);}
.caticon3.sel{background:var(--brand); border-color:var(--brand); color:var(--brand-t);}
.customcat{margin-top:10px;}
.chiprow{display:flex; gap:6px; margin-top:8px; flex-wrap:wrap;}
.chip{font-size:11px; background:#fff; border:0.5px solid var(--border-strong); color:var(--text-secondary); padding:3px 9px; border-radius:13px; cursor:pointer;}
.chip:hover{background:var(--surface-1);}
.segpill2{display:flex; gap:8px;}
.segpill2-item{padding:7px 16px; border-radius:20px; font-size:13px; color:var(--text-secondary); background:var(--surface-1); border:1px solid var(--border-strong); cursor:pointer;}
.segpill2-item.on-settled{background:var(--inc-bg); color:var(--inc); border-color:var(--inc);}
.segpill2-item.on-unsettled{background:var(--exp-bg); color:var(--exp); border-color:var(--exp);}
.vehsearch-wrap{position:relative;}
.dropdown2{position:absolute; top:100%; left:0; right:0; margin-top:4px; background:#fff; border-radius:9px; border:1px solid var(--border-strong); box-shadow:0 8px 24px rgba(0,0,0,0.08); z-index:5; overflow:hidden;}
.ddi2{padding:9px 12px; font-size:13px; cursor:pointer; border-bottom:1px solid var(--border);}
.ddi2:last-child{border-bottom:none;}
.ddi2:hover{background:var(--surface-1);}
.ddi2-add{color:var(--brand-t); font-weight:500;}
.ddi2 small{display:block; color:var(--text-muted); font-size:11px;}
.vehicle-selected2{display:flex; align-items:center; justify-content:space-between; background:var(--surface-1); border:1px solid var(--border-strong); border-radius:9px; padding:9px 11px; font-size:13px; color:var(--navy);}
.vehicle-selected2 .x{color:var(--text-muted); cursor:pointer;}
.receiptrow2{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
.receipt-btn2{font-size:12.5px; color:#a3690a; background:#fff8ec; border:1.2px dashed #e3a94b; padding:8px 13px; border-radius:8px; cursor:pointer;}
.receipt-btn2-outline{font-size:12.5px; color:var(--text-secondary); background:#fff; border:1px solid var(--border-strong); padding:8px 13px; border-radius:8px; cursor:pointer;}
.receipt-btn2-outline.on{background:var(--navy); color:#fff; border-color:var(--navy);}
.receipt-btn2.uploading{opacity:0.6; pointer-events:none;}
.receipt-hint{width:100%; font-size:11.5px; color:var(--text-muted); margin-top:2px;}
.thumb2{position:relative; width:56px; height:56px; border-radius:8px; overflow:hidden; border:0.5px solid var(--border-strong);}
.thumb2 img{width:100%; height:100%; object-fit:cover;}
.thumb2 .rm{position:absolute; top:0; right:0; width:18px; height:18px; background:rgba(0,0,0,0.55); color:#fff; font-size:11px; display:flex; align-items:center; justify-content:center; border-radius:0 0 0 8px; cursor:pointer;}
.fielderr2{color:var(--exp); font-size:12px; margin-top:6px; min-height:14px;}
.modal-footer{display:flex; justify-content:flex-end; gap:10px; margin-top:6px; padding-top:16px; border-top:1px solid var(--border);}

.radiogrp{display:flex; flex-direction:column; gap:9px;}
.radioitem{display:flex; align-items:center; gap:9px; font-size:13.5px; color:var(--text-primary); cursor:pointer; padding:8px 10px; border-radius:8px; border:1px solid var(--border-strong);}
.radioitem.sel{border-color:var(--brand); background:#fffaf0;}
.radioitem input{accent-color:var(--brand);}
.exportnote{font-size:11.5px; color:var(--text-muted); margin-top:4px; line-height:1.5;}

.lightbox{position:fixed; inset:0; background:rgba(0,0,0,0.8); display:none; align-items:center; justify-content:center; z-index:200; cursor:zoom-out;}
.lightbox img{max-width:90vw; max-height:90vh; border-radius:8px;}

.toast2{position:fixed; top:22px; left:50%; transform:translateX(-50%); background:rgba(20,20,18,0.9); color:#fff; font-size:13.5px; padding:11px 22px; border-radius:24px; z-index:300; display:none; box-shadow:0 8px 24px rgba(0,0,0,0.2);}
