:root{
      --nav:#10243d;
      --nav2:#183552;
      --blue:#1268c4;
      --blue2:#eaf4ff;
      --text:#172334;
      --muted:#687588;
      --line:#e5eaf0;
      --bg:#f5f7fa;
      --card:#fff;
      --green:#16834f;
      --greenBg:#eaf8f1;
      --orange:#b86b00;
      --orangeBg:#fff5df;
      --red:#c53636;
      --redBg:#fff0f0;
      --grayBg:#f1f3f6;
      --shadow:0 2px 10px rgba(20,42,70,.06);
      --radius:9px;
    }
    *{box-sizing:border-box}
    html,body{margin:0;min-height:100%;font-family:Segoe UI,Arial,sans-serif;color:var(--text);background:var(--bg);font-size:13px}
    button,input,select{font:inherit}
    button{cursor:pointer}
    .app{display:flex;min-height:100vh}
    .sidebar{
      width:224px;flex:0 0 224px;background:var(--nav);color:#fff;display:flex;flex-direction:column;
      min-height:100vh;position:fixed;left:0;top:0;bottom:0;z-index:20
    }
    .brand{height:72px;padding:14px 16px;display:flex;align-items:center;gap:11px;border-bottom:1px solid rgba(255,255,255,.08)}
    .brand-mark{width:36px;height:36px;border-radius:8px;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden;flex:0 0 36px}.brand-mark img{width:100%;height:100%;object-fit:contain;display:block}
    .brand strong{display:block;font-size:15px;line-height:18px}
    .brand span{display:block;font-size:11px;color:#b9c7d7;margin-top:2px}
    .nav-title{padding:18px 17px 7px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#8296ad}
    .nav{padding:5px 9px}
    .nav-item{
      width:100%;border:0;background:transparent;color:#d8e2ed;text-align:left;border-radius:7px;
      padding:10px 11px;margin:2px 0;display:flex;align-items:center;gap:10px;font-size:13px
    }
    .nav-item:hover{background:rgba(255,255,255,.07);color:#fff}
    .nav-item.active{background:#176dbd;color:#fff;font-weight:600}
    .nav-icon{width:18px;text-align:center;font-size:14px;opacity:.95}
    .sidebar-footer{margin-top:auto;padding:13px 16px;color:#7f93aa;font-size:10px;border-top:1px solid rgba(255,255,255,.06)}
    .main{margin-left:224px;flex:1;min-width:0}
    .topbar{
      height:72px;background:#fff;border-bottom:1px solid var(--line);padding:0 24px;
      display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:10
    }
    .topbar h1{margin:0;font-size:20px;line-height:24px}
    .topbar p{margin:3px 0 0;color:var(--muted);font-size:12px}
    .server-state{font-size:11px;color:var(--muted);white-space:nowrap}
    .server-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#21a463;margin-right:5px}
    .server-dot.down{background:#d84c4c}
    .content{padding:20px 24px 30px;max-width:1500px;margin:auto}
    .page{display:none}.page.active{display:block}
    .section-title{margin:0 0 4px;font-size:17px}.section-sub{margin:0;color:var(--muted);font-size:12px}
    .cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px}
    .stat-card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:15px;box-shadow:var(--shadow);min-height:100px}
    .stat-label{font-size:12px;color:var(--muted);margin-bottom:9px}.stat-value{font-size:25px;font-weight:700;line-height:28px}
    .stat-note{font-size:11px;color:var(--muted);margin-top:7px}.stat-card.blue{border-top:3px solid var(--blue)}
    .stat-card.green{border-top:3px solid var(--green)}.stat-card.orange{border-top:3px solid #e59a23}.stat-card.red{border-top:3px solid var(--red)}
    .panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);margin-bottom:14px;overflow:hidden}
    .panel-head{padding:15px 17px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:15px}
    .panel-head h2{font-size:14px;margin:0 0 3px}.panel-head p{font-size:11px;color:var(--muted);margin:0}
    .panel-body{padding:16px}
    .quick-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;padding:14px}
    .quick{
      border:1px solid var(--line);background:#fff;border-radius:8px;padding:14px;text-align:left;display:flex;flex-direction:column;gap:7px;
      transition:.15s
    }
    .quick:hover{border-color:#b9d5f2;background:#fbfdff;transform:translateY(-1px)}
    .quick .quick-icon{font-size:18px;color:var(--blue)}.quick b{font-size:13px}.quick span{font-size:11px;color:var(--muted)}
    .attention{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;padding:14px}
    .attention-item{border:1px solid var(--line);border-radius:8px;padding:13px;display:flex;justify-content:space-between;align-items:center;gap:12px}
    .attention-item .a-label{font-weight:600;font-size:12px}.attention-item .a-note{font-size:11px;color:var(--muted);margin-top:4px}
    .a-count{font-size:20px;font-weight:700}.a-red{color:var(--red)}.a-orange{color:var(--orange)}.a-green{color:var(--green)}
    .health-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:14px}
    .health-item{border:1px solid var(--line);border-radius:8px;padding:12px;display:flex;justify-content:space-between;align-items:center}
    .health-item span{font-size:11px;color:var(--green);font-weight:700}
    .sync-row{padding:13px 16px;display:flex;justify-content:space-between;align-items:center;gap:12px}
    .sync-progress{margin-top:14px;border:1px solid var(--line);border-radius:9px;padding:12px;background:#f8fafc}.sync-progress-head{display:flex;justify-content:space-between;gap:10px;font-size:12px}.sync-progress-track{height:9px;border-radius:99px;background:#e7edf4;overflow:hidden;margin:9px 0}.sync-progress-bar{height:100%;background:var(--blue);border-radius:99px;transition:width .25s ease}.sync-progress-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.sync-progress-stats span{font-size:10px;color:var(--muted);padding:7px 8px;background:#fff;border:1px solid var(--line);border-radius:7px}.sync-progress-stats b{display:block;color:#1f3044;font-size:12px;margin-top:2px}.sync-info b{display:block;font-size:12px}.sync-info span{display:block;color:var(--muted);font-size:11px;margin-top:3px}
    .toolbar{padding:13px 14px;border-bottom:1px solid var(--line);background:#fbfcfd}
    .search-row{display:flex;gap:8px;align-items:center}.search-box{position:relative;flex:1;min-width:220px}
    .search-box input{width:100%;height:36px;padding:0 12px 0 34px;border:1px solid #d8dfe8;border-radius:7px;background:#fff;outline:none}
    .search-box input:focus,input:focus,select:focus{border-color:#79acd9;box-shadow:0 0 0 2px rgba(18,104,196,.08)}
    .search-icon{position:absolute;left:11px;top:9px;color:#8a96a5}
    .filter-row{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin-top:8px}
    input,select{height:34px;border:1px solid #d8dfe8;border-radius:6px;background:#fff;color:var(--text);padding:0 9px;outline:none}
    input[type=date]{min-width:132px}select{min-width:135px}
    .btn{height:34px;border:1px solid #d4dce6;border-radius:6px;background:#fff;color:#344255;padding:0 11px;font-weight:600;font-size:12px}
    .btn:hover{background:#f6f8fa}.btn.primary{background:var(--blue);border-color:var(--blue);color:#fff}.btn.primary:hover{background:#0e5ba9}
    .btn.soft{background:var(--blue2);border-color:#cfe4fa;color:#155b98}.btn.danger{color:var(--red);border-color:#efcaca;background:#fff7f7}
    .toolbar-right{display:flex;gap:7px;align-items:center;margin-left:auto}
    .table-meta{padding:10px 14px;color:var(--muted);font-size:11px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line)}
    .table-wrap{overflow:auto}
    table{width:100%;border-collapse:collapse;min-width:950px}
    th,td{padding:10px 11px;border-bottom:1px solid #edf0f4;text-align:left;vertical-align:middle;white-space:nowrap}
    th{background:#f8fafc;color:#637083;font-size:10px;text-transform:uppercase;letter-spacing:.02em;font-weight:700;position:sticky;top:0;z-index:1}
    td{font-size:12px}.num{text-align:right}.code{font-family:Consolas,monospace;font-size:11px}
    tbody tr:hover{background:#fbfdff}.primary-text{font-weight:600}.secondary{display:block;color:var(--muted);font-size:10px;margin-top:2px}
    .tag{display:inline-flex;align-items:center;border-radius:20px;padding:4px 8px;font-size:10px;font-weight:700}
    .tag.matched{background:var(--greenBg);color:var(--green)}.tag.multiple{background:var(--orangeBg);color:var(--orange)}
    .tag.unmatched{background:var(--redBg);color:var(--red)}.tag.excluded{background:var(--grayBg);color:#687588}
    .row-action{border:0;background:transparent;color:var(--blue);font-size:11px;font-weight:700;padding:3px 0}.row-action:hover{text-decoration:underline}
    .pager{display:flex;justify-content:flex-end;align-items:center;gap:5px;padding:11px 14px}
    .pager button{height:28px;min-width:28px;border:1px solid #d8dfe8;background:#fff;border-radius:5px}.pager button.active{background:var(--blue);color:#fff;border-color:var(--blue)}
    .pager span{font-size:11px;color:var(--muted);margin:0 5px}
    .empty{padding:38px 20px;text-align:center;color:var(--muted)}.empty strong{display:block;color:#4d5a6c;margin-bottom:5px}.empty-link{padding:12px 10px;font-size:11px}.invoice-items-table th:nth-child(1),.invoice-items-table td:nth-child(1){position:sticky;left:0;z-index:2;min-width:44px;width:44px;background:#fff}.invoice-items-table th:nth-child(2),.invoice-items-table td:nth-child(2){position:sticky;left:44px;z-index:2;min-width:90px;width:90px;background:#fff}.invoice-items-table th:nth-child(3),.invoice-items-table td:nth-child(3){position:sticky;left:134px;z-index:2;min-width:260px;width:260px;background:#fff}.invoice-items-table thead th:nth-child(-n+3){z-index:3;background:#f7f9fb}.invoice-items-table tbody tr:hover td:nth-child(-n+3){background:#fff}.invoice-items-table th:nth-child(3),.invoice-items-table td:nth-child(3){box-shadow:2px 0 4px rgba(20,40,60,.08)}
    .detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:14px}.detail-card{border:1px solid var(--line);border-radius:8px;padding:14px}
    .detail-card h3{margin:0 0 10px;font-size:13px}.kv{display:grid;grid-template-columns:145px 1fr;gap:7px;font-size:11px}.kv span:nth-child(odd){color:var(--muted)}
    .reconcile-layout{display:grid;grid-template-columns:1.15fr .85fr;gap:14px}.process-box{padding:15px}
    .process-steps{display:flex;gap:0;margin:4px 0 16px}.step{flex:1;text-align:center;position:relative;font-size:10px;color:#8390a0}
    .step:after{content:"";position:absolute;left:50%;right:-50%;top:10px;height:1px;background:#dfe5ec;z-index:0}.step:last-child:after{display:none}
    .step-dot{position:relative;z-index:1;width:21px;height:21px;border-radius:50%;background:#e9edf2;color:#6c7887;display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:700}
    .step.active .step-dot{background:var(--blue);color:#fff}.step.active{color:var(--blue);font-weight:700}
    .result{border:1px solid var(--line);border-radius:8px;padding:14px;background:#fbfcfd;min-height:80px}
    .reconcile-guide{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:14px}.reconcile-rule{display:flex;gap:10px;align-items:flex-start;border:1px solid var(--line);border-radius:8px;padding:12px;background:#fff}.reconcile-rule.active{border-color:#cfe4fa;background:#fbfdff}.reconcile-rule{width:100%;text-align:left;cursor:pointer}.reconcile-rule:hover{border-color:#b9d5f2;background:#f9fcff}.reconcile-rule em{display:block;color:#0b6fc9;font-style:normal;font-size:10px;margin-top:6px;font-weight:700}.rule-no{width:25px;height:25px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#edf1f5;color:#6b7788;font-weight:700;flex:0 0 25px}.reconcile-rule.active .rule-no{background:var(--blue);color:#fff}.reconcile-rule b{display:block;font-size:12px}.reconcile-rule span{display:block;color:var(--muted);font-size:10px;line-height:15px;margin-top:3px}.reconcile-summary{min-height:0}.result-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:12px}.result-head b{display:block;font-size:13px}.result-head span{display:block;color:var(--muted);font-size:10px;margin-top:3px}.result-time{white-space:nowrap}.result-cards{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}.result-cards>button{border:1px solid var(--line);border-radius:7px;padding:10px;background:#fff;text-align:left;cursor:pointer}.result-cards>button:hover{border-color:#b9d5f2;background:#f9fcff}.result-cards b{display:block;font-size:18px}.result-cards span{display:block;color:var(--muted);font-size:10px;margin-top:2px}.result-warning{margin-top:10px;padding:9px 10px;border-radius:7px;background:var(--redBg);color:var(--red);font-size:11px}.loading-inline{color:var(--muted);font-size:11px}.more-btn{width:28px;height:28px;margin-left:7px;border:1px solid #d8dfe8;border-radius:6px;background:#fff;color:#44556a;font-size:18px;line-height:20px}.more-btn:hover{background:#f4f8fc;border-color:#b9d5f2}.mini-badge{display:inline-flex;align-items:center;border-radius:12px;padding:3px 7px;font-size:10px;font-weight:700;margin-right:5px}.mini-badge.goods{background:var(--greenBg);color:var(--green)}.mini-badge.expense{background:#eaf2ff;color:#1769aa}.mini-badge.branch{background:#fff3cd;color:#9a6700}.mini-badge.other{background:#f0e8ff;color:#6b3bb5}.mini-badge.locked{background:var(--orangeBg);color:var(--orange)}.action-panel{display:flex;flex-direction:column;gap:9px}.action-row{display:flex;align-items:center;justify-content:space-between;gap:15px;border:1px solid var(--line);border-radius:8px;padding:12px}.action-row b{display:block;font-size:12px}.action-row span{display:block;color:var(--muted);font-size:10px;margin-top:3px}.switch-row{display:flex!important;align-items:center;gap:6px;white-space:nowrap!important;color:#344255!important}.action-sub{border:1px dashed #cfd8e4;border-radius:8px;padding:10px}.saved-note{padding:10px;border-radius:7px;background:var(--greenBg);color:var(--green);font-size:11px;font-weight:600}.manual-head{display:flex;justify-content:space-between;gap:15px;align-items:center;border-bottom:1px solid var(--line);padding-bottom:12px}.manual-head>b,.manual-head span{display:block}.manual-head span{color:var(--muted);font-size:10px;margin-top:4px}.manual-total{text-align:right}.manual-total b{display:block;font-size:18px}.manual-total span{font-size:10px}.candidate-table{margin-top:12px;border:1px solid var(--line);border-radius:8px;overflow:auto}.candidate-table table{min-width:980px}.candidate-table th{position:sticky;top:0}.manual-totalbar{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:10px;padding:10px;border-radius:7px;background:#f7f9fb;color:#566274;font-size:10px}.manual-totalbar b{color:#1e3044;font-size:11px}.manual-filterbar{display:flex;justify-content:flex-end;gap:8px;align-items:center;margin:10px 0 8px}.manual-filterbar select,.manual-ncc-selector select{height:34px;border:1px solid #cbd6e2;border-radius:6px;padding:0 9px;background:#fff;color:#23344a;font-size:11px}
    .report-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:14px}.report-card{border:1px solid var(--line);border-radius:8px;padding:15px}
    .report-card b{display:block;font-size:12px}.report-card span{display:block;color:var(--muted);font-size:11px;margin-top:6px;line-height:17px}
    .toast{position:fixed;right:20px;bottom:20px;background:#1c2b3c;color:#fff;padding:10px 13px;border-radius:7px;box-shadow:0 6px 22px rgba(0,0,0,.2);font-size:12px;display:none;z-index:100;max-width:420px}
    .modal-backdrop{position:fixed;inset:0;background:rgba(12,28,45,.42);display:none;align-items:center;justify-content:center;z-index:50}
    .modal{width:min(720px,calc(100% - 30px));max-height:85vh;overflow:auto;background:#fff;border-radius:10px;box-shadow:0 18px 50px rgba(0,0,0,.22)}.modal.invoice-detail-modal{width:min(1350px,calc(100% - 32px));max-height:92vh}
    /* Desktop detail modal: wider for 19/21-inch screens; mobile rules below still override it. */
    .modal.detail-view-modal{width:min(1180px,calc(100% - 40px));max-height:88vh}
    .modal.detail-view-modal .modal-body{padding:18px 20px}
    .modal.detail-view-modal .detail-grid{gap:16px}
    .modal.detail-view-modal .detail-card{padding:16px}
    .modal.detail-view-modal .detail-card h3{font-size:14px;margin-bottom:11px}
    .modal.detail-view-modal .kv{grid-template-columns:155px minmax(0,1fr);font-size:12px;gap:8px}
    .modal.detail-view-modal .table-wrap{max-height:52vh;overflow:auto}
    .modal.detail-view-modal .table-wrap table{min-width:1040px}
    .modal.detail-view-modal .table-wrap th,.modal.detail-view-modal .table-wrap td{padding:9px 10px}

    .modal.modal-wide{width:min(1400px,calc(100% - 28px));max-height:90vh}.modal.cross-mst-modal{width:min(1500px,calc(100% - 36px));max-height:84vh}.modal.cross-mst-modal .modal-body{padding:18px 20px}.modal.cross-mst-modal .candidate-table{max-height:46vh;overflow:auto}.modal.cross-mst-modal .candidate-table table{min-width:1200px}.modal.cross-mst-modal .detail-card{margin-bottom:4px}.modal.cross-mst-modal .manual-totalbar{font-size:11px}.modal.cross-mst-modal .action-sub{margin-top:4px}.modal.pn-manual-modal{width:min(1450px,calc(100% - 28px));max-height:92vh;overflow:hidden;display:flex;flex-direction:column}.modal.pn-manual-modal .modal-body{overflow:hidden;display:flex;flex-direction:column;min-height:0}.modal.pn-manual-modal #pnInvoiceCandidateArea{display:flex;flex-direction:column;min-height:0;overflow:hidden}.pn-invoice-table{max-height:45vh;overflow:auto}.pn-invoice-table table{min-width:1180px}.pn-invoice-table th,.pn-invoice-table td{padding:7px 8px}.cross-mst-badge{background:#fff3cd;color:#9a6700}.same-mst-badge{background:var(--greenBg);color:var(--green)}.manual-cross-note{padding:10px;border-radius:8px;background:#fff8e1;border:1px solid #f1d58a;color:#7b5a00;font-size:11px;margin-top:10px}.pn-manual-head{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;border-bottom:1px solid var(--line);padding-bottom:12px}.pn-manual-head .manual-total{text-align:right}.pn-manual-actions{display:flex;gap:8px;align-items:center}.manual-ncc-selector{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:10px;padding:11px 12px;border:1px solid #cfe0f0;border-radius:8px;background:#f8fbfe}.manual-ncc-selector>div{min-width:0}.manual-ncc-selector b{display:block;font-size:12px}.manual-ncc-selector span{display:block;color:var(--muted);font-size:10px;line-height:15px;margin-top:3px}.manual-ncc-selector select{min-width:430px;max-width:55%;height:36px;border:1px solid #cbd6e2;border-radius:6px;padding:0 10px;background:#fff;color:#23344a}.manual-candidate-table{max-height:48vh}.manual-candidate-table table{min-width:1280px}.manual-candidate-table th,.manual-candidate-table td{white-space:nowrap}.manual-candidate-table th{background:#f7f9fb}.pick-candidate{padding:5px 9px;font-size:11px}
    .modal-head{padding:15px 17px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}
    .modal-head h3{margin:0;font-size:14px}.modal-body{padding:16px}.modal-foot{padding:12px 16px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:7px}
    .close{border:0;background:transparent;font-size:20px;color:#748094}.period-input{width:150px}
    .sync-final-result{margin-top:10px;padding:11px 12px;border:1px solid #dbe5ef;border-radius:8px;background:#fff}.sync-final-result>b{display:block;font-size:12px;margin-bottom:8px}.sync-final-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.sync-final-grid span{font-size:10px;color:#687588;padding:7px 8px;background:#f8fafc;border:1px solid #e5eaf0;border-radius:7px}.sync-final-grid b{display:block;color:#1f3044;font-size:12px;margin-top:2px}.sync-final-note{margin-top:8px;font-size:10px;color:#687588}.loading{opacity:.6;pointer-events:none}

    .auth-screen{position:fixed;inset:0;background:linear-gradient(135deg,#10243d,#183552);display:flex;align-items:center;justify-content:center;z-index:200}
    .auth-card{width:min(430px,calc(100% - 30px));background:#fff;border-radius:12px;padding:26px;box-shadow:0 20px 70px rgba(0,0,0,.28)}
    .auth-brand{display:flex;align-items:center;gap:12px;margin-bottom:20px}.auth-brand .brand-mark{background:#fff}
    .auth-card h2{margin:0;font-size:20px}.auth-card p{color:var(--muted);font-size:12px;margin:5px 0 18px}.auth-label{display:block;font-size:11px;font-weight:700;color:#566274;margin:12px 0 6px}
    .auth-card input{width:100%;height:40px}.auth-card .btn{width:100%;height:40px;margin-top:16px}.auth-note{margin-top:12px;padding:9px 10px;background:#f6f8fa;border-radius:7px;font-size:11px;color:#687588;line-height:16px}
    .auth-error{margin-top:10px;color:#c53636;font-size:11px;min-height:16px}.context-bar{display:flex;align-items:center;gap:8px;margin-right:14px}.context-label{font-size:10px;color:var(--muted)}.context-value{font-size:11px;font-weight:700;color:#23354a}.scope-select{height:31px;min-width:220px}.user-actions{display:flex;align-items:center;gap:8px}.logout-btn{height:31px}
    .hidden{display:none!important}.scope-chip{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;background:#eef6ff;border:1px solid #d3e7fb;border-radius:20px;color:#155b98;font-size:10px;font-weight:700}
    .login-required .app{display:none}
    .date-filter{position:relative;display:inline-block}.date-filter-main{display:flex;align-items:center;gap:6px}.date-filter-main input[type=date]{width:145px;min-width:145px}.date-arrow{color:#8794a5;font-weight:600}.date-preset-btn{height:34px;border:1px solid #d8dfe8;border-radius:7px;background:#fff;color:#344255;padding:0 11px;font-size:11px;white-space:nowrap}.date-preset-btn:hover{border-color:#79acd9;background:#fbfdff}.date-popover{display:none;position:absolute;top:42px;left:0;width:350px;background:#fff;border:1px solid #d8dfe8;border-radius:10px;box-shadow:0 14px 36px rgba(20,42,70,.16);padding:12px;z-index:30}.date-popover.open{display:block}.date-popover-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}.date-popover-title{font-weight:700;font-size:12px}.date-year-select{height:30px;border:1px solid #d8dfe8;border-radius:6px;padding:0 8px;min-width:95px;font-size:11px}.date-preset-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-bottom:10px}.date-preset-grid button,.month-grid button{border:1px solid #e0e6ed;background:#fff;border-radius:6px;padding:7px 5px;font-size:10px;color:#344255}.date-preset-grid button:hover,.month-grid button:hover{border-color:#79acd9;background:#f5faff;color:#1268c4}.date-section-label{font-size:10px;color:#7a8798;margin:7px 0 6px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.month-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.month-grid button.active{background:#eaf4ff;border-color:#79acd9;color:#1268c4;font-weight:700}.date-popover-foot{display:flex;justify-content:flex-end;margin-top:10px}.date-clear-btn{border:0;background:transparent;color:#6b7788;font-size:10px;padding:4px 6px}.date-clear-btn:hover{color:#1268c4}.status-tag-cell{white-space:nowrap}.tag.unmatched{background:var(--redBg);color:var(--red)}.tag.multiple{background:var(--orangeBg);color:var(--orange)}.tag.matched{background:var(--greenBg);color:var(--green)}.tag.excluded{background:var(--grayBg);color:#657387}


/* =========================================================
   DESKTOP TABLE POLISH V9
   Keep mobile responsive/card rules unchanged.
   At >=1200px, MISA tables use the available content width
   instead of forcing a 1450/1700px table, so the final
   Status/Action columns remain visible on 19/21-inch screens.
   ========================================================= */
@media (min-width:1200px){
  .mobile-misa-table,
  .mobile-misa-issue-table{
    width:100% !important;
    min-width:100% !important;
    max-width:100% !important;
    table-layout:fixed;
  }

  .mobile-misa-table th,
  .mobile-misa-table td,
  .mobile-misa-issue-table th,
  .mobile-misa-issue-table td{
    box-sizing:border-box;
    padding-left:8px;
    padding-right:8px;
  }

  /* Compact identity columns */
  .mobile-misa-table th:nth-child(1),
  .mobile-misa-table td:nth-child(1),
  .mobile-misa-issue-table th:nth-child(1),
  .mobile-misa-issue-table td:nth-child(1){width:8.5%;}

  .mobile-misa-table th:nth-child(2),
  .mobile-misa-table td:nth-child(2),
  .mobile-misa-issue-table th:nth-child(2),
  .mobile-misa-issue-table td:nth-child(2){width:9.5%;}

  .mobile-misa-table th:nth-child(3),
  .mobile-misa-table td:nth-child(3),
  .mobile-misa-issue-table th:nth-child(3),
  .mobile-misa-issue-table td:nth-child(3){width:9%;}

  .mobile-misa-table th:nth-child(4),
  .mobile-misa-table td:nth-child(4),
  .mobile-misa-issue-table th:nth-child(4),
  .mobile-misa-issue-table td:nth-child(4){width:6%;}

  .mobile-misa-table th:nth-child(5),
  .mobile-misa-table td:nth-child(5),
  .mobile-misa-issue-table th:nth-child(5),
  .mobile-misa-issue-table td:nth-child(5){width:7%;}

  /* Supplier is the flexible column */
  .mobile-misa-table th:nth-child(6),
  .mobile-misa-table td:nth-child(6),
  .mobile-misa-issue-table th:nth-child(6),
  .mobile-misa-issue-table td:nth-child(6){
    width:auto;
    white-space:normal;
    overflow-wrap:anywhere;
  }

  /* Amount columns */
  .mobile-misa-table th:nth-child(7),
  .mobile-misa-table td:nth-child(7),
  .mobile-misa-issue-table th:nth-child(7),
  .mobile-misa-issue-table td:nth-child(7){width:8%;}

  .mobile-misa-table th:nth-child(8),
  .mobile-misa-table td:nth-child(8),
  .mobile-misa-issue-table th:nth-child(8),
  .mobile-misa-issue-table td:nth-child(8){width:6%;}

  .mobile-misa-table th:nth-child(9),
  .mobile-misa-table td:nth-child(9),
  .mobile-misa-issue-table th:nth-child(9),
  .mobile-misa-issue-table td:nth-child(9){width:8%;}

  /* Always reserve enough room for status + action */
  .mobile-misa-table th:nth-child(10),
  .mobile-misa-table td:nth-child(10),
  .mobile-misa-issue-table th:nth-child(10),
  .mobile-misa-issue-table td:nth-child(10){
    width:8%;
    white-space:nowrap;
  }

  .mobile-misa-table th:nth-child(11),
  .mobile-misa-table td:nth-child(11),
  .mobile-misa-issue-table th:nth-child(11),
  .mobile-misa-issue-table td:nth-child(11){
    width:10%;
    min-width:92px;
    white-space:nowrap;
  }

  .mobile-misa-table td:nth-child(11) .btn,
  .mobile-misa-issue-table td:nth-child(11) .btn{
    white-space:nowrap;
    max-width:100%;
  }
}
